From f2b1e5e123c6700109c7853a60126f0bd23c2cae Mon Sep 17 00:00:00 2001 From: fangqf <1032580279@qq.com> Date: Sat, 21 Jun 2025 11:53:28 +0800 Subject: [PATCH 1/2] add DAudioCallback interface --- .../audioext/v2_0/IDAudioCallback.idl | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/distributed_audio/audioext/v2_0/IDAudioCallback.idl b/distributed_audio/audioext/v2_0/IDAudioCallback.idl index 2b25a533..3a2738c2 100644 --- a/distributed_audio/audioext/v2_0/IDAudioCallback.idl +++ b/distributed_audio/audioext/v2_0/IDAudioCallback.idl @@ -145,4 +145,31 @@ import ohos.hdi.distributed_audio.audioext.v2_0.Types; * @version 2.0 */ RefreshAshmemInfo([in] int streamId, [in] FileDescriptor fd, [in] int ashmemLength, [in] int lengthPerTrans); + + /** + * @brief Get the latency of the distributed audio device. + * + * @param streamId Stream ID for distributed audio devices. + * @param ms Latency in milliseconds. + * + * @return a value of 0 if success, return a negative value if failed. + * + * @since 6.0 + * @version 2.0 + */ + GetLatency([in] int streamId, [out] unsigned int ms); + + /** + * @brief Get the current render position and timestamp of the distributed audio device. + * + * @param streamId Stream ID for distributed audio devices. + * @param frames Current frame number. + * @param time Current timestamp. + * + * @return a value of 0 if success, return a negative value if failed. + * + * @since 6.0 + * @version 2.0 + */ + GetRenderPosition([in] int streamId, [out] unsigned long frames, [out] struct CurrentTime time); } \ No newline at end of file -- Gitee From 5ea0d1952cf75343f97bc55e34be336fcdd2feed Mon Sep 17 00:00:00 2001 From: fangqf <1032580279@qq.com> Date: Sat, 21 Jun 2025 11:53:28 +0800 Subject: [PATCH 2/2] add DAudioCallback interface Signed-off-by: Felfan <1032580279@qq.com> --- .../audioext/v2_0/IDAudioCallback.idl | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/distributed_audio/audioext/v2_0/IDAudioCallback.idl b/distributed_audio/audioext/v2_0/IDAudioCallback.idl index 2b25a533..3a2738c2 100644 --- a/distributed_audio/audioext/v2_0/IDAudioCallback.idl +++ b/distributed_audio/audioext/v2_0/IDAudioCallback.idl @@ -145,4 +145,31 @@ import ohos.hdi.distributed_audio.audioext.v2_0.Types; * @version 2.0 */ RefreshAshmemInfo([in] int streamId, [in] FileDescriptor fd, [in] int ashmemLength, [in] int lengthPerTrans); + + /** + * @brief Get the latency of the distributed audio device. + * + * @param streamId Stream ID for distributed audio devices. + * @param ms Latency in milliseconds. + * + * @return a value of 0 if success, return a negative value if failed. + * + * @since 6.0 + * @version 2.0 + */ + GetLatency([in] int streamId, [out] unsigned int ms); + + /** + * @brief Get the current render position and timestamp of the distributed audio device. + * + * @param streamId Stream ID for distributed audio devices. + * @param frames Current frame number. + * @param time Current timestamp. + * + * @return a value of 0 if success, return a negative value if failed. + * + * @since 6.0 + * @version 2.0 + */ + GetRenderPosition([in] int streamId, [out] unsigned long frames, [out] struct CurrentTime time); } \ No newline at end of file -- Gitee