mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 00:06:59 +02:00
Update documentation.
This commit is contained in:
+24
-5
@@ -143,9 +143,9 @@ waveform you want to generated via the `ma_waveform_config` object which you can
|
||||
|
||||
Noise Generation
|
||||
----------------
|
||||
A noise generation API has been added. This is used via the `ma_noise` API. Currently only white noise is supported, but pink and brown noise is planned. The
|
||||
`ma_noise` API is similar to the waveform API. Use `ma_noise_config_init()` to initialize a config object, and then pass it into `ma_noise_init()` to
|
||||
initialize a `ma_noise` object. Then use `ma_noise_read_pcm_frames()` to read PCM data.
|
||||
A noise generation API has been added. This is used via the `ma_noise` API. Currently white and pink noise is supported. The `ma_noise` API is similar to the
|
||||
waveform API. Use `ma_noise_config_init()` to initialize a config object, and then pass it into `ma_noise_init()` to initialize a `ma_noise` object. Then use
|
||||
`ma_noise_read_pcm_frames()` to read PCM data.
|
||||
|
||||
|
||||
Miscellaneous Changes
|
||||
@@ -1070,10 +1070,22 @@ The amplitude, frequency and sample rate can be changed dynamically with `ma_wav
|
||||
You can reverse the waveform by setting the amplitude to a negative value. You can use this to control whether or not a sawtooth has a positive or negative
|
||||
ramp, for example.
|
||||
|
||||
Below are the supported waveform types:
|
||||
|
||||
|---------------------------|
|
||||
| Enum Name |
|
||||
|---------------------------|
|
||||
| ma_waveform_type_sine |
|
||||
| ma_waveform_type_square |
|
||||
| ma_waveform_type_triangle |
|
||||
| ma_waveform_type_sawtooth |
|
||||
|---------------------------|
|
||||
|
||||
|
||||
|
||||
Noise
|
||||
-----
|
||||
miniaudio supports generation of white noise via the `ma_noise` API. Example:
|
||||
miniaudio supports generation of white and pink noise via the `ma_noise` API. Example:
|
||||
|
||||
```c
|
||||
ma_noise_config config = ma_noise_config_init(FORMAT, CHANNELS, ma_noise_type_white, SEED, amplitude);
|
||||
@@ -1099,7 +1111,14 @@ side. To instead have each channel use the same random value, set the `duplicate
|
||||
config.duplicateChannels = MA_TRUE;
|
||||
```
|
||||
|
||||
Currently only white noise is supported. Pink and brown noise are planned.
|
||||
Below are the supported noise types.
|
||||
|
||||
|-----------------------|
|
||||
| Enum Name |
|
||||
|-----------------------|
|
||||
| ma_noise_type_white |
|
||||
| ma_noise_type_pink |
|
||||
|-----------------------|
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ ma_result test_notch2__by_format(const char* pInputFilePath, const char* pOutput
|
||||
return result;
|
||||
}
|
||||
|
||||
notchConfig = ma_notch2_config_init(decoder.outputFormat, decoder.outputChannels, decoder.outputSampleRate, 0, 2000);
|
||||
notchConfig = ma_notch2_config_init(decoder.outputFormat, decoder.outputChannels, decoder.outputSampleRate, 1, 60);
|
||||
result = ma_notch2_init(¬chConfig, ¬ch);
|
||||
if (result != MA_SUCCESS) {
|
||||
ma_decoder_uninit(&decoder);
|
||||
|
||||
Reference in New Issue
Block a user