Opus Encoder Error : Channel must be stereo or mono
Im getting an error when trying to initialize the Opus encoder class in Unity3d 5.6 beta versions. The code works flawlessly on 5.5 and 5.4. I have tried b7-b9 and none of them work. Here are the error details.
ArgumentOutOfRangeException: Must be Mono or Stereo Parameter name: numChannels POpusCodec.OpusEncoder..ctor (SamplingRate inputSamplingRateHz, Channels numChannels, Int32 bitrate, OpusApplicationType applicationType, Delay encoderDelay) (at Assets/Plugins/PhotonVoiceApi/Core/POpusCodec/OpusEncoder.cs:208) ExitGames.Client.Photon.Voice.LocalVoice..ctor (ExitGames.Client.Photon.Voice.VoiceClient voiceClient, Byte id, IAudioStreamBase audioStream, ExitGames.Client.Photon.Voice.VoiceInfo voiceInfo, Int32 channelId) (at Assets/Plugins/PhotonVoiceApi/Core/VoiceClient.cs:217) ExitGames.Client.Photon.Voice.LocalVoice`1[System.Single]..ctor (ExitGames.Client.Photon.Voice.VoiceClient voiceClient, Byte id, IAudioStream`1 audioStream, ExitGames.Client.Photon.Voice.VoiceInfo voiceInfo, Int32 channelId) (at Assets/Plugins/PhotonVoiceApi/Core/VoiceClient.cs:317) ExitGames.Client.Photon.Voice.LocalVoiceFloat..ctor (ExitGames.Client.Photon.Voice.VoiceClient voiceClient, Byte id, IAudioStream`1 audioStream, ExitGames.Client.Photon.Voice.VoiceInfo voiceInfo, Int32 channelId) (at Assets/Plugins/PhotonVoiceApi/Core/VoiceClient.cs:385) ExitGames.Client.Photon.Voice.VoiceClient.CreateLocalVoice (IAudioStreamBase audioStream, ExitGames.Client.Photon.Voice.VoiceInfo voiceInfo, Int32 channelId) (at Assets/Plugins/PhotonVoiceApi/Core/VoiceClient.cs:727) ExitGames.Client.Photon.Voice.LoadBalancingFrontend.CreateLocalVoice (IAudioStreamBase audioStream, ExitGames.Client.Photon.Voice.VoiceInfo voiceInfo) (at Assets/Plugins/PhotonVoiceApi/LoadBalancingFrontend.cs:152) PhotonVoiceNetwork.CreateLocalVoice (IAudioStreamFloat audioClip, ExitGames.Client.Photon.Voice.VoiceInfo voiceInfo) (at Assets/PUNVoice/Scripts/PhotonVoiceNetwork.cs:215) PhotonVoiceRecorder.Start () (at Assets/PUNVoice/Scripts/PhotonVoiceRecorder.cs:144)
Im quite sure this is a unity3d beta bug. But I really need a solution right now. How to fix this Please help.
Your answer
![](https://koobas.hobune.stream/wayback/20220612112358im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Enable C# 7.0 in Unity 2018.2.0b2 0 Answers
Getting an error: Assertion failed on expression: 'SUCCEEDED(hr)' 5 Answers
Update to Unity 2021 Beta = huge performance hit 0 Answers
Unity 2017 crashing often 2 Answers