Skip to content

Commit

Permalink
Fixed a startup error warning with the audio
Browse files Browse the repository at this point in the history
  • Loading branch information
Gemmstone committed Apr 7, 2024
1 parent 4b432f0 commit ee86c9f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Core/audioManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ def callback_sounddevice(self, indata, outdata, frames, time):
self.audio_stream_signal.emit(normalized_volume)

def callback_pyaudio(self, in_data, frame_count, time_info, status):
if self.audio_stream is None:
return

if status:
self.audio_stream.close()
self.audio_stream = None
Expand All @@ -97,7 +100,10 @@ def callback_pyaudio(self, in_data, frame_count, time_info, status):

volume = int((rms_volume / 32768) * 100)

self.audio_stream_signal.emit(volume)
try:
self.audio_stream_signal.emit(volume)
except RuntimeError:
pass
# print(volume, frame_count, time_info, status)

return None, pyaudio.paContinue
Expand Down

0 comments on commit ee86c9f

Please sign in to comment.