Volume ramping example

The following shows you the configuration to use in the audio policy configuration file to use volume ramping.

Here's how the [VOL_RAMP] tag is used. The names that you can use are volume_mute, pause_resume, and ducking. The duration you set is in milliseconds. You can specify use the profile key-value pair to specify multiple sample percentages of the specified duration and volume increments (expressed as percentages) that can be used to curve the volume ramp; otherwise if you don't provide profile, the volume ramp is linear. For more information about the syntax, see the Syntax of the audio policy configuration file in this chapter.

name=volume_mute             # When mixer API calls are made,
                             # such as snd_pcm_mixer_write()
duration=20                  # Ramp in the span of 20 milliseconds
profile=20:10,60:80,20:10    # Defined are three linear segments.
                             # Segment 1, specifies 20% of the duration and increase the
                             # volume by 10% of the volume ramp. Segment 2, species
                             # 60% of the duration and 80% of the volume increase, and
                             # segment 3, specifies the remaining 20% duration
                             # and to increase the volume by the remaining 10%

name=pause_resume            # Whenever the user calls snd_pcm_*_resume() or
                             # snd_pcm_*_pause()
duration=30                  # duration of 30 milliseconds
                             # No profile key-value is specified, so
                             # it's a linear ramp

name=ducking                 # When ducking policies and preemption is used
duration=60                  # Ramp time is 60 milliseconds