Changelog
All notable changes to the audio_samples Python package are documented here.
The format follows Keep a Changelog.
The package binds the Rust crate
audio_samples. Fixes and behaviour
changes in the core are summarised here where Python users will notice them; the
crate’s CHANGELOG
has the full detail.
0.3.0 - Unreleased
Built on audio_samples 3.0, audio_samples_io 0.4 and spectrograms 2.2.1. spectrograms 2.2
fixes the Kaiser window for β > 3.75, spaces gammatone and ERB filters on the ERB-number scale and
centres CQT kernels in the frame. In 2.2.1 a mel spectrogram’s frequency axis gives the
filterbank’s band centres for any f_min/f_max, uncentred frames are timed at their centre, and
a CQT whose f_min is at or above Nyquist raises an error. Those outputs change.
Onset detection follows audio_samples 3.0 (see its changelog).
PeakPickingConfig.default()and its presets leave pre-emphasis off, which moved onsets early; theSpectralFluxConfigandComplexOnsetConfigpresets do not log-compress;OnsetDetectionConfigpresets set their running median in seconds;SpectralFluxConfig.musicaluses the rectified flux andSpectralFluxConfig.complexthe rectified complex-domain flux. The complex-domain detectors (complex_onset_detection,onset_detection_function_complex,SpectralFluxMethod.complex/.rectified_complex) work: they found one of four clicks of a click track.phase_deviation_matrixreturns the magnitude-weighted phase deviation.The signal generators give at least one sample (a zero or sub-sample duration built an invalid, empty buffer) and compute the sample count exactly, so a few durations whose floating-point product fell just below a whole number gain one sample (1.001 s at 8 kHz is 8008 samples, was 8007).
str(audio)is one line andrepr(audio)previews each channel.strgivesAudioSamples<f32>: 2 ch × 48000 samples @ 48000 Hz (1.000 s);repradds a line per channel (up to eight) with its first and last three samples.strof mono audio used to include a preview line, and the header usedxfor×.Onset peak-picking presets are given in seconds and take the sample rate.
PeakPickingConfig.music,.speechand.drumswere class attributes sized as if their lengths counted audio samples, so on an onset strength function they spanned seconds and found almost nothing. They are now static methods taking(sample_rate, hop_size), with threshold windows of 0.2 s, 0.2 s and 0.1 s and minimum separations of 0.1 s, 80 ms and 30 ms.OnsetDetectionConfig.musical,.percussive,.speech,SpectralFluxConfig.percussive,.musicalandComplexOnsetConfig.percussive,.musical,.speechtake the sample rate, e.g.OnsetDetectionConfig.percussive(audio.sample_rate); theSpectralFluxConfigandComplexOnsetConfigpresets are static methods instead of class attributes.VadMethod.spectralworks. It raised an error. A frame is speech when its level reachesenergy_threshold_dband at leastspectral_ratio_thresholdof its energy lies betweenspeech_band_low_hzandspeech_band_high_hz; loud noise, hum and hiss are rejected.LimiterConfig.isp_limitingdetects true (inter-sample) peaks at 4× oversampling; it had no effect. TheLimiterConfigpresets set it, so their output changes for material whose true peak exceeds its sample peak.The
SideChainConfigfilters, pre-emphasis and mix are applied to the detector input when the side chain is enabled, in the plain and the side-chain methods; they were ignored.SideChainConfig(enabled=True)now defaults toexternal_mix=1.0(the side-chain signal alone; it was 0.0 but had no effect).apply_compressor_sidechainandapply_limiter_sidechainaccept a mono side-chain signal for multi-channel audio, or one with the same channel count.OnsetDetectionConfigno longer hasthreshold,min_onset_interval_secsorpre_emphasis. Onset detection never read them. The threshold floor, the minimum spacing between onsets and the pre-emphasis are set onpeak_picking(adaptive_threshold.min_threshold,min_peak_separation,pre_emphasisandpre_emphasis_coeff). The constructor no longer takes them.==and!=on AudioSamples compare sample type, sample rate, shape and samples;==returned False for any two objects.forms.resampleandforms.pitch_shiftwithscale=Truemultiply by the reciprocal of the square root of the ratio instead of dividing by it: within one rounding of the quotient, and several times cheaper per sample. For float32 and float64 input,forms.resampleapplies it while the samples are written (the same values, one pass fewer).Downsampling by ratios such as 22050 to 16000 or 8000 Hz and 48000 to 44100 Hz is faster and its output changes at the stopband level; see the crate’s changelog.
features.wavelet_lengthsandfeatures.waveletaccept one frequency whenalphais given. The bandwidth then does not come from the spacing of the frequencies; withoutalpha, two or more are still required.io.read_and_resamplekeeps the file’s sample type. Withoutas_typeit returns the file’s own sample type, asio.readandAudioSamples.resampledo (16-bit files giveint16); it converted tof32before. Passas_type=SampleType.F32for the former result.More of librosa’s option values work.
AudioSamples.magphasetakes a fractional or negativepower;AudioSamples.griffinlim_cqttakesinit="random"withrng; therngofgriffinlim,griffinlim_audio,griffinlim_cqtandinversetakes a NumPy generator (one seed is drawn from it, which advances it); thefeatures.spectral_*_from_spectrogramandpoly_features_from_spectrogramtake a time-varying 2-D or 3-Dfreq;onset_strength_multitakes slices aschannelsandsequence.syncslices asidx;rhythm.metrogramtakesaggregate=None;effects.nn_filtertakesscipy.sparserecurrence matrices and any aggregate;trim_dbandsplit_dbtake any callable asrefandaggregate;io.readandio.StreamedAudioReadertake a binary file object (WAV or FLAC). Callables run with the GIL held.harmonic/percussivestill raise formask=True: librosa returns the inverse STFT of the mask there, and the masks areeffects.hpss(S, mask=True).The
iostub listsset_thread_limitandthread_limitin__all__.io.saveandio.write_with_optionstakeflac_md5.flac_md5=Falsewrites a FLAC file without the MD5 signature of its audio, which encodes faster.as_type=now converts block by block as the file is written, so saving no longer holds a converted copy of the signal.io.set_thread_limitandio.thread_limit. A limit on the threads a file read or decode uses, settable at any time, alongside the environment variableAUDIO_SAMPLES_IO_THREADS.Streaming reads keep the file’s sample type.
read_frames,frames,windowsandsamplesofio.StreamedAudioReaderdefault to the sample type of the file; they converted tof32before. Passdtype=SampleType.F32for the former result.Import is close to free.
import audio_samplesno longer loads the extension; the first access to one of its names (orimport audio_samples.ioand the like) does. Everything else behaves as before.The wheel no longer ships
logo.png, benchmark scripts or notebooks. The README’s logo uses an absolute URL, so it shows on PyPI.Everything else librosa 1.0 computes. New submodules:
linalg(nnls,pinv,eigh,svd);inverse(mel_to_stft,mel_to_audio,mfcc_to_mel,mfcc_to_audio);factorization(Nmf,decompose);pitch_filterbank(mr_frequencies,semitone_filterbank,iirt), withAudioSamples.iirt;segment(diagonal_filter,path_enhance,timelag_filter,agglomerative,subsegment);notation(tuning systems, Functional Just System, svara, mela and thaat names,midi_to_note,hz_to_note,note_to_midi,note_to_hz);arrays(local extrema, event and interval matching, one-dimensional interpolation, padding, reordering, compressed sparse rows, argument checks,zero_crossings,tone,chirp). Alsospectral.mellin_transform,sequence.path_to_steps,utils.blocks_to_{frames,samples,time}andgeneration.example_clip_info.Array forms and options.
audio_samples.formsholds array forms of methods, for options anAudioSamplesmakes unnecessary or that need another input:to_mono,to_stereo,to_multi,get_duration,read_segment,stream_blocks,resample,pitch_shift,frame,onset_detect,beat_track,stft,istft,reassigned_spectrogram,chroma_cqt,chroma_cens,chroma_vqt,tempogram_ratio,onset_strengthandsalience.AudioSamples.vqttakesintervals;interp_harmonicsandf0_harmonicstakekindandaxis;recurrence_matrixandcross_similaritytakesparse=Trueandrecurrence_matrixtakesaxis;cq_to_chromatakes its smoothingwindow;waveletandwavelet_lengthstakealpha.Display.
mpl.plot_matrixwith typed axes (time, lag, frequency, mel, constant-Q, note, svara, FJS, chroma, tempo, tonnetz) and dB and phase value scales;mpl.plot_waveform_adaptive,mpl.plot_waveform_bars,mpl.plot_waveform_f0,mpl.plot_grid,mpl.infer_colormap, dB and phase colorbars, a shared legend, highlights and the tick formatters.Unary operators.
-audio,+audioandabs(audio)return audio of the same sample type. Integer results saturate, anduint8works relative to silence.Arithmetic keeps the sample type.
1.0 + audioreturned float64;audio / otherandaudio / arrayreturned float64 for integer audio,/=changed the sample type of the audio it was applied to, and an array of another dtype did the same for+,-and*. All of them now keep the sample type of the audio on the left, and audio of another sample type is converted to it (this panicked before). Integer results saturate instead of wrapping,u8audio respects its offset, and an integer divided by zero gives the limit with its sign. On integer audio a float scalar is in the floating-point range, soaudio + 1.0adds full scale, and it must be within -1.0 to 1.0 orValueErroris raised. An int or NumPy integer scalar is a number of sample steps relative to silence, soaudio + 1adds one step on every integer type, on either side of the operator, andOverflowErroris raised if it does not fit the type (audio + 40000on int16,audio + 200on uint8, whose range is -128 to 127). A NumPyuint8scalar onuint8audio is a sample, soaudio + np.uint8(128)changes nothing.*and/are gains, soaudio * 2equalsaudio * 2.0, and only the result saturates. Non-finite scalars raiseValueErroron integer audio, a non-finite array too, and dividing integer audio by a zero scalar raisesZeroDivisionError. Dividing by an array or other audio works sample by sample: a divisor sample of silence gives the limit with the sign of the dividend, and silence over silence gives silence (128 foruint8). Arithmetic with NumPy on the left (np.int16(1) + audio,array * audio) now follows the same rules. On float audio an int is the same number as the float. A bool scalar raisesTypeError.Type stubs are checked and precise.
mypy.stubtest, mypy and pyright run in pre-commit and in CI.AudioSamplesis generic in its sample type (AudioSamples[numpy.float32]also works at run time), and overloads give the dtype of analysis results from the sample type or the input array, the bool results ofpyin,recurrence_matrixandviterbi_binary, and the results selected byunits=,mode=,return_zf=,backtrack=and similar arguments. An input of unknown type gives a result of unknown type. Corrected signatures includeapply_compressor,apply_limiterandnormalize;scale,clip,normalizeandremove_dc_offsetreturnNone. The stubs forutilsmove toaudio_samples/utils/;audio_samples.audio_mathandaudio_samples.detectionnever existed at run time and are gone from the stubs, with their contents underaudio_samples.utils.Migration checker.
python -m audio_samples.migrate PATH [PATH ...]lists the librosa calls in Python files and notebooks with the equivalent, how closely it matches and what to watch for in that call. It has JSON output, a summary and an exit status for CI, and it never changes the files.Example clips.
generation.example_cliprenders named clips of music and speech with known contents at any sample rate, duration and sample type. Nothing is stored or downloaded, and the same arguments give the same bytes on any platform with IEEE 754 arithmetic.Free-threaded Python. The module states
gil_used = false, so onpython3.14tthe GIL stays off. A read that meets a concurrentSosFilter.process_samples_in_placeon the same array raisesTypeErrorinstead of aPanicException. See the “Threads and free-threaded Python” page.Threads. Streaming readers and writers work from any thread, one call at a time; they no longer raise a
PanicExceptionon another thread. On a free-threaded build, an in-place method on audio built on a NumPy array and reads of that array raiseTypeErrorwhen they meet.Faster.
hpsson a spectrogram (median filter),melspectrogram,mfcc_framesandto_monoof decoded stereo. Results are unchanged.Example gallery. The docs have a gallery by task (
docs/gallery, built with sphinx-gallery): each entry runs during the docs build, and a failure stops it.AudioSamples.apply_compressorandapply_limiterstubs match the methods, which take a config object.librosa parity. A librosa 1.0-compatible API alongside the existing one: librosa-style methods on
AudioSamplesand the new submodulesaudio_samples.spectral,features,sequence,rhythmandeffects. They take librosa’s keyword names, return(channels, F, T)arrays, and are tested against librosa 1.0 golden fixtures. The docs gain a librosa migration guide that maps every librosa function to its equivalent and lists every difference.Output precision follows the input. The librosa-compatible
AudioSamplesmethods return float32 / complex64 arrays for uint8, int16, int24 and float32 audio, and float64 / complex128 arrays for int32 and float64 audio (the float type that holds every sample value exactly). The free functions inspectral,features,rhythm,effectsandsequencecompute in float32 for float32 / complex64 arrays and in float64 for any other input. Filterbanks, windows, weightings, tempo and tuning stay float64. Audio-returning methods (time_stretch,pitch_shift,preemphasis,trim_db,harmonic, …) return the receiver’s sample type.istft_matrix,icqt,griffinlim_cqtandgriffinlim_audiotake adtype=sample type; without it they return float32 audio for a single-precision input matrix and float64 audio otherwise.Defaults that differ from librosa. Where librosa’s default changes the data without being asked, the bindings use a different default; pass librosa’s value to reproduce a librosa call:
top_db=Noneinpower_to_db,amplitude_to_db,mfcc_framesandperceptual_weighting(librosa: 80);min_db=Noneinfrequency_weightingandmulti_frequency_weighting(librosa: -80);tuning=0.0inchroma_stft,chroma_cqt,chroma_cens,tonnetzandchroma_stft_from_spectrogram(librosa: None, which estimates it);trim=Falseinbeat_trackandbeat_track_with_bpm(librosa: True);rng=0ingriffinlimandgriffinlim_audio(librosa: unseeded);align_zeros=Falseinremix(librosa: True).Required arguments.
sris required in every free function where librosa defaults it to 22050, and theutilsframe and time conversions requiresample_rateorsr(they used to fall back to 22050).hop_lengthis required inpcen,samples_to_frames,frames_to_samples,time_to_frames_floor,times_like,samples_like, and inclickswhenframes=is given (librosa: 512).top_dbis required intrim_db,trim_db_in_placeandsplit_db(librosa: 60).Teaching material. An explain API (
audio_samples.explain), 14 tutorial notebooks, a page for instructors and a set of usability fixes for students.
Added
Explain API:
audio_samples.explain.explain(obj, *, sample_rate, n_samples, n_channels, f0_range, n_fft, n_mels)explainsStftParams,SpectrogramParams,MelParams,MfccParams,WindowType,IirFilterDesign,EqBand,CompressorConfig,LimiterConfig,VadConfigandOnsetDetectionConfigfrom your settings, before anything runs. Topic functions cover sampling, aliasing, quantisation, the DFT, windows, YIN, autocorrelation pitch, LPC, the cepstrum, resampling and FIR filters.AudioSamples.explain(obj, ...)uses the signal’s rate, length and channels, and the config classes gain.explain(...).ExplainDoc: summary, formulas, symbols, derived quantities, tables, trade-offs and warnings as plain Python data, withtext(),markdown(),html(),quantity()andhas_warning(). It renders in Jupyter with maths.Tutorials: 14 notebooks (
docs/source/tutorials/), from sampling to codecs, checked against NumPy, SciPy and librosa. Solution cells are tagged so that student versions can be generated. There is also a “For instructors” page.AudioSampleslibrosa-style spectrum methods:stft_matrix,istft_matrix(static),spectrogram_matrix,melspectrogramandmfcc_frames.AudioSampleslibrosa-style features:spectral_{centroid,bandwidth,rolloff,flatness,contrast}_frames,poly_features,rms_frames,zero_crossing_rate_framesandreassigned_spectrogram.AudioSamplestonal, constant-Q and pitch methods:chroma_stft,piptrack,estimate_tuning,cqt,vqt,pseudo_cqt,hybrid_cqt, staticicqtandgriffinlim_cqt,chroma_cqt,chroma_cens,chroma_vqt,tonnetz,yinandpyin.AudioSamplesrhythm methods:onset_strength,onset_strength_multi,onset_detect,tempogram,fourier_tempogram,tempo,beat_track(returns(tempo, beats)),plp,tempogram_ratioandhybrid_tempogram.AudioSampleseffects, each audio-to-audio one also available as an_in_placevariant:time_stretch,pitch_shift,preemphasis,deemphasis,trim_db,split_db,remix,harmonic,percussive,harmonic_percussive,lpcand the staticgriffinlim_audio.audio_samples.spectral:stft,istft, dB conversions,mel_filterbank,get_window,window_sumsquare,window_bandwidth,delta,stack_memory,frame,melspectrogram_from_spectrogramandmfcc_from_mel_db.audio_samples.features: the*_from_spectrogramdescriptors,pcen, frequency weightings (A to D, Z, multi, perceptual),chroma_filterbank,normalize, tuning estimation,cq_to_chroma,wavelet,wavelet_lengths, CENS and tonnetz post-processing,yin,pyin,salience,interp_harmonicsandf0_harmonics.audio_samples.sequence:dtw, the Viterbi decoders, transition matrices,rqa,recurrence_matrix,cross_similarity, the recurrence/lag conversions andsync.audio_samples.rhythm: array-input onset, tempo and beat functions,onset_backtrack,peak_pick, tempo frequencies andmetrogram.aggregateaccepts NumPy reductions, names or any callable, andprioraccepts ascipy.statsdistribution or a callable.audio_samples.effects:phase_vocoder,preemphasis/deemphasiswith filter state,softmask,hpss(librosadecompose.hpss),nn_filter,griffinlim,lpcandclicks.audio_samples.utils: librosa unit conversions (time_to_samples,samples_to_frames,frames_to_samples,time_to_frames_floor,times_like,samples_like,hz_to_octs,octs_to_hz,a4_to_tuning,tuning_to_a4,cqt_frequencies,key_to_notes,key_to_degrees),mu_law_encodeandmu_law_decode(also at top level). There is also ahtk=keyword on the mel helpers andn_fft=onframes_to_time.IirFilterDesign:passband_ripple,stopband_attenuationandbessel_normconstructor arguments; Chebyshev I/II, elliptic, Bessel and Butterworth band-stop classmethods;sos(sample_rate)returns SciPy’s(n, 6)SOS array;frequency_response(freqs, sample_rate).SosFilter.from_sos(sos, fs),SosFilter.sos()andSosFilter.filtfilt(x).AudioSamples.apply_filter/apply_filter_in_place(FIR “valid” convolution, likenp.convolve(..., "valid")).audio_samples.exceptions:AudioErrorand subclasses that carry the Rust diagnostic’s.codeand.help. Each subclass also inherits the built-in exception raised before (ValueError,TypeError, …), so existingexceptclauses keep working.The spectrogram parameter classes (
StftParams,SpectrogramParams,MelParams,MfccParams,LogParams, …) are re-exported at top level, andaudio_samples.spectrogramsis importable.ChromaNormis exported.AudioSamples._repr_html_shows a summary table and an audio player in Jupyter. Config classes have field-listing reprs.EnvelopeFollower.process,process_arrayandreset; read-only getters onCompressorConfig,VadConfigandPeakPickingConfig.min_peak_separation.NumPy interop: ufuncs and array functions (
np.sin,np.mean,np.max,np.fft.rfft, …) acceptAudioSamples, and__array__acceptscopy=.Docs: a librosa migration guide, reference pages for the new modules, and a “Coming from librosa” section in the README.
Changed
sequence.viterbi_binaryreturns its states asboolby default (one byte per entry; librosa returnsuint16).dtype=numpy.uint16ordtype=numpy.int64gives an integer array.AudioSamples.apply_windowmultiplies by float64 coefficients and rounds integer results to nearest, saturating at the type’s range. Integer audio used to quantise the window to the sample type, so fractional windows zeroed the signal (or overflowed). Float audio is unchanged.apply_filter/apply_filter_in_placelikewise filter integer audio with float64 taps on its raw scale, so taps outside[-1, 1]work.Behaviour changes from the core crate (see its changelog):
Integer audio:
normalizewith the mean or median method,remove_dc_offset,to_mono(average),to_stereo(pan),panandbalanceround to nearest and saturate (24-bit values no longer wrap; uint8 pans around 128).to_monowith the weighted and centre methods no longer returns silence for integer audio. Z-score normalisation of integer audio raises instead of returning near-silence.zero_crossing_rateon multichannel audio is the mean of the per-channel rates. It used to sum the channels’ crossings, so two identical channels gave twice the mono rate.Resampling (
resample,resample_by_ratio,io.read_and_resample) uses a delay-free windowed-sinc resampler. The output is aligned with the input and is exactlyceil(n * out / in)samples long.ResamplingQuality.fastdownsampling is now anti-aliased, so it is no longer identical tox[::2].mu_compressfollows the standard curveln(1 + mu|x|) / ln(1 + mu).PeakPickingConfig.default()(used by the default onset detection config) uses a 9-frame delta threshold (0.07) with an absolute floor of 0.1, a 3-frame minimum separation and no median filter, so it finds the onsets of a clean track. Themusic/speech/drumspresets are unchanged.Onset detection:
OnsetDetectionConfig.default(),.speech()andSpectralFluxConfig.musical()use a constant-Q CQT (Q 34.1, was 0.5) andOnsetDetectionConfig.musical()Q 16.8 (was 1.0), so a steady tone no longer gives a fluctuating detection function and similar clicks give similar peaks.detect_onsetsreports clean onsets within one hop (they were about 30 ms early).OnsetDetectionConfig.percussive()andSpectralFluxConfig.percussive()find every click of a click track (5-frame median zeroing, flux compression 10).complex_onset_detectionreports the time each CQT frame describes.Filter designs match
scipy.signal. High-pass Butterworth/Chebyshev filters of order other than 2 were frequency-mirrored, odd orders had a doubled pole, and the simple filters were unstable or silent on int16 audio.
hz_to_mel,mel_to_hz,hz_to_midi,midi_to_hz,frames_to_timeandtime_to_framesaccept arrays. Scalar input still returns a scalar.aus.WindowTypeis now the class thatStftParamsaccepts. The old enum is still available asaus.types.WindowType.Arithmetic,
convolve,deconvolve,cross_correlation,mix,concatenate,stackand spectrogram parameters check that sample rates match, and the error message names both rates.Empty buffers are rejected when the
AudioSamplesis constructed, instead of causing aPanicExceptionlater.AudioSamples.copy()makes a deep copy of NumPy-backed data. The copy used to share the buffer, so filtering the copy also filtered the original.In-place operations on read-only NumPy buffers copy the data first instead of writing through it.
new_multi/from_arraywarn when an array looks like(samples, channels). Under-W errorthe warning raises.Filter responses accept the strings
'lowpass','highpass','bandpass'and'bandstop', and filter errors raiseValueError(some raisedTypeError).hpssaccepts anHpssConfig. Generators accept anydtypethatnumpy.dtype()accepts; the default is still float32.resampleandresample_by_ratioaccept the quality names"fast","medium"and"high".inspect.signatureandhelp()work for every public callable.Missing files raise
FileNotFoundError.from audio_samples.spectral|sequence|utils|types|io import ...works.AudioSamplesis no longer marked unsendable. The package loads the extension that was built for the running interpreter when several are present.The heavy pure-Rust computations release the GIL (for example
pyin,stft,cqt,time_stretchandhpss), so they run in parallel across threads.The
spectrogramspip dependency was dropped. Its objects were rejected at runtime, and the classes are compiled into the extension.The extension is built with the core’s
educationalfeature, which the explain API needs.
Deprecated
AudioSamples.frequency_responseemits aDeprecationWarning. It always returned a flat response.hpss(stft_params=...)is accepted as a deprecated alias ofconfig=.effects.phase_vocoder(hop_length=, n_fft=)is accepted and ignored with aFutureWarning, as in librosa.
Fixed
The signal generators raise
ValueErrorfor a duration that is NaN, infinite or too large for a duration (they panicked), andcompound_tonefor a negative one.AdaptiveThresholdConfig.min_threshold/max_thresholdare readable properties (they were write-only, and the stub declared nonexistentset_min_threshold()/set_max_threshold()methods).The docs site reports the package version from
Cargo.tomlinstead of a stale0.1.1.np.asarrayon 24-bit audio read freed memory, which corrupted the data in about half of the calls.Integer arguments that are out of range raise
ValueErrorinstead ofOverflowErroror aborting the interpreter on an impossible allocation (for examplemidi_to_note(-1),resample(-n)andstft(n_fft=2**40)).effects.lpcchecks the order against the signal length before allocating.Nested Python callbacks (
aggregate/prior) no longer clobber the outer call’s callback and return NaN silently.str()of multichannel audio no longer panics, andtime_axis()works on multichannel audio.Docstrings and stubs were corrected to match the runtime (tested in both directions).
onset_detection_functionandspectral_fluxreturn(times, values).zero_crossing_rateis in crossings per second and averaged over channels.detect_beatsuses a fixed-tempo grid.AudioSamples.dtypeis a string. The generator default dtype is float32. The resampler docs describe the actual filters and output length. The YIN threshold docstring had its direction backwards. README examples are now executed by the tests.
0.2.4 - 2026-07-08
Version bump only; no code changes from 0.2.3.
0.2.3 - 2026-07-08
Changed
Migrated to
audio_samples2.0 andaudio_samples_io0.3, with all of the 2.0 breaking changes. These include the*_in_placerenames, structured return types, config structs andChannelReduction.
Added
Bindings for the 2.0 functionality. This covers spectral descriptors, PSD,
convolve/deconvolve, the constant-Q transform, Chebyshev II, elliptic and Bessel IIR designs,filtfilt, a streamingSosFilter, a parametric EQ, gate/expander and sidechain dynamics, pitch contours, key and tempo estimation, iterators, new generators, comparison metrics, and WAV/FLAC streaming IO with metadata.Citation information in the README.
0.2.2 - 2026-04-29
Added
FLAC support and faster IO, through
audio_samples_io0.2 (withaudio_samples1.0.6).
0.2.1 - 2026-03-31
Changed
Updated
audio_samples_ioto 0.1.9. Added IO benchmarks.
0.2.0 - 2026-03-17
Changed
Updated to
audio_samples1.0 and pyo3 0.28. Python 3.10 or newer is required.Plotting uses a matplotlib-based API (the
mplextra) by default. The Rust plotly backend is opt-in at build time (theplottingextra with theaudio-samples-plottingfeature).Stubs and bindings are split into modules that mirror the core crate.
Added
Benchmarks and tested README snippets.
0.1.1 - 2026-01-04
Added
Documentation site, contributing guide, README and license.
0.1.0 - 2026-01-04
Added
Initial Python bindings for
audio_samplesandaudio_samples_io. These cover generation, IO, processing, spectral analysis and statistics, with a DTMF example.