Loading a large amount of audio data

Discussion and feedback on Construct 2

Post » Sun Apr 17, 2016 1:23 pm

Hi everyone,

I could really use some advice :)

I need to load (and play) a large amount of audio data, for an app that relies heavily on audio tracks.

The project contains almost 1 hour of audio data and tracks range from 1 - 3 minutes. I know this much audio data seems like a lot, but it's for a health advice app, so the audio is a really vital part of the app.

I have tried loading the audio from the music folder, but there is always quite a noticeable lag between starting the track, and actually hearing it play (sometimes as much as 10-12 seconds).

I've also tried loading it from the sound folder, but the tracks are so large that they take forever to load. And, audio from the sound folder can't play until it's completely loaded.

Does anyone have any useful tips or suggestions on how we can achieve our goal.

Thanks for any advice you can offer :)
B
18
S
4
G
2
Posts: 77
Reputation: 1,588

Post » Sun Apr 17, 2016 1:44 pm

Are your audio files as small as possible - like instead of stereo mono, smallest bitrate, ...

Can you guess which audio file could be played next?

  • System > On start of layout | system > load game from slot "brain"
  • System > On load failed | system > scroll to obj_Forum
B
17
S
8
G
5
Posts: 340
Reputation: 4,707

Post » Sun Apr 17, 2016 2:41 pm

Hi @fm4fanAT,

Thanks for your reply.

I'm using a sample rate of 44.1khz (required for C2 audio, I believe) with a bit depth of 16 bits. I've also reduced the size by setting the tracks to mono, rather than stereo. So I think they're as optimized as they can be, but it's still a lot of audio data.

Each track is linked to a separate page, and each page discusses a particular health issue. So I can tell when each track will be required.

I have tried loading each track a few pages before it was required. But with audio lag ranging anywhere from 6-12 seconds, this approach seemed to cause a few problems. Firstly, this approach still can't load the first track we require fast enough (so it's not ready when the first page loads). However, I had considered adding a controlled loader layout to overcome this problem.

Secondly I've tested on several mobile devices and each one handles the lag slightly differently (e.g. some devices play a track after 6-7 seconds and others take 10-12 seconds before the track is ready). This makes guessing when we should begin to load a track, quite difficult.

Thirdly, with so many tracks being loaded simultaneously (e.g. track 1 still buffering when I start to load track 2 for the next page etc.) some lower end devices just seem to give up all together, and crash the app.

It wouldn't be a problem if the C2 audio plugin could stream audio immediately (on mobile). But this lag issue is really throwing a spanner into the works.

Thanks again for the reply, if you have any useful ideas, I'm all ears :)
B
18
S
4
G
2
Posts: 77
Reputation: 1,588

Post » Mon Apr 18, 2016 12:01 am

This is a problem I've had as well, and preloading the audio a screen or two before you want it is the way to go. Perhaps make a loading screen like you said, and make your own .ogg files in a program like Audacity so you can crank the bitrate way down? OGG format has very good compression and you can push it quite far before it sounds really bad.
Image



Coming soon on Steam!
B
16
S
9
G
3
Posts: 204
Reputation: 3,466

Post » Wed Apr 20, 2016 6:17 pm

Thanks for the advice @mikehive, I'll give it a try.

I'm also looking at other audio plugins, to see if any of them can deliver better/faster results. :)
B
18
S
4
G
2
Posts: 77
Reputation: 1,588


Return to Construct 2 General

Who is online

Users browsing this forum: tarek2 and 28 guests