Skip to main content

A real-time audio time-scale modification library

Project description

Documentation Status Build Status

AudioTSM is a python library for real-time audio time-scale modification procedures, i.e. algorithms that change the speed of an audio signal without changing its pitch.

Documentation:
https://audiotsm.readthedocs.io/
Source code repository and issue tracker:
https://github.com/Muges/audiotsm/
License:
MIT – see the file LICENSE for details.

Installation

Audiotsm should work with python 2.7 and python 3.4+.

For now you should probably install audiotsm directly from the github repository using pip:

pip install git+https://github.com/Muges/audiotsm.git

A package should be available on PyPI soon.

You may also need to install the sounddevice library in order to run the examples or to use a StreamWriter.

Basic usage

The audiotsm package implements several time-scale modification procedures:

  • OLA (Overlap-Add), which should only be used for percussive audio signals;
  • WSOLA (Waveform Similarity-based Overlap-Add), an amelioration of the OLA procedure which should give good results on most inputs.

Below is a basic example showing how to reduce the speed of a wav file by half using the WSOLA procedure:

from audiotsm import wsola
from audiotsm.io.wav import WavReader, WavWriter

with WavReader(input_filename) as reader:
    with WavWriter(output_filename, reader.channels, reader.samplerate) as writer:
        tsm = wsola(reader.channels, speed=0.5)
        tsm.run(reader, writer)

Thanks

If you are interested in time-scale modification procedures, I highly recommend reading A Review of Time-Scale Modification of Music Signals by Jonathan Driedger and Meinard Müller.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for audiotsm, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size audiotsm-0.1.0-py2.py3-none-any.whl (22.2 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size audiotsm-0.1.0.tar.gz (31.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page