Skip to content

baresip failed to set audio-source (Function not implemented) #16

Open
@bhupiister

Description

@bhupiister

The below line of code was the issue in my case. I had to change

    def convert_audio(input_file, outfile=None,ismp3=False):
        input_file = expanduser(input_file)
        sound = AudioSegment.from_file(input_file)
        sound += AudioSegment.silent(duration=500)
        # ensure minimum time
        # workaround baresip bug
        while sound.duration_seconds < 3:
            sound += AudioSegment.silent(duration=500)

        outfile = outfile or join(tempfile.gettempdir(), "pybaresip.wav")
        sound = sound.set_frame_rate(48000)
        sound = sound.set_channels(2)        
        sound.export(outfile, format="wav")
        return outfile, sound.duration_seconds

Making the frame rate and set_channel as below made it work

        sound = sound.set_frame_rate(8000)
        sound = sound.set_channels(1)

The problem may be related to the hardware, unable to play the device at higher frame rate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions