Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capture, modify and then output audio in electron

I'm trying to capture, modify and finally output audio in node with Electron (Mac OSX). These are the steps:

  1. Capture the audio before it's output, possibly via CoreAudio.
  2. Modify the audio stream/buffer via the Web Audio API.
  3. Output the modified buffer to the sound device.

I've tried node-core-audio. However, the most I can achieve is a rapid glitching sound. Other than this a I haven't been able to find a good solution I/O of audio.

How can I achieve this without sacrificing sound quality?

like image 826
Adviov Avatar asked Jan 06 '16 08:01

Adviov


1 Answers

I'm not sure what you want to accomplish, but on MacOS, this is not yet possible. I came accross the problem of recording system sound on MacOS, and I found a solution. Finally! Using Soundflower and Javascript with electron, I finally could record system audio. Though it is not exactly what you want, I modified this audio stream by adding it with video stream from the System, then displayed it to the user. Here is my solution to the issue IN this detailed blog post I think it is better than posting all the long steps here on stackoverflow.

like image 61
John Code Avatar answered Sep 22 '22 14:09

John Code