need command line mp3/ogg player

need command line mp3/ogg player

Various things about Spring that do not fit in any of the other forums listed below, including forum rules.

Moderator: Moderators

User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

need command line mp3/ogg player

Post by BigHead »

I'm working on a dynamic music lua widget. Lua doesn't support mp3/ogg playback at the moment. However lua can launch external applications so command line player would make the widget possible (actually it's possible right now with my wav hack but the quality is awful).

I need the player to behave like this:

Code: Select all

>player playlist1
(plays random song from playlist1)
>player playlist2
(stops playing playlist1 and plays random song from playlist2)
>player -quit
(stops playback and quits the player)
*The syntax doesn't need to be so simple - it's just an example
Also being cross-platform and GPL compatibile would be a nice bonus.

I tried mplayer but it starts a second instance so I have two songs playing at one time.

Thanks for your suggestions!
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Post by Forboding Angel »

Have you tried http://www.videolan.org/ ?

Videolan is pretty much made of total win. Also it's OS.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Post by jK »

videolan and mplayer aren't usefull in this case, cause they are heavy in size and slow in startup, as well (iirc) they don't support single instancing (they don't send messages to a running instance).
So it has to be a very small (only some kB in size) commandline player without any video support.

perhaps mpg123?
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

mpg123 doesn't support song switching (single instance) so it can't be used :(
btw vlan does but it's way too slooow ...
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Post by Forboding Angel »

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Post by Forboding Angel »

An additional 5 seconds http://herrie.info/
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Post by Forboding Angel »

User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

linux only
An additional 5 seconds http://herrie.info/
linux only
download page no longer avaliable and propably linux only as well

2 hours on google
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Post by Neddie »

Plait isn't Linux only, I'm pretty sure.
User avatar
BrainDamage
Lobby Developer
Posts: 1164
Joined: 25 Sep 2006, 13:56

Post by BrainDamage »

they are both not linux-only, but since only the source is released, you'll have to build yourself a windows version

i might take a look @ cross-compiling one using mingw if there won't be and alternative

btw mpg123 SUPPORTS song switching
mpg123 -R
@R MPG123 (ThOr) v2
help
@HELP/H: command listing (LONG/SHORT forms), command case insensitve
@LOAD/L <trackname>: load and start playing resource <trackname>
@LOADPAUSED/LP <trackname>: load and start playing resource <trackname>
@PAUSE/P: pause playback
@STOP/S: stop playback (closes file)
@JUMP/J <frame>|<+offset>|<-offset>: jump to mpeg frame <frame> or change position by offset
@EQ/E <channel> <band> <value>: set equalizer value for frequency band on channel
@SEQ <bass> <mid> <treble>: simple eq setting...
@SILENCE: be silent during playback (meaning silence in text form)
@meaning of the @S stream info:
@S <mpeg-version> <layer> <sampling freq> <mode(stereo/mono/...)> <mode_ext> <framesize> <stereo> <copyright> <error_protected> <emphasis> <bitrate> <extension> <vbr(0/1=yes/no)>
@LOAD/L <trackname>: load and start playing resource <trackname>
maybe your version is too old? mine is 0.60
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Post by jK »

oh remote access is new in v0.6* :P

The only windows binary I found is v0.59: here

So if someone could compile/find a newer version for windows :roll:

PS: plait needs cygwin -> too much work for a luaUI music player ...
User avatar
SwiftSpear
Classic Community Lead
Posts: 7287
Joined: 12 Aug 2005, 09:29

Post by SwiftSpear »

Spring can play MP3 last time I checked... I'm not sure about OGG...
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Post by lurker »

SwiftSpear wrote:Spring can play MP3 last time I checked... I'm not sure about OGG...
seriously? as in it can play them in certain situations or as in mp3s can be used for all sound effects?
User avatar
SwiftSpear
Classic Community Lead
Posts: 7287
Joined: 12 Aug 2005, 09:29

Post by SwiftSpear »

lurker wrote:
SwiftSpear wrote:Spring can play MP3 last time I checked... I'm not sure about OGG...
seriously? as in it can play them in certain situations or as in mp3s can be used for all sound effects?
As I understand it there is a playsound command modders currently bind into unit scripts and what not... Maby I was assuming wrong but I figured it should be possible to just use a lua based list of files and feed data to the playsound command which would then play the songs in spring. All the controls would be issued via lua but functionality spring already has would do the work.
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Post by SinbadEV »

I would use video lan and one of the alternative interfaces.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Post by knorke »

User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

:roll:

I thought I'd try foobar but discovered that spring implementation of lua doesn't support os.execute() command. This means that you can't run external apps from luaUI.

Thanks for your help anyway!

SwiftSpear: Are you sure about that playsound command? Anyway it would only be useful if there was stopsound command as well. Can anyone clear this for me (us)?
User avatar
SwiftSpear
Classic Community Lead
Posts: 7287
Joined: 12 Aug 2005, 09:29

Post by SwiftSpear »

BigHead wrote::roll:

I thought I'd try foobar but discovered that spring implementation of lua doesn't support os.execute() command. This means that you can't run external apps from luaUI.

Thanks for your help anyway!

SwiftSpear: Are you sure about that playsound command? Anyway it would only be useful if there was stopsound command as well. Can anyone clear this for me (us)?
From what I understand everything needed for MP3s is there. Playsound, stopsound, and volume control. I don't think there are controls to execute sounds part way through a track, but I can only think of very very few soundtrack implementations that need it...

Sorry I can't be more clear, I could be totally wrong, this is just stuff I was garnishing out of random development forum threads...

http://spring.clan-sy.com/phpbb/viewtopic.php?t=11643

Browse through that thread and see if you can find something helpful... It has some lua playsound scripts...
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

Nope, the thread is about Spring.PlaySoundFile() which plasy .wav files and can't stop the sound once it started. It's also the method I use in my hack.

Dynamic music widget I think we're loosing you ... :(

*edited spelling*
Last edited by BigHead on 03 Oct 2007, 11:34, edited 1 time in total.
User avatar
SwiftSpear
Classic Community Lead
Posts: 7287
Joined: 12 Aug 2005, 09:29

Post by SwiftSpear »

mmm, I misunderstood then...

So likely we need an engine patcher on board to add the necessary MP3 and ogg stuff to spring then :(
Locked

Return to “General Discussion”