Recent

Author Topic: RunCommand mpg123 doesn't work  (Read 1326 times)

Mario

  • New Member
  • *
  • Posts: 30
RunCommand mpg123 doesn't work
« on: June 26, 2024, 11:09:31 pm »
Hi,

(I hope this is the right place to ask)

So as the subject says,

Code: Pascal  [Select][+][-]
  1. RunCommand('mpg123', ['audio.mp3'], s);

(with appropriate s) does not produce any audio, while running

Code: Bash  [Select][+][-]
  1. mpg123 audio.mp3

works fine. Any hints on how I could get it to work? It's Lazarus 3.4 with fpc 3.2.2 on latest Debian stable.

Any help greatly appreciated!

Mario

PS: This is a console application, and should stay that way for now.

Fred vS

  • Hero Member
  • *****
  • Posts: 3410
    • StrumPract is the musicians best friend
Re: RunCommand mpg123 doesn't work
« Reply #1 on: June 26, 2024, 11:44:29 pm »
Hello.

This work here on XUbuntu 22.04:
Code: Pascal  [Select][+][-]
  1. program mpg123_test;
  2. uses
  3.   process;
  4. var
  5.   s : ansistring;
  6. begin
  7.   RunCommand('mpg123', ['audio.mp3'], s);
  8. end.

Maybe try with the full path:
Code: Pascal  [Select][+][-]
  1. RunCommand('/usr/bin/mpg123', ['audio.mp3'], s);
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

TRon

  • Hero Member
  • *****
  • Posts: 3623
Re: RunCommand mpg123 doesn't work
« Reply #2 on: June 27, 2024, 02:03:52 am »
@mario:
What is the contents of s when the command "does not produce any audio, while running" ?
« Last Edit: June 27, 2024, 02:06:54 am by TRon »
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

Mario

  • New Member
  • *
  • Posts: 30
Re: RunCommand mpg123 doesn't work
« Reply #3 on: June 27, 2024, 12:26:08 pm »
I must apologize. I had the path to the file wrong. mpg123 seems to not print anything to stdio, only to stderr, while mplayer just says "end of file" if it doesn't find it.

Sorry.

TRon

  • Hero Member
  • *****
  • Posts: 3623
Re: RunCommand mpg123 doesn't work
« Reply #4 on: June 28, 2024, 03:34:29 am »
...
Sorry.
No problem. It happens to the best of us  :) Thank you for letting us know  8-)
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

 

TinyPortal © 2005-2018