220 26165 <a27c2580-c766-4488-bc26-a7b15783e0fd@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: alexander.zywicki@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Any interest to adding audio support to the std library?
Date: Fri, 3 Jun 2016 19:35:36 -0700 (PDT)
Lines: 211
Approved: news@gmane.org
Message-ID: <a27c2580-c766-4488-bc26-a7b15783e0fd@isocpp.org>
References: <5751B06A.4080501@mail1.stofanet.dk> <5290948.va25uYNizX@tjmaciei-mobl1>
 <CAEhD+6Ca=j3SaS5nC_Qe=6FGMdJLgpQd1LnGfiep8m9GrEU1jQ@mail.gmail.com>
 <1580229.cHEgQxCuA1@tjmaciei-mobl1> <CANh-dX=heKaWzvE+rk8FeCSTQyZ8-FR9UaGdam8quLaEuLJ=-A@mail.gmail.com>
 <62b7649a-5de5-4330-9bac-708375d36e2c@isocpp.org>
 <CAOcFa=fnWS=T2p6xgQ_EiCnVTmkSk_UrobDMYvXhaKi95cxrdQ@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1147_620087267.1465007736584"
X-Trace: ger.gmane.org 1465007753 22949 80.91.229.3 (4 Jun 2016 02:35:53 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 4 Jun 2016 02:35:53 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCS7TY6DTQOBB6P4ZC5AKGQEAQHZ3XI@isocpp.org Sat Jun 04 04:35:42 2016
Return-path: <std-proposals+bncBCS7TY6DTQOBB6P4ZC5AKGQEAQHZ3XI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ig0-f198.google.com ([209.85.213.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCS7TY6DTQOBB6P4ZC5AKGQEAQHZ3XI@isocpp.org>)
	id 1b91R5-0003hP-Bj
	for gclcip-std-proposals@m.gmane.org; Sat, 04 Jun 2016 04:35:39 +0200
Original-Received: by mail-ig0-f198.google.com with SMTP id lp2sf25981199igb.3
        for <gclcip-std-proposals@m.gmane.org>; Fri, 03 Jun 2016 19:35:39 -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:in-reply-to:references: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=/Jk/PxDtr97zfhf3eM7My7bqLd7e9sc0SH74nslArqQ=;
        b=2SKG7yCiV9+WOTkwAT13LZLoZ9QdRLJ8oR1+btJXSeR7/i4vMDeAdjiyNviPSP1+sj
         JLDICVSBcUXL1dasv6ewNwTCmVPXmo7S8uKby/dyo34gbaA2LAZDSDx5VYfWeMtRVcgJ
         sx0Svkplcs6rhiMa31gEQortlrURnuip98d6/D1EgtAD/T7q9RKQfttlk1C69Bh6RDwc
         bz6wC0/z/58SIjJWMED0oB3CpXnpSVHLTvT+pf7ukHgtjRmN/+n3pUXZANFj+4db4LcK
         NoiLBGt229HVsSLqg9Fn3WDXX5m+ylErwK5XMRTEI/ggvKnouOtN0aQM4ZwO6UwMKkQO
         xlUQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:message-id:in-reply-to:references: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=/Jk/PxDtr97zfhf3eM7My7bqLd7e9sc0SH74nslArqQ=;
        b=Uu9IksP6Hpr6Mhha+VyBETD/ztSvx3ZNlKgDBKQYhRvqNkzV6iEy+bD2THskxGSTX1
         +6vtxpYCfaacazQ67omY+LvFvmkimYAOK4uFVulVER2T+wVsqINES9VaH55Jl9Kac9Vo
         DZNiefzAj+viLofqbgJoewsAp75rG7SRGTp2RfEutMkkxfmTXhIPZzBB4WP4LIT1r4pn
         uNfNjiShToJfK5tTLy3eqtAU3jrkvB5MxcrGG1W01nvKPeSaoVOjhzC4RWHXfRKae/SU
         /MLBKxGQuPxe3Gm5gh2Kaot0A7cXtgRK7c71/NpNE2wxYi3C5/hvY7rmcuk5puza4TzF
         TqBg==
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:in-reply-to:references
         :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=/Jk/PxDtr97zfhf3eM7My7bqLd7e9sc0SH74nslArqQ=;
        b=OHRYw9DGQ0WRKU9iSEYfnT9PvNH8iCtSi09qOv+rjTwQYUMX+GXUBkjkzh0Db2bJaR
         iGnoXte2mhYE59llygcgyT6fo+pLJUERQa4QBDKM+486qcVtYysMYUnTebcp5kn0QUsV
         m0GtNAooxM6ElPKVOFF1t6G7sxyc6MW2rvvZQyomiPGTa5E484N1BWBAHXUP36uKuCqd
         cZh0MRxZa3Wp7ACDEoKWdjbNhE/6YbsqDNMbkCPnANDilapl9DNBEegwZkfMwdm3/Qdx
         JNGAjnKUbE2s++OFJA6owCxO4x2Vr2dcYe6qMxszRvYN7NCeMadFct24OejsscFC/b5O
         pVTQ==
X-Gm-Message-State: ALyK8tL6et7TZXkUMhGN3vssL2rpZP3kSjpG02GqFMukeShoJhGBF3FpTHcVRJl/mE3pOA==
X-Received: by 10.157.13.11 with SMTP id 11mr5116091oti.24.1465007738413;
        Fri, 03 Jun 2016 19:35:38 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.36.69 with SMTP id k66ls554994iok.22.gmail; Fri, 03 Jun
 2016 19:35:37 -0700 (PDT)
X-Received: by 10.36.110.207 with SMTP id w198mr90888itc.6.1465007737640;
        Fri, 03 Jun 2016 19:35:37 -0700 (PDT)
In-Reply-To: <CAOcFa=fnWS=T2p6xgQ_EiCnVTmkSk_UrobDMYvXhaKi95cxrdQ@mail.gmail.com>
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:26165
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/26165>

------=_Part_1147_620087267.1465007736584
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Friday, June 3, 2016 at 9:11:26 PM UTC-5, Ron wrote:
> Okay, I've done some thinking here.=C2=A0 The simplest solution should be=
 the correct one.=C2=A0 I think the standard should stick to something very=
 basic here, otherwise we get into an area that is too complicated to imple=
ment.=C2=A0 All we should have in terms of a standard audio interface for C=
++ is:
>=20
>=20
> 1) A method for enumerating the interfaces on a machine.
> 2) A method for getting each interfaces capabilities (supported rates, bi=
t depths etc.).
> 3) A method for activating a requested device for sending and receiving f=
rames in the requested format.
>=20
>=20
> Valid types for audio samples should be either a signed integer, a float =
or a double.=C2=A0 And that's pretty much it.=C2=A0 Get audio input, put au=
dio output.=C2=A0 Anything other than that would be a different proposal al=
l together.=C2=A0 Audio, video or DSP processing in general should certainl=
y be a different proposal.
>=20
>=20
> But I would propose we also add an int24_t class into the standard for pr=
ocessing 24-bit samples.=C2=A0 Something as simple as this would suffice fo=
r now:
> class int24_t
> {
> private:
> =C2=A0 =C2=A0 int8_t val[3];
> };
>=20
>=20
> Something more fully featured would be desirable, like this: https://gith=
ub.com/RonNovy/CppDSP/blob/master/src/int24_t.h
> But I guess that, would be another proposal.
>=20
>=20
> On Fri, Jun 3, 2016 at 6:47 PM,  <alexande...@gmail.com> wrote:
> On Friday, June 3, 2016 at 8:30:49 PM UTC-5, Jeffrey Yasskin wrote:
>=20
> > On Fri, Jun 3, 2016 at 6:09 PM, Thiago Macieira <thi...@macieira.org> w=
rote:
>=20
> > On s=C3=A1bado, 4 de junho de 2016 02:20:15 BRT Andrey Semashev wrote:
>=20
> >
>=20
> > > What is needed is a standardized interface for these different module=
s
>=20
> >
>=20
> > > to work with each other. The interface should also allow me, the
>=20
> >
>=20
> > > developer, to work with the media (e.g. create my own audio or image
>=20
> >
>=20
> > > filter or a new codec or a new device driver).
>=20
> >
>=20
> >
>=20
> >
>=20
> > That I agree with.
>=20
> >
>=20
> >
>=20
> >
>=20
> > But should the standard mandate that there should be at least one? How =
does
>=20
> >
>=20
> > someone write a plugin to the C++ Standard Library? Will we now mandate=
 this
