(function(a){a.fn.speech=function(b){var c={speech:true,lang:"zh",speed:3,sWidth:16,sHeight:13,https:true,bg:"./image/speech.png",content:"这是一段测试内容"};var b=a.extend(c,b); return this.each(function(){var j=a(this),i=j.find(".speech_iframe"),d=b.https?"https":"http",f=j.text();f=(!f||f===undefined||f===null)?b.content:f;var h=d+"://tts.baidu.com/text2audio?lan="+b.lang+"&ie=UTF-8&text="+f+"&spd="+b.speed; if(b.speech){var g="";j.append(g);var e=j.find(".speech");e.css({width:b.sWidth,height:b.sHeight,display:"inline-block",background:"url("+b.bg+") no-repeat"}); e.on("click",function(){i.length>0?i.attr("src",h):(function(){var k=""; j.append(k);})();});}else{i.length>0?i.attr("src",h):(function(){var k=""; j.append(k);})();}});};})(jQuery);