[EOS] Delay when playing audio, is preloading the files the only fix?

Post all technical issues and questions here. We'll gladly help you wherever we can.
Post Reply
Nice-Log
Explorer
Explorer
Posts: 33
Joined: Thu Dec 01, 2022 8:37 pm

[EOS] Delay when playing audio, is preloading the files the only fix?

Post by Nice-Log »

Hello All:

In my teases, I found that after using the "Audio: Play" command, there is maybe a second or two delay before the audio starts when playing the tease. I was previously chalking it up to maybe power saving on my device needing a second to power on my headphones, but no that doesn't seem to be it, though maybe it contributes to the delay.

The only way I've found to avoid this is by first using the "Audio: Play" command, then immediately stopping playback with the "Sound.get().stop()" command at the beginning of the page, and then starting it again with "Sound.get().play()", presumably after "Sound.get().seek(0)" if the same file was played before on the page to restart it.

Is there another way to handle this? I liked giving each "Audio: Play" command the same identifier so I can just copy and paste the same eval code to stop audio playback, but that doesn't work as above because each file needs a unique identifier.

Thanks for any help in this manner,
Nice-Log
User avatar
Batman314
Explorer
Explorer
Posts: 76
Joined: Thu Sep 12, 2013 2:59 pm

Re: [EOS] Delay when playing audio, is preloading the files the only fix?

Post by Batman314 »

Try converting to lower bitrate MP3s. 96 Mbps is a good starting point, but you could potentially go lower depending on what the audio is/if you notice it degrading. Vlc media player is easy and free for batch conversions of almost any filetype.
Nice-Log
Explorer
Explorer
Posts: 33
Joined: Thu Dec 01, 2022 8:37 pm

Re: [EOS] Delay when playing audio, is preloading the files the only fix?

Post by Nice-Log »

Batman314 wrote: Fri Dec 08, 2023 2:11 am Try converting to lower bitrate MP3s. 96 Mbps is a good starting point, but you could potentially go lower depending on what the audio is/if you notice it degrading. Vlc media player is easy and free for batch conversions of almost any filetype.
Sure, decreasing the bitrate to lower the filesizes was the first thing I tried. Brought it down to 16Kbps which sounded atrocious but didn't change the delay. Neither did cutting my metronome files down in length by ~60%.
Thamrill
Explorer At Heart
Explorer At Heart
Posts: 265
Joined: Thu Jan 03, 2013 4:55 pm
Gender: Male
Sexual Orientation: Straight
I am a: Submissive

Re: [EOS] Delay when playing audio, is preloading the files the only fix?

Post by Thamrill »

Nice-Log wrote: Thu Dec 07, 2023 5:55 pm Hello All:

In my teases, I found that after using the "Audio: Play" command, there is maybe a second or two delay before the audio starts when playing the tease. I was previously chalking it up to maybe power saving on my device needing a second to power on my headphones, but no that doesn't seem to be it, though maybe it contributes to the delay.

The only way I've found to avoid this is by first using the "Audio: Play" command, then immediately stopping playback with the "Sound.get().stop()" command at the beginning of the page, and then starting it again with "Sound.get().play()", presumably after "Sound.get().seek(0)" if the same file was played before on the page to restart it.

Is there another way to handle this? I liked giving each "Audio: Play" command the same identifier so I can just copy and paste the same eval code to stop audio playback, but that doesn't work as above because each file needs a unique identifier.

Thanks for any help in this manner,
Nice-Log
One thing I saw in the past (I can't remember which author did it) was someone loading all audio (and maybe image) at the start of the tease, stopping all the audio files, giving each one an id (for image I guess it was to cache them). In contrast, other authors load them on the go, and there is no real issue.

I never dig too much into it, but is it possible that a slow connection may cause a delay in loading the file? Maybe you're also changing a picture just before the audio play action and maybe it also affects the loading time of the audio? Are you using an audio file that maybe is tto long and could be cut to reduce load time?
Image

Image

Image
Nice-Log
Explorer
Explorer
Posts: 33
Joined: Thu Dec 01, 2022 8:37 pm

Re: [EOS] Delay when playing audio, is preloading the files the only fix?

Post by Nice-Log »

Thamrill wrote: Sat Dec 09, 2023 6:34 am One thing I saw in the past (I can't remember which author did it) was someone loading all audio (and maybe image) at the start of the tease, stopping all the audio files, giving each one an id (for image I guess it was to cache them). In contrast, other authors load them on the go, and there is no real issue.

I never dig too much into it, but is it possible that a slow connection may cause a delay in loading the file? Maybe you're also changing a picture just before the audio play action and maybe it also affects the loading time of the audio? Are you using an audio file that maybe is tto long and could be cut to reduce load time?
Yep, I've been converting my work-in-progress tease to load all the audio files at the beginning of each section as you mentioned. I found that to be more effort than just running the audio commands as needed. As for cutting down the length, my metronome files are about 5 minutes, and I tried cutting them down to about 2 minutes with no change. Going shorter than that means I have to worry about the file ending before I expect it, so it's not a good solution for me.
Thamrill
Explorer At Heart
Explorer At Heart
Posts: 265
Joined: Thu Jan 03, 2013 4:55 pm
Gender: Male
Sexual Orientation: Straight
I am a: Submissive

Re: [EOS] Delay when playing audio, is preloading the files the only fix?

Post by Thamrill »

Nice-Log wrote: Wed Dec 13, 2023 3:54 pm
Thamrill wrote: Sat Dec 09, 2023 6:34 am One thing I saw in the past (I can't remember which author did it) was someone loading all audio (and maybe image) at the start of the tease, stopping all the audio files, giving each one an id (for image I guess it was to cache them). In contrast, other authors load them on the go, and there is no real issue.

I never dig too much into it, but is it possible that a slow connection may cause a delay in loading the file? Maybe you're also changing a picture just before the audio play action and maybe it also affects the loading time of the audio? Are you using an audio file that maybe is tto long and could be cut to reduce load time?
Yep, I've been converting my work-in-progress tease to load all the audio files at the beginning of each section as you mentioned. I found that to be more effort than just running the audio commands as needed. As for cutting down the length, my metronome files are about 5 minutes, and I tried cutting them down to about 2 minutes with no change. Going shorter than that means I have to worry about the file ending before I expect it, so it's not a good solution for me.
Have you tried using a different browser? Maybe it's just a limitation on the browser side.
Are your metronome complex or constant? because you might cut them by using a short file played in loop
Image

Image

Image
Post Reply

Who is online

Users browsing this forum: No registered users and 55 guests