220 26131 <f490fd21-cf07-4d7b-8936-c71c97a1ab9d@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: alexander.zywicki@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Any interest to adding audio support to the std library?
Date: Fri, 3 Jun 2016 02:37:30 -0700 (PDT)
Lines: 1317
Approved: news@gmane.org
Message-ID: <f490fd21-cf07-4d7b-8936-c71c97a1ab9d@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_106_1145794443.1464946650460"
X-Trace: ger.gmane.org 1464946770 21405 80.91.229.3 (3 Jun 2016 09:39:30 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 3 Jun 2016 09:39:30 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCS7TY6DTQOBBXE7YW5AKGQEVWY2OIQ@isocpp.org Fri Jun 03 11:39:15 2016
Return-path: <std-proposals+bncBCS7TY6DTQOBBXE7YW5AKGQEVWY2OIQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vk0-f70.google.com ([209.85.213.70])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCS7TY6DTQOBBXE7YW5AKGQEVWY2OIQ@isocpp.org>)
	id 1b8lXv-00088P-89
	for gclcip-std-proposals@m.gmane.org; Fri, 03 Jun 2016 11:37:39 +0200
Original-Received: by mail-vk0-f70.google.com with SMTP id m81sf200167133vka.1
        for <gclcip-std-proposals@m.gmane.org>; Fri, 03 Jun 2016 02:37:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:subject:mime-version:x-original-sender
         :reply-to:precedence:mailing-list:list-id:x-spam-checked-in-group
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=BuuXlRnLHVScwOwFiPF8/KqhSG+Fyo4ba021YxQJ3Zs=;
        b=mWUDq7BHMiQdSEBCXGvSXqHsICR1mk2jInhqXGYtvHjUZ4aDF25B8TUaMv+eKWf4N+
         WONxlEdZbv6B7u8GwR7f01aJ55zMRIZnPqXF5kmImp8VOsJY8wzfzcR+e1Pkm74YKfDt
         cDnAB81CMxxIrGhIEvhuIBjQSp+g06XSBbIbmlmGuDkGsp8J/ZdDPJsLPFKEpciDnvsk
         3H5XTZizhmw5LaJxDbkHVFrHn0J37eiK8fTXJank3e4bE3EtihRwbJ1eM3fM3KRXIVmS
         c++fvyPs6LLaqgCAncIa7t9LMe1/3tGuj2k3JGvpMH0eVpphshPmq/RGxDbHLh6laKdd
         o1iw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:message-id:subject:mime-version:x-original-sender
         :reply-to:precedence:mailing-list:list-id:x-spam-checked-in-group
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=BuuXlRnLHVScwOwFiPF8/KqhSG+Fyo4ba021YxQJ3Zs=;
        b=rSV9FHKgYxRGjX/pb/s3zo4EUYbHy1auq9kxHxcCplr0ZcVPXXAG1aM1eZoseXSX4n
         1lYzIE8dEyOp9qWhwwst8atT5CkZxNBpuNGe2zlrGOyXCPT67XhPy19Q7OHe590weDlm
         ixoFNcVMwkiK0HKSpdclrL7SW8NTk7cCRbye43oXhz/qPLVghobsLYTeriLimSZdyVko
         S1n108F+BTJbCwJXyVn4KPRYebnKuiU0sGdNKubFb4crzygyxJDmDJPoC/lDAAFg07QE
         2/8zPFeFk7PE3Ur74V8MhpgIzxc9DZsTyFndt7Iqs7h4yO1QyOCtXZsmcnutryvIy5sA
         1Mxw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:message-id:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=BuuXlRnLHVScwOwFiPF8/KqhSG+Fyo4ba021YxQJ3Zs=;
        b=Kxa+NE+dAF3Q7yc9/e+o1w/hAYyohyjDGYOZr5BHagPZHpfXUd07PlsXZ68+Y0n5f7
         ioFO5i1BVIEMgIh8XVJhBibM5oMYlhVlbU0KBkBCOXnvnJvfIzmVJhbKH1Z6gsnkoQ4f
         xjeRXa7lFcGAyIvv+QYa7kvcImNb+8SznJ+0rz4qosW5r7WbP2YHzw1FydN48auHso+R
         xaBARmkzKkyImgcYpZFmD4SEmOnIIMZZWTDZfhoUvdWQaw5xjCqCOUj7yNhfscdkbdjr
         QIsVoO3iVV7TD8A4JMOhl6SfR1MpmBYtVYARIwpvPcl3zTl9TOZERmOqhIkzfuMQF5r7
         nzNA==
X-Gm-Message-State: ALyK8tJp+qTbAGzuOPbhENZ9RWOHtxgulcvFTDMBkgpD3SxzbyJySbcLwZbzpMAIm9ztIQ==
X-Received: by 10.31.146.19 with SMTP id u19mr1876109vkd.5.1464946653018;
        Fri, 03 Jun 2016 02:37:33 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.134.159 with SMTP id q31ls313077ioi.0.gmail; Fri, 03 Jun
 2016 02:37:31 -0700 (PDT)
X-Received: by 10.36.20.206 with SMTP id 197mr524064itg.3.1464946651866;
        Fri, 03 Jun 2016 02:37:31 -0700 (PDT)
X-Original-Sender: alexander.zywicki@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:26131
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/26131>

------=_Part_106_1145794443.1464946650460
Content-Type: multipart/alternative; 
	boundary="----=_Part_107_48294388.1464946650462"

------=_Part_107_48294388.1464946650462
Content-Type: text/plain; charset=UTF-8

I have drafted some ideas on how I think the c++ std library could support 
audio functionality. 

I know that audio functionality is a very operating specific problem, but 
with the recent trend towards implementing a file-system library and 
possibly a graphics library I believe that audio would not be too much of a 
reach anymore.

