Bundle sounddevice PortAudio library in sidecar builds
On macOS, sounddevice ships its own PortAudio dylib in the _sounddevice_data directory. PyInstaller wasn't collecting it, causing "Error querying device -1" when the sidecar tried to open an audio stream. Added data collection for _sounddevice_data in both cloud and headless PyInstaller specs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -19,9 +19,26 @@ datas = [
|
|||||||
('config/default_config.yaml', 'config'),
|
('config/default_config.yaml', 'config'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# Collect sounddevice's bundled PortAudio library (_sounddevice_data)
|
||||||
|
try:
|
||||||
|
import sounddevice
|
||||||
|
sd_path = os.path.dirname(sounddevice.__file__)
|
||||||
|
sd_data = os.path.join(sd_path, '_sounddevice_data')
|
||||||
|
if os.path.exists(sd_data):
|
||||||
|
datas.append((sd_data, '_sounddevice_data'))
|
||||||
|
print(f" + Collected sounddevice PortAudio data from {sd_data}")
|
||||||
|
# Also collect the package itself
|
||||||
|
sd_datas = collect_data_files('sounddevice')
|
||||||
|
if sd_datas:
|
||||||
|
datas += sd_datas
|
||||||
|
print(f" + Collected {len(sd_datas)} sounddevice data files")
|
||||||
|
except ImportError:
|
||||||
|
print(" - Warning: sounddevice not found")
|
||||||
|
|
||||||
# Hidden imports -- only lightweight deps needed for Deepgram streaming
|
# Hidden imports -- only lightweight deps needed for Deepgram streaming
|
||||||
hiddenimports = [
|
hiddenimports = [
|
||||||
'sounddevice',
|
'sounddevice',
|
||||||
|
'_sounddevice_data',
|
||||||
'numpy',
|
'numpy',
|
||||||
# FastAPI and dependencies
|
# FastAPI and dependencies
|
||||||
'fastapi',
|
'fastapi',
|
||||||
|
|||||||
@@ -38,6 +38,21 @@ datas = [
|
|||||||
(vad_assets_path, 'faster_whisper/assets'),
|
(vad_assets_path, 'faster_whisper/assets'),
|
||||||
] + pvporcupine_data_files
|
] + pvporcupine_data_files
|
||||||
|
|
||||||
|
# Collect sounddevice's bundled PortAudio library (_sounddevice_data)
|
||||||
|
try:
|
||||||
|
import sounddevice
|
||||||
|
sd_path = os.path.dirname(sounddevice.__file__)
|
||||||
|
sd_data = os.path.join(sd_path, '_sounddevice_data')
|
||||||
|
if os.path.exists(sd_data):
|
||||||
|
datas.append((sd_data, '_sounddevice_data'))
|
||||||
|
print(f" + Collected sounddevice PortAudio data from {sd_data}")
|
||||||
|
sd_datas = collect_data_files('sounddevice')
|
||||||
|
if sd_datas:
|
||||||
|
datas += sd_datas
|
||||||
|
print(f" + Collected {len(sd_datas)} sounddevice data files")
|
||||||
|
except ImportError:
|
||||||
|
print(" - Warning: sounddevice not found")
|
||||||
|
|
||||||
# Hidden imports -- NO PySide6/Qt needed for headless backend
|
# Hidden imports -- NO PySide6/Qt needed for headless backend
|
||||||
hiddenimports = [
|
hiddenimports = [
|
||||||
# Transcription engine
|
# Transcription engine
|
||||||
@@ -46,6 +61,7 @@ hiddenimports = [
|
|||||||
'faster_whisper.vad',
|
'faster_whisper.vad',
|
||||||
'ctranslate2',
|
'ctranslate2',
|
||||||
'sounddevice',
|
'sounddevice',
|
||||||
|
'_sounddevice_data',
|
||||||
'scipy',
|
'scipy',
|
||||||
'scipy.signal',
|
'scipy.signal',
|
||||||
'numpy',
|
'numpy',
|
||||||
|
|||||||
Reference in New Issue
Block a user