Skip to content

Implement WebAudio methods for timing#22

Open
squarebananas wants to merge 4 commits intonkast:mainfrom
squarebananas:AudioTiming
Open

Implement WebAudio methods for timing#22
squarebananas wants to merge 4 commits intonkast:mainfrom
squarebananas:AudioTiming

Conversation

@squarebananas
Copy link
Copy Markdown
Contributor

Adds BaseAudioContext.CurrentTime, AudioBufferSourceNode.Start and AudioBuffer.Duration.

As WebAudio doesn't provide pause/resume at a per sound effect level, these additions are required for implementing pause/resume features. The playback position can be tracked by accumulating the change in BaseAudioContext.CurrentTime, resetting for looped sounds after AudioBuffer.Duration is reached. The playback position can then be used to resume with AudioBufferSourceNode.Start by playing a new sound instance with the start position offset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant