audio

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: GPL-3.0 Imports: 10 Imported by: 4

Documentation

Overview

Package audio uses OpenAL to play game audio by exposing the two audio callbacks Sample and SampleBatch for the libretro implementation.

Index

Constants

This section is empty.

Variables

View Source
var Effects map[string]*Effect

Effects are sound effects

Functions

func Init

func Init()

Init initializes the audio device

func PlayEffect added in v0.8.7

func PlayEffect(e *Effect)

PlayEffect plays a sound effect

func Reconfigure added in v0.8.7

func Reconfigure(r int32)

Reconfigure initializes the audio package. It sets the number of buffers, the volume and the source for the games.

func Sample

func Sample(left int16, right int16)

Sample renders a single audio frame. It is passed as a callback to the libretro implementation.

func SampleBatch

func SampleBatch(buf []byte, size int32) int32

SampleBatch renders multiple audio frames in one go It is passed as a callback to the libretro implementation.

func SetEffectsVolume added in v0.8.7

func SetEffectsVolume(vol float32)

SetEffectsVolume sets the audio volume of sound effects

func SetVolume

func SetVolume(vol float32)

SetVolume sets the audio volume

Types

type Effect added in v0.8.7

type Effect struct {
	Format *wav.WavFormat
	// contains filtered or unexported fields
}

Effect is a static sound effect

func LoadEffect added in v0.8.7

func LoadEffect(filename string) (*Effect, error)

LoadEffect loads a wav into memory and prepare the buffer and source in OpenAL

Jump to

Keyboard shortcuts

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