clean up codebase, remove unused directories

This commit is contained in:
riqo 2021-02-03 08:50:55 -06:00
commit a5b6837623
9 changed files with 8 additions and 1413 deletions

View file

@ -16,15 +16,16 @@ const ws = new WebSocket("ws://localhost:8080");
let audioChunks = [];
const audioInputStreamTransform = new Writable({
write(chunk, encoding, next) {
// console.log(chunk)
console.log(chunk)
// ws send chunk
audioChunks.push(chunk);
// audioChunks.push(chunk);
// ws.send(chunk)
next();
},
final() {
console.log(audioChunks)
ws.send(audioChunks)
// ws.send("stop")
// stop ws transer
},
});
@ -38,7 +39,7 @@ const client = new speech.SpeechClient();
*/
const filename = './rawAudio.wav';
const encoding = 'LINEAR16';
const sampleRateHertz = 16000;
const sampleRateHertz = 44100;
const languageCode = 'en-US';
const config = {
@ -90,7 +91,7 @@ const recognizeStream = client
// Create an instance of AudioIO with inOptions (defaults are as below), which will return a ReadableStream
const audioOptions = {
channelCount: 2,
channelCount: 1,
sampleFormat: portAudio.sampleFormat16Bit,
sampleRate: 16000,
deviceId: -1, // Use -1 or omit the deviceId to select the default device