From a7fb82f3d34e0787d10f00b9748aeb40c761b0c5 Mon Sep 17 00:00:00 2001
From: WeebDataHoarder <57538841+WeebDataHoarder@users.noreply.github.com>
Date: Fri, 29 Jul 2022 12:57:50 +0200
Subject: [PATCH] Clarified filters and hashers on README
---
README.md | 37 ++++++++++++++++++++++++++++++++++---
audio/filter/filter.go | 2 +-
2 files changed, 35 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 29e5c22..1545b3d 100644
--- a/README.md
+++ b/README.md
@@ -37,6 +37,37 @@ Only output from Kirika's own encoders is supported.
| **MP4** | ❌ | - | - | - | |
| **ADIF** | ❌ | - | - | - | |
+## Filters
+
+
+| Filter | Native Sample Format | Notes |
+|:-------------:|:---------------------:|:---------------------------------------------------------------------------------------------------------------------------:|
+| Resample | `float32` | Changes input source sample rate to a different sample rate.
If source sample rate equals `sampleRate`, returns source. |
+| Source Format | `float32 int16 int32` | Changes input source to a different format. |
+| Buffer | `float32 int16 int32` | Makes output source a buffered channel of the specified size. |
+| Block Size | `float32 int16 int32` | Adjusts input source blocks to a normalized block size. |
+| Real Time | `float32 int16 int32` | Outputs enough samples per second equal to the source sample rate. |
+| Volume | `float32 int16 int32` | Adjusts volume of all samples equally.
If `adjustement` equals `1.0`, returns source. |
+| Stereo | `float32 int16 int32` | Makes input stereo.
If source channels equals `2`, returns source. |
+| Mono | `float32 int16 int32` | Makes input mono.
If source channels equals `1`, returns source. |
+| ReplayGain | `float32 int16 int32` | Creates a Volume filter with the specified ReplayGain parameters. |
+| Normalization | `float32` | Automatically adjusts volume according to short term audio loudness. |
+
+### Filter Chain
+Allows chaining different filters together where one's output is the next one input.
+
+## Hashers
+Several audio Analyzer hashers are implemented. List of current ones:
+* CRC32
+* SHA256
+* SHA1
+* MD5
+* AccurateRipV1
+* AccurateRipV1 (Start mode)
+* AccurateRipV2
+* AccurateRipV2 (Start mode)
+
+
## Dependencies
### Go >= 1.18
@@ -123,10 +154,10 @@ Some tests cannot be completed in this mode.
| **FLAC** | [FLAC](https://xiph.org/flac/format.html) | ✅ | ✅ | `int32` | ✅* | Decoding/encoding by [flacgo](https://git.gammaspectra.live/S.O.N.G/flacgo).
*Encoder only supports Verbatim / Constant frame prediction modes, offering almost no compression. |
| **TTA** | [TTA](https://www.tausoft.org/en/true_audio_codec_format/) | ✅ | ✅ | `int32` | ✅ | Decoding/encoding by [S.O.N.G/go-tta](https://git.gammaspectra.live/S.O.N.G/go-tta). |
| **MP3** | [MP3](http://mpgedit.org/mpgedit/mpeg_format/MP3Format.html) | ✅ | ❌ | `2ch. int16` | ❌ | Decoding by [hajimehoshi/go-mp3](https://github.com/hajimehoshi/go-mp3). |
-| **Opus** | - | ❌ | ❌ | - | ❌ | |
+| **Opus** | - | ❌ | - | - | ❌ | |
| **Vorbis** | [Ogg](https://www.xiph.org/ogg/doc/framing.html) | ✅ | ❌ | `float32` | ❌ | Decoding by [jfreymuth/vorbis](https://github.com/jfreymuth/vorbis) via [jfreymuth/oggvorbis](https://github.com/jfreymuth/oggvorbis). |
-| **AAC** | - | ❌ | ❌ | - | ❌ | |
-| **ALAC** | - | ❌ | ✅ | - | ❌ | |
+| **AAC** | - | ❌ | - | - | ❌ | |
+| **ALAC** | - | ❌ | - | - | ❌ | |
### disable_format_[format]
diff --git a/audio/filter/filter.go b/audio/filter/filter.go
index ddd9f66..d6a7f52 100644
--- a/audio/filter/filter.go
+++ b/audio/filter/filter.go
@@ -34,7 +34,7 @@ func (f SourceFormatFilter) Process(source audio.Source) audio.Source {
} else if int32Source, ok := source.(audio.TypedSource[int32]); ok {
return int32Source
} else {
- return source.ToInt32(32)
+ return source.ToInt32(source.GetBitDepth())
}
}