hum, vorbisfile => oggdemux ! vorbisdec ! audioconvert

Original commit message from CVS:

hum, vorbisfile => oggdemux ! vorbisdec ! audioconvert
This commit is contained in:
Stéphane Loeuillet 2004-05-02 23:49:11 +00:00
parent 0b3089e537
commit ac27b7cdba
4 changed files with 16 additions and 8 deletions

View file

@ -104,7 +104,7 @@ eos (GstElement *src, gpointer data)
int
main (int argc, char *argv[])
{
GstElement *filesrc, *demuxer, *decoder, *audiosink;
GstElement *filesrc, *demuxer, *decoder, *audioconvert, *audiosink;
GstElement *thread;
if (argc < 2) {
@ -133,14 +133,18 @@ main (int argc, char *argv[])
decoder = gst_element_factory_make ("vorbisdec", "decoder");
g_assert (decoder != NULL);
/* create an audio converter */
converter = gst_element_factory_make ("audioconvert", "converter");
g_assert (decoder != NULL);
/* and an audio sink */
audiosink = gst_element_factory_make ("osssink", "play_audio");
g_assert (audiosink != NULL);
/* add objects to the thread */
gst_bin_add_many (GST_BIN (thread), filesrc, demuxer, decoder, audiosink, NULL);
gst_bin_add_many (GST_BIN (thread), filesrc, demuxer, decoder, converter, audiosink, NULL);
/* link them in the logical order */
gst_element_link_many (filesrc, demuxer, decoder, audiosink, NULL);
gst_element_link_many (filesrc, demuxer, decoder, converter, audiosink, NULL);
/* start playing */
gst_element_set_state (thread, GST_STATE_PLAYING);

View file

@ -104,7 +104,7 @@ eos (GstElement *src, gpointer data)
int
main (int argc, char *argv[])
{
GstElement *filesrc, *demuxer, *decoder, *audiosink;
GstElement *filesrc, *demuxer, *decoder, *audioconvert, *audiosink;
GstElement *thread;
if (argc < 2) {
@ -133,14 +133,18 @@ main (int argc, char *argv[])
decoder = gst_element_factory_make ("vorbisdec", "decoder");
g_assert (decoder != NULL);
/* create an audio converter */
converter = gst_element_factory_make ("audioconvert", "converter");
g_assert (decoder != NULL);
/* and an audio sink */
audiosink = gst_element_factory_make ("osssink", "play_audio");
g_assert (audiosink != NULL);
/* add objects to the thread */
gst_bin_add_many (GST_BIN (thread), filesrc, demuxer, decoder, audiosink, NULL);
gst_bin_add_many (GST_BIN (thread), filesrc, demuxer, decoder, converter, audiosink, NULL);
/* link them in the logical order */
gst_element_link_many (filesrc, demuxer, decoder, audiosink, NULL);
gst_element_link_many (filesrc, demuxer, decoder, converter, audiosink, NULL);
/* start playing */
gst_element_set_state (thread, GST_STATE_PLAYING);

View file

@ -35,7 +35,7 @@ Here we convert a Mp3 file into an Ogg Vorbis file:
And then we can play that file with:
gst-launch filesrc location=music.ogg ! oggdemux ! vorbisdec ! osssink
gst-launch filesrc location=music.ogg ! oggdemux ! vorbisdec ! audioconvert ! osssink
Some other useful pipelines are..
Plays wav files (currently there are no wav encoders):

View file

@ -224,7 +224,7 @@ Play the mp3 music file "music.mp3" using a libmad-based plug-in and
output to an OSS device
.B
gst\-launch filesrc location=music.ogg ! oggdemux ! vorbisdec ! osssink
gst\-launch filesrc location=music.ogg ! oggdemux ! vorbisdec ! audioconvert ! osssink
.br
Play an Ogg Vorbis format file