Skip to content

Commit

Permalink
fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chenkui164 committed Sep 27, 2022
1 parent 9c5f2dd commit ce4064d
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions lib/Audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,16 +167,18 @@ int Audio::fetch_chunck(float *&dout, int len)

int Audio::fetch(float *&dout, int &len, int &flag)
{

AudioFrame *frame = frame_queue.front();
frame_queue.pop();

dout = speech_data + frame->get_start();
len = frame->get_len();
delete frame;
flag = S_END;

return frame_queue.size();
if (frame_queue.size() > 0) {
AudioFrame *frame = frame_queue.front();
frame_queue.pop();

dout = speech_data + frame->get_start();
len = frame->get_len();
delete frame;
flag = S_END;
return 1;
} else {
return 0;
}
}

void Audio::padding()
Expand Down

0 comments on commit ce4064d

Please sign in to comment.