Spaces:
Runtime error
Runtime error
aar2dee2
commited on
Commit
·
12940e9
1
Parent(s):
8ede406
fix custom send audio func
Browse files
app.py
CHANGED
@@ -86,6 +86,7 @@ def convert_to_audio_segment(input_audio):
|
|
86 |
|
87 |
|
88 |
def send_audio(audio_segment: AudioSegment):
|
|
|
89 |
sampling_rate = DEFAULT_SAMPLING_RATE
|
90 |
stream = sd.OutputStream(
|
91 |
channels=1,
|
@@ -96,7 +97,7 @@ def send_audio(audio_segment: AudioSegment):
|
|
96 |
raw_data = audio_segment.raw_data
|
97 |
if audio_segment.frame_rate != sampling_rate:
|
98 |
raw_data = audio_segment.set_frame_rate(sampling_rate).raw_data
|
99 |
-
stream.write(np.frombuffer(raw_data, dtype=np.int16))
|
100 |
|
101 |
|
102 |
def main(input_audio):
|
|
|
86 |
|
87 |
|
88 |
def send_audio(audio_segment: AudioSegment):
|
89 |
+
logger.info("now processing output")
|
90 |
sampling_rate = DEFAULT_SAMPLING_RATE
|
91 |
stream = sd.OutputStream(
|
92 |
channels=1,
|
|
|
97 |
raw_data = audio_segment.raw_data
|
98 |
if audio_segment.frame_rate != sampling_rate:
|
99 |
raw_data = audio_segment.set_frame_rate(sampling_rate).raw_data
|
100 |
+
return stream.write(np.frombuffer(raw_data, dtype=np.int16))
|
101 |
|
102 |
|
103 |
def main(input_audio):
|