AudioNet / node-core-audio

Bindings for PortAudio giving JavaScript access to sound card samples (mostly unmaintained)
MIT License
330 stars 68 forks source link

Given examples #64

Open perguth opened 8 years ago

perguth commented 8 years ago

I run MacOS 10.11.5. Regarding the given examples I would like to know if they should work out of the box and what the expected audio output should be. Maybe I have interpreted the examples wrongly but the following code should produce no hearable output (or even silence the system if music is running) but actually results in "tr-tr-tr-tr-..." noises coming out of the speakers that get louder over time.

var coreAudio = require('node-core-audio')
var engine = coreAudio.createNewAudioEngine()

engine.addAudioCallback(processAudio)

function processAudio (buffer) {
  console.log('%d channels', buffer.length)
  console.log('Channel 0 has %d samples', buffer[0].length)

  for (var sample = 0; sample < buffer[0].length; sample++) {
    buffer[0][sample] = 0.0
  }

  return buffer
}
aromeronavia commented 7 years ago

Check out the #26.

I copy/pasted the code and the 'tr tr tr' sound is gone (THANKS FUCKING GOD) haha. You can continue your experiments Mr.