refactor core into composables & components
This commit is contained in:
parent
3be7023792
commit
a84019da0d
37 changed files with 409 additions and 469 deletions
21
testAudio.js
Normal file
21
testAudio.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
const fs = require('fs');
|
||||
const portAudio = require('naudiodon');
|
||||
|
||||
// Create an instance of AudioIO with outOptions (defaults are as below), which will return a WritableStream
|
||||
const ao = new portAudio.AudioIO({
|
||||
outOptions: {
|
||||
channelCount: 2,
|
||||
sampleFormat: portAudio.SampleFormat16Bit,
|
||||
sampleRate: 48000,
|
||||
deviceId: -1, // Use -1 or omit the deviceId to select the default device
|
||||
closeOnError: true // Close the stream if an audio error is detected, if set false then just log the error
|
||||
}
|
||||
});
|
||||
|
||||
// Create a stream to pipe into the AudioOutput
|
||||
// Note that this does not strip the WAV header so a click will be heard at the beginning
|
||||
const rs = fs.createReadStream('rawAudio.wav');
|
||||
|
||||
// Start piping data and start streaming
|
||||
rs.pipe(ao);
|
||||
ao.start();
|
||||
Loading…
Reference in a new issue