Stops the music either by fading out quickly, or by enqueuing and End-Segment.

Assembly: psaiCoreDotNet (in psaiCoreDotNet.dll) Version: (


public PsaiResult StopMusic(
	bool immediately


Type: System..::..Boolean
passing 'true' will stop the playback by a quick fadeout; 'false' will smoothly end the music via the shortest path to a Segment that has the END-Suitability set.

Return Value

Type: PsaiResult
"PsaiResult.OK if successful
"PsaiResult.initialization_errorpsai has not been initialized correctly. See psai.log for more information.
"PsaiResult.unknown_themethe requested Theme does not exist in the current soundtrack
"PsaiResult.commandIgnoredMenuModeActivethe command was ignored, call MenuModeLeave() first.
"PsaiResult.commandIgnoredpsai is already in Silence Mode


If the "immediately" parameter is set to false, psai will wait for the current Segment to finish, then play an End- Segment of the current Theme, then stop the music. Psai will remain silent until you explicitly trigger another Theme by calling TriggerMusicTheme().

See Also