public static DiscordClient UsingAudio(this DiscordClient client, Action<AudioServiceConfig> configFunc = null) { var config = new AudioServiceConfig(); configFunc(config); client.Services.Add(new AudioService(config)); return client; }
internal VoiceSocket(DiscordConfig config, AudioServiceConfig audioConfig, JsonSerializer serializer, Logger logger) : base(config, serializer, logger) { _audioConfig = audioConfig; _decoders = new ConcurrentDictionary<uint, OpusDecoder>(); _targetAudioBufferLength = _audioConfig.BufferLength / 20; //20 ms frames _encodingBuffer = new byte[MaxOpusSize]; _ssrcMapping = new ConcurrentDictionary<uint, ulong>(); _encoder = new OpusEncoder(48000, _audioConfig.Channels, 20, _audioConfig.Bitrate, OpusApplication.MusicOrMixed); _sendBuffer = new VoiceBuffer((int)Math.Ceiling(_audioConfig.BufferLength / (double)_encoder.FrameLength), _encoder.FrameSize); }
internal VoiceWebSocket(DiscordClient client, AudioClient audioClient, Logger logger) : base(client, logger) { _audioClient = audioClient; _config = client.Audio().Config; _decoders = new ConcurrentDictionary<uint, OpusDecoder>(); _targetAudioBufferLength = _config.BufferLength / 20; //20 ms frames _encodingBuffer = new byte[MaxOpusSize]; _ssrcMapping = new ConcurrentDictionary<uint, ulong>(); _encoder = new OpusEncoder(48000, _config.Channels, 20, _config.Bitrate, OpusApplication.MusicOrMixed); _sendBuffer = new VoiceBuffer((int)Math.Ceiling(_config.BufferLength / (double)_encoder.FrameLength), _encoder.FrameSize); }
public static DiscordClient UsingAudio(this DiscordClient client, AudioServiceConfig config = null) { client.Services.Add(new AudioService(config)); return client; }
public static DiscordClient UsingAudio(this DiscordClient client, AudioServiceConfig config = null) { client.AddService(new AudioService(config)); return(client); }
public AudioService(AudioServiceConfig config) { Config = config; _asyncLock = new AsyncLock(); }
public AudioService(AudioServiceConfig config) { Config = config; }