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
|
# legacy compat
|
||||||
import anki.storage
|
import anki.storage
|
||||||
import anki.sync
|
import anki.sync
|
||||||
from anki.utils import isLin, isWin
|
from anki.utils import isLin, isMac, isWin
|
||||||
|
|
||||||
# external module access in Windows
|
|
||||||
if isWin:
|
if isWin:
|
||||||
|
# external module access
|
||||||
import pythoncom
|
import pythoncom
|
||||||
import pywintypes
|
import pywintypes
|
||||||
import win32com
|
import win32com
|
||||||
|
|
||||||
if isLin:
|
if isLin:
|
||||||
|
# file locking
|
||||||
import fcntl
|
import fcntl
|
||||||
|
|
||||||
|
if isMac:
|
||||||
|
# recording
|
||||||
|
import PyQt5.QtMultimedia
|
||||||
|
|
|
@ -507,8 +507,9 @@ class PyAudioThreadedRecorder(threading.Thread):
|
||||||
self.finish = False
|
self.finish = False
|
||||||
if isMac and qtminor > 12:
|
if isMac and qtminor > 12:
|
||||||
# trigger permission prompt
|
# trigger permission prompt
|
||||||
# pylint: disable=undefined-variable
|
from PyQt5.QtMultimedia import QAudioDeviceInfo
|
||||||
QAudioDeviceInfo.defaultInputDevice() # type: ignore
|
|
||||||
|
QAudioDeviceInfo.defaultInputDevice()
|
||||||
|
|
||||||
def run(self) -> None:
|
def run(self) -> None:
|
||||||
chunk = 1024
|
chunk = 1024
|
||||||
|
|
Loading…
Reference in a new issue