Is there any solution for converting Wav to Ogg or MP3 by using pure PHP?
Technically it’s possible. But what about ready-made libraries?
Im talking about 1-7 sec wav.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Writing this in pure PHP will melt your brain for sure. That said, you can create a PHP extension wrapper around ffmpeg if you know enough C. That would probably be the most optimal.
Alternatively, you can just use
exec()unless you want to distribute your code and hate to have this as a (reasonable) dependency.In both cases you would need to have a working ffmpeg library installed on the server.
Disclaimer
I didn’t read this answer before writing my own 🙂