-
Notifications
You must be signed in to change notification settings - Fork 163
How to?
Alvaro Gallo edited this page Jan 10, 2022
·
5 revisions
- In your project setup, you should have the "assets_src" folder, that's where you put your assets in human formats.
- Make two folders inside "assets_src": "audio" and "audio_event".
- In "audio" you can put your files, but I prefer to make two folders inside "audio": "music" and "sfx".
- Once you have your audio files inside "audio", go to "audio_event" folder and create a YAML file called as you would refer after in your code.
- Put these contents inside your yaml file:
---
actions:
- type: play
clips: [ music/music.ogg ]
loop: false
...
This file contains an action and has a clip called music.ogg, inside "assets_src/audio/music", and it sets the music not loop.
- Run
halley-cmd import projDir halleyDir
. - In your Stage make a member example:
Halley::AudioHandle m_music
. - In
YourStage::Init()
put this:
// Stop things from previous Stage
getAudioAPI().stopAllMusic();
// Play some music
m_music = getAudioAPI().playMusic("music");
- Done!! your
m_music
will have some utilities to tweak your sounds.