mp3decoder: MP3 decoder for teaching.

[ codec, program ] [ Propose Tags ]

This is an MP3 decoder written (almost) completely in Haskell. The current version is experimental software, written for teaching purposes, and is currently too slow to be usable in practice. For the accompanying article, se

[Skip to Readme]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS] 0.0.1
Dependencies base, binary-strict, bytestring, haskell98, mtl [details]
License LicenseRef-OtherLicense
Copyright Bjorn Edstrom, 2008
Author Bjorn Edstrom
Category Codec
Home page
Uploaded by BjornEdstrom at 2008-10-01T15:15:43Z
Reverse Dependencies 1 direct, 0 indirect [details]
Executables mp3driver
Downloads 3407 total (11 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2017-01-03 [all 8 reports]

Readme for mp3decoder-0.0.1

[back to package description]
=== Prereq. ===

Using this code requires:

*) A Haskell compiler, such as GHC.

*) binary-strict, from here:
   If you've never used Haskell before, install binary-strict by 
   downloading and unpacking the source, cd to the directory where the
   Setup file is, and do

     $ runhaskell Setup.lhs configure
     $ runhaskell Setup.lhs build
     $ runhaskell Setup.lhs install

That's it.

=== Building the decoder ===

Building the decoder works almost the same as building binary-strict. 
From the directory where this file is, do:

$ runhaskell Setup.lhs configure
$ runhaskell Setup.lhs build

Do not install it (if you're familiar with Haskell and for some reason
want to install this decoder as a library, you'll have to edit the 
cabal file).

When done, there will be an executable file in dist/build/mp3driver.
Pass an MP3 file to it

$ mp3driver test.mp3

And it will write a file, "out.wav", to the current directory.

The actual decoder is in Codec/Audio/MP3. Change parts of it, run
the build command again, and see what happens. :-)

=== Trouble? ===

If, for some reason, the above doesn't work, there's a manual method
of building the mp3driver program. Copy all *.hs, *.h and *.c files
to the same directory. Build the two C files:

$ gcc -O2 -c c_imdct.c
$ gcc -O2 -c c_synth.c

Change all "import Codec.Audio.MP3.XXX" in the Haskell source files
to "import XXX". Then:

$ ghc c_imdct.o c_synth.o --make Driver.hs