> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cartesia.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Infill Audio

> Create infill audio between two clips.

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    def infill_create(client: Cartesia) -> None:
        """Create infill audio between two clips."""
        from pathlib import Path
        # Can pass file paths directly (as Path objects)
        response = client.tts.infill(
            model_id="sonic-3.5",
            language="en",
            transcript="Infill text",
            left_audio=Path("left.wav"),
            right_audio=Path("right.wav"),
            voice_id="6ccbfb76-1fc6-48f7-b71d-91ac6298247b",
            output_format={"container": "wav", "encoding": "pcm_f32le", "sample_rate": 44100},
        )
        response.write_to_file("infill_output.wav")
        print(f"Saved audio to infill_output.wav")
        print(f"Play with: ffplay -f wav infill_output.wav")
    ```

    From [cartesia-python/examples/examples.py:504](https://github.com/cartesia-ai/cartesia-python/blob/main/examples/examples.py#L504)
  </Tab>

  <Tab title="Python (Async)">
    ```python theme={null}
    async def infill_create_async(client: AsyncCartesia) -> None:
        """Create infill audio between two clips."""
        from pathlib import Path
        response = await client.tts.infill(
            model_id="sonic-3.5",
            language="en",
            transcript="Infill text",
            left_audio=Path("left.wav"),
            right_audio=Path("right.wav"),
            voice_id="6ccbfb76-1fc6-48f7-b71d-91ac6298247b",
            output_format={"container": "raw", "encoding": "pcm_f32le", "sample_rate": 44100},
        )
        await response.write_to_file("infill_output_async.wav")
        print("Saved audio to infill_output_async.wav")
        print("Play with: ffplay -f wav infill_output_async.wav")
    ```

    From [cartesia-python/examples/async\_examples.py:341](https://github.com/cartesia-ai/cartesia-python/blob/main/examples/async_examples.py#L341)
  </Tab>
</Tabs>

## Run this example

<Tabs>
  <Tab title="Python">
    ```sh theme={null}
    cd cartesia-python
    CARTESIA_API_KEY=YOUR_KEY python3 examples/examples.py infill_create
    ```
  </Tab>

  <Tab title="Python (Async)">
    ```sh theme={null}
    cd cartesia-python
    CARTESIA_API_KEY=YOUR_KEY python3 examples/async_examples.py infill_create_async
    ```
  </Tab>
</Tabs>
