CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 1999
    Location
    St-Petersburg (Russia)
    Posts
    32

    ACM: Compressing WAV audio to Mpeg Layer 3 using Codecs

    I'm building a small app to automate compression of WAV to MP3.

    It produces MP3s, of approximately the right size, but the sound is garbled, it sounds like the song with 'extra' noise.. lots., I can even
    hear the words. However winamp keeps changing from 'green' to 'red' ie out of sync or somethign.

    I'm using ACM to compress my wav data blocks into mp3. Then I am literally writing those mp3 blocks (from the acm) to disk. Do i need headers or anything?

    I'm letting the user choose the mpeg format, and getting the buffer sizes from acm, the source buffers are approx 10x bigger than the destination, which seems right for 128kpbs mp3s..

    Thanks!!

    - Alex


  2. #2
    Join Date
    Jul 2000
    Location
    Ft. Lauderdale
    Posts
    1

    Re: ACM: Compressing WAV audio to Mpeg Layer 3 using Codecs

    You do need a header. The only way I know to do it is manually. I have done this with WAV. Basically edit the file with a HEX editor and look at about the first 46 bytes (the header size is standard for all sound files as far as I know), compare it with another MP3 file and see the difference.

    How did you initialize the ACM to work? I can't get it to work. I don't know if it is because I am trying on WinCE or I don't know what I am doing. Supposety Ver. 3 of CE supports it, but I am yet to see.

    Ron


  3. #3
    Join Date
    Jun 2000
    Location
    Redmond, WA
    Posts
    26

    MP3 Sourcecode

    Here is some code that converts WAVs to MP3:
    http://www.planetsourcecode.com/vb/s...&txtCodeId=402

    And here is some code to decode mp3s:
    http://www.planetsourcecode.com/vb/s...&txtCodeId=372

    And here is some code that gets the bitrate, id3, etc:
    http://www.planetsourcecode.com/vb/s...&txtCodeId=512

    Check this site out:
    http://www.id3.org/
    It may shed some light...

    Hope that was useful,
    Chris


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured