mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
fix missing QAudioDeviceInfo on macOS
This commit is contained in:
parent
ecab88d8c5
commit
37695da713
2 changed files with 10 additions and 4 deletions
|
@ -26,13 +26,18 @@ import socks
|
|||
# legacy compat
|
||||
import anki.storage
|
||||
import anki.sync
|
||||
from anki.utils import isLin, isWin
|
||||
from anki.utils import isLin, isMac, isWin
|
||||
|
||||
# external module access in Windows
|
||||
if isWin:
|
||||
# external module access
|
||||
import pythoncom
|
||||
import pywintypes
|
||||
import win32com
|
||||
|
||||
if isLin:
|
||||
# file locking
|
||||
import fcntl
|
||||
|
||||
if isMac:
|
||||
# recording
|
||||
import PyQt5.QtMultimedia
|
||||
|
|
|
@ -507,8 +507,9 @@ class PyAudioThreadedRecorder(threading.Thread):
|
|||
self.finish = False
|
||||
if isMac and qtminor > 12:
|
||||
# trigger permission prompt
|
||||
# pylint: disable=undefined-variable
|
||||
QAudioDeviceInfo.defaultInputDevice() # type: ignore
|
||||
from PyQt5.QtMultimedia import QAudioDeviceInfo
|
||||
|
||||
QAudioDeviceInfo.defaultInputDevice()
|
||||
|
||||
def run(self) -> None:
|
||||
chunk = 1024
|
||||
|
|
Loading…
Reference in a new issue