eric.itzhak
eric.itzhak

Reputation: 16062

how to run nAudio on Windows XP?

I am using nAudio on my WPF Application. I have followed their tutorial on How to play mp3 And everything works fine.

However, in their tutorial they mention :

3) In a method – that only needs to be called once, setup the waveOutDevice. In this example we will use WASPI – which is available on Vista and Windows 7. A more detailed discussion on which output device to chose and when, to come latter

waveOutDevice = new WasapiOut(AudioClientShareMode.Shared, 100);

And for some reason, they didn't discuss on how to do that. Anyone has a clue? And if you do know which output device i should use, do i need to check which OS the user has and set output device accordingly or the one for XP will work on

Upvotes: 2

Views: 958

Answers (1)

ChimeraObscura
ChimeraObscura

Reputation: 1964

You basically have four options for playing audio with NAudio:

  • AsioOut - For most things, ASIO is probably overkill. But if you need very low latency playback, this is your best bet. It requires a sound card with ASIO drivers or the program ASIO4ALL.
  • DirectSoundOut - Uses DirectX for playback.
  • WasapiOut - General purpose playback for Vista and Windows 7.
  • WaveOut - General purpose playback for any version of Windows.

All of them implement IWavePlayer, so once instantiated, using them is pretty much the same for each class - just call Init() and pass in your IWaveProvider. All of them except WasapiOut can be constructed without paramaters, so all you need is:

waveOutDevice = new WaveOut();

Upvotes: 2

Related Questions