Skip to content

Commit

Permalink
Fixed compatibility issue with older python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Mews committed Jun 8, 2024
1 parent 8b65b2b commit b30628b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/simplestretch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ def stretch_audio(
# Delete invalid file
pathlib.Path(output).unlink()

exc.add_note("(Try saving it as a .wav file instead)")
exc.prefix += "\n(Try saving it as a .wav file instead)\n"

raise exc

return (audio, stretched_samplerate)
Expand Down Expand Up @@ -107,4 +108,7 @@ def speedup_audio(
# Stretch audio to match the specified speedup factor
return stretch_audio(
audio=audio, factor=1 / factor, output=output, samplerate=samplerate
)
)


stretch_audio(audio="song.mp3", factor=0.5, output="out.mp3")

0 comments on commit b30628b

Please sign in to comment.