are there any audio handling functions in php?

Computer builds, hardware and software discussion or troubleshooting, including peripherals. Essentially a general place to talk about desktop computers.
Locked
Master of Puppets_it
Posts: 15
Joined: Tue Feb 24, 2004 6:54 pm

are there any audio handling functions in php?

Post by Master of Puppets_it »

Me and a friend are starting on this online media player/library kinda thing, and i've got the idea in my head how i'm gonna do it, but it would require too much reloading of the media player page(too much being any at all).

Does anyone know a library of audio handling functions or something of the sort? or maybe know if there are already some functions that could help me. I need to find the length of the song, and hopefully there are already functions for play and stop, because thats where i would have to reload. I have no clue how i'm gonna implement the rewinding or fastfowarding though. I wouldnt know if this is a stupid question, but i'm jus starting to get into php, so sorry if so. All comments appreciated(except negative or otherwise not helpful). Thanks in advance.

Archived topic from Iceteks, old topic ID:2225, old post ID:18751
Chris Vogel
Posts: 5140
Joined: Fri Jan 10, 2003 1:14 am

are there any audio handling functions in php?

Post by Chris Vogel »

Playback and stop? Thinking about how PHP works, I don't see how that's possible. I don't think there are any audio functions. You can check for yourself, but I doubt you will find anything.

To do what you want, I think the best thing to do would be to make use of a media player plug-in. This means that users would have to have that plug-in to utilise your site like you intended, but it seems to be the only way...

Archived topic from Iceteks, old topic ID:2225, old post ID:18752
User avatar
Red Squirrel
Posts: 29206
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

are there any audio handling functions in php?

Post by Red Squirrel »

Yeah php is more of a one time run scripting language and not interactive. Youwould need a plug in or maybe something made with flash, for better compatibility.

Archived topic from Iceteks, old topic ID:2225, old post ID:18753
Honk if you love Jesus, text if you want to meet Him!
Chris Vogel
Posts: 5140
Joined: Fri Jan 10, 2003 1:14 am

are there any audio handling functions in php?

Post by Chris Vogel »

Red Squirrel wrote: Yeah php is more of a one time run scripting language and not interactive. Youwould need a plug in or maybe something made with flash, for better compatibility.
FLASH! I forgot all about that. It's a very common plug-in, and it's probably the safest to use. :)

Archived topic from Iceteks, old topic ID:2225, old post ID:18754
Master of Puppets_it
Posts: 15
Joined: Tue Feb 24, 2004 6:54 pm

are there any audio handling functions in php?

Post by Master of Puppets_it »

i think i was a little unclear in what i said the first time.

i didnt mean i was gonna use a function php already has; i was pretty sure that was non-existant. By using the <embed> and <bgsound> tag, i'm going to make users able to play files from their computer by
<embed src=file://$song>. I can do this on mine, for i already know the path to all my files, but i need to be able to find the path of files that are inputted into an add song form. Again, due to my 'quest' into php starting just recently, i'm not for sure how to do this yet. I know when you put <input type=file>, a browse button is there so the user can browse his/her/its computer for files, but i dont wanna upload the file, i just want a string that is the path to it, so when a file is clicked in the music library, it opens a pop-under window that has <embed src=file://$song autorun=true hidden=true> on it, so it will play the file. The reloading i spoke of in the previous post would be playing of new songs or stopping, which would be
fopen('play.php','w') and then a window.location='play.php'; so as to make the file empty, stopping the playback, or starting playback of a different song. Can someone help me with the filepath thing? I need the browse button there, but i dont need the file.

That was a whole lot of stuff, so i hope it wasnt too confusing to read. Help is appreciated.
Also, i wanna do this in JavaScript in PHP, so a plug-in isn't required, no matter how common. Thanks anyway

Archived topic from Iceteks, old topic ID:2225, old post ID:18780
User avatar
Red Squirrel
Posts: 29206
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

are there any audio handling functions in php?

Post by Red Squirrel »

You need to put the file on your webspace, or you can use one of the standard windows sounds and link to the windows folder, but even then, sometimes it's windows sometimes it's winnt. Also, those functions don't work in standard browsers. Not sure why they don't standardlize that though, but just to let you know it will only work in IE, unless there's something I do wrong when I try it. :unsure:

Archived topic from Iceteks, old topic ID:2225, old post ID:18781
Honk if you love Jesus, text if you want to meet Him!
Master of Puppets_it
Posts: 15
Joined: Tue Feb 24, 2004 6:54 pm

are there any audio handling functions in php?

Post by Master of Puppets_it »

the purpose of this is for multiple users to be able to login and have their music libraries and playlists loaded if existent, and to be able to add to them. There will be the index, and then it will interpret the playlist and music library files so the file://yada-yada-yada is on that person's machine. it could take up a lot of space, but i doubt many people will sign up with it, at least not at first. the text file that it would interpret/get info from(i havent decided yet) would have a list of info including file://yada so that the file it would be refering to is on that particular persons cp. when me and my friend get it up, i think it'll be pretty cool.

what browser do you use? i'm using mozilla firefox on suse, and it works. if you're also using firefox, try MozPlugger.

Archived topic from Iceteks, old topic ID:2225, old post ID:18782
User avatar
Red Squirrel
Posts: 29206
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

are there any audio handling functions in php?

Post by Red Squirrel »

For this you could simply use php with a mysql database with links to the files maybe. Basically the same idea as listing the topics of a forum, but for music.

Archived topic from Iceteks, old topic ID:2225, old post ID:18894
Honk if you love Jesus, text if you want to meet Him!
Locked