RTC audio data processing method, device, equipment and storage medium
By receiving and decoding the RTC audio data stream in a single thread and directly playing the target audio data stream, it solves the problem of low audio data processing efficiency under WebRTC technology and achieves more efficient data processing, especially in scenarios where the data timing is stable or insensitive. middle.
Patent Information
- Application Number
- CN202210476470.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-29
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2042-04-29
AI Technical Summary
In the audio data transmission scenario of real-time communication, the client needs to process data streams with non-fixed sampling rates, resulting in low efficiency of multi-threaded serial processing based on WebRTC technology, especially in scenarios where the data timing is stable or insensitive, resulting in Data processing is inefficient.
Receive and decode the RTC audio data stream sent by the server through a single thread, and directly play the target audio data stream, avoiding message queue data transfer between multiple threads and improving data processing efficiency.
It improves the client's data processing efficiency, reduces processor overhead, and significantly improves audio data processing performance in scenarios where data timing is stable or insensitive.
Smart Images

Figure CN114900507B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network technology, and in particular to a method, device, equipment and storage medium for processing RTC audio data. Background Art
[0002] In the audio data transmission scenario of real-time communication (RTC), when the cloud server sends a downstream data stream to the client, due to the unfixed sampling rate of the data in the data stream, the client needs to use multiple threads to serially complete the reception and decoding of audio data based on the Web Real-Time Communication (WebRTC) technology, so that different threads can maintain the timing of the data in the data stream by moving data in the message queue. In some scenarios where the timing of the data in the downstream data stream is stable or the timing of the downstream data stream is insensitive, the data processing of audio data based on the current WebRTC technology will result in low data processing efficiency on the client side. Summary of the invention
[0003] The embodiments of the present application provide a method, apparatus, device and storage medium for processing RTC audio data, in order to improve the data processing efficiency of the client.
[0004] In a first aspect, an embodiment of the present application provides a method for processing RTC audio data, comprising: receiving and decoding an RTC audio data stream sent by a server through a first thread to obtain a target audio data stream; and playing the target audio data stream.
[0005] In a second aspect, an embodiment of the present application provides an RTC audio processing device, comprising: a processing unit, used to receive and decode the RTC audio data stream sent by the server through a first thread to obtain a target audio data stream; and a playback unit, used to play the target audio data stream.
[0006] In a third aspect, an embodiment of the present application provides an electronic device, comprising: at least one processor and a memory; the memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the method provided in the first aspect.
[0007] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the method provided in the first aspect is implemented.
[0008] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the method provided in the first aspect.
[0009] In an embodiment of the present application, the client can receive the RTC audio data stream sent by the server through the first thread, and decode the RTC audio data stream to obtain the final playable target data stream, without the need to process the audio data stream through multiple threads, thereby avoiding the transfer of audio data between different threads through message queues, and improving data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0011] Figure 1 A schematic diagram of a cloud gaming scenario provided by an embodiment of the present application is shown;
[0012] Figure 2 A flowchart of a method for processing RTC audio data provided in an embodiment of the present application;
[0013] Figure 3 A schematic diagram of a first thread provided in an embodiment of the present application;
[0014] Figure 4 A schematic block diagram of a device for processing RTC audio data provided in an embodiment of the present application;
[0015] Figure 5 A schematic structural diagram of an electronic device provided for an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0016] Cloud computing is an Internet-based computing model that allows shared hardware and software resources and information to be provided to various terminals on demand. The network that provides resources is called a "cloud". To users, the resources in the "cloud" are infinitely scalable and can be accessed at any time and used on demand.
[0017] Cloud gaming is a type of cloud application and a gaming method based on cloud computing. In the cloud gaming mode, all games are run on the server (such as the cloud server) and the rendered games are transmitted to the client through the network.
[0018] Figure 1 A schematic diagram of a cloud gaming scene 100 provided in an embodiment of the present application is shown. Figure 1As shown, the cloud service end 110 is used to provide a carrier for remote services. The cloud service end 110 can be a cloud computing resource pool. The cloud service end 110 can be implemented as a server or server cluster in the cloud, for example Figure 1 The server 111 in the cloud virtualizes one or more virtual machines through virtualization technology, for example, there is a virtual machine 111-1 in the server 111. The virtual machine 111-1 in the server 111 provides cloud services (such as cloud gaming services) to cloud service clients through a network 130 (such as Ethernet or 5G).
[0019] See also Figure 1 The client of the cloud service (usually called a thin client) 120 receives the cloud service provided by the cloud service virtual machine 111 - 1 through the network 130 , such as receiving the cloud game mapped by the virtual machine.
[0020] For example, in Figure 1 In the cloud game scene 100 shown, there may be uplink transmission of data and downlink transmission of data between the client 120 and the cloud server 110. During the uplink transmission of data, the user may interact with the client 120 through a game controller or touch operation to input game instructions, audio / video data, etc. The client 120 sends the input game instructions and audio / video data to the cloud server 110, so that the cloud server 110 obtains the data stream input by the user.
[0021] During the downlink transmission of data, the cloud server 110 encodes and encapsulates the audio / video data to be sent, and sends the encapsulated audio / video data to the client 120. The client 120 receives the encapsulated audio / video data sent by the cloud server 110, decapsulates it, and decodes it to obtain audio data and / or video data. Then, the client 120 outputs the audio data and / or video data to play the audio data and / or video data to the user.
[0022] It should be noted that the data in the above-mentioned uplink transmission and downlink transmission process can be a data stream, which can be understood as a group of ordered byte data sequences with a start point and an end point, or a group of ordered data packets.
[0023] The cloud service end 110 and the client end 120 may implement a data stream transmission protocol through a streaming protocol, such as Real-time Transport Protocol (RTP), Real-time Transport Control Protocol (RTCP), Secure Real-time Transport Protocol (SRTP), Secure Real-time Transport Control Protocol (SRTCP) or Real-time Streaming Protocol (RTSP).
[0024] In the downlink transmission of the above-mentioned audio data, the client 120 usually receives the audio data sent by the cloud server 110 based on the WebRTC technology. It should be understood that WebRTC can also be applied to scenarios such as Internet phone, telephone conference, video chat, live broadcast, etc. In these scenarios, the sampling rate of the data in the downlink data stream sent by the cloud server is not fixed. Therefore, based on the WebRTC technology, the client 120 needs to use multiple threads to serially complete the reception, decapsulation, decoding and other operations of audio / video data, so that different threads can maintain the timing of the data in the data stream by moving data in the message queue. For the above-mentioned cloud game scenario, the audio data sent by the cloud server 110 is usually sampled based on a fixed sampling rate. Compared with scenarios such as Internet phone and video chat, the timing of the downlink data stream sent by the cloud server 110 is stable and controllable. Data processing of the downlink data stream based on the existing WebRTC technology will result in low data processing efficiency of the client.
[0025] Furthermore, because WebRTC is also used in scenarios such as Internet phone calls, telephone conferences, video chats, and live broadcasts, the audio data in the downstream data stream sent by the cloud server contains environmental echoes and environmental noise. Therefore, the client needs to perform at least one pre-processing operation of echo cancellation, error correction compensation, resampling, and zero padding on the audio data in the received downstream data stream based on WebRTC technology. In the embodiment of the present application, after the client decapsulates the received audio data, it does not need to undergo any of the above pre-processing operations, but directly decodes the audio data and plays the decoded audio data, which further improves the efficiency of data processing and reduces the overhead of the client processor.
[0026] The embodiments of the present application are only described by taking cloud gaming as an example, but are not limited thereto. For example, the cloud service may also be a cloud desktop service or any cloud application service.
[0027] The present application is applicable to any RTC audio data transmission scenario, and is particularly applicable to scenarios where the data timing in the data stream is stable or the data stream timing is insensitive.
[0028] The client 120 may be implemented as any terminal device with a processor, such as an ordinary computer PC, a mobile phone, a tablet computer (pad), a smart wearable device, a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self driving, a wireless terminal in remote medical surgery, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, a wireless terminal in a smart home, etc.
[0029] Exemplarily, the terminal device implemented by the client 120 may be deployed with a D1 chip based on the fifth-generation reduced instruction set computer (RISC), or RISC-V instruction set. Among them, RISC-V is an open instruction set architecture (ISA) based on the reduced instruction set computing principle. Optionally, the D1 chip integrates a 64-bit single-core CPU, 1GHz main frequency, and supports up to 4K H.265 / H.264 decoding.
[0030] Exemplarily, the client 120 can obtain the cloud game audio / video data stream of the virtual machine based on the streaming technology of the open source WebRTC development kit (Open WebRTC Toolkit, OWT). Among them, OWT is an end-to-end media server software. The OWT software client includes development environments such as JavaScript / Android / iOS / Linux / Windows C++SDK. The OWT software server supports two modes: Selective Forwarding Unit (SFU) and Multipoint Control Unit (MCU), which can realize real-time audio and video analysis functions and have good low-latency performance in cloud game scenarios.
[0031] Exemplarily, the client 120 can play the audio / video data stream through a playback device deployed by itself. Alternatively, the client 120 can be connected to an external device, such as a display via a High Definition Multimedia Interface (HDMI), and push the audio / video data stream to the display for display.
[0032] In response to the problem of low client data processing efficiency, the embodiment of the present application considers receiving, decoding and other processing of the data stream through a thread (such as the first thread below) to improve the client data processing efficiency.
[0033] It should be noted that a thread is the basic unit of independent scheduling and dispatching, and is the smallest unit that the operating system can run and schedule. It is included in the process and is the actual operating unit in the process. A thread refers to a single sequential control flow in a process.
[0034] The following is a detailed description of the RTC audio data processing method provided in the embodiment of the present application in conjunction with the accompanying drawings.
[0035] It should be understood that the following is only for the convenience of understanding and explanation, and the method provided in the embodiment of the present application is described in detail by taking the client as the execution subject. Figure 1 The client 120 in the embodiment of the present invention, or a component in the client 120, such as a chip or a chip system. The server mentioned below may be Figure 1 The cloud server 110, or a component in the cloud server 110, such as a chip or a chip system.
[0036] Figure 2 A flowchart of a method for processing RTC audio data provided by an embodiment of the present application. Figure 2 As shown, the method includes:
[0037] S210, receiving and decoding the RTC audio data stream sent by the server through the first thread to obtain a target audio data stream;
[0038] S220, play the target audio data stream.
[0039] RTC audio data stream can be understood as an audio data stream transmitted in the RTC scenario. In the above S210, the client can receive the RTC audio data stream sent by the server through the first thread, and decode the RTC audio data stream to obtain the final playable target data stream, without the need to process the audio data stream through multiple threads, avoiding the transfer of audio data between different threads through message queues, and improving data processing efficiency.
[0040] In the above S220, the client can play the target audio data stream through its own deployed playback device, such as a speaker; or the client can play the target audio data stream through an external device connected to it, such as a speaker, or a display with a speaker, a mobile phone or other terminal device.
[0041] Optionally, the client can play the target audio data stream through the first thread or a second thread different from the first thread. The difference is that playing the target audio data stream through the first thread can further improve the efficiency of client data processing, and playing the target audio data stream through the second thread can realize asynchronous message transmission between threads based on the message queue, so that the second thread reads the audio data put into the message queue by the first thread from the message queue, avoiding the first thread sending an exception during the data processing process and affecting the playback effect of the target audio data stream.
[0042] In some embodiments, the RTC audio data stream may include multiple audio data packets, and the audio data packets include audio encoding data. In the case where the audio data stream includes multiple audio data packets, the client can perform audio decoding on each audio data packet through the first thread to obtain audio decoding data corresponding to each audio data packet, and the audio decoding data corresponding to each audio data packet can constitute the above-mentioned target audio data stream.
[0043] Continuing with the above embodiment, the client can play each audio decoded data in the target audio data stream to play the target audio data. For example, the client can play each audio decoded data in the target audio data stream through the first thread.
[0044] For example, the server encodes the real-time sampled audio data to obtain audio encoding data, and encapsulates the audio encoding data to obtain an audio data packet. Sampling, encoding and encapsulating in different sampling time periods can obtain multiple audio data packets with a time sequence relationship to form the aforementioned RTC audio data stream.
[0045] The audio data packet may be an audio data packet encapsulated based on a streaming protocol, such as the aforementioned RTP, SRTP, etc. An audio data packet encapsulated based on RTP may be referred to as an RTP data packet, and an audio data packet encapsulated based on SRTP may be referred to as an SRTP data packet.
[0046] Assuming that the audio data packet in the audio data stream is the above-mentioned RTP data packet, after receiving the RTP data packet through the first thread, the client can decapsulate the RTP data packet based on RTP to obtain the audio encoding data in the RTP data packet, and then decode the audio encoding data in the RTP data packet through the first thread to obtain audio decoding data. Further, the client plays the audio decoding data through the first thread.
[0047] Assuming that the audio data packet in the audio data stream is the above SRTP data packet, combined with Figure 3 As shown, after receiving the SRTP data packet through the first thread, the client can decrypt the SRTP data packet based on SRTP to obtain the RTP data packet. It can be understood that the decryption of the SRTP data packet by the client can also be described as the decapsulation of the SRTP by the first thread. The two can be used interchangeably and have the same meaning. Further, the client decapsulates the RTP data packet based on RTP through the first thread to obtain the audio encoding data in the RTP data packet, and then decodes the audio encoding data to obtain the audio decoding data. Further, the client plays the audio decoding data through the first thread.
[0048] Of course, this application only takes the example of an audio data stream including multiple audio data packets for illustration, but it should not be understood as constituting any limitation on this application. For example, the audio data stream may include multiple encoded audio coded data, which are sent from the server to the client without encapsulation. In this case, the client decodes the received audio coded data through the first thread to obtain audio decoded data, and then plays the audio decoded data through the first thread.
[0049] In some scenarios, the audio data sent by the server is usually sampled based on a fixed sampling rate. When the server samples the audio data based on a fixed sampling rate, multiple audio data packets in the RTC audio data stream all include audio encoding data of the same duration. In this case, the server can send an audio data packet to the client according to the preset duration, and the client can receive the audio data packet sent by the server in each receiving cycle. Generally speaking, the receiving cycle is the same as the preset duration. For example, the server encodes the sampled audio data and encapsulates it every 20ms preset duration to obtain an RTP data packet, which includes 20ms of audio encoding data. The server sends the encapsulated RTP data packet to the client after each encapsulation, that is, the server sends an RTP data packet to the client every 20ms, and accordingly, the client receives an RTP data packet every 20ms through the first thread.
[0050] When multiple audio data packets in the audio data stream of the client sent by the server all include audio encoding data of the same preset duration, the timing of the audio data stream is stable and controllable. In this case, the multiple audio data packets of the audio data stream received by the client through the first thread have a stable timing relationship, and then the client can maintain the timing relationship of the multiple audio data packets in the audio data stream without the need for a message queue, so that the client can continue to decrypt, decapsulate, decode, and other operations on the multiple audio data packets.
[0051] In the above embodiment, the client performs decapsulation and decoding operations on multiple audio data packets in the audio data stream respectively through the first thread. In other embodiments, the client can merge the audio coding data in some audio data packets in the multiple audio data packets in the audio data stream through the first thread, and decode the merged audio coding data through the first thread. For example, some audio data packets in the multiple audio data packets are decapsulated through the first thread to obtain audio coding data belonging to the same frame, the audio coding data belonging to the same frame are merged, and then the merged audio coding data of the frame is decoded through the first thread.
[0052] Therefore, the embodiment of the present application receives and decodes the RTC audio data stream sent by the server through the first thread to obtain the target audio data stream, and then plays the target audio data stream, thereby avoiding the problem of low data processing efficiency caused by data processing of the RTC audio data stream through multiple threads to obtain the required audio data stream to be played.
[0053] In the various embodiments of the present application, unless otherwise specified or logically conflicting, the attributes and / or descriptions of the various embodiments are consistent and may be referenced to each other, and the technical features in different embodiments may be combined to form new embodiments according to their inherent logical relationships.
[0054] It should be noted that the descriptions such as “first” and “second” in this article are used to distinguish different threads, etc., and do not represent the order of precedence, nor do they limit “first” and “second” to different types.
[0055] Figure 4 A schematic block diagram of a device for processing RTC audio data provided by an embodiment of the present application. Figure 4 As shown, the RTC audio data processing device 400 may include a processing unit 410 and a playing unit 420 .
[0056] Optionally, the RTC audio data processing device 400 may correspond to the client in the above method embodiment, for example, may be an implementation of the aforementioned client, or a component configured in the client (such as a chip or a chip system, etc.).
[0057] The processing unit 410 may be used to receive and decode the RTC audio data stream sent by the server through the first thread to obtain a target audio data stream; and the playing unit 420 may be used to play the target audio data stream.
[0058] In some embodiments, the RTC audio data stream includes multiple audio data packets, which include audio encoding data. The processing unit 410 is specifically used to: for each audio data packet in the multiple audio data packets, through the first thread, perform audio decoding on the audio encoding data in the audio data packet to obtain audio decoding data corresponding to the audio data packet; the audio decoding data corresponding to the multiple audio data packets respectively constitute the target audio data stream.
[0059] In some embodiments, the playback unit 420 is specifically configured to: play each audio decoding data in the target audio data stream through the first thread.
[0060] In some embodiments, each audio data packet in the RTC audio data stream includes audio encoding data of a preset duration; the processing unit 410 is specifically used to: receive, through the first thread, one of the multiple audio data packets sent by the server in each receiving cycle, and the receiving cycle is equal to the preset duration.
[0061] In some embodiments, each audio data packet in the RTC audio data stream is an encrypted data packet. Before the RTC audio data stream is audio decoded through the first thread to obtain the target audio data stream, the processing unit 410 is also used to: decrypt the multiple ordered audio data packets through the first thread.
[0062] In some embodiments, the processing unit 410 is specifically used to: decapsulate the audio data packet through the first thread to obtain the audio encoding data in the audio data packet; decode the audio encoding data through the first thread to obtain the audio decoding data corresponding to the audio data packet.
[0063] In some embodiments, the audio data packet is a data packet encapsulated based on the real-time transport protocol RTP, or the audio data packet is a data packet encapsulated based on the secure real-time transport protocol SRTP.
[0064] The division of the units in the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated.
[0065] It should be understood that the specific process of each unit executing the above corresponding steps has been described in detail in the above method embodiment, and for the sake of brevity, it will not be repeated here.
[0066] Figure 5 The following is a schematic diagram of the structure of an electronic device provided by an exemplary embodiment of the present application. The electronic device can be implemented as the client in the above method embodiment. Figure 5As shown, the electronic device 500 includes: a processor 510 and a transceiver 520. Optionally, the electronic device 500 also includes a memory 530. The processor 510, the transceiver 520 and the memory 530 can communicate with each other through an internal connection path to transmit control and / or data signals. The memory 530 is used to store a computer program, and the processor 510 is used to call and run the computer program from the memory 530 to control the transceiver 520 to send and receive signals. Optionally, the electronic device 500 may also include an antenna 540, which is used to send the uplink data or uplink control signaling output by the transceiver 520 through a wireless signal.
[0067] The processor 510 and the memory 530 may be combined into a processing device, and the processor 510 is used to execute the program code stored in the memory 530 to implement the above functions. In specific implementation, the memory 530 may also be integrated into the processor 510, or independent of the processor 510.
[0068] The transceiver 520 may include a receiver (or receiver, receiving circuit) and a transmitter (or transmitter, transmitting circuit). The receiver is used to receive signals, and the transmitter is used to transmit signals.
[0069] Optionally, the electronic device 500 may further include a power supply 550 for providing power to various devices or circuits in the electronic device 500 .
[0070] In addition, in order to make the functions of the terminal device more complete, the electronic device 500 may also include one or more of an input unit 560, a display unit 570, an audio circuit 580, a camera 590 and a sensor 600, and the audio circuit may also include a speaker 580a, a microphone 580b, etc.
[0071] It should be understood that Figure 5 The electronic device 500 shown can implement various processes involving the first terminal or the second terminal in the above method embodiment. The operations and / or functions of each module in the electronic device 500 are respectively to implement the corresponding processes in the above method embodiment. For details, please refer to the description in the above method embodiment. To avoid repetition, the detailed description is appropriately omitted here.
[0072] The present application also provides a processing device, comprising at least one processor, wherein the at least one processor is used to execute a computer program stored in a memory, so that the processing device executes the method executed by the client in the above method embodiment.
[0073] The embodiment of the present application also provides a processing device, including a processor and an input / output interface. The input / output interface is coupled to the processor. The input / output interface is used to input and / or output information. The information includes at least one of an instruction and data. The processor is used to execute a computer program so that the processing device executes the method executed by the client in the above method embodiment.
[0074] The present application also provides a processing device, including a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the processing device executes the method executed by the client in the above method embodiment.
[0075] It should be understood that the above-mentioned processing device can be one or more chips. For example, the processing device can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a processor (central processor unit, CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.
[0076] In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software. The steps of the method disclosed in conjunction with the embodiment of the present application can be directly embodied as a hardware processor for execution, or a combination of hardware and software modules in a processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in conjunction with its hardware. To avoid repetition, it is not described in detail here.
[0077] It should be noted that the processor in the embodiment of the present application can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method embodiment can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or the hardware and software modules in the decoding processor can be combined and performed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0078] It can be understood that the memory in the embodiments of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0079] According to the method provided in the embodiment of the present application, the present application also provides a computer program product, which includes: computer program code, when the computer program code is run on a computer, the computer executes the method executed by the client in the above method embodiment.
[0080] According to the method provided in the embodiment of the present application, the present application also provides a computer-readable storage medium, which stores a program code. When the program code runs on a computer, the computer executes the method executed by the client in the above method embodiment.
[0081] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for processing real-time communication (RTC) audio data, the method being applied to a scenario where the timing of the RTC audio data is stable, characterized in that: include: Receiving and decoding the RTC audio data stream sent by the server to obtain the target audio data stream through the first thread, wherein the audio data in the RTC audio data stream is obtained by sampling based on a fixed sampling rate; each audio data packet in the RTC audio data stream includes audio encoding data of a preset duration; Play each audio decoded data in the target audio data stream through the first thread; The receiving, through the first thread, the RTC audio data stream sent by the server includes: Through the first thread, one of the multiple audio data packets sent by the server is received in each receiving cycle, and the receiving cycle is equal to the preset duration.
2. The method according to claim 1, characterized in that: The RTC audio data stream includes a plurality of audio data packets, and the audio data packets include audio encoding data. The decoding of the RTC audio data stream to obtain a target audio data stream through the first thread includes: For each audio data packet in the multiple audio data packets, audio decoding is performed on the audio encoded data in the audio data packet through the first thread to obtain audio decoded data corresponding to the audio data packet; The audio decoded data corresponding to the multiple audio data packets respectively constitute the target audio data stream.
3. The method according to claim 1, characterized in that Each audio data packet in the RTC audio data stream is an encrypted data packet. Before the audio decoding of the RTC audio data stream is performed through the first thread to obtain the target audio data stream, the method further includes: Through the first thread, a plurality of ordered audio data packets are decrypted.
4. The method according to claim 1, characterized in that: The step of performing audio decoding on the audio encoding data in the audio data packet through the first thread to obtain audio decoding data corresponding to the audio data packet includes: Decapsulating the audio data packet through the first thread to obtain audio encoding data in the audio data packet; The audio encoding data is decoded through the first thread to obtain audio decoding data corresponding to the audio data packet.
5. The method according to claim 1, characterized in that The audio data packet is a data packet encapsulated based on the real-time transport protocol RTP, or the audio data packet is a data packet encapsulated based on the secure real-time transport protocol SRTP.
6. An RTC audio processing device, the device is applied to a scenario where the timing of RTC audio data is stable, characterized in that: include: The processing unit is used to receive and decode the RTC audio data stream sent by the server through the first thread to obtain a target audio data stream, wherein the audio data in the RTC audio data stream is obtained by sampling based on a fixed sampling rate; A playing unit, configured to play each audio decoded data in the target audio data stream through the first thread; each audio data packet in the RTC audio data stream includes audio encoded data of a preset duration; The processing unit is specifically used for: Through the first thread, one of the multiple audio data packets sent by the server is received in each receiving cycle, and the receiving cycle is equal to the preset duration.
7. An electronic device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the method according to any one of claims 1 to 5 is implemented.
