-
Notifications
You must be signed in to change notification settings - Fork 472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stream and play #114
Comments
I have a gradio example for it: |
Thank you very much, it helps me a lot !!!
|
this is my example to make it more smooth, but i still heard static between the chunks, if someone can enhance it to play it smoother please make a revision |
This small script help add crossfade and avoid static noise between chunk combined_audio = AudioSegment.silent(duration=100)
# Process each audio chunk and apply crossfade
for chunk in audio_chunks:
audio_segment = AudioSegment.from_raw(
io.BytesIO(chunk), sample_width=2, frame_rate=44100, channels=1
)
if len(combined_audio) > 0:
chunk_length_ms = (len(chunk) / 44100) * 1000
crossfade_duration = int(0.1 * chunk_length_ms)
else:
crossfade_duration = 0
combined_audio = combined_audio.append(audio_segment, crossfade=crossfade_duration) |
It's so appealing for me to use streaming.
But I'm sorry, I'm a beginner. This is my first time learning about and wanting to use the stream feature. Could you provide a specific example of streaming it and playing it?"
The text was updated successfully, but these errors were encountered: