audio

package
v0.0.0-...-4d18667 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package audio manages the loading and playback of sound files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cleanup

func Cleanup()

Cleanup cleans up all audio data

Types

type Sound

type Sound struct {
	// contains filtered or unexported fields
}

Sound represents a loaded sound file that can be played back.

func NewSound

func NewSound(fileName string) (*Sound, error)

NewSound open the file for the given filename and returns a Sound.

func (*Sound) Delete

func (s *Sound) Delete()

Delete deletes the sound from memory.

func (*Sound) Play

func (s *Sound) Play() (err error)

Play plays the sound.

func (*Sound) SetVolume

func (s *Sound) SetVolume(v float64)

SetVolume sets the volume between 0.0 (silent) and 1.0 (full volume). Any outside this range will be capped.

Jump to

Keyboard shortcuts

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