mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 19:21:06 +00:00
hum, vorbisfile => oggdemux ! vorbisdec ! audioconvert
Original commit message from CVS: hum, vorbisfile => oggdemux ! vorbisdec ! audioconvert
This commit is contained in:
parent
0b3089e537
commit
ac27b7cdba
4 changed files with 16 additions and 8 deletions
|
@ -104,7 +104,7 @@ eos (GstElement *src, gpointer data)
|
||||||
int
|
int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
GstElement *filesrc, *demuxer, *decoder, *audiosink;
|
GstElement *filesrc, *demuxer, *decoder, *audioconvert, *audiosink;
|
||||||
GstElement *thread;
|
GstElement *thread;
|
||||||
|
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
|
@ -133,14 +133,18 @@ main (int argc, char *argv[])
|
||||||
decoder = gst_element_factory_make ("vorbisdec", "decoder");
|
decoder = gst_element_factory_make ("vorbisdec", "decoder");
|
||||||
g_assert (decoder != NULL);
|
g_assert (decoder != NULL);
|
||||||
|
|
||||||
|
/* create an audio converter */
|
||||||
|
converter = gst_element_factory_make ("audioconvert", "converter");
|
||||||
|
g_assert (decoder != NULL);
|
||||||
|
|
||||||
/* and an audio sink */
|
/* and an audio sink */
|
||||||
audiosink = gst_element_factory_make ("osssink", "play_audio");
|
audiosink = gst_element_factory_make ("osssink", "play_audio");
|
||||||
g_assert (audiosink != NULL);
|
g_assert (audiosink != NULL);
|
||||||
|
|
||||||
/* add objects to the thread */
|
/* 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 */
|
/* 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 */
|
/* start playing */
|
||||||
gst_element_set_state (thread, GST_STATE_PLAYING);
|
gst_element_set_state (thread, GST_STATE_PLAYING);
|
||||||
|
|
|
@ -104,7 +104,7 @@ eos (GstElement *src, gpointer data)
|
||||||
int
|
int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
GstElement *filesrc, *demuxer, *decoder, *audiosink;
|
GstElement *filesrc, *demuxer, *decoder, *audioconvert, *audiosink;
|
||||||
GstElement *thread;
|
GstElement *thread;
|
||||||
|
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
|
@ -133,14 +133,18 @@ main (int argc, char *argv[])
|
||||||
decoder = gst_element_factory_make ("vorbisdec", "decoder");
|
decoder = gst_element_factory_make ("vorbisdec", "decoder");
|
||||||
g_assert (decoder != NULL);
|
g_assert (decoder != NULL);
|
||||||
|
|
||||||
|
/* create an audio converter */
|
||||||
|
converter = gst_element_factory_make ("audioconvert", "converter");
|
||||||
|
g_assert (decoder != NULL);
|
||||||
|
|
||||||
/* and an audio sink */
|
/* and an audio sink */
|
||||||
audiosink = gst_element_factory_make ("osssink", "play_audio");
|
audiosink = gst_element_factory_make ("osssink", "play_audio");
|
||||||
g_assert (audiosink != NULL);
|
g_assert (audiosink != NULL);
|
||||||
|
|
||||||
/* add objects to the thread */
|
/* 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 */
|
/* 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 */
|
/* start playing */
|
||||||
gst_element_set_state (thread, GST_STATE_PLAYING);
|
gst_element_set_state (thread, GST_STATE_PLAYING);
|
||||||
|
|
|
@ -35,7 +35,7 @@ Here we convert a Mp3 file into an Ogg Vorbis file:
|
||||||
|
|
||||||
And then we can play that file with:
|
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..
|
Some other useful pipelines are..
|
||||||
Plays wav files (currently there are no wav encoders):
|
Plays wav files (currently there are no wav encoders):
|
||||||
|
|
|
@ -224,7 +224,7 @@ Play the mp3 music file "music.mp3" using a libmad-based plug-in and
|
||||||
output to an OSS device
|
output to an OSS device
|
||||||
|
|
||||||
.B
|
.B
|
||||||
gst\-launch filesrc location=music.ogg ! oggdemux ! vorbisdec ! osssink
|
gst\-launch filesrc location=music.ogg ! oggdemux ! vorbisdec ! audioconvert ! osssink
|
||||||
.br
|
.br
|
||||||
Play an Ogg Vorbis format file
|
Play an Ogg Vorbis format file
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue