Skip to content

WebAudio: looping audio using bufferSource.loop doesn't work #41073

@webbedspace

Description

@webbedspace

Describe the bug:
When a WebAudio's bufferSource (as from AudioContext.prototype.createBufferSource()) loop is true, then playback won't work.

To Reproduce:
Minimal test:

<!DOCTYPE html>
<script>
document.documentElement.onclick = async () => {

var file = await fetch(`https://deltarune.com/assets/audio/results.mp3`) // Replace with any MP3
var ctx = new AudioContext()
var node = ctx.createGain()
node.connect(ctx.destination)
var bufferSource = ctx.createBufferSource()
bufferSource.connect(node)
bufferSource.loopStart = 0
bufferSource.loopEnd = 3
bufferSource.loop=true
var b = await file.arrayBuffer(file)
bufferSource.buffer = await ctx.decodeAudioData(b)
bufferSource.start(0, 0, 86400)

}
</script>

When clicking the page, this plays the music on Firefox but not Servo.

Platform:
Windows 10, Servo latest.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions