Search

CN-122018845-A - Intercommunication method, system, terminal and storage medium for audio data in An Zhuo Shengtai application

CN122018845ACN 122018845 ACN122018845 ACN 122018845ACN-122018845-A

Abstract

The invention discloses an intercommunication method, a system, a terminal and a storage medium of Audio data in an android Zhuo Shengtai application, wherein the method comprises the steps of constructing a Socket Server on an Audio HAL layer of the android, and waiting for service connection of an Audio bridging system of OpenHarmony; openHarmony builds an Audio bridging system service, and performs data communication with a Socket Server of the android through UnixSocket, and the android Server sends an android communication signaling to OpenHarmony, openHarmony, and reads PCM Audio data on the android according to the android communication signaling. The invention solves the difference between OpenHarmony and android audio frames, realizes that the android application directly uses audio hardware equipment on OpenHarmony, provides a low-delay audio data transmission mechanism, ensures the real-time performance of audio playing, realizes the real-time conversion of audio data formats, ensures the compatibility of the android application and OpenHarmony audio frames, and further realizes the intercommunication of audio data of OpenHamrony and android application.

Inventors

  • ZHONG WENQING

Assignees

  • 深圳开鸿数字产业发展有限公司

Dates

Publication Date
20260512
Application Date
20251211

Claims (10)

  1. 1. The method for communicating the audio data in the application of the An Zhuo Shengtai is characterized by comprising the following steps of: constructing a Socket Server on an android Audio HAL layer, and waiting for service connection of a OpenHarmony Audio bridging system; OpenHarmony, constructing an audio bridging system service, and carrying out data communication with a Socket Server of the android through UnixSocket; And the android server side sends the android communication signaling to OpenHarmony, openHarmony, and the PCM audio data on the android are read according to the android communication signaling.
  2. 2. The method for communicating Audio data in an android ecological application according to claim 1, wherein the constructing a Socket Server on an Audio HAL layer of an android is specifically: A Socket Server is created in the audio_hw.c file in android libhardware.
  3. 3. The method for communicating Audio data in an android ecological application according to claim 1, wherein a Socket Server is constructed on an Audio HAL layer of the android, and further comprising: and constructing a ring queue in the android audio libhardware, wherein the ring queue is used as a buffer area of PCM audio data.
  4. 4. The method for communicating audio data in an android ecological application according to claim 1, wherein OpenHarmony constructs an audio bridging system service, and performs data communication with a Socket Server of an android through UnixSocket, specifically comprising: OpenHarmony constructing an audio bridging system service, configuring a compiling script of the audio bridging system service, and declaring to create UnixSocket file; the audio bridging system service initiates a background process, always detects whether a Socket Server is started, and actively initiates a connection request after detecting that the Socket Server is started; after the request is established, the android server side sends a file descriptor for communication to the audio bridging system service; when the android Server plays the audio data, the PCM audio data is sent to the audio bridging system service through a Socket Server frame by frame according to the designated size, and after the audio bridging system service receives the audio bridging system service, the PCM audio data is read and then is informed to the android Server.
  5. 5. The method for communicating audio data in an android ecological application according to claim 4, wherein when the android Server plays the audio data, PCM audio data is sent to the audio bridging system service through a Socket Server frame by frame according to a specified size, after the audio bridging system service receives the audio bridging system service, the audio bridging system service reads the PCM audio data and notifies the android Server, and then further comprises: After receiving the PCM audio data, the audio bridging system service transmits the PCM audio data to a OpenHarmony media service framework, and audio playing is carried out through the media service framework.
  6. 6. The method for communicating audio data in an android ecological application according to claim 1, wherein the method for communicating audio data in an android ecological application further comprises: when the android service needs to record, a recording request is sent to the audio bridging system service, the audio bridging system service calls microphone equipment of the media service to receive sound after receiving the recording request, and after receiving the recording data, the audio bridging system service sends the recording data to the android service through a Socket Server.
  7. 7. The method for communicating audio data in an android ecological application according to claim 1, wherein the android communication signaling comprises: A readable data block indicating currently readable data block information; a read instruction, namely requesting to read data; a write instruction, which is to request to write data; memory address information, namely informing the other side of which memory is required to be read or written; Data size-data size to be read or written.
  8. 8. An intercommunication system for audio data in an android Zhuo Shengtai application, which is characterized by comprising: The service creation module is used for constructing a Socket Server on the android Audio HAL layer and waiting for OpenHarmony Audio bridging system service connection; The communication connection module is used for constructing an audio bridging system service by OpenHarmony and carrying out data communication with the Socket Server of the android through UnixSocket; And the audio intercommunication module is used for sending the android communication signaling to OpenHarmony, openHarmony by the android server and reading PCM audio data on the android according to the android communication signaling.
  9. 9. A terminal, characterized in that the terminal comprises a memory, a processor and an intercommunication program for audio data in an android ecological application stored on the memory and capable of running on the processor, wherein the intercommunication program for audio data in the android ecological application realizes the steps of the intercommunication method for audio data in the android ecological application according to any one of claims 1-7 when being executed by the processor.
  10. 10. A computer readable storage medium, wherein the computer readable storage medium stores an interworking program of audio data in an android ecological application, which when executed by a processor, implements the steps of the interworking method of audio data in an android ecological application according to any one of claims 1-7.

