mirror of
https://github.com/xiph/opus.git
synced 2025-06-02 00:27:43 +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;
|
LPCNetEncState *net;
|
||||||
net = lpcnet_encoder_create();
|
net = lpcnet_encoder_create();
|
||||||
while (1) {
|
while (1) {
|
||||||
float features[4][NB_TOTAL_FEATURES];
|
float features[NB_TOTAL_FEATURES];
|
||||||
short pcm[LPCNET_PACKET_SAMPLES];
|
short pcm[LPCNET_FRAME_SIZE];
|
||||||
size_t ret;
|
size_t ret;
|
||||||
ret = fread(pcm, sizeof(pcm[0]), LPCNET_PACKET_SAMPLES, fin);
|
ret = fread(pcm, sizeof(pcm[0]), LPCNET_FRAME_SIZE, fin);
|
||||||
if (feof(fin) || ret != LPCNET_PACKET_SAMPLES) break;
|
if (feof(fin) || ret != LPCNET_FRAME_SIZE) break;
|
||||||
lpcnet_compute_features(net, pcm, features);
|
lpcnet_compute_single_frame_features(net, pcm, features);
|
||||||
fwrite(features, sizeof(float), 4*NB_TOTAL_FEATURES, fout);
|
fwrite(features, sizeof(float), NB_TOTAL_FEATURES, fout);
|
||||||
}
|
}
|
||||||
lpcnet_encoder_destroy(net);
|
lpcnet_encoder_destroy(net);
|
||||||
} else if (mode == MODE_SYNTHESIS) {
|
} else if (mode == MODE_SYNTHESIS) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue