|
6 | 6 | # See https://docs.python.org/3/library/typing.html
|
7 | 7 | #
|
8 | 8 |
|
| 9 | +from enum import Enum |
9 | 10 | from typing import Any, Callable, List, Mapping, Optional
|
10 | 11 |
|
11 |
| -class Daily: |
12 |
| - @staticmethod |
13 |
| - def init(worker_threads: int = 2) -> None: ... |
14 |
| - @staticmethod |
15 |
| - def deinit() -> None: ... |
16 |
| - @staticmethod |
17 |
| - def create_camera_device( |
18 |
| - device_name: str, width: int, height: int, color_format: str = "RGBA" |
19 |
| - ) -> VirtualCameraDevice: ... |
20 |
| - @staticmethod |
21 |
| - def create_speaker_device( |
22 |
| - device_name: str, sample_rate: int = 16000, channels: int = 1, non_blocking: bool = False |
23 |
| - ) -> VirtualSpeakerDevice: ... |
24 |
| - @staticmethod |
25 |
| - def create_microphone_device( |
26 |
| - device_name: str, sample_rate: int = 16000, channels: int = 1, non_blocking: bool = False |
27 |
| - ) -> VirtualMicrophoneDevice: ... |
28 |
| - @staticmethod |
29 |
| - def create_native_vad( |
30 |
| - reset_period_ms: int = 500, sample_rate: int = 16000, channels: int = 1 |
31 |
| - ) -> NativeVad: ... |
32 |
| - @staticmethod |
33 |
| - def select_speaker_device(device_name: str) -> None: ... |
| 12 | +class AudioData: |
| 13 | + @property |
| 14 | + def bits_per_sample(self) -> int: ... |
| 15 | + @property |
| 16 | + def sample_rate(self) -> int: ... |
| 17 | + @property |
| 18 | + def num_channels(self) -> int: ... |
| 19 | + @property |
| 20 | + def num_audio_frames(self) -> int: ... |
| 21 | + @property |
| 22 | + def audio_frames(self) -> bytes: ... |
34 | 23 |
|
35 | 24 | class CallClient:
|
36 | 25 | def __init__(self, event_handler: Optional[EventHandler] = None) -> None: ...
|
@@ -240,6 +229,45 @@ class CallClient:
|
240 | 229 | completion: Optional[Callable[[Optional[str]], None]] = None,
|
241 | 230 | ) -> None: ...
|
242 | 231 |
|
| 232 | +class CustomAudioSource: |
| 233 | + def __init__(self, sample_rate: int, channels: int) -> None: ... |
| 234 | + @property |
| 235 | + def sample_rate(self) -> int: ... |
| 236 | + @property |
| 237 | + def channels(self) -> int: ... |
| 238 | + def write_frames( |
| 239 | + self, frame: bytes, completion: Optional[Callable[[int], None]] = None |
| 240 | + ) -> int: ... |
| 241 | + |
| 242 | +class CustomAudioTrack: |
| 243 | + def __init__(self, audio_source: CustomAudioSource) -> None: ... |
| 244 | + @property |
| 245 | + def id(self) -> str: ... |
| 246 | + |
| 247 | +class Daily: |
| 248 | + @staticmethod |
| 249 | + def init(worker_threads: int = 2) -> None: ... |
| 250 | + @staticmethod |
| 251 | + def deinit() -> None: ... |
| 252 | + @staticmethod |
| 253 | + def create_camera_device( |
| 254 | + device_name: str, width: int, height: int, color_format: str = "RGBA" |
| 255 | + ) -> VirtualCameraDevice: ... |
| 256 | + @staticmethod |
| 257 | + def create_speaker_device( |
| 258 | + device_name: str, sample_rate: int = 16000, channels: int = 1, non_blocking: bool = False |
| 259 | + ) -> VirtualSpeakerDevice: ... |
| 260 | + @staticmethod |
| 261 | + def create_microphone_device( |
| 262 | + device_name: str, sample_rate: int = 16000, channels: int = 1, non_blocking: bool = False |
| 263 | + ) -> VirtualMicrophoneDevice: ... |
| 264 | + @staticmethod |
| 265 | + def create_native_vad( |
| 266 | + reset_period_ms: int = 500, sample_rate: int = 16000, channels: int = 1 |
| 267 | + ) -> NativeVad: ... |
| 268 | + @staticmethod |
| 269 | + def select_speaker_device(device_name: str) -> None: ... |
| 270 | + |
243 | 271 | class EventHandler:
|
244 | 272 | def __init__(self) -> None: ...
|
245 | 273 | def on_active_speaker_changed(self, participant: Mapping[str, Any]) -> None: ...
|
@@ -277,32 +305,26 @@ class EventHandler:
|
277 | 305 | def on_transcription_started(self, status: Mapping[str, Any]) -> None: ...
|
278 | 306 | def on_transcription_stopped(self, stopped_by: str, stopped_by_error: bool) -> None: ...
|
279 | 307 |
|
280 |
| -class AudioData: |
281 |
| - @property |
282 |
| - def bits_per_sample(self) -> int: ... |
283 |
| - @property |
284 |
| - def sample_rate(self) -> int: ... |
285 |
| - @property |
286 |
| - def num_channels(self) -> int: ... |
287 |
| - @property |
288 |
| - def num_audio_frames(self) -> int: ... |
| 308 | +class LogLevel(Enum): |
| 309 | + Off: LogLevel |
| 310 | + Error: LogLevel |
| 311 | + Warn: LogLevel |
| 312 | + Info: LogLevel |
| 313 | + Debug: LogLevel |
| 314 | + Trace: LogLevel |
| 315 | + |
| 316 | + def __str__(self) -> str: ... |
289 | 317 | @property
|
290 |
| - def audio_frames(self) -> bytes: ... |
| 318 | + def value(self) -> int: ... |
291 | 319 |
|
292 |
| -class CustomAudioSource: |
293 |
| - def __init__(self, sample_rate: int, channels: int) -> None: ... |
| 320 | +class NativeVad: |
| 321 | + @property |
| 322 | + def rest_period_ms(self) -> int: ... |
294 | 323 | @property
|
295 | 324 | def sample_rate(self) -> int: ...
|
296 | 325 | @property
|
297 | 326 | def channels(self) -> int: ...
|
298 |
| - def write_frames( |
299 |
| - self, frame: bytes, completion: Optional[Callable[[int], None]] = None |
300 |
| - ) -> int: ... |
301 |
| - |
302 |
| -class CustomAudioTrack: |
303 |
| - def __init__(self, audio_source: CustomAudioSource) -> None: ... |
304 |
| - @property |
305 |
| - def id(self) -> str: ... |
| 327 | + def analyze_frames(self, frame: bytes) -> float: ... |
306 | 328 |
|
307 | 329 | class VideoFrame:
|
308 | 330 | @property
|
@@ -348,12 +370,3 @@ class VirtualSpeakerDevice:
|
348 | 370 | def read_frames(
|
349 | 371 | self, num_frame: int, completion: Optional[Callable[[bytes], None]] = None
|
350 | 372 | ) -> bytes: ...
|
351 |
| - |
352 |
| -class NativeVad: |
353 |
| - @property |
354 |
| - def rest_period_ms(self) -> int: ... |
355 |
| - @property |
356 |
| - def sample_rate(self) -> int: ... |
357 |
| - @property |
358 |
| - def channels(self) -> int: ... |
359 |
| - def analyze_frames(self, frame: bytes) -> float: ... |
|
0 commit comments