| 1 |
from typing import Iterator, Literal |
| 2 |
|
| 3 |
from av.codec.context import CodecContext |
| 4 |
from av.packet import Packet |
| 5 |
|
| 6 |
from .format import AudioFormat |
| 7 |
from .frame import AudioFrame |
| 8 |
from .layout import AudioLayout |
| 9 |
|
| 10 |
class _Format: |
| 11 |
def __get__(self, i: object | None, owner: type | None = None) -> AudioFormat: ... |
| 12 |
def __set__(self, instance: object, value: AudioFormat | str) -> None: ... |
| 13 |
|
| 14 |
class _Layout: |
| 15 |
def __get__(self, i: object | None, owner: type | None = None) -> AudioLayout: ... |
| 16 |
def __set__(self, instance: object, value: AudioLayout | str) -> None: ... |
| 17 |
|
| 18 |
class AudioCodecContext(CodecContext): |
| 19 |
frame_size: int |
| 20 |
sample_rate: int |
| 21 |
rate: int |
| 22 |
type: Literal["audio"] |
| 23 |
format: _Format |
| 24 |
layout: _Layout |
| 25 |
@property |
| 26 |
def channels(self) -> int: ... |
| 27 |
def encode(self, frame: AudioFrame | None = None) -> list[Packet]: ... |
| 28 |
def encode_lazy(self, frame: AudioFrame | None = None) -> Iterator[Packet]: ... |
| 29 |
def decode(self, packet: Packet | None = None) -> list[AudioFrame]: ... |