Native audio samples and waveform plots
Generate a deterministic tone, retain immutable samples, export a native WAV and inspect a bounded waveform.
// Native deterministic audio; no microphone, speaker, model, or codec needed.
import aner.audio
import aner.tensor
let clip = audio.tone(seconds: 0.1, rate: 48000, channels: 2,
frequency: 440.0, amplitude: 0.25)
print(clip.frames())
print(clip.channels())
print(clip.rate())
print(clip.duration())
let left = clip.channel(0)
let excerpt = left.slice(0, 480)
print(excerpt.frames())
print(excerpt.time())
let samples = excerpt.tensor()
let restored = audio.from_tensor(samples, rate: 48000)
print(restored.frames())
Make it your experiment.
Use Aner 0.1.0 or newer. Save this program as examples/media/audio_basics.aner inside a folder for your experiment. Open a terminal in that folder, then check and run the program.
aner check examples/media/audio_basics.aner
aner run examples/media/audio_basics.anerThe aner command must be on your PATH. Follow the installation guide if your terminal cannot find it.
Requires Aner 0.1.0 or newer. Native PCM/WAV, synthesis, FFT and speech activity are available independently of optional FFmpeg and model backends. Decoding, resampling or local transcription requires the corresponding capability and separately supplied inputs or weights.
aner check examples/media/audio_basics.aner
aner run examples/media/audio_basics.anerBundled datasets retain their own source attribution and license notices. Example outcomes are not comparative benchmarks or evidence of clinical validity.
Dataset sources & attribution