mirror of
https://github.com/xiph/opus.git
synced 2025-05-31 07:37:42 +00:00
single-frame features for -features option
This commit is contained in:
parent
e4b4613d05
commit
3b8d64d746
1 changed files with 6 additions and 6 deletions
|
@ -99,13 +99,13 @@ int main(int argc, char **argv) {
|
|||
LPCNetEncState *net;
|
||||
net = lpcnet_encoder_create();
|
||||
while (1) {
|
||||
float features[4][NB_TOTAL_FEATURES];
|
||||
short pcm[LPCNET_PACKET_SAMPLES];
|
||||
float features[NB_TOTAL_FEATURES];
|
||||
short pcm[LPCNET_FRAME_SIZE];
|
||||
size_t ret;
|
||||
ret = fread(pcm, sizeof(pcm[0]), LPCNET_PACKET_SAMPLES, fin);
|
||||
if (feof(fin) || ret != LPCNET_PACKET_SAMPLES) break;
|
||||
lpcnet_compute_features(net, pcm, features);
|
||||
fwrite(features, sizeof(float), 4*NB_TOTAL_FEATURES, fout);
|
||||
ret = fread(pcm, sizeof(pcm[0]), LPCNET_FRAME_SIZE, fin);
|
||||
if (feof(fin) || ret != LPCNET_FRAME_SIZE) break;
|
||||
lpcnet_compute_single_frame_features(net, pcm, features);
|
||||
fwrite(features, sizeof(float), NB_TOTAL_FEATURES, fout);
|
||||
}
|
||||
lpcnet_encoder_destroy(net);
|
||||
} else if (mode == MODE_SYNTHESIS) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue