如何调制Web Audio API中的任何AudioParams,例如使用低频振荡器获取GainNode的值?
Firefox 25说要引入Web Audio,但似乎缺少一些重要的功能 - createJavaScriptNode.
我正在尝试构建一个分析器,但我在控制台中得到错误,createJavaScriptNode不是一个函数.
我在我的项目中使用网络音频 api。有没有办法记录发送到 webkitAudioContext.destination 的音频数据?.wav 文件正在我的浏览器中播放,因此应该有某种方法将该数据存储到 (.wav) 文件中。我知道这是可能的,但还没有找到任何解决方案:( recorder.js 可以帮助我,但到目前为止我发现它只是记录麦克风实时输入,是否可以在帮助下记录我的音频(.wav 文件) recorder.js 的吗?请帮忙
我正在使用此示例进行录制https://github.com/mattdiamond/Recorderjs
audio-recording html5-audio webkitaudiocontext web-audio-api
我正在尝试使用 Web Audio API 找到音频时刻的强度。我在规范中发现的唯一与强度相关的事情是:
analyser.minDecibels
analyser.maxDecibels
Run Code Online (Sandbox Code Playgroud)
有没有办法做到这一点?
我正在尝试使用JavaScript中的Web Audio API将声音加载到缓冲区并播放它.不幸的是它不起作用,我收到以下错误:
Uncaught TypeError: Failed to set the 'buffer' property on 'AudioBufferSourceNode':
The provided value is not of type 'AudioBuffer'.
Run Code Online (Sandbox Code Playgroud)
我可以确定哪条线给了我错误,但我不知道为什么.以下是相关代码,如果它有帮助:
var audioContext;
var playSoundBuffer;
function init() {
window.AudioContext = window.AudioContext || window.webkitAudioContext;
audioContext = new AudioContext();
loadNote();
}
function loadNote() {
var request = new XMLHttpRequest();
request.open("GET", "./sounds/topE.wav", true);
request.responseType = "arraybuffer";
request.onload = function() {
audioContext.decodeAudioData(request.response, function(buffer) {
playSoundBuffer = buffer;
}, function(error) {
console.error("decodeAudioData error", error);
});
};
request.send();
playSound();
}
function playSound() {
var source …Run Code Online (Sandbox Code Playgroud) 我想知道soundcloud如何生成他们的波形.
谢谢
什么是实现一个正确的方法峰值表像那些在Logic Pro中使用的网络音频API AnalyserNode?
我知道会AnalyserNode.getFloatFrequencyData()返回分贝值,但是如何将这些值组合起来才能在仪表中显示呢?您是否像下面的代码示例一样取最大值(其中analyserData来自getFloatFrequencyData():
let peak = -Infinity;
for (let i = 0; i < analyserData.length; i++) {
const x = analyserData[i];
if (x > peak) {
peak = x;
}
}
Run Code Online (Sandbox Code Playgroud)
仅通过获取最大值来检查一些输出,就好像这不是正确的方法。我错了吗?
或者,使用a ScriptProcessorNode代替会更好吗?这种方法有何不同?
我正在尝试用我的音频做几件事:
我有这个代码:
var audioContext = window.AudioContext || window.webkitAudioContext,
context = new audioContext(),
sourceNode = context.createMediaElementSource(document.getElementById('audio'));
// Nodes to control the left channel
var channelSplitterNode = context.createChannelSplitter(1);
var leftChannelGainNode = context.createGain();
leftChannelGainNode.gain.value = 1.10;
channelSplitterNode.connect(leftChannelGainNode, 0);
var leftChannelDelayNode = context.createDelay();
leftChannelDelayNode.delayTime.value = 0.10;
channelSplitterNode.connect(leftChannelDelayNode, 0);
// Node to control the track's overall volume
var volumeGainNode = context.createGain();
// I think this might be where I mess up
sourceNode.connect(leftChannelGainNode);
sourceNode.connect(leftChannelDelayNode);
sourceNode.connect(volumeGainNode);
volumeGainNode.connect(context.destination);
// Change gain at any time like so …Run Code Online (Sandbox Code Playgroud) 我正在尝试在 React 中创建一个 AudioWorklet。我正在使用 create-react-app 并将在 React 上下文之外工作的脚本导入到 App.jsx 中。它无法实例化我的 AudioWorkletNode 扩展并引发以下错误:
Failed to compile.
./src/worklet/worklet-node.js
Line 2: 'AudioWorkletNode' is not defined no-undef
Run Code Online (Sandbox Code Playgroud)
代码:
// The code in the main global scope.
class MyWorkletNode extends AudioWorkletNode {
constructor(context) {
super(context, 'my-worklet-processor');
}
}
let context = new AudioContext();
context.audioWorklet.addModule('processor.js').then(() => {
let node = new MyWorkletNode(context);
});
Run Code Online (Sandbox Code Playgroud)
同样的代码成功初始化了 AudioWorklet,所以我有点困惑为什么 AudioWorkletNode 没有被识别。
使用 Web Audio API,我正在尝试构建具有“向前跳过 15 秒”功能的 mp3 播放器。
我能够使用源缓冲区加载 mp3,并可以让它开始播放。我想做这样的事情,虽然我知道 currentTime 不是一个可设置的属性:
context.currentTime += 15
Run Code Online (Sandbox Code Playgroud)
一旦歌曲已经播放,你如何向前跳过 n 秒?
web-audio-api ×10
javascript ×6
audio ×2
html5 ×2
html5-audio ×2
audiobuffer ×1
audiocontext ×1
firefox ×1
html ×1
reactjs ×1
soundcloud ×1
waveform ×1
web ×1
webrtc ×1