Re: [Osalp-dev] aflibConverter question
Status: Abandoned
Brought to you by:
daservis
|
From: Bruce F. <for...@tn...> - 2002-03-05 17:50:23
|
Akos Maroy wrote: > > 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. > This class is not really designed to be used by itself. It is certainly difficult to understand. It has also been awhile. The best that I can recommend is to look at the aflibAudioSampleRateCvt class. I would also use an audio chain using this class. This will simplify the task for you. This is the way it was intended to be used. Bruce Forsberg |