Example #1
0
    public static Voice.LocalVoice CreateLocalVoiceShort(Voice.VoiceInfo voiceInfo, Voice.IBufferReader <float> reader)
    {
        var localVoice = instance.client.VoiceClient.CreateLocalVoiceAudio <short>(voiceInfo);

        localVoice.LocalUserServiceable = new BufferReaderPushAdapterAsyncPoolFloatToShort(localVoice, reader);
        return(localVoice);
    }
Example #2
0
    /// <summary>
    /// Creates new local voice (outgoing audio stream).
    /// </summary>
    /// <param name="voiceInfo">Outgoing audio stream parameters (should be set according to Opus encoder restrictions).</param>
    /// <param name="serviceableFactory">Optional factory called after LovalVoice<T> initialized to create ILocalVoiceServiceable instance attached to the LocalVoice"/>.</param>
    /// <returns>Outgoing stream handler.</returns>
    /// <remarks>
    /// audioStream.SamplingRate and voiceInfo.SamplingRate may do not match. Automatic resampling will occur in this case.
    /// </remarks>
    public static Voice.LocalVoiceAudioFloat CreateLocalVoice(Voice.VoiceInfo voiceInfo, Voice.IBufferReader <float> reader)
    {
        var localVoice = (Voice.LocalVoiceAudioFloat)instance.client.VoiceClient.CreateLocalVoiceAudio <float>(voiceInfo);

        localVoice.LocalUserServiceable = new Voice.BufferReaderPushAdapterAsyncPool <float>(localVoice, reader);
        return(localVoice);
    }
 protected virtual Voice.LocalVoice createLocalVoice(Voice.VoiceInfo voiceInfo, Voice.IBufferReader <float> reader)
 {
     return(PhotonVoiceNetwork.CreateLocalVoice(voiceInfo, reader));
 }
Example #4
0
 protected override Voice.LocalVoice createLocalVoice(Voice.VoiceInfo voiceInfo, Voice.IBufferReader <float> reader)
 {
     return(PhotonVoiceNetwork.CreateLocalVoiceShort(voiceInfo, reader));
 }
Example #5
0
 public BufferReaderPushAdapterAsyncPoolFloatToShort(Voice.LocalVoice localVoice, Voice.IBufferReader <float> reader) : base(reader)
 {
     buffer = new float[((Voice.LocalVoiceFramed <short>)localVoice).FrameSize];
 }