Getting audio buffer data
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.
精彩评论