/// <summary> /// Used to lazily initialize the decoder to make sure we're /// using the correct output format, this way we don't end up /// creating more decoders than we need. /// </summary> /// <param name="outputFormat"></param> // Token: 0x06000173 RID: 371 RVA: 0x00004C0D File Offset: 0x00002E0D internal void Initialize(AudioFormat outputFormat) { if (this.Decoder != IntPtr.Zero) { Interop.OpusDestroyDecoder(this.Decoder); } this.AudioFormat = outputFormat; this.Decoder = Interop.OpusCreateDecoder(outputFormat); }
public OpusDecoder CreateDecoder() { lock (this.ManagedDecoders) { var decoder = Interop.OpusCreateDecoder(this.AudioFormat); var managedDecoder = new OpusDecoder(decoder, this); this.ManagedDecoders.Add(managedDecoder); return(managedDecoder); } }