# dspBufferSize

> The length of the DSP buffer in samples determining the latency of sounds by the audio output device.

## Definition

* **Type:** Field
* **Namespace:** [UnityEngine](/engine/6000.6/script-reference/unityengine.md)
* **Assembly:** UnityEngine.AudioModule

```csharp
public int dspBufferSize
```

### Remarks

This buffer size only accounts for the size of a single DSP buffer. It doesn't include additional latency caused by multiple DSP buffers or buffers from your platform's audio system.

You can use dspBufferSize or [AudioSettings.GetDSPBufferSize](/engine/6000.6/script-reference/unityengine/audiosettings/getdspbuffersize.md) to get the DSP buffer size but it's recommended you use dspBufferSize. For a code example that shows each of the DSP buffer sizes, refer to [AudioSettings.Reset](/engine/6000.6/script-reference/unityengine/audiosettings/reset.md).

### Examples

```csharp
// This script changes the settings of the audio configuration programatically. 
// Attach this script to a GameObject in your Scene. Also assign an <see cref="UnityEngine.AudioSource"></see> component in the Inspector and 
// assign an audio clip to the AudioSource. 

using UnityEngine;

public class AudioConfigurationExample : MonoBehaviour
{
    void Start()
    {
        AudioSource source = GetComponent<AudioSource>();

        AudioConfiguration config = AudioSettings.GetConfiguration();

        // Change each configuration to your preferred setting. 
        config.speakerMode = AudioSpeakerMode.Stereo;
        config.dspBufferSize = 64;

        AudioSettings.Reset(config);
        // Play the audio. 
        source.Play();
    }
}
```
