转字节数组声音 [英] Turn byte array to sound

查看:185
本文介绍了转字节数组声音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MP3文件作为字节数组。如何将其恢复到健全和使用JavaScript玩?

I have an mp3 file as byte array. How to turn it back to a sound and play using javascript?

感谢

推荐答案

据我知道这是决然不平凡。

As far as I know this is decidedly non trivial.


  1. 您可以把数组转换成一个数据URI ,然后回放正常。

  2. 您可以将它张贴回服务器做的编码和回放正常。

  3. 您可以使用花哨的API

  1. You can turn the array into a data URI, and then play it back normally.
  2. You can post it back to a server to do the encoding and play it back normally.
  3. You can use a fancy API

2,似乎效率不高,3,需要特定浏览器的支持。因此,使用方法1.我还没有尝试过,但检查出 http://www.bitsnbites.eu/? p = 1 。你应该想到这是比本地code方式效率较低。

2 seems inefficient, 3 requires browser specific support. So, use 1. I havent tried it, but check out http://www.bitsnbites.eu/?p=1. You should expect this to be way less efficient than native code.

这篇关于转字节数组声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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