SFSOUND v1.0
============
A tiny, config-driven WAV player for Windows.

WHAT IT IS
----------
sfsound.exe reads the path to a .wav file out of a plain text
config file, plays that file, and exits. That's the whole program.

It was originally built to give a DOS-era BBS (Spitfire) a way to
play a specific sound on caller logon, without depending on
Windows' system Sound Scheme events (the old trick of sending a
BEL character to trigger a mapped Windows sound - which has the
side effect of also firing on unrelated system events).

There's nothing BBS-specific about it though. Anything that can
shell out to an .exe and wants to fire off a distinct sound - a
batch file, a scheduled task, a script, another legacy DOS/16-bit
app, a monitoring tool, whatever - can use it the same way.

FILES
-----
  sfsound.exe    The program. Statically linked 32-bit Windows
                 console binary. No installer, no dependencies
                 beyond DLLs that already ship with Windows
                 (kernel32.dll, msvcrt.dll, winmm.dll).
  sfsound.c      Full C source, in case you want to modify it
                 (MinGW-w64, compiles as a plain console app).
  sfsound.cfg    Example config file.
  logon.wav	 Example logon wav file. Place in c:\sf\

USAGE
-----
Good places to call the program: c:\sflogon.bat, c:\sfsec*.bat.

  sfsound.exe
      Looks for "sfsound.cfg" in the same folder as the exe.

  sfsound.exe <path-to-cfg>
      Uses the config file you specify instead. This lets one
      copy of sfsound.exe serve multiple purposes - point
      different callers at different .cfg files, each with its
      own .wav path, e.g.:

        sfsound.exe C:\sounds\alert.cfg
        sfsound.exe C:\sounds\logon.cfg
        sfsound.exe D:\app\notify.cfg

CONFIG FILE FORMAT
-------------------
Plain text. The first non-blank, non-comment line is used as
the path to the .wav file. Lines starting with # or ; are
treated as comments and skipped. Surrounding quotes and
trailing whitespace are stripped automatically.

Example:

  # sound to play
  C:\sounds\notify.wav

BEHAVIOR
--------
- Playback is synchronous: sfsound.exe blocks until the WAV
  finishes playing, then exits. For short sound effects this is
  typically well under a second, and whatever called it (a batch
  file, a login sequence, a script) resumes immediately after.
- SND_NODEFAULT is set, so if the .wav can't be found or played,
  it fails silently and exits with a non-zero code rather than
  falling back to the Windows default beep or popping an error
  dialog.

EXIT CODES
----------
  0   Played successfully
  1   Could not open the config file
  2   Config file had no usable path in it
  3   The .wav file referenced by the config does not exist
  4   PlaySound failed for some other reason

BUILDING FROM SOURCE
---------------------
Cross-compiled on Linux with mingw-w64, targeting 32-bit Windows
for maximum compatibility with older systems:

  i686-w64-mingw32-gcc -O2 -Wall -o sfsound.exe sfsound.c -lwinmm -static

The -static flag avoids any dependency on the mingw runtime DLLs,
so the resulting exe only needs DLLs already present on a stock
Windows install.

LICENSE
-------
Public domain / do whatever you want with it. No warranty.
