简体   繁体   English

如何降低NAudio中的音频播放速度?

[英]How to reduce audio playback speed in NAudio?

My code to play mp3 file looks like this: 我的播放mp3文件的代码如下所示:

Stream stream = new MemoryStream(byteArray);
Mp3FileReader fread = new Mp3FileReader(stream);
IWavePlayer audioPlayer = new DirectSoundOut();
audioPlayer.Init(fread);
audioPlayer.Play();

Now, I want to play mp3 file with reduced speed (half normal speed). 现在,我想以降低的速度(半速)播放mp3文件。

Is there any way to do this? 有什么办法吗?

NAudio does not include a ready-made component to change the speed of audio playback. NAudio不包含用于更改音频播放速度的现成组件。 However, it is possible if you create your own derived WaveStream / IWaveProvider and implement a speedup algorithm yourself. 但是,可以创建自己的派生WaveStream / IWaveProvider并自己实现加速算法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM