Photon Voice Error

in Photon Voice
Hi again, we have got Photon Voice working, however when we are playing multiplayer, and the remote player attemps to make a sound other than voice, such as a gun shot, the sound glitches and we get this error. Once we uncheck Photon Voice speaker on the remote player, the error does not occur. Any ideas?
/Users/builduser/buildslave/unity/build/Runtime/Audio/sound/SoundChannel.cpp(367) : Error executing result (An invalid seek position was passed to this function. )
UnityEngine.AudioSource:set_timeSamples(Int32)
PhotonVoiceSpeaker:set_playSamplePos(Int32) (at Assets/PUNVoice/Scripts/PhotonVoiceSpeaker.cs:28)
PhotonVoiceSpeaker:Update() (at Assets/PUNVoice/Scripts/PhotonVoiceSpeaker.cs:157)
/Users/builduser/buildslave/unity/build/Runtime/Audio/sound/SoundChannel.cpp(367) : Error executing result (An invalid seek position was passed to this function. )
UnityEngine.AudioSource:set_timeSamples(Int32)
PhotonVoiceSpeaker:set_playSamplePos(Int32) (at Assets/PUNVoice/Scripts/PhotonVoiceSpeaker.cs:28)
PhotonVoiceSpeaker:Update() (at Assets/PUNVoice/Scripts/PhotonVoiceSpeaker.cs:157)
0
Comments
I'm glad you managed to make Photon Voice work !
Are you saying that in Photon Voice's Push-To-Talk demo, if no button is pressed then all audio clips are paused or stopped locally? So if you press any of the PTT buttons, sounds (other audio clips attached to any GameObject other than the one to which
PhotonVoiceRecorder
andPhotonVoiceSpeaker
are attached to) are working/playing locally but once button is up again all those sounds stop or pause locally?We will update the documentation to prevent such issues for other developers in the future.
Thank you for your report!
We are having another problem, when using Photon Voice, it seems that on iOS it makes it so that the sound for the game, plays out of the speaker used for phone calls instead of the proper speakers.
There is a fix listed here https://github.com/cbaltzer/UnitySpeakerFix
But how would we go about fixing this in PhotonVoice?
Thanks!
For the first case, you can do so in first Update() call of one of the components of PhotonVoiceRecorder object.
As a quick and simple solution, you can find Microphone.Start in PhotonVoice sources and add iPhoneSpeaker.ForceToSpeaker() there.
Is there an alternate way to make it play by default through the proper speakers? Is this not a common problem that many people face with Photon Voice?
Thanks, I hope we can find a solution.
My audio works when I don't have headphones, but as soon as I plug them in, I can hear the audio for a few ms and then stops. I still hear photon voice audio, but not the other audio.
In the console I'm getting the following error:
Maybe you can also share the current state of the projects you are working on and - especially - the issues you are currently facing when using Photon Voice.