0

我正在尝试使用这个 repo中的一个非常简单的 expo 音频播放器,该 播放器可以很好地处理导入为的音频文件

import AudioFile from '../assets/test.m4a';

AudioFile 的 console.log 返回一个数字

console.log(typeof AudioFile);

但是当我尝试使用从录音机收到的文件 uri 时,我得到了文件的 uri,如下所示,播放器无法工作

file:///data/user/0/host.exp.exponent/cache/ExperienceData/%2540madaher%252Fdelivery/Audio/recording-091d5e42-1a82-4e59-8e76-d415ca424c29.m4a

有人可以帮我理解其中的区别吗?

4

1 回答 1

0

我通过改变解决了这个问题 await this.soundObject.loadAsync({ uri: this.props.audio });而不是await this.soundObject.loadAsync(this.props.audio); 希望这可以帮助某人

于 2021-02-13T13:59:45.733 回答