resona

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2025 License: MIT Imports: 2 Imported by: 0

README

🔊 Resona

Go Reference CI (Go) Go Report Card GitHub license Made in Slovakia

Resona is the friendly, fast, and flexible audio and DSP toolkit for Go. Whether you're building a synth, sequencer, effect, player, or a full-on singing voice synthesizer, Resona provides the tools you need, without getting in your way.

Resona comes from the Latin word "resono", meaning "to resonate".

✨ Features

  • Super lightweight: no bloat, just clean Go code (with a few optional deps)
  • Modular, Go stdlib-style API for audio/DSP
  • Supports loading WAV, MP3, FLAC, and much more!
  • Core DSP math: windows, filters, oscillators, etc...
  • Basic audio effects: gain, filter, etc...
  • Basic generators: noise, oscillator, etc...

🚀 Getting Started

Install using this command:

go get github.com/MatusOllah/resona

🧩 Conventions & Audio Data Model

Resona represents all audio data interleaved 32-bit float samples in the range [-1.0, 1.0]. For more details, see the documentation.

📚 Documentation

All documentation is available at pkg.go.dev/github.com/MatusOllah/resona.

⚖️ License

Copyright © 2025 Matúš Ollah

Licensed under the MIT License (see LICENSE) - free to use, fork, remix, and share!

Documentation

Overview

Package resona is the audio and DSP toolkit for Go.

Interleaved Audio Format

All sample slices in Resona represent interleaved, multi-channel audio data. In an interleaved layout, samples for each channel are stored in sequence for each frame. For example, in stereo (2-channel) audio, the slice:

[]float32{L0, R0, L1, R1, L2, R2, ...}

contains successive frames, where each frame consists of one sample per channel (left and right). This layout is common in many audio APIs and is efficient for streaming and hardware buffers. However, this may be less convenient for certain processing tasks. If channel-separated (planar) access is required, callers may convert interleaved slices using the audio package.

The number of channels is not specified by the aio package interfaces themselves; it is an implicit contract between the caller and the implementation. Implementations should clearly document the expected or provided number of channels and sample rate (e.g. using the afmt package).

Sample Format

All samples are represented as 32-bit floating-point numbers (float32). The value range is typically normalized between -1.0 and +1.0, where:

  • 0.0 represents silence
  • -1.0 to +1.0 represents full-scale audio signal
  • Values outside this range may be clipped or distorted depending on the backend

Seeking

All seekable streams implement the io.Seeker interface. Seek offset is measured in frames.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Version

func Version() (version, sum string)

Version returns the version of Resona and its checksum. The returned values are only valid in binaries built with module support.

If a replace directive exists in the Resona go.mod, the replace will be reported in the version in the following format:

"version=>[replace-path] [replace-version]"

and the replace sum will be returned in place of the original sum.

Types

This section is empty.

Directories

Path Synopsis
Package abufio implements buffered I/O for audio, similar to bufio but for audio.
Package abufio implements buffered I/O for audio, similar to bufio but for audio.
Package afmt provides utilities for working with audio formats.
Package afmt provides utilities for working with audio formats.
Package aio defines basic interfaces for audio I/O primitives.
Package aio defines basic interfaces for audio I/O primitives.
Package audio implements functions and general-purpose utilities for the manipulation of sample slices and audio.
Package audio implements functions and general-purpose utilities for the manipulation of sample slices and audio.
cmd
play command
Package codec provides utilities for working with audio codecs and encoding / decoding audio files.
Package codec provides utilities for working with audio codecs and encoding / decoding audio files.
au
Package au implements encoding and decoding of NeXT/Sun audio file format (AU) files.
Package au implements encoding and decoding of NeXT/Sun audio file format (AU) files.
avr
Package avr implements decoding of the Audio Visual Research (AVR) format.
Package avr implements decoding of the Audio Visual Research (AVR) format.
flac
Package FLAC implements decoding of Free Lossless Audio Codec (FLAC) files.
Package FLAC implements decoding of Free Lossless Audio Codec (FLAC) files.
internal/iff
Package iff implements the Interchange File Format (IFF).
Package iff implements the Interchange File Format (IFF).
mp3
Package mp3 implements decoding of MPEG-1 Audio Layer III (MP3) files.
Package mp3 implements decoding of MPEG-1 Audio Layer III (MP3) files.
oggvorbis
Package oggvorbis implements decoding of Ogg Vorbis files.
Package oggvorbis implements decoding of Ogg Vorbis files.
qoa
Package qoa implements decoding of QOA (Quite OK Audio) files.
Package qoa implements decoding of QOA (Quite OK Audio) files.
svx
Package svx implements decoding of Amiga IFF/8SVX (8-Bit Sampled Voice)/16SVX (16-Bit Sampled Voice) files.
Package svx implements decoding of Amiga IFF/8SVX (8-Bit Sampled Voice)/16SVX (16-Bit Sampled Voice) files.
wav
Package wav implements encoding and decoding of Waveform Audio File Format (WAVE) files.
Package wav implements encoding and decoding of Waveform Audio File Format (WAVE) files.
wav/internal/riff
Package riff implements the Resource Interchange File Format (RIFF), used by WAVE.
Package riff implements the Resource Interchange File Format (RIFF), used by WAVE.
dsp
Package dsp provides digital signal processing (DSP) math primitives.
Package dsp provides digital signal processing (DSP) math primitives.
filter
Package filter provides fundamental DSP filter primitives.
Package filter provides fundamental DSP filter primitives.
fourier
Package fourier provides functions for performing Fourier Transforms and related operations.
Package fourier provides functions for performing Fourier Transforms and related operations.
lutmath
Package lutmath provides mathematical functions implemented using lookup tables (LUTs).
Package lutmath provides mathematical functions implemented using lookup tables (LUTs).
window
Package window implements window functions for digital signal processing (DSP).
Package window implements window functions for digital signal processing (DSP).
Package effect provides various audio effects and DSP chain components.
Package effect provides various audio effects and DSP chain components.
encoding
dfpwm
Package dfpwm implements encoding and decoding of DFPWM1a (Dynamic Filter Pulse Width Modulation).
Package dfpwm implements encoding and decoding of DFPWM1a (Dynamic Filter Pulse Width Modulation).
g711
Package g711 implements the G.711 audio codec, which is widely used in telephony systems.
Package g711 implements the G.711 audio codec, which is widely used in telephony systems.
pcm
Package pcm implements encoding and decoding of Pulse Code Mudulation (PCM).
Package pcm implements encoding and decoding of Pulse Code Mudulation (PCM).
Package freq provides functionality for measuring and displaying frequency.
Package freq provides functionality for measuring and displaying frequency.
Package generator provides various audio generators.
Package generator provides various audio generators.
internal
Package playback provides an interface for audio playback, allowing audio to be sent to various drivers and devices.
Package playback provides an interface for audio playback, allowing audio to be sent to various drivers and devices.
driver
Package driver provides the interface for playback drivers.
Package driver provides the interface for playback drivers.
driver/ffplay
Package ffplay provides a FFplay-based playback driver.
Package ffplay provides a FFplay-based playback driver.
driver/oto
Package oto provides a cross-platform [Oto]-based playback driver.
Package oto provides a cross-platform [Oto]-based playback driver.
resample
libsamplerate
Package libsamplerate provides CGo bindings for the libsamplerate (Secret Rabbit Code) audio resampling library.
Package libsamplerate provides CGo bindings for the libsamplerate (Secret Rabbit Code) audio resampling library.
soxr
Package soxr provides CGo bindings to the SoX Resampler Library, libsoxr.
Package soxr provides CGo bindings to the SoX Resampler Library, libsoxr.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL