473,396 Members | 1,966 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

PHP & sound system

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
7 2936
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: MLH | last post by:
Edit, Insert Object & choose Wave Object, the following OLE object thing gets inserted onto the form... Microsoft Sound Recorder Version 5.1 (Build 2600.xpsp2.030422-1633: Service Pack 1)...
1
by: Marco Krechting | last post by:
Hi All, I have a database with the timer function set to warn the user that arecord is due to expire. Is there a Win API that I can use so a loud warning will go off. Not this simpel beep in...
1
by: Mathias Goldau | last post by:
Hi, Can someone tell me where I find some material (e.g. a compiler with graphics.h and conio.h (for free)) related to graphic programming BGI-like, and sound programming (not PC-speaker). The...
4
by: Robert Gravereaux | last post by:
I'm putting together a C# .Net forms project on win2k. The application requires some sort of horn sound. I've never implemented any audio in .Net, so I'm not sure how best to accomplish this. ...
0
by: June Li | last post by:
H I got a problem with detecting sound card with Windows xp I am working on an application to test microphone. First I need detect if there is a sound card installed (or integrated audio...
1
by: John_H | last post by:
Re: ASP.NET 2.0 I would like suggestions or code examples on how to collect a variable length list of input data (item# & item quantity specifically). I thought that I could accomplish this...
13
by: Pohihihi | last post by:
Hello All, I guess I will be just ranting now. Few weeks back I had an interview with one of the groups in Microsoft for SDE. I was not selected and I am kind of upset on the *reason* I found why...
10
by: Immortalist | last post by:
Various aquisition devices that guide learning along particular pathways towards human biases. And as E.O. Wilson might say mental development appears to be genetically constrained. (1) Language...
6
by: =?Utf-8?B?VmVybm9uIFBlcHBlcnM=?= | last post by:
I have an application that is designed for using with a bar code scanner. I want the user to know that the scan was complete and the data was entered, so I am playing a system sound after data...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.