Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Your computer account is overdrawn. Please see Big Brother.


devel / comp.lang.javascript / Set volume for wave playup

SubjectAuthor
* Set volume for wave playupJonas Thörnvall
`- Re: Set volume for wave playupluserdroog

1
Set volume for wave playup

<574b90ec-7483-49b5-9a7b-69e364687574n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17577&group=comp.lang.javascript#17577

  copy link   Newsgroups: comp.lang.javascript
X-Received: by 2002:a05:6214:2423:: with SMTP id gy3mr711989qvb.44.1640133138655;
Tue, 21 Dec 2021 16:32:18 -0800 (PST)
X-Received: by 2002:a9d:74d0:: with SMTP id a16mr531440otl.237.1640133138284;
Tue, 21 Dec 2021 16:32:18 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.javascript
Date: Tue, 21 Dec 2021 16:32:18 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=84.217.164.86; posting-account=kxPkPAoAAACjJi8w0gL9bnyznPzdw9HW
NNTP-Posting-Host: 84.217.164.86
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <574b90ec-7483-49b5-9a7b-69e364687574n@googlegroups.com>
Subject: Set volume for wave playup
From: jonas.thornvall@gmail.com (Jonas Thörnvall)
Injection-Date: Wed, 22 Dec 2021 00:32:18 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 23
 by: Jonas Thörnvall - Wed, 22 Dec 2021 00:32 UTC

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();
};

Re: Set volume for wave playup

<4568c7bb-1eba-47bf-b218-f6124c66dc62n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17578&group=comp.lang.javascript#17578

  copy link   Newsgroups: comp.lang.javascript
X-Received: by 2002:a05:6214:23ca:: with SMTP id hr10mr1323881qvb.82.1640153323095;
Tue, 21 Dec 2021 22:08:43 -0800 (PST)
X-Received: by 2002:aca:f20a:: with SMTP id q10mr1103992oih.176.1640153322808;
Tue, 21 Dec 2021 22:08:42 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.javascript
Date: Tue, 21 Dec 2021 22:08:42 -0800 (PST)
In-Reply-To: <574b90ec-7483-49b5-9a7b-69e364687574n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=97.87.183.68; posting-account=G1KGwgkAAAAyw4z0LxHH0fja6wAbo7Cz
NNTP-Posting-Host: 97.87.183.68
References: <574b90ec-7483-49b5-9a7b-69e364687574n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4568c7bb-1eba-47bf-b218-f6124c66dc62n@googlegroups.com>
Subject: Re: Set volume for wave playup
From: luser.droog@gmail.com (luserdroog)
Injection-Date: Wed, 22 Dec 2021 06:08:43 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 33
 by: luserdroog - Wed, 22 Dec 2021 06:08 UTC

On Tuesday, December 21, 2021 at 6:32:23 PM UTC-6, jonas.t...@gmail.com wrote:
> 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....
>

I think you're just frustrated. The answer is right under your nose.
> // 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);

^^^ Right here ^^^

Bust up that call to playwav.connect() and put your gain node in the middle there.
"playwav" is your "source". And "audiostream.destination" is already literally in
the example.

> playwav.start();
> };


devel / comp.lang.javascript / Set volume for wave playup

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor