Documentation ¶
Overview ¶
Package absentia provides a functions for building a music player
Index ¶
- type AudioFormat
- type Player
- func (p *Player) CurrentDuration() time.Duration
- func (p *Player) CurrentPosition() int
- func (p *Player) MovePlayback(n int) error
- func (p *Player) Pause() error
- func (p *Player) Play() error
- func (p *Player) Read(rc io.ReadCloser, audiofmt AudioFormat) error
- func (p *Player) SamplesPerSecond() int
- func (p Player) VolumeChange(n float64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AudioFormat ¶
type AudioFormat int
AudioFormat represents the supported file formats
const ( FormatMp3 AudioFormat = iota FormatOGG FormatFLAC FormatWAV )
Currently supported formats
type Player ¶
type Player struct { Paused bool // Length is the amount of frames of the current song Length int // Duration is the total track duration Duration time.Duration // contains filtered or unexported fields }
Player allows to control the current audio stream
func (*Player) CurrentDuration ¶
CurrentDuration returns in how far the track is playing
func (*Player) CurrentPosition ¶
CurrentPosition returns the current frame
func (*Player) MovePlayback ¶
MovePlayback moves the player to sample n
func (*Player) Read ¶
func (p *Player) Read(rc io.ReadCloser, audiofmt AudioFormat) error
Read takes a ReadCloser containing audio data and creates a playback stream according to the proper format
func (*Player) SamplesPerSecond ¶
SamplesPerSecond returns the amount of samples in 1 second
func (Player) VolumeChange ¶
VolumeChange modifies the audio stream's volume.
Click to show internal directories.
Click to hide internal directories.