Jump to content

Install the PyDub module, and the Simpleaudio module that it depends on for playback - just run

python3 -m pip install pydub simpleaudio

Then you should be able to do:

import pydub, pydub.effects, pydub.playback

audio_snippet = pydub.AudioSegment.from_mp3("audiosnippet.mp3")
audio_snippet_faster = pydub.effects.speedup(audio_snippet, playback_speed=2.5)
pydub.playback.play(audio_snippet_faster)

 

____________________________________________________________________________________________________________________________________

 

 

____________________________________________________________________________________________________________________________________

pythonmegapixel

into tech, public transport and architecture // amateur programmer // youtuber // beginner photographer

Thanks for reading all this by the way!

By the way, my desktop is a docked laptop. Get over it, No seriously, I have an exterrnal monitor, keyboard, mouse, headset, ethernet and cooling fans all connected. Using it feels no different to a desktop, it works for several hours if the power goes out, and disconnecting just a few cables gives me something I can take on the go. There's enough power for all games I play and it even copes with basic (and some not-so-basic) video editing. Give it a go - you might just love it.

Link to comment
https://linustechtips.com/topic/1320413-python-audio-handling/#findComment-14602093
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×