szevvy
New Member
Posts: 4
Posts: 4
|
Post by szevvy on Jun 10, 2015 0:24:37 GMT
We found an issue where the playlist controller was taking a lot of frame time, every frame. The cause of this was that the next song was being scheduled every frame, even though the currently playing track was looping - so there was no way for another song to play. The fix we made was in PlaylistController.cs, line 279, from if (CanSchedule) { to if (CanSchedule && CurrentPlaylistSource.loop == false) { and this gave us a massive performance boost; MasterAudio was taking up to 7ms every frame on an iPad Air. Thought you might want to make the same fix your side We didn't investigate why CoUpdate() was taking so much time, just found a way to make it not affect us. Thanks! Michael @ halfbrick
|
|
|
Post by DarkTonic Dev on Jun 10, 2015 0:57:59 GMT
Thanks Michael! I've made the fix.
It might take different amounts of time depending on audio clip format. We always use Resource files and wav files - haven't noticed any slowdown at all.
The schedule every frame code is needed for gapless transitions. You can turn off the use of gapless transitions if you don't need them in the Advanced section in the Master audio prefab.
|
|
szevvy
New Member
Posts: 4
Posts: 4
|
Post by szevvy on Jun 10, 2015 1:13:30 GMT
Wonderful, thanks for the quick response! edit: Yeah, it turns out we're using MP3s - hence the cost. Michael @ halfbrick
|
|
|
Post by DarkTonic Dev on Jun 10, 2015 2:06:04 GMT
Yeah mp3's take about 120x as long to start playing compared to wav. I assume it takes much longer to schedule too. Unless they're fairly long, wav's usually take up less memory too, depending on how many songs in your playlist and whether using Resources files or not. Streaming takes tons of memory as well.
|
|