j7
New Member
Posts: 20
Posts: 20
|
Post by j7 on Sept 24, 2020 9:47:48 GMT
Sorry for such a basic question, but if i have a load of music tracks in my project and use MasterAudio to play them (from playlist) does it load each track as needed, or does it load them all into memory first? Im developing for the Oculus Quest - so want to make sure i optimize memory footprint.
Thanks!
|
|
|
Post by DarkTonic Dev on Sept 24, 2020 9:56:28 GMT
If you use Addressables or Resource files, only the currently playing and any scheduled clips will take up memory. Otherwise they all do. If you read the Audio Memory Allocations page if the documentation, it goes over this and a lot more.
-Brian
|
|
j7
New Member
Posts: 20
Posts: 20
|
Post by j7 on Sept 26, 2020 12:17:49 GMT
Great - thanks - will take a look.
|
|
|
Post by DarkTonic Dev on Sept 26, 2020 16:52:10 GMT
Any time.
|
|
j7
New Member
Posts: 20
Posts: 20
|
Post by j7 on Sept 27, 2020 2:06:54 GMT
So i uncheck the box to preload audio data for the music tracks in my project. I think its now not loading them at runtime, and just loading when i click them. However - now there is a 1 second pause of the whole game as it does it - in VR this means the screen update also pauses which doesnt look good.
So then i check the box for 'load in background' which then means the project continues to move, however the timing is now off. Because i need to time items to key beats of the music track, this now doesnt work.
Is there a way to 'load the selected track' and have it in memory ready for when you want to then play. Or is there a way to show when the track is loaded (when loading in background) - which i can get at, and then get my game to wait until its finished before the next thing happens.
Im using the playmaker Master Audio Playlist Start By Name - command. I have tried to Playlist Start by Name, then pause the track straight away, then unpause it. To see if that works... but it still seem to get 'stuck' loading the track when i try and play it.
|
|
|
Post by DarkTonic Dev on Sept 27, 2020 16:52:33 GMT
Music should stream from disc if there's only 1 that you're playing at a time. You'll have none of these problems. Resources and unchecking "Preload Audio Data" will add latency in all cases.
If you do choose to use Resources or uncheck "Preload Audio Data", and use the "Gapless Song Transitions" feature (assuming you have more than 1 song), only that first song will have latency. The rest will be preloaded and scheduled at exactly the end of the other track.
Load In Background is not going to help you.
-Brian
|
|
j7
New Member
Posts: 20
Posts: 20
|
Post by j7 on Sept 28, 2020 6:27:34 GMT
Wow - thanks for the info - just changing theaudio file to 'streaming' worked! So presumably the memory utilization is now low - as its not trying to load loads of music tracks in memory as the scene launches. I dont need to use the Gapless Song Transitions' as im only playing tracks as i need - Great! - thanks again!
|
|
|
Post by DarkTonic Dev on Sept 28, 2020 15:14:43 GMT
Yeah that is correct. Streaming only loads a small portion of the audio into memory at a time.
No problem.
|
|