AudioPlayerSample方法或操作未实现

时间:2018-10-10 17:51:52

标签: cscore

下载了最新的CSCORE项目,将AudioPlayerSample设置为启动,编译了调试文件。立即出现错误:该方法或操作未实现。在Lenovo Windows 10 Home和Visual Studio 2017社区上运行

编辑。这是一个STUPID错误,每个Windows都有不同的SDK路径,CSCore只有一个路径,因此CSCore在不更改项目文件的情况下可以在Windows 8.1而不是7或10上运行:请参见以下内容:{{3} }

stacktrace(在每个stackentry下方添加了源代码行)是:

System.NotImplementedException
    HResult=0x80004001
    Message=The method or operation is not implemented.
    Source=CSCore
    StackTrace:
     at CSCore.CoreAudioAPI.InteropCalls.CallI(Void* _basePtr, IntPtr intPtr, Void* p) in C:\Users\mpmvd\Documents\Visual Studio 2017\Projects\cscore-master\CSCore\CoreAudioAPI\InteropCalls.cs:line 204 : 
            throw new NotImplementedException();
     at CSCore.CoreAudioAPI.MMDeviceEnumerator.RegisterEndpointNotificationCallbackNative(IMMNotificationClient notificationClient) in C:\Users\mpmvd\Documents\Visual Studio 2017\Projects\cscore-master\CSCore\CoreAudioAPI\MMDeviceEnumerator.cs:line 267 :    
            result = InteropCalls.CallI(UnsafeBasePtr,

                        Marshal.GetComInterfaceForObject(notificationClient, typeof(IMMNotificationClient)),

                        ((void**)(*(void**)UnsafeBasePtr))[6]);


     at CSCore.CoreAudioAPI.MMDeviceEnumerator.RegisterEndpointNotificationCallback(IMMNotificationClient notificationClient) in C:\Users\mpmvd\Documents\Visual Studio 2017\Projects\cscore-master\CSCore\CoreAudioAPI\MMDeviceEnumerator.cs:line 253 : 
            CoreAudioAPIException.Try(RegisterEndpointNotificationCallbackNative(notificationClient), InterfaceName,

                    "RegisterEndpointNotificationCallback");

     at CSCore.CoreAudioAPI.MMDeviceEnumerator..ctor() in C:\Users\mpmvd\Documents\Visual Studio 2017\Projects\cscore-master\CSCore\CoreAudioAPI\MMDeviceEnumerator.cs:line 135 : 
            RegisterEndpointNotificationCallback(_notificationClient);
     at AudioPlayerSample.Form1.Form1_Load(Object sender, EventArgs e) in C:\Users\mpmvd\Documents\Visual Studio 2017\Projects\cscore-master\Samples\AudioPlayerSample\Form1.cs:line 126 : 
            using (var mmdeviceEnumerator = new MMDeviceEnumerator())
     at System.Windows.Forms.Form.OnLoad(EventArgs e)
     at System.Windows.Forms.Form.OnCreateControl()
     at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
     at System.Windows.Forms.Control.CreateControl()
     at System.Windows.Forms.Control.WmShowWindow(Message& m)
     at System.Windows.Forms.Control.WndProc(Message& m)
     at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
     at System.Windows.Forms.ContainerControl.WndProc(Message& m)
     at System.Windows.Forms.Form.WmShowWindow(Message& m)
     at System.Windows.Forms.Form.WndProc(Message& m)
     at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
     at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
     at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

有人经历过并找到了解决方案吗?

1 个答案:

答案 0 :(得分:1)

打开CSCore.csproj文件。

在编译后脚本的底部找到set sdk=%25PROGRAMFILES(x86)%25\Microsoft SDKs\Windows\行,然后在要查找ildasm.exe文件的PROGRAMFILES(x86)\ Microsoft SDKs \ Windows中签入。

更改设置的sdk,以使目录名是您在PC上找到的目录名。