从 react-native-audio-recorder-player 中的 base64 字符串播放

Play from base64 string in react-native-audio-recorder-player

我需要通过转换为文件或直接播放来使用 react-native-audio-recorder-player 在 react-native 中播放来自 base64 编码字符串的音频

我使用下面的代码用 RNFS (react-native-fs) 编写新文件,react-native-audio-recorder-player 从路径 uri 播放歌曲。

const path = `${RNFS.DocumentDirectoryPath}/${i}.aac`;
RNFS.writeFile(path, question.file, 'base64').then(() => startPlayer(path))