Class: FMOD::Effects::Normalize
- Defined in:
- lib/fmod/effects/normalize.rb
Overview
This unit normalizes or amplifies the sound to a certain level.
Normalize amplifies the sound based on the maximum peaks within the signal.
For example if the maximum peaks in the signal were 50% of the bandwidth, it would scale the whole sound by 2.
The lower threshold value makes the normalizer ignores peaks below a certain point, to avoid over-amplification if a loud signal suddenly came in, and also to avoid amplifying to maximum things like background hiss.
Because FMOD is a realtime audio processor, it doesn’t have the luxury of knowing the peak for the whole sound (ie it can’t see into the future), so it has to process data as it comes in.
To avoid very sudden changes in volume level based on small samples of new data, fmod fades towards the desired amplification which makes for smooth gain control. The fade-time parameter can control this.
Instance Attribute Summary collapse
-
#fade_time ⇒ Float
Time to ramp the silence to full in ms.
-
#max_amp ⇒ Float
Maximum amplification allowed.
-
#threshold ⇒ Float
Lower volume range threshold to ignore.
Attributes inherited from Dsp
#active, #bypass, #channel_format, #input_count, #output_count, #parameter_count, #parent, #type, #wet_dry_mix
Attributes inherited from Handle
Method Summary
Methods inherited from Dsp
#[], #[]=, #add_input, bool_param, data_param, #disconnect, #disconnect_from, #enable_metering, float_param, from_handle, #get_bool, #get_data, #get_float, #get_integer, #idle?, #info, #input, #input_connection, #input_metering?, integer_param, #name, #output, #output_connection, #output_format, #output_metering?, #param_info, #play, #reset, #set_bool, #set_data, #set_float, #set_integer, #set_wet_dry_mix, #show_dialog, #to_s, type_map, #version
Methods inherited from Handle
#initialize, #int_ptr, #release, #to_s
Constructor Details
This class inherits a constructor from FMOD::Handle
Instance Attribute Details
#fade_time ⇒ Float
Time to ramp the silence to full in ms.
-
Minimum: 0.0
-
Maximum: 20000.0
-
Default: 5000.0
41 42 43 |
# File 'lib/fmod/effects/normalize.rb', line 41 def fade_time @fade_time end |
#max_amp ⇒ Float
Maximum amplification allowed. Higher values allow more boost.
-
Minimum: 1.0 (no amplification)
-
Maximum: 100000.0
-
Default: 20.0
41 42 43 |
# File 'lib/fmod/effects/normalize.rb', line 41 def max_amp @max_amp end |
#threshold ⇒ Float
Lower volume range threshold to ignore. Raise higher to stop amplification of very quiet signals.
-
Minimum: 0.0
-
Maximum: 1.0
-
Default: 0.1
41 42 43 |
# File 'lib/fmod/effects/normalize.rb', line 41 def threshold @threshold end |