Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #36329 > unrolled thread

Webaudio configure load audio buffer

Started byJonas Thörnvall <jonas.thornvall@gmail.com>
First post2019-04-07 22:50 -0700
Last post2019-04-10 22:44 +0200
Articles 13 — 4 participants

Back to article view | Back to comp.lang.javascript


Contents

  Webaudio configure load audio buffer Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-04-07 22:50 -0700
    Re: Webaudio configure load audio buffer Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-04-09 00:58 -0700
      Re: Webaudio configure load audio buffer "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-04-09 17:35 +0200
        Re: Webaudio configure load audio buffer Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-04-09 09:56 -0700
        Re: Webaudio configure load audio buffer Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-04-09 13:01 -0700
    Re: Webaudio configure load audio buffer Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-04-09 13:46 -0700
      Re: Webaudio configure load audio buffer Silvio <silvio@internet.com> - 2019-04-09 23:52 +0200
        Re: Webaudio configure load audio buffer Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-04-09 15:57 -0700
          Re: Webaudio configure load audio buffer Silvio <silvio@internet.com> - 2019-04-10 01:15 +0200
            Re: Webaudio configure load audio buffer Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-04-09 16:27 -0700
              Re: Webaudio configure load audio buffer Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-04-10 07:24 -0700
              Re: Webaudio configure load audio buffer John G Harris <niam@jghnorth.org.uk.invalid> - 2019-04-10 19:05 +0100
                Re: Webaudio configure load audio buffer "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-04-10 22:44 +0200

#36329 — Webaudio configure load audio buffer

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2019-04-07 22:50 -0700
SubjectWebaudio configure load audio buffer
Message-ID<c3a39111-bdb3-4117-a6fd-197f7013b273@googlegroups.com>
I try to load a local file to play from audiobuffer, but i can not get it to work. It complain about its not an audiobuffer, anyone?

var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
// Stereo
var channels = 2;
var frameCount = audioCtx.sampleRate * 2.0;
var audiobuffer = audioCtx.createBuffer(channels, frameCount, audioCtx.sampleRate);

function loadFileAsAudio()
{
    var fileToLoad = document.getElementById("fileToLoad").files[0];
    //str= document.getElementById("fileToLoad").value;
    //myArr = str.split("\\");
    //var filename=myArr[2];
    //document.getElementById("inputFileNameToSaveAs").value = filename;
    var fileReader = new FileReader();
    fileReader.onload = function(fileLoadedEvent)
    {
        audiobuffer = fileLoadedEvent.target.result;
        audioobject = audioCtx.createBufferSource();
        audioobject.buffer = audiobuffer;
      
    };
    fileReader.readAsArrayBuffer(fileToLoad);
     
}

function playAudio(){
  //Create an audiobuffer
  audioobject.noteOn(0);
  //Load buffer for playing
  audioobject.connect(audioCtx.destination);
  // Start play buffer
  audioobject.start();
}

[toc] | [next] | [standalone]


#36330

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2019-04-09 00:58 -0700
Message-ID<d517303b-f2b5-4316-b552-96f414d02ae2@googlegroups.com>
In reply to#36329
Den måndag 8 april 2019 kl. 07:50:50 UTC+2 skrev Jonas Thörnvall:
> I try to load a local file to play from audiobuffer, but i can not get it to work. It complain about its not an audiobuffer, anyone?
> 
> var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
> // Stereo
> var channels = 2;
> var frameCount = audioCtx.sampleRate * 2.0;
> var audiobuffer = audioCtx.createBuffer(channels, frameCount, audioCtx.sampleRate);
> 
> function loadFileAsAudio()
> {
>     var fileToLoad = document.getElementById("fileToLoad").files[0];
>     //str= document.getElementById("fileToLoad").value;
>     //myArr = str.split("\\");
>     //var filename=myArr[2];
>     //document.getElementById("inputFileNameToSaveAs").value = filename;
>     var fileReader = new FileReader();
>     fileReader.onload = function(fileLoadedEvent)
>     {
>         audiobuffer = fileLoadedEvent.target.result;
>         audioobject = audioCtx.createBufferSource();
>         audioobject.buffer = audiobuffer;
>       
>     };
>     fileReader.readAsArrayBuffer(fileToLoad);
>      
> }
> 
> function playAudio(){
>   //Create an audiobuffer
>   audioobject.noteOn(0);
>   //Load buffer for playing
>   audioobject.connect(audioCtx.destination);
>   // Start play buffer
>   audioobject.start();
> }

I was hoping i could do my little synth local from start, without having to pull the audiophile from a server, could someone help me out?

[toc] | [prev] | [next] | [standalone]


#36331

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2019-04-09 17:35 +0200
Message-ID<XnsAA2CB2F23AA5eejj99@194.109.6.166>
In reply to#36330
Jonas_Thornvall <jonas.thornvall@gmail.com> wrote on 09
Apr 2019 in comp.lang.javascript: 

> I was hoping i could do my little synth local from start, without having
> to pull the audiophile from a server, could someone help me out? 

"Pull the audiophile"?? 

