OpenSNES
Modern Open-Source SNES Development SDK
Loading...
Searching...
No Matches
main.c File Reference

One-shot sound effects from WAV files — the wav2brr pipeline. More...

#include <snes.h>
#include <snes/audio.h>
#include <snes/input.h>
#include <snes/text.h>

Macros

#define SMP_BLIP   0
#define SMP_COIN   1

Functions

int main (void)

Variables

u8 blip_brr []
u8 blip_brr_end []
u8 coin_brr []
u8 coin_brr_end []

Detailed Description

One-shot sound effects from WAV files — the wav2brr pipeline.

The smallest "press a button, hear a sound" example, and a showcase of the zero-config .wav -> .brr build rule: res/blip.wav and res/coin.wav are plain PCM WAV files. data.asm .incbin's them as blip.brr / coin.brr, and the build system converts each with wav2brr automatically — no .brr is committed, they are generated on demand like a .pic from a .png.

See docs/tutorials/audio.md ("One-shot samples from WAV") and tools/wav2brr for the converter.

Init order: textModeInit (display), audioInit, load samples, setScreenOn. Modules: console, dma, audio, input, background, text.

See also
lib/include/snes/audio.haudioLoadSample / audioPlaySample

Macro Definition Documentation

◆ SMP_BLIP

#define SMP_BLIP   0

◆ SMP_COIN

#define SMP_COIN   1

Function Documentation

◆ main()

int main ( void )

Variable Documentation

◆ blip_brr

u8 blip_brr[]
extern

◆ blip_brr_end

u8 blip_brr_end[]

◆ coin_brr

u8 coin_brr[]
extern

◆ coin_brr_end

u8 coin_brr_end[]