DataHoarder
0d63ad8d32
All checks were successful
continuous-integration/drone/push Build is passing
35 lines
801 B
C++
35 lines
801 B
C++
#include "cgaborator.h"
|
|
#include <cstdio>
|
|
|
|
#define BLOCK_SIZE 8192
|
|
|
|
int main() {
|
|
|
|
auto fp = fopen("test.raw", "r");
|
|
|
|
if (fp == nullptr){
|
|
return 1;
|
|
}
|
|
|
|
auto ptr = gaborator_initialize(1024 * 64, 16000, 85, 110, 440, 7040, 128);
|
|
|
|
float audioData[BLOCK_SIZE];
|
|
|
|
|
|
size_t return_size, slice_size;
|
|
while (true){
|
|
auto read = fread(&audioData[0], sizeof(audioData[0]), sizeof(audioData) / sizeof(audioData[0]), fp);
|
|
gaborator_transform(ptr, &audioData[0], sizeof(audioData) / sizeof(audioData[0]), &return_size, &slice_size);
|
|
|
|
if (read < sizeof(audioData) / sizeof(audioData[0])) { //EOF
|
|
break;
|
|
}
|
|
}
|
|
|
|
gaborator_transform(ptr, nullptr, 0, &return_size, &slice_size);
|
|
|
|
fclose(fp);
|
|
|
|
gaborator_release(ptr);
|
|
return 0;
|
|
} |