[icecast] MP3 decoding, fading and streaming at the same time

Thomas Vander Stichele thomas at urgent.rug.ac.be
Thu May 10 09:12:51 UTC 2001

> Any idea or suggestion to avoid having two sound cards to do what I need to 
> do ?
> Or how to fade in / fade out without using the card' mixer, while playing 
> i.e. using mpg123 ?

Depends on how much you want to program.

Basically, the easiest would probably be to use OSS software mixing; if
you buy the commercial OSS drivers, you can have several programs writing
to /dev/dsp and it will automatically mix.

Then you need an mp3 playing program capable of software volume level.
This isn't really what xmms seems to do; xmms seems to control the
hardware audio level.  In any case, you could write this yourself;
changing the volume is merely a matter of reading in the sample values and
multiplying them by a factor; 1.0 for no change, < 1.0 for quieter, > 1.0
for louder (but don't do this because you'll get distortion).

You could write this as a standard program reading from stdin and writing
to stdout and thus create a pipeline :

mpg123 to stdout | volume from stdin to stdout > /dev/dsp

do this for every file you want to play.

Anyway, I'm currently writing something like this based on the gstreamer
platform (gstreamer.net); it should do all of this and a bit more, since
gstreamer can have various types of input (you could basically mix an mp3
with an ogg and an MPEG-2-video audio stream) and types of output
(icecast, disk, sound out, ...).


<-*-                      -*->
There's a world outside
And I know cause I've heard talk
In my sweetest dreams
I would go out for a walk
<-*- thomas at apestaart.org -*->
URGent, the best radio on the Internet - 24/7 ! - http://urgent.rug.ac.be/

--- >8 ----
List archives:  http://www.xiph.org/archives/
icecast project homepage: http://www.icecast.org/
To unsubscribe from this list, send a message to 'icecast-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.

More information about the Icecast mailing list