Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2005-12

TProcess and mpg123/321 issues

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Alexander Todorov

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 ???

Reply by email

Michael Van Canneyt
to Alexander Todorov
Alexander Todorov wrote 26 lines
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.

Michael.

Reply by email