Mercurial > audio-send
changeset 30:32c69ba451d9
fixed bug where sound-processor would generate too many floats
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Mon, 23 Jan 2012 05:49:37 -0700 (2012-01-23) |
parents | cdf320cb5949 |
children | 0e794e48a0cc |
files | org/ear.org |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
1.1 --- a/org/ear.org Sat Dec 10 21:42:50 2011 -0600 1.2 +++ b/org/ear.org Mon Jan 23 05:49:37 2012 -0700 1.3 @@ -773,11 +773,11 @@ 1.4 (process 1.5 [#^ByteBuffer audioSamples numSamples #^AudioFormat audioFormat] 1.6 (let [bytes (byte-array numSamples) 1.7 - floats (float-array numSamples)] 1.8 + num-floats (/ numSamples (.getFrameSize audioFormat)) 1.9 + floats (float-array num-floats)] 1.10 (.get audioSamples bytes 0 numSamples) 1.11 (FloatSampleTools/byte2floatInterleaved 1.12 - bytes 0 floats 0 1.13 - (/ numSamples (.getFrameSize audioFormat)) audioFormat) 1.14 + bytes 0 floats 0 num-floats audioFormat) 1.15 (continuation 1.16 (vec floats)))))) 1.17