Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

correctly playing back audio for voice chat

Discussion in 'Scripting' started by robochase, Jul 21, 2017.

  1. robochase

    robochase

    Joined:
    Mar 1, 2014
    Posts:
    242
    i've got voice chat data coming through & decompressing correctly via steamworks, but i'm having a little trouble figuring out how to correctly play back the audio in Unity.

    In a nutshell, i have a looping AudioClip continously playing, and I'm pasting voice chat snapshots of data that's come over the network into its buffer in what i think is the correct place.

    i can hear voice chats, so I know it kind of works, but there's bugs - there's lots of small silent gaps in the audio, and sometimes you can hear old audio from the previous loops if sections of the buffer were not overwritten with silence.

    my process feels kind of insane to me, and perhaps harder than it should be. maybe i'm overthinking this?

    Does anyone have any insights here?
     
  2. guillermoi

    guillermoi

    Joined:
    Sep 20, 2012
    Posts:
    27
  3. robochase

    robochase

    Joined:
    Mar 1, 2014
    Posts:
    242
    Hey thanks, i switched to this approach and it's working quite a bit better now.

    there's still a few hiccups in playback - it might either be network stuff, or just when my audio clip loops.