public static int opus_encoder_ctl(IntPtr st, Ctl request, out int value) { if (Platform == 1) { return(OpusAPI_Linux.opus_encoder_ctl(st, request, out value)); } return(OpusAPI_Windows.opus_encoder_ctl(st, request, out value)); }
public static int opus_decode(IntPtr st, IntPtr data, int len, IntPtr pcm, int frame_size, int decode_fec) { if (Platform == 1) { return(OpusAPI_Linux.opus_decode(st, data, len, pcm, frame_size, decode_fec)); } return(OpusAPI_Windows.opus_decode(st, data, len, pcm, frame_size, decode_fec)); }
public static IntPtr opus_decoder_create(int Fs, int channels, out IntPtr error) { if (Platform == 1) { return(OpusAPI_Linux.opus_decoder_create(Fs, channels, out error)); } return(OpusAPI_Windows.opus_decoder_create(Fs, channels, out error)); }
public static int opus_encode(IntPtr st, IntPtr pcm, int frame_size, IntPtr data, int max_data_bytes) { if (Platform == 1) { return(OpusAPI_Linux.opus_encode(st, pcm, frame_size, data, max_data_bytes)); } return(OpusAPI_Windows.opus_encode(st, pcm, frame_size, data, max_data_bytes)); }
public static void opus_decoder_destroy(IntPtr decoder) { if (Platform == 1) { OpusAPI_Linux.opus_decoder_destroy(decoder); } else { OpusAPI_Windows.opus_decoder_destroy(decoder); } }
static OpusAPI() { try { IntPtr error; IntPtr temp = OpusAPI_Windows.opus_encoder_create(8000, 1, (int)Application.Voip, out error); if ((Errors)error != Errors.OK) { throw new Exception("Exception occured while creating encoder"); } OpusAPI_Windows.opus_encoder_destroy(temp); } catch (Exception) { Platform = 1; } }