diff --git a/packages/channels/CHANGELOG.md b/packages/channels/CHANGELOG.md index e9adaf1..5ab5581 100644 --- a/packages/channels/CHANGELOG.md +++ b/packages/channels/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.0.4] - 2024-10-03 +- Add options to set the startTimeOffset when playing a sound + ## [1.0.3] - 2023-01-13 - Make bufferSourceNode on a PlayingSound public diff --git a/packages/channels/README.md b/packages/channels/README.md index 235b2df..671991e 100644 --- a/packages/channels/README.md +++ b/packages/channels/README.md @@ -149,6 +149,7 @@ channelsInstance.play('sound', { loop: true, fadeInTime: 2, pan: 1, // between -1 and 1 + startTimeOffset: 0, // in seconds effects: { preVolume: myEffectsChain, } diff --git a/packages/channels/src/PlayingSound.ts b/packages/channels/src/PlayingSound.ts index a4592ae..12a7093 100644 --- a/packages/channels/src/PlayingSound.ts +++ b/packages/channels/src/PlayingSound.ts @@ -87,7 +87,7 @@ export class PlayingSound extends HasSignalModifier { * Gets the current progress of the playing sound (between 0 and 1) */ public getProgress = () => { - return (this.getCurrentTime() / this.sound.audioBuffer.duration) % 1; + return this.getCurrentTime() / this.sound.audioBuffer.duration; }; /**