naudio / NAudio

Audio and MIDI library for .NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when trying to initialize a WaveFileReader

ruliworst opened this issue · comments

Hello,

My use case is based on getting audio of any format, converting it to wav and reading it.
image001 (5)

The conversion as you can see is done by FFMPEG and I have already tested that the provided content is correct because I wrote that MemoryStream to a wav file and it plays properly. However, when I try to initialize the WaveFileReader this exception is thrown:
image002 (3)

Does anyone know why this is happening?

Thank you very much in advance. Any help is useful.

Is it a very large (>2GB) WAV File? If so, try using MediaFoundationReader to play it instead.

Hi Mark, I am working with WAV audio files in memory, that is, I am not using File System. So, I cannot use MediaFoundationReader. The resulting outputStream is about 900KB.

Thanks for your response.