NFAudio

package
v0.0.0-...-3560abe Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

func StopAudio

func StopAudio()

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) PauseAudio

func (s *SpeakerTrack) PauseAudio()

Pause the audio track.

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.

func (*SpeakerTrack) ResumeAudio

func (s *SpeakerTrack) ResumeAudio()

Resume the audio track.

Jump to

Keyboard shortcuts

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