setAudioProcessingOptions method

Future<void> setAudioProcessingOptions(
  1. AudioProcessingOptions options
)

Applies runtime audio processing options to this local audio track.

On success, updates currentOptions and emits LocalTrackOptionsUpdatedEvent. When the native layer cannot apply the options, throws track_options.AudioProcessingException and leaves currentOptions unchanged.

Implementation

Future<void> setAudioProcessingOptions(track_options.AudioProcessingOptions options) async {
  final nextOptions = currentOptions.copyWith(processing: options);
  final response = await Native.setAudioProcessingOptions(
    mediaStreamTrack.id!,
    options.toMap(),
  );

  _throwIfAudioProcessingFailed(response);

  currentOptions = nextOptions;
  events.emit(LocalTrackOptionsUpdatedEvent(
    track: this,
    options: currentOptions,
  ));
}