diff --git a/multimedia/media/media_js_standard/avPlayer/BUILD.gn b/multimedia/media/media_js_standard/avPlayer/BUILD.gn index c74a600ea7238c8e7af7623e81cfdf21555520a9..684981ea87708fc640d5bbb2bb5e6aa2c3cdd46f 100644 --- a/multimedia/media/media_js_standard/avPlayer/BUILD.gn +++ b/multimedia/media/media_js_standard/avPlayer/BUILD.gn @@ -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") { diff --git a/validator/acts_validator/src/main/ets/pages/model/AudioRenderer.ts b/validator/acts_validator/src/main/ets/pages/model/AudioRenderer.ts index 20d868aacbd1809a68790489b3011725f4ee5052..c0a9203889ff9fc7009894ed3e29141b46010430 100644 --- a/validator/acts_validator/src/main/ets/pages/model/AudioRenderer.ts +++ b/validator/acts_validator/src/main/ets/pages/model/AudioRenderer.ts @@ -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++) {