NSpeex on 64 bit platforms

Jul 26, 2010 at 7:00 PM
I know that NSpeex is supposed to work "out of the box" on 64 bit platforms as previously stated, however testing on an x64 Windows 7 machine, NSpeexWrapper.dll fails to load with an "Incorrect format" exception, which is typical to x64 platforms trying to run 32 bit software. Is there any reason as to why this happens even if I change the linker target environment for the NSpeexWrapper project in VS2008 to X64? This has me perplexed as well as the NAudio issues.
Jul 26, 2010 at 9:26 PM


yes the wrapper is the outcome of my first approach to NSpeex: a managed C++ wrapper around the native speex library and therefor only runable under 32bit environment.

Using the NSpeex.dll assembly which is a C# Implementation of Speex can be compiled for Any CPU and is therefore runable under 32bit and 64bit platforms.

The big difference is that NSpeexWrapper.dll is based on Speex 1.2rc1 (the latest version) and NSpeex.dll is based on Speex 1.0.3. So for any testing you are doing use the NSpeex.dll which is 100% managed implementation.


Jul 27, 2010 at 3:10 AM

Yes, but the code can't be compiled to NSpeex.dll without the use of NSpeexWrapper.dll from what I see. If you unload the project and remove references to the wrapper, you no longer know what the Decoder object types are since those reside in the wrapper DLL file. So we come into issues of runtime loading of NSpeexWrapper.dll getting side-by-side configuration errors due to VC++ runtime version differences, which is a huge hassle.

Jul 27, 2010 at 7:18 AM

I haven't got a VS installed on the current computer but that doesn't seem right. Just remove the references to NSpeexWrapper project from the NSpeex project. This should work without problems. Additionally, the NSpeexTest project should only be using the NativePreprocessor for encoding which is also optional. So removing the reference to NSpeexWrapper from the NSpeexTest project requires deleting the pre-processor usage in the test code.

Sorry that I can't be a more help at this time. However, I can fix the reference problem beginning of next week...