Revered the audio system back to PortAudio

This commit is contained in:
WolverinDEV
2020-02-13 22:16:34 +01:00
parent 91982ecc7b
commit 19b7e46137
21 changed files with 778 additions and 184 deletions
+3 -1
View File
@@ -63,7 +63,9 @@ namespace audio.player {
console.warn("Main audio underflow");
};
_audioContext = new AudioContext();
_audioContext = new AudioContext({
sampleRate: _output_stream.sample_rate
});
_processor = _audioContext.createScriptProcessor(1024 * 8, _output_stream.channels, _output_stream.channels);
_processor.onaudioprocess = function(event) {
+2
View File
@@ -10,6 +10,7 @@ export namespace _audio.recorder {
interface NativeDevice extends InputDevice {
device_index: number;
native: any;
}
let _device_cache: NativeDevice[] = undefined;
@@ -26,6 +27,7 @@ export namespace _audio.recorder {
name: e.name,
driver: e.driver,
sample_rate: 48000, /* TODO! */
native: e
} as NativeDevice
}));
}