mikewoz
New Member
Posts: 2
Posts: 2
|
Post by mikewoz on Dec 1, 2015 2:30:41 GMT
Hi,
I am trying to use audio groups playing in 'Looped Chain' mode to create a background music track. I have a group for breakbeats (drums) with several audio clips, each of which is a perfect 2-second loop. The goal is to chain them together in random order to create something that doesn't sound like a loop.
However, in 'Endless' loop mode, there is a brief gap between each clip. It's very short, but it's there and ruins the rhythm.
The gap is also not consistent. When I enable 'Log Sounds' and look at the timestamps, there is a lot of jitter. Eg, here are some differences between successive timestamps:
2.043964 2.0559 2.03982 2.05998
... they should all be *exactly* 2 seconds. I'm not sure if this is jitter in the logging, or the actual play time, but I can hear variations in the gap.
Maybe it's something to do with my settings? - I'm using Unity 5.2.2f1 - I have 'Gapless Music Switching' enabled (in the Advanced Settings of the main MasterAudio manager). - My audio files are 48kHz .wav files with 'Preload Audio Data' checked. - I've tried 'Decompress On Load' and 'Compressed In Memory', and I've tried both PCM and Vorbis for compression. - If I preview the audio file with the standard Unity asset preview, the looping sounds okay (no gaps). - This happens even if I remove all but one audio clip from the group. - Happens for both 'Variation Sequence' modes: 'Top To Bottom' and 'Randomized'
Anyone have ideas for how to fix this?
Thanks, Mike
|
|
|
Post by DarkTonic Dev on Dec 1, 2015 3:02:16 GMT
Firstly, The Gapless music switching checkbox only does so for Playlists, not Sound Groups, as the documentation states. Hence the word "music". Sound Groups are meant for sound effects only normally.
I don't think you're going to get a gapless use of this unless both:
1) Your frame rate is perfect
AND
2) The end of a frame happens exactly when a clip ends (which will pretty much never happen). Since the code checks for end of clip during each frame, that's the source of the problem and the reason why you're seeing 2.04, 2.03 et al.
You may wish to try a Playlist and Playlist Controller instead for this. Hopefully you'll get better results.
|
|