Recent

Author Topic: Console Application - Opening a file or playing music?  (Read 5307 times)

nobodyknowsme

  • Full Member
  • ***
  • Posts: 114
Console Application - Opening a file or playing music?
« on: November 25, 2014, 09:19:33 pm »
Firstly, I'm going to go ahead and guess a console application can't play music you set to it. However could I get pascal (in a console application) to open the file? Making this play in the background?

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Console Application - Opening a file or playing music?
« Reply #1 on: November 25, 2014, 10:10:32 pm »
before Fred-VS sees this, I can suggest to look at OpenAL example.
Where console application plays music in the background.

nobodyknowsme

  • Full Member
  • ***
  • Posts: 114
Re: Console Application - Opening a file or playing music?
« Reply #2 on: November 25, 2014, 11:34:25 pm »
before Fred-VS sees this, I can suggest to look at OpenAL example.
Where console application plays music in the background.

What's openAL and may you link me an example for console applications playing music?

nobodyknowsme

  • Full Member
  • ***
  • Posts: 114
Re: Console Application - Opening a file or playing music?
« Reply #3 on: November 25, 2014, 11:37:06 pm »
before Fred-VS sees this, I can suggest to look at OpenAL example.
Where console application plays music in the background.

Even if it just repeats the same piece is music in the background. What would I need to install or do to do this??

Fred vS

  • Hero Member
  • *****
  • Posts: 3168
    • StrumPract is the musicians best friend
Re: Console Application - Opening a file or playing music?
« Reply #4 on: November 26, 2014, 01:52:20 am »
Quote
before Fred-VS sees this

Too late, i am here...  ;)

Hum, you may take a look at => https://github.com/fredvs/uos
=> Click on button [Download ZIP] in middle/right of page.

There is a console example => ~/uos/examples/consoleplay.lpi

Fre;D
« Last Edit: November 26, 2014, 02:03:38 am by Fred vS »
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

nobodyknowsme

  • Full Member
  • ***
  • Posts: 114
Re: Console Application - Opening a file or playing music?
« Reply #5 on: November 26, 2014, 03:14:45 pm »
Quote
before Fred-VS sees this

Too late, i am here...  ;)

Hum, you may take a look at => https://github.com/fredvs/uos
=> Click on button [Download ZIP] in middle/right of page.

There is a console example => ~/uos/examples/consoleplay.lpi

Fre;D

Will I have to install a plugin for this to work? If so where do I download the pascal plugin

Fred vS

  • Hero Member
  • *****
  • Posts: 3168
    • StrumPract is the musicians best friend
Re: Console Application - Opening a file or playing music?
« Reply #6 on: November 26, 2014, 06:29:34 pm »
Quote
Will I have to install a plugin for this to work? If so where do I download the pascal plugin

All you need is => Lazarus working.  ;)

After you have downloaded the ZIP file, unzip it.
Then, in Lazarus,  open project  =>  ~/uos/examples/consoleplay.lpi
Compile it and run it.

All is included in uos package, libraries and sources.

Fre;D
« Last Edit: November 26, 2014, 06:50:39 pm by Fred vS »
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

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Console Application - Opening a file or playing music?
« Reply #7 on: November 26, 2014, 06:45:49 pm »
Even if it just repeats the same piece is music in the background. What would I need to install or do to do this??
you'll have to have OpenAL installed on the system.
If you're using Windows (which I'm guessing you're), you'll need to have openal.dll in the Windows or at the application directory.
You should be able to get one from here

If you're using any Unix system, it's very likely you already have OpenAL installed. If not, refer to your distro manuals on how to install it (through apt-get or rpm packages or something else)

Never

  • Sr. Member
  • ****
  • Posts: 409
  • OS:Win7 64bit / Lazarus 1.4
Re: Console Application - Opening a file or playing music?
« Reply #8 on: November 26, 2014, 07:48:30 pm »
here a funy ex.
you can play this way videos as well
the pacage in the ex. is cross platform playsoundpackage from lazarus components
the demo is modified
Νέπε Λάζαρε λάγγεψων οξωκά ο φίλοσ'ς αραεύσε

 

TinyPortal © 2005-2018