Crates.io | soundkit |
lib.rs | soundkit |
version | 0.11.8 |
source | src |
created_at | 2023-05-14 06:03:02.95113 |
updated_at | 2024-09-29 19:35:12.587462 |
description | Audio format optimised for low-latency audio. |
homepage | |
repository | https://github.com/wavey-ai/soundkit |
max_upload_size | |
id | 864114 |
size | 10,290,166 |
A package for working with low-latency audio via SRT and via HTTP Range requests
This package provides encoding and decoding for audio packet headers. The header encoding is used to specify the details about the audio data that follows in the packet. This includes information about the encoding method, configuration parameters, and frame sizes for each channel.
The header structure is as follows:
|-----------------------------------------------------------------------------|
| Flag + Config ID | Channel Count | Frame Size 1 | ... |
|-----------------------------------------------------------------------------|
| 1 Byte | 1 Byte | 2 Bytes | ... |
|-----------------------------------------------------------------------------|
The EncodingFlag
indicates the method of encoding used for the audio data. Currently, two encoding methods are supported:
PCM
(value 0
): This flag indicates that Pulse Code Modulation (PCM) encoding is used. PCM is a method used to digitally represent analog signals.Opus
(value 1
): This flag indicates that Opus encoding is used. Opus is a lossy audio coding format designed to efficiently code speech and general audio in a single format.The AudioConfig
is a enumeration that represents the sample rate and bit depth of the audio data. The following configurations are supported:
Hz44100Bit16
Hz44100Bit24
Hz44100Bit32
Hz48000Bit16
Hz48000Bit24
Hz48000Bit32
...
Hz352800Bit32
Each configuration indicates a combination of the sample rate (in Hz) and the bit depth (in Bits). For instance, Hz44100Bit16
represents a sample rate of 44100 Hz and a bit depth of 16 bits.