Delay in first song playing because of waiting for song list to load .mp3 in previewer as opposed to browser
Ok the issue is because when you load multiple songs in the previewer it has to delay and make sure they are all loaded before any play audio can start.
ie: Say we are loading song assets 8 of them in a row, and prior to this we setup a UI element so we can select our .mp3s to play from a list (which would normally play instantly I click on them (each one) as its already shown on the screen waiting now in a do loop).
If you do this arrangement of code in a full screen browser (see Rays example below attached Modplayer_1.aozip), as soon as you click a song on the gui it plays.
If you do the same code in the previewer it wont start playing as it still trying to load the assets in it I have found.
Note: So it seams with the Play Audio cmd, in the browser it will start playing it seams instantly like its interrupt driven in the background but in the previewer it will not as it knows that the total list has not yet loaded. (Or its loading the songs so fast that its all done in a blink).
I have shown though in my notes that you should always code a little differently and for me this is correct as you should preload or load on the fly at different times when coding depending on your application or game design.
But Our friend ray here feels that it should work in the previewer the same.
My notes on the subject in discord to see..https://discord.com/channels/653893653940404224/1004346085172580402/1042688491856871425
Ive included Rays original .mp3 player so you can see the difference what happens between the full screen browser and the previewer. (His code Modplayer_1.aozip)
Ive also included a modified version so you can see how I get around this issue, but again Ray believes that the same code should work regardless in previewer or browser.
(Im not sure you can see what you think of this or if the preview can also play instantly given rays same code design).
Updated by malcolm harvey about 1 year ago
- Status changed from New to Closed
It seams our friend ray here after looking at what I suggested about what type of things are loading or rather the size of things, (as he has reduced things down from 11mb in size his songs to now about 1.1mb) he gets around the delay in the previewer.
Note: Again though, its a user problem in the way he was doing his code loading and assuming that it should have loaded his songs list
regardless of there size and expecting his gui to play those songs instantly before they loaded or preloaded.
Closed ticket, use problem.