# generated by datamodel-codegen:
#   filename:  core/assets/audio_asset.json
#   timestamp: 2026-02-28T17:39:50+00:00

from __future__ import annotations

from enum import Enum, IntEnum
from typing import Annotated

from adcp.types.base import AdCPBaseModel
from pydantic import AnyUrl, ConfigDict, Field

from .. import provenance as provenance_1


class BitDepth(IntEnum):
    integer_16 = 16
    integer_24 = 24
    integer_32 = 32


class Channels(Enum):
    mono = 'mono'
    stereo = 'stereo'
    field_5_1 = '5.1'
    field_7_1 = '7.1'


class AudioAsset(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    bit_depth: Annotated[BitDepth | None, Field(description='Bit depth')] = None
    bitrate_kbps: Annotated[
        int | None, Field(description='Bitrate in kilobits per second', ge=1)
    ] = None
    channels: Annotated[Channels | None, Field(description='Channel configuration')] = None
    codec: Annotated[
        str | None,
        Field(
            description='Audio codec used (aac, aac_lc, he_aac, pcm, mp3, vorbis, opus, flac, ac3, eac3, etc.)'
        ),
    ] = None
    container_format: Annotated[
        str | None,
        Field(description='Audio container/file format (mp3, m4a, aac, wav, ogg, flac, etc.)'),
    ] = None
    duration_ms: Annotated[
        int | None, Field(description='Audio duration in milliseconds', ge=0)
    ] = None
    file_size_bytes: Annotated[int | None, Field(description='File size in bytes', ge=1)] = None
    loudness_lufs: Annotated[float | None, Field(description='Integrated loudness in LUFS')] = None
    provenance: Annotated[
        provenance_1.Provenance | None,
        Field(
            description='Provenance metadata for this asset, overrides manifest-level provenance'
        ),
    ] = None
    sampling_rate_hz: Annotated[
        int | None, Field(description='Sampling rate in Hz (e.g., 44100, 48000, 96000)')
    ] = None
    transcript_url: Annotated[
        AnyUrl | None, Field(description='URL to text transcript of the audio content')
    ] = None
    true_peak_dbfs: Annotated[float | None, Field(description='True peak level in dBFS')] = None
    url: Annotated[AnyUrl, Field(description='URL to the audio asset')]
