Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: ST_I2S ST_FREQUENCY_DIVIDER USBDEVICE
Dependents: HelloWorld_CCA02M1 HelloWorld_CCA02M1_mbedOS HelloWorld_CCA02M1 Karaoke_CCA01M1_CCA02M1_mbedOS
Fork of X_NUCLEO_CCA02M1 by
PDM2PCMAudio Class Reference
PDM2PCMAudio Conversion Library Class. More...
#include <PDM2PCMAudio.h>
Public Member Functions | |
| PDM2PCMAudio (uint32_t frequency, uint32_t channels) | |
| Constructor. | |
| uint32_t | pcm2pdm_samples (uint32_t PCM_samples) |
| Getting number of PCM samples from nummber of PDM samples. | |
| status_t | convert (int16_t *output_buffer, uint16_t *input_buffer, uint32_t volume) |
| Converting audio data from PDM to PCM. | |
| status_t | scramble (uint16_t *output_buffer, uint16_t *input_buffer, uint32_t size) |
| Scrambling audio data. | |
| status_t | demux (uint16_t *output_buffer, uint16_t *input_buffer, uint32_t size) |
| Demuxing audio data. | |
Detailed Description
PDM2PCMAudio Conversion Library Class.
Definition at line 83 of file PDM2PCMAudio.h.
Constructor & Destructor Documentation
| PDM2PCMAudio | ( | uint32_t | frequency, |
| uint32_t | channels | ||
| ) |
Constructor.
- Parameters:
-
frequency Audio sampling frequency. channels Number of audio channels to be recorded.
Definition at line 92 of file PDM2PCMAudio.h.
Member Function Documentation
| status_t convert | ( | int16_t * | output_buffer, |
| uint16_t * | input_buffer, | ||
| uint32_t | volume | ||
| ) |
Converting audio data from PDM to PCM.
- Parameters:
-
output_buffer Pointer to output PCM buffer data. input_buffer Pointer to input PDM buffer data. volume Volume level (it must be in the range [0..PDM2PCM_MAX_VOLUME]).
- Return values:
-
COMPONENT_OK in case of success, COMPONENT_ERROR otherwise.
Definition at line 87 of file PDM2PCMAudio.cpp.
| status_t demux | ( | uint16_t * | output_buffer, |
| uint16_t * | input_buffer, | ||
| uint32_t | size | ||
| ) |
Demuxing audio data.
s
- Parameters:
-
output_buffer Pointer to output PDM buffer data. input_buffer Pointer to input PDM buffer data. size Size of the buffers (thay has to be equally sized).
- Return values:
-
COMPONENT_OK in case of success, COMPONENT_ERROR otherwise.
Demuxing audio data.
- Parameters:
-
output_buffer Pointer to output PDM buffer data. input_buffer Pointer to input PDM buffer data. size Size of the buffers (thay has to be equally sized).
- Return values:
-
COMPONENT_OK in case of success, COMPONENT_ERROR otherwise.
Definition at line 150 of file PDM2PCMAudio.cpp.
| uint32_t pcm2pdm_samples | ( | uint32_t | PCM_samples ) |
Getting number of PCM samples from nummber of PDM samples.
- Parameters:
-
PCM_samples Number of PCM samples.
- Return values:
-
Number of equivalent PDM samples.
Definition at line 75 of file PDM2PCMAudio.cpp.
| status_t scramble | ( | uint16_t * | output_buffer, |
| uint16_t * | input_buffer, | ||
| uint32_t | size | ||
| ) |
Scrambling audio data.
- Parameters:
-
output_buffer Pointer to output PDM buffer data. input_buffer Pointer to input PDM buffer data. size Size of the buffers (thay has to be equally sized).
- Return values:
-
COMPONENT_OK in case of success, COMPONENT_ERROR otherwise.
Definition at line 134 of file PDM2PCMAudio.cpp.
Generated on Wed Jul 13 2022 12:32:42 by
1.7.2

X-NUCLEO-CCA02M1 Digital MEMS Microphones Expansion Board.