How go-audio/audio works
Project type and purpose
• This is a Go-based library (package “audio”) providing a common Buffer interface and implementations for audio data. It is not a standalone service or web app but an open-source tool intended for chaining decoders, encoders, processors, analyzers, and transformers that all speak the same Buffer interface.
File structure
• Top-level files:
• .travis.yml – CI configuration
• LICENSE, README.md – project metadata
• go.mod – module and dependency management
• Core source files:
• audio.go – defines the Buffer interface
• float_buffer.go – implements Buffer with float64 backing
• int_buffer.go – implements Buffer with int backing
• pcm_buffer.go – wraps raw PCM data into a Buffer
• conv.go, formats.go – utilities to convert between formats or Buffer types
• doc.go – package-level documentation
• Test files (suffix _test.go) sit alongside their implementations.
README for additional insights
• The Buffer interface is the centerpiece.
• Implementations include FloatBuffer, IntBuffer (and a Float32Buffer if performance-critical).
• The goal is chainability: any audio library can consume or produce an audio.Buffer.