mime-chat/src/background.ts
2021-02-04 12:34:33 -06:00

29 lines
712 B
TypeScript

"use strict";
import {initApp} from './background/initApp';
import {Recorder} from './background/recorder';
var portAudio = require('naudiodon');
// NOTE Program Begins Here
(async () => {
console.log(portAudio.getDevices())
const isDevelopment = process.env.NODE_ENV !== "production";
try {
const recorder = new Recorder({
channelCount: 1,
sampleFormat: 16,
sampleRate: 16000,
deviceId: 24, // Use -1 or omit the deviceId to select the default device
closeOnError: true
}, 'binary');
// await authenticate method
initApp(isDevelopment);
} catch (e) {
console.log("Error", e);
}
})();