Sound.setPosition
From Spheriki
If the sound is seekable, this sets the position the playing sound is at (in samples, not milliseconds).
Contents |
Usage
- time The amount of time (in samples) to start the music at.
Examples
var sound = LoadSound("somefile.mp3");
sound.play(true);
sound.setPosition(10000);
//The sound should have started playing from a later point than usual.
Notes
- The sound needs to be seekable before you can use this function. You can check whether a sound file is seekable by using Sound.isSeekable().
- OGG and MP3 files usually are seekable, modules (.IT, .MOD, .XM etc) and MIDI files are never seekable.
- Sound position is given in samples; that is, if the sound's frequency is 44100 Hz, you need to pass 88200 to start at 2 seconds.