arioso.base#

Core types and constants for arioso.

Defines the unified output types (Song, AudioResult) and the canonical set of affordance names that all platform adapters map to.

Classes

Affordance(name, type, description[, default])

Descriptor for a unified parameter affordance.

AudioResult([audio_bytes, audio_url, ...])

Unified audio output from any music generation platform.

Song([id, title, status, audio, metadata, ...])

A generated song with its metadata and audio data.

class arioso.base.Affordance(name, type, description, default=None)[source]#

Bases: object

Descriptor for a unified parameter affordance.

name#

Canonical parameter name used at the facade level.

type#

Expected Python type.

description#

Human-readable description.

default#

Default value (None means no default / required).

class arioso.base.AudioResult(audio_bytes=None, audio_url='', audio_array=None, sample_rate=0, format='', duration_seconds=0.0)[source]#

Bases: object

Unified audio output from any music generation platform.

Exactly one of audio_bytes, audio_url, or audio_array will typically be populated by the platform adapter. Conversion between forms can be done on demand by the caller.

audio_bytes#

Raw audio file bytes (MP3, WAV, etc.).

audio_url#

URL to download the audio file.

audio_array#

Numpy array of audio samples.

sample_rate#

Sample rate in Hz (e.g. 44100, 32000).

format#

Audio format string (e.g. “mp3”, “wav”, “pcm”).

duration_seconds#

Duration of the audio in seconds.

class arioso.base.Song(id='', title='', status='pending', audio=<factory>, metadata=<factory>, platform='')[source]#

Bases: object

A generated song with its metadata and audio data.

id#

Provider-specific identifier for the song.

title#

Song title (may be auto-generated by the platform).

status#

Generation status: pending, generating, complete, error.

audio#

The audio output.

metadata#

Provider-specific metadata dict.

platform#

Name of the platform that generated this song.

property audio_array: Any | None#

Shortcut to audio.audio_array.

property audio_bytes: bytes | None#

Shortcut to audio.audio_bytes.

property audio_url: str#

Shortcut to audio.audio_url.

property error_message: str#

Extract error message from metadata, if any.

property is_error: bool#

Check if this Song represents an error response.

property sample_rate: int#

Shortcut to audio.sample_rate.