Open Vishav3 opened 2 years ago
Are you sure recorder.audio.value has the correct format? Can you save it to disk and upload it?
Note that the error occurs on line 12:
audioFile = AudioSegment.from_file(f, format='webm')
, so everything after that is irrelevant to your problem.
I am trying to convert audio recording in webm format to 'flac' Below is my code:
import time camera = CameraStream(constraints={'audio': True,'video': False}) recorder = AudioRecorder(stream=camera, format='webm') recorder.recording = True time.sleep(5) recorder.recording = False recorder.audio.autoplay = False ipd.display(recorder.audio) with BytesIO(recorder.audio.value) as f: audioFile = AudioSegment.from_file(f, format='webm') with BytesIO() as f: audioFile.export(f, format='flac') audioBytes = f.getvalue()
I am getting the following error:![image](https://user-images.githubusercontent.com/80038335/126083852-3a1c2bde-8709-4110-9cf7-62a6949018c3.png)