{ Programa para tocar arquivos de som - versão simplificada }
{ Autor : José Antonio Borges  }
{ Em 1998 }

uses winProcs, wintypes, sysutils, mmsystem;
var
    nomearq: string;
    nomeDir: string;

begin
    if paramcount <> 1 then
        begin
            beep;
            exit;
        end;

    nomeArq := paramStr(1);
    while (nomeArq <> '') and (nomeArq[1] = ' ') do  delete (nomeArq, 1, 1);
    if pos ('.', nomeArq) = 0 then
        nomeArq := nomeArq + '.WAV';

    if pos ('\', nomearq) = 0 then
        begin
            getDir (0, nomeDir);
            if nomeDir [length (nomedir)] <> '\' then
                nomeDir := nomedir + '\';
            nomeArq := nomeDir + nomeArq;
        end;

    sndPlaySound (@nomearq[1], SND_SYNC);
end.
