add window emitters and stuff

This commit is contained in:
Enrique Hernandez 2021-02-04 20:23:34 -06:00
commit 29dc7de3e4
7 changed files with 160 additions and 126 deletions

View file

@ -1,29 +1,25 @@
"use strict";
import {initApp} from './background/initApp';
import {Recorder} from './background/recorder';
var portAudio = require('naudiodon');
/*
* Entry point for Crimata electron app.
* "Look on my Works, ye Mighty, and despair!"
*/
"use strict";
import { protocol } from "electron";
import { initApp } from './background/initApp';
// Scheme must be registered before the app is ready
protocol.registerSchemesAsPrivileged([
{ scheme: "app", privileges: { secure: true, standard: true } }
]);
// Load environment variable
const isDevelopment = process.env.NODE_ENV !== "production";
// 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);
}
console.log('Starting Crimata electron app.');
initApp(isDevelopment);
})();