import { Meta, ArgTypes } from '@storybook/blocks'; import { useAudioInputs } from '../'; # useAudioInputs The `useAudioInputs` hook returns a list of the user's available audio input devices and the currently selected audio input device. ## Return Value ```ts { // A list of the user's available audio input devices devices: [{ deviceId: string; label: string; }], // The currently selected audio input device selectedDevice: AudioInputDevice | undefined, } ``` ## Importing ```javascript import { useAudioInputs } from 'amazon-chime-sdk-component-library-react'; ``` ## Usage The hook depends on the `DevicesProvider`. If you are using `MeetingProvider`, it is rendered by default. ```jsx import React from 'react'; import { MeetingProvider, useAudioInputs, } from 'amazon-chime-sdk-component-library-react'; const App = () => ( ); const MyChild = () => { const { devices, selectedDevice } = useAudioInputs(); const items = devices.map((device) => (
  • {device.label}
  • )); return (

    Current Selected Audio Input Device: {JSON.parse(selectedDevice)}

    Devices

    ); }; ``` ## Props