[Osalp-dev] aflibConverter question
Status: Abandoned
Brought to you by:
daservis
|
From: Akos M. <da...@ty...> - 2002-03-03 13:04:54
|
Hi, I'm trying to use the class aflibConverter from OSALP to do some raw audio data resampling. And I can't get it to work. I read through the documentation for the class at http://osalp.sourceforge.net/doc/html/class_aflibConverter.html but could someone please elaborate more on the parameters to the aflibConverter::resample() function? In particular: - is inCount an output only parameter, or is it in/out? - in inArray, should I supply a 2 channel input with channels interleaved? - will the outArray contain them interleaved? - for inCount / outCount and the return value: a value of n means: - n * channels values in the actual array? - n values in the actual array? For example: aflibConverter * converter = new aflibConverter( true, true, false); converter->initialize( 0.5, 2); short inArray[2048]; short outArray[1024]; int inCount = 2048; int outCount = 1024; // suppose inArray contains two channel interleaved raw audio data of // 1024 samples int converted = converter->resample( inCount, outCount, inArray, outArray); after this call I get 2048 for inCount and 1024 for the return value. But the data in outArray[0 ... 1024] is no good, if I save it to a file, it's not proper .wav data: $ file result.wav result.wav: data $ play result.wav sox: WAVE: RIFF header not found I'm trying to get it work, but so far only resampling with a factor of 1 gives me any useful results (which is of course quite useless :). Any help would be appreciated. Akos |