[fpc-devel] TProcess and mpg123/321 issues

Michael Van Canneyt michael at freepascal.org
Tue Dec 13 21:56:04 CET 2005

On Tue, 13 Dec 2005, Alexander Todorov wrote:

> Hi,
> I have a GUI application created with Lazarus and I need to let users
> play some mp3 files.
> I have the following Button.OnClick
> -----------------------------------------------------
> begin
>   pMusic.CommandLine := 'mpg123 /home/user/song.mp3';
>   pMusic.Active := true;
>   while pMusic.Running then Application.ProcessMessages;
>   ShowMessage('Done');
> end.
> -----------------------------------------------------
> pMusic is a TProcess component dropped on the form. It is set not to
> wait the executed application because that hangs up the whole gui app.
> If I try to run mpg321 the process is created (the ShowMessage is
> executed after some time) but no music is played.
> With mpg123 all is fine.
> N.B. I mean the two different packages mpg123 and mpg321, not the
> symbolic link created during the installation.
> Does anyone have a clue what's causing this behaviour ???

Sounds like a permission problem or the lack of a console for mpg321.

try running

mpg321 /home/user/song.mp3 >/dev/null 2>&1

from a console, and see if that works.


More information about the fpc-devel mailing list