// wav file:
int8_t [const] char* filename [, bool loop = false] )
// pattern:
int8_t [const] uint16_t* pattern [, bool loop = false] )
// raw buffer:
int8_t [const] uint8_t* buffer [, uint32_t length] [, bool loop = false] )
// custom handler:
int8_t Sound_Handler* handler [, bool loop = false] ) will start playing sound from various sources. They return a track identifier or -1 if failed (no available channel).

  • Wav file Plays an 8-bit unsigned wav file with a bitrate of 44.1kHz (max. sound frequency of 22050Hz)
  • Pattern Plays a pattern
  • Raw Buffer Plays a raw unsigned 8-bit buffer. The length of the buffer is determined automatically. If that fails (as in, your program won't compile) manually specify the length.
  • Custom Handler Play a custom sound handler


  • (mixed) source: see above
  • bool loop: if true the sound will loop over and over forever


int8_t: track identifier on success or -1 on failure


#include <Gamebuino-Meta.h>

void setup() { gb.begin(); }

void loop() { while(!gb.update()); if (gb.buttons.pressed(BUTTON_A)) { // let's play TEST.WAV from the sd card!"TEST.WAV"); } }