This page is translated into your preferred language using AI. You can help improve the translation of this wiki!
Visit the wiki’s repo
Overview of Current Capabilities
Version 1.0.0.0
Streaming audio at 16 000 Hz via a custom IAudioHandler. Audio is additionally compressed using gzip and transmitted over a dedicated WebSocketServer, typically on port 8082.
Each audio sample is sent with an uncompressed header: an Int32 sequence followed by an Int64 ptc timestamp (in microseconds).
It is recommended to implement a custom JitterBuffer to track packet lag relative to the last received packet.
Below is an example client implementation for receiving and processing audio:
private void OnMessageReceived(MessageWebSocket sender, MessageWebSocketMessageReceivedEventArgs args)
{
var reader = args.GetDataReader();
reader.ByteOrder = ByteOrder.LittleEndian;
if (reader.UnconsumedBufferLength < 12) return;
int seq = reader.ReadInt32();
long pts = reader.ReadInt64();
uint payloadLen = reader.UnconsumedBufferLength;
byte[] buf = new byte[payloadLen];
reader.ReadBytes(buf);
var msIn = new MemoryStream(buf);
var gzip = new GZipStream(msIn, CompressionMode.Decompress);
var msOut = new MemoryStream();
gzip.CopyTo(msOut);
var pcm = msOut.ToArray();
}
This site uses cookies to save some settings (like your language).
You can disable cookies in your browser settings — the site will probably still work.