Update modules/vad/silero_vad.py
Browse files
modules/vad/silero_vad.py
CHANGED
@@ -9,7 +9,7 @@ import faster_whisper
|
|
9 |
from faster_whisper.transcribe import SpeechTimestampsMap
|
10 |
import gradio as gr
|
11 |
|
12 |
-
class Segment(
|
13 |
id: Optional[int] = Field(default=None, description="Incremental id for the segment")
|
14 |
seek: Optional[int] = Field(default=None, description="Seek of the segment from chunked audio")
|
15 |
text: Optional[str] = Field(default=None, description="Transcription text of the segment")
|
@@ -22,6 +22,12 @@ class Segment(BaseModel):
|
|
22 |
no_speech_prob: Optional[float] = Field(default=None, description="Probability that it's not speech")
|
23 |
words: Optional[List['Word']] = Field(default=None, description="List of words contained in the segment")
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
class SileroVAD:
|
26 |
def __init__(self):
|
27 |
self.sampling_rate = 16000
|
|
|
9 |
from faster_whisper.transcribe import SpeechTimestampsMap
|
10 |
import gradio as gr
|
11 |
|
12 |
+
class Segment(self):
|
13 |
id: Optional[int] = Field(default=None, description="Incremental id for the segment")
|
14 |
seek: Optional[int] = Field(default=None, description="Seek of the segment from chunked audio")
|
15 |
text: Optional[str] = Field(default=None, description="Transcription text of the segment")
|
|
|
22 |
no_speech_prob: Optional[float] = Field(default=None, description="Probability that it's not speech")
|
23 |
words: Optional[List['Word']] = Field(default=None, description="List of words contained in the segment")
|
24 |
|
25 |
+
class Word(self):
|
26 |
+
start: Optional[float] = Field(default=None, description="Start time of the word")
|
27 |
+
end: Optional[float] = Field(default=None, description="Start time of the word")
|
28 |
+
word: Optional[str] = Field(default=None, description="Word text")
|
29 |
+
probability: Optional[float] = Field(default=None, description="Probability of the word")
|
30 |
+
|
31 |
class SileroVAD:
|
32 |
def __init__(self):
|
33 |
self.sampling_rate = 16000
|