如何将PCM转换为MP3?

问题描述 投票:0回答:1

我正在将PCM转换为MP3播放器。将20KHz的PCM文件转换为MP3效果不佳。有什么问题吗?

enter image description here

enter image description here

这是我的代码

using (var retMs = new MemoryStream())
        using (var ms = new MemoryStream(File.ReadAllBytes(filename)))
        using (var rdr = new WaveFileReader(ms))
        using (var wtr = new LameMP3FileWriter(retMs, rdr.WaveFormat, 128))
        {
            rdr.CopyTo(wtr);
            File.WriteAllBytes(Environment.CurrentDirectory + @"\Mix.mp3", retMs.ToArray());
        }
c# audio mp3 pcm convert
1个回答
1
投票

在128k时,MP3编码器使用17 kHz左右的低通滤波器。上面的所有内容都将被丢弃。

如果在可听见的末端保持频率很重要,那么您根本不应该使用有损编解码器...,当然也不应该使用MP3。

© www.soinside.com 2019 - 2024. All rights reserved.