StopAudioStream(object, int, float)

From NWN Lexicon
Jump to navigationJump to search

Stops the given audio stream.

void StopAudioStream(
    object oPlayer,
    int nStreamIdentifier,
    float fFadeTime = 0.0
);

Parameters

oPlayer
The player to play an audio stream for.
nStreamIdentifier
Which AUDIOSTREAM_IDENTIFIER_* to start. There are 10 available in total.
fFadeTime
The amount of seconds to gradually fade out the audio instead of stopping directly (default: 0.0f)


Description

Stops the given audio stream.

Only one type of fading can be active at once, for example: If you call StartAudioStream() with fFadeInTime = 10.0f, any other audio stream functions with a fade time >0.0f will have no effect until StartAudioStream() is done fading.

Will do nothing if the stream is currently not in use.


Remarks

Noted above you cannot crossfade, although if you have "end of music" audio file - like how combat music has - then this would be good to use as a substitute.


Version

This function was added in 88.8193.36-11 of NWN:EE.


Example

// Stops the audio track 0 with a fade time of 5 seconds
void main()
{
    object oPC = GetFirstPC();

    StartAudioStream(oPlayer, AUDIOSTREAM_IDENTIFIER_0, 5.0);
}

See Also

functions: 

StartAudioStream SetAudioStreamPaused SetAudioStreamVolume SeekAudioStream