Background Audio and Microphone Streaming


#1

Dear Electron users,

As a project to learn more about node and electron, I’m creating a Google Assistant Desktop App in Electron using the new Google Assistant SDK v1alpha2.

I made quite some process and I’d say it’s nearly finished, right now I’m refactoring and making it ready for actual use. Right now everything is running in the renderer process and I am using browser technology for Audio Processing and Microphone Streaming to the API. I am wondering what the best practices are for the following things;

  • Listening to a specific keyboard shortcut to trigger the microphone to stream to the API
  • Play audio without the window actually showing

I want the ‘assistant’ to be available at all times, not only when the main window is open or when the user leaves the page. I was thinking to either move audio recording and playing to the app frame (main page for renderer) and hide this window whenever it is minimized or in the system tray. OR process the Audio & Microphone in the main process, but then it might slow down the application itself and not sure if I can access the microphone and speakers through the main process.

Also after all this works I want to implement hotword detection, so we need to listen to the microphone all the time.

What do you guys think? Any suggestions?