Isolated API definitions to their own library
This commit is contained in:
@@ -7,7 +7,6 @@ using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -180,10 +179,9 @@ namespace Discord.Audio
|
||||
{
|
||||
return new RTPWriteStream(this, _secretKey, samplesPerFrame, _ssrc, bufferSize = 4000);
|
||||
}
|
||||
public Stream CreatePCMStream(int samplesPerFrame, int? bitrate = null,
|
||||
OpusApplication application = OpusApplication.MusicOrMixed, int bufferSize = 4000)
|
||||
public Stream CreatePCMStream(int samplesPerFrame, int? bitrate = null, int bufferSize = 4000)
|
||||
{
|
||||
return new OpusEncodeStream(this, _secretKey, samplesPerFrame, _ssrc, bitrate, application, bufferSize);
|
||||
return new OpusEncodeStream(this, _secretKey, samplesPerFrame, _ssrc, bitrate, bufferSize);
|
||||
}
|
||||
|
||||
private async Task ProcessMessageAsync(VoiceOpCode opCode, object payload)
|
||||
|
||||
9
src/Discord.Net.WebSocket/Audio/Opus/OpusApplication.cs
Normal file
9
src/Discord.Net.WebSocket/Audio/Opus/OpusApplication.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Discord.Audio
|
||||
{
|
||||
public enum OpusApplication : int
|
||||
{
|
||||
Voice = 2048,
|
||||
MusicOrMixed = 2049,
|
||||
LowLatency = 2051
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,7 @@
|
||||
|
||||
private readonly OpusEncoder _encoder;
|
||||
|
||||
internal OpusEncodeStream(AudioClient audioClient, byte[] secretKey, int samplesPerFrame, uint ssrc, int? bitrate = null,
|
||||
OpusApplication application = OpusApplication.MusicOrMixed, int bufferSize = 4000)
|
||||
internal OpusEncodeStream(AudioClient audioClient, byte[] secretKey, int samplesPerFrame, uint ssrc, int? bitrate = null, int bufferSize = 4000)
|
||||
: base(audioClient, secretKey, samplesPerFrame, ssrc, bufferSize)
|
||||
{
|
||||
_encoder = new OpusEncoder(SampleRate, Channels);
|
||||
|
||||
Reference in New Issue
Block a user