Items with no label
3335 Discussions

Get AudioData in SDK 2016 R2

DMugu
Beginner
1,124 Views

https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?doc_speech_audio_data.html Intel® RealSense™ SDK 2016 R2 Documentation has the following example for obtaing audio data

// audio is a PXCAudio instance

PXCAudio::AudioData data;

audio->AcquireAccess(PXCAudio::ACCESS_READ,&data);

... // audio buffer is in data.dataPtr with number of samples in data.dataSize

audio->ReleaseAccess(&data);

 

but for this you need to create a PXCAudio object, which is obtained from the PCXession using the CreateAudio method, which accepts the PXCAudio :: AudioInfo object. I used the following options, which are in another example.

PXCAudio::AudioInfo info = {};

info.bufferSize = 8200;

info.format = PXCAudio::AUDIO_FORMAT_PCM;

info.sampleRate = 44100;

info.nchannels = 2;

but audio->AcquireAccess(PXCAudio::ACCESS_READ, &data) return -2, that means PXC_STATUS_PARAM_UNSUPPORTED

could you tell me which parameters I should use?

one more question. At what point can I get the data? The documentation says

The AcquireAccess function locks the audio buffer for exclusive access.

Do I understand correctly that I can not get data right away when I run the program? I have to periodically access the loop through audio-> AcquireAccess (PXCAudio :: ACCESS_READ, & date)

do something with the data and then do it

audio-> ReleaseAccess (& data);

that would remove the lock?

What will happen to the new audio data as long as I keep the lock in my application? they are lost?

0 Kudos
1 Reply
MartyG
Honored Contributor III
262 Views

I apologize for the delay in responding. I was carefully researching your case today. Unfortunately I do not have knowledge of this particular subject, and other people who have asked questions in past years about AudioData have not received answers. So it is likely that an Intel support staff member will need to ask your question to the RealSense developer team. I am sure a support agent will be able to reply to your message soon.

0 Kudos
Reply