Could someone explain for me howto set volume on the played audio.
I do not speak monkey gibberish.
/* Here is some unintelligble syntax to decipher......
// Create a gain node.
var gainNode = audiostream.createGain();
// Connect the source to the gain node.
source.connect(gainNode);
// Connect the gain node to the destination. gainNode.connect(audiostream.destination);
*/ Yeah what the fuck is source and destination....
// Code below works and play up the audiostream of the URL
const audiostream = new AudioContext();
async function audioPlay(url){
const audioBuffer = await fetch(url)
.then(res => res.arrayBuffer())
.then(ArrayBuffer => audiostream.decodeAudioData(ArrayBuffer));
const playwav = audiostream.createBufferSource();
playwav.buffer = audioBuffer;
playwav.connect(audiostream.destination);
playwav.start();
};
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 339 |
Nodes: | 16 (0 / 16) |
Uptime: | 08:14:07 |
Calls: | 7,467 |
Calls today: | 3 |
Files: | 12,692 |
Messages: | 5,626,373 |