public AudioManager(DCSPlayerRadioInfo playerRadioInfo) { PlayerRadioInfo = playerRadioInfo; LogClientId = PlayerRadioInfo.radios[0].name; Client = new Network.Client(this, playerRadioInfo); BotAudioProvider = new BotAudioProvider(Client.DcsPlayerRadioInfo.radios[0], ResponseQueue) { SpeechRecognitionListener = { VoiceHandler = Client.SrsAudioClient, SrsClient = Client } }; }
public void StartEncoding() { BotAudioProvider = new BotAudioProvider(Client.DcsPlayerRadioInfo.radios[0], ResponseQueue) { SpeechRecognitionListener = { VoiceHandler = Client.SrsAudioClient, SrsClient = Client } }; StartResponseCheckLoop(); try { //opus _encoder = OpusEncoder.Create(InputSampleRate, 1, Application.Voip); _encoder.ForwardErrorCorrection = false; _decoder = OpusDecoder.Create(InputSampleRate, 1); _decoder.ForwardErrorCorrection = false; } catch (Exception ex) { Logger.Error(ex, $"{LogClientId}| Error starting audio Output - Quitting! " + ex.Message); Environment.Exit(1); } }