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

MP3 exports unreadable/corrupted #806

Open
Koowah opened this issue Aug 7, 2024 · 1 comment
Open

MP3 exports unreadable/corrupted #806

Koowah opened this issue Aug 7, 2024 · 1 comment

Comments

@Koowah
Copy link

Koowah commented Aug 7, 2024

Steps to reproduce

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()

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

  • Python version: 3.9.19
  • Pydub version: 0.25.1
  • ffmpeg or avlib?: ffmpeg
  • ffmpeg/avlib version: 7.0.1

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

@Koowah
Copy link
Author

Koowah commented Aug 12, 2024

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.

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