RTCAudioEffectPlayer class abstract
Audio effect player.
Valid since v3.56.1
Call RTCAudioEffectPlayer.setEventHandler to set the callback handler to receive related callbacks.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getDuration(
int effectId) → Future< int?> - Gets the duration of the audio effect file.
-
getPosition(
int effectId) → Future< int?> - Gets the current position of audio effect file playback.
-
getVolume(
int effectId) → Future< int?> - Gets the current volume.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pause(
int effectId) → Future< int?> - Pauses the playback of audio effect files.
-
pauseAll(
) → Future< int?> - Pauses the Playback of all audio effect files.
-
preload(
int effectId, {required String filePath}) → Future< int?> - Preloads specified music files into memory to avoid repeated loading when playing the same file frequently and reduce CPU usage.
-
resume(
int effectId) → Future< int?> - Resumes the playback of audio effect files.
-
resumeAll(
) → Future< int?> - Resumes the playback of all audio effect files.
-
setEventHandler(
RTCAudioEffectPlayerEventHandler? handler) → void - Sets the event handler.
-
setPosition(
int effectId, {required int position}) → Future< int?> - Sets the start position of the audio effect file.
-
setVolume(
int effectId, {required int volume}) → Future< int?> - Adjusts the volume level of a specified audio effect.
-
setVolumeAll(
int volume) → Future< int?> - Sets the volume of all audio effect, including audio effect files and PCM effects.
-
start(
int effectId, {required String filePath, AudioEffectPlayerConfig config = const AudioEffectPlayerConfig()}) → Future< int?> -
Starts to play the audio effect file.
This API can be called multiple times with different IDs and file paths for multiple effects at the same time. -
stop(
int effectId) → Future< int?> - Stops the playback of audio effect files.
-
stopAll(
) → Future< int?> - Stops playback of all audio effect files.
-
toString(
) → String -
A string representation of this object.
inherited
-
unload(
int effectId) → Future< int?> - Unloads the specified audio effect file.
-
unloadAll(
) → Future< int?> - Unloads all audio effect files. Return value:
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited