Server LuaCsForBarotrauma
VoipConfig.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using Concentus.Structs;
5 
6 namespace Barotrauma.Networking
7 {
8  static partial class VoipConfig
9  {
10  public const int MAX_COMPRESSED_SIZE = 40; //amount of bytes we expect each 20ms of audio to fit in
11 
12  public static readonly TimeSpan SEND_INTERVAL = new TimeSpan(0,0,0,0,20);
13 
14  public const int FREQUENCY = 48000; //48Khz
15  public const int BITRATE = 16000; //16Kbps
16  public const int BUFFER_SIZE = (8 * MAX_COMPRESSED_SIZE * FREQUENCY) / BITRATE; //20ms window
17 
18  public static OpusDecoder CreateDecoder()
19  {
20  return new OpusDecoder(FREQUENCY, 1);
21  }
22  }
23 }