Skip to content

Commit

Permalink
[fix] fix error in vad (#245)
Browse files Browse the repository at this point in the history
Co-authored-by: user01 <[email protected]>
  • Loading branch information
cdliang11 and user01 authored Dec 27, 2023
1 parent fb2325c commit 2737a26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wespeaker/cli/speaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def extract_embedding(self, audio_path: str):
if len(segments) > 0: # remove head and tail silence
start = int(segments[0]['start'] * sample_rate)
end = int(segments[-1]['end'] * sample_rate)
pcm = pcm[start:end]
pcm = pcm[0, start:end].unsqueeze(0)
else: # all silence, nospeech
return None
pcm = pcm.to(torch.float)
Expand Down

0 comments on commit 2737a26

Please sign in to comment.