--- /dev/null
+PID 335844 received SIGSEGV for address: 0xc
+/home/enrique/Developer/electron-app/node_modules/segfault-handler/build/Release/segfault-handler.node(+0x37a5)[0x7f1c071387a5]
+/lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7f1c10ffa3c0]
+/home/enrique/Developer/electron-app/node_modules/electron/dist/electron dist_electron(+0x72d9550)[0x55ccd61fe550]
// NOTE Program Begins Here
(async () => {
+ console.log(portAudio.getDevices())
const isDevelopment = process.env.NODE_ENV !== "production";
- const recorder = new Recorder({
- channelCount: 1,
- sampleFormat: portAudio.SampleFormat16Bit,
- sampleRate: 16000,
- deviceId: -1, // Use -1 or omit the deviceId to select the default device
- closeOnError: true
- }, 'binary');
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) {
pause(): void;
}
+type inputOptions = {
+ channelCount: number,
+ sampleFormat: number,
+ sampleRate: number,
+ deviceId: number,
+ closeOnError: boolean
+}
+
class StringWritable extends Writable {
constructor(options: {
}
}
-type inputOptions = {clear
-
- channelCount: number,
- sampleFormat: string,
- sampleRate: number,
- deviceId: number,
- closeOnError: boolean
-}
-
export class Recorder implements RecorderI {
private ia: any;
private _update = (Event: any, record: boolean) => {
if (record) {
- console.log('recording');
- this.micWritable.data = '';
- if(this.ia._readableState.paused){
- this.resume();
- return;
- }
- this.ia.pipe(this.micWritable);
-
- console.log(this.ia._readableState.paused);
+ // check for stream status
+ console.log('recording')
+
+
+ // this.ia.pipe(this.micWritable);
} else {
- console.log('stop recording');
- this.ia.unpipe(this.micWritable);
- this.micWritable.on('finish', () => {
- console.log('hello');
- })
+ console.log('stop recording')
+ // unpipe
+ // this.ia.unpipe(this.micWritable);
+
+ // stop stream
+ // this.ia.quit();
+ // this.ia = null;
+
+ // get stream data
+ // this.micWritable.on('finish', () => {
+ // console.log('finished writing data');
+ // })
+ // this.restart();
}
}
}