from app.audio.endpoints.output.base import AudioOutputEndpoint
from app.schemas import AudioChunk, EndpointCapabilities

class LoopbackOutput(AudioOutputEndpoint):
    endpoint_id = "loopback-output"

    def __init__(self):
        self.chunks = []

    async def capabilities(self) -> EndpointCapabilities:
        return EndpointCapabilities(
            id=self.endpoint_id,
            kind="loopback",
            direction="output",
            latency_class="low",
        )

    async def open(self) -> None:
        return None

    async def write_chunk(self, chunk: AudioChunk) -> None:
        self.chunks.append(chunk)

    async def flush(self) -> None:
        return None

    async def close(self) -> None:
        return None
