# Sound Effect Generation

> Create professional-grade sound effects from animal and vehicle to nature, sci-fi, and otherworldly sounds. Perfect for films, games, and digital content.


## Overview

- **Endpoint**: `https://fal.run/beatoven/sound-effect-generation`
- **Model ID**: `beatoven/sound-effect-generation`
- **Category**: text-to-audio
- **Kind**: inference
**Tags**: sfx, audio, effects, speech



## Pricing

- **Price**: $0.1 per requests

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:


- **`prompt`** (`string`, _required_):
  Describe the sound effect you want to generate
  - Examples: "Powerful helicopter takeoff: rapidly building rotor blades whirring and chopping, increasing engine whine, ground vibrations.", "A futuristic spaceship door opening", "A cinematic explosion with debris falling", "Rain falling on a window pane", "Footsteps on gravel"

- **`negative_prompt`** (`string`, _optional_):
  Describe the types of sounds you don't want to generate in the output, avoid double-negatives, compare with positive prompts Default value: `""`
  - Default: `""`
  - Examples: "Low-pitched hum", "High-pitched screech, rain, wind", "Thunder, lightning", "traffic, people speaking", "Soft whisper"

- **`duration`** (`float`, _optional_):
  Length of the generated sound effect in seconds Default value: `5`
  - Default: `5`
  - Range: `1` to `35`
  - Examples: 7, 10, 20, 30

- **`refinement`** (`integer`, _optional_):
  Refinement level - Higher values may improve quality but take longer Default value: `40`
  - Default: `40`
  - Range: `10` to `200`
  - Examples: 40, 70, 100, 200

- **`creativity`** (`float`, _optional_):
  Creativity level - higher values allow more creative interpretation of the prompt Default value: `16`
  - Default: `16`
  - Range: `1` to `20`
  - Examples: 16, 14, 10

- **`seed`** (`integer`, _optional_):
  Random seed for reproducible results - leave empty for random generation
  - Range: `0` to `2147483647`



**Required Parameters Example**:

```json
{
  "prompt": "Powerful helicopter takeoff: rapidly building rotor blades whirring and chopping, increasing engine whine, ground vibrations."
}
```

**Full Example**:

```json
{
  "prompt": "Powerful helicopter takeoff: rapidly building rotor blades whirring and chopping, increasing engine whine, ground vibrations.",
  "negative_prompt": "Low-pitched hum",
  "duration": 7,
  "refinement": 40,
  "creativity": 16
}
```


### Output Schema

The API returns the following output format:

- **`audio`** (`File`, _required_):
  Generated audio file in WAV format
  - Examples: {"url":"https://v3b.fal.media/files/b/lion/9Uo4MoD-efg4sjcDyI6Nl_sfx_QHCg3z.wav"}

- **`prompt`** (`string`, _required_):
  The processed prompt used for generation

- **`metadata`** (`Metadata`, _required_):
  Generation metadata including duration, sample rate, and parameters



**Example Response**:

```json
{
  "audio": {
    "url": "https://v3b.fal.media/files/b/lion/9Uo4MoD-efg4sjcDyI6Nl_sfx_QHCg3z.wav"
  },
  "prompt": ""
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/beatoven/sound-effect-generation \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "prompt": "Powerful helicopter takeoff: rapidly building rotor blades whirring and chopping, increasing engine whine, ground vibrations."
   }'
```

### 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(
    "beatoven/sound-effect-generation",
    arguments={
        "prompt": "Powerful helicopter takeoff: rapidly building rotor blades whirring and chopping, increasing engine whine, ground vibrations."
    },
    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("beatoven/sound-effect-generation", {
  input: {
    prompt: "Powerful helicopter takeoff: rapidly building rotor blades whirring and chopping, increasing engine whine, ground vibrations."
  },
  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/beatoven/sound-effect-generation)
- [API Documentation](https://fal.ai/models/beatoven/sound-effect-generation/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=beatoven/sound-effect-generation)

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