Agora-Flutter-SDK
Agora-Flutter-SDK copied to clipboard
[Question] How do you use `playEffect` with downloaded audio files?
Hi, I ran into an issue while trying to use playEffect with files downloaded to path_provider's temporary directory. Is there a way to make it properly work? If so, where can I find an example?
This is the code I tried to make it work with:
final tempDir = await getTemporaryDirectory();
final soundFile = File('${tempDir.path}/sound-file.mp3');
log('Is absolute ${soundFile.isAbsolute}');
log(soundFile.absolute.path);
log(soundFile.resolveSymbolicLinksSync());
log(soundFile.path);
await AgoraClient.instance.engine.playEffect(
99,
soundFile.path,
0,
1,
1,
100,
false,
);
Hello @CodingAleCR, I think it's supported.
I tried but could not get it to work, in the end I took a different route for this: implemented the audio file processing on web app and play it for everyone in the call.
I think you can make it work easily on agora_rtc_engine: ^6.0.0 by using MediaPlayer, please check https://github.com/AgoraIO-Extensions/Agora-Flutter-SDK/blob/main/example/lib/examples/advanced/media_player/media_player.dart for reference.
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. If you find this problem please file a new issue with the same description, what happens, logs and the output. All system setups can be slightly different so it's always better to open new issues and reference the related ones. Thanks for your contribution.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please raise a new issue.