Skip to main content

cysox

PyPI Python License: MIT Docs

A Python audio processing tool / library which uses Cython to wrap libsox.

Documentation | API Reference | Examples

Features

  • Simple API: Convert, analyze, and play audio with one-liners

  • Typed Effects: 27 base effect classes with IDE autocomplete and range-checked parameters, plus fx.Raw for anything not yet wrapped

  • 53 Effect Presets: Ready-to-use composite effects for voice, lo-fi, drums, mastering, and more

  • Sample Processing: Auto-trim silence, split recordings into one-shots, generate chromatic pitch scales, batch process directories

  • Drum Loop Tools: Slice loops by BPM, create stutter effects, apply beat-synced processing

  • High Performance: Direct C bindings through Cython, KissFFT-accelerated onset detection

  • Zero Configuration: Auto-initialization, no manual setup required

  • Cross-Platform: macOS, Linux (Windows placeholder)

Installation

Note that cysox only works on macOS and Linux.

pip install cysox

The wheels bundle libsox with wav, flac, ogg/vorbis, mp3 and opus (read only) support, and need no system audio libraries.

Command Line Interface

# Show version
cysox --version

# Get audio file info
cysox info audio.wav

# Convert audio files
cysox convert input.wav output.mp3
cysox convert input.wav output.wav --rate 48000 --channels 1
cysox convert input.wav output.wav -p Telephone

# Play audio
cysox play audio.wav

# Concatenate files
cysox concat intro.wav main.wav outro.wav -o full.wav

# List available effect presets
cysox preset list
cysox preset list drums          # Filter by category

# Get preset info and parameters
cysox preset info Chipmunk

# Apply a preset to audio
cysox preset apply Telephone input.wav output.wav
cysox preset apply Chipmunk input.wav output.wav --intensity=2.0

# Slice audio into segments
cysox slice drums.wav output_dir/ -n 8
cysox slice drums.wav output_dir/ --bpm 120 --beats 1
cysox slice drums.wav output_dir/ -n 4 -p DrumPunch

# Slice at detected transients (automatic beat detection)
# -t threshold (e.g. 0.3), -s sensitivity (default 1.5), -m method (default hfc)
cysox slice drums.wav output_dir/ -t 0.3
cysox slice drums.wav output_dir/ -t 0.2 -s 1.2 -m flux

# Create stutter effects
cysox stutter drums.wav stutter.wav -d 0.125 -r 8
cysox stutter drums.wav stutter.wav -s 0.5 -d 0.25 -r 4 -p GatedReverb

# Trim silence from beginning and end of audio
cysox auto-trim raw.wav trimmed.wav
cysox auto-trim raw.wav trimmed.wav --thresh -36 --fadein 10 --fadeout 50
cysox auto-trim raw.wav trimmed.wav --speedup 2

# Split continuous recording into one-shots at silence gaps
cysox split recording.wav one_shots/
cysox split recording.wav one_shots/ --thresh -36 --min-silence 0.5

# Generate pitch-shifted copies (chromatic scale)
cysox pitch-scale sample.wav scale/                    # 12 semitones (1 octave)
cysox pitch-scale sample.wav scale/ --range 24 --offset -12

# Batch process all audio files in a directory
cysox batch raw_samples/ processed/ -p Normalize
cysox batch raw_samples/ processed/ --rate 44100 --channels 1 --format wav
cysox batch raw_samples/ processed/ --no-recursive -p DrumPunch

Quick Start

import cysox
from cysox import fx

# Get audio file info
info = cysox.info('audio.wav')
print(f"Duration: {info['duration']:.2f}s, Sample rate: {info['sample_rate']} Hz")

# Convert with effects
cysox.convert('input.wav', 'output.mp3', effects=[
    fx.Normalize(),
    fx.Reverb(reverberance=60),
    fx.Fade(fade_in=0.5, fade_out=1.0),
])

# Play audio (macOS/Linux)
cysox.play('audio.wav')

# Play with effects
cysox.play('audio.wav', effects=[fx.Volume(db=-6)])

Core Functions

cysox.info(path) -> AudioInfo

Get audio file metadata. Returns an AudioInfo object supporting both attribute access and dict-style access:

info = cysox.info('audio.wav')
print(info.duration)         # Attribute access
print(info['sample_rate'])   # Dict-style access (backwards compatible)
# Fields: path, format, duration, sample_rate, channels,
#         bits_per_sample, samples, encoding

cysox.convert(input, output, effects=[], **options)

Convert audio files with optional effects and format options:

# Simple format conversion
cysox.convert('input.wav', 'output.mp3')

# With effects
cysox.convert('input.wav', 'output.wav', effects=[
    fx.Volume(db=3),
    fx.Bass(gain=5),
    fx.Reverb(),
])

