Photon Voice on c# .net framework

Did anyone had experience consuming Photon Voice in a .net framework application written in c#? I mean out of Unity?

Is that feasible. Any suggestion from anyone already into it?

Regards.

Best Answer

  • vadim
    vadim mod
    edited May 31 Answer ✓

    Yes, it's possible. You can use voice Photon Voice Core API without Unity. Note that audio i/o is outside the scope of this API and should be interfaced via IAudioReader<T> or IAudioPusher<T> for input and IAudioOut<T> or AudioOutDelayControl<T> for output. Normally, we rely on i/o provided by a platform like Unity's Microphone and AudioOut. For convenience, we also provide native microphone capture modules which can be used in C# projects. But for output, 3rd party support or custom module is always required. (Though we have i/o FMOD wrapper with dependency to C# FMOD only but I'm not sure if it can be used outside of Unity).

    Import Assets/Photon/PhotonVoice/PhotonVoiceApi folder without Platforms in your project. If you want to use Voice's mic capture modules, import also Platforms/UWP or Platforms/Windows.

    Depending on the platform and whether you use Voice mic capture, you may need some or all files form Assets/Photon/PhotonVoice/PhotonVoiceLibs/x86_64 and WSA folders. opus_egpv.dll is an audio compression lib essential for Voice. Other libraries are native mic capture implementations (wrapped by cs files from Platforms folder).

    You need to create LoadBalancingTransport2 instance and use it to join room as normal Realtime client. To stream out, it's necessary to create "local voice" with lbc.VoiceClient.CreateLocalVoiceAudioFromSource() which requires an audio input module. To process input audio streams (remote voices), you need to implement client.VoiceClient.OnRemoteVoiceInfoAction callback and provide an audio out module in it.

    For a sample Voice workflow implementation, see Unity Voice Assets\Photon\PhotonVoice\Code\VoiceConnection.cs, Recorder.cs, RemoteVoiceLink.cs, Speaker.cs. You do not need most of the code in this modules, e.g. "linking" is relevant to Unity integration only. Unfortunately we don't have a pure Photon Voice Core API sample at the moment.

Answers

  • vadim
    vadim mod
    edited May 31 Answer ✓

    Yes, it's possible. You can use voice Photon Voice Core API without Unity. Note that audio i/o is outside the scope of this API and should be interfaced via IAudioReader<T> or IAudioPusher<T> for input and IAudioOut<T> or AudioOutDelayControl<T> for output. Normally, we rely on i/o provided by a platform like Unity's Microphone and AudioOut. For convenience, we also provide native microphone capture modules which can be used in C# projects. But for output, 3rd party support or custom module is always required. (Though we have i/o FMOD wrapper with dependency to C# FMOD only but I'm not sure if it can be used outside of Unity).

    Import Assets/Photon/PhotonVoice/PhotonVoiceApi folder without Platforms in your project. If you want to use Voice's mic capture modules, import also Platforms/UWP or Platforms/Windows.

    Depending on the platform and whether you use Voice mic capture, you may need some or all files form Assets/Photon/PhotonVoice/PhotonVoiceLibs/x86_64 and WSA folders. opus_egpv.dll is an audio compression lib essential for Voice. Other libraries are native mic capture implementations (wrapped by cs files from Platforms folder).

    You need to create LoadBalancingTransport2 instance and use it to join room as normal Realtime client. To stream out, it's necessary to create "local voice" with lbc.VoiceClient.CreateLocalVoiceAudioFromSource() which requires an audio input module. To process input audio streams (remote voices), you need to implement client.VoiceClient.OnRemoteVoiceInfoAction callback and provide an audio out module in it.

    For a sample Voice workflow implementation, see Unity Voice Assets\Photon\PhotonVoice\Code\VoiceConnection.cs, Recorder.cs, RemoteVoiceLink.cs, Speaker.cs. You do not need most of the code in this modules, e.g. "linking" is relevant to Unity integration only. Unfortunately we don't have a pure Photon Voice Core API sample at the moment.