Converting C to PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Laban
Forum Newbie
Posts: 5
Joined: Mon Jul 14, 2003 6:11 pm
Location: Sweden

Converting C to PHP

Post by Laban »

Hello World!

I want to encode/decode Mp3's (among other formats) using PHP. I'm thinking about recoding libLAME to native PHP... or is there a better solution? I want this thing to work on a bunch of different platforms.

The thing is that I'm making a shoutcast/icecast compatible radiobroadcaster in PHP.

Interested?
Website: http://stream.lan2k.org
!ERAU QSSI DLRO WEHT
qartis
Forum Contributor
Posts: 271
Joined: Sat Dec 14, 2002 4:43 pm
Location: BC, Canada
Contact:

Post by qartis »

Sounds like a really cool project; I've often thought of how nice it would be to have pure-php audio broadcasting. If you need any help, just ask :)
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Maybe you could compile the C code as an extension for PHP?

Mac
Tubbietoeter
Forum Contributor
Posts: 149
Joined: Fri Mar 14, 2003 2:41 am
Location: Germany

Post by Tubbietoeter »

how about java?
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

sounds cool
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post by Stoker »

the only feasable way is sort of what twiglet suggested; Create a PHP extension that uses exisiting libraries..
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post by m3rajk »

Tubbietoeter wrote:how about java?
that's possible. well to make it in java. a friend of mine did that as a project for a class. was able to get mp3 and wavs to play in the time he had. but what they're talking about, i think the most feasable thing iswhat twiglemac suggested
Tubbietoeter
Forum Contributor
Posts: 149
Joined: Fri Mar 14, 2003 2:41 am
Location: Germany

Post by Tubbietoeter »

i didnt even know that was possible ... (what twigle said)
you got any links or some other info on that (I'm just curious ...)
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

It's hidden away at the end of the manual:
Chapter 25. Extension Possibilities - External Modules

Mac
User avatar
Laban
Forum Newbie
Posts: 5
Joined: Mon Jul 14, 2003 6:11 pm
Location: Sweden

Post by Laban »

Great to hear that there are people interested in this :D

Compiling C-libraries to extentions is a good way. I'm guessing they will have better performance then raw php code. However, there commes the compability issue I belive. Since they are compiled they must be made to support the different systems.

I don't think that's such a big deal since it won't be used on so many different systems (I think :P). Linux/BSD/Windows are the ones I've thought about.
!ERAU QSSI DLRO WEHT
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post by Stoker »

..and remember patent and library licensing etc, as far as I know mp3 is not really free, so you may have to do something along the line as the PDF functionality for PHP, the libs are not free, the PHP extension to use the libs are..
User avatar
Laban
Forum Newbie
Posts: 5
Joined: Mon Jul 14, 2003 6:11 pm
Location: Sweden

Post by Laban »

Perhaps we should use OGG to stream out then...
!ERAU QSSI DLRO WEHT
Post Reply