# Mirelo SFX1.6

> Extend any sound effect with seamless, natural tails.


## Overview

- **Endpoint**: `https://fal.run/mirelo-ai/sfx1.6/extend-audio`
- **Model ID**: `mirelo-ai/sfx1.6/extend-audio`
- **Category**: audio-to-audio
- **Kind**: inference
**Tags**: audio-to-audio, sfx



## Pricing

- **Price**: $0.01 per seconds

For more details, see [fal.ai pricing](https://fal.ai/pricing).

## API Information

This model can be used via our HTTP API or more conveniently via our client libraries.
See the input and output schema below, as well as the usage examples.


### Input Schema

The API accepts the following input parameters:


- **`audio_url`** (`string`, _required_):
  URL of the audio prefix to extend. The prefix duration must be 3–59 seconds; the total output (prefix + append_duration) is capped at 60 seconds.
  - Examples: "https://di3otfzjg1gxa.cloudfront.net/mirelo-ambience-birds_chirping.aac"

- **`text_prompt`** (`string`, _optional_):
  Optional text prompt guiding the extension.
  - Examples: "birds chirping"

- **`append_duration`** (`float`, _optional_):
  How many seconds to add after the prefix. Total output = prefix duration + append_duration, capped at 60s. Minimum 1s, maximum 57s (60s cap minus the 3s prefix minimum). Default value: `10`
  - Default: `10`
  - Range: `1` to `57`

- **`ambience`** (`boolean`, _optional_):
  When true, run the extend+loop path: extend the prefix and stitch the end back to the prefix start so the tile loops seamlessly. When false, run a one-shot extension.
  - Default: `false`

- **`double_output`** (`boolean`, _optional_):
  Only used when ambience=true: concatenate the loop with itself for a 2x-length output.
  - Default: `false`

- **`num_samples`** (`integer`, _optional_):
  Number of variations to generate. Default value: `1`
  - Default: `1`
  - Range: `1` to `4`

- **`seed`** (`integer`, _optional_):
  Seed for generation. -1 or None for random.

- **`upload_audio_format`** (`UploadAudioFormatEnum`, _optional_):
  Audio format for the returned files. Default value: `"wav"`
  - Default: `"wav"`
  - Options: `"wav"`, `"mp3"`, `"aac"`, `"flac"`



**Required Parameters Example**:

```json
{
  "audio_url": "https://di3otfzjg1gxa.cloudfront.net/mirelo-ambience-birds_chirping.aac"
}
```

**Full Example**:

```json
{
  "audio_url": "https://di3otfzjg1gxa.cloudfront.net/mirelo-ambience-birds_chirping.aac",
  "text_prompt": "birds chirping",
  "append_duration": 10,
  "num_samples": 1,
  "upload_audio_format": "wav"
}
```


### Output Schema

The API returns the following output format:

- **`audio`** (`list<Audio>`, _required_):
  Audio with the input prefix preserved and a generated tail (and loop, if ambience=true).
  - Array of Audio
  - Examples: [{"content_type":"audio/wav","file_name":"extended_audio_1.wav","url":"https://v3b.fal.media/files/b/kangaroo/extend_audio_example.wav"}]



**Example Response**:

```json
{
  "audio": [
    {
      "content_type": "audio/wav",
      "file_name": "extended_audio_1.wav",
      "url": "https://v3b.fal.media/files/b/kangaroo/extend_audio_example.wav"
    }
  ]
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/mirelo-ai/sfx1.6/extend-audio \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "audio_url": "https://di3otfzjg1gxa.cloudfront.net/mirelo-ambience-birds_chirping.aac"
   }'
```

### Python

Ensure you have the Python client installed:

```bash
pip install fal-client
```

Then use the API client to make requests:

```python
import fal_client

def on_queue_update(update):
    if isinstance(update, fal_client.InProgress):
        for log in update.logs:
           print(log["message"])

result = fal_client.subscribe(
    "mirelo-ai/sfx1.6/extend-audio",
    arguments={
        "audio_url": "https://di3otfzjg1gxa.cloudfront.net/mirelo-ambience-birds_chirping.aac"
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)
```

### JavaScript

Ensure you have the JavaScript client installed:

```bash
npm install --save @fal-ai/client
```

Then use the API client to make requests:

```javascript
import { fal } from "@fal-ai/client";

const result = await fal.subscribe("mirelo-ai/sfx1.6/extend-audio", {
  input: {
    audio_url: "https://di3otfzjg1gxa.cloudfront.net/mirelo-ambience-birds_chirping.aac"
  },
  logs: true,
  onQueueUpdate: (update) => {
    if (update.status === "IN_PROGRESS") {
      update.logs.map((log) => log.message).forEach(console.log);
    }
  },
});
console.log(result.data);
console.log(result.requestId);
```


## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/mirelo-ai/sfx1.6/extend-audio)
- [API Documentation](https://fal.ai/models/mirelo-ai/sfx1.6/extend-audio/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=mirelo-ai/sfx1.6/extend-audio)

### fal.ai Platform

- [Platform Documentation](https://docs.fal.ai)
- [Python Client](https://docs.fal.ai/clients/python)
- [JavaScript Client](https://docs.fal.ai/clients/javascript)
