janclemenslab / das

Deep Audio Segmenter
http://janclemenslab.org/das/
25 stars 9 forks source link

Play waveform through speaker doesn't work on Mac #66

Closed kaede-kmr closed 9 months ago

kaede-kmr commented 9 months ago

Hi. While trying to annotate recordings with DAS, I can't hear the sound when I press the 'E' key. The following errors appeared on the terminal window. Seemingly, version of portaudio (v 19.6.0) or python-sounddevice (v 0.4.6) installed from conda is the source of problem. My environment is Macbook Air with M1 chip and MacOS Sonoma 14.2. Everything else, including exporting annotations, training, and prediction processes, has worked fine.

||PaMacCore (AUHAL)|| AUHAL component not found.Traceback (most recent call last): File "/Users/myname/miniforge3/envs/dasx/lib/python3.9/site-packages/xarray_behave/gui/app.py", line 1939, in <lambda> menuitem.triggered.connect(lambda: callback(qt_keycode)) File "/Users/myname/miniforge3/envs/dasx/lib/python3.9/site-packages/xarray_behave/gui/app.py", line 2505, in play_audio sd.play(y, self.fs_song) File "/Users/myname/miniforge3/envs/dasx/lib/python3.9/site-packages/sounddevice.py", line 175, in play ctx.start_stream(OutputStream, samplerate, ctx.output_channels, File "/Users/myname/miniforge3/envs/dasx/lib/python3.9/site-packages/sounddevice.py", line 2582, in start_stream self.stream = StreamClass(samplerate=samplerate, File "/Users/myname/miniforge3/envs/dasx/lib/python3.9/site-packages/sounddevice.py", line 1494, in __init__ _StreamBase.__init__(self, kind='output', wrap_callback='array', File "/Users/myname/miniforge3/envs/dasx/lib/python3.9/site-packages/sounddevice.py", line 898, in __init__ _check(_lib.Pa_OpenStream(self._ptr, iparameters, oparameters, File "/Users/myname/miniforge3/envs/dasx/lib/python3.9/site-packages/sounddevice.py", line 2745, in _check raise PortAudioError(errormsg, err, hosterror_info) sounddevice.PortAudioError: <exception str() failed>

postpop commented 9 months ago

Hi, yes, sound playback is always a bit of an issue. We now use simpleaudio as a fallback, which should work on arm Macs. Reinstalling DAS should fix the problem.

kaede-kmr commented 9 months ago

Now that the audio playback problem is fixed. Thank you so much!