src/webaudio.js
/**
     * Plays the loaded audio region.
     *
     * @param {number} start Start offset in seconds, relative to the beginning
     * of a clip.
     * @param {number} end When to stop relative to the beginning of a clip.
     */
Plays the loaded audio region.
@param {number} start Start offset in seconds, relative to the beginning
of a clip.
@param {number} end When to stop relative to the beginning of a clip.
Plays the loaded audio region . @param { number } start Start offset in seconds relative to the beginning of a clip . @param { number } end When to stop relative to the beginning of a clip .
play(start, end) {
        if (!this.buffer) {
            return;
        }
        this.createSource();
        const adjustedTime = this.seekTo(start, end);
        start = adjustedTime.start;
        end = adjustedTime.end;
        this.scheduledPause = end;
        this.source.start(0, start, end - start);
        if (this.ac.state == 'suspended') {
            this.ac.resume && this.ac.resume();
        }
        this.setState(PLAYING);
        this.fireEvent('play');
    }
play ( start , end ) { if ( ! this . buffer ) { return ; } this . createSource ( ) ; const adjustedTime = this . seekTo ( start , end ) ; start = adjustedTime . start ; end = adjustedTime . end ; this . scheduledPause = end ; this . source . start ( 0 , start , end - start ) ; if ( this . ac . state == 'suspended' ) { this . ac . resume && this . ac . resume ( ) ; } this . setState ( PLAYING ) ; this . fireEvent ( 'play' ) ; }
Plays the loaded audio region.
Plays the loaded audio region .
// need to re-create source on each playback