I have a bit hard to read monkey gibberish, is there a way to explain this to someone who is not fullfledged retarded?
.then(res => res.arrayBuffer())
.then(ArrayBuffer => ctx.decodeAudioData(ArrayBuffer));
Specifically
.then =>
Is there another way to write it that may not be gibberish?
On Monday, December 20, 2021 at 3:19:41 PM UTC-6, jonas.t...@gmail.com wrote:
I have a bit hard to read monkey gibberish, is there a way to explain
this to someone who is not fullfledged retarded?
.then(res => res.arrayBuffer())
.then(ArrayBuffer => ctx.decodeAudioData(ArrayBuffer));
Specifically
.then =>
Is there another way to write it that may not be gibberish?
I think this is the new fad called "monadic sequencing". If I'm right,
the above can be translated into:
var x = res.arrayBuffer(); //only it won't be called "res", but the name of the previous result
var y = ctx.decodeAudioData(x);
Or even:
ctx.decodeAudioData( res.arrayBuffer() ); //again, "res" isn't the correct name here
It's just a sequence of functions "arg=> expression" where the result
of one is passed as the argument to the next. You can do the same
thing with a series of temporary variables or by composing all the expressions into one massive expression.
I have a bit hard to read monkey gibberish, is there a way to explain this to someone who is not fullfledged retarded?
.then(res => res.arrayBuffer())
.then(ArrayBuffer => ctx.decodeAudioData(ArrayBuffer));
Specifically
.then =>
Is there another way to write it that may not be gibberish?
Jonas Thörnvall:
I have a bit hard to read monkey gibberish, is there a way to explain this to someone who is not fullfledged retarded?
.then(res => res.arrayBuffer())
.then(ArrayBuffer => ctx.decodeAudioData(ArrayBuffer));
Specifically
.then =>
Is there another way to write it that may not be gibberish?
Just because you don't know every detail about JavaScript does not mean
that this is "gibberish".
See:
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise>
Jonas Thörnvall:
I have a bit hard to read monkey gibberish, is there a way to explain this to someone who is not fullfledged retarded?
.then(res => res.arrayBuffer())
.then(ArrayBuffer => ctx.decodeAudioData(ArrayBuffer));
SpecificallyJust because you don't know every detail about JavaScript does not mean
.then =>
Is there another way to write it that may not be gibberish?
that this is "gibberish".
See:
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise>
--Yeah precisely those things have no importance for the user and should not have part of the syntax, its moronic.
Arno Welzel
https://arnowelzel.de
tisdag 21 december 2021 kl. 13:41:21 UTC+1 skrev Arno Welzel:
Jonas Thörnvall:
I have a bit hard to read monkey gibberish, is there a way to explain this to someone who is not fullfledged retarded?
.then(res => res.arrayBuffer())
.then(ArrayBuffer => ctx.decodeAudioData(ArrayBuffer));
SpecificallyJust because you don't know every detail about JavaScript does not mean that this is "gibberish".
.then =>
Is there another way to write it that may not be gibberish?
See:
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise>
This anal specification of things that the user do not care about drives me nuts, what the user want it functions. get buffersize, set buffsize, get stream, set streams.--Yeah precisely those things have no importance for the user and should not have part of the syntax, its moronic.
Arno Welzel
https://arnowelzel.de
tisdag 21 december 2021 kl. 19:00:58 UTC+1 skrev Jonas Thörnvall:
tisdag 21 december 2021 kl. 13:41:21 UTC+1 skrev Arno Welzel:
Jonas Thörnvall:
I have a bit hard to read monkey gibberish, is there a way to explain this to someone who is not fullfledged retarded?
.then(res => res.arrayBuffer())
.then(ArrayBuffer => ctx.decodeAudioData(ArrayBuffer));
SpecificallyJust because you don't know every detail about JavaScript does not mean that this is "gibberish".
.then =>
Is there another way to write it that may not be gibberish?
See:
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise>
monkey who thrives learning throw together shit that are just string concatinations.This anal specification of things that the user do not care about drives me nuts, what the user want it functions. get buffersize, set buffsize, get stream, set streams.--Yeah precisely those things have no importance for the user and should not have part of the syntax, its moronic.
Arno Welzel
https://arnowelzel.de
The language start to look like shit and is completly unreadable, without spending a year reading the manual.
Make things *OBVIOUS* not *CONVOLUTED*
I start to think about it is a reason for selling courses learning shit paradigms that noone really cares about "beyond their implementation reasons", and i repeat the user "programmer" do not fucking care about that shit unless he is an anal retarded
Fucking soon some bastard have translated the whole language to regexp expressions, that should be used. And you need to learn E-macs to edit the "expressions".Yeah i really start to think it is a reason for selling courses, and make you have to hire a certified "webmechanic" to make a homepage that say hello world.
Then the anal monkeys finally satified with laying a groundwork that make pearl look like natural language.
tisdag 21 december 2021 kl. 19:21:07 UTC+1 skrev Jonas Thörnvall:
tisdag 21 december 2021 kl. 19:00:58 UTC+1 skrev Jonas Thörnvall:
tisdag 21 december 2021 kl. 13:41:21 UTC+1 skrev Arno Welzel:
Jonas Thörnvall:
I have a bit hard to read monkey gibberish, is there a way to explain this to someone who is not fullfledged retarded?
.then(res => res.arrayBuffer())
.then(ArrayBuffer => ctx.decodeAudioData(ArrayBuffer));
SpecificallyJust because you don't know every detail about JavaScript does not mean
.then =>
Is there another way to write it that may not be gibberish?
that this is "gibberish".
See:
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise>
retarded monkey who thrives learning throw together shit that are just string concatinations.This anal specification of things that the user do not care about drives me nuts, what the user want it functions. get buffersize, set buffsize, get stream, set streams.--Yeah precisely those things have no importance for the user and should not have part of the syntax, its moronic.
Arno Welzel
https://arnowelzel.de
The language start to look like shit and is completly unreadable, without spending a year reading the manual.
Make things *OBVIOUS* not *CONVOLUTED*
I start to think about it is a reason for selling courses learning shit paradigms that noone really cares about "beyond their implementation reasons", and i repeat the user "programmer" do not fucking care about that shit unless he is an anal
Program languages are help to formulate ideas to specify the nuts and bolts "of the idea", anything that do not help out with the problem formulation and get the answer is just of no use.Fucking soon some bastard have translated the whole language to regexp expressions, that should be used. And you need to learn E-macs to edit the "expressions".Yeah i really start to think it is a reason for selling courses, and make you have to hire a certified "webmechanic" to make a homepage that say hello world.
Then the anal monkeys finally satified with laying a groundwork that make pearl look like natural language.
tisdag 21 december 2021 kl. 19:26:57 UTC+1 skrev Jonas Thörnvall:
tisdag 21 december 2021 kl. 19:21:07 UTC+1 skrev Jonas Thörnvall:
tisdag 21 december 2021 kl. 19:00:58 UTC+1 skrev Jonas Thörnvall:
tisdag 21 december 2021 kl. 13:41:21 UTC+1 skrev Arno Welzel:
Jonas Thörnvall:
I have a bit hard to read monkey gibberish, is there a way to explain this to someone who is not fullfledged retarded?
.then(res => res.arrayBuffer())
.then(ArrayBuffer => ctx.decodeAudioData(ArrayBuffer));
SpecificallyJust because you don't know every detail about JavaScript does not mean
.then =>
Is there another way to write it that may not be gibberish?
that this is "gibberish".
See:
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise>
retarded monkey who thrives learning throw together shit that are just string concatinations.This anal specification of things that the user do not care about drives me nuts, what the user want it functions. get buffersize, set buffsize, get stream, set streams.--Yeah precisely those things have no importance for the user and should not have part of the syntax, its moronic.
Arno Welzel
https://arnowelzel.de
The language start to look like shit and is completly unreadable, without spending a year reading the manual.
Make things *OBVIOUS* not *CONVOLUTED*
I start to think about it is a reason for selling courses learning shit paradigms that noone really cares about "beyond their implementation reasons", and i repeat the user "programmer" do not fucking care about that shit unless he is an anal
Program languages are help to formulate ideas to specify the nuts and bolts "of the idea", anything that do not help out with the problem formulation and get the answer is just of no use.Fucking soon some bastard have translated the whole language to regexp expressions, that should be used. And you need to learn E-macs to edit the "expressions".Yeah i really start to think it is a reason for selling courses, and make you have to hire a certified "webmechanic" to make a homepage that say hello world.
Then the anal monkeys finally satified with laying a groundwork that make pearl look like natural language.
Specify the nuts and bolt of some meta vocabulary can not be the main idea behind a language construct.
tisdag 21 december 2021 kl. 19:26:57 UTC+1 skrev Jonas Thörnvall:
tisdag 21 december 2021 kl. 19:21:07 UTC+1 skrev Jonas Thörnvall:
tisdag 21 december 2021 kl. 19:00:58 UTC+1 skrev Jonas Thörnvall:
tisdag 21 december 2021 kl. 13:41:21 UTC+1 skrev Arno Welzel:
Jonas Thörnvall:
I have a bit hard to read monkey gibberish, is there a way to explain this to someone who is not fullfledged retarded?
.then(res => res.arrayBuffer())
.then(ArrayBuffer => ctx.decodeAudioData(ArrayBuffer));
SpecificallyJust because you don't know every detail about JavaScript does not mean
.then =>
Is there another way to write it that may not be gibberish?
that this is "gibberish".
See:
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise>
retarded monkey who thrives learning throw together shit that are just string concatinations.This anal specification of things that the user do not care about drives me nuts, what the user want it functions. get buffersize, set buffsize, get stream, set streams.--Yeah precisely those things have no importance for the user and should not have part of the syntax, its moronic.
Arno Welzel
https://arnowelzel.de
The language start to look like shit and is completly unreadable, without spending a year reading the manual.
Make things *OBVIOUS* not *CONVOLUTED*
I start to think about it is a reason for selling courses learning shit paradigms that noone really cares about "beyond their implementation reasons", and i repeat the user "programmer" do not fucking care about that shit unless he is an anal
Program languages are help to formulate ideas to specify the nuts and bolts "of the idea", anything that do not help out with the problem formulation and get the answer is just of no use.Fucking soon some bastard have translated the whole language to regexp expressions, that should be used. And you need to learn E-macs to edit the "expressions".Yeah i really start to think it is a reason for selling courses, and make you have to hire a certified "webmechanic" to make a homepage that say hello world.
Then the anal monkeys finally satified with laying a groundwork that make pearl look like natural language.
Specify the nuts and bolt of some meta vocabulary can not be the main idea behind a language construct.
tisdag 21 december 2021 kl. 13:41:21 UTC+1 skrev Arno Welzel:[...]
Jonas Thörnvall:
I have a bit hard to read monkey gibberish, is there a way toJust because you don't know every detail about JavaScript does not
explain this to someone who is not fullfledged retarded?
.then(res => res.arrayBuffer()) .then(ArrayBuffer =>
ctx.decodeAudioData(ArrayBuffer));
Specifically .then => Is there another way to write it that may
not be gibberish?
mean that this is "gibberish".
See:
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise>
Yeah precisely those things have no importance for the user and
should not have part of the syntax, its moronic.
On 21/12/2021 12:41, Arno Welzel wrote:
Jonas Thörnvall:And remember that te primary purpose of extending computer languages is to
I have a bit hard to read monkey gibberish, is there a way to explain this to someone who is not fullfledged retarded?
.then(res => res.arrayBuffer())
.then(ArrayBuffer => ctx.decodeAudioData(ArrayBuffer));
Specifically
.then =>
Is there another way to write it that may not be gibberish?
Just because you don't know every detail about JavaScript does not mean
that this is "gibberish".
See:
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise>
- make yourself look smart
- sell text books
- sell training courses
- make people who don't buy the above effectively redundant, as they can
no longer understand your code.
The fact that async syntax in JavaShite is total utter crap, is, in this context, an advantage. I mean what tosser invented 'promise' ?
I guess it was some millennial snoflake who once saw the term,[...]
'master-slave' in a textbook ' and 'male plug female socket' in a parts
Fuck i even do not want to write that code, it make me look analBut i guess i must...
retarded to.
The Natural Philosopher:
On 21/12/2021 12:41, Arno Welzel wrote:
Jonas Thörnvall:And remember that te primary purpose of extending computer languages is to >> - make yourself look smart
I have a bit hard to read monkey gibberish, is there a way to explain this to someone who is not fullfledged retarded?
.then(res => res.arrayBuffer())
.then(ArrayBuffer => ctx.decodeAudioData(ArrayBuffer));
Specifically
.then =>
Is there another way to write it that may not be gibberish?
Just because you don't know every detail about JavaScript does not mean
that this is "gibberish".
See:
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise>
- sell text books
- sell training courses
- make people who don't buy the above effectively redundant, as they can
no longer understand your code.
If you don't like this - don't use JavaScript. It may not be the right
thing for you.
The fact that async syntax in JavaShite is total utter crap, is, in this
context, an advantage. I mean what tosser invented 'promise' ?
Friedman, Daniel and David Wise coined the term "promise" about 1976.
<https://en.wikipedia.org/wiki/Futures_and_promises>
"Scheme" which was invented 1975 also implements the concept of promises eventhough it was not named like that back then:I am still not sure it is a decent way to either implement
<https://en.wikipedia.org/wiki/Scheme_(programming_language)>
JavaScript re-discovered this in the late 2000s when asyncronous
execution of code became the de-facto standard for web based
applications. Promises as they are known today are usable in most
browsers since about 2014, so they are not really new there either.
I guess it was some millennial snoflake who once saw the term,[...]
'master-slave' in a textbook ' and 'male plug female socket' in a parts
I wouldn't call people who where already adults in 1970ies "milennial snowflakes".
Jonas Thörnvall:Oh my bad i thought the programmer used the language to implement ideas.
tisdag 21 december 2021 kl. 13:41:21 UTC+1 skrev Arno Welzel:[...]
Jonas Thörnvall:
I have a bit hard to read monkey gibberish, is there a way toJust because you don't know every detail about JavaScript does not
explain this to someone who is not fullfledged retarded?
.then(res => res.arrayBuffer()) .then(ArrayBuffer =>
ctx.decodeAudioData(ArrayBuffer));
Specifically .then => Is there another way to write it that may
not be gibberish?
mean that this is "gibberish".
See:
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise>
Yeah precisely those things have no importance for the user andThey are not for "users" but for softwar developers.
should not have part of the syntax, its moronic.
--
Arno Welzel
https://arnowelzel.de
onsdag 22 december 2021 kl. 10:31:11 UTC+1 skrev Arno Welzel:Oh now i get it its the language programmer that use the language to create customers for his new book or new certificate, it is not a production tool to implement ideas that is selexplanatory first you should learn an hierarchy of gibberish to be able
Jonas Thörnvall:Oh my bad i thought the programmer used the language to implement ideas.
tisdag 21 december 2021 kl. 13:41:21 UTC+1 skrev Arno Welzel:[...]
Jonas Thörnvall:
I have a bit hard to read monkey gibberish, is there a way toJust because you don't know every detail about JavaScript does not
explain this to someone who is not fullfledged retarded?
.then(res => res.arrayBuffer()) .then(ArrayBuffer =>
ctx.decodeAudioData(ArrayBuffer));
Specifically .then => Is there another way to write it that may
not be gibberish?
mean that this is "gibberish".
See:
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise>
Yeah precisely those things have no importance for the user andThey are not for "users" but for softwar developers.
should not have part of the syntax, its moronic.
--
Arno Welzel
https://arnowelzel.de
Oh now i get it its the language programmer that use the language to
create customers for his new book or new certificate, it is not a
production tool to implement ideas that is selexplanatory first you
should learn an hierarchy of gibberish to be able to use it.
Frankly audio does not have that many properties.
channels
frequensy resolution
bit resolution
volume
And then you want the streams to have a name so they can be identified
But no, you have to connect the volume to the stream.......
But first you have to create a volume connected to a node.......
They are imbecills at best.
On 22/12/2021 11:41, Jonas Thörnvall wrote:Unfortunately i think that gainNode object is mandatory if you want to change volume of stream....
<snip>
Frankly audio does not have that many properties.
channels
frequensy resolution
bit resolution
volume
And then you want the streams to have a name so they can be identified
But no, you have to connect the volume to the stream.......
But first you have to create a volume connected to a node.......
They are imbecills at best.We've told you before, if you copy someone else's code you have to put
up with the peculiar way they did it. It's not the fault of the
programming language.
John
On 2021-12-20, luserdroog <luser...@gmail.com> wrote:
On Monday, December 20, 2021 at 3:19:41 PM UTC-6, jonas.t...@gmail.com wrote:
I have a bit hard to read monkey gibberish, is there a way to explain
this to someone who is not fullfledged retarded?
.then(res => res.arrayBuffer())
.then(ArrayBuffer => ctx.decodeAudioData(ArrayBuffer));
Specifically
.then =>
Is there another way to write it that may not be gibberish?
I think this is the new fad called "monadic sequencing". If I'm right,
the above can be translated into:
var x = res.arrayBuffer(); //only it won't be called "res", but the name of the previous result
var y = ctx.decodeAudioData(x);
Or even:
ctx.decodeAudioData( res.arrayBuffer() ); //again, "res" isn't the correct name here
It's just a sequence of functions "arg=> expression" where the resultThe important bit you didn't mention is that it's dealing with Promises.
of one is passed as the argument to the next. You can do the same
thing with a series of temporary variables or by composing all the expressions into one massive expression.
So you can't do either of the things you suggest above. If you're in an
async function you could do this however:
const audioData = await ctx.decodeAudioData(await res.arrayBuffer())
tisdag 21 december 2021 kl. 00:34:44 UTC+1 skrev Jon Ribbens:I mean using .start() with an volume parameter, is what any none anal person would do.
On 2021-12-20, luserdroog <luser...@gmail.com> wrote:
On Monday, December 20, 2021 at 3:19:41 PM UTC-6, jonas.t...@gmail.com wrote:
I have a bit hard to read monkey gibberish, is there a way to explain >> this to someone who is not fullfledged retarded?
.then(res => res.arrayBuffer())
.then(ArrayBuffer => ctx.decodeAudioData(ArrayBuffer));
Specifically
.then =>
Is there another way to write it that may not be gibberish?
I think this is the new fad called "monadic sequencing". If I'm right, the above can be translated into:
var x = res.arrayBuffer(); //only it won't be called "res", but the name of the previous result
var y = ctx.decodeAudioData(x);
Or even:
ctx.decodeAudioData( res.arrayBuffer() ); //again, "res" isn't the correct name here
It's just a sequence of functions "arg=> expression" where the resultThe important bit you didn't mention is that it's dealing with Promises. So you can't do either of the things you suggest above. If you're in an async function you could do this however:
of one is passed as the argument to the next. You can do the same
thing with a series of temporary variables or by composing all the expressions into one massive expression.
const audioData = await ctx.decodeAudioData(await res.arrayBuffer())Why can't i do this.
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();
var gainNode = audiostream.createGain();
gainNode.gain.value = -0.1;
playwav.buffer = audioBuffer;
playwav.connect(audiostream.destination);
playwav.start();
};
or this to set volume
const audiostream = new AudioContext();
var gainNode = audiostream.createGain();
gainNode.gain.value = -0.1;
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();
};
onsdag 22 december 2021 kl. 21:26:47 UTC+1 skrev Jonas Thörnvall:How many models do a programming language need, if you can write the code in a dousins of ways, it will be hard to read without a manual.
tisdag 21 december 2021 kl. 00:34:44 UTC+1 skrev Jon Ribbens:
On 2021-12-20, luserdroog <luser...@gmail.com> wrote:
On Monday, December 20, 2021 at 3:19:41 PM UTC-6, jonas.t...@gmail.com wrote:
I have a bit hard to read monkey gibberish, is there a way to explain >> this to someone who is not fullfledged retarded?
.then(res => res.arrayBuffer())
.then(ArrayBuffer => ctx.decodeAudioData(ArrayBuffer));
Specifically
.then =>
Is there another way to write it that may not be gibberish?
I think this is the new fad called "monadic sequencing". If I'm right, the above can be translated into:
var x = res.arrayBuffer(); //only it won't be called "res", but the name of the previous result
var y = ctx.decodeAudioData(x);
Or even:
ctx.decodeAudioData( res.arrayBuffer() ); //again, "res" isn't the correct name here
It's just a sequence of functions "arg=> expression" where the result of one is passed as the argument to the next. You can do the same thing with a series of temporary variables or by composing all the expressions into one massive expression.The important bit you didn't mention is that it's dealing with Promises. So you can't do either of the things you suggest above. If you're in an async function you could do this however:
const audioData = await ctx.decodeAudioData(await res.arrayBuffer())Why can't i do this.
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();
var gainNode = audiostream.createGain();
gainNode.gain.value = -0.1;
playwav.buffer = audioBuffer;
playwav.connect(audiostream.destination);
playwav.start();
};
or this to set volume
const audiostream = new AudioContext();
var gainNode = audiostream.createGain();
gainNode.gain.value = -0.1;
async function audioPlay(url){I mean using .start() with an volume parameter, is what any none anal person would do.
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();
};
onsdag 22 december 2021 kl. 19:26:11 UTC+1 skrev John Harris:
On 22/12/2021 11:41, Jonas Thörnvall wrote:Unfortunately i think that gainNode object is mandatory if you want
<snip>
Frankly audio does not have that many properties. channelsWe've told you before, if you copy someone else's code you have to
frequensy resolution bit resolution volume
And then you want the streams to have a name so they can be
identified But no, you have to connect the volume to the
stream....... But first you have to create a volume connected to
a node.......
They are imbecills at best.
put up with the peculiar way they did it. It's not the fault of the
programming language.
John
to change volume of stream....
onsdag 22 december 2021 kl. 21:33:03 UTC+1 skrev Jonas Thörnvall:
onsdag 22 december 2021 kl. 21:26:47 UTC+1 skrev Jonas Thörnvall:How many models do a programming language need, if you can write the code in a dousins of ways, it will be hard to read without a manual.
tisdag 21 december 2021 kl. 00:34:44 UTC+1 skrev Jon Ribbens:I mean using .start() with an volume parameter, is what any none anal person would do.
On 2021-12-20, luserdroog <luser...@gmail.com> wrote:Why can't i do this.
On Monday, December 20, 2021 at 3:19:41 PM UTC-6, jonas.t...@gmail.com wrote:The important bit you didn't mention is that it's dealing with Promises. >>>> So you can't do either of the things you suggest above. If you're in an >>>> async function you could do this however:
I have a bit hard to read monkey gibberish, is there a way to explain >>>>>> this to someone who is not fullfledged retarded?
.then(res => res.arrayBuffer())
.then(ArrayBuffer => ctx.decodeAudioData(ArrayBuffer));
Specifically
.then =>
Is there another way to write it that may not be gibberish?
I think this is the new fad called "monadic sequencing". If I'm right, >>>>> the above can be translated into:
var x = res.arrayBuffer(); //only it won't be called "res", but the name of the previous result
var y = ctx.decodeAudioData(x);
Or even:
ctx.decodeAudioData( res.arrayBuffer() ); //again, "res" isn't the correct name here
It's just a sequence of functions "arg=> expression" where the result >>>>> of one is passed as the argument to the next. You can do the same
thing with a series of temporary variables or by composing all the
expressions into one massive expression.
const audioData = await ctx.decodeAudioData(await res.arrayBuffer())
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();
var gainNode = audiostream.createGain();
gainNode.gain.value = -0.1;
playwav.buffer = audioBuffer;
playwav.connect(audiostream.destination);
playwav.start();
};
or this to set volume
const audiostream = new AudioContext();
var gainNode = audiostream.createGain();
gainNode.gain.value = -0.1;
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();
};
Why did they not just do something like
playwav.setVolume(-0.5);
Why invent a hierarchy of idioties to write to set the volume?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 249 |
Nodes: | 16 (2 / 14) |
Uptime: | 75:08:46 |
Calls: | 5,505 |
Files: | 11,668 |
Messages: | 5,075,986 |