public static IEncoder Create(VoiceInfo i, LocalVoice localVoice) { if (localVoice.GetType() == typeof(LocalVoiceAudioFloat)) { return(new EncoderFloat(i)); } else if (localVoice.GetType() == typeof(LocalVoiceAudioShort)) { return(new EncoderShort(i)); } else { throw new UnsupportedCodecException(i.Codec, localVoice); } }
/// <summary>Create a new UnsupportedCodecException.</summary> /// <param name="codec">The codec actually encountered.</param> /// <param name="voice">The LocalVoice (outgoing stream) involved.</param> public UnsupportedCodecException(Codec codec, LocalVoice voice) : base("[PV] unsupported codec: " + codec + " at voice " + voice.GetType()) { }