Kirika/README.md
DataHoarder b35ead54da
Some checks failed
continuous-integration/drone/push Build is failing
Adjust README, build dependencies
2022-04-21 18:53:33 +02:00

20 KiB

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.
ALAC MP4* Decoding/encoding by libalac via go-alac.
*MP4 Decoding/encoding only supported on fragmented MP4 currently.

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.
MP4 - -

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://gitlab.xiph.org/xiph/libopusenc.git
cd libopusenc
./autogen.sh
./configure --prefix /usr
make
sudo make install

FDK AAC Codec Library (required by go-fdkaac)

sudo apt install libfdk-aac-dev

Alternatively if package cannot be found under your distribution:

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

libalac (required by go-alac)

git clone --depth 1 https://git.gammaspectra.live/S.O.N.G/alac.git
cd alac
autoreconf -fi
./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-alac BSD 2-Clause
S.O.N.G/alac Apache 2.0 Can be linked by cgo as a shared library.
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 Subdependency of lieff/minimp3.
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.