Scroll to navigation

Mix_SetMusicCMD(3) SDL_mixer3 FUNCTIONS Mix_SetMusicCMD(3)

NAME

Mix_SetMusicCMD - Run an external command as the music stream.

SYNOPSIS

#include "SDL3_mixer/SDL_mixer.h"
int Mix_SetMusicCMD(const char *command);

DESCRIPTION

This halts any currently-playing music, and next time the music stream is played, SDL_mixer will spawn a process using the command line specified in command . This command is not subject to shell expansion, and beyond some basic splitting up of arguments, is passed to execvp() on most platforms, not system().

The command is responsible for generating sound; it is NOT mixed by SDL_mixer! SDL_mixer will kill the child process if asked to halt the music, but otherwise does not have any control over what the process does.

You are strongly encouraged not to use this function without an extremely good reason.

FUNCTION PARAMETERS

command

RETURN VALUE

Returns 0 if successful, -1 on error

AVAILABILITY

This function is available since SDL_mixer 3.0.0.

SDL_mixer 3.0.0 SDL_mixer