>=20
> >
>=20
> > kind of ability?
>=20
> >
>=20
> >
>=20
> >
>=20
> > Yes. We already do this with things like the random engines.
>=20
> >
>=20
> >
>=20
> > If not, then will there be a requirement that the C++ library vendor pr=
ovide
>=20
> >
>=20
> > it? If so, please think carefully how Apple should code libc++ to work =
on iOS.
>=20
> >
>=20
> >
>=20
> >
>=20
> > WebCrypto has an example of=C2=A0navigating a legal minefield for imple=
menters.
>=20
> >
>=20
> >
>=20
> >
>=20
> > Also remember to leave the legal speculation to lawyers. It's good to h=
ave the heads-up that "hey lawyers should look at this", but anything more =
is unwise.
>=20
> >
>=20
> >
>=20
> > Again, I think this is not material for the C++ Standard Library.
>=20
> >
>=20
> >
>=20
> > I think it's a great area for the C++ library to expand into. I'm defin=
itely worried about the expertise of the people writing the proposal (e.g. =
if I proposed an audio library for C++, I should be laughed off the stage),=
 but we can overcome that by asking well-known audio users for their opinio=
ns before standardizing the proposal.
>=20
> >
>=20
> >
>=20
> > Jeffrey
>=20
>=20
>=20
> I agree about the issue of expertise. By no means would I call myself an =
expert, but I have a degree in audio engineering and a pretty solid grasp o=
f the c++ language. Are there people out there more skilled than me at each=
 topic? Of course, but that's why I am here, to get the opinions of those p=
