Documentation ¶
Index ¶
- Variables
- func ChangeMasterVolume(volume float64)
- func StopAudio()
- type SpeakerTrack
- func (s *SpeakerTrack) ChangeVolume(volume float64)
- func (s *SpeakerTrack) GetName() string
- func (s *SpeakerTrack) PauseAudio()
- func (s *SpeakerTrack) PlayAudioFromBytes(data []byte, volume float64, speed float64, loops int) error
- func (s *SpeakerTrack) PlayAudioFromFile(file string, volume float64, speed float64, loops int) error
- func (s *SpeakerTrack) ResumeAudio()
Constants ¶
This section is empty.
Variables ¶
var SpeakerTracks = make(map[string]*SpeakerTrack)
Functions ¶
func ChangeMasterVolume ¶
func ChangeMasterVolume(volume float64)
Changes master volume of all audio tracks. The default master volume is 5.
Types ¶
type SpeakerTrack ¶
type SpeakerTrack struct {
// contains filtered or unexported fields
}
func NewSpeakerTrack ¶
func NewSpeakerTrack(name string) (*SpeakerTrack, error)
func (*SpeakerTrack) ChangeVolume ¶
func (s *SpeakerTrack) ChangeVolume(volume float64)
Change the volume of the audio track.
func (*SpeakerTrack) GetName ¶
func (s *SpeakerTrack) GetName() string
func (*SpeakerTrack) PlayAudioFromBytes ¶
func (s *SpeakerTrack) PlayAudioFromBytes(data []byte, volume float64, speed float64, loops int) error
Play an audio from bytes with a specified volume, playback speed, and looping option. A volume of 0 mutes the audio, and volume increases as the value increases. The speed should be a ratio for the speed adjustment, with 1 using the original speed of the file. The loops option allows for the audio track to be repeated indefinitely. Choose -1 for infinitely looping audio A loops value of 0 and 1 have the same functionality, playing the audio once.
func (*SpeakerTrack) PlayAudioFromFile ¶
func (s *SpeakerTrack) PlayAudioFromFile(file string, volume float64, speed float64, loops int) error
Play an audio file with a specified volume, playback speed, and looping option. A volume of 0 mutes the audio, and volume increases as the value increases. The speed should be a ratio for the speed adjustment, with 1 using the original speed of the file. The loops option allows for the audio track to be repeated indefinitely. Choose -1 for infinitely looping audio A loops value of 0 and 1 have the same functionality, playing the audio once.