• Y
  • List All
  • Feedback
    • This Project
    • All Projects
Profile Account settings Log out
  • Favorite
  • Project
  • All
Loading...
  • Log in
  • Sign up
yjyoon / whisper_streaming_Deprecated star
  • Project homeH
  • CodeC
  • IssueI
  • Pull requestP
  • Review R
  • MilestoneM
  • BoardB 1
  • Files
  • Commit
  • Branches
whisper_streaming_Deprecatedvoice_activity_controller.py
Download as .zip file
File name
Commit message
Commit date
.gitignore
Initial commit
2023-04-05
LICENSE
Initial commit
2023-04-05
README.md
Merge branch 'main' into vad-streaming-clean
2024-08-19
line_packet.py
Merge branch 'main' into vad-streaming-clean
2024-08-19
silero_vad.py
clean code with VAC
2024-08-19
voice_activity_controller.py
clean code with VAC
2024-08-19
whisper_online.py
clean code with VAC
2024-08-19
whisper_online_server.py
removing duplicated code -- whisper_online_vac
2024-08-19
Dominik Macháček 2024-08-19 c300a03 clean code with VAC UNIX
Raw Open in browser Change history
import torch from silero_vad import VADIterator import time class VoiceActivityController: SAMPLING_RATE = 16000 def __init__(self): self.model, _ = torch.hub.load( repo_or_dir='snakers4/silero-vad', model='silero_vad' ) # we use the default options: 500ms silence, etc. self.iterator = VADIterator(self.model) def reset(self): self.iterator.reset_states() def __call__(self, audio): ''' audio: audio chunk in the current np.array format returns: - { 'start': time_frame } ... when voice start was detected. time_frame is number of frame (can be converted to seconds) - { 'end': time_frame } ... when voice end is detected - None ... when no change detected by current chunk ''' x = audio # if not torch.is_tensor(x): # try: # x = torch.Tensor(x) # except: # raise TypeError("Audio cannot be casted to tensor. Cast it manually") t = time.time() a = self.iterator(x) print("VAD took ",time.time()-t,"seconds") return a

          
        
    
    
Copyright Yona authors & © NAVER Corp. & NAVER LABS Supported by NAVER CLOUD PLATFORM

or
Sign in with github login with Google Sign in with Google
Reset password | Sign up