Skip to content

Commit

Permalink
Fix sound split exception during startup on AppVeyor CI runner (nvacc…
Browse files Browse the repository at this point in the history
…ess#16270)

Closes nvaccess#16269
Fixup of nvaccess#16071

Summary of the issue:
Exception _ctypes.COMError is thrown at startup on AppVeyor CI runner because hno sound device is present.

Description of user facing changes
N/A

Description of development approach
Catching and logging exception. Returning from soundSplit.initialize function so that initialization can continue.

Testing strategy:
Not sure how to test on AppVeyor, but judging by the exception providded - this should fix the error.
Tested on my local computer to avoid syntax errors.
  • Loading branch information
mltony authored and Adriani90 committed Mar 13, 2024
1 parent 14096f3 commit f3c7f94
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion source/audio/soundSplit.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import ui
from utils.displayString import DisplayStringIntEnum
from dataclasses import dataclass
from comtypes import COMError

VolumeTupleT = tuple[float, float]

Expand Down Expand Up @@ -78,7 +79,11 @@ def getNVDAVolume(self) -> VolumeTupleT:
def initialize() -> None:
if nvwave.usingWasapiWavePlayer():
global audioSessionManager
audioSessionManager = AudioUtilities.GetAudioSessionManager()
try:
audioSessionManager = AudioUtilities.GetAudioSessionManager()
except COMError:
log.exception("Could not initialize audio session manager")
return
state = SoundSplitState(config.conf["audio"]["soundSplitState"])
setSoundSplitState(state)
else:
Expand Down

0 comments on commit f3c7f94

Please sign in to comment.