"An audiophile is a person who is enthusiastic about high-fidelity sound 
reproduction. An audiophile seeks to reproduce the sound of a live musical 
performance, typically in a room with good acoustics. It is widely agreed 
that reaching this goal is very difficult and that even the best-regarded 
recording and playback systems rarely, if ever, achieve it.

Audiophile values may be applied at all stages of music reproduction: the 
initial audio recording, the production process, and the playback, which is 
usually in a home setting. In general, the values of an audiophile are seen 
to be antithetical to the growing popularity of more convenient but lower 
quality music, especially lossy digital file types like MP3, lower 
definition streaming services, and inexpensive headphones."

<https://en.wikipedia.org/wiki/Audiophile>

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#36332

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2019-04-09 09:56 -0700
Message-ID<2c6fd3d4-cedc-4c93-944f-702c9b9ea066@googlegroups.com>
In reply to#36331
Den tisdag 9 april 2019 kl. 17:35:58 UTC+2 skrev Evertjan.:
> Jonas_Thornvall <jonas.thornvall@gmail.com> wrote on 09
> Apr 2019 in comp.lang.javascript: 
> 
> > I was hoping i could do my little synth local from start, without having
> > to pull the audiophile from a server, could someone help me out? 
> 
> "Pull the audiophile"?? 
> 
> "An audiophile is a person who is enthusiastic about high-fidelity sound 
> reproduction. An audiophile seeks to reproduce the sound of a live musical 
> performance, typically in a room with good acoustics. It is widely agreed 
> that reaching this goal is very difficult and that even the best-regarded 
> recording and playback systems rarely, if ever, achieve it.
> 
> Audiophile values may be applied at all stages of music reproduction: the 
> initial audio recording, the production process, and the playback, which is 
> usually in a home setting. In general, the values of an audiophile are seen 
> to be antithetical to the growing popularity of more convenient but lower 
> quality music, especially lossy digital file types like MP3, lower 
> definition streaming services, and inexpensive headphones."
> 
> <https://en.wikipedia.org/wiki/Audiophile>
> 
> -- 
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)

Yeah that is right, LoL

[toc] | [prev] | [next] | [standalone]


#36333

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2019-04-09 13:01 -0700
Message-ID<98ddcf99-91b4-4691-966b-35e464d58ce1@googlegroups.com>
In reply to#36331
Den tisdag 9 april 2019 kl. 17:35:58 UTC+2 skrev Evertjan.:
> Jonas_Thornvall <jonas.thornvall@gmail.com> wrote on 09
> Apr 2019 in comp.lang.javascript: 
> 
> > I was hoping i could do my little synth local from start, without having
> > to pull the audiophile from a server, could someone help me out? 
> 
> "Pull the audiophile"?? 
> 
> "An audiophile is a person who is enthusiastic about high-fidelity sound 
> reproduction. An audiophile seeks to reproduce the sound of a live musical 
> performance, typically in a room with good acoustics. It is widely agreed 
> that reaching this goal is very difficult and that even the best-regarded 
> recording and playback systems rarely, if ever, achieve it.
> 
> Audiophile values may be applied at all stages of music reproduction: the 
> initial audio recording, the production process, and the playback, which is 
> usually in a home setting. In general, the values of an audiophile are seen 
> to be antithetical to the growing popularity of more convenient but lower 
> quality music, especially lossy digital file types like MP3, lower 
> definition streaming services, and inexpensive headphones."
> 
> <https://en.wikipedia.org/wiki/Audiophile>
> 
> -- 
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)

*The nice guys* a Web Music Developers JP helped me out.
But understanding js syntax is like pusselgames where the game changes after each bit layed.

