Skip to content

Release 2.6.0

Choose a tag to compare

@davidliu davidliu released this 10 Feb 16:20
· 130 commits to main since this release

2.6.0 (2025-02-10)

Bug Fixes

  • fix crash on android when reloading javascript (#196) (0f24b42)

Features

  • native audio processing apis and various useTrackVolume hooks (#194) (8c96b92)

What's new

New Volume Hooks and BarVisualizer

  • The useTrackVolume hook returns the volume of an audio track.
let volume = useTrackVolume(audioTrack); // returns a number between 0-1
  • The useMultibandTrackVolume hook returns the volume of an audio track across multiple frequency bands.
let volumes = useMultibandTrackVolume(audioTrack); // returns an array of numbers between 0-1
  • The BarVisualizer component can be used to quickly get a visual representation of an audio track.
<BarVisualizer trackRef={audioTrack}/>

It can also be combined with the useVoiceAssistant hook to automatically transition the appearance based on the agent state:

function SimpleVoiceAssistant() {
  const { state, audioTrack } = useVoiceAssistant();
  return (
   <BarVisualizer
     state={state}
     trackRef={audioTrack}
   />
  );
}

Native APIs for audio processing

New apis are available at the native level for processing the audio:

// iOS
#import "LKAudioProcessingManager.h"
LKAudioProcessingManager *apm = LKAudioProcessingManager.sharedInstance.audioProcessingModule;

// Android
import com.livekit.reactnative.LiveKitReactNative;
AudioProcessingController apc = LiveKitReactNative.audioProcessingController;