Documentation ¶
Index ¶
- func DecodeFromFile(fsys fs.FS, name string) (StreamSeekCloser, Format, error)
- type Format
- type MusicPlayer
- func (mp *MusicPlayer) Close()
- func (mp MusicPlayer) Duration() time.Duration
- func (mp MusicPlayer) IsEmpty() bool
- func (mp MusicPlayer) IsPaused() bool
- func (mp MusicPlayer) IsPlayed() bool
- func (mp *MusicPlayer) Pause()
- func (mp *MusicPlayer) Play()
- func (mp MusicPlayer) PlaybackRate() float64
- func (mp *MusicPlayer) Resume()
- func (mp *MusicPlayer) Rewind()
- func (mp *MusicPlayer) SetPlaybackRate(ratio float64)
- func (mp *MusicPlayer) SetVolume(vol float64)
- func (mp MusicPlayer) Time() time.Duration
- type Sound
- type SoundMap
- type SoundPlayer
- type SoundPod
- type StreamSeekCloser
- type Streamer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeFromFile ¶ added in v0.6.0
Types ¶
type MusicPlayer ¶ added in v0.3.1
type MusicPlayer struct {
// contains filtered or unexported fields
}
func NewMusicPlayer ¶ added in v0.3.1
func NewMusicPlayer(f beep.StreamSeekCloser, format beep.Format, ratio float64) MusicPlayer
func NewMusicPlayerFromFile ¶ added in v0.6.0
func (*MusicPlayer) Close ¶ added in v0.3.1
func (mp *MusicPlayer) Close()
func (MusicPlayer) Duration ¶ added in v0.6.0
func (mp MusicPlayer) Duration() time.Duration
func (MusicPlayer) IsEmpty ¶ added in v0.6.0
func (mp MusicPlayer) IsEmpty() bool
func (MusicPlayer) IsPaused ¶ added in v0.6.0
func (mp MusicPlayer) IsPaused() bool
func (MusicPlayer) IsPlayed ¶ added in v0.6.0
func (mp MusicPlayer) IsPlayed() bool
func (*MusicPlayer) Pause ¶ added in v0.6.0
func (mp *MusicPlayer) Pause()
func (*MusicPlayer) Play ¶ added in v0.6.0
func (mp *MusicPlayer) Play()
func (MusicPlayer) PlaybackRate ¶ added in v0.6.0
func (mp MusicPlayer) PlaybackRate() float64
func (*MusicPlayer) Resume ¶ added in v0.6.0
func (mp *MusicPlayer) Resume()
func (*MusicPlayer) Rewind ¶ added in v0.6.0
func (mp *MusicPlayer) Rewind()
func (*MusicPlayer) SetPlaybackRate ¶ added in v0.6.0
func (mp *MusicPlayer) SetPlaybackRate(ratio float64)
func (*MusicPlayer) SetVolume ¶ added in v0.6.0
func (mp *MusicPlayer) SetVolume(vol float64)
func (MusicPlayer) Time ¶ added in v0.6.0
func (mp MusicPlayer) Time() time.Duration
type Sound ¶ added in v0.3.1
type Sound struct {
// contains filtered or unexported fields
}
Sound is for playing simple sound effects.
type SoundMap ¶
type SoundMap struct {
// contains filtered or unexported fields
}
func NewSoundMap ¶
It is possible that there is no sounds in file system. Hence, selecting format from the first met sound in file system then do beep.NewBuffer(format) may cause error.
func (*SoundMap) AppendSound ¶ added in v0.6.0
func (sm *SoundMap) AppendSound(name string, streamer beep.StreamSeekCloser)
func (*SoundMap) AppendSoundFromFile ¶ added in v0.6.0
func (*SoundMap) SetResampleRatio ¶ added in v0.6.0
type SoundPlayer ¶ added in v0.3.1
type SoundPlayer interface {
Play(vol float64)
}
SoundPlayer is an interface for playing sound. It is implemented by Sound and SoundPod.
type SoundPod ¶ added in v0.6.0
type SoundPod struct {
SoundMap
}
SoundBag is for playing randomly one of the sounds.
func NewSoundPod ¶ added in v0.6.0
type StreamSeekCloser ¶ added in v0.6.0
type StreamSeekCloser = beep.StreamSeekCloser
Click to show internal directories.
Click to hide internal directories.