Skip to content
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

WASAPI error on some audio output devices - execution of nvwave.playWaveFile failed. #16770

Closed
cary-rowen opened this issue Jun 29, 2024 · 3 comments · Fixed by #16771
Closed

Comments

@cary-rowen
Copy link
Contributor

Steps to reproduce:

Execute the following code in the NVDA Python console

import nvwave
nvwave.playWaveFile("d:\copy.wav")

p.s. Drive D should contain a file named "copy.wav".

Actual behavior:

The following error is thrown:

>>> nvwave.playWaveFile("d:\copy.wav")
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "nvwave.pyc", line 722, in playWaveFile
  File "nvwave.pyc", line 835, in __init__
  File "nvwave.pyc", line 888, in open
  File "nvwave.pyc", line 1020, in _setVolumeFromConfig
  File "nvwave.pyc", line 1009, in setVolume
  File "_ctypes/callproc.c", line 1000, in GetResult
OSError: [WinError -2147024809] 参数错误。

Expected behavior:

No errors are thrown and the wave file plays as expected.

NVDA logs, crash dumps and other attachments:

System configuration

NVDA installed/portable/running from source:

Installed

NVDA version:

alpha-32650,405f9bfa

Windows version:

Windows 10 22H2 (AMD64) build 19045.4529

Name and version of other software in use when reproducing the issue:

None

Other information about your system:

I'm using Aeropex by AfterShokz bone conduction headphones.

The device has two output channels,:

  • Aeropex by AfterShokz Stere
  • Aeropex by AfterShokz Hands

Encountered the above error while using "Aeropex by AfterShokz Hands".

Another error encountered while using "Aeropex by AfterShokz Stere":

ERROR - queueHandler.flushQueue (11:53:00.363) - MainThread (1744):
Error in func WasapiWavePlayer._idleCheck
Traceback (most recent call last):
  File "queueHandler.pyc", line 63, in flushQueue
  File "nvwave.pyc", line 1056, in _idleCheck
AttributeError: 'WasapiWavePlayer' object has no attribute '_lastActiveTime'

Other questions

Does the issue still occur after restarting your computer?

Yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

No

If NVDA add-ons are disabled, is your problem still occurring?

Yes

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

Yes

@cary-rowen
Copy link
Contributor Author

cc @jcsteh
Do you have any thoughts on this, I'm guessing you may have a hard time trying to reproduce this without the device.

Thanks for any thoughts.

@jcsteh
Copy link
Contributor

jcsteh commented Jun 29, 2024

This is happening when setting the volume for the sound. My guess is that the device is mono in this mode, but the WASAPI code assumes that all devices are stereo. I knew that mono devices existed, of course, but I thought Windows always down-mixed and exposed them as having two channels. I guess that's not the case.

@cary-rowen
Copy link
Contributor Author

You are right, I tested #16771 which verifies what you are saying is the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants