mirror of
https://github.com/bloeys/wavy.git
synced 2025-12-29 09:28:19 +00:00
Docs + SeekToTime comment
This commit is contained in:
6
wavy.go
6
wavy.go
@ -240,6 +240,12 @@ func (s *Sound) SeekToPercent(percent float64) {
|
||||
s.Data.Seek(int64(float64(s.Info.Size)*percent), io.SeekStart)
|
||||
}
|
||||
|
||||
//SeekToTime moves the current position of the sound to the given duration.
|
||||
//For example if you use t=5*time.Second then play you will start from 5th second.
|
||||
//
|
||||
//This can be used while the sound is playing.
|
||||
//
|
||||
//t is clamped between [0, totalTime]
|
||||
func (s *Sound) SeekToTime(t time.Duration) {
|
||||
|
||||
if !s.IsPlaying() {
|
||||
|
||||
Reference in New Issue
Block a user