
Would anyone know of packages out there for Haskell that support mp3's or ogg files? thanks Jason

On Fri, 3 Dec 2004, Jason Bailey wrote:
Would anyone know of packages out there for Haskell that support mp3's or ogg files?
Do you mean realtime unpacking and playback? I'm afraid without hacking Haskell programs are too slow for that. If you want to read or write compressed audio streams you might content with piping data through an external compressor/decompressor, or calling a library for that purpose.

Henning Thielemann
On Fri, 3 Dec 2004, Jason Bailey wrote:
Would anyone know of packages out there for Haskell that support mp3's or ogg files?
Do you mean realtime unpacking and playback? I'm afraid without hacking Haskell programs are too slow for that.
Really? Written in C, mpg123 can decode 50 minutes of audio in 30 seconds (tested on a 1GHz PIII) -- would a Haskell implementaion really be 100x slower? (Although I agree that FFI'ing to an existing library does sound like the thing to do.) -kzm -- If I haven't seen further, it is by standing in the footprints of giants

On Fri, 3 Dec 2004, Ketil Malde wrote:
Henning Thielemann
writes: On Fri, 3 Dec 2004, Jason Bailey wrote:
Would anyone know of packages out there for Haskell that support mp3's or ogg files?
Do you mean realtime unpacking and playback? I'm afraid without hacking Haskell programs are too slow for that.
Really? Written in C, mpg123 can decode 50 minutes of audio in 30 seconds (tested on a 1GHz PIII) -- would a Haskell implementaion really be 100x slower?
I've written much simpler audio signal processing routines compiled by GHC which don't run in realtime on a 1GHz machine ...

On Fri, 3 Dec 2004, Henning Thielemann wrote:
On Fri, 3 Dec 2004, Ketil Malde wrote:
Really? Written in C, mpg123 can decode 50 minutes of audio in 30 seconds (tested on a 1GHz PIII) -- would a Haskell implementaion really be 100x slower?
I've written much simpler audio signal processing routines compiled by GHC which don't run in realtime on a 1GHz machine ...
Mind if I ask what was going on there? I can see things potentially taking that long if you do things in a [Word16] or something like that, and this /is/ one of the cases where float is better than double... That, and this is probably one of those "squash laziness" situations. -- flippa@flippac.org

At Fri, 03 Dec 2004 10:56:24 -0500, Jason Bailey wrote:
Would anyone know of packages out there for Haskell that support mp3's or ogg files?
I have some haskell bindings to libmad somewhere ... I don't remember how complete they are, but I think i got them to the point that I could decode and play an mp3. Of course, all the actual decoding work was being done in libmad, and haskell was just pulling the strings... I can attempt to dig them up if that would suit your needs... Jeremy Shaw. -- This message contains information which may be confidential and privileged. Unless you are the addressee (or authorized to receive for the addressee), you may not use, copy or disclose to anyone the message or any information contained in the message. If you have received the message in error, please advise the sender and delete the message. Thank you.

I'm new to Haskell so I didn't realize it had that much of a performance issue. If you could find those bindings I'd appreciate it, at the very least it would give me a starting point on where to go frrom here. Jason Jeremy Shaw wrote:
At Fri, 03 Dec 2004 10:56:24 -0500, Jason Bailey wrote:
Would anyone know of packages out there for Haskell that support mp3's or ogg files?
I have some haskell bindings to libmad somewhere ... I don't remember how complete they are, but I think i got them to the point that I could decode and play an mp3. Of course, all the actual decoding work was being done in libmad, and haskell was just pulling the strings...
I can attempt to dig them up if that would suit your needs...
Jeremy Shaw.
--
This message contains information which may be confidential and privileged. Unless you are the addressee (or authorized to receive for the addressee), you may not use, copy or disclose to anyone the message or any information contained in the message. If you have received the message in error, please advise the sender and delete the message. Thank you.

At Fri, 03 Dec 2004 14:39:45 -0500, Jason Bailey wrote:
[1
] I'm new to Haskell so I didn't realize it had that much of a performance issue. If you could find those bindings I'd appreciate it, at the very least it would give me a starting point on where to go frrom here.
I actually have no idea how fast a native haskell implementation would be. But I do know that it would take a long time to write one compared to writing libmad bindings :) Writing a good quality mp3 decoder is a big project. This page ought to give you an idea of how easy it is to get wrong: http://www.underbit.com/resources/mpeg/audio/compliance/ The only *downside* of libmad I found is that it is GPL, not LGPL or BSD. But, even then, they offer a commercial license, so... I will attempt to get what I have online tomorrow... Jeremy Shaw. -- This message contains information which may be confidential and privileged. Unless you are the addressee (or authorized to receive for the addressee), you may not use, copy or disclose to anyone the message or any information contained in the message. If you have received the message in error, please advise the sender and delete the message. Thank you.

At Fri, 03 Dec 2004 10:40:45 -0800, Jeremy Shaw wrote:
At Fri, 03 Dec 2004 10:56:24 -0500, Jason Bailey wrote:
Would anyone know of packages out there for Haskell that support mp3's or ogg files?
I have some haskell bindings to libmad somewhere ... I don't remember how complete they are, but I think i got them to the point that I could decode and play an mp3.
Sorry for the delay, I found a copy of my code that compiles, it is now online at: http://www.n-heptane.com/nhlab/ I think it might even work... Right now I only have a low-level binding, and a sample application that decodes an mp3. But, the low-level bindings to mad are pretty low -- there really needs to be a higher level library, but I have not written one yet ;) The MadTest stuff is a bit hack-ish and should probably be updated to use NewBinary. Jeremy Shaw. -- This message contains information which may be confidential and privileged. Unless you are the addressee (or authorized to receive for the addressee), you may not use, copy or disclose to anyone the message or any information contained in the message. If you have received the message in error, please advise the sender and delete the message. Thank you.

On Fri, Dec 03, 2004 at 10:56:24AM -0500, Jason Bailey wrote:
Would anyone know of packages out there for Haskell that support mp3's or ogg files?
I have a (partial, I think) binding for gstreamer: http://urchin.earth.li/~ian/minstrel/ (you only need GHC 6.3 for hcurses, hgstreamer and dependencies should compile fun without it I believe). I also have a complete, although error-checking-free, libalsaplayer binding, but I found it a less pleasant API (which is why I switched): darcs get http://urchin.earth.li/darcs/ian/halsaplayer Thanks Ian
participants (6)
-
Henning Thielemann
-
Ian Lynagh
-
Jason Bailey
-
Jeremy Shaw
-
Ketil Malde
-
Philippa Cowderoy