Documentation ¶
Index ¶
- func AdjustAudio(raw []byte, vol float64) []byte
- type CodecHandler
- type LocalPlayer
- func (lp *LocalPlayer) GetIsMuted() bool
- func (lp *LocalPlayer) GetTrack() Track
- func (lp *LocalPlayer) Play(session *rtsp.Session)
- func (lp *LocalPlayer) SetAlbumArt(artwork []byte)
- func (lp *LocalPlayer) SetMute(isMuted bool)
- func (lp *LocalPlayer) SetTrack(album string, artist string, title string)
- func (lp *LocalPlayer) SetVolume(volume float64)
- type Player
- type Track
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdjustAudio ¶
AdjustAudio takes a raw data frame of audio and a volume value between 0 and 1, 1 being full volume, 0 being mute
Types ¶
type CodecHandler ¶
CodecHandler handler function for receiving raw bytes and decoding them using some codec
func GetCodec ¶
func GetCodec(session *rtsp.Session) CodecHandler
GetCodec determins the appropriate codec from the rtsp session
type LocalPlayer ¶
type LocalPlayer struct {
// contains filtered or unexported fields
}
LocalPlayer is a player that will just play the audio locally
func NewLocalPlayer ¶
func NewLocalPlayer() *LocalPlayer
NewLocalPlayer instantiates a new LocalPlayer
func (*LocalPlayer) GetIsMuted ¶
func (lp *LocalPlayer) GetIsMuted() bool
GetIsMuted returns muted state
func (*LocalPlayer) Play ¶
func (lp *LocalPlayer) Play(session *rtsp.Session)
Play will play the packets received on the specified session
func (*LocalPlayer) SetAlbumArt ¶
func (lp *LocalPlayer) SetAlbumArt(artwork []byte)
SetAlbumArt sets the album art for the player
func (*LocalPlayer) SetMute ¶
func (lp *LocalPlayer) SetMute(isMuted bool)
SetMute will mute or unmute the player
func (*LocalPlayer) SetTrack ¶
func (lp *LocalPlayer) SetTrack(album string, artist string, title string)
SetTrack sets the track for the player
func (*LocalPlayer) SetVolume ¶
func (lp *LocalPlayer) SetVolume(volume float64)
SetVolume accepts a float between 0 (mute) and 1 (full volume)
type Player ¶
type Player interface { Play(session *rtsp.Session) SetVolume(volume float64) SetMute(isMuted bool) GetIsMuted() bool SetTrack(album string, artist string, title string) SetAlbumArt(artwork []byte) GetTrack() Track }
Player defines a player for outputting the data packets from the session