Here are some of the ideas I have so far. I have both some code examples of 
the intended usage as well as a list of the types needed to implement the 
given examples.

Please keep in mind my drafts are still very rough.


CODE EXAMPLES

//std::audio example 1 "single process"
void example_1(){
    double sample_rate = 44100;
    std::size_t frame_size =2;
    std::size_t buffer_size=128;

    std::audio_context<float> ctx{sample_rate,buffer_size,frame_size};//contruct 
from values

    std::astream_process<float> proc(ctx,[](std::iastream const& input, std
::oastream& output){
        std::frame_buffer<float>& buff = ctx.borrow_buffer();//borrow a 
buffer from the context for usage
        //prevents the need for dynamic allocation of a temporary buffer
        input>>buff;//stream data into buffer for manipulation
        for(auto&& frame: buff){
            frame=0.0;//do something with audio
        }
        output<<buff;//stream to output
    });//dsp object
    //uses implied routing equivilent to
    //std::aout<<proc<<std::ain;
    //

    proc.start();
    //do other stuff
    proc.stop();
}

//std::audio example 2 "process group"
void example_2(){

    std::audio_context<float> ctx;//default context created with 
std::default_* values

    //version 1: capture context via lambda
    std::astream_process<float> proc1(ctx,[&ctx](std::iastream const& input, 
std::oastream& output){
        std::frame_buffer<float>& buff = ctx.borrow_buffer();
        input>>buff;
        for(auto&& frame: buff){
            frame*=0.5;
        }
        output<<buff;
    });//dsp object

    //version 2: have context passed as argument
    std::astream_process<float> proc2(ctx,[](std::iastream const& input, std
::oastream& output,std::audio_context<float> const& context){
        std::frame_buffer<float>& buff = ctx.borrow_buffer();
        input>>buff;
        for(auto&& frame: buff){
            frame*=2.0;
        }
        output<<buff;
    });

    std::process_group<float> pgroup;//a group of processes that will 
happen consecutivley
    pgroup.push(proc1);//add to group
    pgroup.push(proc2);//add to group

    //configure stream relationships in terms of std::ain / std:aout 
manually
    //std::ain/std::aout are std::astream globals that refer to the default 
audio inputs and outputs supplied by the context in use
    //std::ain/std::aout will route the audio to the enpoint specified by 
the context reference held by the process that is streaming the data
    std::aout<<proc1<<proc2<<std::ain;//method 1
    //std::ain>>proc2>>proc1>>std::aout;//method 2

    pgroup.start();
    //do other stuff
    pgroup.stop();

}


//std::audio example 3 "audio files"
void example_3(){

    std::audio_context<float> ctx;

    std::astream_process<float> proc(ctx,[](std::iafstream const& input, std
::oafstream& output){
        std::frame_buffer<float>& buff = ctx.borrow_buffer();
        input>>buff;
        for(auto&& frame: buff){
            frame=0.0;
        }
        output<<buff;
    });//dsp object

    std::iafstream audio_file1(ctx,"filename1.extension");//an audio file 
handle
    std::oafstream audio_file2(ctx,"filename2.extension");//an audio file 
handle

    //routing
    audio_file2<<proc<<audio_file1;//take input from file nad write to file
    //audio_file1>>proc>>audio_file2;//equivilent syntax
    proc.start();
    //do other stuff
    proc.stop();
}


//std::audio example 4 "combination routing"
void example_3(){

    std::audio_context<float> ctx;
    //manually select hardware endpoints
    std::size_t device_id = ctx.default_device_id();
    std::iastream input_device = ctx.get_device<std::input_device>(device_id
);
    std::oastream output_device = ctx.get_device<std::output_device>(
device_id);

    std::astream_process<float> proc(ctx,[](std::iastream const& input,
                                            std::oastream& output,
                                            std::iafstream const& input_file
,
                                             std::oafstream& output_file){
        std::frame_buffer<float>& buff = ctx.borrow_buffer();
        (input + input_file)>>buff;//add streams to perform sum before 
writing to buffer
        //or you could use seperate buffers
        //like this
        /*
            std::frame_buffer<float> buff1;
            std::frame_buffer<float> buff2;

            input>>buff1;
            input_file>>buff2;
            buff1+=buff2;//buffer arithmatic
        */
        output<<buff;//send the contents of buff to the hardware out and 
the file out
        output_file<<buff;
    });

    std::iafstream audio_file1(ctx,"filename1.extension");//the actual 
files to be used above
    std::oafstream audio_file2(ctx,"filename2.extension");

    //connect the files to the process
    //connect the hardware device to the process
    audio_file2<<proc<<audio_file1;//take input from file
    output_device<<proc<<input_device;//also take from hardware
    proc.start();
    //do other stuff
    proc.stop();
}



REQUIRED LIBRARY MEMBERS


namespace std{
    inline namespace audio{
        //working context for audio flow
        template<typename>
        class audio_context;
        /*
        *The context in which all audio data is centered.
        *Contains: sampling rate, buffer size, frame size, etc...
        *The values of ain,aout,afin,afout refer to the endpoints defined 
by the context, when applied to routing on a porocess tied to the context
        *think of a context as the program level driver object
        */

        //audio streams (think like std::fstream and its friends)
        class astream;//audio stream
        class oastream;//output audio stream
        class iastream;//input audio stream
        class oafstream;//output audio file stream
        class iafstream;//input audio file stream


        //stream endpoints
        class ain;//audio input endpoint
        class aout;//audio output endpoint
        class afin;//audio file input endpoint
        class afout//audio file output endpoint

        //stream processing
        template<typename>
        class astream_process;//a dsp process applied to a stream

        template<typename>
        class process_group;//a group of processes that will act as one

        //containers
        template<typename>
        class frame_buffer;//a sequence container that is resizeable at 
runtime, but only with explicit resize calls. contains frames(see below)
        /*Implementation note on frame_buffer
         *frame_buffer is intended to hold N number of frames which 
themselves can hold M number of samples
         *meaning that the total size in samples if frame_buffer = N * M
         *ideally frame_buffers representation of its sample data will be 
continuous in memory
        */

        template<typename>
        class frame;//a container that holds samples, thin array wrapper


        //hardware representation
        class device;//an audio device as recognized by the OS
        class input_device;//an input device
        class output_device;//an output device

        // audio file formats
        enum class afformat{
            raw,//raw headerless audio bytes, interpreted only by the 
settings of the context.
            //best used for temporary storage within the life of a context
            wav,
            flac//etc...
        }
    }
}



-- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/f490fd21-cf07-4d7b-8936-c71c97a1ab9d%40isocpp.org.

------=_Part_107_48294388.1464946650462
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I have drafted some ideas on how I think the c++ std libra=
ry could support audio functionality. <br><br>I know that audio functionali=
ty is a very operating specific problem, but with the recent trend towards =
implementing a file-system library and possibly a graphics library I believ=
e that audio would not be too much of a reach anymore.<br><br>Here are some=
 of the ideas I have so far. I have both some code examples of the intended=
 usage as well as a list of the types needed to implement the given example=
s.<br><br>Please keep in mind my drafts are still very rough.<br><br><br>CO=
DE EXAMPLES<br><br><div class=3D"prettyprint" style=3D"background-color: rg=
b(250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; bo=
rder-width: 1px; word-wrap: break-word;"><code class=3D"prettyprint"><div c=
lass=3D"subprettyprint"><span style=3D"color: #800;" class=3D"styled-by-pre=
ttify">//std::audio example 1 &quot;single process&quot;</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">void</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> example_1</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">()</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #008;" cla=
ss=3D"styled-by-prettify">double</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> sample_rate </span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> </span><span style=3D"color: #066;" class=3D"styled-by=
-prettify">44100</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br=
>=C2=A0 =C2=A0 std</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">::</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
size_t frame_size </span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">=3D</span><span style=3D"color: #066;" class=3D"styled-by-prettify"=
>2</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0=
 std</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify">size_t buffer_=
size</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</s=
pan><span style=3D"color: #066;" class=3D"styled-by-prettify">128</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br><br>=C2=A0 =C2=A0 std</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify">audio_context</span><=
span style=3D"color: #080;" class=3D"styled-by-prettify">&lt;float&gt;</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"> ctx</span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">sample_rate</span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify">buffer_size</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify">frame_size</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">};</span><span style=3D"color: #800;" class=
=3D"styled-by-prettify">//contruct from values</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"><br><br>=C2=A0 =C2=A0 std</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify">astream_process</span><span styl=
e=3D"color: #080;" class=3D"styled-by-prettify">&lt;float&gt;</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> proc</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify">ctx</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">,[](</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify">std</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">::</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify">iastream </span><span style=3D"color: #008;" class=3D"styled-by-p=
rettify">const</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">&amp;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
input</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> std</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">oastream</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> output</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">){</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 std</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify">frame_buffer</span><span st=
yle=3D"color: #080;" class=3D"styled-by-prettify">&lt;float&gt;</span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> buff </span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"color:=
 #000;" class=3D"styled-by-prettify"> ctx</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">.</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">borrow_buffer</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">();</span><span style=3D"color: #800;" class=3D"=
styled-by-prettify">//borrow a buffer from the context for usage</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 </span><span style=3D"color: #800;" class=3D"styled-by-prettify"=
>//prevents the need for dynamic allocation of a temporary buffer</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 input</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">&gt;&gt;</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify">buff</span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>;</span><span style=3D"color: #800;" class=3D"styled-by-prettify">//stream=
 data into buffer for manipulation</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=
=3D"color: #008;" class=3D"styled-by-prettify">for</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #008;=
" class=3D"styled-by-prettify">auto</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">&amp;&amp;</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"> frame</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">:</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> buff</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">){</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><=
br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 frame</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"color: #06=
6;" class=3D"styled-by-prettify">0.0</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">;</span><span style=3D"color: #800;" class=3D"sty=
led-by-prettify">//do something with audio</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">}</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 output</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
&lt;&lt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify">bu=
ff</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span>=
<span style=3D"color: #800;" class=3D"styled-by-prettify">//stream to outpu=
t</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=
=A0 =C2=A0 </span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>});</span><span style=3D"color: #800;" class=3D"styled-by-prettify">//dsp =
object</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=
=C2=A0 =C2=A0 </span><span style=3D"color: #800;" class=3D"styled-by-pretti=
fy">//uses implied routing equivilent to</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color=
: #800;" class=3D"styled-by-prettify">//std::aout&lt;&lt;proc&lt;&lt;std::a=
in;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=
=A0 =C2=A0 </span><span style=3D"color: #800;" class=3D"styled-by-prettify"=
>//</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br=
>=C2=A0 =C2=A0 proc</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">.</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
start</span><span style=3D"color: #660;" class=3D"styled-by-prettify">();</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =
=C2=A0 </span><span style=3D"color: #800;" class=3D"styled-by-prettify">//d=
o other stuff</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"><br>=C2=A0 =C2=A0 proc</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">.</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify">stop</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
();</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">}</span><span=
 style=3D"color: #000;" class=3D"styled-by-prettify"><br><br></span><span s=
tyle=3D"color: #800;" class=3D"styled-by-prettify">//std::audio example 2 &=
quot;process group&quot;</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"><br></span><span style=3D"color: #008;" class=3D"styled-by-pr=
ettify">void</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> example_2</span><code class=3D"prettyprint"><span style=3D"color: #660;"=
 class=3D"styled-by-prettify">()</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify"></span></code><span style=3D"color: #660;" class=3D=
