MP3解码器 [英] Mp3 Decoder

查看:240
本文介绍了MP3解码器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道可以将mp3文件转换为wave文件的逻辑(即使用的解码逻辑)不使用任何编解码器,我们可以简单地将mp3样本转换为wave样本吗?
我可以使用以下提供的代码快照从mp3文件中提取样本.但是我不知道将这些样本解码为wave样本的逻辑.

这仅是我的代码的很小一部分,仅用于提取ID3V1标记数据

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

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)

推荐答案

(;))

我不知道您为什么坚持不使用编解码器.无论如何,这里有一个示例如何在CP上将wav转换为mp3:

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

通过使用DirectShow API并将滤镜图形连接在一起,可以工作.
当您需要阅读mp3并转换为wav时,您当然需要逆转此过程.


干杯,


曼弗雷德(Manfred)
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


这篇关于MP3解码器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