I have a proprietary library lets say libX.
libX is a Speech Recognition and has a function to write to a wav(In my case it's pcm).
The function let's libX write has this definition:
void Write
(
FILE * const p,
const float * const * const buffer,
const float range,
const size_t frameToBeWritten,
size_t * const frameWritten
);
I have managed to fill a buffer which is float **, however I still get segmentation fault.
My question How would one go about fixing this problem.
I have a working example of this function, however that example doesn't do justice to the implementation,checked gdb with function PrintArray, since I investigated how the working example float ** is being filled :
void PrintArray(float ** a,int channels,int buffer_length){
int i;
int j;
for (i=0; i<channels; i++)
{
printf("===========================");
printf("Channel %d \n",i);
for (j=0; j<buffer_length; j++)
{
printf("%f ", a[i][j]);
}
printf("\n");
}
}
In both my code and the example code, the arrays are being filled correctly I couldn't find any differences betweem my float ** and the working example float **
For more code please refer to: Filling up float ** from int16_t *