"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"><br><br>=C2=A0 =C2=A0 std</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify">audio_context</span><span style=3D"color: #080;" class=
=3D"styled-by-prettify">&lt;float&gt;</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"> ctx</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">;</span><span style=3D"color: #800;" class=3D"styled-b=
y-prettify">//default context created with std::default_* values</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"><br><br>=C2=A0 =C2=A0=
 </span><span style=3D"color: #800;" class=3D"styled-by-prettify">//version=
 1: capture context via lambda</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"><br>=C2=A0 =C2=A0 std</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">astream_process</span><span style=3D"color: #080;" =
class=3D"styled-by-prettify">&lt;float&gt;</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> proc1</span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">(</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify">ctx</span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">,[&amp;</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify">ctx</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">](</span><span style=3D"color: #000;" class=3D"styled-by-prettify">std</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify">iastream </span><span=
 style=3D"color: #008;" class=3D"styled-by-prettify">const</span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"> input</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> std</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify">oastream</span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">&amp;</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> output</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">){</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><b=
r>=C2=A0 =C2=A0 =C2=A0 =C2=A0 std</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify">frame_buffer</span><span style=3D"color: #080;" class=3D"st=
yled-by-prettify">&lt;float&gt;</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">&amp;</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> buff </span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"> ctx</span><span style=3D"color: #660;" class=3D"styled-by-prettify">.=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify">borrow_buf=
fer</span><span style=3D"color: #660;" class=3D"styled-by-prettify">();</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 input</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">&gt;&gt;</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify">buff</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"st=
yled-by-prettify">for</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">(</span><span style=3D"color: #008;" class=3D"styled-by-prettify=
">auto</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&amp=
;&amp;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> fra=
me</span><span style=3D"color: #660;" class=3D"styled-by-prettify">:</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> buff</span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">){</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 frame</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">*=3D</span><span style=3D"color: #066;" class=3D"styled-by-pre=
ttify">0.5</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">}</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 output</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">&lt;&lt;</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify">buff</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">});</span><span style=3D"color: #800;" class=3D"st=
yled-by-prettify">//dsp object</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"><br><br>=C2=A0 =C2=A0 </span><span style=3D"color: #800=
;" class=3D"styled-by-prettify">//version 2: have context passed as argumen=
t</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=
=A0 =C2=A0 std</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">::</span><span style=3D"color: #000;" class=3D"styled-by-prettify">astr=
eam_process</span><span style=3D"color: #080;" class=3D"styled-by-prettify"=
>&lt;float&gt;</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> proc2</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">ctx</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">,[](</span><span=
 style=3D"color: #000;" class=3D"styled-by-prettify">std</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify">iastream </span><span style=3D"color=
: #008;" class=3D"styled-by-prettify">const</span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">&amp;</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> input</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> std</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">::</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
>oastream</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&=
amp;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> outpu=
t</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify">std</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify">audio_context</span><span style=
=3D"color: #080;" class=3D"styled-by-prettify">&lt;float&gt;</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">const</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">&amp;</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"> context</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">){</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 std</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify">frame_buffer</span><span style=3D"co=
lor: #080;" class=3D"styled-by-prettify">&lt;float&gt;</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">&amp;</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"> buff </span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">=3D</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> ctx</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">.</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify">borrow_buffer</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">();</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 input</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">&gt;&gt;</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify">buff</span><span style=3D"color: #660;"=
 class=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"=
color: #008;" class=3D"styled-by-prettify">for</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #008;" cl=
ass=3D"styled-by-prettify">auto</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">&amp;&amp;</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify"> frame</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">:</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> buff</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">){</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 frame</span><span style=3D"color:=
 #660;" class=3D"styled-by-prettify">*=3D</span><span style=3D"color: #066;=
" class=3D"styled-by-prettify">2.0</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color:=
 #660;" class=3D"styled-by-prettify">}</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 output</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">&lt;&lt;</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify">buff</span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">});</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"><br><br>=C2=A0 =C2=A0 std</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">process_group</span><span st=
yle=3D"color: #080;" class=3D"styled-by-prettify">&lt;float&gt;</span><span=
 style=3D"color: #000;" class=3D"styled-by-prettify"> pgroup</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"co=
lor: #800;" class=3D"styled-by-prettify">//a group of processes that will h=
appen consecutivley</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"><br>=C2=A0 =C2=A0 pgroup</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">.</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify">push</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
proc1</span><span style=3D"color: #660;" class=3D"styled-by-prettify">);</s=
pan><span style=3D"color: #800;" class=3D"styled-by-prettify">//add to grou=
p</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=
=A0 =C2=A0 pgroup</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">.</span><span style=3D"color: #000;" class=3D"styled-by-prettify">pu=
sh</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify">proc2</span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">);</span><span style=
=3D"color: #800;" class=3D"styled-by-prettify">//add to group</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"><br><br>=C2=A0 =C2=A0 </=
span><span style=3D"color: #800;" class=3D"styled-by-prettify">//configure =
stream relationships in terms of std::ain / std:aout manually</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span=
><span style=3D"color: #800;" class=3D"styled-by-prettify">//std::ain/std::=
aout are std::astream globals that refer to the default audio inputs and ou=
tputs supplied by the context in use</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #8=
00;" class=3D"styled-by-prettify">//std::ain/std::aout will route the audio=
 to the enpoint specified by the context reference held by the process that=
 is streaming the data</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"><br>=C2=A0 =C2=A0 std</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify">aout</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">&lt;&lt;</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify">proc1</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">&lt;&lt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
