AudioNet / node-core-audio

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

Audio glitches during playback #26

Open ZECTBynmo opened 10 years ago

ZECTBynmo commented 10 years ago

This issue was reported by @Cactusbone inside of this issue https://github.com/ZECTBynmo/node-core-audio/issues/24

Reproduction steps:

Code reproducing issue

https://gist.github.com/Cactusbone/1aea1635f34869b13e30

Platform

Windows 7 64bit

Description

same twitchy sound in vista 64bit with an integrated sigmatel. i'll try using a real soundcard.

I've just noticed sound is far greater (not crystal clear but not too bad) when i set interleaved to true.

ok after more tests, with inputChannels set to 1 and outputChannels set to 1, (interleaved true of false does not matter) the sound is crystal clear. with inputChannels to 2 and ouputChannels to 1, i get some glitches (but not many) interleaved = true slows down music (as expected), but whenever outputChannels is set to 2, i have load of glitches.

luke-j commented 8 years ago

I have this same issue on OSX. Simply returning the inputBuffer either results in screeching, glitching sounds, or in total silence, depending on the settings. See code below.

var engine = require("node-core-audio").createNewAudioEngine();

var options = {
    inputChannels: 1,
    outputChannels: 1
};

engine.setOptions(options);

engine.addAudioCallback(function (inputBuffer) {
    return inputBuffer;
});

Is there anyway at this point to simply capture audio clearly coming from the sound card?

martinjms commented 7 years ago

just doing this worked for me in OSX var options = { outputChannels: 1 };