Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Mews committed Jun 9, 2024
2 parents 29c4d4e + c203c45 commit 8b34c4b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
[![Tests badge](https://github.com/Mews/simpleaudiostretch/actions/workflows/run_tests.yml/badge.svg)](https://github.com/Mews/simpleaudiostretch/actions/workflows/run_tests.yml)
[![Coverage badge](https://raw.githubusercontent.com/Mews/simpleaudiostretch/python-coverage-comment-action-data/badge.svg)](https://htmlpreview.github.io/?https://github.com/Mews/simpleaudiostretch/blob/python-coverage-comment-action-data/htmlcov/index.html)
[![Documentation badge](https://readthedocs.org/projects/simpleaudiostretch/badge/?version=latest&style=flat-default)](https://simpleaudiostretch.readthedocs.io/en/latest/simplestretch.html)
[![PyPI Version](https://badge.fury.io/py/simpleaudiostretch.svg)](https://pypi.python.org/pypi/simpleaudiostretch)
[![PyPI Version](https://img.shields.io/pypi/v/simpleaudiostretch?label=pypi%20package)](https://pypi.python.org/pypi/simpleaudiostretch)
[![PyPI Downloads](https://img.shields.io/pypi/dm/simpleaudiostretch)](https://pypi.python.org/pypi/simpleaudiostretch)

A simple python package to stretch audio files and change their speed.

Expand All @@ -25,7 +26,7 @@ In this example we take a file called `song.mp3` and make it twice as long:
```python
import simplestretch

#A factor of 2 means the song becomes twice as long
# A factor of 2 means the song becomes twice as long
simplestretch.stretch_audio("song.mp3", 2, "out.wav")
```

Expand All @@ -37,16 +38,16 @@ import simplestretch, soundfile
# 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
# 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:
```python
import simplestretch

#In this example we make the song twice as fast rather than twice as long
# In this example we make the song twice as fast rather than twice as long
simplestretch.speedup_audio("song.mp3", 2, "out.wav")
```
## CLI
Expand Down

0 comments on commit 8b34c4b

Please sign in to comment.