使用PHP和MySQL处理音频文件! [英] Manipulating audio files using PHP and MySQL!

查看:179
本文介绍了使用PHP和MySQL处理音频文件!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的编码员和助手,

我是PHP新手,目前正在从事一个项目,需要将用户的音频片段存储到服务器上.我最近学习了如何将图像存储到服务器上.为此,我将图像链接存储到MySQL数据库中,而不是将实际图像存储在数据库中.但是我对任何音频剪辑都感到困惑,因为图像很容易在网页上显示,但是音频剪辑需要插件播放器来运行它们.因此,如果有人可以帮助我,那么他/她将非常好.

任何链接,任何文章或任何代码都将受到欢迎.

谢谢!

-

Dear Coders and Helpers,

I am new in PHP and currently working on a project in which I am required to store audio clips from users onto server. I recently learned how to store images onto server. For that I store Image link into MySQL database rather than storing actual image in the database. But I am confused to do the same for any audio clip because images are easy to display on the webpage but audio clips require plug-in players to run them. So, please if anyone can help me with this matter it would be very kind of him/her.

Any link, any article, or any code will be welcomed.

Thanx!

--
Coder in need!

推荐答案

如果您不熟悉PHP,为什么要在需要的项目上工作?哦,是的.外包.勇闯新世界,等等.

它的工作原理相同.您存储路径.要显示图像,您将渲染一个img标签,对吗?还是只是发送字节流并在其自己的页面上显示它?无论哪种方式,要使其正常工作,您都需要设置MIME类型.因此,您需要在数据库中添加一栏来告诉您文件的数据类型,然后根据该数据类型编写代码以显示不同的文件类型.有了此框架后,就可以将其用于视频,Office文档(如果您以Windows和IE为目标)等.
If you''re new to PHP, why would you be working on a project where you have a requirement ? Oh, that''s right. Outsourcing. Brave new world, etc.

It works the same. You store the path. To show an image, you''d be rendering an img tag, right ? Or just sending a byte stream and showing it on it''s own page ? Either way, for it to work you need to set a MIME type. So, you add a column to your DB that tells you the data type of the file, then based on that data type, you write code to show the different file types. Once you have this framework in place, you can use it for video, Office documents ( if you target Windows and IE ), etc.


这篇关于使用PHP和MySQL处理音频文件!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