Skip to main content
Join the official Python Developers Survey 2018 and win valuable prizes: Start the survey!

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/
Examples:
https://muges.github.io/audiotsm/
Source code repository and issue tracker:
https://github.com/Muges/audiotsm/
Python Package Index:
https://pypi.python.org/pypi/audiotsm/
License:
MIT – see the file LICENSE for details.

Installation

Audiotsm should work with python 2.7 and python 3.4+.

You can install the latest version of audiotsm with pip:

pip install audiotsm

If you want to use the gstreamer plugins, you should install PyGObject and python-gst, and use the following command to install audiotsm:

pip install audiotsm[gstreamer]

If you want to play the output of the TSM procedures in real time, or to use the examples, you should install audiotsm as follow:

pip install audiotsm[stream]

Basic usage

The audiotsm package implements several time-scale modification procedures:

  • OLA (Overlap-Add);
  • WSOLA (Waveform Similarity-based Overlap-Add);
  • Phase Vocoder.

The OLA procedure should only be used on percussive audio signals. The WSOLA and the Phase Vocoder procedures are improvements of the OLA procedure, and should both give good results in most cases.

If you are unsure which procedure to choose, the Phase Vocoder should sound best in most cases. You can listen to the output of the different procedures on various audio files and at various speeds on the examples page.

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

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

with WavReader(input_filename) as reader:
    with WavWriter(output_filename, reader.channels, reader.samplerate) as writer:
        tsm = phasevocoder(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.

Filename, size & hash SHA256 hash help File type Python version Upload date
audiotsm-0.1.2-py2.py3-none-any.whl (32.2 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Sep 21, 2017
audiotsm-0.1.2.tar.gz (6.6 MB) Copy SHA256 hash SHA256 Source None Sep 21, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page