Displaying 2 results from an estimated 2 matches for "eachbyte".
Did you mean:
each_byte
2010 Jun 26
3
Down Convertion from 32Khz to 16Khz
hi
on my device i can sample only at 32khz and want to use speex at 16khz so i
need to down-convert the input signal by factor of 2.
does anyone provide me a reference to some code that does that? are there
any trick to do that?
i tried to add to subsequent sample but the result was very bad.
what are the requrment from a decimation filter for audio?
thanks,
nir
-------------- next part
2010 Jun 26
0
Down Convertion from 32Khz to 16Khz
I've done something similar in Groovy/Java using Wave files. In my case I was downsampling from 16bit to 8bit. Here's the core of my conversion logic.
def convertData(def inputStream, def outputStream) {
boolean otherByte = false
inputStream.eachByte {
if(otherByte) {
//invert high order byte
int inverted = ((int)it) ^ 0x00000080
byte[] toWrite = new byte[1]; toWrite[0] = (byte)inverted
outputStream.write toWrite
otherByte = false
} else otherByte = true
}
}
Basical...