DiscordVoiceDataSource
public protocol DiscordVoiceDataSource : class
Specifies that a type will be a data source for a VoiceEngine.
-
The size of a frame in samples per channel. Needed to calculate the maximum size of a frame.
Declaration
Swift
var frameSize: Int
-
Called when the engine needs voice data. If there is no more data left, a
DiscordVoiceDataSourceStatus.doneerror should be thrown.Declaration
Swift
func engineNeedsData(_ engine: DiscordVoiceEngine) throws -> [UInt8]Parameters
engineThe voice engine that needs data.
Return Value
An array of Opus encoded bytes.
-
Call when you want data collection to stop.
Declaration
Swift
func finishUpAndClose() -
Signals that the source should start producing data for consumption.
Declaration
Swift
func startReading()
DiscordVoiceDataSource Protocol Reference