By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,967 Members | 1,687 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,967 IT Pros & Developers. It's quick & easy.

PHP & sound system

P: n/a
Hello,

I want to build a php based webserver that can act as a playlist
editor and play mp3's through the sound system on the server through
an itrip like device that will allow it to be picked up on fm radios
around the house.

I've got the whole thing sorted apart from the minor point of
accessing the sound system!?!

I'm guessing I will have to have some third party app that can act as
a go between the php and the sound system but I can't seem to find
anything that will do this.

I thought about writing the lot in .net but I was wanting to keep it
cross-platform if possible....

Anyone got any ideas.

W33B

May 1 '07 #1
Share this Question
Share on Google+
7 Replies


P: n/a
w33bster wrote:
I'm guessing I will have to have some third party app that can act as
a go between the php and the sound system but I can't seem to find
anything that will do this.
Assuming that the audio is stored in files on the server. (e.g. MP3s,
OGGs, etc) you could use the PHP system() function to launch command-line
programs to play the files. There are various non-interactive command-line
audio players available, such as mpg123, ogg123, etc.

--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python/Apache/Linux
May 1 '07 #2

P: n/a
C.
On 1 May, 09:50, w33bs...@googlemail.com wrote:
Hello,

I want to build a php based webserver that can act as a playlist
editor and play mp3's through the sound system on the server through
an itrip like device that will allow it to be picked up on fm radios
around the house.

I've got the whole thing sorted apart from the minor point of
accessing the sound system!?!
I suspect it may be easier to attach a player to a streaming source
generated with php than trying to control the player via PHP (but I
believe mplayer and amarok do provide runtime control APIs). A quick
googloe suggests lots of prewritten stuff.

HTH

C.

May 1 '07 #3

P: n/a
Toby A Inkster <us**********@tobyinkster.co.ukwrites:
w33bster wrote:
>I'm guessing I will have to have some third party app that can act as
a go between the php and the sound system but I can't seem to find
anything that will do this.

Assuming that the audio is stored in files on the server. (e.g. MP3s,
OGGs, etc) you could use the PHP system() function to launch command-line
programs to play the files. There are various non-interactive command-line
audio players available, such as mpg123, ogg123, etc.
Which would ruin his desire for cross platform I think?
May 1 '07 #4

P: n/a
Toby A Inkster wrote:
Assuming that the audio is stored in files on the server. (e.g. MP3s,
OGGs, etc) you could use the PHP system() function to launch command-line
programs to play the files. There are various non-interactive command-line
audio players available, such as mpg123, ogg123, etc.
PS: See also http://tobyinkster.co.uk/article/jukebox/

It's a Linux/GTK2 media player written in Perl. Only supports OGG files,
but adding support for other formats wouldn't be too difficult.

More to the point though, it provides a TCP/IP interface, so your PHP
script could open a connection to localhost:5853 and send commands like:

list
(retrieves list of available songs, each with a number)
play 55
(plays number 55 from above list)
vdown
(lower volume 10%)

--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python/Apache/Linux
May 1 '07 #5

P: n/a
rf
<w3******@googlemail.comwrote in message
news:11*********************@p77g2000hsh.googlegro ups.com...
Hello,

I want to build a php based webserver that can act as a playlist
editor and play mp3's through the sound system on the server
You want to play sound on the server? There is nobody there in the rack room
to listen to it.
I thought about writing the lot in .net but I was wanting to keep it
cross-platform if possible....
If it is on the server then cross-platform is irrelevant.

--
Richard.
May 1 '07 #6

P: n/a
On May 1, 1:07 pm, Toby A Inkster <usenet200...@tobyinkster.co.uk>
wrote:
Toby A Inkster wrote:
Assuming that the audio is stored in files on the server. (e.g. MP3s,
OGGs, etc) you could use the PHP system() function to launch command-line
programs to play the files. There are various non-interactive command-line
audio players available, such as mpg123, ogg123, etc.

PS: See alsohttp://tobyinkster.co.uk/article/jukebox/

It's a Linux/GTK2 media player written in Perl. Only supports OGG files,
but adding support for other formats wouldn't be too difficult.

More to the point though, it provides a TCP/IP interface, so your PHP
script could open a connection to localhost:5853 and send commands like:

list
(retrieves list of available songs, each with a number)
play 55
(plays number 55 from above list)
vdown
(lower volume 10%)

--
Toby A Inkster BSc (Hons) ARCShttp://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python/Apache/Linux
mplayer is a cross platform and command line.
vlc has remote control support via a few methods, telnet etc... and is
virtually what you want already. A streaming player that can sit on
the server, and broadcast anywhere else, via UDP TCP etc... or just
play locally for your itrip to pick up.
a quick exec or system call, or telnet session and your there. whether
you have written a pure php web server, or are writing code that will
be running as a module in apache/iss etc..

May 1 '07 #7

P: n/a
rf wrote:
w3******@googlemail.com wrote:
>I want to build a php based webserver that can act as a playlist
editor and play mp3's through the sound system on the server

You want to play sound on the server? There is nobody there in the rack
room to listen to it.
It is more sensible than you think. I have written such a thing -- see the
link I posted earlier -- though mine uses a telnet interface, not a
browser based one.

The server isn't kept in a rack room -- it's kept in your living room,
with big speakers attached. You can queue songs up on the playlist from
any device with a TCP/IP connection and a telnet client. This can include
mobile phones, wireless laptops, etc.

w33bster goes one step further by then having his server broadcast its
sound on a very short-range FM signal, so that he can tune radios in other
rooms in his house into the same music. Sounds like a cool idea to me!

--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python/Apache/Linux
May 1 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.