34 lines
720 B
C++
34 lines
720 B
C++
#include "cgaborator.h"
|
|
#include <cstdio>
|
|
#include <iostream>
|
|
|
|
#define BLOCK_SIZE 8192
|
|
|
|
int main() {
|
|
|
|
auto fp = fopen("test.raw", "r");
|
|
|
|
if (fp == nullptr){
|
|
return 1;
|
|
}
|
|
|
|
auto ptr = gaborator_initialize(16000, 85, 110, 7040, 440);
|
|
if (ptr == nullptr){
|
|
return 1;
|
|
}
|
|
|
|
float audioData[BLOCK_SIZE];
|
|
|
|
while (true){
|
|
auto read = fread(&audioData[0], sizeof(audioData[0]), sizeof(audioData) / sizeof(audioData[0]), fp);
|
|
if (read < sizeof(audioData) / sizeof(audioData[0])) { //EOF
|
|
break;
|
|
}
|
|
gaborator_analyze(ptr, &audioData[0], sizeof(audioData) / sizeof(audioData[0]));
|
|
}
|
|
|
|
fclose(fp);
|
|
|
|
gaborator_release(ptr);
|
|
return 0;
|
|
} |