Saving mp3 filetypes on windows #6
Domino9752
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Thanks for all your work! I've used your code as a learning guide, it's been great fun. I've moved the weights to a model directory, and added a random_prompt generator on a button. Your code has been an excellent guide!
To give a little pay-back, I'd thought I might mention that on windows the save to mp3 call requires ffmpeg be installed and its directory be in the windows path. This code snippet helped isolate the problem for me:
from pydub import AudioSegment
try:
# Generate a 1-second silent audio segment for testing
silent = AudioSegment.silent(duration=1000) # 1 second of silence
silent.export("test.mp3", format="mp3")
print("FFmpeg is working and the MP3 file was created successfully.")
except Exception as e:
print(f"An error occurred: {e}"
Beta Was this translation helpful? Give feedback.
All reactions