A service which plays tracks throughout a competition.
Install the library using:
pip install -U pip setuptools wheel
pip install git+https://github.com/srobo/srcomp-mixtapeInstall:
pip install -e .
Run checks:
./script/check
A configuration of tracks and triggers to play during a competition is called
a mixtape. A mixtape is a directory containing:
- A configuration file,
playlist.yaml, which defines trigger points, - Tracks to play, in 16-bit, 44.1kHz uncompressed WAV format.
Using uncompressed audio is unfortunately necessary due to the nondeterministic time it takes to decode compressed audio, which can throw off timings.
playlist.yaml contains the following top-level keys:
magicqdefines the MagicQ connection settings, for automatic triggering of lights.tracksdefines the triggers and tracks to be played in a specific match, as a giant dictionary of the match number to track configuration.alldefines the triggers and tracks to be played in every match, in the same format as a single match intracks.obs_studiodefines the connection settings to an instance of OBS Studio which has the obs-websocket plugin installed. This requires the following nested keys:port: the websocket port for the (probably 4444)password: the password for the websocketsource_name: the name of the "Source" within OBS Studio that will play the videos. The source being controlled the option "Close file when inactive" needs to be set to allow the source to be changed when not active.scene_name: the name of the "Scene" within OBS Studio that contains the above Source. The scene being transitioned to needs "Transition Override > Fade" selected so there is a fade.preload_time: the duration, in seconds, before a video is played that it should be loaded and transitioned to.
The configuration for a track is a list of triggers, each of which is a dictionary containing the following keys:
startis the time of the trigger, in seconds, relative to the game start time. Note: This value can be negative to represent actions before the start of the match. The limit is the pre-match time defined in the compstate schedule.
And either:
filenameis the path to a WAV file to play, relative to the mixtape directory.output_deviceis the Audio device to send the output to.group(optional) is the exclusivity group to assign this trigger to; only one sound from a given exclusivity group can be playing at a time.
Or:
magicq_cueis the MagicQ cue ID to send.magicq_playbackis the MagicQ playlist ID to send.
Or:
obs_videois the path to a video file which should be played by OBS Studio. The track start corresponds to the point where the video begins playing. The video will be loaded and transitioned topreload_timeseconds before this.obs_videoalso supports using the placeholder{match_num}in the filename given, this is substituted for the match number each time the action is used.
Or:
obs_sceneis the scene name to transistion to.- The scene being transitioned to needs "Transition Override > Fade" selected so there is a fade.