Closed hankpillow closed 14 years ago
Hi Igor
Yes, StandardizeFilter actually only upsamples from 22k right now. It doesn't work with arbitrary sample rates. If you need to work with 11k, I would suggest writing your own Filter that quadruples the sample rate, perhaps with some interpolation, which would be fairly straightforward.
Hi, I've read the the README and some comments inside the packages about lower rates ( less then 22050) and I realise we just don't have any code to cope with it.
I'm using the StandardFilter as recommended but still not working.
I'm doing something like this: sound_source = new StandardizeFilter( new SoundSource( new sound_class, new AudioDescriptor(AudioDescriptor.RATE_11025) ) );
But, looking inside the StandardizeFilter.as I checked that there isn't any condition to modify the samples (getSample) when rates are lower.
if (source.descriptor.rate == AudioDescriptor.RATE_44100) { sample = _source.getSample(numFrames); } else if (source.descriptor.rate == AudioDescriptor.RATE_22050) { sample = _source.getSample(Math.floor(numFrames/2)); }
And, following my "logic" I did something like this:
if (source.descriptor.rate == AudioDescriptor.RATE_44100) { sample = _source.getSample(numFrames); } else if (source.descriptor.rate == AudioDescriptor.RATE_22050) { sample = _source.getSample(Math.floor(numFrames/2)); }else if (source.descriptor.rate == AudioDescriptor.RATE_11025) { sample = _source.getSample(Math.floor(numFrames/4)); }
And I also changed position and frameCount methods.
But the result still mute.
Am I doing something wrong or this condition (lower rates) aren't working well yet?
cheers igor