Interface SFXGenerateRequest

Request payload for sound-effect generation from a text prompt.

Passed to IAudioGenerator.generateSFX by the high-level orchestration layer after normalising user input.

Example

const request: SFXGenerateRequest = {
prompt: 'Thunder crack followed by heavy rain on a tin roof',
durationSec: 5,
};
interface SFXGenerateRequest {
    prompt: string;
    modelId?: string;
    durationSec?: number;
    outputFormat?: AudioOutputFormat;
    seed?: number;
    n?: number;
    userId?: string;
    providerOptions?: Record<string, unknown>;
}

Properties

prompt: string

Text prompt describing the desired sound effect.

Be specific about the sound, its environment, and any layering (e.g. "glass breaking on a marble floor in a large hall with reverb").

modelId?: string

Model identifier to use for generation.

When omitted the provider falls back to its IAudioGenerator.defaultModelId.

durationSec?: number

Desired output duration in seconds.

SFX clips are typically short (1-15 seconds). Providers may enforce their own limits.

outputFormat?: AudioOutputFormat

Output audio format.

Default

'mp3'
seed?: number

Seed for reproducible output.

Not all providers honour seeds — check provider documentation.

n?: number

Number of audio clips to generate.

Default

1
userId?: string

Identifier of the requesting user (for billing / rate limiting).

providerOptions?: Record<string, unknown>

Arbitrary provider-specific options.