audio

package
v0.0.0-...-163e08f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIsFull  = errors.New("ring is full")
	ErrIsEmpty = errors.New("ring is empty")
)

Functions

This section is empty.

Types

type Clock

type Clock struct {
	// contains filtered or unexported fields
}

func (*Clock) AnchorTime

func (c *Clock) AnchorTime(virtualAnchorTime int64, rtpTime int64)

AnchorTime setup anchor time using the real clock virtualAnchorTime - network Time (using PTP) of the anchorTime rtpTime Timestamp - monotonic counter of frames

func (*Clock) CurrentRtpTime

func (c *Clock) CurrentRtpTime() int64

func (*Clock) IncRtpTime

func (c *Clock) IncRtpTime()

func (*Clock) PacketTime

func (c *Clock) PacketTime(frameRtpTime int64) time.Time

PacketTime returns the real clock time at which time a RTP packet should be played

type PCMFrame

type PCMFrame struct {
	TcpPacket
	// contains filtered or unexported fields
}

func NewFrame

func NewFrame(aacDecoder *codec.AacDecoder, sharedKey []byte, rawPacket []byte) (*PCMFrame, error)

func (*PCMFrame) Data

func (p *PCMFrame) Data() []byte

type PlaybackStatus

type PlaybackStatus uint8
const (
	STOPPED PlaybackStatus = iota
	PLAYING
)

type Player

type Player struct {
	ControlChannel chan globals.ControlMessage

	Status PlaybackStatus
	// contains filtered or unexported fields
}

func NewPlayer

func NewPlayer(clock *ptp.VirtualClock, ring *Ring) *Player

func (*Player) Push

func (p *Player) Push(frame interface{})

func (*Player) Reset

func (p *Player) Reset()

func (*Player) Run

func (p *Player) Run()

type Ring

type Ring struct {
	// contains filtered or unexported fields
}

func NewRing

func NewRing(size int) *Ring

NewRing New returns a new Ring whose buffer has the given size.

func (*Ring) Capacity

func (r *Ring) Capacity() int

Capacity returns the size of the underlying buffer.

func (*Ring) Flush

func (r *Ring) Flush(predicate func(interface{}) bool) int

func (*Ring) Free

func (r *Ring) Free() int

Free returns the length of available bytes to write.

func (*Ring) IsEmpty

func (r *Ring) IsEmpty() bool

IsEmpty returns this Ring is empty.

func (*Ring) IsFull

func (r *Ring) IsFull() bool

IsFull returns this Ring is full.

func (*Ring) Length

func (r *Ring) Length() int

Length return the length of available read bytes.

func (*Ring) Peek

func (r *Ring) Peek() interface{}

func (*Ring) Pop

func (r *Ring) Pop() interface{}

func (*Ring) Push

func (r *Ring) Push(c interface{})

func (*Ring) Reset

func (r *Ring) Reset()

Reset the read pointer and writer pointer to zero.

func (*Ring) TryPeek

func (r *Ring) TryPeek() (b interface{}, err error)

func (*Ring) TryPop

func (r *Ring) TryPop() (b interface{}, err error)

func (*Ring) TryPush

func (r *Ring) TryPush(c interface{}) error

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(player *Player) *Server

func (*Server) Flush

func (s *Server) Flush(fromSeq, untilSeq uint64)

func (*Server) SetRate0

func (s *Server) SetRate0()

func (*Server) SetRateAnchorTime

func (s *Server) SetRateAnchorTime(rtpTime uint32, networkTime time.Time)

func (*Server) Setup

func (s *Server) Setup(sharedKey []byte) (int, error)

func (*Server) Teardown

func (s *Server) Teardown()

type TcpPacket

type TcpPacket struct {
	rtp.Packet
	SequenceNumber uint32
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL