nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches

◆ contin_array_create()

int contin_array_create ( void *  pcm_cont,
uint32_t  pcm_cont_size,
void const *const  pcm_finite,
uint32_t  pcm_finite_size,
uint32_t *const  finite_pos 
)

#include <include/contin_array.h>

Creates a continuous array from a finite array.

Parameters
pcm_contPointer to the destination array.
pcm_cont_sizeSize of pcm_cont.
pcm_finitePointer to an array of samples or data.
pcm_finite_sizeSize of pcm_finite.
finite_posVariable used internally. Must be set to 0 for the first run and not changed.
Note
This function serves the purpose of e.g. having a set of audio samples stored in pcm_finite. This can then be fetched in smaller pieces into ram and played back in a loop using the results in pcm_cont. The function keeps track of the current position in finite_pos, so that the function can be called multiple times and maintain the correct position in pcm_finite.
Return values
0If the operation was successful.
-EPERMIf any sizes are zero.
-ENXIOOn NULL pointer.