cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding PCM buffer data used in audio loop example of bluecoin

Dinakaran Palani
Associate II

how can i store 1 second audio data using audio loop example

7 REPLIES 7
niccolò
ST Employee

Hi @Dinakaran Palani​ ,

if you follow the datapath of the audio signal you will find the audio buffer.

once you find it, you can store it in a long array until you have enough samples to make one second.

hope this helps,

Niccolò

Dinakaran Palani
Associate II

Hi @niccolo.ruffini​ 

how frequently should I capture the data from pcm buffer to another buffer

the second one is how should I declare that buffer for storing one-second samples for the sampling rate 16000 for single-channel

if I declare an array of uint16_t[16000] if I do so I am getting excessive use of ram

Hi @Dinakaran Palani​ ,

you should capture data from the buffer every time it is full, otherwise you loose samples.

do you get the error even if you use the malloc?

Niccolò

Dinakaran Palani
Associate II

how to do it

Hi @Dinakaran Palani​ ,

you can follow this link to check how to use the malloc function.

hope this helps

Niccolò

Dinakaran Palani
Associate II

i tried allocating by using the snippet as shown in the example link I am not able to allocate 16000 memory location

Hi @Dinakaran Palani​ ,

What system are you using?

Niccolò