示例#1
0
 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);
     }
 }
示例#2
0
 /// <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())
 {
 }