未验证 提交 700912a3 编写于 作者: O openharmony_ci 提交者: Gitee

!8484 修改build.gn错误,修改validator音频播放bug

Merge pull request !8484 from 秦莉文/master
......@@ -23,8 +23,8 @@ ohos_js_hap_suite("avplayer_js_hap") {
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAVPlayerTest"
subsystem_name = "ability"
part_name = "ability_runtime"
subsystem_name = "multimedia"
part_name = "multimedia_player_framework"
}
ohos_app_scope("ActsAVPlayerTest_app_profile") {
......
......@@ -11,6 +11,7 @@ class AudioRenderer {
private audioRenderer: audio.AudioRenderer = undefined
private fd: number = undefined
private offset: number = undefined
private length: number = undefined
async createAudioRenderer(){
let audioStreamInfo = {
......@@ -46,6 +47,7 @@ class AudioRenderer {
globalThis.abilityContext.resourceManager.getRawFd("test_44100_2.wav").then(value => {
this.fd = value.fd
this.offset = value.offset
this.length = value.length
Logger.info(this.tag, `getRawFd fd : ${this.fd}, offset: ${value.offset}, length: ${value.length}`)
}).catch(err => {
console.log(`getRawFd fail err: ${err}, message: ${err.message}, code: ${err.code}`);
......@@ -53,8 +55,9 @@ class AudioRenderer {
let bufferSize = await this.audioRenderer.getBufferSize()
Logger.info(this.tag, `audioRenderer bufferSize:` + JSON.stringify(bufferSize))
let stat = await fs.stat(this.fd);
let len = stat.size % bufferSize == 0 ? Math.floor(stat.size / bufferSize) : Math.floor(stat.size / bufferSize + 1);
// let stat = await fs.stat(this.fd);
// let len = stat.size % bufferSize == 0 ? Math.floor(stat.size / bufferSize) : Math.floor(stat.size / bufferSize + 1);
let len = this.length % bufferSize == 0 ? Math.floor(this.length / bufferSize) : Math.floor(this.length / bufferSize + 1);
let buf = new ArrayBuffer(bufferSize);
while (true) {
for (let i = 0;i < len; i++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册