# With format options
cysox.convert('input.wav', 'output.wav',
    sample_rate=48000,
    channels=1,
    bits=24,
)

cysox.stream(path, chunk_size=8192) -> Iterator[memoryview]

Stream audio samples for processing:

import numpy as np

for chunk in cysox.stream('large.wav', chunk_size=8192):
    arr = np.frombuffer(chunk, dtype=np.int32)
    process(arr)

cysox.play(path, effects=[])

Play audio to the default audio device:

cysox.play('audio.wav')
cysox.play('audio.wav', effects=[fx.Volume(db=-6), fx.Reverb()])

cysox.concat(inputs, output)

Concatenate multiple audio files:

cysox.concat(['intro.wav', 'main.wav', 'outro.wav'], 'full.wav')

All input files must have the same sample rate and channel count.

Effects Module

The cysox.fx module provides 27 base effect classes and 53 composite presets, plus fx.Raw for any sox effect without a typed class yet:

Volume & Dynamics

fx.Volume(db=3)                    # Adjust volume in dB
fx.Gain(db=6)                      # Apply gain
fx.Normalize(level=-3)             # Normalize to target level

Equalization

fx.Bass(gain=5, frequency=100)     # Boost/cut bass
fx.Treble(gain=-2, frequency=3000) # Boost/cut treble
fx.Equalizer(frequency=1000, width=1.0, gain=3)

Filters

fx.HighPass(frequency=200)         # Remove low frequencies
fx.LowPass(frequency=8000)         # Remove high frequencies
fx.BandPass(frequency=1000, width=100)
fx.BandReject(frequency=60, width=10)  # Notch filter

Spatial & Reverb

fx.Reverb(reverberance=50, room_scale=100)
fx.Echo(gain_in=0.8, gain_out=0.9, delays=[100], decays=[0.5])
fx.Chorus()
fx.Flanger()

Time-Based

fx.Trim(start=1.0, end=5.0)        # Extract portion
fx.Pad(before=0.5, after=1.0)      # Add silence
fx.Speed(factor=1.5)               # Change speed (affects pitch)
fx.Tempo(factor=1.5)               # Change tempo (preserves pitch)
fx.Pitch(cents=100)                # Shift pitch (preserves tempo)
fx.Reverse()                       # Reverse audio
fx.Fade(fade_in=0.5, fade_out=1.0) # Fade in/out
fx.Repeat(count=3)                 # Repeat audio
fx.Silence(threshold=-48)          # Remove silence by amplitude

Conversion

fx.Rate(sample_rate=48000)         # Resample
fx.Channels(channels=1)            # Change channel count
fx.Remix(mix=["1,2"])              # Custom channel mixing
fx.Dither()                        # Add dither

Any Other sox Effect

The typed classes cover 27 effects. fx.Raw reaches everything else libsox provides — compand, vad, noisered, synth, stats, phaser, overdrive, tremolo, sinc and the rest — with arguments passed through verbatim:

fx.Raw('compand', '0.3,1', '6:-70,-60,-20', -5, -90, 0.2)   # Compression
fx.Raw('vad')                                               # Trim leading silence
fx.Raw('overdrive', 5, 20)                                  # Distortion

You give up the validation and autocomplete a typed class provides, so prefer a typed class where one exists. An unknown effect name is reported when the chain is built.

Composite Effects

Create reusable effect combinations:

from cysox.fx import CompositeEffect, HighPass, LowPass, Reverb, Volume

class TelephoneEffect(CompositeEffect):
    """Simulate telephone audio quality."""

    @property
    def effects(self):
        return [
            HighPass(frequency=300),
            LowPass(frequency=3400),
            Volume(db=-3),
        ]

# Use like any other effect
cysox.convert('input.wav', 'output.wav', effects=[TelephoneEffect()])

Effect Presets

The library includes 54 ready-to-use composite effect presets organized by category:

Voice Effects

fx.Chipmunk(intensity=1.8)         # High-pitched voice
fx.DeepVoice(intensity=0.6)        # Low, slowed voice
fx.Robot(intensity=70)             # Metallic robotic voice
fx.HauntedVoice(pitch_shift=5)     # Spooky ghost effect
fx.VocalClarity(presence_boost=4)  # Enhanced vocal presence
fx.Whisper()                       # Intimate whisper effect

Lo-Fi Effects

fx.Telephone(sample_rate=8000)     # Classic telephone sound
fx.AMRadio()                       # AM radio broadcast
fx.Megaphone(volume_boost=6)       # Bullhorn effect
fx.Underwater(depth=500)           # Submerged/muffled sound
fx.VinylWarmth(bass_boost=3)       # Warm vinyl aesthetic
fx.LoFiHipHop(warmth=4)            # Lo-fi hip hop style
fx.Cassette()                      # Cassette tape degradation

