• 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_Deprecatedmicrophone_stream.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
proceedings link
2023-11-29
line_packet.py
line packet commited
2023-06-02
mic_test_whisper_simple.py
vad
2023-12-02
mic_test_whisper_streaming.py
vad
2023-12-02
microphone_stream.py
vad
2023-12-02
voice_activity_controller.py
delete unused var
2023-12-02
whisper_online.py
logfile reviewed, whisper_timestamped loading module and vad
2023-11-28
whisper_online_server.py
Ukrainian tokenizer support
2023-06-06
Rodrigo 2023-12-02 70c5355 vad UNIX
Raw Open in browser Change history
### mic stream import queue import re import sys import pyaudio class MicrophoneStream: def __init__( self, sample_rate: int = 16000, ): """ Creates a stream of audio from the microphone. Args: chunk_size: The size of each chunk of audio to read from the microphone. channels: The number of channels to record audio from. sample_rate: The sample rate to record audio at. """ try: import pyaudio except ImportError: raise Exception('py audio not installed') self._pyaudio = pyaudio.PyAudio() self.sample_rate = sample_rate self._chunk_size = int(self.sample_rate * 0.1) self._stream = self._pyaudio.open( format=pyaudio.paInt16, channels=1, rate=sample_rate, input=True, frames_per_buffer=self._chunk_size, ) self._open = True def __iter__(self): """ Returns the iterator object. """ return self def __next__(self): """ Reads a chunk of audio from the microphone. """ if not self._open: raise StopIteration try: return self._stream.read(self._chunk_size) except KeyboardInterrupt: raise StopIteration def close(self): """ Closes the stream. """ self._open = False if self._stream.is_active(): self._stream.stop_stream() self._stream.close() self._pyaudio.terminate()

          
        
    
    
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