SeekAudioStream(object, int, float)

From NWN Lexicon
Jump to navigationJump to search

Seek the audio stream to the given offset.

void SeekAudioStream(
    object oPlayer,
    int nStreamIdentifier,
    float fSeconds
);

Parameters

oPlayer
The player to play an audio stream for.
nStreamIdentifier
Which AUDIOSTREAM_IDENTIFIER_* to start. There are 10 available in total.
fSeconds
The amount of seconds to seek to.


Description

Seek the audio stream to the given offset.

When seeking at or beyond the end of a stream, the seek offset will wrap around, even if the file is configured not to loop.

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

Will do nothing if the stream is in ended state (reached end of file and looping is off). In this case, you need to restart the stream.


Remarks

You can skip ahead instantly to a certain point in an audio file, or skip backwards.


Version

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


Example

// Seeks audio track 0 to the 10 second mark
void main()
{
    object oPC = GetFirstPC();

    SeekAudioStream(oPlayer, AUDIOSTREAM_IDENTIFIER_0, 10.0);
}

See Also

functions: 

StartAudioStream StopAudioStream SetAudioStreamPaused SetAudioStreamVolume