This project has moved and is read-only. For the latest updates, please go here.

NAudio 64-bit support?

Feb 2, 2009 at 9:58 PM
Edited Feb 2, 2009 at 9:59 PM
I can get NAudio's AudioPlaybackForm demo to work on Vista 32-bit, but on the same machine, it crashes when I try to play a sound using Windows 7 64-bit.  In fact I can't get NAudio to play back any sound on the 64-bit partition, using any of the output drivers (WaveOut, DSound, WASAPI).  The NAudio coding4fun sample code also doesn't work on 64-bit.

I have no doubt the Win7 aspect of my machine is an unsupported configuration -- but has anyone had any success playing sounds back on Vista 64-bit?  Is that configuration supported?

p.s. congratulations on the coding4fun article Mark!
Feb 3, 2009 at 7:26 AM
Hi Rob,

I would love to add 64 bit support to NAudio, but don't have a PC with 64 bit windows at the moment. Most likely, the problems are with the P/Invoke interop signatures using Int32 when they should be using IntPtr. It's definitely on the TODO list though (along with a lot of other things!)

Feb 3, 2009 at 1:42 PM
Mark, thank you very much for this response. I understand, as I've been in the position of wanting to debug a 64-bit app without having a machine available. If you do ever get around to investigating 64-bit support, if you could ping me (maybe respond to this thread again?) that would be great.

all the best
Feb 4, 2009 at 6:36 PM
Edited Feb 4, 2009 at 6:41 PM
I can't confirm the crash using wav files, but it crashes with mp3 files.

I might look into this, I have a Windows Vista/Windows 7 x64 development PC, and I can confirm that most WASAPI/CoreAudioApi Interfaces work fine on 64 bit Vista. The problem is, I can't debug 64 bit code, since I use SharpDevelop (no 64 bit debugger).

64bit recap using a wave file:

waveOut playback works.
DirectSound doesn't , but it crashes because of a System.ArgumentException.
WASAPI also works fine

EDIT: another 64 bit bug is that ASIO is not supported, but compiled to 32 bit, I can select ASIO as output (but it crashes ;P). I don't know which is correct behaviour, however, as I don't have ASIO drivers, I'd say it's the 32 bit version with the bug.
Feb 9, 2009 at 12:27 PM
thanks for the info Frank. A quick solution for people wanting to use NAudio on x64 might be to compile as x86 only, which I have heard (but not personally verified) causes Windows to run it in an x86 emulation mode.
Feb 15, 2009 at 5:10 AM
Hi Mark,

I can confirm your suggestion works on Windows XP 64 Bit Edition. I found your software today when looking for other .Net Open Source audio libraries but was confused about why I couldn't get a basic wave file to play until I found this. The error message I was getting was rather odd and it took a few moments to track down where it was being called from. But once I found this, changed the output for x86 all worked as expected. I'd suggest you change the default setting for this libary to out put as x86 until you do have a chance to get to a x64 environment.

Click Build > Configuration Manager and then change all of the projects platform to x86

Also in reference to ASIO I have ASIO4ALL v2 installed and it worked fine once I changed the projects platform to x86.

Thanks for the great library.

Feb 17, 2009 at 9:57 PM
I can also confirm Sebastian's comment for Windows 7 Beta 64 bit.  Creating a new x86 Build Configuration in Visual Studio for NAudio enables it to work.  I have only tested WaveOut and DirectSound output.
Oct 11, 2009 at 2:41 AM

I also had problems on x64 (Windows 7). I changed the Target Platform to "Any CPU" value in Visual Studio and all earned.

Thank you for your library

Oct 12, 2009 at 12:58 AM
I was wrong. The library does not work on X64 platform. If you change the value of Target Platform to "Any CPU" project starts but when trying to convert constantly gives "InvalidParameter calling acmStreamPrepareHeader" for any wav files. The project does not work on x64 and works on x86 platform (in Virtual PC)
Oct 12, 2009 at 2:31 PM

Atreides07, you need to set it to target x86, even though you are using x64. It should then work. This has been done in NAudio 1.3