audio

package
v0.3.26 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package audio handles music and sound effects for Spy Cards Online.

Index

Constants

This section is empty.

Variables

View Source
var (
	// SoundsVolume is the user-set volume (0..1) of sound effects.
	SoundsVolume float64 = 0.6
	// MusicVolume is the user-set volume (0..1) of music.
	MusicVolume float64 = 0.6

	// IgnoreAudio causes calls to audio functions to be ignored
	// if it is nonzero.
	IgnoreAudio uint64
)
View Source
var (
	AtkFail = &Sound{
		Name: "AtkFail",
	}
	AtkSuccess = &Sound{
		Name: "AtkSuccess",
	}
	BattleStart0 = &Sound{
		Name: "BattleStart0",
	}
	Buzzer = &Sound{
		Name: "Buzzer",
	}
	CardSound2 = &Sound{
		Name:   "CardSound2",
		Pitch:  1.2,
		Volume: 0.5,
	}
	Charge = &Sound{
		Name: "Charge",
	}
	Coin = &Sound{
		Name: "Coin",
	}
	Confirm = &Sound{
		Name: "Confirm",
	}
	Confirm1 = &Sound{
		Name:   "Confirm1",
		Pitch:  0.4,
		Volume: 0.5,
	}
	CrowdCheer2 = &Sound{
		Name:  "CrowdCheer2",
		Pitch: 1.2,
	}
	CrowdClap = &Sound{
		Name: "CrowdClap",
	}
	CrowdGasp = &Sound{
		Name: "CrowdGasp",
	}
	Damage0 = &Sound{
		Name: "Damage0",
	}
	Death3 = &Sound{
		Name: "Death3",
	}
	Fail = &Sound{
		Name: "Fail",
	}
	Heal = &Sound{
		Name: "Heal",
	}
	Lazer = &Sound{
		Name: "Lazer",
	}
	PageFlip = &Sound{
		Name: "PageFlip",
	}
	Toss11 = &Sound{
		Name: "Toss11",
	}
	FBCountdown = &Sound{
		Name: "FBCountdown",
	}
	FBDeath = &Sound{
		Name: "FBDeath",
	}
	FBFlower = &Sound{
		Name: "FBFlower",
	}
	FBGameOver = &Sound{
		Name: "FBGameOver",
	}
	FBPoint = &Sound{
		Name: "FBPoint",
	}
	FBStart = &Sound{
		Name: "FBStart",
	}
	MiteKnightIntro = &Sound{
		Name: "MiteKnightIntro",
	}
	MKDeath = &Sound{
		Name: "MKDeath",
	}
	MKGameOver = &Sound{
		Name: "MKGameOver",
	}
	MKHit = &Sound{
		Name: "MKHit",
	}
	MKHit2 = &Sound{
		Name: "MKHit2",
	}
	MKKey = &Sound{
		Name: "MKKey",
	}
	MKOpen = &Sound{
		Name: "MKOpen",
	}
	MKPotion = &Sound{
		Name: "MKPotion",
	}
	MKShield = &Sound{
		Name: "MKShield",
	}
	MKStairs = &Sound{
		Name: "MKStairs",
	}
	MKWalk = &Sound{
		Name: "MKWalk",
	}
	PeacockSpiderNPCSummonSuccess = &Sound{
		Name: "PeacockSpiderNPCSummonSuccess",
	}
	Shot2 = &Sound{
		Name: "Shot2",
	}
	Inn = &Sound{
		Name: "Inn",
	}
	Kut1 = &Sound{
		Name: "Kut1",
	}
	Kut2 = &Sound{
		Name: "Kut2",
	}
	Damage1 = &Sound{
		Name: "Damage1",
	}
	Damage2 = &Sound{
		Name: "Damage2",
	}
	FunnyStep = &Sound{
		Name: "FunnyStep",
	}
	StatUp = &Sound{
		Name: "StatUp",
	}
	StatDown = &Sound{
		Name: "StatDown",
	}
)

Sound effects.

View Source
var (
	Miniboss = &Sound{
		Name:  "Miniboss",
		Loop:  true,
		Start: 20.55,
		End:   87,
	}
	Bounty = &Sound{
		Name:  "Bounty",
		Loop:  true,
		Start: 6.7,
		End:   52.5,
	}
	Inside2 = &Sound{
		Name:  "Inside2",
		Loop:  true,
		Start: 10.3,
		End:   72,
	}
	FlyingBee = &Sound{
		Name:  "FlyingBee",
		Loop:  true,
		Start: 999,
		End:   999,
	}
	MiteKnight = &Sound{
		Name:  "MiteKnight",
		Loop:  true,
		Start: 999,
		End:   999,
	}
	TermiteLoop = &Sound{
		Name:  "TermiteLoop",
		Loop:  true,
		Start: 999,
		End:   999,
	}
	Battle4 = &Sound{
		Name:  "Battle4",
		Loop:  true,
		Start: 12.95,
		End:   83.68,
	}
	Battle0 = &Sound{
		Name:  "Battle0",
		Loop:  true,
		Start: 2.08,
		End:   68.1,
	}
	Chef1 = &Sound{
		Name:  "Chef1",
		Loop:  true,
		Start: 1.503,
		End:   30,
	}
	Field1 = &Sound{
		Name:  "Field1",
		Loop:  true,
		Start: 5.11,
		End:   86.44,
	}
)

Music tracks.

Functions

func IsCurrentMusicLoading added in v0.3.13

func IsCurrentMusicLoading() bool

func MusicFFT added in v0.3.5

func MusicFFT() []uint8

func MusicVolumeTemp added in v0.3.10

func MusicVolumeTemp(scale float64)

func SetListenerPosition added in v0.3.17

func SetListenerPosition(x, y, z, rx, ry, rz float32)

func StopMusic

func StopMusic()

StopMusic stops the current music track.

func StopSounds added in v0.3.1

func StopSounds()

StopSounds stops all active sounds.

func Tick

func Tick()

Tick is an internal function that performs bookkeeping for the audio package.

Types

type Sound

type Sound struct {
	Name     string
	Pitch    float64
	Volume   float64
	MaxDelay float64

	Loop  bool
	Start float64
	End   float64
	// contains filtered or unexported fields
}

Sound is an audio clip.

func (*Sound) PlayMusic

func (s *Sound) PlayMusic(delay float64, restart bool)

PlayMusic plays a sound as the current music track.

func (*Sound) PlaySound

func (s *Sound) PlaySound(delay, overridePitch, overrideVolume float64, x, y, z float32)

PlaySound plays a sound, optionally modifying its pitch and volume.

func (*Sound) PlaySoundGlobal added in v0.3.17

func (s *Sound) PlaySoundGlobal(delay, overridePitch, overrideVolume float64)

func (*Sound) Preload

func (s *Sound) Preload() error

Preload loads the Sound and returns the error encountered, if any.

func (*Sound) Release added in v0.2.72

func (s *Sound) Release()

Release releases any system resources used by the Sound. It is an error to use the Sound after calling Release.

func (*Sound) StartPreload added in v0.3.7

func (s *Sound) StartPreload()

StartPreload creates a new goroutine to preload the sound.

Jump to

Keyboard shortcuts

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