mltony / nvda-bluetooth-audio

Bluetooth Audio NVDA add-on improves sound quality when working with bluetooth headphones or speakers.
GNU General Public License v2.0
10 stars 10 forks source link

throws an error when used with nv-box addon #12

Closed cary-rowen closed 8 months ago

cary-rowen commented 1 year ago

NV-Box Sorry, this addon is not localized into other languages, its main language is Chinese.

The error log is as follows:

ERROR - stderr (14:40:25.035) - Thread-4 (15632):
Exception in thread Thread-4:
Traceback (most recent call last):
  File "C:\Users\cary\AppData\Roaming\nvda\addons\NVBox\globalPlugins\nvbox\caiyun\__init__.py", line 127, in broadcastWeather
    ui.message(f'正在获取 {location[2]} 的天气信息')
  File "ui.pyc", line 130, in message
  File "speech\speech.pyc", line 188, in speakMessage
  File "C:\Users\cary\AppData\Roaming\nvda\addons\bluetoothaudio\globalPlugins\bluetoothAudio.py", line 185, in wrapperFunc
    hookFunc()
  File "C:\Users\cary\AppData\Roaming\nvda\addons\bluetoothaudio\globalPlugins\bluetoothAudio.py", line 66, in resetCounter
    beepThread.play(t, reopen)
  File "C:\Users\cary\AppData\Roaming\nvda\addons\bluetoothaudio\globalPlugins\bluetoothAudio.py", line 165, in play
    self.timer.Start(timerDuration, wx.TIMER_ONE_SHOT)
wx._core.wxAssertionError: C++ assertion "wxThread::IsMain()" failed at ..\..\src\common\timerimpl.cpp(57) in wxTimerImpl::Start(): timer can only be started from the main thread

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "threading.pyc", line 926, in _bootstrap_inner
  File "threading.pyc", line 870, in run
  File "C:\Users\cary\AppData\Roaming\nvda\addons\NVBox\globalPlugins\nvbox\wrapper.py", line 32, in run
    func(*args, **kwargs)
  File "C:\Users\cary\AppData\Roaming\nvda\addons\NVBox\globalPlugins\nvbox\caiyun\__init__.py", line 137, in broadcastWeather
    ui.message(f'{e}')
  File "ui.pyc", line 130, in message
  File "speech\speech.pyc", line 188, in speakMessage
  File "C:\Users\cary\AppData\Roaming\nvda\addons\bluetoothaudio\globalPlugins\bluetoothAudio.py", line 185, in wrapperFunc
    hookFunc()
  File "C:\Users\cary\AppData\Roaming\nvda\addons\bluetoothaudio\globalPlugins\bluetoothAudio.py", line 66, in resetCounter
    beepThread.play(t, reopen)
  File "C:\Users\cary\AppData\Roaming\nvda\addons\bluetoothaudio\globalPlugins\bluetoothAudio.py", line 165, in play
    self.timer.Start(timerDuration, wx.TIMER_ONE_SHOT)
wx._core.wxAssertionError: C++ assertion "wxThread::IsMain()" failed at ..\..\src\common\timerimpl.cpp(57) in wxTimerImpl::Start(): timer can only be started from the main thread
IO - tones.beep (14:40:25.144) - Thread-3 (10476):
Beep at pitch 659, for 50 ms, left volume 50, right volume 50
cary-rowen commented 8 months ago

Fix by #17