eople if I can an figure out what needs to be done to make this library a r=
eality.
>=20
>=20
>=20
> --
>=20
> You received this message because you are subscribed to the Google Groups=
 "ISO C++ Standard - Future Proposals" group.
>=20
> To unsubscribe from this group and stop receiving emails from it, send an=
 email to std-proposal...@isocpp.org.
>=20
> To post to this group, send email to std-pr...@isocpp.org.
>=20
> To view this discussion on the web visit https://groups.google.com/a/isoc=
pp.org/d/msgid/std-proposals/62b7649a-5de5-4330-9bac-708375d36e2c%40isocpp.=
org.

I think that simplicity is a good way to go but I believe that what you are=
 proposing may be too basic. As it stands none of the std containers meet t=
he needs for audio. The closest I would argue could be std::array of you ar=
e okay with a buffer length fixed at compile time or std::vector but std::v=
ector could cause a dynamic memory allocation on a real time thread if the =
user tries to push_back and the vector needs to expand. This allocation cou=
ld lead to an unknown wait time for the audio thread and possibly result in=
 buffer under flow to the driver. You could use a plain array but that leav=
es room for memory leaks and makes copying buffers difficult.=20

A container designed for real-time usage would be needed.=20

I don't see how processing would need to be a different proposal, what is a=
n audio library without a well organized and effiecint way means for intera=
cting with the audio data?=20

If processing does need to be a different proposal, I do believe that they =
would need to be designed simultaneously so that they might be easily inter=
faces with each other, because I feel that they would most likely be used i=
n conjunction in many cases.

--=20
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 e=
mail 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/a27c2580-c766-4488-bc26-a7b15783e0fd%40isocpp.or=
g.

------=_Part_1147_620087267.1465007736584--

.
