NAudio演示不再工作了

Kur*_*rru 4 .net c# audio naudio

我只是试图运行NAudio演示,我得到一个奇怪的错误:

System.BadImageFormatException: Could not load file or a
ssembly 'NAudio, Version=1.3.8.0, Culture=neutral, PublicKeyToken=null' or one o
f its dependencies. An attempt was made to load a program with an incorrect form
at.
File name: 'NAudio, Version=1.3.8.0, Culture=neutral, PublicKeyToken=null'
   at NAudioWpfDemo.AudioGraph..ctor()
   at NAudioWpfDemo.ControlPanelViewModel..ctor(IWaveFormRenderer waveFormRender
er, SpectrumAnalyser analyzer) in C:\Users\Admin\Downloads\NAudio-1.3\NAudio-1-3
\Source Code\NAudioWpfDemo\ControlPanelViewModel.cs:line 23
   at NAudioWpfDemo.MainWindow..ctor() in C:\Users\Admin\Downloads\NAudio-1.3\NA
udio-1-3\Source Code\NAudioWpfDemo\MainWindow.xaml.cs:line 15

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\M
icrosoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure lo
gging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fus
ion!EnableLog].
Run Code Online (Sandbox Code Playgroud)

自从我上次使用NAudio演示以来,我已经从32位Windows XP更改为64位Windows 7.这是否会导致此问题?它非常烦人,因为我要再次尝试使用C#中的音频

dri*_*iis 7

我对NAudio没有经验,但是你提到的例外情况经常发生在有点问题时.这意味着NAudio可能只编译为32位,而你运行64位.

要尝试解决此问题,请在项目的编译属性中将输出设置为32位(x86).