Valora
API Reference@valora-ai/reactindexFunctions

AudioTrack

function AudioTrack(__namedParameters): Element;

Defined in: packages/react/src/components/track/AudioTrack.tsx:44

The AudioTrack component is responsible for rendering participant audio tracks. This component must have access to the participant's context, or alternatively pass it a Participant as a property.

Parameters

ParameterType
__namedParametersAudioTrackProps

Returns

Element

Example

// Basic — render a participant audio track.
<ParticipantTile>
  <AudioTrack trackRef={trackRef} />
</ParticipantTile>

// Advanced — render subscribed microphone audio for the room.
function RoomAudioTracks() {
  const tracks = useTracks([Track.Source.Microphone], { onlySubscribed: true });
  return (
    <VoiceRoom agent={agent}>
      {tracks.map((trackRef, index) => (
        <AudioTrack key={index} trackRef={trackRef} volume={0.8} />
      ))}
      <RoomAudioRenderer />
    </VoiceRoom>
  );
}

On this page

Valora is local-first

No API key, no server — everything in this doc runs on-device.

Star on GitHub