Class VoiceTransmitSink
Sink used to transmit audio data via VoiceNextConnection.
Inheritance
Namespace: DSharpPlus.VoiceNext
Assembly: cs.temp.dll.dll
Syntax
public sealed class VoiceTransmitSink : IDisposable
Properties
SampleDuration
Gets the PCM sample duration for this sink.
Declaration
public int SampleDuration { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
SampleLength
Gets the length of the PCM buffer for this sink. Written packets should adhere to this size, but the sink will adapt to fit.
Declaration
public int SampleLength { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
VolumeModifier
Gets or sets the volume modifier for this sink. Changing this will alter the volume of the output. 1.0 is 100%.
Declaration
public double VolumeModifier { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Methods
Dispose()
Declaration
public void Dispose()
FlushAsync(CancellationToken)
Flushes the rest of the PCM data in this buffer to VoiceNext packet queue.
Declaration
public Task FlushAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | The token to monitor for cancellation requests. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
GetInstalledFilters()
Gets the collection of installed PCM filters, in order of their execution.
Declaration
public IEnumerable<IVoiceFilter> GetInstalledFilters()
Returns
Type | Description |
---|---|
IEnumerable<IVoiceFilter> | Installed PCM filters, in order of execution. |
InstallFilter(IVoiceFilter, Int32)
Installs a new PCM filter, with specified execution order.
Declaration
public void InstallFilter(IVoiceFilter filter, int order = 2147483647)
Parameters
Type | Name | Description |
---|---|---|
IVoiceFilter | filter | Filter to install. |
System.Int32 | order | Order of the new filter. This determines where the filter will be inserted in the filter pipeline. |
Pause()
Pauses playback.
Declaration
public void Pause()
ResumeAsync()
Resumes playback.
Declaration
public Task ResumeAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
UninstallFilter(IVoiceFilter)
Uninstalls an installed PCM filter.
Declaration
public bool UninstallFilter(IVoiceFilter filter)
Parameters
Type | Name | Description |
---|---|---|
IVoiceFilter | filter | Filter to uninstall. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the filter was uninstalled. |
WriteAsync(ReadOnlyMemory<Byte>, CancellationToken)
Writes PCM data to the sink. The data is prepared for transmission, and enqueued.
Declaration
public Task WriteAsync(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
ReadOnlyMemory<System.Byte> | buffer | PCM data buffer to send. |
System.Threading.CancellationToken | cancellationToken | The token to monitor for cancellation requests. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
WriteAsync(Byte[], Int32, Int32, CancellationToken)
Writes PCM data to the sink. The data is prepared for transmission, and enqueued.
Declaration
public Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | PCM data buffer to send. |
System.Int32 | offset | Start of the data in the buffer. |
System.Int32 | count | Number of bytes from the buffer. |
System.Threading.CancellationToken | cancellationToken | The token to monitor for cancellation requests. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |