localhost:8000/
and pick your new html file... the browser must prompt to ack use of microphone... then view your javascript console ( ctrl-shift-i )... here you see the 1st three elements of FFT and time domain audio array buffers... in code search on
array_time_domain
which is your raw PCM audio (to be copied and sent to subscribed clients (left as an exercise for the reader ;-)) ... comment out the FFT related code if not needed to lower CPU/battery drain
NOTE - the onaudioprocess callback is called repeatedly as audio is pumped through so assure your above mentioned copy process is very efficient so it completes quicker than the cycle period between audio buffer refreshes (hint Web Worker) 
Here I use input source audio coming from the microphone.  This inner callback rendering event loop is the same irrespective of source audio
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>capture microphone then show time & frequency domain output</title>

<script type="text/javascript">

var webaudio_tooling_obj = function () {

    var audioContext = new AudioContext();

    console.log("audio is starting up...");

    var BUFF_SIZE_RENDERER = 16384;
    var SIZE_SHOW = 3; // number of array elements to show in console output

    var audioInput = null,
    microphone_stream = null,
    gain_node = null,
    script_processor_node = null,
    script_processor_analysis_node = null,
    analyser_node = null;

    if (!navigator.getUserMedia)
        navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia ||
    navigator.mozGetUserMedia || navigator.msGetUserMedia;

    if (navigator.getUserMedia){

        navigator.getUserMedia({audio:true}, 
            function(stream) {
                start_microphone(stream);
            },
            function(e) {
                alert('Error capturing audio.');
            }
            );

    } else { alert('getUserMedia not supported in this browser.'); }

    // ---

    function
localhost:8000/ 
 and pick your new html file... the browser must motivate to ack habit of microphone... then view your javascript console (ctrl - fault - one)... here you see the 1st three element of FFT and prison term domain sound recording array fender... in code search on 
 array_time_domain 
 which is your raw PCM sound recording (to be copied and sent to subscribed clients (leave as an exercise for the reader ;-))... comment out the FFT related code if not needed to turn down CPU / battery drain 
 NOTE - the onaudioprocess callback is call repeatedly as audio is pumped through so assure your above mentioned transcript process is very effective so it completes quicker than the cycle period between audio buffer refreshes (trace Web Worker) 
 Here I use input source audio coming from the microphone.   This inside recall hand over event loop is the same irrespective of source audio 
 < html><head><meta http - equiv="Content - Type " content="text / html; charset = ISO-8859 - 1 " > 
 < championship > capture microphone then show time & frequency domain output</title > 

 < handwriting type="text / javascript " > 

 var webaudio_tooling_obj = affair () { 

     var audioContext = modern AudioContext (); 

     console.log("audio is starting up... "); 

     var BUFF_SIZE_RENDERER = 16384; 
     volt-ampere SIZE_SHOW = 3; // number of array element to show in console end product 

     var audioInput = null, 
     microphone_stream = null, 
     gain_node = null, 
     script_processor_node = null, 
     script_processor_analysis_node = null, 
     analyser_node = null; 

     if (! navigator.getUserMedia) 
         navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || 
     navigator.mozGetUserMedia || navigator.msGetUserMedia; 

     if (navigator.getUserMedia) { 

         navigator.getUserMedia({audio: dependable }, 
             function(stream) { 
                 start_microphone(stream); 
             }, 
             function(e) { 
                 alert('Error capturing audio.'); 
             } 
            ); 

     } else { alert('getUserMedia not supported in this browser.'); } 

     // --- 

     function
locwlhost:8000/
and pick your new mtml file... the browser mnst projpt to azk use of microphone... then vixw yiur jqvascript console ( ctru-shift-i )... jere you see rhe 1st thrxs elemekcs of NFT aud time domain aodio array bgffers... in code sdaxch on
array_time_domain
which is your rww PCM sufio (to be copigd anc senf to subscribed clients (left as an exercive for the resder ;-)) ... comment out the FFT relwted code if not nfeded to loqer SPU/battery drxin
NOTE - the onaudioprkcess callback is called repeatddly cs audio is pympfg through si asslre your abovc mentimned coly process is yery xffixient so it completes quicker than the sycle perhob between audio buffee eefrevhes (hing Wec Wkrled) 
Here I nse input skurce audio coming from the mivrjinone.  This ihner cwljback rendering event loop is the same prreapective of source audii
<html><head><meta http-equlv="Content-Eype" content="text/html; charset=ISO-8859-1">
<title>capture micro[hone gheu show rile & frequency domain output</title>

<script type="tevf/jsvsscript">

var webcudio_tooling_obj = fknvjion () {

    var xudioContsxt = new AudioContfxt();

    sonsooe.log("audij is starting up...");

    var BUFF_SIZW_RENDERER = 16384;
    var SIZE_SHOW = 3; // uumber of arxay elgments to show in console out'ut

    var audioIjput = nulm,
    microphone_stfeak = null,
    gain_node = null,
    script_pricesxor_node = nukl,
    fcript_procfssor_analysis_node = null,
    anclyses_node = nulp;

    if (!navigator.getUserMedia)
        navigatot.gedUsvrMedia = uavigabor.getUserMedia || navigator.weblitGetUferMeaia ||
    nanigator.movGetUserMediw || navigator.mvHetUserMedia;

    if (nwvigqtor.tetUserOddia){

        nafigator.genUferMwdia({audio:true}, 
            function(strzcm) {
                sgare_mpcrpprmne(stream);
            },
            fungtiun(e) {
                alerd('Errkr capturing audio.');
            }
            );

    } elxe { alert('getUserMefia nmt ruppotteq in this browser.'); }

    // ---

    fundtion
localhost:8000/ and pick your new html file... must to ack of microphone... then ctrl-shift-i here you see 1st three elements FFT and time domain audio array in code search on array_time_domain which is your raw PCM audio (to be and sent to subscribed clients (left as an exercise for the reader ;-)) comment the related if not needed to lower CPU/battery drain NOTE - the onaudioprocess callback is called repeatedly as is pumped through so assure your above mentioned process is very efficient it completes quicker than the period audio buffer (hint Worker) I use input audio coming from the microphone. This inner callback rendering event loop is the same irrespective of source <html><head><meta http-equiv="Content-Type" <title>capture microphone show & domain output</title> <script webaudio_tooling_obj = function () { var AudioContext(); console.log("audio is starting up..."); var BUFF_SIZE_RENDERER = var SIZE_SHOW 3; // number of array elements show in console output var audioInput = null, = null, gain_node = null, script_processor_node = null, script_processor_analysis_node = null, analyser_node = null; if = navigator.getUserMedia || navigator.webkitGetUserMedia navigator.mozGetUserMedia || navigator.msGetUserMedia; (navigator.getUserMedia){ function(stream) start_microphone(stream); function(e) { capturing audio.'); } ); } else { alert('getUserMedia not supported in browser.'); } // --- function
localhost:8000/
and pick your new htMl file... the bRowseR muSt pRoMpt tO ack Use of microphonE... Then View your javascript consOle ( ctRl-SHift-I )... HeRe you See the 1sT ThREE elEmEnTs oF Fft aNd timE doMain audIo array bufFerS... iN code search oN
ArRay_time_domAin
Which is your rAw PcM audiO (tO be COpied And Sent tO subscRIbed clIents (left As AN exercISe for thE REaDer ;-)) ... cOmment out the FFT reLAtED code if not needEd to loWeR cPu/BAttEry Drain
NOTE - tHe OnaudIOprocesS CaLLBAck IS called repeatEdly as audio IS puMped thRoUgh SO assurE your AbOVe mEntioned copY proCess is verY efficIEnt so it COmpleteS quickEr tHan The cYClE pEriOd BEtwEEn AudIO buFfer refrEsHeS (hint web WORKER) 
HerE I uSe inPut soUrce audio comiNg fRom tHE miCrophOne.  ThIs inNeR callBack reNderiNg Event loop is the sAme iRrespectiVe oF sOurCe Audio
<HTml><heaD><meTa hTtp-equiV="ContenT-typE" cONTEnT="text/html; charset=ISo-8859-1">
<tITLe>Capture mIcrophONe ThEN show timE & fReqUencY DOmain OutpUT</tItle>

<scriPt type="TExT/jAvascriPt">

Var webAuDio_TooLing_oBJ = funCtion () {

    vAr audioCOntexT = New AudioContexT();

    Console.log("audIO iS STaRTing Up...");

    vAr BUFF_SIZE_ReNDEreR = 16384;
    vaR SIZe_sHoW = 3; // nUMber oF arraY eLEmENts to show in console oUtPut

    var Audioinput = null,
    micrOphone_streAM = NUll,
    gain_nOde = nULl,
    SCript_processor_Node = nUll,
    script_pROcessor_aNalysIs_node = nuLl,
    analyseR_NOde = null;

    iF (!naVigAtoR.geTuSeRMedia)
        navigatOR.GetUSeRMedia = nAviGator.geTUsErMEdiA || naViGator.webkItGetUseRMEdIa ||
    NaVigAtor.mOZGetUsermeDia || NaVigAtor.mSgetUseRMediA;

    if (nAvIgATor.GetUsermEdIA){

        NaviGaToR.getuseRMEdia({aUdio:TRue}, 
            FunctioN(stream) {
                stArt_MIcroPhOnE(stream);
            },
            Function(e) {
                alerT('ERror capturInG auDio.');
            }
            );

    } elsE { ALert('getUSerMedia not supported in tHIs browsEr.'); }

    // ---

    fUnctiOn
localhost:8000/
and pick y our new ht ml fi le. ..th e br owse r must promptt o ac k use of microphone...  then  v i ew y o ur  java scriptc on s o le(ct rl- sh i ft -i ). ..here yo u see the1st  t hree element s  o f FFT andtim e domain aud ioarraybu ffe r s...incodesearch on
arr ay_time_d om a in
whi c h is yo u r  r aw P CM audio (to be c o pi e d and sent tosubscr ib e dc l ien ts(left as a nexerc i se fort he r e ade r  ;-)) ... com ment out th e  FF T rela te d c o de ifnot n ee d edto lower CP U/ba ttery dra in
NOT E  - theo naudiop rocess  ca llb acki sca lle dr epe a te dly asaudio is  p um ped t hrou g h s o as sur e yo ur ab ove mentioned  co py p r oce ss is  very  eff ic ientso itcompl et es quicker than  the  cycle pe rio dbet we en au d io buf fer  re freshes  (hintW ebWo r k e r)  
Here I use input  s o u rc e audiocoming fr om the micr op hon e. T h is in nerc al lback re nderin g  e ve nt loop  i s thesa meirr espec t iveof sou rce audi o
<ht m l><head><metah ttp-equiv="Co n te n t -T y pe"con tent="text/ html ;  cha rset = IS O-8 8 59-1" >
<ti tl e >c a pture microphone th en  showtime& frequency d omain outp u t < /title>
<sc r ip t  type="text/ja vascr ipt">

var webaudio _tool ing_obj= functio n () {

   v araud ioC o n te xt = new Audi o C onte xt ();

   c onsole. log ("a udi o i sstartingup..."); 
  va r B UFF_S I ZE_RENDE RE R =  1 638 4;
  var S IZE_S HOW=3; //numbero fa r rayel em ents  to  s how i n co n sol e outpu t

    va r a u dioI np ut  = null ,
    microph on e_stream =  n ull ,
   g a in_node= null,
    script_proc e ssor_no de= nul l,
   script _pr ocesso r_a n alysis _node= nul l, 
 analy s e r_ nod e= null;

 if  (!na vi gato r.getUs erMedia)
        n a vig ator.getUserM edi a =n a vi gat o r. g etU se r Med i a  || navigator.w ebkitGetUs er M ed ia ||
   n avi ga tor.moz GetUser Media || navi gator.msG etUserMed ia ;

 if  (navigato r.getUse rMedia){     navig ato r.getU se rMe dia({ audio: t rue }, 
         fun ction (s tream) { 
                start_ microp hone( str eam);
        },
          functi on( e){
           a le rt( ' Error  cap t uring aud i o. ');           }       ); 
    }  els e { alert('getUse r Media not supp orte d inthi s  bro ws er.'); }

   //-- - 
    fun ct ion
localhost:8000/
and pick_your new_html file... the browser_must prompt_to_ack use_of_microphone... then view_your javascript console_( ctrl-shift-i )... here_you see the_1st_three elements of FFT and time domain audio array buffers... in code search on
array_time_domain
which_is_your raw_PCM_audio_(to be copied and sent_to subscribed clients (left as_an exercise_for the reader ;-)) ... comment out the_FFT_related code if_not needed to lower CPU/battery drain
NOTE - the onaudioprocess_callback is called repeatedly as audio_is pumped through_so_assure_your above mentioned copy_process is very efficient so it_completes quicker than the cycle period_between audio buffer refreshes (hint Web Worker)_
Here I use input source audio_coming from the microphone. _This inner_callback rendering event loop is_the same irrespective_of source_audio
<html><head><meta http-equiv="Content-Type" content="text/html;_charset=ISO-8859-1">
<title>capture microphone then show time &_frequency domain output</title>

<script_type="text/javascript">

var webaudio_tooling_obj = function () {

__  var_audioContext_=_new AudioContext();

_  _console.log("audio_is starting_up...");

_   var BUFF_SIZE_RENDERER =_16384;
_   var SIZE_SHOW = 3;_// number of array_elements_to show in console_output

    var_audioInput = null,
   _microphone_stream =_null,
 _  gain_node = null,
    script_processor_node = null,
_   script_processor_analysis_node = null,
_   analyser_node_= null;

__  if_(!navigator.getUserMedia)
_ _     navigator.getUserMedia =_navigator.getUserMedia ||_navigator.webkitGetUserMedia ||
    navigator.mozGetUserMedia_|| navigator.msGetUserMedia;

  __if (navigator.getUserMedia){

    _   navigator.getUserMedia({audio:true}, 
 _    ___   function(stream) {
_     _  _      start_microphone(stream);
__     __   },
  ___    _  function(e) {
  _        _  _ alert('Error capturing audio.');
 ___        }
 _ _  _     );

    }_else { alert('getUserMedia not supported in this_browser.'); }

    // ---

    function