Documentation ¶
Index ¶
- Constants
- type AudioBuffer
- func (buffer *AudioBuffer) AddBuffer(data []byte)
- func (buffer *AudioBuffer) Channels() av.ChannelLayout
- func (buffer *AudioBuffer) Format() av.SampleFormat
- func (buffer *AudioBuffer) Frequency() int
- func (buffer *AudioBuffer) Process(byteLength int) (rslt []byte)
- func (buffer *AudioBuffer) RecommendSampleCount() int
- type AudioFormat
- type AudioFrequencySampler
- func (sampler *AudioFrequencySampler) Channels() av.ChannelLayout
- func (sampler *AudioFrequencySampler) Format() av.SampleFormat
- func (sampler *AudioFrequencySampler) Frequency() int
- func (sampler *AudioFrequencySampler) Process(len int) (rslt []byte)
- func (sampler *AudioFrequencySampler) RecommendSampleCount() int
- type AudioProcessor
- type PacketDecoder
- func (decoder *PacketDecoder) Channels() av.ChannelLayout
- func (decoder *PacketDecoder) Decode(pkt av.Packet) (err error)
- func (decoder *PacketDecoder) Format() av.SampleFormat
- func (decoder *PacketDecoder) Frequency() int
- func (decoder *PacketDecoder) Initialize() (err error)
- func (decoder *PacketDecoder) Process(byteLength int) (rslt []byte)
- func (decoder *PacketDecoder) RecommendSampleCount() (samples int)
- type PacketTranscoder
- type Service
Constants ¶
const ( InitTimer uint32 = (1 << iota) InitVideo InitAudio InitEvent )
Flag Define
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AudioBuffer ¶
type AudioBuffer struct {
// contains filtered or unexported fields
}
AudioBuffer audio play buffer
func NewAudioBuffer ¶
func NewAudioBuffer(bufferCount int, frequency int, samples int, ) *AudioBuffer
NewAudioBuffer create new audio buffer
func (*AudioBuffer) AddBuffer ¶
func (buffer *AudioBuffer) AddBuffer(data []byte)
AddBuffer add date to buffer
func (*AudioBuffer) Channels ¶
func (buffer *AudioBuffer) Channels() av.ChannelLayout
Channels channel layout
func (*AudioBuffer) Format ¶
func (buffer *AudioBuffer) Format() av.SampleFormat
Format sample format
func (*AudioBuffer) Process ¶
func (buffer *AudioBuffer) Process(byteLength int) (rslt []byte)
Process process buffer
func (*AudioBuffer) RecommendSampleCount ¶
func (buffer *AudioBuffer) RecommendSampleCount() int
RecommendSampleCount recommended sample count
type AudioFrequencySampler ¶
type AudioFrequencySampler struct {
// contains filtered or unexported fields
}
AudioFrequencySampler generate sampling audio
func NewFrequencySampler ¶
func NewFrequencySampler(baseFrequency int, layout av.ChannelLayout, freqInfo []int, samples int) (*AudioFrequencySampler, error)
NewFrequencySampler create new sampler
func (*AudioFrequencySampler) Channels ¶
func (sampler *AudioFrequencySampler) Channels() av.ChannelLayout
Channels return channel layout
func (*AudioFrequencySampler) Format ¶
func (sampler *AudioFrequencySampler) Format() av.SampleFormat
Format audio format
func (*AudioFrequencySampler) Frequency ¶
func (sampler *AudioFrequencySampler) Frequency() int
Frequency base frequency
func (*AudioFrequencySampler) Process ¶
func (sampler *AudioFrequencySampler) Process(len int) (rslt []byte)
Process process sampler
func (*AudioFrequencySampler) RecommendSampleCount ¶
func (sampler *AudioFrequencySampler) RecommendSampleCount() int
RecommendSampleCount sampling count
type AudioProcessor ¶
type AudioProcessor interface { Process(len int) []byte Frequency() int Format() av.SampleFormat Channels() av.ChannelLayout RecommendSampleCount() int }
AudioProcessor interface
type PacketDecoder ¶
type PacketDecoder struct {
// contains filtered or unexported fields
}
PacketDecoder audio packet decoder
func NewPacketDecoder ¶
func NewPacketDecoder(srcCodec av.AudioCodecData, dstLayout av.ChannelLayout, dstFrequency int, bufferCount int, ) *PacketDecoder
NewPacketDecoder make new packet decoder
func (*PacketDecoder) Channels ¶
func (decoder *PacketDecoder) Channels() av.ChannelLayout
Channels channel layout
func (*PacketDecoder) Decode ¶
func (decoder *PacketDecoder) Decode(pkt av.Packet) (err error)
Decode decode packet
func (*PacketDecoder) Format ¶
func (decoder *PacketDecoder) Format() av.SampleFormat
Format sample format
func (*PacketDecoder) Initialize ¶
func (decoder *PacketDecoder) Initialize() (err error)
Initialize initialize decoder
func (*PacketDecoder) Process ¶
func (decoder *PacketDecoder) Process(byteLength int) (rslt []byte)
Process process buffer
func (*PacketDecoder) RecommendSampleCount ¶
func (decoder *PacketDecoder) RecommendSampleCount() (samples int)
RecommendSampleCount recommended sample count
type PacketTranscoder ¶
type PacketTranscoder struct {
// contains filtered or unexported fields
}
PacketTranscoder struct for transcoder
func NewTranscoder ¶
func NewTranscoder(src av.AudioCodecData, forceDecoding bool, codec av.CodecType, sampleRate int, layout av.ChannelLayout, bitrate int, options *map[string]interface{}, ) (trans *PacketTranscoder, err error)
NewTranscoder create new transcoder instance
func (*PacketTranscoder) Close ¶
func (trans *PacketTranscoder) Close() (err error)
Close close transcoder
func (*PacketTranscoder) OutCodecData ¶
func (trans *PacketTranscoder) OutCodecData() (codecData av.AudioCodecData)
OutCodecData Output AudioCodecData
func (*PacketTranscoder) Setup ¶
func (trans *PacketTranscoder) Setup() (err error)
Setup Transcoder setup
type Service ¶
Service sdl device context
func (*Service) Initialize ¶
func (service *Service) Initialize(capability uint32, audioContext AudioProcessor)
Initialize initialize service