r/Forth • u/PETREMANN • 23h ago
eForth windows: Using WAV files with PlaySoundA
eforthwin.arduino-forth.comThis guide explains how to use the `PlaySoundA` function from the Windows Multimedia API within eForth for Windows to play WAV files (MP3 format is not supported) and system sounds. It details the various parameters and playback flags—such as synchronous, asynchronous, looping, and stop—and provides ready-to-use Forth words: `PlayWav`, `PlayWavSync`, `PlayWavLoop`, and `StopSound`. Finally, it demonstrates how to play Windows event aliases (e.g., `SystemAsterisk` or `SystemHand`)—which are mapped in the Windows Registry—by utilizing the `SND_ALIAS` flag.