>proc2</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;=
&lt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify">std</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify">ain</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color=
: #800;" class=3D"styled-by-prettify">//method 1</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=
=3D"color: #800;" class=3D"styled-by-prettify">//std::ain&gt;&gt;proc2&gt;&=
gt;proc1&gt;&gt;std::aout;//method 2</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"><br><br>=C2=A0 =C2=A0 pgroup</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">.</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify">start</span><span style=3D"color: #660;"=
 class=3D"styled-by-prettify">();</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #800=
;" class=3D"styled-by-prettify">//do other stuff</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 pgroup</span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">.</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify">stop</span><span style=3D"color:=
 #660;" class=3D"styled-by-prettify">();</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"><br><br></span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">}</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"><br><br><br></span><span style=3D"color: #800;" class=3D=
"styled-by-prettify">//std::audio example 3 &quot;audio files&quot;</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span s=
tyle=3D"color: #008;" class=3D"styled-by-prettify">void</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> example_3</span><code class=
=3D"prettyprint"><span style=3D"color: #660;" class=3D"styled-by-prettify">=
()</span><span style=3D"color: #660;" class=3D"styled-by-prettify"></span><=
/code><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"><br><br>=C2=A0 =C2=
=A0 std</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify">audio_conte=
xt</span><span style=3D"color: #080;" class=3D"styled-by-prettify">&lt;floa=
t&gt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> ctx<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"><br><br>=C2=A0 =C2=
=A0 std</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify">astream_pro=
cess</span><span style=3D"color: #080;" class=3D"styled-by-prettify">&lt;fl=
oat&gt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> pr=
oc</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify">ctx</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">,[](</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">std</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify">iafstream </span><span style=3D"color: #008=
;" class=3D"styled-by-prettify">const</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">&amp;</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> input</span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"> std</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">::</span><span style=3D"color: #000;" class=3D"styled-by-prettify">oaf=
stream</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&amp=
;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> output</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">){</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 std</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">::</span><span style=3D"color: #000;" class=3D"styled-by-prettify">f=
rame_buffer</span><span style=3D"color: #080;" class=3D"styled-by-prettify"=
>&lt;float&gt;</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">&amp;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
buff </span><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> ctx</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">.</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify">borrow_buffer</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">();</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0=
 input</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;=
&gt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify">buff</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-prettify"=
>for</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</spa=
n><span style=3D"color: #008;" class=3D"styled-by-prettify">auto</span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">&amp;&amp;</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> frame</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">:</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"> buff</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">){</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 f=
rame</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</s=
pan><span style=3D"color: #066;" class=3D"styled-by-prettify">0.0</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 </span><span style=3D"color: #660;" class=3D"styled-by-prettify">}</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 output</span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">&lt;&lt;</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify">buff</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br=
>=C2=A0 =C2=A0 </span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">});</span><span style=3D"color: #800;" class=3D"styled-by-prettify">//=
dsp object</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
<br><br>=C2=A0 =C2=A0 std</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">::</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify">iafstream audio_file1</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">(</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify">ctx</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">,</span><span style=3D"color: #080;" class=3D"styled-by-prettify">&quot;f=
ilename1.extension&quot;</span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">);</span><span style=3D"color: #800;" class=3D"styled-by-pret=
tify">//an audio file handle</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"><br>=C2=A0 =C2=A0 std</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify">oafstream audio_file2</span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">(</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">ctx</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">,</span><span style=3D"color: #080;" class=3D"styled-by-pr=
ettify">&quot;filename2.extension&quot;</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">);</span><span style=3D"color: #800;" class=3D=
"styled-by-prettify">//an audio file handle</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"><br><br>=C2=A0 =C2=A0 </span><span style=
=3D"color: #800;" class=3D"styled-by-prettify">//routing</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 audio_file=
2</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;&lt;<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify">proc</span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;&lt;</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify">audio_file1</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span styl=
e=3D"color: #800;" class=3D"styled-by-prettify">//take input from file nad =
write to file</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #800;" class=3D"styled-by=
-prettify">//audio_file1&gt;&gt;proc&gt;&gt;audio_file2;//equivilent syntax=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0=
 =C2=A0 proc</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">.</span><span style=3D"color: #000;" class=3D"styled-by-prettify">start</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">();</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 <=
/span><span style=3D"color: #800;" class=3D"styled-by-prettify">//do other =
stuff</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=
=C2=A0 =C2=A0 proc</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">.</span><span style=3D"color: #000;" class=3D"styled-by-prettify">s=
top</span><span style=3D"color: #660;" class=3D"styled-by-prettify">();</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">}</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br><br><br></span><span sty=
le=3D"color: #800;" class=3D"styled-by-prettify">//std::audio example 4 &qu=
ot;combination routing&quot;</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"><br></span><span style=3D"color: #008;" class=3D"styled-b=
y-prettify">void</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> example_3</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify"><code class=3D"prettyprint"><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">()</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify"></span></code>{</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"><br><br>=C2=A0 =C2=A0 std</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify">audio_context</span><span style=3D"color: #080;" class=
=3D"styled-by-prettify">&lt;float&gt;</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"> ctx</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">;</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #800;" class=3D"=
styled-by-prettify">//manually select hardware endpoints</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 std</span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify">size_t device_id </span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> ctx</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">.</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify">default_device_id</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">();</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 std</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify">iastream input_device </span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> ctx</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">.</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify">get_device</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">std</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">::</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify">input_device</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">&gt;(</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify">device_id</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">);</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br=
>=C2=A0 =C2=A0 std</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">::</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
oastream output_device </span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> ctx</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
..</span><span style=3D"color: #000;" class=3D"styled-by-prettify">get_devic=
e</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify">std</span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">output_device</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">&gt;(</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">device_id</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">);</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"><br><br>=C2=A0 =C2=A0 std</span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">astream_process</span><span =
style=3D"color: #080;" class=3D"styled-by-prettify">&lt;float&gt;</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> proc</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify">ctx</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">,[](</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify">std</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"styled-=
by-prettify">iastream </span><span style=3D"color: #008;" class=3D"styled-b=
y-prettify">const</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">&amp;</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> input</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 s=
td</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify">oastream</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> output</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 std</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify">iafstream </span><span style=3D"color: #0=
08;" class=3D"styled-by-prettify">const</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">&amp;</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> input_file</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0std</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify">oafstream</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">&amp;</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> output_file</span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">){</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 std</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify">frame_buffer</span><span style=3D"color: #080;" class=
=3D"styled-by-prettify">&lt;float&gt;</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">&amp;</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> buff </span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-=
by-prettify"> ctx</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">.</span><span style=3D"color: #000;" class=3D"styled-by-prettify">bo=
rrow_buffer</span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>();</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">(</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify">input </span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">+</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> inp=
ut_file</span><span style=3D"color: #660;" class=3D"styled-by-prettify">)&g=
t;&gt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify">buff=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><s=
pan style=3D"color: #800;" class=3D"styled-by-prettify">//add streams to pe=
rform sum before writing to buffer</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=
=3D"color: #800;" class=3D"styled-by-prettify">//or you could use seperate =
buffers</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #800;" class=3D"s=
tyled-by-prettify">//like this</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"c=
olor: #800;" class=3D"styled-by-prettify">/*<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 std::frame_buffer&lt;float&gt; buff1;<br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 std::frame_buffer&lt;float&gt; buff2;<br><br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 input&gt;&gt;buff1;<br>=C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 input_file&gt;&gt;buff2;<br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 buff1+=3Dbuff2;//buffer arithmatic<br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 */</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 output</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">&lt;&lt;</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify">buff</span><span style=3D"color: #660;"=
 class=3D"styled-by-prettify">;</span><span style=3D"color: #800;" class=3D=
"styled-by-prettify">//send the contents of buff to the hardware out and th=
e file out</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 output_file</span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">&lt;&lt;</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify">buff</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">});</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"><br><br>=C2=A0 =C2=A0 std</span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">iafstream audio_file1</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify">ctx</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">,</span><span style=3D"color: #080;" class=3D"styled-by-=
prettify">&quot;filename1.extension&quot;</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">);</span><span style=3D"color: #800;" class=
=3D"styled-by-prettify">//the actual files to be used above</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 std</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify">oafstream audio_file2</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify">ctx</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color=
: #080;" class=3D"styled-by-prettify">&quot;filename2.extension&quot;</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">);</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"><br><br>=C2=A0 =C2=A0 </=
span><span style=3D"color: #800;" class=3D"styled-by-prettify">//connect th=
e files to the process</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #800;" class=3D"=
styled-by-prettify">//connect the hardware device to the process</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 aud=
io_file2</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&l=
t;&lt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify">proc=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;&lt;</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify">audio_file1<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><sp=
an style=3D"color: #800;" class=3D"styled-by-prettify">//take input from fi=
le</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=
=A0 =C2=A0 output_device</span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">&lt;&lt;</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify">proc</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">&lt;&lt;</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy">input_device</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">;</span><span style=3D"color: #800;" class=3D"styled-by-prettify">//a=
lso take from hardware</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"><br>=C2=A0 =C2=A0 proc</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">.</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify">start</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">();</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #800;" class=3D"styled-by=
-prettify">//do other stuff</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"><br>=C2=A0 =C2=A0 proc</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">.</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify">stop</span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">();</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"><br></span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>}</span></div></code></div><br><br><br>REQUIRED LIBRARY MEMBERS<br><br><br=
><div class=3D"prettyprint" style=3D"background-color: rgb(250, 250, 250); =
border-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; w=
ord-wrap: break-word;"><code class=3D"prettyprint"><div class=3D"subprettyp=
rint"><span style=3D"color: #008;" class=3D"styled-by-prettify">namespace</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> std</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><s=
pan style=3D"color: #008;" class=3D"styled-by-prettify">inline</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"=
color: #008;" class=3D"styled-by-prettify">namespace</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> audio</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span s=
tyle=3D"color: #800;" class=3D"styled-by-prettify">//working context for au=
dio flow</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><b=
r>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"=
styled-by-prettify">template</span><span style=3D"color: #080;" class=3D"st=
yled-by-prettify">&lt;typename&gt;</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=
=3D"color: #008;" class=3D"styled-by-prettify">class</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> audio_context</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </spa=
n><span style=3D"color: #800;" class=3D"styled-by-prettify">/*<br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 *The context in which all audio data is centered.<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 *Contains: sampling rate, buffer size, frame si=
ze, etc...<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 *The values of ain,aout,afin,afou=
t refer to the endpoints defined by the context, when applied to routing on=
 a porocess tied to the context<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 *think of a =
context as the program level driver object<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 *=
/</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #800;" class=3D"st=
yled-by-prettify">//audio streams (think like std::fstream and its friends)=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0=
 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"styled-b=
y-prettify">class</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> astream</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">;</span><span style=3D"color: #800;" class=3D"styled-by-prettify">//au=
dio stream</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">class</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> oastream</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">;</span><span style=3D"color: #800;" class=3D"styled-by-p=
rettify">//output audio stream</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"c=
olor: #008;" class=3D"styled-by-prettify">class</span><span style=3D"color:=
 #000;" class=3D"styled-by-prettify"> iastream</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #800;" cl=
ass=3D"styled-by-prettify">//input audio stream</span><span style=3D"color:=
 #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span=
><span style=3D"color: #008;" class=3D"styled-by-prettify">class</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> oafstream</span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=
=3D"color: #800;" class=3D"styled-by-prettify">//output audio file stream</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by=
-prettify">class</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> iafstream</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">;</span><span style=3D"color: #800;" class=3D"styled-by-prettify">//i=
nput audio file stream</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"><br><br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"c=
olor: #800;" class=3D"styled-by-prettify">//stream endpoints</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-prettify">cla=
ss</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> ain</sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span =
style=3D"color: #800;" class=3D"styled-by-prettify">//audio input endpoint<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by=
-prettify">class</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> aout</span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>;</span><span style=3D"color: #800;" class=3D"styled-by-prettify">//audio =
output endpoint</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #008;" cl=
ass=3D"styled-by-prettify">class</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> afin</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">;</span><span style=3D"color: #800;" class=3D"styled-by-=
prettify">//audio file input endpoint</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span sty=
le=3D"color: #008;" class=3D"styled-by-prettify">class</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> afout</span><span style=3D"col=
or: #800;" class=3D"styled-by-prettify">//audio file output endpoint</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #800;" class=3D"styled-by=
-prettify">//stream processing</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"c=
olor: #008;" class=3D"styled-by-prettify">template</span><span style=3D"col=
or: #080;" class=3D"styled-by-prettify">&lt;typename&gt;</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 </span><span style=3D"color: #008;" class=3D"styled-by-prettify">class<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"> astream_pr=
ocess</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</sp=
an><span style=3D"color: #800;" class=3D"styled-by-prettify">//a dsp proces=
s applied to a stream</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"><br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color:=
 #008;" class=3D"styled-by-prettify">template</span><span style=3D"color: #=
080;" class=3D"styled-by-prettify">&lt;typename&gt;</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </=
span><span style=3D"color: #008;" class=3D"styled-by-prettify">class</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> process_group</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span=
 style=3D"color: #800;" class=3D"styled-by-prettify">//a group of processes=
 that will act as one</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"><br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color:=
 #800;" class=3D"styled-by-prettify">//containers</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </sp=
an><span style=3D"color: #008;" class=3D"styled-by-prettify">template</span=
><span style=3D"color: #080;" class=3D"styled-by-prettify">&lt;typename&gt;=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0=
 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"styled-b=
y-prettify">class</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> frame_buffer</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">;</span><span style=3D"color: #800;" class=3D"styled-by-prettify"=
>//a sequence container that is resizeable at runtime, but only with explic=
it resize calls. contains frames(see below)</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><sp=
an style=3D"color: #800;" class=3D"styled-by-prettify">/*Implementation not=
e on frame_buffer<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*frame_buffer is int=
ended to hold N number of frames which themselves can hold M number of samp=
les<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*meaning that the total size in sa=
mples if frame_buffer =3D N * M<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*ideal=
ly frame_buffers representation of its sample data will be continuous in me=
mory<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 */</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"><br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><spa=
n style=3D"color: #008;" class=3D"styled-by-prettify">template</span><span =
style=3D"color: #080;" class=3D"styled-by-prettify">&lt;typename&gt;</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0=
 =C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-prett=
ify">class</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
 frame</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</s=
pan><span style=3D"color: #800;" class=3D"styled-by-prettify">//a container=
 that holds samples, thin array wrapper</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"><br><br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span=
><span style=3D"color: #800;" class=3D"styled-by-prettify">//hardware repre=
sentation</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><=
br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D=
"styled-by-prettify">class</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> device</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">;</span><span style=3D"color: #800;" class=3D"styled-by-pretti=
fy">//an audio device as recognized by the OS</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><=
span style=3D"color: #008;" class=3D"styled-by-prettify">class</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> input_device</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=
=3D"color: #800;" class=3D"styled-by-prettify">//an input device</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-prettify"=
>class</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> out=
put_device</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
;</span><span style=3D"color: #800;" class=3D"styled-by-prettify">//an outp=
ut device</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><=
br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #800;" clas=
s=3D"styled-by-prettify">// audio file formats</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span>=
<span style=3D"color: #008;" class=3D"styled-by-prettify">enum</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"=
color: #008;" class=3D"styled-by-prettify">class</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"> afformat</span><span style=3D"color:=
 #660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 r=
aw</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span>=
<span style=3D"color: #800;" class=3D"styled-by-prettify">//raw headerless =
audio bytes, interpreted only by the settings of the context.</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #800;" class=3D"styled-b=
y-prettify">//best used for temporary storage within the life of a context<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 wav</span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 flac</span=
><span style=3D"color: #800;" class=3D"styled-by-prettify">//etc...</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 </span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">}</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=
=C2=A0 =C2=A0 </span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">}</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">}</span></d=
iv></code></div><br><br><br></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/f490fd21-cf07-4d7b-8936-c71c97a1ab9d%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/f490fd21-cf07-4d7b-8936-c71c97a1ab9d=
%40isocpp.org</a>.<br />

------=_Part_107_48294388.1464946650462--

------=_Part_106_1145794443.1464946650460
Content-Type: text/plain; charset=US-ASCII; name=required_code.txt
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=required_code.txt
X-Attachment-Id: 016a0680-963e-4a3b-88d0-072500b189b3
Content-ID: <016a0680-963e-4a3b-88d0-072500b189b3>



