[AudioStreamGenerator] Add mixing rate presets, update docs.
This commit is contained in:
@@ -73,6 +73,25 @@
|
||||
The sample rate to use (in Hz). Higher values are more demanding for the CPU to generate, but result in better quality.
|
||||
In games, common sample rates in use are [code]11025[/code], [code]16000[/code], [code]22050[/code], [code]32000[/code], [code]44100[/code], and [code]48000[/code].
|
||||
According to the [url=https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem]Nyquist-Shannon sampling theorem[/url], there is no quality difference to human hearing when going past 40,000 Hz (since most humans can only hear up to ~20,000 Hz, often less). If you are generating lower-pitched sounds such as voices, lower sample rates such as [code]32000[/code] or [code]22050[/code] may be usable with no loss in quality.
|
||||
[b]Note:[/b] [AudioStreamGenerator] is not automatically resampling input data, to produce expected result [member mix_rate_mode] should match the sampling rate of input data.
|
||||
[b]Note:[/b] If you are using [AudioEffectCapture] as the source of your data, set [member mix_rate_mode] to [constant MIX_RATE_INPUT] or [constant MIX_RATE_OUTPUT] to automatically match current [AudioServer] mixing rate.
|
||||
</member>
|
||||
<member name="mix_rate_mode" type="int" setter="set_mix_rate_mode" getter="get_mix_rate_mode" enum="AudioStreamGenerator.AudioStreamGeneratorMixRate" default="2">
|
||||
Mixing rate mode. If set to [constant MIX_RATE_CUSTOM], [member mix_rate] is used, otherwise current [AudioServer] mixing rate is used.
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
<constant name="MIX_RATE_OUTPUT" value="0" enum="AudioStreamGeneratorMixRate">
|
||||
Current [AudioServer] output mixing rate.
|
||||
</constant>
|
||||
<constant name="MIX_RATE_INPUT" value="1" enum="AudioStreamGeneratorMixRate">
|
||||
Current [AudioServer] input mixing rate.
|
||||
</constant>
|
||||
<constant name="MIX_RATE_CUSTOM" value="2" enum="AudioStreamGeneratorMixRate">
|
||||
Custom mixing rate, specified by [member mix_rate].
|
||||
</constant>
|
||||
<constant name="MIX_RATE_MAX" value="3" enum="AudioStreamGeneratorMixRate">
|
||||
Maximum value for the mixing rate mode enum.
|
||||
</constant>
|
||||
</constants>
|
||||
</class>
|
||||
|
||||
Reference in New Issue
Block a user