-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Protected memory exception when changing master volume #26
Comments
I'm looking into this issue and will post back when I find a solution. Like so: |
I was able to find the problem. Please take a pull from the master branch and let me know if this version works for you as well. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Had this exception when using the Nuget package.
Downloaded the code from GitHub and ran the Forms.Framework sample and got the same error. Am running it in Framework 4.8.1, but read through another issue that just changing the targeting framework should work. Should mention that changing the selected device is working just fine. Only the volume has this problem.
System.AccessViolationException
HResult=0x80004003
Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source=
StackTrace:
Stack trace
at CoreAudio.Interfaces.IAudioEndpointVolume.SetMasterVolumeLevelScalar(Single fLevel, Guid pguidEventContext)
at CoreAudio.AudioEndpointVolume.set_MasterVolumeLevelScalar(Single value) in C:\Code\ExampleCode\CoreAudio-master\CoreAudio\AudioEndpointVolume.cs:line 60
at CoreAudioForms.Framework.Sample.FormMain.Master_Scroll(Object sender, EventArgs e) in C:\Code\ExampleCode\CoreAudio-master\samples\CoreAudioForms.Framework.Sample\FormMain.cs:line 35
at System.Windows.Forms.TrackBar.OnScroll(EventArgs e)
at System.Windows.Forms.TrackBar.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)
at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.Control.ReflectMessageInternal(IntPtr hWnd, Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WmVScroll(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(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)
at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
at System.Windows.Forms.Control.DefWndProc(Message& m)
at System.Windows.Forms.Control.WmMouseMove(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.TrackBar.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)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at CoreAudioForms.Framework.Sample.Program.Main() in C:\Code\ExampleCode\CoreAudio-master\samples\CoreAudioForms.Framework.Sample\Program.cs:line 13
The text was updated successfully, but these errors were encountered: