Config file section
|Valid in machine config files||YES|
|Valid in mode config files||YES|
|Valid in shows||YES|
This section can also be used in a show file in the
tracks: section of a step.
track_player: section of your config is where you specify actions to perform on audio
tracks when MPF events are received. Tracks can be stopped, paused, or played with an optional
fade time. The volume of a track can also be changed with an optional fade time. Finally, all
sounds currently playing on a track can be stopped (again with an optional fade
out time). (This player is part of the MPF media controller and only available if you’re
using MPF-MC for your media controller.)
See the config player for more information on config players.
New in version 0.32.
Usage in config files¶
In config files, the track player is used via the
track_player: section. Event names that
will trigger track actions are nested sub-headings and track names are listed as nested
sub-headings below that.
__all__ can be used in place of a track name to apply the action
to all audio tracks in the sound system.
track_player: pause_music_track: music: action: pause fade: 1 sec resume_music_track: music: action: play stop_sounds_on_all_tracks: __all__: action: stop_all_sounds fade: 0.5 sec
Usage in shows¶
In shows, the track player is used via the
tracks: section of a step.
shows: my_show_with_sound: - time: 0 tracks: music: action: set_volume volume: 0.3 fade: 0.25 sec - time: 3.5 tracks: music: action: set_volume volume: 0.5 fade: 0.25 sec
The following sections are required for each named sound pool in your config:
Single value, type: one of the following options: play, stop, pause, set_volume, stop_all_sounds. Default: None
action: setting controls what action will be performed on the specified track. Options for
play- The specified track will be played after it has been stopped or paused.
stop- The track is stopped (with an optional fade out time). All sound processing on the track is stopped and the track is cleared. All playing and queued sounds are canceled. All sound events on the track are ignored/discarded while the track is stopped.
pause- The track is paused (with an optional fade out time). All sound processing on the track is paused. The track will pick-up where it left off when played/resumed. All sound events on the track are ignored/discarded while the track is paused.
set_volume- Set a new volume level for the track (with an optional timed fade from the current volume level).
stop_all_sounds- Stops all sounds currently playing on the track (with optional fade out time) and cancels any pending sounds in the track sound queue. The
fade_outsetting for any playing sounds will be ignored. The track will continue to process new sound events.
Single value, type:
gain setting (Instructions for entering gain values)
-inf, db, or float between 0.0 and 1.0. Default:
The new volume setting for the track. As with all volume parameters in MPF, this item can be
represented as a number between 0.0 and 1.0 (1.0 is max volume, 0.0 is off, 0.9 is 90%, etc.)
It also can be represented as a decibel string from -inf to 0.0 db (ex:
-3.0 db). This
setting only applies to the
set_volume action and will be ignored for all others.
There is no express (one line) configuration for the track player. You must specify the
setting every time.