development:csdk:1.0:music
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
development:csdk:1.0:music [2024/11/08 01:57] – removed - external edit (Unknown date) 127.0.0.1 | development:csdk:1.0:music [2024/11/08 01:57] (current) – ↷ Page moved from development:csdk:music to development:csdk:1.0:music clyde | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Importing and Playing Music ====== | ||
+ | |||
+ | Just like for graphical assets, sound assets need to be stored in the '' | ||
+ | |||
+ | There are two types of sounds that can be played on the GameTank: | ||
+ | |||
+ | * Songs | ||
+ | * Sound Effects (SFX) | ||
+ | |||
+ | ===== Enabling sounds ===== | ||
+ | |||
+ | Enabling sounds requires the following in C: | ||
+ | |||
+ | * Add ''# | ||
+ | * Call '' | ||
+ | * Call '' | ||
+ | |||
+ | e.g. | ||
+ | |||
+ | init_dynawave(); | ||
+ | init_music(); | ||
+ | | ||
+ | while (1) { | ||
+ | // start a sound | ||
+ | await_draw_queue(); | ||
+ | sleep(1); | ||
+ | flip_pages(); | ||
+ | tick_music(); | ||
+ | } | ||
+ | |||
+ | ===== Songs ===== | ||
+ | |||
+ | Songs are imported from MIDI files and are called using '' | ||
+ | |||
+ | #include " | ||
+ | play_song(& | ||
+ | |||
+ | ===== Sound Effects (SFX) ===== | ||
+ | |||
+ | SFX are mini-sample '' | ||
+ | |||
+ | #include " | ||
+ | play_sound_effect(& | ||