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

AllegatoDimensione
Download bu.cpp3.33 KB
5 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

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.

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

AudioData:
  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:

WAVEFORMATEX waveFmt;

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.type = PXCAudio::SURFACE_TYPE_SYSTEM_MEMORY;

data.dataSize = sizeof(byteWaveBuffer);

thank you

anyone here?

Lascia un commento

Eseguire l'accesso per aggiungere un commento. Non siete membri? Iscriviti oggi