using float buffer to feed PXCAudio and do SR

using float buffer to feed PXCAudio and do SR

I am trying to using a float buffer to feed PXCAudio and do SR. But My code does not work, can anyone help? thanks in advance.

I am not sure about if my initiation for PXCAudio::AudioInfo info and PXCAudio::AudioData data is correct.

Please find my current code in the attachment. The "byteWaveBuffer" is a globle varible which I am sure it is not empty before used to initialize the PXCAudio::AudioData data.

Thanks again for any help and answers. :)

Downloadtext/x-c++src bu.cpp3.33 KB
5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I have forwarded your question to our development team and should be back to you soon.

You will need to fill more fields in AudioInfo and AudioData before CreateAudio.

  pxcU32      bufferSize;     /* buffer size in number samples */
  pxcU32      sampleRate;     /* samples per second */
  pxcU32      nchannels;      /* number of channels */

  AudioFormat     format;
  pxcU32          dataSize;   // in number samples 

Let us know if that resolved your problem or not.

I have filled all fields in AudioInfo and AudioData but it still does not work.

filled like that:


PXCAudio::AudioInfo info;
memset(&info, 0, sizeof(info));
info.format = PXCAudio::AUDIO_FORMAT_IEEE_FLOAT;

info.bufferSize=2000;//and i have try input 32000 in it

info.sampleRate = 16000;

info.nchannels = 1;

info.mask?=3;//(2 or 1);
PXCAudio::AudioData data;
memset(&data, 0, sizeof(data));
data.format = PXCAudio::WAVE_FORMAT_PCM;
data.dataPtr = byteWaveBuffer;//a audio buf it can play by Cool Edit Pro 2.1

data.dataSize = sizeof(byteWaveBuffer);

thank you

anyone here?

Leave a Comment

Please sign in to add a comment. Not a member? Join today