Project

General

Profile

Actions

Bug #858

open

Play Audio sometimes playing the wrong audio in the internal player

Added by Paul Kitching about 3 years ago. Updated about 3 years ago.

Status:
Resolved
Priority:
Normal
Target version:
Start date:
10/30/2021
Due date:
% Done:

0%

Estimated time:
Affected version:

Description

If I use the same audio number to play a different piece of audio using F2 for the internal player, I often get the previous sound playing, and sometimes over the top of the next one.

#splashScreen:False
tunes=3
tunenum=1
dim tune$(3)
tune$(1)="One.mp3"
tune$(2)="Two.mp3"
tune$(3)="Three.mp3"
load asset "tunes\"+tune$(tunenum),50
print str$(tunenum),"tunes\"+tune$(tunenum)
play audio 50:audio loop on 50:volume audio 50,90
do
    if timer>4
        add tunenum,1,1 to tunes
        print tunenum
        stop audio 50
        audio loop off 50
        load asset "tunes\"+tune$(tunenum),50
        print str$(tunenum),"tunes\"+tune$(tunenum)
        play audio 50
        audio loop on 50
        volume audio 50,90
        timer=0
    end if
    wait vbl
loop

When I test this with short samples I usually get a repeated sample, and doing the same in a game using longer tuners I often get the previous tune playing again but it plays the next one at the same time.

This seems to work correctly in a browser.

Actions

Also available in: Atom PDF