我正在使用 HTML5 音频 api 来播放声音。这对于常规 mp3 文件工作正常,但当使用诸如 之类的声音流时http://95.173.167.24:8009,它无法播放。
这是我正在使用的代码:
if('webkitAudioContext' in window) {
var myAudioContext = new webkitAudioContext();
}
request = new XMLHttpRequest();
request.open('GET', 'http://95.173.167.24:8009', true);
request.responseType = 'arraybuffer';
request.addEventListener('load', bufferSound, false);
request.send();
function bufferSound(event) {
var request = event.target;
var source = myAudioContext.createBufferSource();
source.buffer = myAudioContext.createBuffer(request.response, false);
source.connect(myAudioContext.destination);
source.noteOn(0);
}
Run Code Online (Sandbox Code Playgroud)
谁能指出我在这方面的正确方向?
任何帮助表示赞赏。谢谢
我遇到了一个DropDownList由XML文件填充的ASP.NET问题:
rblState.DataSource = dsState;
rblState.DataValueField = "abbreviation";
rblState.DataTextField = "name";
rblState.DataBind();
Run Code Online (Sandbox Code Playgroud)
这工作正常并显示所有正确的数据但是,当我尝试从单击按钮后从列表中检索所选值时,会出现问题:
string state = rblState.SelectedItem.Text;
Console.WriteLine(state);
Run Code Online (Sandbox Code Playgroud)
这始终只输出列表中的第一个值.
有人知道解决方案吗?
我正在使用 parse_ini_file 读取文件的内容,但并不总是成功。
例如,这个文件工作正常:
[playlist]
numberofentries=3
File1=http://scfire-dtc-aa05.stream.aol.com:80/stream/1010
Title1=(#1 - 168/11500) Absolutely Smooth Jazz - SKY.FM - the world's smoothest jazz 24 hours a day
Length1=-1
File2=http://scfire-ntc-aa06.stream.aol.com:80/stream/1010
Title2=(#2 - 171/11500) Absolutely Smooth Jazz - SKY.FM - the world's smoothest jazz 24 hours a day
Length1=-1
File3=http://scfire-mtc-aa04.stream.aol.com:80/stream/1010
Title3=(#3 - 175/11500) Absolutely Smooth Jazz - SKY.FM - the world's smoothest jazz 24 hours a day
Length1=-1
Version=2
Run Code Online (Sandbox Code Playgroud)
但是,当我使用 parse_ini_file 读取以下文件时,出现错误,指出它无法解析该文件:
[playlist]
numberofentries=3
File1=http://87.230.82.17:80
Title1=(#1 - 365/1400) DEFJAY.DE - 100% R&B! (GERMANY)
Length1=-1
File2=http://87.230.56.25:80 …Run Code Online (Sandbox Code Playgroud) 我有一个 .ini 文件,如下所示:
[playlist]
numberofentries=2
File1=http://87.230.82.17:80
Title1=(#1 - 365/1400) Example Title
Length1=-1
File2=http://87.230.56.25:80
Title2=(#2 - 370/1400) Example Title
Length1=-1
Version=2
Run Code Online (Sandbox Code Playgroud)
我想知道如何以编程方式读取此文件,在文件和标题值周围添加引号,然后再次在 PHP 中保存此文件。
我将非常感谢任何帮助。