Media¶
- class audformat.Media(type='other', *, format=None, sampling_rate=None, channels=None, bit_depth=None, video_fps=None, video_resolution=None, video_channels=None, video_depth=None, description=None, meta=None)[source]¶
Media information.
File
format
is always converted to lower case.- Parameters
type (
str
) – media type, seeaudformat.define.MediaType
for available media typesformat (
Optional
[str
]) – file format (e.g. ‘wav’, ‘flac’, ‘mp4’)video_fps (
Optional
[int
]) – video rate in frames per secondsvideo_resolution (
Optional
[Sequence
[int
]]) – video resolution in pixels (e.g.[800, 600]
)video_channels (
Optional
[int
]) – number of channels per pixel (e.g. 3 for RGB)video_depth (
Optional
[int
]) – number of bits per video channel
- Raises
BadValueError – if an invalid
type
is passed
Examples
>>> Media( ... type=define.MediaType.AUDIO, ... format="wav", ... sampling_rate=16000, ... channels=2, ... ) {type: audio, format: wav, channels: 2, sampling_rate: 16000}