Click here to Skip to main content
15,887,249 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to know the logic on which the mp3 file can be converted to wave file(i.e the decoding logic used) Without using any codec can we simply convert the mp3 samples to wave samples??
I can extract the samples from mp3 file by using snapshot of following code that I have provided.But I dont know the logic to decode these samples to wave samples.

THIS IS ONLY A SMALL PORTION OF MY CODE ONLY FOR EXTRACTING THE ID3V1 TAG DATA
VB
imports system.io
'THIS CODE IS FOR ONLY READING THE TAG SECTION SIMILARLY I HAVE ALSO EXTRACTED THE HEADER OF THE MP3 FRAME AND DATA STORED
        Dim mp As FileStream
        Dim Title(30) As Byte
        Dim Artist(30) As Byte
        Dim Album(30) As Byte
        Dim Year(4) As Byte
        Dim Comments(30) As Byte
        mp = New FileStream("File_name.mp3", FileMode.Open)
        mp.Seek(-125, SeekOrigin.End)
        mp.Read(Title, 0, 30)
        mp.Seek(-95, SeekOrigin.End)
        mp.Read(Artist, 0, 30)
        mp.Seek(-65, SeekOrigin.End)
        mp.Read(Album, 0, 30)
        mp.Seek(-35, SeekOrigin.End)
        mp.Read(Year, 0, 4)
        mp.Seek(-31, SeekOrigin.End)
        mp.Read(Comments, 0, 30)
        Dim TxtTitle As String = System.Text.Encoding.ASCII.GetString(Title)
        Dim TxtArtist As String = System.Text.Encoding.ASCII.GetString(Artist)
        Dim TxtAlbum As String = System.Text.Encoding.ASCII.GetString(Album)
        Dim TextComments As String = System.Text.Encoding.ASCII.GetString(Comments)
Posted
Updated 5-Dec-10 21:38pm
v3

1 solution

Hi Be, ( ;) )

I don't know why you insist on not using a codec. Anyhow there's an example of how to convert wav to mp3 right here on CP:

http://www.codeproject.com/KB/audio-video/dshowencoder.aspx

It works by using DirectShow API and wiring together a filter graph.
You would have of course reverse the process as you need to read mp3 and transform to wav.


Cheers,


Manfred
 
Share this answer
 
v2
Comments
Dalek Dave 6-Dec-10 4:11am    
Good Call.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900