mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 08:38:00 +00:00
schedules a stopped state if the source is not looped
This commit is contained in:
parent
9987af7a1d
commit
7ff330cb96
1 changed files with 2 additions and 5 deletions
|
@ -182,15 +182,12 @@ define(["Tone/core/Tone", "Tone/core/Buffer", "Tone/source/Source"], function(To
|
|||
this._source.loop = this._loop;
|
||||
this._source.loopStart = this.toSeconds(this._loopStart);
|
||||
this._source.loopEnd = this.toSeconds(this._loopEnd);
|
||||
// this fixes a bug in chrome 42 that breaks looping
|
||||
// https://code.google.com/p/chromium/issues/detail?id=457099
|
||||
duration = 65536;
|
||||
} else {
|
||||
this._nextStop = startTime + duration;
|
||||
//if it's not looping, set the state change at the end of the sample
|
||||
this._state.setStateAtTime(Tone.State.Stopped, startTime + duration);
|
||||
}
|
||||
//and other properties
|
||||
this._source.playbackRate.value = this._playbackRate;
|
||||
this._source.onended = this.onended;
|
||||
this._source.connect(this.output);
|
||||
//start it
|
||||
this._source.start(startTime, offset, duration);
|
||||
|
|
Loading…
Reference in a new issue