[gst-devel] Play a list of ogg
Crevetolog
bellon.pierre at gmail.com
Sun Mar 7 15:05:56 CET 2010
Hi, I search a way to play a list of indexed ogg with gst-launch (in fact
it's in a code).
I'm developing an addin for tomboy which add voice notes to tomboy, it's
working with gstreamer but I'm trying to add a new functionality which need
to read indexed ogg files in order, one by one, like that :
"play(name_of_the_note.0.ogg) -> playing over ->
play(name_of_the_note.1.ogg) -> etc..."
I have a function "Play(filePath)" which works but if I do a for() loop for
all the voice notes, that play all ogg together so I searched in gstreamer
plugins list a way to do what I want but didn't find.
I tried to use Threads in C# but didn't worked.
I saw the plugin multifilesrc which read indexed files but I didn't find
other than PNG images examples with that, no example with sound files or
other.
I would like to know if there is a way with gst-launch (the command line
tool) to play a list of file one by one.
Thanks.
My Play() function and the bus callback if someone is interested (it's in C#
using Gstreamer-sharp):
public void Play(string filePath)
{
int status = GetState();
/*
* get the state of the pipeline
* 0 : null
* 1 : playing
* 2 : Paused
*/
if(status == 2)
{
pipeline.SetState(Gst.State.Playing);
}
else
{
string command = "filesrc location="+filePath+" ! oggdemux ! vorbisdec !
audioconvert ! gconfaudiosink";
pipeline = Gst.Parse.Launch(command);
SetBusCallback();
pipeline.SetState(Gst.State.Playing);
}
}
private bool BusCallback(Gst.Bus bus,Gst.Message message)
{
switch (message.Type)
{
case Gst.MessageType.Eos:
status = Gst.State.Ready;
pipeline.SetState(status);
break;
case Gst.MessageType.Error:
status = Gst.State.Null;
pipeline.SetState(status);
break;
default:
break;
}
return true;
}
PS: sorry for my english if I made some mistakes.
--
View this message in context: http://n4.nabble.com/Play-a-list-of-ogg-tp1583564p1583564.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list