audioCtx.decodeAudioData(arraybuffer).then((audioBuffer) => {
What is then(audioBuffer)=> { supposed to mean???

<html>
<head>
<script>
var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
var audiobuffer = null;
var source = null;

function loadFileAsAudio() 
{ 
    var file = document.getElementById("fileToLoad").files[0]; 
    var fileReader = new FileReader();
 
    fileReader.onload = () => { 
       var arraybuffer = fileReader.result; 
        audioCtx.decodeAudioData(arraybuffer).then((audioBuffer) => {
           source = audioCtx.createBufferSource();
           source.buffer = audioBuffer;
       });
    };
    fileReader.readAsArrayBuffer(file); 
 } 

function playAudio()
{ 
  source.connect(audioCtx.destination); 
  source.start(0);
}

</script>
</head>
<body>
<label class="custom-file-upload">
<input type="file"/ id="fileToLoad" onchange="loadFileAsAudio()">
</label>
<textarea id="inputTextToSave" cols="80" rows="15"></textarea><br>
<button onclick=playAudio();>play</button>
</body>
</html> 

[toc] | [prev] | [next] | [standalone]


#36334

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2019-04-09 13:46 -0700
Message-ID<4ab572f7-78df-4349-a664-5a5ac67b845f@googlegroups.com>
In reply to#36329
Den måndag 8 april 2019 kl. 07:50:50 UTC+2 skrev Jonas Thörnvall:
> I try to load a local file to play from audiobuffer, but i can not get it to work. It complain about its not an audiobuffer, anyone?
> 
> var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
> // Stereo
> var channels = 2;
> var frameCount = audioCtx.sampleRate * 2.0;
> var audiobuffer = audioCtx.createBuffer(channels, frameCount, audioCtx.sampleRate);
> 
> function loadFileAsAudio()
> {
>     var fileToLoad = document.getElementById("fileToLoad").files[0];
>     //str= document.getElementById("fileToLoad").value;
>     //myArr = str.split("\\");
>     //var filename=myArr[2];
>     //document.getElementById("inputFileNameToSaveAs").value = filename;
>     var fileReader = new FileReader();
>     fileReader.onload = function(fileLoadedEvent)
>     {
>         audiobuffer = fileLoadedEvent.target.result;
>         audioobject = audioCtx.createBufferSource();
>         audioobject.buffer = audiobuffer;
>       
>     };
>     fileReader.readAsArrayBuffer(fileToLoad);
>      
> }
> 
> function playAudio(){
>   //Create an audiobuffer
>   audioobject.noteOn(0);
>   //Load buffer for playing
>   audioobject.connect(audioCtx.destination);
>   // Start play buffer
>   audioobject.start();
> }

I am pretty tired to read the assbroken syntax coming out of the javascript community. What is this actually supposed to mean? Is there a way to rewrite it to something that actually make sense reading?

To most "normal" people then((audiBuffer) is a nonsense statement it is just syntax followed by => to me that is equal or bigger { curlbrackets. 

Who is the moron that come up with this conceptual? syntax and in what context, and what is it suppoed to mean?
This kind of syntax is what happens when morons in charge of developing the syntax of a language. Soon there will be blip, blop, schabang**, futur@ss and goofy included. Are you guys suddenly in contest with the perl guys?

  audioCtx.decodeAudioData(arraybuffer).then((audioBuffer) => {
         //  loadedAudio = audioCtx.createBufferSource();
         //  loadedAudio.buffer = audioBuffer;
    });

[toc] | [prev] | [next] | [standalone]


#36335

FromSilvio <silvio@internet.com>
Date2019-04-09 23:52 +0200
Message-ID<5cad141f$0$3558$e4fe514c@newszilla.xs4all.nl>
In reply to#36334
On 09-04-19 22:46, Jonas Thörnvall wrote:
> Den måndag 8 april 2019 kl. 07:50:50 UTC+2 skrev Jonas Thörnvall:
>> I try to load a local file to play from audiobuffer, but i can not get it to work. It complain about its not an audiobuffer, anyone?
>>
>> var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
>> // Stereo
>> var channels = 2;
>> var frameCount = audioCtx.sampleRate * 2.0;
>> var audiobuffer = audioCtx.createBuffer(channels, frameCount, audioCtx.sampleRate);
>>
>> function loadFileAsAudio()
>> {
>>      var fileToLoad = document.getElementById("fileToLoad").files[0];
>>      //str= document.getElementById("fileToLoad").value;
>>      //myArr = str.split("\\");
>>      //var filename=myArr[2];
>>      //document.getElementById("inputFileNameToSaveAs").value = filename;
>>      var fileReader = new FileReader();
>>      fileReader.onload = function(fileLoadedEvent)
>>      {
>>          audiobuffer = fileLoadedEvent.target.result;
>>          audioobject = audioCtx.createBufferSource();
>>          audioobject.buffer = audiobuffer;
>>        
>>      };
>>      fileReader.readAsArrayBuffer(fileToLoad);
>>       
>> }
>>
>> function playAudio(){
>>    //Create an audiobuffer
>>    audioobject.noteOn(0);
>>    //Load buffer for playing
>>    audioobject.connect(audioCtx.destination);
>>    // Start play buffer
>>    audioobject.start();
>> }
> 
> I am pretty tired to read the assbroken syntax coming out of the javascript community. What is this actually supposed to mean? Is there a way to rewrite it to something that actually make sense reading?
> 
> To most "normal" people then((audiBuffer) is a nonsense statement it is just syntax followed by => to me that is equal or bigger { curlbrackets.
> 
> Who is the moron that come up with this conceptual? syntax and in what context, and what is it suppoed to mean?
> This kind of syntax is what happens when morons in charge of developing the syntax of a language. Soon there will be blip, blop, schabang**, futur@ss and goofy included. Are you guys suddenly in contest with the perl guys?
> 
>    audioCtx.decodeAudioData(arraybuffer).then((audioBuffer) => {
>           //  loadedAudio = audioCtx.createBufferSource();
>           //  loadedAudio.buffer = audioBuffer;
>      });
> 

For someone who has been messing around with code as long as you have 
you demonstrate an incredible inability to grasp syntax, let alone 
semantics which follow syntax.

You still can not dissect a simple expression (just like an earlier 
instance where you could not grasp expressions of the form a[b] = c) 
which gives you zero chance of doing anything other than blind trial and 
error "programming".

Against better judgment (or for the sake of someone who may actually 
learn from this) I will give it a last shot:

This breaks down to:

a.then(b)

where b is of the form:

c => d

The former is a simple method call like the many ones you have defiled 
already. The latter is called an arrow function expression which is 
shorthand syntax for a function, not unlike the ones that have befuddled 
you already.

[toc] | [prev] | [next] | [standalone]


#36336

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2019-04-09 15:57 -0700
Message-ID<e7ba73e3-c1f8-4404-b78a-8ff67bf023b0@googlegroups.com>
In reply to#36335
Den tisdag 9 april 2019 kl. 23:52:36 UTC+2 skrev Silvio:
> On 09-04-19 22:46, Jonas Thörnvall wrote:
> > Den måndag 8 april 2019 kl. 07:50:50 UTC+2 skrev Jonas Thörnvall:
> >> I try to load a local file to play from audiobuffer, but i can not get it to work. It complain about its not an audiobuffer, anyone?
> >>
> >> var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
> >> // Stereo
> >> var channels = 2;
> >> var frameCount = audioCtx.sampleRate * 2.0;
> >> var audiobuffer = audioCtx.createBuffer(channels, frameCount, audioCtx.sampleRate);
> >>
> >> function loadFileAsAudio()
> >> {
> >>      var fileToLoad = document.getElementById("fileToLoad").files[0];
> >>      //str= document.getElementById("fileToLoad").value;
> >>      //myArr = str.split("\\");
> >>      //var filename=myArr[2];
> >>      //document.getElementById("inputFileNameToSaveAs").value = filename;
> >>      var fileReader = new FileReader();
> >>      fileReader.onload = function(fileLoadedEvent)
> >>      {
> >>          audiobuffer = fileLoadedEvent.target.result;
> >>          audioobject = audioCtx.createBufferSource();
> >>          audioobject.buffer = audiobuffer;
> >>        
> >>      };
> >>      fileReader.readAsArrayBuffer(fileToLoad);
> >>       
> >> }
> >>
> >> function playAudio(){
> >>    //Create an audiobuffer
> >>    audioobject.noteOn(0);
> >>    //Load buffer for playing
> >>    audioobject.connect(audioCtx.destination);
> >>    // Start play buffer
> >>    audioobject.start();
> >> }
> > 
> > I am pretty tired to read the assbroken syntax coming out of the javascript community. What is this actually supposed to mean? Is there a way to rewrite it to something that actually make sense reading?
> > 
> > To most "normal" people then((audiBuffer) is a nonsense statement it is just syntax followed by => to me that is equal or bigger { curlbrackets.
> > 
> > Who is the moron that come up with this conceptual? syntax and in what context, and what is it suppoed to mean?
> > This kind of syntax is what happens when morons in charge of developing the syntax of a language. Soon there will be blip, blop, schabang**, futur@ss and goofy included. Are you guys suddenly in contest with the perl guys?
> > 
> >    audioCtx.decodeAudioData(arraybuffer).then((audioBuffer) => {
> >           //  loadedAudio = audioCtx.createBufferSource();
> >           //  loadedAudio.buffer = audioBuffer;
> >      });
> > 
> 
> For someone who has been messing around with code as long as you have 
> you demonstrate an incredible inability to grasp syntax, let alone 
> semantics which follow syntax.
> 
> You still can not dissect a simple expression (just like an earlier 
> instance where you could not grasp expressions of the form a[b] = c) 
> which gives you zero chance of doing anything other than blind trial and 
> error "programming".
> 
> Against better judgment (or for the sake of someone who may actually 
> learn from this) I will give it a last shot:
> 
> This breaks down to:
> 
> a.then(b)
> 
> where b is of the form:
> 
> c => d
> 
> The former is a simple method call like the many ones you have defiled 
> already. The latter is called an arrow function expression which is 
> shorthand syntax for a function, not unlike the ones that have befuddled 
> you already.

No no Silvio i have not problem with assignments of variables to array indexes.
And no no no there is no fucking method audiobuffer

What do you mean is in the form of c => d there is no such variables. I want to know what it fucking means in english.

This for example means
c[b]=a 
variable a is assigned index b in array c **that is what it means**

while (a<b) "and that is what it fucking means

for (i=0;i<10;i++) Add one to i for each occurence in loop starting at 0 ending at 9

b=a.length method means give variable b length of a

So you see just recently javascript had a reasonable syntax with method and function calls.

But some snivelling little maggot manage to make the syntax incomprehensible.
So what the fuck does audioCtx.decodeAudioData(arraybuffer).then((audioBuffer) => { 

Explain it in words in plain english.
It can't be that fucking hard if you actually know what it means, and just not reaggurate phrases you learnt.

[toc] | [prev] | [next] | [standalone]


#36337

FromSilvio <silvio@internet.com>
Date2019-04-10 01:15 +0200
Message-ID<5cad278a$0$3528$e4fe514c@newszilla.xs4all.nl>
In reply to#36336
On 10-04-19 00:57, Jonas Thörnvall wrote:
> Den tisdag 9 april 2019 kl. 23:52:36 UTC+2 skrev Silvio:
>> On 09-04-19 22:46, Jonas Thörnvall wrote:
>>> Den måndag 8 april 2019 kl. 07:50:50 UTC+2 skrev Jonas Thörnvall:
>>>> I try to load a local file to play from audiobuffer, but i can not get it to work. It complain about its not an audiobuffer, anyone?
>>>>
>>>> var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
>>>> // Stereo
>>>> var channels = 2;
>>>> var frameCount = audioCtx.sampleRate * 2.0;
>>>> var audiobuffer = audioCtx.createBuffer(channels, frameCount, audioCtx.sampleRate);
>>>>
>>>> function loadFileAsAudio()
>>>> {
>>>>       var fileToLoad = document.getElementById("fileToLoad").files[0];
>>>>       //str= document.getElementById("fileToLoad").value;
>>>>       //myArr = str.split("\\");
>>>>       //var filename=myArr[2];
>>>>       //document.getElementById("inputFileNameToSaveAs").value = filename;
>>>>       var fileReader = new FileReader();
>>>>       fileReader.onload = function(fileLoadedEvent)
>>>>       {
>>>>           audiobuffer = fileLoadedEvent.target.result;
>>>>           audioobject = audioCtx.createBufferSource();
>>>>           audioobject.buffer = audiobuffer;
>>>>         
>>>>       };
>>>>       fileReader.readAsArrayBuffer(fileToLoad);
>>>>        
>>>> }
>>>>
>>>> function playAudio(){
>>>>     //Create an audiobuffer
>>>>     audioobject.noteOn(0);
>>>>     //Load buffer for playing
>>>>     audioobject.connect(audioCtx.destination);
>>>>     // Start play buffer
>>>>     audioobject.start();
>>>> }
>>>
>>> I am pretty tired to read the assbroken syntax coming out of the javascript community. What is this actually supposed to mean? Is there a way to rewrite it to something that actually make sense reading?
>>>
>>> To most "normal" people then((audiBuffer) is a nonsense statement it is just syntax followed by => to me that is equal or bigger { curlbrackets.
>>>
>>> Who is the moron that come up with this conceptual? syntax and in what context, and what is it suppoed to mean?
>>> This kind of syntax is what happens when morons in charge of developing the syntax of a language. Soon there will be blip, blop, schabang**, futur@ss and goofy included. Are you guys suddenly in contest with the perl guys?
>>>
>>>     audioCtx.decodeAudioData(arraybuffer).then((audioBuffer) => {
>>>            //  loadedAudio = audioCtx.createBufferSource();
>>>            //  loadedAudio.buffer = audioBuffer;
>>>       });
>>>
>>
>> For someone who has been messing around with code as long as you have
>> you demonstrate an incredible inability to grasp syntax, let alone
>> semantics which follow syntax.
>>
>> You still can not dissect a simple expression (just like an earlier
>> instance where you could not grasp expressions of the form a[b] = c)
>> which gives you zero chance of doing anything other than blind trial and
>> error "programming".
>>
>> Against better judgment (or for the sake of someone who may actually
>> learn from this) I will give it a last shot:
>>
>> This breaks down to:
>>
>> a.then(b)
>>
>> where b is of the form:
>>
>> c => d
>>
>> The former is a simple method call like the many ones you have defiled
>> already. The latter is called an arrow function expression which is
>> shorthand syntax for a function, not unlike the ones that have befuddled
>> you already.
> 
> No no Silvio i have not problem with assignments of variables to array indexes.
> And no no no there is no fucking method audiobuffer
> 
> What do you mean is in the form of c => d there is no such variables. I want to know what it fucking means in english.
> 
> This for example means
> c[b]=a
> variable a is assigned index b in array c **that is what it means**
> 
> while (a<b) "and that is what it fucking means
> 
> for (i=0;i<10;i++) Add one to i for each occurence in loop starting at 0 ending at 9
> 
> b=a.length method means give variable b length of a

This is the only place I will step in because this sentence perfectly 
exhibits your incapacity.

b=a.length

does NOT mean "give variable b length of a". Period.

b=xxx

firstly means evaluate expression xxx and assign the result to variable b.

a.length

secondly is a method call that happens to return the length of a.

These are in essence completely unrelated parts. Only if you are able to 
dissect compound expressions into smaller ones and understand how the 
semantics of each sub-expression combine into the semantics of the 
compound expression can you understand code in general.

> 
> So you see just recently javascript had a reasonable syntax with method and function calls.
> 
> But some snivelling little maggot manage to make the syntax incomprehensible.
> So what the fuck does audioCtx.decodeAudioData(arraybuffer).then((audioBuffer) => {
> 
> Explain it in words in plain english.
> It can't be that fucking hard if you actually know what it means, and just not reaggurate phrases you learnt.
> 

I dissected this piece of code you fail to understand today into its two 
essential parts, thus explaining that it is a simple method (named 
"then") call where the actual parameter of the call is an anonymous 
function with one formal parameter (named "audioBuffer").

The problem here is your cognitive inability and not the syntax or even 
semantics of JavaScript or any other programming language.

[toc] | [prev] | [next] | [standalone]


#36338

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2019-04-09 16:27 -0700
Message-ID<1fac13f8-d69c-4695-b61d-6902197edb62@googlegroups.com>
In reply to#36337
Den onsdag 10 april 2019 kl. 01:15:49 UTC+2 skrev Silvio:
> On 10-04-19 00:57, Jonas Thörnvall wrote:
> > Den tisdag 9 april 2019 kl. 23:52:36 UTC+2 skrev Silvio:
> >> On 09-04-19 22:46, Jonas Thörnvall wrote:
> >>> Den måndag 8 april 2019 kl. 07:50:50 UTC+2 skrev Jonas Thörnvall:
> >>>> I try to load a local file to play from audiobuffer, but i can not get it to work. It complain about its not an audiobuffer, anyone?
> >>>>
> >>>> var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
> >>>> // Stereo
> >>>> var channels = 2;
> >>>> var frameCount = audioCtx.sampleRate * 2.0;
> >>>> var audiobuffer = audioCtx.createBuffer(channels, frameCount, audioCtx.sampleRate);
> >>>>
> >>>> function loadFileAsAudio()
> >>>> {
> >>>>       var fileToLoad = document.getElementById("fileToLoad").files[0];
> >>>>       //str= document.getElementById("fileToLoad").value;
> >>>>       //myArr = str.split("\\");
> >>>>       //var filename=myArr[2];
> >>>>       //document.getElementById("inputFileNameToSaveAs").value = filename;
> >>>>       var fileReader = new FileReader();
> >>>>       fileReader.onload = function(fileLoadedEvent)
> >>>>       {
> >>>>           audiobuffer = fileLoadedEvent.target.result;
> >>>>           audioobject = audioCtx.createBufferSource();
> >>>>           audioobject.buffer = audiobuffer;
> >>>>         
> >>>>       };
> >>>>       fileReader.readAsArrayBuffer(fileToLoad);
> >>>>        
> >>>> }
> >>>>
> >>>> function playAudio(){
> >>>>     //Create an audiobuffer
> >>>>     audioobject.noteOn(0);
> >>>>     //Load buffer for playing
> >>>>     audioobject.connect(audioCtx.destination);
> >>>>     // Start play buffer
> >>>>     audioobject.start();
> >>>> }
> >>>
> >>> I am pretty tired to read the assbroken syntax coming out of the javascript community. What is this actually supposed to mean? Is there a way to rewrite it to something that actually make sense reading?
> >>>
> >>> To most "normal" people then((audiBuffer) is a nonsense statement it is just syntax followed by => to me that is equal or bigger { curlbrackets.
> >>>
> >>> Who is the moron that come up with this conceptual? syntax and in what context, and what is it suppoed to mean?
> >>> This kind of syntax is what happens when morons in charge of developing the syntax of a language. Soon there will be blip, blop, schabang**, futur@ss and goofy included. Are you guys suddenly in contest with the perl guys?
> >>>
> >>>     audioCtx.decodeAudioData(arraybuffer).then((audioBuffer) => {
> >>>            //  loadedAudio = audioCtx.createBufferSource();
> >>>            //  loadedAudio.buffer = audioBuffer;
> >>>       });
> >>>
> >>
> >> For someone who has been messing around with code as long as you have
> >> you demonstrate an incredible inability to grasp syntax, let alone
> >> semantics which follow syntax.
> >>
> >> You still can not dissect a simple expression (just like an earlier
> >> instance where you could not grasp expressions of the form a[b] = c)
> >> which gives you zero chance of doing anything other than blind trial and
> >> error "programming".
> >>
> >> Against better judgment (or for the sake of someone who may actually
> >> learn from this) I will give it a last shot:
> >>
> >> This breaks down to:
> >>
> >> a.then(b)
> >>
> >> where b is of the form:
> >>
> >> c => d
> >>
> >> The former is a simple method call like the many ones you have defiled
> >> already. The latter is called an arrow function expression which is
> >> shorthand syntax for a function, not unlike the ones that have befuddled
> >> you already.
> > 
> > No no Silvio i have not problem with assignments of variables to array indexes.
> > And no no no there is no fucking method audiobuffer
> > 
> > What do you mean is in the form of c => d there is no such variables. I want to know what it fucking means in english.
> > 
> > This for example means
> > c[b]=a
> > variable a is assigned index b in array c **that is what it means**
> > 
> > while (a<b) "and that is what it fucking means
> > 
> > for (i=0;i<10;i++) Add one to i for each occurence in loop starting at 0 ending at 9
> > 
> > b=a.length method means give variable b length of a
> 
> This is the only place I will step in because this sentence perfectly 
> exhibits your incapacity.
> 
> b=a.length
> 
> does NOT mean "give variable b length of a". Period.
> 
> b=xxx
> 
> firstly means evaluate expression xxx and assign the result to variable b.
> 
> a.length
> 
> secondly is a method call that happens to return the length of a.
> 
> These are in essence completely unrelated parts. Only if you are able to 
> dissect compound expressions into smaller ones and understand how the 
> semantics of each sub-expression combine into the semantics of the 
> compound expression can you understand code in general.
> 
> > 
> > So you see just recently javascript had a reasonable syntax with method and function calls.
> > 
> > But some snivelling little maggot manage to make the syntax incomprehensible.
> > So what the fuck does audioCtx.decodeAudioData(arraybuffer).then((audioBuffer) => {
> > 
> > Explain it in words in plain english.
> > It can't be that fucking hard if you actually know what it means, and just not reaggurate phrases you learnt.
> > 
> 
> I dissected this piece of code you fail to understand today into its two 
> essential parts, thus explaining that it is a simple method (named 
> "then") call where the actual parameter of the call is an anonymous 
> function with one formal parameter (named "audioBuffer").
> 
> The problem here is your cognitive inability and not the syntax or even 
> semantics of JavaScript or any other programming language.

I can tell you one thing there is nothing wrong with cognitive abilities they are far superior yours, in fact i measure 178 in IQ. So the problem is not there , you see the whole idea of high level languages and scripting languages in special was to lift them from codeboook drivel to something that could have a close semantical meaning, because it meant that people who weren't interested in learning codebooks by heart shouuld be able to simply read out semantical statements directly from the syntax "and method and function names". Thus script languages was created, with roots from high level languages in education like Pascal.

No the nilly willy little low IQ fuckers who like to learn codebooks by heart, can't stand that people that is not interested in learning programmming languages can do things thus the little pillowbiters must throw in incomprehensible codebook shit within the semantical context of the syntax.

So you see that is what is going on, low IQ entps who take pride in learn by heart, take over projects and sneak in their shitty nonsensical codebook syntax to replace the semantic context within the programming language.

Now you may not have the IQ to see it is going on, but i have and it piss me off.

[toc] | [prev] | [next] | [standalone]


#36340

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2019-04-10 07:24 -0700
Message-ID<00bd78a2-7cd7-4014-9d50-9f03d3b71e03@googlegroups.com>
In reply to#36338
Den onsdag 10 april 2019 kl. 01:27:24 UTC+2 skrev Jonas Thörnvall:
> Den onsdag 10 april 2019 kl. 01:15:49 UTC+2 skrev Silvio:
> > On 10-04-19 00:57, Jonas Thörnvall wrote:
> > > Den tisdag 9 april 2019 kl. 23:52:36 UTC+2 skrev Silvio:
> > >> On 09-04-19 22:46, Jonas Thörnvall wrote:
> > >>> Den måndag 8 april 2019 kl. 07:50:50 UTC+2 skrev Jonas Thörnvall:
> > >>>> I try to load a local file to play from audiobuffer, but i can not get it to work. It complain about its not an audiobuffer, anyone?
> > >>>>
> > >>>> var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
> > >>>> // Stereo
> > >>>> var channels = 2;
> > >>>> var frameCount = audioCtx.sampleRate * 2.0;
> > >>>> var audiobuffer = audioCtx.createBuffer(channels, frameCount, audioCtx.sampleRate);
> > >>>>
> > >>>> function loadFileAsAudio()
> > >>>> {
> > >>>>       var fileToLoad = document.getElementById("fileToLoad").files[0];
> > >>>>       //str= document.getElementById("fileToLoad").value;
> > >>>>       //myArr = str.split("\\");
> > >>>>       //var filename=myArr[2];
> > >>>>       //document.getElementById("inputFileNameToSaveAs").value = filename;
> > >>>>       var fileReader = new FileReader();
> > >>>>       fileReader.onload = function(fileLoadedEvent)
> > >>>>       {
> > >>>>           audiobuffer = fileLoadedEvent.target.result;
> > >>>>           audioobject = audioCtx.createBufferSource();
> > >>>>           audioobject.buffer = audiobuffer;
> > >>>>         
> > >>>>       };
> > >>>>       fileReader.readAsArrayBuffer(fileToLoad);
> > >>>>        
> > >>>> }
> > >>>>
> > >>>> function playAudio(){
> > >>>>     //Create an audiobuffer
> > >>>>     audioobject.noteOn(0);
> > >>>>     //Load buffer for playing
> > >>>>     audioobject.connect(audioCtx.destination);
> > >>>>     // Start play buffer
> > >>>>     audioobject.start();
> > >>>> }
> > >>>
> > >>> I am pretty tired to read the assbroken syntax coming out of the javascript community. What is this actually supposed to mean? Is there a way to rewrite it to something that actually make sense reading?
> > >>>
> > >>> To most "normal" people then((audiBuffer) is a nonsense statement it is just syntax followed by => to me that is equal or bigger { curlbrackets.
> > >>>
> > >>> Who is the moron that come up with this conceptual? syntax and in what context, and what is it suppoed to mean?
> > >>> This kind of syntax is what happens when morons in charge of developing the syntax of a language. Soon there will be blip, blop, schabang**, futur@ss and goofy included. Are you guys suddenly in contest with the perl guys?
> > >>>
> > >>>     audioCtx.decodeAudioData(arraybuffer).then((audioBuffer) => {
> > >>>            //  loadedAudio = audioCtx.createBufferSource();
> > >>>            //  loadedAudio.buffer = audioBuffer;
> > >>>       });
> > >>>
> > >>
> > >> For someone who has been messing around with code as long as you have
> > >> you demonstrate an incredible inability to grasp syntax, let alone
> > >> semantics which follow syntax.
> > >>
> > >> You still can not dissect a simple expression (just like an earlier
> > >> instance where you could not grasp expressions of the form a[b] = c)
> > >> which gives you zero chance of doing anything other than blind trial and
> > >> error "programming".
> > >>
> > >> Against better judgment (or for the sake of someone who may actually
> > >> learn from this) I will give it a last shot:
> > >>
> > >> This breaks down to:
> > >>
> > >> a.then(b)
> > >>
> > >> where b is of the form:
> > >>
> > >> c => d
> > >>
> > >> The former is a simple method call like the many ones you have defiled
> > >> already. The latter is called an arrow function expression which is
> > >> shorthand syntax for a function, not unlike the ones that have befuddled
> > >> you already.
> > > 
> > > No no Silvio i have not problem with assignments of variables to array indexes.
> > > And no no no there is no fucking method audiobuffer
> > > 
> > > What do you mean is in the form of c => d there is no such variables. I want to know what it fucking means in english.
> > > 
> > > This for example means
> > > c[b]=a
> > > variable a is assigned index b in array c **that is what it means**
> > > 
> > > while (a<b) "and that is what it fucking means
> > > 
> > > for (i=0;i<10;i++) Add one to i for each occurence in loop starting at 0 ending at 9
> > > 
> > > b=a.length method means give variable b length of a
> > 
> > This is the only place I will step in because this sentence perfectly 
> > exhibits your incapacity.
> > 
> > b=a.length
> > 
> > does NOT mean "give variable b length of a". Period.
> > 
> > b=xxx
> > 
> > firstly means evaluate expression xxx and assign the result to variable b.
> > 
> > a.length
> > 
> > secondly is a method call that happens to return the length of a.
> > 
> > These are in essence completely unrelated parts. Only if you are able to 
> > dissect compound expressions into smaller ones and understand how the 
> > semantics of each sub-expression combine into the semantics of the 
> > compound expression can you understand code in general.
> > 
> > > 
> > > So you see just recently javascript had a reasonable syntax with method and function calls.
> > > 
> > > But some snivelling little maggot manage to make the syntax incomprehensible.
> > > So what the fuck does audioCtx.decodeAudioData(arraybuffer).then((audioBuffer) => {
> > > 
> > > Explain it in words in plain english.
> > > It can't be that fucking hard if you actually know what it means, and just not reaggurate phrases you learnt.
> > > 
> > 
> > I dissected this piece of code you fail to understand today into its two 
> > essential parts, thus explaining that it is a simple method (named 
> > "then") call where the actual parameter of the call is an anonymous 
> > function with one formal parameter (named "audioBuffer").
> > 
> > The problem here is your cognitive inability and not the syntax or even 
> > semantics of JavaScript or any other programming language.
> 
> I can tell you one thing there is nothing wrong with cognitive abilities they are far superior yours, in fact i measure 178 in IQ. So the problem is not there , you see the whole idea of high level languages and scripting languages in special was to lift them from codeboook drivel to something that could have a close semantical meaning, because it meant that people who weren't interested in learning codebooks by heart shouuld be able to simply read out semantical statements directly from the syntax "and method and function names". Thus script languages was created, with roots from high level languages in education like Pascal.
> 
> No the nilly willy little low IQ fuckers who like to learn codebooks by heart, can't stand that people that is not interested in learning programmming languages can do things thus the little pillowbiters must throw in incomprehensible codebook shit within the semantical context of the syntax.
> 
> So you see that is what is going on, low IQ entps who take pride in learn by heart, take over projects and sneak in their shitty nonsensical codebook syntax to replace the semantic context within the programming language.
> 
> Now you may not have the IQ to see it is going on, but i have and it piss me off.

Personally i think that people inclined to codebook syntax should not work with developing high level languages, if they want shortcuts and stuffing things into things piping expression into eachother they should build their own parser, and then they can go on blipblopping, perling or whatever they like. Isn't there a fucking perl parser to Javascript alread for those guys?

[toc] | [prev] | [next] | [standalone]


#36341

FromJohn G Harris <niam@jghnorth.org.uk.invalid>
Date2019-04-10 19:05 +0100
Message-ID<o1csaeh5r04na19dk52lv3cvjhb3ku9uv8@4ax.com>
In reply to#36338
On Tue, 9 Apr 2019 16:27:15 -0700 (PDT), Jonas Thörnvall
<jonas.thornvall@gmail.com> wrote:


  <snip>
>in fact i measure 178 in IQ.

It's well known that people who have won a Nobel prize can say and
write very silly things.

  <snip>
>So you see that is what is going on, low IQ entps who take pride in learn by heart, take over projects and sneak in their shitty nonsensical codebook syntax to replace the semantic context within the programming language.
  <snip>

Perhaps they use short-cut syntax to make it difficult for other
people to steal their code.

  John

[toc] | [prev] | [next] | [standalone]


#36343

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2019-04-10 22:44 +0200
Message-ID<XnsAA2DE74B5B2DEeejj99@194.109.6.166>
In reply to#36341
John G Harris <niam@jghnorth.org.uk.invalid> wrote on 10 Apr 2019 in 
comp.lang.javascript:

> Perhaps they use short-cut syntax to make it difficult for other
> people to steal their code.

With an IQ of over 177?

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web