Spatial Effects

fx.SmallRoom(wetness=30)           # Intimate room reverb
fx.LargeHall(size=100, decay=70)   # Concert hall ambience
fx.Cathedral()                     # Church reverb
fx.Bathroom()                      # Tiled room reverb
fx.Stadium()                       # Arena with echo

Broadcast Effects

fx.Podcast()                       # Voice cleanup + presence
fx.RadioDJ(presence=4)             # Punchy broadcast voice
fx.Voiceover()                     # Professional VO processing
fx.Intercom()                      # PA system effect
fx.WalkieTalkie()                  # Two-way radio

Musical Effects

fx.EightiesChorus(depth=4)         # Classic 80s chorus
fx.DreamyPad()                     # Ethereal ambient texture
fx.SlowedReverb(slow_factor=0.85)  # Slowed + reverb aesthetic
fx.SlapbackEcho(delay_ms=120)      # Rockabilly short delay
fx.DubDelay(tempo_ms=375)          # Rhythmic dub delays
fx.JetFlanger()                    # Extreme flanger sweep
fx.ShoegazeWash()                  # Heavy reverb/chorus wash

Drum Loop Effects

fx.HalfTime(preserve_pitch=True)   # Slow to half speed
fx.DoubleTime(preserve_pitch=True) # Speed up to double
fx.DrumPunch(punch=4, attack=3)    # Enhance punch and attack
fx.DrumCrisp(brightness=4)         # Crisp, bright drums
fx.DrumFat(fatness=5)              # Thick, heavy drums
fx.Breakbeat()                     # Classic breakbeat processing
fx.VintageBreak()                  # Lo-fi sampled break sound
fx.DrumRoom(room_size=40)          # Natural room ambience
fx.GatedReverb()                   # 80s gated reverb
fx.DrumSlice(start=0, duration=0.5)# Extract a segment
fx.ReverseCymbal(fade_duration=0.5)# Reverse riser effect
fx.LoopReady()                     # Prepare for seamless looping

Mastering Effects

fx.BroadcastLimiter(target_level=-1)  # Broadcast-ready limiting
fx.WarmMaster(warmth=1.5)             # Warm mastering preset
fx.BrightMaster(air=2)                # Bright/airy mastering
fx.LoudnessMaster(target_level=-0.3)  # Maximum loudness

Cleanup Effects

fx.RemoveRumble(cutoff=60)         # High-pass for rumble
fx.RemoveHiss(cutoff=12000)        # Low-pass for tape hiss
fx.RemoveHum(frequency=60)         # Notch filter for hum (50/60Hz)
fx.CleanVoice()                    # Basic voice cleanup
fx.TapeRestoration()               # Restore tape recordings

Transition Effects

fx.FadeInOut(fade_in_secs=0.3, fade_out_secs=0.3)
fx.CrossfadeReady(fade_duration=0.3)

Chaining Presets

Presets can be combined with each other and base effects:

cysox.convert('input.wav', 'output.wav', effects=[
    fx.RemoveRumble(),      # Cleanup first
    fx.VinylWarmth(),       # Apply lo-fi aesthetic
    fx.SmallRoom(),         # Add room ambience
    fx.WarmMaster(),        # Final mastering
])

Drum Loop Slicing

cysox provides utilities for slicing drum loops and creating stutter effects.

cysox.slice_loop() - Split Loops into Segments

Split an audio file into multiple segment files:

import cysox
from cysox import fx

# Slice into equal parts
slices = cysox.slice_loop('drums.wav', 'output_dir/', slices=8)
# Creates: output_dir/drums_slice_000.wav through drums_slice_007.wav

# Slice by BPM (one beat per slice)
slices = cysox.slice_loop('drums.wav', 'output_dir/', bpm=120, beats_per_slice=1)

# Slice with effects applied to each segment
slices = cysox.slice_loop('drums.wav', 'output_dir/',
    slices=8,
    effects=[fx.DrumPunch()]
)

Parameters:

  • path: Input audio file

  • output_dir: Directory for slice files (created if needed)

  • slices: Number of equal slices (default: 4)

  • bpm: Calculate slice duration from BPM (overrides slices)

  • beats_per_slice: Beats per slice when using BPM (default: 1)

  • beat_duration: Explicit duration per slice in seconds

  • threshold: Onset detection threshold 0.0-1.0 (enables automatic transient slicing)

  • sensitivity: Onset detection sensitivity 1.0-3.0 (default: 1.5)

  • onset_method: Detection method - 'hfc', 'flux', 'energy', 'complex', or 'superflux'

  • output_format: Output format (default: "wav")

  • effects: Effects to apply to each slice

Returns: List of created file paths

Automatic Transient Slicing

Slice loops automatically at detected transients (drum hits, etc.):

# Slice at detected onsets with default sensitivity
slices = cysox.slice_loop('drums.wav', 'output_dir/', threshold=0.3)

# More sensitive detection (catches subtle hits)
slices = cysox.slice_loop('drums.wav', 'output_dir/',
    threshold=0.2,
    sensitivity=1.2
)

# Use different detection method
slices = cysox.slice_loop('drums.wav', 'output_dir/',
    threshold=0.3,
    onset_method='flux'  # Good for tonal changes
)

cysox.onset - Direct Onset Detection

For more control, use the onset detection module directly:

from cysox import onset

# Detect onsets in a file
onsets = onset.detect('drums.wav', threshold=0.3)
print(f"Found {len(onsets)} transients")
for t in onsets:
    print(f"  {t:.3f}s")

# With custom parameters
onsets = onset.detect('drums.wav',
    threshold=0.3,      # Detection threshold (0.0-1.0)
    sensitivity=1.5,    # Peak picking sensitivity (1.0-3.0)
    min_spacing=0.05,   # Min time between onsets (seconds)
    method='hfc'        # 'hfc', 'flux', 'energy', 'complex', or 'superflux'
)

Detection Methods:

  • hfc (default) - High-Frequency Content

    • Weights frequency bins by their index, emphasizing high frequencies

    • High frequencies are prominent in transient attacks (the "click" of a drum hit)

    • Best for: drums, percussion, plucked instruments

    • Fast and reliable for most percussive material

  • flux - Spectral Flux

    • Measures the change in spectral energy between consecutive frames

    • Detects when the frequency content changes significantly

    • Best for: mixed material, melodic instruments, detecting note changes

    • Good all-around choice when HFC misses softer onsets

  • energy - Energy-based

    • Simply measures the RMS energy (loudness) of each frame

    • Fastest method, minimal computation

    • Best for: very clean recordings, isolated drums, quick processing

    • May miss onsets that are spectrally distinct but similar in volume

  • complex - Complex Domain

    • Analyzes both magnitude AND phase of the spectrum

    • Detects deviations from expected phase trajectories

    • Best for: maximum accuracy, subtle onsets, research applications

    • Slowest method but catches onsets other methods miss

  • superflux - Superflux (Boeck & Widmer, DAFx 2013)

    • Mel-scaled spectral flux with vibrato suppression

    • Maximum filter along frequency axis to reject false onsets from frequency modulation

    • Backtracking from peaks to nearest local minimum for precise transient placement

    • Best for: polyphonic material, vibrato-heavy sources, maximum precision

Understanding threshold vs sensitivity:

threshold (0.0-1.0) and sensitivity (1.0-3.0) control different stages:

  • threshold - Global minimum floor

    • Sets the absolute minimum level a peak must reach

    • Applied to the normalized detection function (0-1 scale)

    • Lower values = more sensitive, catches quieter transients

    • threshold=0.3 means peaks must reach at least 30% of max energy

    • Think of it as: "ignore everything below this level"

  • sensitivity - Adaptive peak picking strictness

    • Controls how much a peak must exceed the local average

    • Uses a moving median filter to compute the local baseline

    • Higher values = stricter, only picks prominent peaks

    • sensitivity=1.5 means a peak must be 1.5x the local median

    • Think of it as: "how much must a peak stand out from neighbors"

Typical combinations:

  • Drums with clear hits: threshold=0.3, sensitivity=1.5 (defaults)

  • Subtle transients: threshold=0.2, sensitivity=1.2

  • Only loud hits: threshold=0.5, sensitivity=2.0

cysox.stutter() - Create Stutter Effects

Extract a segment and repeat it:

# Basic stutter: 8x repeat of first 1/8 note at 120 BPM
cysox.stutter('drums.wav', 'stutter.wav',
    segment_duration=0.125,  # 1/8 note at 120 BPM
    repeats=8
)

# Stutter from a specific position (e.g., the snare hit)
cysox.stutter('drums.wav', 'snare_stutter.wav',
    segment_start=0.5,       # Start at 0.5 seconds
    segment_duration=0.125,
    repeats=4
)

# Stutter with effects
cysox.stutter('drums.wav', 'stutter_punchy.wav',
    segment_duration=0.25,
    repeats=4,
    effects=[fx.DrumPunch(), fx.DrumRoom()]
)

Parameters:

  • path: Input audio file

  • output_path: Output file path

  • segment_start: Start position in seconds (default: 0)

  • segment_duration: Length of segment in seconds (default: 0.125)

  • repeats: Total times segment plays (default: 8)

  • effects: Effects to apply after stuttering

Practical Examples

Chop an Amen Break

import cysox
from cysox import fx

# Get loop info
info = cysox.info('amen.wav')
print(f"Duration: {info['duration']:.3f}s")

# Assuming 2-bar loop at 175 BPM
bpm = 175

# Slice into individual beats
slices = cysox.slice_loop('amen.wav', 'amen_beats/', bpm=bpm)
print(f"Created {len(slices)} beat slices")

# Slice into 16th notes with breakbeat processing
slices = cysox.slice_loop('amen.wav', 'amen_16ths/',
    slices=16,
    effects=[fx.Breakbeat()]
)

# Create kick stutter fill
cysox.stutter('amen.wav', 'kick_fill.wav',
    segment_start=0,
    segment_duration=info['duration'] / 16,  # First 16th note
    repeats=16
)

Process Drum Loops

# Half-time for slow, heavy feel
cysox.convert('drums.wav', 'halftime.wav', effects=[fx.HalfTime()])

# Lo-fi vintage break sound
cysox.convert('drums.wav', 'vintage.wav', effects=[
    fx.VintageBreak(),
    fx.DrumRoom(wetness=20)
])

# 80s gated reverb snare
cysox.convert('drums.wav', 'gated.wav', effects=[fx.GatedReverb()])

# Full processing chain
cysox.convert('drums.wav', 'processed.wav', effects=[
    fx.RemoveRumble(cutoff=40),
    fx.DrumPunch(punch=5, attack=4),
    fx.DrumRoom(room_size=30, wetness=20),
    fx.BroadcastLimiter(),
])

Sample Processing

cysox includes sample processing utilities ported from AudioHit for preparing audio samples for software and hardware samplers.

cysox.auto_trim() - Trim Silence

Detect and remove silence from the beginning and end of audio based on amplitude threshold:

# Basic silence trimming
cysox.auto_trim('raw.wav', 'trimmed.wav')

# Custom threshold (less sensitive)
cysox.auto_trim('raw.wav', 'trimmed.wav', threshold_db=-36)

# With fade in/out (milliseconds)
cysox.auto_trim('raw.wav', 'trimmed.wav', fade_in=10, fade_out=50)

# Speed up after trimming
cysox.auto_trim('raw.wav', 'trimmed.wav', speed_factor=2.0)

# With additional effects
cysox.auto_trim('raw.wav', 'trimmed.wav', effects=[fx.Normalize()])

Parameters:

  • path: Input audio file

  • output_path: Output audio file

  • threshold_db: Amplitude threshold in dB (default: -48dB)

  • min_silence: Minimum non-silence duration in seconds (default: 0.1)

  • fade_in: Fade-in duration in milliseconds (default: 0)

  • fade_out: Fade-out duration in milliseconds (default: 0)

  • speed_factor: Playback speed multiplier (default: None)

  • effects: Additional effects to apply after trimming

cysox.split_by_silence() - Split at Silence Gaps

Split a continuous recording into separate one-shot samples at silence boundaries:

# Split at default threshold
segments = cysox.split_by_silence('recording.wav', 'one_shots/')

# Custom detection parameters
segments = cysox.split_by_silence('recording.wav', 'one_shots/',
    threshold_db=-36,     # Less sensitive
    min_silence=0.5,      # Require 500ms of silence to split
    min_segment=0.25,     # Discard segments shorter than 250ms
)

# With fades and effects on each segment
segments = cysox.split_by_silence('recording.wav', 'one_shots/',
    fade_in=5, fade_out=20,
    effects=[fx.Normalize()],
)

Parameters:

  • path: Input audio file

  • output_dir: Directory for segment files (created if needed)

  • threshold_db: Amplitude threshold in dB (default: -48dB)

  • min_silence: Minimum silence duration to trigger split, in seconds (default: 0.25)

  • min_segment: Minimum segment duration, in seconds (default: 0.25)

  • fade_in: Fade-in per segment in milliseconds (default: 0)

  • fade_out: Fade-out per segment in milliseconds (default: 0)

  • speed_factor: Playback speed multiplier (default: None)

  • output_format: Output format (default: "wav")

  • effects: Effects to apply to each segment

Returns: List of created file paths

cysox.pitch_scale() - Generate Chromatic Pitch Variants

Create multiple pitch-shifted copies of a sample at semitone intervals, useful for building playable melodic sample libraries:

# Generate one octave (12 semitones) of chromatic variations
files = cysox.pitch_scale('c3_piano.wav', 'scale/')
# Creates: scale/c3_piano_pitch_+0.wav through scale/c3_piano_pitch_+11.wav

# Two octaves starting from one octave below
files = cysox.pitch_scale('sample.wav', 'scale/',
    semitones=24, offset=-12)

# With effects on each copy
files = cysox.pitch_scale('sample.wav', 'scale/',
    semitones=12, effects=[fx.Normalize()])

