preloadEffect abstract method
Loads the audio effect file into memory.
To ensure smooth communication, pay attention to the size of the preloaded audio effect file. Supported formats for preloading audio files are listed in What audio formats are supported by the RTC SDK.
soundIdThe ID of the audio effect. Each audio effect has a unique ID.filePathFile path: Android: File path including file name and extension. Supports URL of online files, URI of local files, absolute paths, or paths starting with /assets/. Accessing local files via absolute path may cause permission issues. It is recommended to use URI to access local files. For example, content://com.android.providers.media.documents/document/audio%3A14441. Windows: Absolute path or URL of the audio file, including file name and extension. For example, C:\music\audio.mp4. iOS or macOS: Absolute path or URL of the audio file, including file name and extension. For example, /var/mobile/Containers/Data/audio.mp4.startPosThe start position for loading the audio effect file, in milliseconds.
Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly. See Error Codes for details and resolution suggestions.
Implementation
Future<void> preloadEffect(
{required int soundId, required String filePath, int startPos = 0});