Collection of audio utilities for decoding/encoding files and streams.
Go to file
DataHoarder 40a32bba46
Some checks failed
continuous-integration/drone/push Build is failing
Flush MP3 encoder after finishing
2022-04-20 13:18:24 +02:00
audio Flush MP3 encoder after finishing 2022-04-20 13:18:24 +02:00
cgo Added 24-bit and 8-bit modes to TTA encoder 2022-04-17 23:25:38 +02:00
hasher Added Hasher / Filter / Sink interfaces and implementation 2022-02-22 19:30:48 +01:00
resources Added Vorbis support 2022-03-05 11:09:24 +01:00
.drone.yml Update dependencies, use Go 1.18 release 2022-04-17 03:11:53 +02:00
.gitignore Initial commit 2022-02-22 10:35:08 +01:00
.gitmodules Addded samples submodule 2022-02-22 10:44:50 +01:00
go.mod Bumped go-ebur128 dependency 2022-04-20 11:11:14 +02:00
go.sum Bumped go-ebur128 dependency 2022-04-20 11:11:14 +02:00
Kirika.go Initial commit 2022-02-22 10:35:08 +01:00
Kirika_test.go Added license information to README.md 2022-04-18 00:22:59 +02:00
LICENSE Initial commit 2022-02-22 10:35:08 +01:00
README.md Added relevant subdependencies to License section 2022-04-18 22:17:11 +02:00

Kirika

Collection of audio utilities for decoding/encoding files and streams.

  • Not based on ffmpeg/libav/libavcodec/libavformat and alike
  • Channel-based audio consumption/filter chain
  • Raw sample analyzer channels
  • AnalyzerChannel channels / mergers / splitters / trimmers
  • Audio resampler
  • Audio downmixing to stereo/mono
  • Multi-codec decoder and encoder
  • Multi-format packetizers
  • ReplayGain 2.0 track/album calculator

Codecs supported

Codec Containers Decoder Analyzer Encoder Notes
FLAC FLAC, Ogg Adjustable encoding compression level and block size.
Decoding/encoding by libFLAC via goflac.
TTA TTA Decoding/encoding via go-tta.
MP3 MP3 - Adjustable encoding bitrate and mode.
Decoding via minimp3, encoding by LAME via go-lame.
Opus Ogg - Adjustable encoding bitrate.
Decoding/encoding by libopus via go-pus.
Vorbis Ogg - Decoding by jfreymuth/vorbis via jfreymuth/oggvorbis.
AAC ADTS - Adjustable encoding bitrate and mode (LC, HEv2).
Decoding/encoding by FDK-AAC via go-fdkaac.

Container packetizers supported

Container Packetizer Keep Mode Sample Numbers Notes
FLAC Uses mewkiz/flac for parsing streams.
TTA - -
MP3 Uses sssgun/mp3 as a frame parser.
Ogg * *Sample numbers (absolute granule position in Ogg) depend on underlying codec implementing it.
Has been tested as working for Opus
ADTS Uses edgeware/mp4ff for its ADTS frame parser.

Dependencies

Go >= 1.18

libFLAC (required by goflac)

sudo apt install libflac-dev

libopus and libopusfile (required by go-pus)

sudo apt install libopus-dev libopusfile-dev

libopusenc (required by go-pus)

git clone --depth 1 https://github.com/xiph/libopusenc.git
cd libopusenc
./autogen.sh
./configure --prefix /usr
make
sudo make install

FDK AAC Codec Library (required by go-fdkaac)

git clone --depth 1 https://github.com/mstorsjo/fdk-aac.git
cd fdk-aac
./autogen.sh
./configure --prefix /usr
make -j$(nproc)
sudo make install

LAME (required by go-lame)

sudo apt install libmp3lame-dev

libsamplerate (required by gosamplerate)

sudo apt install libsamplerate0-dev

libebur128 (required by go-ebur128)

sudo apt install libebur128-dev

Licenses

Kirika

Copyright (c) 2022 Kirika Contributors All rights reserved.

Redistribution and use in source and binary forms, with or without modification,are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Dependencies

Subdependencies that are not cgo-based are denoted in cursive.

Dependency License Notes
S.O.N.G/go-ebur128 BSD 2-Clause
jiixyj/libebur128 MIT Can be linked by cgo as a shared library.
S.O.N.G/go-fdkaac MIT
mstorsjo/fdk-aac FDK License, BSD-like Does not include patent grants.
Can be linked by cgo as a shared library.
S.O.N.G/go-pus MIT
xiph/opus BSD 3-Clause Read extra license details on the official site.
Can be linked by cgo as a shared library.
xiph/opusfile BSD 3-Clause Can be linked by cgo as a shared library.
xiph/ogg BSD 3-Clause Can be linked by cgo as a shared library.
xiph/libopusenc BSD 3-Clause Can be linked by cgo as a shared library.
S.O.N.G/go-tta LGPL v3
S.O.N.G/goflac BSD 3-Clause
xiph/flac BSD 3-Clause Read extra license details on the official site.
Can be linked by cgo as a shared library.
dh1tw/gosamplerate BSD 2-Clause
libsndfile/libsamplerate BSD 2-Clause Can be linked by cgo as a shared library.
edgeware/mp4ff MIT
jfreymuth/oggvorbis MIT
jfreymuth/vorbis MIT Subdependency of jfreymuth/oggvorbis.
kvark128/minimp3 MIT
lieff/minimp3 CC0 1.0
mewkiz/flac The Unlicense
go-audio/audio Apache 2.0 Subdependency of mewkiz/flac. Only used on tests there.
go-audio/wav Apache 2.0 Subdependency of mewkiz/flac. Only used on tests there.
go-audio/riff Apache 2.0 Subdependency of go-audio/wav. Only used on tests there.
icza/bitio Apache 2.0 or LGPL v2.1 Subdependency of mewkiz/flac.
sssgun/mp3 MIT
viert/go-lame MIT
LAME LGPL v2 Can be linked by cgo as a shared library.