Parameters:

  • path: Input audio file

  • output_dir: Directory for pitch-shifted files (created if needed)

  • semitones: Number of copies to generate (default: 12)

  • offset: Starting semitone offset (default: 0)

  • output_format: Output format (default: "wav")

  • effects: Effects to apply to each copy after pitch shifting

Returns: List of created file paths

cysox.batch() - Batch Process Directories

Process all audio files in a directory tree:

# Convert a folder to mono 22050Hz
processed = cysox.batch('samples/', 'processed/',
    sample_rate=22050, channels=1)

# Apply effects to all files
processed = cysox.batch('raw/', 'ready/',
    effects=[fx.Normalize(), fx.Fade(fade_in=0.01)])

# Convert format, non-recursive
processed = cysox.batch('input/', 'output/',
    output_format='flac', recursive=False)

# With progress callback
cysox.batch('raw/', 'done/',
    on_file=lambda i, o: print(f"  {i} -> {o}"))

Parameters:

  • input_dir: Directory containing audio files

  • output_dir: Directory for processed files (created if needed)

  • effects: Effects to apply to each file

  • sample_rate: Target sample rate in Hz

  • channels: Target number of channels

  • bits: Target bits per sample

  • recursive: Process subdirectories (default: True)

  • output_format: Output format (None keeps original)

  • on_file: Callback called after each file (input_path, output_path)

Returns: List of processed output file paths

Low-Level API

For advanced use cases, access the full libsox bindings:

from cysox import sox

# Manual initialization (high-level API handles this automatically)
sox.init()

# Open files
input_fmt = sox.Format('input.wav')
output_fmt = sox.Format('output.wav', signal=input_fmt.signal, mode='w')

# Build effects chain
chain = sox.EffectsChain(input_fmt.encoding, output_fmt.encoding)

e = sox.Effect(sox.find_effect("input"))
e.set_options([input_fmt])
chain.add_effect(e, input_fmt.signal, input_fmt.signal)

e = sox.Effect(sox.find_effect("vol"))
e.set_options(["3dB"])
chain.add_effect(e, input_fmt.signal, input_fmt.signal)

e = sox.Effect(sox.find_effect("output"))
e.set_options([output_fmt])
chain.add_effect(e, input_fmt.signal, input_fmt.signal)

# Process
chain.flow_effects()

# Cleanup
input_fmt.close()
output_fmt.close()
sox.quit()

Building from Source

macOS

brew install flac lame mpg123 libogg libvorbis opus opusfile libpng pkg-config
make
make test

Linux

sudo apt-get install libsox-dev libsndfile1-dev pkg-config
make
make test

Status

Comprehensive test suite covering all functionality. All libsox C examples ported to Python (effects chains, waveform analysis, trim, concatenation, format conversion).

Known Issues

  • Memory I/O: libsox memory I/O functions have platform issues (tests skipped)

  • Init/Quit Cycles: Use high-level API to avoid init/quit issues (handled automatically)

See KNOWN_LIMITATIONS.md for details.

Platform Support

  • macOS: Full support

  • Linux: Full support

  • Windows: Placeholder (contributions welcome)

Building Documentation

pip install mkdocs-material
make docs          # Build static site
make docs-serve    # Live preview at http://localhost:8000

License

cysox's own source code is MIT (see LICENSE).

Binary wheels also bundle native libraries under their own licences: libsox, libmpg123 and LAME (LGPL), and FLAC, Ogg, Vorbis, Opus, libpng and KissFFT (BSD or permissive). libmad (GPL) is not bundled; mp3 is decoded with libmpg123. Each wheel carries the licence texts in cysox-*.dist-info/licenses/. licenses/README.md lists them and how to relink the statically linked libsox.

Building from source against your own system libraries bundles nothing, and only the MIT licence applies.

Metadata

