OpenCart mp3 预览
在 OpenCart 商店上提供音频预览的最佳方法和播放器是什么?这将涉及上传完整曲目,然后提取要播放的部分
What is the best method and player for giving an audio preview on an OpenCart store. This would involve uploading the full track and then extracting a portion to be played
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
m3psplt 是迄今为止您最好的选择。
有时安装起来有点冒险(特别是在 CentOS 和其他基于 RH 的发行版上),但这确实是我找到的唯一解决方案。
我通常运行一个脚本,使用 getid3 分析 mp3 来获取长度,然后计算长度的中点mp3,然后通过 mp3splt 的 exec 命令将其加上三十秒传递给 mp3splt。
当您能够正确安装它时,它会非常有效。如果您使用的是 debian/ubuntu,那么通过 aptitude 安装实际上很简单。
m3psplt is by far your best bet.
It can sometimes be a little dicey to install (particularly on CentOS, other RH based distros) but it's really the only solution I've found.
I usually run a script that analyzes the mp3 with getid3 to get the length, then I calculate the halfway point of the mp3, and pass that plus thirty seconds to mp3splt via the exec command to mp3splt.
It works great when you can get it to install properly. If you're on debian/ubuntu it's actually a cinch to install via aptitude.
我认为唯一要做的另一件事是将命令行 unix 音频编辑实用程序包装在 php 脚本中,基本上创建一个“抓取 2 分钟 MP3 头”功能,然后在上传文件时在文件上运行该功能。那么是的,将它们保存在文件系统的“预览”区域中,并将文件名存储在数据库表中以供以后参考。
The only other thing I could think do do would be to wrap your command line unix audio editing utilities in a php script to basically create a "grab 2 minute head of MP3" function, then run that on files when they are uploaded. then yes, save them in a "previews" area of the file system and store the filename in a DB table for later reference.
我找到了一个可以满足您需求的 PHP 脚本(请注意我没有测试它)。您可以在此处找到它。类接口看起来简单且实用。无论如何,您需要修改 OpenCart 产品模板以公开预览命令。
I've found a PHP script that could fit your needs (please note I didn't tested it). You can find it here. The class interface seems simple and functional. Anyway, you will need to modify your OpenCart product template to expose the preview command.