Skip to content

Commit

Permalink
Add filters documentation + fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Eliastik committed Jan 6, 2025
1 parent 9845dbc commit 7c4a727
Show file tree
Hide file tree
Showing 36 changed files with 504 additions and 290 deletions.
210 changes: 210 additions & 0 deletions FILTERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
# Filters

## English

This documentation list all filters available in this library and their settings.

The filters code is located in [lib/filters/](lib/filters/) folder.

### BassBoosterFilter

This filter simply apply a bass boost filter to the audio.

#### Settings

```
{
frequencyBooster: "200",
frequencyReduce: "200",
dbBooster: "15",
dbReduce: "-2"
}
```

* `frequencyBooster`: In hz, frequencies below this will be bass-boosted
* `frequencyReduce`: In hz, frequencies above this will be reduced
* `dbBooster`: In db, set the bass-boosting gain
* `dbReduce`: In db, set the reduction gain

### BitCrusherFilter

This filter apply a 8-bit effect to the audio.

#### Settings

```
{
bits: "16",
normFreq: "0.9"
}
```

* `bits`: Set the resolution
* `normFreq`: Set the filter intensity (between 0 and 1)

### EchoFilter

This filter apply an echo effect to the audio. This is a different effect from a reverb.

#### Settings

```
{
delay: "0.2",
gain: "0.75"
}
```

* `delay`: Set the delay
* `gain`: Set the gain

### HighPassFilter

This filter apply a high pass effect.

#### Settings

```
{
highFrequency: "3500"
}
```

* `highFrequency`: In hz, the frequencies below this value will be reduced

### LowPassFilter

This filter apply a low pass effect.

#### Settings

```
{
lowFrequency: "3500"
}
```

* `lowFrequency`: In hz, the frequencies above this value will be reduced

### LimiterFilter

This filter is brickwall limiter used to reduce distorsion. It can also be set as a standard compressor with certain settings.

#### Settings

```
{
preGain: "0",
postGain: "0",
attackTime: "0",
releaseTime: "6",
threshold: "0",
lookAheadTime: "0.3"
}
```

* `preGain`: Gain applied (in db) before signal processing. It can increase the input level.
* `postGain`: Gain applied (in db) after signal processing, allowing you to adjust the output volume. Please note that an excessive value will reintroduce distorsion.
* `attackTime`: The time in seconds for the limiter to reach its maximum level after the signal exceeds the threshold (threshold).
* `releaseTime`: The time in seconds for the limiter to return to its normal level after the signal falls below the threshold.
* `threshold`: The level at which the limiter starts to act. Signals above this level are reduced.
* `lookAheadTime`: The time in seconds, indicating how much ahead the limiter looks at the signal to adjust compression.


### PassThroughFilter

This filter should not be used. It is used to monitor audio processing. It is automatically managed by the library.

#### Settings

This filter does not have any configurable settings.

### ReturnAudioRenderer

This renderer is used to return the audio.

It applies a mirror effect on the audio, reversing it so that the end becomes the beginning and vice versa.

#### Settings

This renderer does not have any configurable settings.

### ReverbFilter

This filter apply a reverb effect to the audio.

#### Settings

```
{
reverbEnvironment: {
name: "Reverb Environment Name",
value: "Reverb Environment URL",
additionalData: {
size: "500",
link: "Additional resource link",
addDuration: "5"
}
},
reverbCustomEnvironmentFile: null, // Should be a File object
reverbCustomEnvironmentAddTime: "0" // Optionnal
}
```

* `reverbEnvironment`: The environment in which the reverb effect is simulated.
* `name`: The name of the reverb environment.
* `value`: A URL pointing to the reverb environment audio file.
* `additionalData`: Additional data specific to the environment:
* `size`: The size of the simulated environment in bytes.
* `link`: A link (URL) to additional resources or details about the environment.
* `addDuration`: Extra time to apply to the input audio, extending its duration, in seconds.
* `reverbCustomEnvironmentFile`: A custom reverb environment file, which should be a File object (e.g., a .wav or .ogg file) to apply a custom reverb effect.
* `reverbCustomEnvironmentAddTime`: Additional duration to apply to the input audio when using a custom environment. This parameter is optional.

### SoundtouchWrapperFilter

