ebiten

package
v0.0.0-...-7f92c57 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package ebiten contains ebiten's implementation of the audio interface

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AudioProvider

type AudioProvider struct {
	*d2util.Logger
	// contains filtered or unexported fields
}

AudioProvider represents a provider capable of playing audio

func CreateAudio

func CreateAudio(l d2util.LogLevel, am *d2asset.AssetManager) *AudioProvider

CreateAudio creates an instance of ebiten's audio provider

func (*AudioProvider) LoadSound

func (eap *AudioProvider) LoadSound(sfx string, loop, bgm bool) (d2interface.SoundEffect, error)

LoadSound loads a sound affect so that it canb e played

func (*AudioProvider) PlayBGM

func (eap *AudioProvider) PlayBGM(song string)

PlayBGM loads an audio stream and plays it in the background

func (*AudioProvider) SetVolumes

func (eap *AudioProvider) SetVolumes(bgmVolume, sfxVolume float64)

SetVolumes sets the volumes of the audio provider

type SoundEffect

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

SoundEffect represents an ebiten implementation of a sound effect

func (*SoundEffect) IsPlaying

func (v *SoundEffect) IsPlaying() bool

IsPlaying returns a bool for whether or not the sound is currently playing

func (*SoundEffect) Play

func (v *SoundEffect) Play()

Play plays the sound effect

func (*SoundEffect) SetPan

func (v *SoundEffect) SetPan(pan float64)

SetPan sets the audio pan, left is -1.0, center is 0.0, right is 1.0

func (*SoundEffect) SetVolume

func (v *SoundEffect) SetVolume(volume float64)

SetVolume ets the volume

func (*SoundEffect) Stop

func (v *SoundEffect) Stop()

Stop stops the sound effect

Jump to

Keyboard shortcuts

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