[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Audio Function Problem
From: |
Thomas D. Dean |
Subject: |
Re: Audio Function Problem |
Date: |
Fri, 13 Oct 2017 20:59:31 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
On 10/13/17 12:16, Thomas D. Dean wrote:
I have a problem with audio functions returning values that seem strange.
getaudiodata () should return values between -1 and 1 but, does not.
Seems to be a problem in handling a 24 bit source.
Tom Dean
<snip>
This is a bug in Octave. I sent a patch to Savannah.
I used the sources from octave-4.2.1.tar.gz.
This problem in in the callback function, portaudio_record_callback. The
same problem exists in the function octave_record_callback.
The variables used to convert from 24 bit to 32 bit are not zero'd
inside the loop. Therefore, bits in the high order byte remain,
corrupting the data. Fixing portaudio_record_callback fixes my problem,
but octave_record_callback should be corrected at the same time.
> diff libinterp/dldfcn/audiodevinfo.cc.orig
libinterp/dldfcn/audiodevinfo.cc
1347c1347,1349
< for (int j = 0; j < 3; j++)
---
> // 20171013 tomdean
> sample_l32 = 0; sample_r32 = 0;
> for (int j = 0; j < 3; j++)
1423a1426,1427
> // 20171013 tomdean
> sample_l32 = 0; sample_r32 = 0;
Tom Dean