-
Notifications
You must be signed in to change notification settings - Fork 0
lunaris audio voice
Lohk edited this page Sep 16, 2021
·
1 revision
Voice
is the main hardware interface. This represent an "audio device". You can attach mixer
s to this and so you can play audio files.
Function | About |
---|---|
create(const int, const ALLEGRO_AUDIO_DEPTH, const ALLEGRO_CHANNEL_CONF) : bool |
Create a voice with a frequency (in hertz, defaults 48 kHz), depth (one of the enum, defaults to 16 bits) and audio configuration (mono, stereo, surround, defaults to stereo). Returns true on success. |
destroy() : void |
Destroy the voice (it should detach mixers attached to it, but it's recommended to detach manually) |
mute(const bool) : void |
Mute output? |
exists() : bool |
Check if this voice is initialized. Recommended before any attach or get/set. Returns true if it's good. |
1. Simple one file music player (without error checks)
Lunaris::voice audio;
audio.create();
Lunaris::mixer mixing;
mixing.create();
mixing.attach_to(audio);
Lunaris::track mytrack;
Lunaris::sample mysample;
mysample.load("fancy_music.ogg");
mytrack.load(mysample);
mytrack.attach_to(mixing);
mytrack.set_gain(0.3f);
mytrack.play();
- Lunaris (rebrand & dev)
- LSWv5
- _Macros
-
Handling
- Abort
- Initialize
- Paths
- Tools
- AdvancedShared
- Any
- Common
- CString
- FastFunction
- Future
- Hash
- Launcher
- Resource
- Stopwatch
- SuperFunctionalMap
- SuperMap
- SuperMutex
- SuperPair
- SuperResource
- SuperThread
- Interface
- Bitmap
- Camera
- Color
- Config
- Connection
- DelayedTask
- Display
- Downloader
- EventCustom
- Events
- EventTimer
- Font
- Logger
- Mixer
- PathManager
- Sample
- SmartFile
- Target
- Track
- Vertex
- Voice
- Work
- Block
- BubbleFX
- Button
- Collisioner
- GameCore
- ProgressBar
- ShineFX
- Sprite
- Text
- TextInput