Page 1 of 1

Audio extraction

Posted: 14 Dec 2009 17:26
by nimport nawak
I woul like to play a sound from the network (RTP) and be able to use some voice recognition algorithm. Are they any way to reach the audio buffer in libvlc just like with Vmem for the video ?
thanks

Re: Audio extraction

Posted: 14 Dec 2009 18:49
by Rémi Denis-Courmont
There is smem to get data out of the stream output, or the file audio output to write samples to a pipe.

Re: Audio extraction

Posted: 14 Dec 2009 19:52
by nimport nawak
thanks for the reply, i'm going to search how i can use it

Re: Audio extraction

Posted: 15 Dec 2009 01:04
by nimport nawak
So I just found that smem was in vlc 1.1.0 and the audio part was still not here so i wait and see

Re: Audio extraction

Posted: 15 Dec 2009 16:11
by Rémi Denis-Courmont
Duh? the audio file output has been there for at least 7 years.

Re: Audio extraction

Posted: 07 Apr 2010 10:03
by wetneb
So maybe the header of smem.c should be updated :

Code: Select all

/***************************************************************************** * How to use it ***************************************************************************** * * You should use this module in combination with the transcode module, to get * raw datas from it. This module does not make any conversion at all, so you * need to use the transcode module for this purpose. * * For example, you can use smem as it : * --sout="#transcode{vcodec=RV24,acodec=s16l}:smem{smem-options}" * * Into each lock function (audio and video), you will have all the informations * you need to allocate a buffer, so that this module will copy data in it. * * the video-data and audio-data pointers will be passed to lock/unlock function * * For now, audio is NOT IMPLEMENTED. * ******************************************************************************/
After a dive into VLC's headers, I've got a few questions about this module :

I don't understand how callbacks (prerender and postrender) are working in this module. I suppose they must be defined in the parameters, but how should they be named ? I can't put the names of my C++ functions as raw strings in the parameters, isn't it ? And how can I know which parameters will be passed to my callbacks (their types and their meanings) ?
The last noob question : the header refers to some lock functions : where are they defined ?

Thanks :) !

Re: Audio extraction

Posted: 10 Apr 2010 21:53
by wetneb
No answer ?
It seems that this module has been implemented a long time ago, despite some recent improvements on it. There's no documentation at all about this. Maybe I should send a message to the author(s) of this module, and they would help me to understand its behaviour, so I could write down some explanations or a tutorial. Does anyone knows who did write this code ? It must have been done before the project switched to Git, since I can't find the commit in the log.
I think many people are interrested in using this functionnality, but it's quite hard to find informations about it.

Re: Audio extraction

Posted: 10 Feb 2011 09:57
by ian168
Hi all,
I used the smem well in my VC++ project on windows,but cannot work in ios.
Does any one know why smem cannot work in ios??
i built the source code of MobileVLC from http://git.videolan.org/?p=MobileVLC.git;a=summary,the latest version i used.
Or smem cannot work in ios system?

Does smem work well in ios platform?

Posted: 10 Feb 2011 10:04
by ian168
In order to get the RTSP video and audio stream raw data,i used the vlc 1.1.5 library on windows,i worked well.
I have tried vmem and smem in my VC++ project and both can work well,and then i tried to implement in iphone.
I built the source code of MobileVLC from http://git.videolan.org/?p=MobileVLC.git;a=summary the latest version,
but smem cannot in ios platform.......Does any one know why smem cannot work in ios?

Re: Audio extraction

Posted: 10 Feb 2011 20:05
by wetneb
Could you describe your problem more accurately ? Do you get errors at compile or run time ?