Function useVolumeLevel

  • Returns the volume level of an audio track at a frequency of once per second.

    Parameters

    Returns number

    Example

    import { useVolumeLevel, useLocalMicrophoneTrack } from "agora-rtc-react";

    function App() {
    const audioTrack = useLocalMicrophoneTrack();
    const volumeLevel = useVolumeLevel(audioTrack);

    return <div>{volumeLevel}</div>;
    }