We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
` complete_audio_chunk = pydub.AudioSegment.empty() while True: if webrtc_ctx.audio_receiver: sound_chunk = pydub.AudioSegment.empty() try: audio_frames = webrtc_ctx.audio_receiver.get_frames(timeout=1) except queue.Empty: time.sleep(0.1) status_indicator.write("No frame arrived.") continue
status_indicator.write("Running. Say something!") for idx, audio_frame in enumerate(audio_frames): sound = pydub.AudioSegment( data=audio_frame.to_ndarray().tobytes(), sample_width=audio_frame.format.bytes, frame_rate=audio_frame.sample_rate, channels=len(audio_frame.layout.channels), ) op = str(idx) + "omg" + str(audio_frame.to_ndarray().shape) text_output.write(op) sound_chunk += sound complete_audio_chunk += sound else: status_indicator.write("Audio Receiver is not set. Abort.") break complete_audio_chunk.export("/home/kp/temp/audio_file.wav", format="wav") logger.info("ENEDNEND call") st.write("end call")
`
I tried the above code, (copied from https://github.com/whitphx/streamlit-webrtc-example/blob/main/app.py). Only audio frames are of interest for me. But, audio is not saved in audio_file.wav at all.
The text was updated successfully, but these errors were encountered:
whitphx/streamlit-webrtc#357 might help.
Sorry, something went wrong.
No branches or pull requests
`
complete_audio_chunk = pydub.AudioSegment.empty()
while True:
if webrtc_ctx.audio_receiver:
sound_chunk = pydub.AudioSegment.empty()
try:
audio_frames = webrtc_ctx.audio_receiver.get_frames(timeout=1)
except queue.Empty:
time.sleep(0.1)
status_indicator.write("No frame arrived.")
continue
`
I tried the above code, (copied from https://github.com/whitphx/streamlit-webrtc-example/blob/main/app.py). Only audio frames are of interest for me. But, audio is not saved in audio_file.wav at all.
The text was updated successfully, but these errors were encountered: