import { Meta } from '@storybook/blocks';

<Meta title="SDK Hooks/useAttendeeAudioStatus" />

# useAttendeeAudioStatus

The `useAttendeeAudioStatus` hook returns the mute and signal strength state for a given chime attendee ID.

### Return Value

```javascript
{
  // Whether or not the audio is muted
  muted: boolean;

  // Available values are 0 (no signal), 0.5 (weak signal), or 1 (good signal)
  signalStrength: number;
}
```

## Importing

```javascript
import { useAttendeeAudioStatus } from 'amazon-chime-sdk-component-library-react';
```

## Usage

The hook depends on the `AudioVideoProvider`. If you are using `MeetingProvider`, it is rendered by default.

```jsx
import React from 'react';
import {
  MeetingProvider,
  useAttendeeAudioStatus,
} from 'amazon-chime-sdk-component-library-react';

const App = () => (
  <MeetingProvider>
    <MyChild />
  </MeetingProvider>
);

const MyChild = () => {
  const { muted, signalStrength } = useAttendeeAudioStatus(
    'chime-attendee-id-1234'
  );

  return (
    <>
      <p> chime-attendee-id-1234 is {muted ? 'muted' : 'unmuted'} </p>
      <p> signal strength: {signalStrength} </p>
    </>
  );
};
```

### Dependencies

- `AudioVideoProvider`
