Skip to content

Convert audio recording in 'webm' to 'flac' format  #100

@Vishav3

Description

@Vishav3

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

Can anyone suggest where I am going wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions