Integration

Media

Control media playback and access now playing information from Spotify, Windows Media, and other media players. Display current song on stream and let viewers control music.

Overview

FaustBot integrates with system media controls for playback management:

Now Playing

Get current track, artist, and album.

Playback Control

Play, pause, skip, and previous.

Stream Display

Show current song on your overlay.

Chat Commands

Let viewers see what's playing.

Supported Players

Works with any media player that integrates with Windows Media Session: Spotify, VLC, Windows Media Player, Chrome/Edge, and more.

Setup

1

Enable Media Integration

Go to Integrations → Media and enable the integration. FaustBot will detect active media sessions.

2

Start Playing Music

Open your preferred media player (Spotify, etc.) and start playing music. FaustBot will automatically detect the active session.

3

Create Actions

Set up actions for chat commands like !song or !skip to let viewers interact with your music.

Triggers

Track Changed New song started playing
Playback Started Media started playing
Playback Paused Media was paused
Playback Stopped Media playback stopped

Trigger Variables

VariableDescription
%mediaTitle%Track/song title
%mediaArtist%Artist name
%mediaAlbum%Album name
%mediaPlayer%Media player name
%mediaStatus%Playing, Paused, or Stopped
%mediaDuration%Track duration in seconds
%mediaPosition%Current position in seconds

Scripting API

Control media playback from your scripts:

Playback Control

# Get current media info
info = CPH.MediaGetCurrentMedia()
if info:
    CPH.LogInfo(f"Now playing: {info['title']} by {info['artist']}")
    CPH.LogInfo(f"Album: {info['album']}")

# Media playback controls
CPH.MediaPlay()
CPH.MediaPause()
CPH.MediaPlayPause()  # Toggle
CPH.MediaStop()
CPH.MediaNext()
CPH.MediaPrevious()

Now Playing Display

# Display now playing in chat
def Execute():
    info = CPH.MediaGetCurrentMedia()
    if info:
        CPH.SendMessage(f"🎵 Now playing: {info['title']} - {info['artist']}")
    else:
        CPH.SendMessage("No media currently playing")
    return True

# Update OBS with current song
def Execute():
    info = CPH.MediaGetCurrentMedia()
    if info:
        text = f"🎵 {info['title']} - {info['artist']}"
        CPH.ObsSetGdiText("Now Playing", text)
    return True

See the full API reference for all available media methods.