android - React native sound is too slow when loading a sound from url (delay)
问题描述
So i am making a mobile app with react native and i used react-native-sound for playing sounds in the app but i noticed that everytime i load the page that plays the sound it dosent play right away i have to wait for at least 10 seconds to hear it
NOTE: i am taking the sound from my website with a link that has the mp3 file retrieved from a buffer and you know how it goes .. i tried other websites but still the same .
const track = new Sound(
'https://example.com/voice/' + this.props.res._id,
null,
e => {
if (e) {
console.warn('error loading track:', e);
} else {
track.play();
}
},
);
}
so do you have any idea about this delay or how to get rid of it because when i open this link in the phone or pc browser it starts working instantly i just want the same think on the app and thank you..
解决方案
推荐阅读
- java - 我的多线程线性搜索有缺陷吗?
- mysql - 如何在mysql中的两个日期范围内获取每天的每小时数据?
- java - Java ArrayIndexOutOfBoundsException:999
- visual-studio-code - 将 Bootstrap 链接到我的 VS Code 项目
- android-studio - 结构 R.id.name 中的所有字母 R 变为红色
- metrics - Micronaut:如何获取 Prometheus 格式的指标?
- php - php if elseif 循环不能正常工作
- asp.net-mvc - asp.net core web API文件上传和“form-data”多个参数传递给方法
- python - 通过代理 pip 安装包
- google-cloud-platform - Write into different project's datastore and GBQ using GAE