Skip to content

Commit

Permalink
Merge pull request #38 from lovemefan/develop
Browse files Browse the repository at this point in the history
bugfix: index error in last chunk
  • Loading branch information
lovemefan authored Dec 19, 2024
2 parents e05d5c3 + 85a76ed commit d4bda81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sense-voice/csrc/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ int main(int argc, char ** argv) {
n_pad = CHUNK_SIZE <= pcmf32.size() - i ? 0 : CHUNK_SIZE + i - pcmf32.size();

for (int j = i + offset; j < i + CHUNK_SIZE; j++) {
if (j > 0 && j < i + CONTEXT_SIZE - n_pad){
if (j > 0 && j < i + CONTEXT_SIZE - n_pad && j < pcmf32.size()){
chunk[j - i - offset] = pcmf32[j] / 32768;
} else{
//pad chunk when first chunk in left or data not enough in right
Expand Down

0 comments on commit d4bda81

Please sign in to comment.