A small package to stretch audio
Reason this release was yanked:
Major bug that ignored the path provided to the function and always opened "song.mp3"
Project description
simpleaudiostretch
A simple python package to stretch audio files and change their speed.
Installation
You can install the package by running the command
pip install simpleaudiostretch
Features
- Supports many different audio formats, including mp3, wav, and also raw audio data in the form of numpy ndarrays.
- Its incredibly fast, especially when working with raw audio data.
Usage/Examples
This is an example on how you might use this library
In this example we take a file called song.mp3
and make it twice as long:
import simplestretch
#A factor of 2 means the song becomes twice as long
simplestretch.stretch_audio("song.mp3", 2, "out.wav")
You might also have the raw audio data, in which case you could do the following:
import simplestretch, soundfile
# In this example we use soundfile to get the audio data
# But you can use any numpy ndarray representing audio
audio_data, samplerate = soundfile.read("song.mp3")
#When working with raw audio data
#You will also need to pass the audio's sample rate to the function
simplestretch.stretch_audio(audio_data, 2, output="out.wav", samplerate=samplerate)
You can also work with changes in speed rather than changes in length through the speedup_audio
method:
import simplestretch
#In this example we make the song twice as fast rather than twice as long
simplestretch.speedup_audio("song.mp3", 2, "out.wav")
Support
If you have any issues using this package or would like to request features, you can open an issue or contact me through my discord!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for simpleaudiostretch-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c34d0293f20c275c828f6310074261e678e4d7c1a79d8cd68943668e196143e7 |
|
MD5 | b0ef3d63837b3a7406606044d8363bb3 |
|
BLAKE2b-256 | c0a9b4902efd0e5da816ea1b597bd7ed441c8e77b3fa35c3226fe83a1f6565e6 |