2022-02-22 09:24:49 +00:00
# [![](resources/kirikas.png)](resources/kirika.png) Kirika
Collection of audio utilities for decoding/encoding files and streams.
2022-03-01 17:10:01 +00:00
* Not based on ffmpeg/libav/libavcodec/libavformat and alike
2022-02-22 18:30:48 +00:00
* Channel-based audio consumption/filter chain
* Raw sample analyzer channels
* AnalyzerChannel channels / mergers / splitters / trimmers
2022-02-22 09:24:49 +00:00
* Audio resampler
2022-02-22 18:30:48 +00:00
* Audio downmixing to stereo/mono
2022-03-01 17:10:01 +00:00
* Multi-codec decoder and encoder
* Multi-format packetizers
2022-03-08 11:13:55 +00:00
* ReplayGain 2.0 track/album calculator
2022-02-28 14:47:50 +00:00
2022-03-01 17:10:01 +00:00
## Codecs supported
2022-02-28 14:47:50 +00:00
2022-04-17 21:25:38 +00:00
| Codec | Containers | Decoder | Analyzer | Encoder | Notes |
|:----------:|:----------------------------------------------------------------------------------------:|:-------:|:--------:|:-------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **FLAC** | [FLAC ](https://xiph.org/flac/format.html ), [Ogg ](https://xiph.org/flac/ogg_mapping.html ) | ✅ | ✅ | ✅ | Adjustable encoding compression level and block size.< br /> Decoding/encoding by [libFLAC ](https://github.com/xiph/flac ) via [goflac ](https://git.gammaspectra.live/S.O.N.G/goflac ). |
| **TTA** | [TTA ](https://www.tausoft.org/en/true_audio_codec_format/ ) | ✅ | ✅ | ✅ | Decoding/encoding via [go-tta ](https://git.gammaspectra.live/S.O.N.G/go-tta ). |
| **MP3** | [MP3 ](http://mpgedit.org/mpgedit/mpeg_format/MP3Format.html ) | ✅ | - | ✅ | Adjustable encoding bitrate and mode.< br /> Decoding via [minimp3 ](https://github.com/kvark128/minimp3 ), encoding by [LAME ](https://lame.sourceforge.io/ ) via [go-lame ](https://github.com/viert/go-lame ). |
| **Opus** | [Ogg ](https://www.xiph.org/ogg/doc/framing.html ) | ✅ | - | ✅ | Adjustable encoding bitrate.< br /> Decoding/encoding by [libopus ](https://github.com/xiph/opus ) via [go-pus ](https://git.gammaspectra.live/S.O.N.G/go-pus ). |
| **Vorbis** | [Ogg ](https://www.xiph.org/ogg/doc/framing.html ) | ✅ | - | ❌ | Decoding by [jfreymuth/vorbis ](https://github.com/jfreymuth/vorbis ) via [jfreymuth/oggvorbis ](https://github.com/jfreymuth/oggvorbis ). |
| **AAC** | [ADTS ](https://wiki.multimedia.cx/index.php/ADTS ) | ✅ | - | ✅ | Adjustable encoding bitrate and mode (LC, HEv2).< br /> Decoding/encoding by [FDK-AAC ](https://github.com/mstorsjo/fdk-aac ) via [go-fdkaac ](https://git.gammaspectra.live/S.O.N.G/go-fdkaac ). |
2022-02-22 09:24:49 +00:00
2022-03-01 17:10:01 +00:00
## Container packetizers supported
2022-04-17 18:27:29 +00:00
2022-04-17 21:25:38 +00:00
| Container | Packetizer | Keep Mode | Sample Numbers | Notes |
|:---------:|:----------:|:---------:|:--------------:|:---------------------------------------------------------------------------------------------------------------------------------------|
| **FLAC** | ✅ | ✅ | ✅ | Uses [mewkiz/flac ](https://github.com/mewkiz/flac ) for parsing streams. |
| **TTA** | ❌ | - | - | |
| **MP3** | ✅ | ✅ | ✅ | Uses [sssgun/mp3 ](https://github.com/sssgun/mp3 ) as a frame parser. |
| **Ogg** | ✅ | ✅ | ✅* | *Sample numbers (absolute granule position in Ogg) depend on underlying codec implementing it.< br /> Has been tested as working for Opus |
| **ADTS** | ✅ | ✅ | ✅ | Uses [edgeware/mp4ff ](https://github.com/edgeware/mp4ff ) for its ADTS frame parser. |
2022-03-01 17:10:01 +00:00
2022-02-22 09:24:49 +00:00
## Dependencies
### Go >= 1.18
2022-04-17 21:25:38 +00:00
### [libFLAC](https://github.com/xiph/flac) (required by [goflac](https://git.gammaspectra.live/S.O.N.G/goflac))
2022-02-22 09:24:49 +00:00
```shell
sudo apt install libflac-dev
```
### [libopus](https://github.com/xiph/opus) and [libopusfile](https://github.com/xiph/opusfile) (required by [go-pus](https://git.gammaspectra.live/S.O.N.G/go-pus))
```shell
sudo apt install libopus-dev libopusfile-dev
```
2022-02-27 18:44:04 +00:00
### [libopusenc](https://github.com/xiph/libopusenc) (required by [go-pus](https://git.gammaspectra.live/S.O.N.G/go-pus))
```shell
2022-02-28 12:54:17 +00:00
git clone --depth 1 https://github.com/xiph/libopusenc.git
2022-02-27 18:44:04 +00:00
cd libopusenc
./autogen.sh
./configure --prefix /usr
make
sudo make install
```
2022-02-28 13:38:23 +00:00
### [FDK AAC Codec Library](https://github.com/mstorsjo/fdk-aac) (required by [go-fdkaac](https://git.gammaspectra.live/S.O.N.G/go-fdkaac))
2022-02-28 12:54:17 +00:00
```shell
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
```
2022-02-28 13:38:23 +00:00
### [LAME](https://lame.sourceforge.io/) (required by [go-lame](https://github.com/viert/go-lame))
2022-02-27 15:43:50 +00:00
```shell
sudo apt install libmp3lame-dev
```
2022-02-22 09:24:49 +00:00
### [libsamplerate](https://github.com/libsndfile/libsamplerate) (required by [gosamplerate](https://github.com/dh1tw/gosamplerate))
```shell
sudo apt install libsamplerate0-dev
2022-03-08 11:13:55 +00:00
```
### [libebur128](https://github.com/jiixyj/libebur128) (required by [go-ebur128](https://git.gammaspectra.live/S.O.N.G/go-ebur128))
```shell
sudo apt install libebur128-dev
2022-02-22 09:24:49 +00:00
```