Simulate audio for webrtc

1,073 views
Skip to first unread message

vosybac

unread,
May 31, 2012, 6:18:17 AM5/31/12
to discuss-webrtc
Hi,

In webrtc, is it possible to set audio data from audio file (*.wav)
instead of user's voice ?

Bac

Punyabrata Ray

unread,
May 31, 2012, 12:29:36 PM5/31/12
to discuss...@googlegroups.com
Hi Bac,
This is currently not supported today.
-pr

Randell Jesup

unread,
May 31, 2012, 5:56:09 PM5/31/12
to discuss...@googlegroups.com
On 5/31/2012 12:29 PM, Punyabrata Ray wrote:
Hi Bac,
This is currently not supported today.
-pr

You could leverage the 'fake_video' input code for testing video to inject audio.

If you can build a MediaStream with input from a file, then you could supply it instead of a getUserMedia() stream.

-- 
Randell Jesup
randel...@jesup.org

Bac Vo Sy

unread,
Jun 1, 2012, 2:49:20 AM6/1/12
to discuss...@googlegroups.com
Thanks,

Currently I used a  VoiceEngine and VoEFile to play file as microphone, however it doesn't work.


On Fri, Jun 1, 2012 at 4:56 AM, Randell Jesup <rand...@jesup.org> wrote:
On 5/31/2012 12:29 PM, Punyabrata Ray wrote:
Hi Bac,
This is currently not supported today.
-pr

You could leverage the 'fake_video' input code for testing video to inject audio.

Could you please tell me where is the code ?
 

If you can build a MediaStream with input from a file, then you could supply it instead of a getUserMedia() stream.

-- 
Randell Jesup
randel...@jesup.org

Bac

pablo platt

unread,
Jun 1, 2012, 5:29:48 AM6/1/12
to discuss...@googlegroups.com

vosybac

unread,
Jun 6, 2012, 5:17:26 AM6/6/12
to discuss-webrtc
Hi,

I have followed this unit test to inject fake_audio_capture_module
into audio track, and register a webrtc::AudioTransport callback to
write audio data into local file but it doesn't work.
http://libjingle.googlecode.com/svn/trunk/talk/app/webrtc/peerconnection_unittest.cc

Any help ?

Bac


On 1 Tháng Sáu, 16:29, pablo platt <pablo.pl...@gmail.com> wrote:
> I also tried using webcamstudio but couldn't make it work:http://code.google.com/p/webrtc/issues/detail?id=250&colspec=ID%20Pri...
>
> On Fri, Jun 1, 2012 at 9:49 AM, Bac Vo Sy <vosy...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Thanks,
>
> > Currently I used a  VoiceEngine and VoEFile to play file as microphone,
> > however it doesn't work.
>
> > On Fri, Jun 1, 2012 at 4:56 AM, Randell Jesup <rande...@jesup.org> wrote:
>
> >>  On 5/31/2012 12:29 PM, Punyabrata Ray wrote:
>
> >> Hi Bac,
> >> This is currently not supported today.
> >> -pr
>
> >> You could leverage the 'fake_video' input code for testing video to
> >> inject audio.
>
> > Could you please tell me where is the code ?
>
> >> If you can build a MediaStream with input from a file, then you could
> >> supply it instead of a getUserMedia() stream.
>
> >> --
> >> Randell Jesuprandell-i...@jesup.org
>
> > Bac

Kaushal Ambani

unread,
Aug 6, 2013, 8:11:18 PM8/6/13
to discuss...@googlegroups.com, vos...@gmail.com
Two possible Solutions. But both will play or record audio in the form of  rtpdump packets.

1.Replacing WebRTC media engine with FileMediaEngine. FileMediaEngine gives you option of specifying an input audio file to play from as well as output file to record the audio. Check out the trunk/talk/media/base/filemediaengine.h. The exact place to inject this filemediaengine is in PeerConnectionFactory::Initialize_s() method just before ChannelManager is initialized.

2. Another option is to replace the webTRC voice engine with the fakewebrtcvoiceengine (look  trunk/talk/media/webrtc/fakewebrtcvoiceengine.h).

I would prefer first one. Mind well both solutions record audio in the form of RTP dump.

Cheers !!

Dan Oreilly

unread,
Aug 8, 2013, 3:57:33 AM8/8/13
to discuss...@googlegroups.com, vos...@gmail.com
Kaushal, is that a component of the webrtc stack (i.e available on Chrome or Firefox)? FileMediaEngine seems to be part of libjingle.
I am looking for a similar solution to allow sending pre-recorded voice (wav or rtp dump) through the webrtc stack to another webrtc end-point and then record it locally on the receiver end.
I'd like to do that using javascript so any webrtc browser can do it.

Kaushal Ambani

unread,
Aug 8, 2013, 10:08:53 PM8/8/13
to discuss...@googlegroups.com, vos...@gmail.com
Dan,

Yes its a part of libjingle. For your problem you can have look at the core voice engine, especially the component VoEFile (see voe_file.h). Here is the link that explains its functionality http://www.webrtc.org/reference/webrtc-internals/voefile
After that you should look at the webrtcVoiceEngine (trunk\talk\media\webrtc\) and see how it uses this core voice engine (See webrtcvoe.h).

But I have not tried it as my problem didn't require it. Also I am not sure that this will surely work, it just looks like plausible solution to me.



cheers !!
Reply all
Reply to author
Forward
0 new messages