Audio-specific GPU operations: mix, overlay, resample, channel conversion.
All operations run on GPU-resident sample buffers (f32 planar PCM).
Examples
result = ExCubecl.Audio.mix([track_a, track_b], gains: [0.7, 0.5])
result = ExCubecl.Audio.overlay(bg, fg, duck_level: -12)
resampled = ExCubecl.Audio.resample(samples, from: 44100, to: 48000)
mono = ExCubecl.Audio.channels(samples, :stereo, :mono)
Summary
Functions
Converts between channel layouts (e.g. stereo → mono, mono → stereo).
Mixes multiple audio streams by summing with per-channel gain.
Overlays foreground audio over background, optionally ducking the background.
Resamples audio to a different sample rate using GPU-accelerated linear interpolation.
Types
@type samples() :: ExCubecl.AudioSamples.t()
Functions
Converts between channel layouts (e.g. stereo → mono, mono → stereo).
Examples
mono = ExCubecl.Audio.channels(samples, :stereo, :mono)
Mixes multiple audio streams by summing with per-channel gain.
Options
:gains— list of gain values (0.0–1.0+) corresponding to each track
Overlays foreground audio over background, optionally ducking the background.
Options
:duck_level— dB reduction for background during foreground (default -12)
Resamples audio to a different sample rate using GPU-accelerated linear interpolation.
Options
:from— source sample rate (Hz):to— target sample rate (Hz)