[Asterisk-Users] MP3 streams for MOH: idea

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Sat Sep 6 20:14:57 MST 2003


On Saturday 06 September 2003 21:14, James Sharp wrote:
> > [thread change, different topic]
> >
> >>is
> >
> > How about a little tiny program that connects to a remote host,
> > grabs the contents of an MP3 stream, and pushes it into a FIFO
> > locally?  It would be a raw TCP-to-FIFO stream, so mpg123 would be
> > able to digest it as if it was a local file.  The program would
> > take two arguments: remote hostname/IP and port, and then the file
> > to which the output would be sent.  I don't know how mpg123 handles
> > blocking...
>
> Is there any particular reason (rather than not having time to code
> one and embed it into *) why we can't have our own in-thread
> connection to an MP3 stream or file, rather than spawning off a
> process (fork() is expensive as compared to pthread_create()) of
> mpg123 to play the stream/file?
>
> It seems that this spawning/hoping the process dies cleanly is a
> thorn in a few people's side.

Well, there's a clear problem with the patent on the MP3 codec.  Given
that Asterisk is currently royalty-free, adding native, non-emcumbered
code to play MP3s would force Digium to pay a royalty to the holders of
that patent, for each decoder.  By fork()ing and running an outside
binary, the legal liability might pass to the maker of that binary (but
IANAL, so don't take this as legal advice).  If you want to add native
support for something like MP3, I'd suggest looking at Ogg Vorbis.

-Tilghman




More information about the asterisk-users mailing list