执行此函数时出现异常“NoDriver calling acmFormatSuggest”:
private static WaveChannel32 OpenMp3Stream(string fileName)
{
WaveChannel32 inputStream;
WaveStream mp3Reader = new Mp3FileReader(fileName);
WaveStream pcmStream = WaveFormatConversionStream.CreatePcmStream(mp3Reader);
WaveStream blockAlignedStream = new BlockAlignReductionStream(pcmStream);
inputStream = new WaveChannel32(blockAlignedStream);
return inputStream;
}
在这条线上:
WaveStream pcmStream = WaveFormatConversionStream.CreatePcmStream(mp3Reader);
我试图改变 NAudio.dll 的平台(从 x86 到 x64,反之亦然),但这并没有帮助。
是否有其他方法可以从 MemoryStream 播放MP3文件,或者如何解决此错误?