NAudio icon indicating copy to clipboard operation
NAudio copied to clipboard

Error when trying to initialize a WaveFileReader

Open ruliworst opened this issue 2 years ago • 2 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.

ruliworst avatar Nov 06 '23 12:11 ruliworst

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

markheath avatar Nov 28 '23 14:11 markheath

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.

ruliworst avatar Dec 05 '23 12:12 ruliworst