Search Unity

Pooling AudioSources

Discussion in 'General Discussion' started by anwserman, Apr 18, 2013.

  1. anwserman

    anwserman

    Joined:
    Feb 13, 2012
    Posts:
    36
    So I'm concerned about how to go about implementing audio into my app; I'd rather get it done correctly the first time then have to fix something horribly broken later on. So I have these following questions:

    1) AudioClips have a duplicate/instantiate event. Do I have to even worry about pooling AudioClips if they're all assigned to objects at design-time?

    2) Pooling AudioSources. Should all AudioSources in my app be pooled, or should I only pool AudioClips when using PlayOneShot? Basically, should permanent objects get their own assigned AudioSource, while prefabs and other temporary ones use a pooled AudioSource?

    3) PlayOnceAtPoint: if I have a pooled AudioSource, I could make my own version of this by using a pooled object, setting its position, playing it, them disabling it when done. This would be more efficient then the alternative, Static method?

    Thank you!

    EDIT: I will not buy the Audio Toolkit. I already have created my own generic pooling system and I'd like to learn more about Unity behind-the-scenes.
     
    Last edited: Apr 18, 2013