Photon Voice: AudioClip.SetData failed; invalid offsetSamples

I am trying to set a voice chat in my VR multiplayer application and after several tries, I discovered that if I set in the Recorder script the mic type to "Unity" the voice chat works.

Nevertheless I have this error: "AudioClip.SetData failed; invalid offsetSamples" generated with this sample number 44160 (that I found out with a debug log).

the full error is this one and I am not able to understand what generates it and how to avoid it:

ArgumentException: AudioClip.SetData failed; invalid offsetSamples
UnityEngine.AudioClip.SetData (System.Single[] data, System.Int32 offsetSamples) (at <41c3f0db5b294ee7952c69a689436367>:0)
Photon.Voice.Unity.UnityAudioOut.Service () (at Assets/Live.Multiplayer/ThirdParts/Photon/PhotonVoice/PhotonVoiceApi/Platforms/Unity/UnityAudioOut.cs:221)
Photon.Voice.Unity.Speaker+<PlaybackCoroutine>d__43.MoveNext () (at Assets/Live.Multiplayer/ThirdParts/Photon/PhotonVoice/Code/Speaker.cs:412)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <526469d5a48c43eebd9af19f8745afa1>:0)

these are the settings of my recorder and of the other related components:


  • JohnTube
    JohnTube ✭✭✭✭✭

    Hi @s_gurzi,

    Thank you for choosing Photon!

    It looks like you are using an old Photon Voice version.

    Please update to the latest and retry with our demo scenes first then with your own.

    If the issue persists, please let us know how to reproduce.

  • Using Photon Voice 2 Version 2.29 - December 24, 2021

    Have same setting in the components. Still getting the same error-

    "AudioClip.SetData failed; invalid offsetSamples"

    I have build it for desktop and Oculus quest native. On desktop , when window is minimized and then maximized or when clicked out, the error pops up.

    Any suggestions?

  • JohnTube
    JohnTube ✭✭✭✭✭

    Hi @yashmatange,

    Does this happen with the demo scenes?

    How can we reproduce with minimal steps?

    Could you reproduce and send us logs (keep log level to INFO)?


    not sure where 44160 is coming from in your original post.