Skip to content
Alvaro Gallo edited this page Sep 17, 2021 · 5 revisions

How to's

Play Music:

  1. In your project setup, you should have the "assets_src" folder, that's where you put your assets in human formats.
  2. Make two folders inside "assets_src": "audio" and "audio_event".
  3. In "audio" you can put your files, but I prefer to make two folders inside "audio": "music" and "sfx".
  4. 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.
  5. 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. 6. Run halley-cmd import projDir halleyDir. 7. In your Stage make a member example: Halley::AudioHandle m_music. 8. In YourStage::Init() put this:

  // Stop things from previous Stage
  getAudioAPI().stopAllMusic();
  // Play some music
  m_Music = getAudioAPI().playMusic("music");```
9. Done!! your `m_music` will have some utilities to tweak your sounds.
Clone this wiki locally