AudioNet / node-core-audio

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

Setting sampleRate #51

Closed tambien closed 8 years ago

tambien commented 8 years ago

I'm having trouble setting the sampling rate of the audio input. My particular input only works at 48k:

audioEngine.setOptions({
    sampleRate : 48000,
    framesPerBuffer : BUFFER_SIZE,
    inputDevice : inputDevice,
    inputChannels : CHANNEL_COUNT,
    outputChannels : 1,
});

console.log(audioEngine.getOptions());

This is printed to the console:

{ inputChannels: 6,
  outputChannels: 1,
  inputDevice: 2,
  outputDevice: 1,
  sampleRate: 44100,
  sampleFormat: 1,
  framesPerBuffer: 2048,
  numBuffers: 8,
  interleaved: false,
  useMicrophone: true }

Maybe i'm overlooking something. Any help would be appreciated. Thanks!