How Web pages play AMR's audio files

Source: Internet
Author: User

This demand is long-standing, the company's voice orders a lot, every customer service is from the server down voice to listen. Very inconvenient. So I went online ba la to see what the Web Player can play AMR format audio files, AMR Baidu Encyclopedia

Anyway, I've been looking for a long time. , and then discover that Apple's QuickTime player player can play.

The steps are as follows:

1. Download QuickTime Player

2. Mime.type support for adding Web servers on the server side is the Apache, Nginx, and the like. mime.type files are added as follows

    1. AUDIO/AMR AMR
    2. AUDIO/AMR-WB AMR
    3. audio/amr-wb+ AMR
    4. AUDIO/AMR AMR Amr

3. Insert the following code on the page

Source copy print About
  1. <button class="Icon-audio" id="playerbtn" style= "margin:0 5px;cursor:pointer; "Playerurl=" Http://xxx.com/abc.amr "> Play </button>
  2. <div style="width:1px;height:1px;" id="PLAYERQT" >
  3. </div>
  4. The JS code is as follows: Okay, I'll use jquery to replace it.
  5. var playerqt = document.getElementById ("PLAYERQT");
  6. $ ("#playerBtn"). Bind ("click",function (e) {
  7. var playerurl = E.target.getattribute ("Playerurl");
  8. Playeraudio (Playerurl);
  9. });
  10. function Playeraudio (URL) {
  11. var html = ' ltembed width= ' 1px "height=" 1px "name=" plugin "src=" ' +url+' "type=" Audio/amr "id=" Qt_emb ">";
  12. playerqt.innerhtml = html;
  13. }

4. In the URL to get this AMR, add the header of the server code as follows

    1. Header (' Content-type:audio/amr ');

Original address: http://myway.sinaapp.com/30.html

Http://blog.sina.com.cn/s/blog_c70924a60101gwgm.html

How Web pages play AMR's audio files

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.