I am currentyl developing a site for a client who requires artist to upload their music but only play samples of it, sorta like iTunes. The site has a php backend and is currently using a basic mp3 flash player to play mp3s.
我现在正在为一个客户开发一个网站,该网站要求艺术家上传他们的音乐,但只播放它的样本,就像iTunes一样。该网站有一个PHP后端,目前正在使用基本的MP3 Flash播放器来播放mp3。
My question is there a flash player that can be configured to play only samples or is there a way through php or another method to load only a portion of the song and have it play in a player?
我的问题是有一个Flash播放器,可以配置为只播放样本或有没有办法通过PHP或其他方法只加载一部分歌曲并让它在播放器中播放?
2 个解决方案
#1
1
You have a few options:
你有几个选择:
- You could programatically interface with a tool like Silverlight or Flex to access a media player control and set properties.
- You could use a tool like ffmpeg programatically to create a clipped version of the file, similar to what BitPim does for creating ringtones, then serve that up.
您可以以编程方式与Silverlight或Flex等工具进行交互,以访问媒体播放器控件并设置属性。
您可以使用像ffmpeg这样的工具以编程方式创建文件的剪辑版本,类似于BitPim创建铃声所做的那样,然后提供它。
I would go with the second approach.
我会采用第二种方法。
#2
2
I think probably the easiest, and safest way to give access to a sample is to make different versions of the mp3-files that are only the sample. You can use free tools such as Audacity to create a shorter version of the MP3.
我认为提供访问样本的最简单,最安全的方法可能就是制作不同版本的mp3文件,这些只是样本。您可以使用Audacity等免费工具创建较短版本的MP3。
If you would be using a Flash player to play only a short clip of the MP3, the browser would still have to download the whole MP3 and the user could then easily figure out the file URL and download it. On the otherhand, clipping it shorter with PHP would most likely be resource intensive, so just clip it beforehand using an audio editing tool.
如果您使用Flash播放器只播放MP3的短片,浏览器仍然需要下载整个MP3,然后用户可以轻松找出文件URL并下载。另一方面,使用PHP缩短它很可能是资源密集型的,所以只需使用音频编辑工具预先剪辑它。
#1
1
You have a few options:
你有几个选择:
- You could programatically interface with a tool like Silverlight or Flex to access a media player control and set properties.
- You could use a tool like ffmpeg programatically to create a clipped version of the file, similar to what BitPim does for creating ringtones, then serve that up.
您可以以编程方式与Silverlight或Flex等工具进行交互,以访问媒体播放器控件并设置属性。
您可以使用像ffmpeg这样的工具以编程方式创建文件的剪辑版本,类似于BitPim创建铃声所做的那样,然后提供它。
I would go with the second approach.
我会采用第二种方法。
#2
2
I think probably the easiest, and safest way to give access to a sample is to make different versions of the mp3-files that are only the sample. You can use free tools such as Audacity to create a shorter version of the MP3.
我认为提供访问样本的最简单,最安全的方法可能就是制作不同版本的mp3文件,这些只是样本。您可以使用Audacity等免费工具创建较短版本的MP3。
If you would be using a Flash player to play only a short clip of the MP3, the browser would still have to download the whole MP3 and the user could then easily figure out the file URL and download it. On the otherhand, clipping it shorter with PHP would most likely be resource intensive, so just clip it beforehand using an audio editing tool.
如果您使用Flash播放器只播放MP3的短片,浏览器仍然需要下载整个MP3,然后用户可以轻松找出文件URL并下载。另一方面,使用PHP缩短它很可能是资源密集型的,所以只需使用音频编辑工具预先剪辑它。