Documentation ¶
Index ¶
- Constants
- func ContinuousPlay(ingoing chan []byte) error
- func ContinuousPlayOpus(ingoing chan []byte) error
- func ContinuousRecord(outgoing chan []byte) error
- func ContinuousRecordOpus(outgoing chan []byte) error
- func DecodePayload(payload []byte) ([]byte, error)
- func EncodePayload(chunk []byte) []byte
- func EncodePayloadToString(chunk []byte) string
- func PlayChunk(chunk []byte) error
- func PlayWAVChunk(chunk []byte) error
- func RecordChunk() ([]byte, error)
- func RecordWAVChunk() ([]byte, error)
- type WAVInfo
Constants ¶
View Source
const ( BLOCK_SIZE = 480 //480 == 60ms at 8kHz/8bit, for Opus encoding FRAME_SIZE_MS = 60 // 60ms SAMPLE_RATE = 8000 // kHz CHANNELS = 1 OPUS_BIT_RATE = 16000 )
Variables ¶
This section is empty.
Functions ¶
func ContinuousPlay ¶
ContinuousPlay opens audio stream and plays raw pcm chunks, requesting ingoing channel. It's blocking function.
func ContinuousPlayOpus ¶
ContinuousPlayOpus opens audio stream and plays opus encoded chunks, requesting ingoing channel. It's a blocking function.
func ContinuousRecord ¶
ContinuousRecord records chunks and puts them into channel. It's a blocking function.
func ContinuousRecordOpus ¶
ContinuousRecordOpus records Opus encoded chunks and puts them into channel. It's a blocking function.
func DecodePayload ¶
DecodePayload converts base64 to []byte
func EncodePayload ¶
EncodePayload retruns the base64 encoding of input
func EncodePayloadToString ¶
EncodePayloadToString converts []byte to base64 string
func RecordWAVChunk ¶
Types ¶
type WAVInfo ¶
type WAVInfo struct { Id [4]byte Length int32 WavFmt [8]byte Format int32 PCM int16 Channels int16 Freq int32 BytesPerSecond int32 BytesPerCapture int16 BitsPerSample int16 Data [4]byte BytesInData int32 }
WAVInfo contains wav information
func GetWAVInfo ¶
GetWAVInfo gets information from wav chunk
Click to show internal directories.
Click to hide internal directories.