flutter_audio_games library

This package provides useful widgets for rapid creation of audio games.

Getting Started

  • Create audio menus with the AudioGameMenu class.
  • Schedule a single task to happen on a regular basis with the Ticking widget.
  • Schedule random tasks with the RandomTasks widget.
  • Add music to any widget by wrapping it in a Music widget.
  • Add a sound to play when a widget is focused by wrapping it in a PlaySoundSemantics widget.
  • Show splash screens and play cut scenes with the TimedBuilders widget.

Classes

AmbiancesBuilder
A widget which plays ambiances.
AmbiancesBuilderState
State for AmbiancesBuilder.
AssetSpan
A span in a asset which can be loaded from assetKey.
AudioGameMenu
A menu in an audio game.
AudioGameMenuItem
A menu item in an AudioGameMenu.
AudioGameMenuItemListTile
A ListTile for use in an AudioGameMenu widget.
AudioGameMenuListView
The ListView that powers AudioGameMenus.
LoadableSound
A Sound with a loadMode.
LoadedSound
A source and handle which have been loaded.
LoadSounds
A widget which loads sounds before rendering child.
LoadSoundsState
State for LoadSounds.
MaybeMusic
A widget that possibly plays music.
MaybePlaySoundSemantics
A widget which uses PlaySoundSemantics to play sound if sound is not null.
MidiNotes
A list of MIDI notes.
Music
A widget that plays music.
MusicProvider
The inherited version of a Music.
MusicState
State for Music.
PlaySound
A widget which plays a sound when built.
PlaySoundSemantics
A Semantics widget which plays a sound when focused.
PlaySoundSemanticsState
State for PlaySoundSemantics.
PlaySoundsSemantics
A widget which plays a random sound from sounds every interval when selected.
PlaySoundsSemanticsState
State for PlaySoundsSemantics.
PlaySoundState
State for PlaySound.
ProtectSounds
A widget which protects a list of sounds from being disposed for the duration of its life.
ProtectSoundsState
State for ProtectSounds.
SelectPlaybackDevice
A screen for selecting a new SoLoud playback device.
SelectPlaybackDeviceState
State for SelectPlaybackDevice.
SideScroller
A widget for showing a side scroller.
SideScrollerState
State for SideScroller.
SideScrollerSurface
A surface in a SideScroller level.
SideScrollerSurfaceObject
An object in a SideScrollerSurface.
SoLoudScope
Manage the life cycle of SoLoud.
SoLoudScopeProvider
Provide a sourceLoader to anyone who needs it.
SoLoudScopeState
State for SoLoudScope.
Sound
A single sound to play.
SoundFromAsset
A Sound loaded from assetKey.
SoundFromAssetSpan
A Sound from a span of assetKey.
SoundFromBuffer
A Sound from buffer.
SoundFromFile
A Sound loaded from file.
SoundFromUrl
A Sound loaded from url.
SoundHandleProperty<T>
A property on a SoundHandle instance.
SoundPosition
The base class for sound positions.
SoundPosition3d
Position for a 3d sound.
SoundPositionPanned
Position for a panned sound.
SoundWave
A Sound from a wave form.
SourceLoader
A class for creating AudioSources from Sounds.
StartWebAudio
A widget which shows a button for starting web audio.
StartWebAudioState
State for StartWebAudio.
VoiceGroup
The voice group class.
VolumeListTile
A ListTile for editing volume.

Enums

MovingDirection
Possible movement directions.
SideScrollerDirection
The directions which can be moved in a SideScroller level.
TurningDirection
Possible turning directions.

Extensions

AudioSourceX on AudioSource
Useful methods for sources.
BuildContextX on BuildContext
Useful extensions on build contexts.
FileX on File
Useful methods to turn Files into Sounds.
ListSoundHandleX on List<SoundHandle>
Useful methods for lists of sound handles.
ListStringX on List<String>
Useful methods on string lists.
ListX on List<E>
Useful extensions for lists.
PointDoubleX on Point<double>
Useful methods for points.
PointIntX on Point<int>
Useful methods for points.
PointX on Point<T>
Useful methods on generic points.
SoLoudX on SoLoud
Useful methods.
SoundHandleX on SoundHandle
Useful methods on sound handles.
StringX on String
Useful string methods.

Constants

unpanned → const SoundPositionPanned
The position for an unpanned sound.

Functions

angleToRad(double angle) double
Convert an angle to radians.
buildStartWebAudioButton(BuildContext context, VoidCallback onDone) Widget
Build a button for starting web audio.
normaliseAngle(double angle) double
Return an angle between 0 and 359 degrees.
radsToDegrees(double radians) double
Convert radians to degrees.

Typedefs

OnSourceLoad = FutureOr<void> Function(AudioSource source)
The type of a function which will affect a source when it is loaded.
SideScrollerSurfaceAction = FutureOr<void> Function(SideScrollerState state)
The type of side scroller move functions for players.
WebAudioButtonBuilder = Widget Function(BuildContext context, VoidCallback onDone)
The type of a function which builds a button for starting web audio.