Anybody got more RPI example code? For FPC 3.0 to edit with nano on the command line? --> No lazarus
1) Run
nano and paste this (with right path, of course):
program playconsole;
{$mode objfpc}{$H+}
uses
SysUtils, Classes, Process ;
procedure playsound ;
var
AProcess : TProcess;
begin
AProcess := TProcess.Create(nil);
AProcess.FreeOnRelease;
AProcess.Executable := '/path/of/sound_player' ; // path of sound-player (ffplay or omxplayer or other player)
AProcess.Parameters.Add('/path/of/sound_file.mp3') ; // path of sound-to-play
AProcess.Execute;
end;
begin
playsound;
end.
2) Save it as
playconsole.pas3) In console, compile it with:
fpc /path/of/playconsole.pas4) in console, run it with:
/path/of/playconsoleFre;D