Python class
AudioGenerationMetadata
AudioGenerationMetadata
class max.interfaces.AudioGenerationMetadata(*, sample_rate=None, duration=None, chunk_id=None, timestamp=None, final_chunk=None, model_name=None, request_id=None, tokens_generated=None, processing_time=None, echo=None)
Bases: Struct
Represents metadata associated with audio generation.
This class will eventually replace the metadata dictionary used throughout the AudioGenerationOutput object, providing a structured and type-safe alternative for audio generation metadata.
-
Parameters:
-
- sample_rate (int | None) – The sample rate of the generated audio in Hz.
- duration (float | None) – The duration of the generated audio in seconds.
- chunk_id (int | None) – Identifier for the audio chunk (useful for streaming).
- timestamp (str | None) – Timestamp when the audio was generated.
- final_chunk (bool | None) – Whether this is the final chunk in a streaming sequence.
- model_name (str | None) – Name of the model used for generation.
- request_id (RequestID | None) – Unique identifier for the generation request.
- tokens_generated (int | None) – Number of tokens generated for this audio.
- processing_time (float | None) – Time taken to process this audio chunk in seconds.
- echo (str | None) – Echo of the input prompt or identifier for verification.
chunk_id
duration
echo
final_chunk
model_name
processing_time
request_id
sample_rate
timestamp
to_dict()
to_dict()
Convert the metadata to a dictionary format.
tokens_generated
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!