Release files for cysox 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cysox 0.3.0
File Size Uploaded Provenance Actions
cysox-0.3.0.tar.gz 2.4 MB Without provenance Details for cysox-0.3.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for cysox 0.3.0
File Actions
cysox-0.3.0-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.15 CPython 3.15 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for cysox-0.3.0-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
cysox-0.3.0-cp315-cp315-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.15 CPython 3.15 Linux glibc 2.27+ ARM64, Linux glibc 2.28+ ARM64 Details for cysox-0.3.0-cp315-cp315-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
cysox-0.3.0-cp315-cp315-macosx_14_0_arm64.whl CPython 3.15 CPython 3.15 macOS 14.0+ ARM64 Details for cysox-0.3.0-cp315-cp315-macosx_14_0_arm64.whl
cysox-0.3.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for cysox-0.3.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
cysox-0.3.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.27+ ARM64, Linux glibc 2.28+ ARM64 Details for cysox-0.3.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
cysox-0.3.0-cp314-cp314-macosx_14_0_arm64.whl CPython 3.14 CPython 3.14 macOS 14.0+ ARM64 Details for cysox-0.3.0-cp314-cp314-macosx_14_0_arm64.whl
cysox-0.3.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for cysox-0.3.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
cysox-0.3.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.27+ ARM64, Linux glibc 2.28+ ARM64 Details for cysox-0.3.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
cysox-0.3.0-cp313-cp313-macosx_14_0_arm64.whl CPython 3.13 CPython 3.13 macOS 14.0+ ARM64 Details for cysox-0.3.0-cp313-cp313-macosx_14_0_arm64.whl
cysox-0.3.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for cysox-0.3.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
cysox-0.3.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.27+ ARM64, Linux glibc 2.28+ ARM64 Details for cysox-0.3.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
cysox-0.3.0-cp312-cp312-macosx_14_0_arm64.whl CPython 3.12 CPython 3.12 macOS 14.0+ ARM64 Details for cysox-0.3.0-cp312-cp312-macosx_14_0_arm64.whl
cysox-0.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for cysox-0.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
cysox-0.3.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ ARM64, Linux glibc 2.27+ ARM64 Details for cysox-0.3.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
cysox-0.3.0-cp311-cp311-macosx_14_0_arm64.whl CPython 3.11 CPython 3.11 macOS 14.0+ ARM64 Details for cysox-0.3.0-cp311-cp311-macosx_14_0_arm64.whl
cysox-0.3.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for cysox-0.3.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
cysox-0.3.0-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ ARM64, Linux glibc 2.27+ ARM64 Details for cysox-0.3.0-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
cysox-0.3.0-cp310-cp310-macosx_14_0_arm64.whl CPython 3.10 CPython 3.10 macOS 14.0+ ARM64 Details for cysox-0.3.0-cp310-cp310-macosx_14_0_arm64.whl

Total release size: 34.3 MB

Release files / cysox-0.3.0.tar.gz

Download URL cysox-0.3.0.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
754bf3c791d86371a30e4bffd3c5743e60b30f499c4de30caa4b8c2e3545f533
BLAKE2b-256 checksum
How to use checksums
93931c8c44ecadfcc4aab58893896421d62fe32e082bbd287abafc8f27135f6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / cysox-0.3.0-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL cysox-0.3.0-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.0 MB
Tags CPython 3.15 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
2f1b57a6dbfa63b0cf46075ca2f2276858f5417765edb83268f2ccd1d0a25e46
BLAKE2b-256 checksum
How to use checksums
c547891db097aa7eea18de146bae8d92ef0460b812906275a3f371e4cf4952e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / cysox-0.3.0-cp315-cp315-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL cysox-0.3.0-cp315-cp315-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 1.8 MB
Tags CPython 3.15 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
97659d16088ae50ad4bbad553d27082d74e76d3b90a7f61a6a15d921cca809f1
BLAKE2b-256 checksum
How to use checksums
76cbbfc0dddd3ddaadba0a76c57a3279aa1271800d39e5432a18b746f74be863
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / cysox-0.3.0-cp315-cp315-macosx_14_0_arm64.whl

Download URL cysox-0.3.0-cp315-cp315-macosx_14_0_arm64.whl
Size 1.5 MB
Tags CPython 3.15 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
b329aa0d60f69f6b958f2732adae9fad567aafb22db0955bd1dc2938be72e256
BLAKE2b-256 checksum
How to use checksums
da6c02cdab72c9ca3883bb8f619bb4a66242e209a9d5d306dbb2eacfbd7a9d78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / cysox-0.3.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL cysox-0.3.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.0 MB
Tags CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
7769b812add7f322b4e6fbba2d7d81515fcb477603dec76bd276da04718a7bd6
BLAKE2b-256 checksum
How to use checksums
b174f0643bc73a6c0526520116c5a510def43d1b55309d65a1eb935de3e5fcb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / cysox-0.3.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL cysox-0.3.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 1.8 MB
Tags CPython 3.14 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
7bd9438c561c641bb5cd2ebf9f419b5b647b04d6ce08b8a81a8cc429f639fe95
BLAKE2b-256 checksum
How to use checksums
ce9bb5beb20e65340cc6fb7a5efd830091b76975aaea6c1fbd2863e89143fa2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / cysox-0.3.0-cp314-cp314-macosx_14_0_arm64.whl

