Alfredo E. Cotroneo
2004-Aug-06 14:22 UTC
[icecast] MP3 decoding, fading and streaming at the same time
Hi There, I have just ported to Linux a program that I wrote years ago in Prolog under DOS to automate our Shortwave radio station. Back in 1990 the original program used ADPCM coded audio files and a special board. Now I can use MP3 files and a Soundblaster compatible card ;-) under Linux, and it runs from a console without any fancy interface. I absolutely need to fade-in and fade-out audio, and now I use the mixer capability of the SoundBlaster, so a simple MP3 file scheduler is not enough for me. I am now trying to feed the output of this program (actually the output of the Sound card) to an icecast server. The easiest way would be to have another sound card and connect line-out (1st card) to line-in (2nd card) and use liveice to feed icecast. Either use two sound cards on the same PC (I did not mange yet) or even two Linux servers ;-)) I wonder if there is another easier way to do it without two soundcards. I MUST have fade-in/fade-out capabilities, and I currently use the card mixer to do that. I tried i.e. feeding Line-out and line-in of the same (duplex) Soundcard, but looks like the opensound audio driver cannot be open simultaneosly by two applications (liveice should only read, mpg123 should only write to the sound driver). 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 ? Thanks. Alfredo --- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Thomas Vander Stichele
2004-Aug-06 14:22 UTC
[icecast] MP3 decoding, fading and streaming at the same time
> 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, ...). thomas <-*- -*-> 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@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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
jaromil
2004-Aug-06 14:22 UTC
[icecast] MP3 decoding, fading and streaming at the same time
On Thu, May 10, 2001 at 07:44:37AM +0200, Alfredo E. Cotroneo wrote:> Hi There, > > I have just ported to Linux a program that I wrote years ago in Prolog > under DOS to automate our Shortwave radio station. Back in 1990 the > original program used ADPCM coded audio files and a special board. Now I > can use MP3 files and a Soundblaster compatible card ;-) under Linux, and > it runs from a console without any fancy interface. I absolutely need to > fade-in and fade-out audio, and now I use the mixer capability of the > SoundBlaster, so a simple MP3 file scheduler is not enough for me.is it released somewhere or any release of that sourcecode is planned? -- jrml ..//korova.dyne.org 6EEE 4FB2 2555 7ACD 8496 AB99 E2A2 93B4 6C62 4800 --- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Scott Manley
2004-Aug-06 14:22 UTC
[icecast] MP3 decoding, fading and streaming at the same time
Liveice has a built in mixer that mixes the pcm streams before sendin them to the card, th drawback is that automation with crossfading would be hard.... you'd definately need to hack code to get it to work -- Scott Manley (AKA Szyzyg) Streaming Media Hacker www.myplay.com --- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Tim Pozar
2004-Aug-06 14:22 UTC
[icecast] MP3 decoding, fading and streaming at the same time
I did something like this for KKSF where they wanted to mix between a wave file and a the over the air signal to insert different spot in the outgoing MP3 stream. I put two sound cards in a machine as they are cheap (~$20) played the wave on one sound card and mixed between them with other sound card. I wrote a program that looked at a line on the serial port and if it went high it would run "mixer" to crank down the live station feed, play the wave file and then run "mixer" to turn up the live audio again. One would either have a 30 or 60 second wave file to insert or a long cut and wait for the line to toggle back to go back to the live audio. The scheme works for those folks running into the AFTRA problem. Drop me a note if you want details or code. Tim On Thu, May 10, 2001 at 07:44:37AM +0200, Alfredo E. Cotroneo wrote:> Hi There, > > I have just ported to Linux a program that I wrote years ago in Prolog > under DOS to automate our Shortwave radio station. Back in 1990 the > original program used ADPCM coded audio files and a special board. Now I > can use MP3 files and a Soundblaster compatible card ;-) under Linux, and > it runs from a console without any fancy interface. I absolutely need to > fade-in and fade-out audio, and now I use the mixer capability of the > SoundBlaster, so a simple MP3 file scheduler is not enough for me. > > I am now trying to feed the output of this program (actually the output of > the Sound card) to an icecast server. The easiest way would be to have > another sound card and connect line-out (1st card) to line-in (2nd card) > and use liveice to feed icecast. Either use two sound cards on the same PC > (I did not mange yet) or even two Linux servers ;-)) > > I wonder if there is another easier way to do it without two soundcards. I > MUST have fade-in/fade-out capabilities, and I currently use the card mixer > to do that. I tried i.e. feeding Line-out and line-in of the same (duplex) > Soundcard, but looks like the opensound audio driver cannot be open > simultaneosly by two applications (liveice should only read, mpg123 should > only write to the sound driver). > > 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 ? > > Thanks. > > Alfredo > > > --- >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@xiph.org' > containing only the word 'unsubscribe' in the body. No subject is needed. > Unsubscribe messages sent to the list will be ignored/filtered.-- Snail: Tim Pozar / LNS / 1978 45th Ave / San Francisco CA 94116 / USA POTS: +1 415 665 3790 Radio: KC6GNJ / KAE6247 "It's a damn poor mind that can only think of one way to spell a word." - Andrew Jackson "What is wanted is not the will to believe, but the will to find out, which is the exact opposite." - Bertrand Russell, "Skeptical_Essays" --- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
William Goldsmith
2004-Aug-06 14:22 UTC
[icecast] MP3 decoding, fading and streaming at the same time
Do a search for 'ecasound'. It does everything you need & more. You'll probably still want the OSS pro drivers, too. -bg ----- Bill Goldsmith www.radioparadise.com www.kpig.com> > Any idea or suggestion to avoid having two sound cards to do what I needto> > do ? > > > > Or how to fade in / fade out without using the card' mixer, whileplaying> > 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, ...). > > thomas > > <-*- -*-> > 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@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@xiph.org'> containing only the word 'unsubscribe' in the body. No subject is needed. > Unsubscribe messages sent to the list will be ignored/filtered. >--- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.