I just found NAudio the other day and I played with it. I wrote a simple program in the form of windows, in which there is a download button (loads a specific .wav song), and buttons for playing, pausing, stopping, attenuating sound (my own added functionality using timers and gradually increasing volume) and wipe the sound. I also have track control for handling volume. I created a wrapper class to accommodate all of the NAudio materials, as well as to add additional features such as fade-in / out and event notification when sound starts or pauses.
Well, everyone said that everything is in order. The program correctly loads, plays, pauses, stops and disappears. The volume level correctly reflects the volume level of the song being played. This works a lot, but I have two problems.
Firstly, after I click on the “Download” button to download the sound, and then do whatever I want (or not) when I exit the program, I get the following pop-up error message (“Assertion failed "):" The AcmStreamHeader utility was not called in AcmStreamHeader.Finalize (). " This is one of the “Abort, Retry, Ignore” pop-ups, but after a few seconds it disappears and the project ends. (Note: the download function creates a DirectSoundOut and calls CreateInputStream ..., taken directly from NAudio samples on the site, and also sets up event handlers for certain events, but that probably doesn't matter.)
In the class destructor, I call the following calls:
mainOutputStream.Close();
mainOutputStream.Dispose();
waveOutDevice.Dispose();
. , . , , ?
VS 10 Windows 7 32-bit.