Page 1 of 1

Feed an audio stream into chromium

PostPosted: Wed Jan 20, 2021 4:55 am
by zyfan
I'm working on a project and need to get chromium audio output data and to feed audio stream back in chromium.
In CEF there is already an AudioHandler API, audio output data can be accessed through this API, which is great.
I was wondering how could I feed audio stream in? Is it possible to implement such a feature?

Re: Feed an audio stream into chromium

PostPosted: Wed Jan 20, 2021 1:45 pm
by magreenblatt
What are you intending to do with the audio stream that you feed back in?

Re: Feed an audio stream into chromium

PostPosted: Wed Jan 20, 2021 9:21 pm
by zyfan
I would like to bridge the audio io between webpage and a softphone/softswitch system, in an unobtrusive manner. And CEF seems to be a good way to handle this. Not sure about the difficulty of adding such features to CEF. Is there any plan to do this for CEF development team? Or could you please give me some guidance? like the where should I start, etc.
Many thanks.

Re: Feed an audio stream into chromium

PostPosted: Wed Jan 20, 2021 9:28 pm
by magreenblatt
You could encode the response as an audio file and feed it back into the browser using standard APIs like Web Audio.

Re: Feed an audio stream into chromium

PostPosted: Wed Jan 20, 2021 10:35 pm
by zyfan
Thank you for the rapid reply.
In my case, both audio input and audio output of chromium are realtime streams, it would be impossible for realtime communication if I encode the response as an audio file then feed in. And I can't modify the webpage which the softswitch is bridged with, that's why an unobtrusive way is needed.

Re: Feed an audio stream into chromium

PostPosted: Thu Jan 21, 2021 9:17 pm
by zyfan
I'm not so much familiar with the audio system of chromium, so it would be great if you could give me some pointers? Such like where should I start with if I give it a try to implement the feed in api myself.

Thank you so much.