namespace std{
    inline namespace audio{
        //working context for audio flow
        template<typename>
        class audio_context;
        /*
        *The context in which all audio data is centered.
        *Contains: sampling rate, buffer size, frame size, etc...
        *The values of ain,aout,afin,afout refer to the endpoints defined by the context, when applied to routing on a porocess tied to the context
        *think of a context as the program level driver object
        */

        //audio streams (think like std::fstream and its friends)
        class astream;//audio stream
        class oastream;//output audio stream
        class iastream;//input audio stream
        class oafstream;//output audio file stream
        class iafstream;//input audio file stream


        //stream endpoints
        class ain;//audio input endpoint
        class aout;//audio output endpoint
        class afin;//audio file input endpoint
        class afout//audio file output endpoint

        //stream processing
        template<typename>
        class astream_process;//a dsp process applied to a stream

        template<typename>
        class process_group;//a group of processes that will act as one

        //containers
        template<typename>
        class frame_buffer;//a sequence container that is resizeable at runtime, but only with explicit resize calls. contains frames(see below)
        /*Implementation note on frame_buffer
         *frame_buffer is intended to hold N number of frames which themselves can hold M number of samples
         *meaning that the total size in samples if frame_buffer = N * M
         *ideally frame_buffers representation of its sample data will be continuous in memory
        */

        template<typename>
        class frame;//a container that holds samples, thin array wrapper


        //hardware representation
        class device;//an audio device as recognized by the OS
        class input_device;//an input device
        class output_device;//an output device

        // audio file formats
        enum class afformat{
            raw,//raw headerless audio bytes, interpreted only by the settings of the context.
            //best used for temporary storage within the life of a context
            wav,
            flac//etc...
        }







    }
}

------=_Part_106_1145794443.1464946650460
Content-Type: text/plain; charset=US-ASCII; name=usage_ideas.txt
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=usage_ideas.txt
X-Attachment-Id: 6a7d2a02-1a72-4e10-b0b7-e2fea8e12483
Content-ID: <6a7d2a02-1a72-4e10-b0b7-e2fea8e12483>



//std::audio example 1 "single process"
void example_1{
    double sample_rate = 44100;
    std::size_t frame_size =2;
    std::size_t buffer_size=128;

    std::audio_context<float> ctx{sample_rate,buffer_size,frame_size};//contruct from values

    std::astream_process<float> proc(ctx,[](std::iastream const& input, std::oastream& output){
        std::frame_buffer<float>& buff = ctx.borrow_buffer();//borrow a buffer from the context for usage
        //prevents the need for dynamic allocation of a temporary buffer
        input>>buff;//stream data into buffer for manipulation
        for(auto&& frame: buff){
            frame=0.0;//do something with audio
        }
        output<<buff;//stream to output
    });//dsp object
    //uses implied routing equivilent to
    //std::aout<<proc<<std::ain;
    //

    proc.start();
    //do other stuff
    proc.stop();
}

//std::audio example 2 "process group"
void example_2{

    std::audio_context<float> ctx;//default context created with std::default_* values

    //version 1: capture context via lambda
    std::astream_process<float> proc1(ctx,[&ctx](std::iastream const& input, std::oastream& output){
        std::frame_buffer<float>& buff = ctx.borrow_buffer();
        input>>buff;
        for(auto&& frame: buff){
            frame*=0.5;
        }
        output<<buff;
    });//dsp object

    //version 2: have context passed as argument
    std::astream_process<float> proc2(ctx,[](std::iastream const& input, std::oastream& output,std::audio_context<float> const& context){
        std::frame_buffer<float>& buff = ctx.borrow_buffer();
        input>>buff;
        for(auto&& frame: buff){
            frame*=2.0;
        }
        output<<buff;
    });

    std::process_group<float> pgroup;//a group of processes that will happen consecutivley
    pgroup.push(proc1);//add to group
    pgroup.push(proc2);//add to group

    //configure stream relationships in terms of std::ain / std:aout manually
    //std::ain/std::aout are std::astream globals that refer to the default audio inputs and outputs supplied by the context in use
    //std::ain/std::aout will route the audio to the enpoint specified by the context reference held by the process that is streaming the data
    std::aout<<proc1<<proc2<<std::ain;//method 1
    //std::ain>>proc2>>proc1>>std::aout;//method 2

    pgroup.start();
    //do other stuff
    pgroup.stop();

}


//std::audio example 3 "audio files"
void example_3{

    std::audio_context<float> ctx;

    std::astream_process<float> proc(ctx,[](std::iafstream const& input, std::oafstream& output){
        std::frame_buffer<float>& buff = ctx.borrow_buffer();
        input>>buff;
        for(auto&& frame: buff){
            frame=0.0;
        }
        output<<buff;
    });//dsp object

    std::iafstream audio_file1(ctx,"filename1.extension");//an audio file handle
    std::oafstream audio_file2(ctx,"filename2.extension");//an audio file handle

    //routing
    audio_file2<<proc<<audio_file1;//take input from file nad write to file
    //audio_file1>>proc>>audio_file2;//equivilent syntax
    proc.start();
    //do other stuff
    proc.stop();
}


//std::audio example 4 "combination routing"
void example_3{

    std::audio_context<float> ctx;
    //manually select hardware endpoints
    std::size_t device_id = ctx.default_device_id();
    std::iastream input_device = ctx.get_device<std::input_device>(device_id);
    std::oastream output_device = ctx.get_device<std::output_device>(device_id);

    std::astream_process<float> proc(ctx,[](std::iastream const& input,
                                            std::oastream& output,
                                            std::iafstream const& input_file,
                                             std::oafstream& output_file){
        std::frame_buffer<float>& buff = ctx.borrow_buffer();
        (input + input_file)>>buff;//add streams to perform sum before writing to buffer
        //or you could use seperate buffers
        //like this
        /*
            std::frame_buffer<float> buff1;
            std::frame_buffer<float> buff2;

            input>>buff1;
            input_file>>buff2;
            buff1+=buff2;//buffer arithmatic
        */
        output<<buff;//send the contents of buff to the hardware out and the file out
        output_file<<buff;
    });

    std::iafstream audio_file1(ctx,"filename1.extension");//the actual files to be used above
    std::oafstream audio_file2(ctx,"filename2.extension");

    //connect the files to the process
    //connect the hardware device to the process
    audio_file2<<proc<<audio_file1;//take input from file
    output_device<<proc<<input_device;//also take from hardware
    proc.start();
    //do other stuff
    proc.stop();
}

------=_Part_106_1145794443.1464946650460--

.
