开发者

Getting audio buffer data

开发者 https://www.devze.com 2023-03-30 20:17 出处:网络
I am using naudio and I was curious how I could get the audio buffer data. Is there a way to obtain the audio buffer data f开发者_JS百科rom a Wave file read from WaveFileReader? I would like to event

I am using naudio and I was curious how I could get the audio buffer data.

Is there a way to obtain the audio buffer data f开发者_JS百科rom a Wave file read from WaveFileReader? I would like to eventually save it to a file.

I assumed that to do so was

byte[] buffer = new byte[wave.Length]; wave.Read(buffer, 0, (int)wave.Length);

However, is wave.length the length of the audio data buffer, or is it the length in respect to duration? If not duration, how can I get the duration?


wave.Length is the number of bytes of audio data. The TotalTime property of a WaveStream will attempt to convert this into a TimeSpan.

0

精彩评论

暂无评论...
验证码 换一张
取 消