User Tools

Site Tools


development:csdk:2.0:headers:music

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
development:csdk:2.0:headers:music [2024/11/20 21:13] – clydedevelopment:csdk:2.0:headers:music [2026/09/16 23:36] (current) – [play_sound_effect] clyde
Line 5: Line 5:
 void init_music(); void init_music();
 </code> </code>
 +This should only need to be called once, after ''init_audio_coprocessor()'' and before doing any music or sound effects.
 ==== play_song ==== ==== play_song ====
 <code C> <code C>
Line 19: Line 20:
 char tick_music(); char tick_music();
 </code> </code>
 +Call this once per frame, ideally shortly after ''await_vsync()''
 ==== play_sound_effect ==== ==== play_sound_effect ====
 <code C> <code C>
Line 26: Line 28:
  
 ''channel'' gives the channel number to play the sound effect on, but also the priority. ''channel'' gives the channel number to play the sound effect on, but also the priority.
-The channel used is the lower two bytes of ''channel'' while the priority used is given by the upper four bytes of ''channel''.+The channel used is the lower two bits of ''channel'' while the priority used is given by the upper four bits of ''channel''.
 ==== stop_music ==== ==== stop_music ====
 <code C> <code C>
development/csdk/2.0/headers/music.1732137186.txt.gz · Last modified: 2024/11/20 21:13 by clyde