Download URL cysox-0.3.0-cp314-cp314-macosx_14_0_arm64.whl
Size 1.5 MB
Tags CPython 3.14 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
090946b4e78402daf4d1e92677147a7f06f9ab97e72b2b5a7fa402c5067d5ac5
BLAKE2b-256 checksum
How to use checksums
15d28217879e3f45cf1ebbd8a7447d580e606c83991f52c726be8c917801d2fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / cysox-0.3.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL cysox-0.3.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.0 MB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
a437065f9c0208494e4cc48c27a64f973222d98213c5abac27af3bd529eee737
BLAKE2b-256 checksum
How to use checksums
c2270530247b827768503228bb4a3a93952b8e652e54b6442004d5e2c5e3fda4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / cysox-0.3.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL cysox-0.3.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 1.8 MB
Tags CPython 3.13 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
6b2c0b8979deb93dd2f957abbd642800862afcde99fdf2aa82a1394351c360fb
BLAKE2b-256 checksum
How to use checksums
f81656614da2dd0863f07138df87745df9e1c5c5471b1211180678f6847250c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / cysox-0.3.0-cp313-cp313-macosx_14_0_arm64.whl

Download URL cysox-0.3.0-cp313-cp313-macosx_14_0_arm64.whl
Size 1.5 MB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
1c36bb9513364a9c9319d58fb416099c73c68f4fdf3a655de18541d11ef43012
BLAKE2b-256 checksum
How to use checksums
f5039e9b782a99d4fac2e7db6be7bf3d7001565ad281216cb15fbeeabd215bee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / cysox-0.3.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL cysox-0.3.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.0 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
7a92a6641673be45cb580c1c584e2927ef104300b3f1cfea160f56f80aaa91f0
BLAKE2b-256 checksum
How to use checksums
c1a0462c1ce108dcacc5f45879f572e41536aacbe3b8ac1cdc84ca211983ff0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / cysox-0.3.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL cysox-0.3.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 1.8 MB
Tags CPython 3.12 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
9760e400e020d9188bcd56ee93d76118d768ccd6c4a63d13b9fc4fc5a766beff
BLAKE2b-256 checksum
How to use checksums
26eaf00ba78c514ba0ba0f2179e54779f96c213542f6823c85f3d639bb3ccf9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / cysox-0.3.0-cp312-cp312-macosx_14_0_arm64.whl

Download URL cysox-0.3.0-cp312-cp312-macosx_14_0_arm64.whl
Size 1.5 MB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
7a15c337b6798780c77ff3e3e453e2e1e32ea99c0aa2c492b41b879c8cac9a7f
BLAKE2b-256 checksum
How to use checksums
da5704ab87a53511841d579540dd5f4c3c96ecbaf96a29031e3690f512995007
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / cysox-0.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL cysox-0.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.0 MB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
13cde3c88b745222141c18053a5d08e642c7331bf09f10cbfb198bd8188a516c
BLAKE2b-256 checksum
How to use checksums
b032daf3be71b0d0651cb0185901a2edb061f0f4991470cca4efed50824d74e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / cysox-0.3.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL cysox-0.3.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 1.8 MB
Tags CPython 3.11 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
f2a48505fa9ef343e9b137f5f1c66aa911fb3971e255371ee3dc36e16aa4502a
BLAKE2b-256 checksum
How to use checksums
966b18f4180f3e922320bfda0f7975c2fd1f5c41bc95efafed174a7550812afd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / cysox-0.3.0-cp311-cp311-macosx_14_0_arm64.whl

Download URL cysox-0.3.0-cp311-cp311-macosx_14_0_arm64.whl
Size 1.5 MB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
b276f1e06f271fa58ef69236b088de37a1b1191eaebef0f0015edc053fc836cb
BLAKE2b-256 checksum
How to use checksums
b2e1eec227e0f029ad1674306471a95bd69ff49a4c6727681571897aaeb68451
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / cysox-0.3.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL cysox-0.3.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.0 MB
Tags CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
fef2fbb90c1c015381465af313d0d6b69a5223fa2c866b991d54cf649472247d
BLAKE2b-256 checksum
How to use checksums
fb8008e621da915ccc8962d4b4c2b1b9dc480957ab6cbca963c2e7c4039f5fc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / cysox-0.3.0-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL cysox-0.3.0-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 1.8 MB
Tags CPython 3.10 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
cd08e931089eda1e6702c1e3abb217c3ea910a3d856d2fe74e5a9ce2e3be748a
BLAKE2b-256 checksum
How to use checksums
86db1135a049e86b0b912863d4a929314e305886266d0f2378c26dc203dc612d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / cysox-0.3.0-cp310-cp310-macosx_14_0_arm64.whl

Download URL cysox-0.3.0-cp310-cp310-macosx_14_0_arm64.whl
Size 1.5 MB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
3db200e16b4434339842b16db419b0aab6bf739fe9ba7b818b727f0ff9536c0d
BLAKE2b-256 checksum
How to use checksums
8783277510e72b5f64540b2a03f8e59806a7acc4ec6891af0dbc5507ea18964b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Security for cysox 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page