Open Vishav3 opened 3 years ago
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:
Can anyone suggest where I am going wrong?
Not related to this project, still curious if you managed to solve this.
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:
Can anyone suggest where I am going wrong?