Open Koowah opened 1 month ago
from pydub import AudioSegment def main(): mp3_file_path = "tests/146218705.mp3" wav_file_path = mp3_file_path.replace("mp3", "wav") new_mp3_file_path = mp3_file_path.replace(".mp3", "_new.mp3") sound = AudioSegment.from_mp3(mp3_file_path) sound.export(wav_file_path, format="wav") sound = AudioSegment.from_wav(wav_file_path) sound.export(new_mp3_file_path, format="mp3") if __name__ == "__main__": main()
I should be able to export AudioSegments to mp3
All mp3 exports are corrupted or unreadable. There is no problem with wav exports.
Any audio should do the trick - I tried many coming from different sources.
I installed ffmpeg using conda-forge
Installing ffmpeg build manually and adding its bins to PATH fixed the issue.
For anyone interested here's a tutorial. The gyan.dev build that the tutorial uses is suggested for windows installation on the official ffmpeg website.
Steps to reproduce
Expected behavior
I should be able to export AudioSegments to mp3
Actual behavior
All mp3 exports are corrupted or unreadable. There is no problem with wav exports.
Your System configuration
Is there an audio file you can include to help us reproduce?
Any audio should do the trick - I tried many coming from different sources.
To be noted
I installed ffmpeg using conda-forge