Tool/software: TI-RTOS
Once I got the pdmstream example built and running I found a bug in pdmstream.c on line 416 --
SA_processPDMData() calls SA_envelopeDetector with the 2nd argument AUDIO_BUF_UNCOMPRESSED_SIZE (buffer size in bytes!) but the formal parameter is numOfSamples, which is used to index through the buffer of uint_16. To get meaningful results out of SA_envelopeDetector I changed the function call to this:
current = SA_envelopeDetector((int16_t *)bufferRequest.buffer->pBuffer,
AUDIO_BUF_UNCOMPRESSED_SIZE/sizeof(int16_t)); // want size in int_16!
Now the "Volume" number in the serial output makes sense.
A bug fix would be appreciated.
Thanks,
Rich
.