This filter applies speed and frequency modifications to the audio using the Soundtouch library.

#### Settings

```
{
speedAudio: "1",
frequencyAudio: "1"
}
```

* `speedAudio`: This parameter sets the speed of the audio. For example, if set to "2", the audio will play at 2x its normal speed.
* `frequencyAudio`: This parameter adjusts the frequency of the audio. For example, if set to "2", the audio will sound sharper (higher frequency) and pitched up by 2x.

### TelephonizerFilter

This filter applies a phone call effect to the audio, simulating the characteristic sound quality of a telephone call.

#### Settings

This filter does not have any configurable settings.

### VocoderFilter/VocoderRenderer

This filter applies a vocoder effect to the audio, creating a robotic voice sound.

It is preferable to use the VocoderFilter rather than the renderer VocoderRenderer for better control and flexibility.

#### Settings

```
{
modulatorGainValue: "1",
carrierSampleGainValue: "0",
oscillatorGainValue: "1",
noiseGainValue: "0.2",
oscillatorDetuneValue: "0"
}
```

* `modulatorGainValue`: Controls the gain of the modulator signal. Increasing this will intensify the effect.
* `carrierSampleGainValue`: Controls the gain of the carrier signal. Affects the strength of the audio output.
* `oscillatorGainValue`: Adjusts the gain of the oscillator signal, influencing the tonal quality.
* `noiseGainValue`: Controls the gain of the noise signal, adding texture to the vocoder effect.
* `oscillatorDetuneValue`: Controls the detuning of the oscillator, affecting the pitch and harmonic content.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ If you do not expose the files, the library will try to function as best as it c

The documentation of the methods and class can be found here: [docs/](docs/).

Documentation on the audio filters offered by the library can be found here: [FILTERS.md](FILTERS.md).

The most important part is the [AudioEditor class](docs/classes/AudioEditor.md).

You will also be interested by the [VoiceRecorder class](docs/classes/VoiceRecorder.md).
Expand Down Expand Up @@ -130,6 +132,8 @@ Si vous n'exposez pas les fichiers, la bibliothèque essaiera de fonctionner au

La documentation des méthodes et des classes se trouve ici : [docs/](docs/).

La documentation des filtres audio proposés par la librairie est ici : [FILTERS.md](FILTERS.md).

La partie la plus importante est la classe [AudioEditor](docs/classes/AudioEditor.md).

Vous serez également intéressé par la classe [VoiceRecorder](docs/classes/VoiceRecorder.md).
Expand Down
2 changes: 1 addition & 1 deletion dist/cjs/SimpleSoundStudioLibrary.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cjs/SimpleSoundStudioLibrary.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/esm/SimpleSoundStudioLibrary.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/esm/SimpleSoundStudioLibrary.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/classes/AbstractAudioElement.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Class: `abstract` AbstractAudioElement

Defined in: [interfaces/AbstractAudioElement.ts:9](https://github.com/Eliastik/simple-sound-studio-lib/blob/663925a270924e57c5730bbb254aa7f5b3523775/lib/interfaces/AbstractAudioElement.ts#L9)
Defined in: [interfaces/AbstractAudioElement.ts:9](https://github.com/Eliastik/simple-sound-studio-lib/blob/9845dbc69e805d01349b7ad64337ff031854285d/lib/interfaces/AbstractAudioElement.ts#L9)

## Extended by

Expand All @@ -31,7 +31,7 @@ Defined in: [interfaces/AbstractAudioElement.ts:9](https://github.com/Eliastik/s

> **injectDependencies**(`bufferFetcherService`, `bufferDecoderService`, `configService`, `eventEmitter`): `void`
Defined in: [interfaces/AbstractAudioElement.ts:23](https://github.com/Eliastik/simple-sound-studio-lib/blob/663925a270924e57c5730bbb254aa7f5b3523775/lib/interfaces/AbstractAudioElement.ts#L23)
Defined in: [interfaces/AbstractAudioElement.ts:23](https://github.com/Eliastik/simple-sound-studio-lib/blob/9845dbc69e805d01349b7ad64337ff031854285d/lib/interfaces/AbstractAudioElement.ts#L23)

#### Parameters

Expand Down
Loading

0 comments on commit 7c4a727

Please sign in to comment.