a python library for manipulating audio files

ucbvislab ucbvislab Last update: Feb 24, 2022

radiotool - tools for constructing audio

Important note

Some parts of this codebase have had significant changes since thelast revision of the documentation- so the current documentation iswrong in some places. I will try to update the documentation as soonas I can, but for now, feel free to ask me questions if anything isnot clear.

Description

Radiotool is a python library that aims to make it easy to createaudio by piecing together bits of other audio files. This library wasoriginally written to enable my research in audio editing userinterfaces, but perhaps someone else might find it useful.

Read the full documentation.

To perform the actual audio rendering, radiotool relies onscikits.audiolab, a python wrapper for libsndfile.

Installation

Either pip install radiotool or clone the repository and runpython setup.py install.

Requirements

libsndfile, numpy, scikits.audiolab, and librosa.

exempi for writing Audition/Premiere-readable labels to audio files.

Composition

The heart of radiotool is the Composition. A Composition isbuilt out of Segments, which represent segments of audioTracks (or raw PCM data, in the case of RawTracks). You canalso add Dynamics to adjust the volume of segments in certainways.

Simple example

from radiotool.composer import *comp = Composition()# create a track with a pre-existing wav filetrack = Track("test.wav")# create a segment of a track that:# 1. starts at the 0.0 mark of the composition# 2. begins playing at the 0.5 second mark of the track# 3. plays for 1.0 secondssegment = Segment(track, 0.0, 0.5, 1.0)# add segment to the compositioncomp.add_segment(segment)# output your composition as a numpy arrayarr_out = comp.build()# or export your composition as an audio file, composition.wavcomp.export(filename="composition")

Retargeting

Music retargeting is the idea of taking a song and remixing it fromits own existing beats/structure to fit the music to certainconstraints.

See http://ucbvislab.github.io/radiotool/algorithms/retarget.html forapplications of music retargeting, and details about how to retargetmusic using raditool.

See the documentation for more detail.

Tags:

Subscribe to our newsletter