From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matt Flax Newsgroups: gmane.comp.audio.sox.devel Subject: Re: 64bit audio read and write Date: Wed, 6 Jul 2016 19:57:37 +1000 Message-ID: <577CD611.80007@flatmax.org> References: <577C4A9A.2000105@flatmax.org> <20160706072934.GA24278@dcvr.yhbt.net> Reply-To: sox-devel@lists.sourceforge.net NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1467802333 26508 80.91.229.3 (6 Jul 2016 10:52:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Jul 2016 10:52:13 +0000 (UTC) To: sox-devel@lists.sourceforge.net Original-X-From: sox-devel-bounces@lists.sourceforge.net Wed Jul 06 12:52:04 2016 Return-path: Envelope-to: gcasd-sox-devel@m.gmane.org X-ACL-Warn: X-Authority-Analysis: v=2.1 cv=O+TEx0JW c=1 sm=1 tr=0 a=j2gF+hSnfl5JSr2jVBK1AQ==:117 a=j2gF+hSnfl5JSr2jVBK1AQ==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=N659UExz7-8A:10 a=xqWC_Br6kY4A:10 a=cAmyUtKerLwA:10 a=quVeovP3AAAA:8 a=P_JWiMecAAAA:8 a=FP58Ms26AAAA:8 a=rM55TPfQLIzE5WimQ7cA:9 a=pILNOxqGKmIA:10 a=-FEs8UIgK8oA:10 a=NWVoK91CQyQA:10 a=AZ-0r2VTK9MkIlfBvydC:22 a=D0-HAvA3Hk9NMREbgwuX:22 a=6LVbBl2NLSWPyIBDCKCu:22 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 In-Reply-To: <20160706072934.GA24278@dcvr.yhbt.net> X-Spam-Score: -1.0 (-) X-Spam-Report: Spam detection software, running on the system "meb", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: On 06/07/16 17:29, Eric Wong wrote: > Matt Flax wrote: >> Hi there, >> >> I currently use libsox to load and save audio data. I was wanting to >> write and read 64bit data, however the generic sox sample type is 32 bit > Correct, sox does some calculations internally in 64-bit double, > but data which flows in between the effects is all 32-bit int. > >> (from sox.h) : >> typedef sox_int32_t sox_sample_t; >> >> The basic format of the read (and write) functions are : >> size_t sox_read( >> sox_format_t * ft, >> sox_sample_t *buf, >> size_t len >> ); >> >> Can anyone tell me the basic methodology for reading/writing 64bit audio ? > It would probably reworking a lot of sox internals and would > require increased memory bandwidth, hurting performance for > common <= 32-bit processing. > > But, where and how are you working with 64-bit audio > and what 64-bit audio formats are there? I think there are 64 bit file formats, aiff-c perhaps ? Also matlab file formats should be supporting 64 bits. Personally, working with filters and various signal processing algorithms like that. It is handy being able to save double length words, possibly which are generated and synthesised in one way or other ... [...] Content analysis details: (-1.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP X-Spam-Score: 0.0 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. X-Headers-End: 1bKkQu-0001vt-Ae X-BeenThere: sox-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: sox-devel-bounces@lists.sourceforge.net Xref: news.gmane.org gmane.comp.audio.sox.devel:491 Archived-At: Received: from lists.sourceforge.net ([216.34.181.88]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bKkR0-00068I-Iy for gcasd-sox-devel@m.gmane.org; Wed, 06 Jul 2016 12:52:02 +0200 Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1bKkQy-00010e-2H; Wed, 06 Jul 2016 10:52:00 +0000 Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1bKkQw-00010Z-AH for sox-devel@lists.sourceforge.net; Wed, 06 Jul 2016 10:51:58 +0000 Received: from nschwqsrv03p.mx.bigpond.com ([61.9.189.237]) by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1bKkQu-0001vt-Ae for sox-devel@lists.sourceforge.net; Wed, 06 Jul 2016 10:51:58 +0000 Received: from nschwcmgw06p ([61.9.190.166]) by nschwmtas01p.mx.bigpond.com with ESMTP id <20160706095738.KTMV16828.nschwmtas01p.mx.bigpond.com@nschwcmgw06p> for ; Wed, 6 Jul 2016 09:57:38 +0000 Received: from meb ([124.190.105.82]) by nschwcmgw06p with BigPond Outbound id FMxd1t00h1mhCic01Mxeoc; Wed, 06 Jul 2016 09:57:38 +0000 Received: from localhost ([::1] helo=[127.0.0.1]) by meb with esmtp (Exim 4.84_2) (envelope-from ) id 1bKjdv-0007EW-Fb for sox-devel@lists.sourceforge.net; Wed, 06 Jul 2016 20:01:19 +1000 On 06/07/16 17:29, Eric Wong wrote: > Matt Flax wrote: >> Hi there, >> >> I currently use libsox to load and save audio data. I was wanting to >> write and read 64bit data, however the generic sox sample type is 32 bit > Correct, sox does some calculations internally in 64-bit double, > but data which flows in between the effects is all 32-bit int. > >> (from sox.h) : >> typedef sox_int32_t sox_sample_t; >> >> The basic format of the read (and write) functions are : >> size_t sox_read( >> sox_format_t * ft, >> sox_sample_t *buf, >> size_t len >> ); >> >> Can anyone tell me the basic methodology for reading/writing 64bit audio ? > It would probably reworking a lot of sox internals and would > require increased memory bandwidth, hurting performance for > common <= 32-bit processing. > > But, where and how are you working with 64-bit audio > and what 64-bit audio formats are there? I think there are 64 bit file formats, aiff-c perhaps ? Also matlab file formats should be supporting 64 bits. Personally, working with filters and various signal processing algorithms like that. It is handy being able to save double length words, possibly which are generated and synthesised in one way or other ... > > I'm not up-to-date with the latest technology, but even 32-bit > is far beyond the range of human hearing; and last I checked; > available ADC/DACs can't even make full use of 24-bit (nor > our ears). 120 dB SPL (threshold of discomfort) is around 20 billion times louder then 20 dB SPL (a whisper). That is approximately 24 bits. However, we can hear down to 10 dB SPL, or lower for young people ... that is approximately 40 bits of dynamic range. Actually, I am not proposing we change the bit depth of sox in its signal processing system, however perhaps we can introduce functions to read and write 64 bit audio ? Something like functions to read64 and write64 perhaps ? > > On the other hand, moving to 32-bit float would make sense for > compatibility with 3rd-party plugins (LADSPA for sure, maybe > LV2?). Right now, we're constantly converting between > float/integer in effects chains which hurts performance. > > ------------------------------------------------------------------------------ > Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San > Francisco, CA to explore cutting-edge tech and listen to tech luminaries > present their vision of the future. This family event has something for > everyone, including kids. Get more information and register today. > http://sdm.link/attshape > _______________________________________________ > SoX-devel mailing list > SoX-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sox-devel ------------------------------------------------------------------------------ Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today. http://sdm.link/attshape