Remove type definition for callback to support old Python
Browse files
vad.py
CHANGED
|
@@ -42,7 +42,23 @@ class AbstractTranscription(ABC):
|
|
| 42 |
"""
|
| 43 |
return
|
| 44 |
|
| 45 |
-
def transcribe(self, audio: str, whisperCallable
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
# get speech timestamps from full audio file
|
| 47 |
seconds_timestamps = self.get_transcribe_timestamps(audio)
|
| 48 |
|
|
|
|
| 42 |
"""
|
| 43 |
return
|
| 44 |
|
| 45 |
+
def transcribe(self, audio: str, whisperCallable):
|
| 46 |
+
"""
|
| 47 |
+
Transcribe the given audo file.
|
| 48 |
+
|
| 49 |
+
Parameters
|
| 50 |
+
----------
|
| 51 |
+
audio: str
|
| 52 |
+
The audio file.
|
| 53 |
+
|
| 54 |
+
whisperCallable: Callable[[Union[str, np.ndarray, torch.Tensor]], dict[str, Union[dict, Any]]]
|
| 55 |
+
The callback that is used to invoke Whisper on an audio file/buffer.
|
| 56 |
+
|
| 57 |
+
Returns
|
| 58 |
+
-------
|
| 59 |
+
A list of start and end timestamps, in fractional seconds.
|
| 60 |
+
"""
|
| 61 |
+
|
| 62 |
# get speech timestamps from full audio file
|
| 63 |
seconds_timestamps = self.get_transcribe_timestamps(audio)
|
| 64 |
|