Menu

how to alter code to contain mp2 codec

Robert
2005-09-07
2013-04-25
  • Robert

    Robert - 2005-09-07

    Can one of the authors of oggplay tell me what parts of code is the ogg codec. If I know this then I can replace this with mp2 codec C code so that I can build an MP2 player.

    MP2 codec are freely available - I just need to know how to hook this into oggplay.

    I'd rather reuse the oggplay ui and file handling features than build a player from scratch. All I need to do is replace the ogg codec with an MP2 codec.

    I want to be able to play DAB radio recordings made on my Bug (www.thebug.com) on SD card, playing on my Sendo X mobile phone.

     
    • Claus Bjerre

      Claus Bjerre - 2005-09-07

      The vorbis codec resides in the directory vorbis, see  http://cvs.sourceforge.net/viewcvs.py/symbianoggplay/symbianoggplay/
      The integer version of vorbis used here is called Tremor and in http://cvs.sourceforge.net/viewcvs.py/symbianoggplay/symbianoggplay/src/ the vorbis codec dll is handled by OggTremor.cpp.
      Good luck, and please let us know if you succeed !

       
    • Robert

      Robert - 2005-09-08

      Thanks, Claus, I have 4 more questions:

      you wrote:
      >The vorbis codec resides in the directory vorbis, see
      > http://cvs.sourceforge.net/viewcvs.py/symbianoggplay/symbianoggplay/ 

      1) Some of these files are not the codec - what specific files contain the codec?

      you wrote:
      > The integer version of vorbis used here is called Tremor and in
      > http://cvs.sourceforge.net/viewcvs.py/symbianoggplay/symbianoggplay/src/ the vorbis codec dll is handled by OggTremor.cpp.

      2) What is the integer version?
      3) How is this different from the non-integer version?
      4) Why is there more than one codec to play the files?

       
    • Claus Bjerre

      Claus Bjerre - 2005-09-08

      1. Which files ? If you are looking in the vorbis directory then I suppose that except for the Symbian glue files then there isn't much that isn't related to the Tremor codec ?
      2. In order to run on an ARM processor as in the phones we are talking about here, the codec needs to run with integer math as these processors have no floating point units.
      3+4. I guess this is answered in point 2 ? (there is only the integer codec in OggPlay)

       
    • Stuart Fisher

      Stuart Fisher - 2005-09-08

      Hi Robert,

      There are basically four components to the OggPlay "non-MMF audio engine":

      1. OggTremor.cpp
      This is the main playback code and handles decoding the audio buffers and the audio streaming.

      2. TremorDecoder.cpp
      This is the interface between the main playback code and the vorbis dll

      3. The vorbis dll itself. (aka the Tremor codec)

      4. Oggrateconvert.cpp. This is the sample rate converter / volume boost engine.

      The only thing you need to change is TremorDecoder.cpp. You need to remove the calls into the vorbis dll and replace them with calls into an mp2 dll that do the same thing (open the file, read and decompress the data, get the current position, set the position, etc)

      You will also have to make some minor changes to the file system. Currently we just scan for .ogg files so you will need to change it to look for mp2 files instead.

      Stuart

      P.S. It would be great if you could actually make the changes in a way that allows us to carry on playing oggs. However, adding multi codec support to the non-MMF version is not going to be straightforward. For now I would recommend that you just try to replace the vorbis codec with an mp2 version.

       
    • Stuart Fisher

      Stuart Fisher - 2005-09-14

      newlc.com is a good place to start or you might want to try the following book:

      http://www.amazon.co.uk/exec/obidos/ASIN/0470856114/qid=1126733401/sr=1-6/ref=sr_1_11_6/202-2488045-8691004

      But you really don't need much Symbian knowledge to get started because TremorDecoder.cpp is essentially just a C/C++ interface: there isn't much Symbian OS knowledge required here. Grab the source code and get started now!

      Seriously though, grab the source code this week because I'm going to be making a major checkin very soon that will make things a bit more complicated for you, so don't wait.

      Stuart

      P.S. If you didn't know already you'll need to download TortoiseCVS (or some other CVS client) to get the code.

       

Log in to post a comment.