php / html网页中的背景音乐 [英] Background music in a php/html webpage

查看:236
本文介绍了php / html网页中的背景音乐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用iPhone将一段钢琴音乐录制为.m4a格式。我想砍它,并将其转换成合适的格式,以用作php / html网站中的背景音乐。



我有以下问题: -
1.什么样的格式是最好的(例如mp3,WAV等)?
2.我应该砍掉.m4a,然后转换,还是将其转换为另一种格式然后切割?
3.我是否可以将该文件应用于网页,以产生循环效果?但我担心,每次刷新后,音乐可能会从一开始就播放,这是不希望的。



非常感谢!

解决方案

一般来说,在您的网站上放置循环音乐是个不错的主意。 95%的访问网站的人喜欢控制正在播放的媒体。而不是嵌入,它可能是一个好主意,包括一个JavaScript插件,用户可以用它来控制歌曲的音量和寻找位置。大多数插件允许您在加载页面时自动启动歌曲,这可以让您获得与嵌入歌曲相同的效果(我仍然建议不要自动启动,但它是您的页面)。

过去我使用过的一个成功的插件是 http://www.jplayer。组织。它允许音频和视频播放。它也适用于.m4a文件,所以你不需要转换任何东西。



如果你想让音乐连续播放而不是每次访问进入一个新的页面,你将不得不考虑使用iframe来保存你的网站的内容。


I used an iPhone to record a piece of piano music as .m4a format. I would like to chop it and convert it into a suitable format to be used as the background music in a php/html website.

I have the following questions:- 1. what kind of format is the best (e.g. mp3, WAV, etc)? 2. shall I chop the .m4a followed by conversion, or shall I convert it to another format then chop? 3. may I just apply the file in the webpage, to produce a looping effect? but I worry about, after each refresh, the music may play from the beginning which is not desired.

Thanks a lot!!

解决方案

Generally speaking, it's a bad idea to have looping music on your website. 95% of people that visit websites like to have control over media that is playing. Rather than embedding, it may be a good idea to include a javascript plugin which users can use to control the song's volume and seek position. Most plugins allow you to auto-start a song when the page loads, which would allow you to have the same effect as embedding the song (I still recommend against auto-start, but it's your page).

One plugin that I have used with good success in the past is http://www.jplayer.org. It allows both audio and video playback. It also works with .m4a files so you wouldn't have to convert anything.

If you're wanting to have the music continuously play rather than start over everytime the visitor goes to a new page, you will have to look into using an iframe to hold the contents of your site.

这篇关于php / html网页中的背景音乐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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