using float buffer to feed PXCAudio and do SR

using float buffer to feed PXCAudio and do SR

imagem de Shuyuan M.

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. :)

Download bu.cpp3.33 KB
5 posts / 0 new
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.
imagem de David Lu (Intel)

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

imagem de Mikhail Nikolsky (Intel)

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.

imagem de Green A.

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

imagem de Green A.

anyone here?

Faça login para deixar um comentário.