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

# useAudioLevelObserver

> The useAudioLevelObserver provides a way to get the local participant's audio levels.

`useAudioLevelObserver(params) : void`

The `onVolumeChange` callback runs when the observed participant's audio level changes, letting you respond to volume changes — for example, to drive a visual indicator.

## Parameters

<ParamField body="sessionId" type="string" required>
  The participant's `sessionId` for which audio level should be observed.
</ParamField>

<ParamField body="onVolumeChange" type="Function" required>
  A callback reference to run when the track's volume level changes.
</ParamField>

<ParamField body="onError" type="Function">
  A callback reference to run when local audio level observer is not available in the current browser.
</ParamField>

<ParamField body="interval" type="number" default="200">
  The interval in milliseconds at which the volume level is checked (minimum: 100).
</ParamField>

## Example

```jsx theme={null}
import {
  useAudioLevelObserver,
  useLocalSessionId,
} from '@daily-co/daily-react';
import { useCallback, useRef } from 'react';

export const MicVolumeVisualizer = () => {
  const localSessionId = useLocalSessionId();

  const volRef = useRef(null);

  useAudioLevelObserver(
    localSessionId,
    useCallback((volume) => {
      // this volume number will be between 0 and 1
      // give it a minimum scale of 0.15 to not completely disappear 👻
      volRef.current.style.transform = `scale(${Math.max(0.15, volume)})`;
    }, [])
  );

  // Your audio track's audio volume visualized in a small circle,
  // whose size changes depending on the volume level
  return (
    <div>
      <div className="vol" ref={volRef} />
      <style jsx>{`
        .vol {
          border: 1px solid black;
          border-radius: 100%;
          height: 32px;
          transition: transform 0.1s ease;
          width: 32px;
        }
      `}</style>
    </div>
  );
};
```

## See also

<CardGroup>
  <Card title="Components" icon="layout" iconType="solid">
    * [DailyAudioTrack](/reference/daily-react/daily-audio-track)
    * [DailyAudio](/reference/daily-react/daily-audio)
  </Card>

  <Card title="Hooks" icon="code" iconType="solid">
    * [useMediaTrack()](/reference/daily-react/use-media-track)
    * [useAudioLevel()](/reference/daily-react/use-audio-level) (deprecated replacement)
  </Card>
</CardGroup>