Description

Intercommunication method, system, terminal and storage medium for audio data in An Zhuo Shengtai application Technical Field The present invention relates to the field of communications technologies, and in particular, to a method, a system, a terminal, and a computer readable storage medium for communicating audio data in a Zhuo Shengtai application. Background OpenHarmony is an open source operating system, hosted by the open atom open source foundation (OpenAtom Foundation), that aims to provide a unified operating system solution for full-field smart devices. At present, openHarmony has made a certain progress in the fields of intelligent home, intelligent wearing, intelligent vehicle-mounted, industrial manufacturing, military aerospace and the like, but the application ecology of OpenHarmony is still in an early development stage. According to OpenHarmony official data, only some Demo applications provided by community edition are difficult to be in ecological alignment with the current android application. OpenHarmony operating systems currently present challenges in terms of application ecology weaknesses, lack of rich third party applications, and developer support shortages, development tools and documents are not yet perfect. User habit dependence-dependence of users on android ecology is difficult to change in a short period. Android (Android) is the global largest mobile operating system, occupying more than 70% of the global smartphone market share. The application ecology is extremely rich, the number of applications in Google Play stores exceeds 300 ten thousand, and the application is applicable to various fields of games, social contact, offices, entertainment and the like. Currently OpenHarmony does not support android applications, the audio framework of OpenHarmony is based on an HDF driving framework, and obvious differences exist between the audio framework and the audio of the android, so that the audio hardware equipment of OpenHarmony cannot be directly used by the android application running on the basis of a Docker service, and the problems that a multimedia playing function cannot sound and the like are caused. Accordingly, the prior art is still in need of improvement and development. Disclosure of Invention The invention mainly aims to provide an intercommunication method, system, terminal and computer readable storage medium of audio data in a Zhuo Shengtai application, and aims to solve the problems that an audio framework of OpenHarmony and audio of android have obvious difference in the prior art, so that the android application running based on a Docker service cannot directly use audio hardware equipment of OpenHarmony, and a multimedia playing function cannot sound. In order to achieve the above purpose, the present invention provides an audio data intercommunication method in an android application Zhuo Shengtai, where the audio data intercommunication method in an android application includes the following steps: constructing a Socket Server on an android Audio HAL layer, and waiting for service connection of a OpenHarmony Audio bridging system; OpenHarmony, constructing an audio bridging system service, and carrying out data communication with a Socket Server of the android through UnixSocket; And the android server side sends the android communication signaling to OpenHarmony, openHarmony, and the PCM audio data on the android are read according to the android communication signaling. Optionally, the method for communicating Audio data in the android ecological application, wherein the constructing a Socket Server on the android Audio HAL layer specifically includes: A Socket Server is created in the audio_hw.c file in android libhardware. Optionally, the method for communicating Audio data in the android ecological application, wherein a Socket Server is constructed on the Audio HAL layer of the android, and then the method further includes: and constructing a ring queue in the android audio libhardware, wherein the ring queue is used as a buffer area of PCM audio data. Optionally, the method for communicating audio data in the android ecological application, wherein OpenHarmony constructs an audio bridging system service, and performs data communication with a Socket Server of the android through UnixSocket, specifically includes: OpenHarmony constructing an audio bridging system service, configuring a compiling script of the audio bridging system service, and declaring to create UnixSocket file; the audio bridging system service initiates a background process, always detects whether a Socket Server is started, and actively initiates a connection request after detecting that the Socket Server is started; after the request is established, the android server side sends a file descriptor for communication to the audio bridging system service; when the android Server plays the audio data, the PCM audio data is sent to the audio bridging system service through a Socke