[Speex-dev] Down Convertion from 32Khz to 16Khz
nir elkayam
nir.elkayam at gmail.com
Sat Jun 26 09:12:43 PDT 2010
thanks, but actualy this is not my problem.
changing sampling rate may have more problem because of aliasing which need
to be removed.
On Sat, Jun 26, 2010 at 6:18 PM, Clifton Craig <clifton.craig at gmail.com>wrote:
> 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
> }
> }
> Basically you need to write every other byte in thePCM sample stream.
>
>
>
> Clifton Craig
> Software Engineer
> http://codeforfun.wordpress.com
> clifton.craig at gmail.com
>
> On Jun 26, 2010, at 9:50 AM, nir elkayam wrote:
>
> > 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
> > _______________________________________________
> > Speex-dev mailing list
> > Speex-dev at xiph.org
> > http://lists.xiph.org/mailman/listinfo/speex-dev
>
>
--
ניר אלקיים
טל: 050-3930056
nir.elkayam at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/speex-dev/attachments/20100626/325ba918/attachment.htm
More information about the Speex-dev
mailing list