PunVoice Optimization

It seems that PUNVOIP is costing about 1-2 MS per frame on my cpu a i5-6700K.

I tracked it down to this line of code on the profiler.

Microphone.GetPosition()

It seems that this is a built-in Unity function for listening to Microphones. I'm not sure if the problem is Unity Side or Pun side for the expense or if this is just how expensive it is to listen to Microphone input. I'd like to reduce the expense here to less than .1MS if possible.

Any idea on how to optimize this? Is there a way I can take this input only when someone is actually talking?

Thanks!

Comments

  • Currently, it's the single most expensive piece of CPU side code I have so I'd really like to optimize this if possible.
  • Nevermind... I found the optimization settings on the Photon Voice Settings script. Seems really easy to optimize it there. Leaving this here in case other people are having trouble and search for a way to optimize.
  • To be clear. Lowering the sample rate is the easiest way to increase performance. Putting it 12000 as opposed to 24000. Dropped the MS cost from 1.5MS to .1MS. I'm sure this will hit quality as well. Testing it now to see how well it works.