AntonioND / gbt-player

A music player library for the PSG audio channels of the GB, GBC and GBA.
MIT License
281 stars 20 forks source link

Request: play sound effect example #23

Closed GValiente closed 1 year ago

GValiente commented 1 year ago

It would be nice to have a proper example of playing sound effects with gbt-player.

From gbadev Discord server:


you can do something like

    disable channel 4 from the player
    play sound effect
    wait until it's done
    enable channel 4
AntonioND commented 1 year ago

Actually, I've just checked and there is something like that already: https://github.com/AntonioND/gbt-player/tree/4ee745f848d1aa610529aca0043f91cbc7d9ef6f/gba/examples/disable_channels

This example lets you play a sound effect in channel 2, and it lets you experiment with disabling the channel or not so that you can see that the sound effect can be interrupted if the channel is enabled. Is this good enough for you, or would you prefer a more explicit example? It would do basically the same thing.

GValiente commented 1 year ago

It seems good enough, thanks.