# V1.1 Video to Sound Effects

> Analyzes a video and generates synchronized, royalty-free sound effects timed to visible actions. Returns the generated sound-effects audio track for commercial use.


## Overview

- **Endpoint**: `https://fal.run/sonilo/v1.1/video-to-sound-effects`
- **Model ID**: `sonilo/v1.1/video-to-sound-effects`
- **Category**: video-to-audio
- **Kind**: inference
**Tags**: sfx, audio, effects, 



## Pricing

Your request will cost **$0.009** per second of output and per sample.

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:


- **`video_url`** (`string`, _required_):
  The video to add sound to (public URL, or upload a file). The generated audio matches the video's length.
  - Examples: "https://storage.googleapis.com/falserverless/model_tests/video_models/mmaudio_input.mp4"

- **`prompt`** (`string`, _optional_):
  Optional. Describe the kind of sound you want; it steers the generated audio for every scene. Leave empty to caption the video automatically.

- **`segments`** (`list<SfxSegment>`, _optional_):
  Optional. Split the video into time ranges, each with its own sound description. Leave empty to split into scenes automatically.
  - Array of SfxSegment

- **`audio_format`** (`AudioFormatEnum`, _optional_):
  Format of the returned audio file: aac (default), mp3, wav, or flac. (The video with sound is always AAC.) Default value: `"aac"`
  - Default: `"aac"`
  - Options: `"wav"`, `"mp3"`, `"aac"`, `"flac"`



**Required Parameters Example**:

```json
{
  "video_url": "https://storage.googleapis.com/falserverless/model_tests/video_models/mmaudio_input.mp4"
}
```

**Full Example**:

```json
{
  "video_url": "https://storage.googleapis.com/falserverless/model_tests/video_models/mmaudio_input.mp4",
  "segments": [
    {}
  ],
  "audio_format": "aac"
}
```


### Output Schema

The API returns the following output format:

- **`audio`** (`Audio`, _required_):
  The generated sound, in your chosen audio format.

- **`audios`** (`list<Audio>`, _required_):
  All generated sounds, one per sample.
  - Array of Audio



**Example Response**:

```json
{
  "audio": {
    "url": "",
    "content_type": "image/png",
    "file_name": "z9RV14K95DvU.png",
    "file_size": 4404019
  },
  "audios": [
    {
      "url": "",
      "content_type": "image/png",
      "file_name": "z9RV14K95DvU.png",
      "file_size": 4404019
    }
  ]
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/sonilo/v1.1/video-to-sound-effects \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "video_url": "https://storage.googleapis.com/falserverless/model_tests/video_models/mmaudio_input.mp4"
   }'
```

### 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(
    "sonilo/v1.1/video-to-sound-effects",
    arguments={
        "video_url": "https://storage.googleapis.com/falserverless/model_tests/video_models/mmaudio_input.mp4"
    },
    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("sonilo/v1.1/video-to-sound-effects", {
  input: {
    video_url: "https://storage.googleapis.com/falserverless/model_tests/video_models/mmaudio_input.mp4"
  },
  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/sonilo/v1.1/video-to-sound-effects)
- [API Documentation](https://fal.ai/models/sonilo/v1.1/video-to-sound-effects/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=sonilo/v1.1/video-to-sound-effects)

### 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)
