question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting exact bitrate for Mp3 file

See original GitHub issue

I’ve tried to change bitrate of this sample mp3 file:

audio = AudioSegment.from_file('Canon.mp3')
audio.export('Canon2.mp3', bitrate='16k', format='mp3')

but it seems that resulted audio file is in ‘32k’ bitrate:

mediainfo('Canon2.mp3')['bit_rate']
32022

I’m using ffmpeg for conversion and I’ve tried setting codec parameter which didn’t help:

audio.export('Canon2.mp3', bitrate='16k', format='mp3', parameters=['-codec:a', 'libmp3lame'])

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
nourniacommented, May 31, 2016

Thanks.

0reactions
PasinduAnthonycommented, Jul 30, 2020

Really usefull

Read more comments on GitHub >

github_iconTop Results From Across the Web

3 Ways to Change Bitrate on MP3 Files - Online Tech Tips
If you want a higher bitrate MP3 than you currently have, you need to go back to the source (CD, etc) and extract...
Read more >
How to Determine the True Bitrate of any Audio File - Appuals
First install Spek on your PC and launch it. · Now find an audio file (MP3, WAV, FLAC, AAC, whatever) you want to...
Read more >
[Easy Guide] How to Change Bitrate of MP3 File - Joyoshare
Then, select MP3 under "General Audio" option. There is a gear icon appearing at the top right corner of the selected format. You...
Read more >
How to Use an Audio Bitrate Converter - Movavi
Here we describe how to change bitrate for an MP3 file. To set a specific bitrate, select the Custom option under Bitrate type....
Read more >
MP3 Export Options - Audacity Manual
Use constant bit rate if you are streaming the file over the Internet, as it ensures the audio cannot stutter due to sudden...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found