Skip to content
New issue

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

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

Open
bhupiister opened this issue Sep 4, 2024 · 0 comments
Open

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

bhupiister opened this issue Sep 4, 2024 · 0 comments

Comments

@bhupiister
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant