Live broadcast audio transmission method and device, equipment, storage medium and product
By detecting the audio buffer length, room activity, and network conditions in the live broadcast room to determine the conditions for enabling the timer, and starting the preset timer to send the buffered audio packets, the problem of long waiting time for viewers entering the live broadcast room for the first time is solved, and fast playback and optimized live audio transmission are achieved.
Patent Information
- Application Number
- CN202511095613.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-06
- Publication Date
- 2025-11-18
AI Technical Summary
Existing live audio transmission solutions require viewers to wait a considerable amount of time before receiving audio packets when they first enter the live stream, resulting in poor live audio transmission quality.
When a target user enters the live stream room for the first time, the system determines whether the timer activation conditions are met based on the audio buffer length of the live stream room, the room's audio activity level, and the target user's historical network status. If the conditions are met, a preset timer is started, and a buffered audio packet is sent to the target user based on the preset timer to achieve fast playback of live stream audio.
It reduces the time users have to wait for audio to play when they first enter the live stream, achieves instant audio playback, and optimizes the audio transmission effect.
Smart Images

Figure CN120980256A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of computer technology, and particularly relate to a live audio transmission method and device, equipment, storage medium and product. BACKGROUND
[0002] With the rapid development of the live industry, audio experience has gradually become one of the important factors for users to evaluate the quality of a live product. Especially when a user first enters a live room, whether the audio can be opened immediately becomes a key to retention.
[0003] Current live audio transmission usually relies on the anchor to send audio packets at fixed time intervals, and the server forwards or caches and distributes. The server will trigger the logic of issuing audio packets to the audience only when it receives the audio packets uploaded by the anchor. However, when the audience first enters the live room, the server needs to wait for the anchor to successfully upload the audio packets before triggering the logic of issuing audio packets to the audience, resulting in that the audience who first enters the live room needs to wait for a long time to receive the audio packets, and the live audio transmission effect is poor. SUMMARY
[0004] Embodiments of the present application provide a live audio transmission method, device, equipment, storage medium and product. When it is detected that a target user first enters a live room, whether a timer enabling condition is met is determined according to the audio cache length and room audio activity of the live room, and the historical network condition of the target user, and a preset timer is started when the timer enabling condition is met. The cached audio packets are sent to the target user based on the preset timer, so that the target user can play live audio according to the cached audio packets. The cached audio packets are sent to the target user in a timely manner according to the preset timer instead of waiting for the anchor to upload the audio packets before sending the cached audio packets to the target user. The target user can quickly receive the cached audio packets and play the sound, reducing the length of time for the user to wait for sound playing when first entering the live room, realizing the instant playing effect of live audio, optimizing the live audio transmission effect, and effectively solving the technical problem that the audience needs to wait for a long time to receive the audio packets when first entering the live room, and the live audio transmission effect is poor.
[0005] In a first aspect, embodiments of the present application provide a live audio transmission method, comprising: In the case of detecting that a target user first enters a live room, determining the audio cache length and room audio activity of the live room, and the historical network condition of the target user; Determining whether a timer enabling condition is met according to the audio cache length, the room audio activity and the historical network condition; Starting a preset timer in the case of meeting the timer enabling condition; The information acquisition module is configured to determine an audio cache length and a room audio activity of the live room and a historical network condition of the target user when it is detected that the target user enters the live room for the first time.
[0006] In a second aspect, the embodiments of the present application provide a live audio transmission device, comprising an information acquisition module, an enabling judgment module, a timing enabling module and an audio sending module, wherein: The information acquisition module is configured to determine an audio cache length and a room audio activity of the live room and a historical network condition of the target user when it is detected that the target user enters the live room for the first time. The enabling judgment module is configured to determine whether a timer enabling condition is met according to the audio cache length, the room audio activity and the historical network condition. The timing enabling module is configured to start a preset timer when the timer enabling condition is met. The audio sending module is configured to send a cache audio packet to the target user based on the preset timer, so that the target user plays live audio according to the cache audio packet.
[0007] In a third aspect, the embodiments of the present application provide a live audio transmission device, comprising a memory and one or more processors. The memory is configured to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the live audio transmission method of the first aspect.
[0008] In a fourth aspect, the embodiments of the present application provide a non-volatile storage medium storing computer executable instructions, which are used to execute the live audio transmission method of the first aspect when executed by a computer processor.
[0009] In a fifth aspect, the embodiments of the present application provide a computer program product, which comprises a computer program stored in a computer readable storage medium, and at least one processor of a device reads and executes the computer program from the computer readable storage medium, so that the device executes the live audio transmission method of the first aspect.
[0010] The embodiment of the application determines whether the timer enabling condition is met according to the audio cache length and the room audio activity of the live broadcast room and the historical network condition of the target user when it is detected that the target user enters the live broadcast room for the first time, and starts a preset timer when the timer enabling condition is met, and sends the cache audio packet to the target user based on the preset timer, so that the target user plays the live broadcast audio according to the cache audio packet. The target user can quickly receive the cache audio packet and play the sound, reduce the time length of waiting for the sound to be played when the user enters the live broadcast room for the first time, realize the second play effect of the live broadcast audio, and optimize the live broadcast audio transmission effect. BRIEF DESCRIPTION OF DRAWINGS
[0011] Figure 1 is a flowchart of a live broadcast audio transmission method provided by the embodiment of the application; Figure 2 is a flowchart of another live broadcast audio transmission method provided by the embodiment of the application; Figure 3 is a structural schematic diagram of a live broadcast audio transmission device provided by the embodiment of the application; Figure 4 is a structural schematic diagram of a live broadcast audio transmission device provided by the embodiment of the application. DETAILED DESCRIPTION
[0012] In order to make the objects, technical solutions and advantages of the application clearer, the specific embodiments of the application will be further described in detail below with reference to the drawings. It can be understood that the specific embodiments described herein are only used to explain the application, but not to limit the application. In addition, it should be noted that, for the convenience of description, only parts related to the application are shown in the drawings, but not all contents. Before discussing the example embodiments in more detail, it should be mentioned that some example embodiments are described as processes or methods depicted by flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged. The above processes can be terminated when the operations are completed, but can also have additional steps not included in the drawings. The above processes can correspond to methods, functions, procedures, subroutines, subprograms, etc.
[0013] The live audio transmission method provided by the application can be applied to audio transmission in an audio and video live scene (for example, a speech chat room, a multi-player battle, a real-time communication (RTC) conference, etc.), and aims to send a buffered audio packet to a target user in time according to a preset timer when the target user enters a live room for the first time, reduce the time length of waiting for sound playing when the target user enters the live room for the first time, realize a second-by-second playing effect of live audio, and optimize the live audio transmission effect.
[0014] The existing live audio transmission generally relies on a passive triggering strategy, that is, the server starts to forward or push a buffered audio only after a user who is on a microphone sends an audio packet in the next round. In a poor network environment or a multi-server deployment scene, the existing live audio transmission scheme often has a large delay in audio second opening, a high audio lag rate, and even no audio. Although the use of a content delivery network (CDN) to transmit data can alleviate the pressure on some servers, the triggering mechanism of the CDN depends on an audio packet, and there is a long delay link in the transmission process, which makes it difficult to ensure the real-time data transmission. The existing live audio transmission scheme generally adopts a static strategy, such as transmitting an audio packet in a fixed time window, a fixed buffer, and a fixed code rate. In particular, in the scene where a user enters a room for the first time, a host is not active, data is not synchronized, and the like, when a viewer enters a live room for the first time and there is no local buffered audio data, the viewer needs to wait for the next round of packet sending of the user who is on a microphone, the data transmission lacks initiative, it is difficult to realize second-by-second playing of live audio, and the live audio transmission effect is poor. Based on this, the embodiment of the application provides a live audio transmission method to solve the technical problem that a viewer needs to wait for a long time to receive an audio packet when the viewer enters a live room for the first time, and the live audio transmission effect is poor.
[0015] Figure 1 A flowchart of the live audio transmission method provided by the embodiment of the application is given, and the live audio transmission method provided by the embodiment of the application can be executed by a live audio transmission device. The live audio transmission device can be realized by hardware and / or software, and integrated in a live audio transmission equipment (for example, a server).
[0016] The following describes the live audio transmission method executed by the live audio transmission device. Referring to Figure 1 , the live audio transmission method comprises the following steps. S110: In a case where it is detected that a target user enters a live room for the first time, determining an audio buffer length of the live room and a room audio activity, and a historical network condition of the target user.
[0017] The target user provided in the application can be a viewer entering a live room. There can be one or more users in the live room. The user can be a host in the live room, or another host connected to the host, or another viewer in the live room. When each viewer enters the live room, it can be determined whether a preset timer needs to be enabled for the viewer based on the live audio transmission method provided in the application, and the cached audio packet is sent to the user based on the preset timer. Alternatively, the live audio transmission device provided in the application can be a server where the host of the live room is located, or a server where the user (another host or viewer) is located.
[0018] Exemplarily, when it is detected that the target user enters the live room, it can be determined whether the target user is entering the live room for the first time. Wherein, the target user entering the live room for the first time can be that the target user enters the live room for the first time after the host starts the live room, or that the target user enters the live room again after a preset time length after the target user exits the live room (during which the live audio transmission device still records the information of the target user and does not delete it, for example, the preset time length is 0.2s). If the target user exits the live room and quickly (within a preset time length) enters the live room again, it is considered that the target user is not entering the live room for the first time.
[0019] In one embodiment, when it is detected that the target user enters the live room for the first time, the audio cache length of the live room, the room audio activity, and the historical network condition of the target user are determined. Wherein, the live audio transmission device caches the cached audio packets uploaded by the user in the live room. The user uploads the audio packets to the live audio transmission device at a fixed time interval. After receiving the audio packets uploaded by the user, the live audio transmission device triggers the audio packet delivery logic to send the received audio packets or cached audio packets to the users who have entered the room.
[0020] The audio cache length can be understood as the audio duration corresponding to the cached audio packets in the live audio transmission device. The room audio activity can be determined according to the packet sending frequency of the audio packets and / or the number of users in the live room. Wherein, since the target user has not collected the real-time network status of the target user when entering the live room for the first time, the network status can be evaluated through the historical network condition of the target user. The network status can be determined by one or more combinations of round trip time (RTT), packet loss rate and jitter of the target user when transmitting data.
[0021] S120: Determine whether the timer enabling condition is met according to the audio cache length, the room audio activity, and the historical network condition.
[0022] Exemplarily, according to the audio cache length, the room audio activity and the historical network condition determined above, it is determined whether the target user meets the timer enabling condition. In one embodiment, when the timer enabling condition is not met, a preset timer is not created for the target user, but the target user is waited for to send the audio package after the microphone user uploads a new audio package.
[0023] S130: When the timer enabling condition is met, a preset timer is started.
[0024] S140: The cached audio package is sent to the target user based on the preset timer, so that the target user plays the live audio according to the cached audio package.
[0025] In one embodiment, when the target user meets the timer enabling condition, a preset timer can be created and started for the target user, and the cached audio package is sent to the target user based on the preset timer. After receiving the cached audio package, the target user can play the corresponding live audio according to the cached audio package.
[0026] For example, the preset timer is timed based on a set timing period, and the cached audio package is sent to the target user when the preset timer is timed for each time length to reach the timing period. Alternatively, after starting the preset timer, a preset number of cached audio packages can be sent to the target user first, and then the preset number of cached audio packages can be continuously sent to the target user when the preset timer is timed for a time length to reach the timing period.
[0027] The preset timer is used to actively send the cached audio package to the target user based on the preset timer, so that the target user can receive the cached audio package and play the live audio faster, optimize the live audio second opening experience, and reduce the initial jitter rate when the user first enters the live room.
[0028] Alternatively, the cached audio package can be continuously sent to the target user based on the preset timer until the sent cached audio package is the latest audio package uploaded by the microphone user (for example, the sequence number of the cached audio package currently sent to the target user reaches the maximum value recorded, the preset timer can be stopped, and the audio package can be sent to the target user based on the original data delivery strategy).
[0029] According to the foregoing, when it is detected that the target user enters the live room for the first time, whether the timer enabling condition is met is determined according to the audio cache length of the live room and the room audio activity and the historical network condition of the target user, and the preset timer is started when the timer enabling condition is met. The buffered audio packet is sent to the target user based on the preset timer, so that the target user plays live audio according to the buffered audio packet. The buffered audio packet does not need to be sent to the target user after the user uploads the audio packet, but is sent to the target user in time according to the preset timer. The target user can quickly receive the buffered audio packet and play the sound, reduces the time length of waiting for sound playing when the user enters the live room for the first time, realizes the second play effect of live audio, and optimizes the live audio transmission effect.
[0030] On the basis of the foregoing embodiment, Figure 2 A flowchart of another live audio transmission method provided by the embodiment of the application is given, which is a specific embodiment of the foregoing live audio transmission method. Referring to Figure 2 The live audio transmission method comprises: S210: In the case of detecting that the target user enters the live room for the first time, determining the audio cache length of the live room and the room audio activity and the historical network condition of the target user.
[0031] S220: Determining whether the timer enabling condition is met according to the audio cache length, the room audio activity and the historical network condition.
[0032] The live audio transmission method provided by the application can determine whether the timer enabling condition is met according to the audio cache length, the room audio activity and the historical network condition. In the case that the audio cache length reaches a preset length threshold, the room audio activity reaches a preset activity threshold, and the historical network condition meets a preset network condition, it can be determined that the timer enabling condition is met.
[0033] Exemplarily, the audio cache length is compared with the preset length threshold (for example, 200 ms), the room audio activity is compared with the preset activity threshold, and it is judged whether the historical network condition meets the preset network condition.
[0034] In one embodiment, in the case that the audio cache length reaches the preset length threshold, the room audio activity reaches the preset activity threshold, and the historical network condition meets the preset network condition, it can be determined that the timer enabling condition is met. In the case that the audio cache length does not reach the preset length threshold, the room audio activity does not reach the preset activity threshold, or the historical network condition does not meet the preset network condition, it can be determined that the timer enabling condition is not met.
[0035] The preset activity threshold can be a packet sending frequency and / or a number of people on the microphone. Correspondingly, the preset activity threshold can be a packet sending frequency threshold (for example, 2 audio packets per second) and / or a number of people on the microphone threshold (for example, 2 people). Optionally, the historical network condition can be represented by a round-trip time, a packet loss rate, and jitter. The historical network condition satisfying the preset network condition can be that the round-trip time is less than a time delay threshold, the packet loss rate is less than a packet loss rate threshold, and the jitter is less than a jitter threshold.
[0036] The application can accurately determine whether the timer enabling condition is met, accurately determine the timing of enabling the preset timer, ensure that the target user can quickly receive the buffered audio packets and play the sound, and reduce the length of time that the user waits for the sound to be played when first entering the live room.
[0037] S230: Start the preset timer when the timer enabling condition is met.
[0038] S240: Send the buffered audio packets to the target user based on the preset timer, for the target user to play the live audio according to the buffered audio packets.
[0039] In one possible embodiment, the live audio transmission method provided by the application can be that the buffered audio packets are sent to the target user based on the preset timer, which can be: determining a timing period and an audio packet delivery quantity corresponding to the preset timer; and sending the buffered audio packets to the target user according to the timing period and the audio packet delivery quantity.
[0040] For example, when creating the preset timer, the timing period and the audio packet delivery quantity of the preset timer can be set according to the historical network condition of the target user. The better the historical network condition, the smaller the timing period, and the larger the audio packet delivery quantity.
[0041] Optionally, the preset timer can be configured with a default timing period and audio packet delivery quantity. Different combinations of timing periods and audio packet delivery quantities can also be configured for different network conditions, and the correspondence between network conditions and timing periods and audio packet delivery quantities can be recorded. After creating the preset timer, the timing period and the audio packet delivery quantity corresponding to the historical network condition can be determined based on the above correspondence.
[0042] In an embodiment, after determining the timing period corresponding to the preset timer and the number of audio packets to be sent, the cached audio packets can be sent to the target user according to the timing period and the number of audio packets to be sent. That is, after each timing period, the target user is sent the cached audio packets corresponding to the number of audio packets to be sent. According to the timing period corresponding to the preset timer and the number of audio packets to be sent, the application actively sends the cached audio packets to the target user, ensures that the target user can quickly receive the cached audio packets and play the sound after entering the live room, reduces the time length of the user waiting for the sound to be played when entering the live room for the first time, controls the rhythm and number of audio packet delivery through the timing period and the number of audio packets to be sent, and avoids network congestion caused by sudden increase in code rate.
[0043] In one possible embodiment, the live audio transmission method provided by the application can send the cached audio packets to the target user based on the preset timer, which can be: determining the timestamps corresponding to a plurality of cached audio packets, determining a priority audio packet from the plurality of cached audio packets according to the timestamps, sending the priority audio packet to the target user based on the preset timer, and sending the cached audio packets after the priority audio packet.
[0044] For example, the timestamps corresponding to a plurality of cached audio packets are determined (for example, the collection time of the cached audio packets), a priority audio packet is determined from the plurality of cached audio packets according to the timestamps, the priority audio packet is sent to the target user based on the preset timer, and the cached audio packets after the priority audio packet are sent. Optionally, the cached audio packets with timestamps before the timestamp of the priority audio packet can be discarded to reduce the occupation of the cache space by expired cached audio packets.
[0045] Optionally, the cached audio packets with a time length from the current time to the timestamp less than or equal to a preset time length threshold can be used as the priority audio packets, and the cached audio packets with a time length from the current time to the timestamp greater than the preset time length threshold can be discarded, so as to avoid sending expired cached audio packets to the target user, ensure normal playback of the cached audio packets by the target user, and optimize the bandwidth utilization rate and the audio playback experience. In an embodiment, the cached audio packets are not sent to the target user in batches at a time, but can be sorted and processed according to the playback urgency by using a priority queue, the cached audio packet with the shortest time length from the current time to the timestamp is preferentially pushed to the target user, and the cached audio packet that has been delayed for too long and may not be decoded is discarded, so as to ensure the playback quality and the bandwidth utilization efficiency. Optionally, the maximum number of audio packets to be sent in each timing period (for example, 12 audio packets sent at a time in the prior art are limited to 6 cached audio packets sent at a time) can be used to control the overall data transmission code rate, alleviate the network congestion problem in the audio first broadcast stage, and effectively reduce the audio first broadcast stall rate.
[0046] In one embodiment, the live audio transmission method provided in the present application determines a priority audio package from the plurality of buffered audio packages according to the timestamps, which can be: determining a key frame audio package recording an audio key frame from the plurality of buffered audio packages, and determining the key frame audio package with the shortest time length from the current time as the priority audio package.
[0047] For example, the buffered audio packages recording the audio key frames are determined from the plurality of buffered audio packages, and these buffered audio packages are determined as the key frame audio packages. The timestamps corresponding to each key frame audio package are determined, and the key frame audio package with the shortest time length from the current time is determined as the priority audio package, which ensures that the target user can correctly decode the corresponding audio data according to the priority audio package after receiving the priority audio package, and ensures the correct decoding of the subsequent buffered audio packages, guarantees the fluency of the first decoding of the buffered audio package, and improves the audio playback experience of the target user.
[0048] In one embodiment, the user and the target user provided in the present application can be located in the same server, or can be located in different servers. When the user and the target user are located in the same server, the live audio transmission device can directly send the buffered audio package to the target user, and when the user and the target user are located in different servers, the live audio transmission device can send the buffered audio package to the server where the target user is located, and the server where the target user is located forwards. Based on this, the live audio transmission method provided in the present application sends the buffered audio package to the target user based on the preset timer, which can be: in the case that the current server and the server where the target user is located are different servers, sending the buffered audio package to the server where the target user is located based on the preset timer, for the server where the target user is located to send the buffered audio package to the target user.
[0049] For example, when the current server and the server where the target user is located are different servers, the preset timer counts based on the set timing period, and when the preset timer counts for each time length reaches the timing period, the buffered audio package is sent to the server where the target user is located. After receiving the buffered audio package sent by the server where the target user is located, the target user can play the corresponding live audio according to the buffered audio package.
[0050] In one embodiment, when the current server and the server where the target user is located are different servers, the preset timer can be started in the server where the target user is located, and the server where the target user is located can also send the buffered audio package (the buffered audio package sent by the server where the user is located) to the target user based on the preset timer.
[0051] When the current server and the server where the target user is located are different servers, the server where the target user is located forwards the cached audio packet, timer cooperation between multiple servers is realized, cross-server fast synchronization of the cached audio packet is ensured, stability and universality of live audio transmission are improved, and the live audio transmission can support a complex distributed deployment environment.
[0052] S250: Determine the current network status of the target user, and update the timing period and the audio packet delivery quantity corresponding to the preset timer according to the current network status.
[0053] S260: Based on the preset timer after the timing period and the audio packet delivery quantity are updated, the cached audio packet is sent to the target user.
[0054] Exemplarily, after the cached audio packet is sent to the target user based on the preset timer, the current network status of the target user in the process of sending the cached audio packet to the target user can be obtained in real time. According to the correspondence between the network status and the timing period and the audio packet delivery quantity, the corresponding timing period and audio packet delivery quantity under the current network status are determined, and the timing period and the audio packet delivery quantity corresponding to the preset timer are updated by using the timing period and the audio packet delivery quantity determined above.
[0055] In one embodiment, after the timing period and the audio packet delivery quantity corresponding to the preset timer are updated, the cached audio packet will continue to be sent to the target user based on the preset timer after the timing period and the audio packet delivery quantity are updated. By updating the timing period and the audio packet delivery quantity corresponding to the preset timer according to the current network status of the target user, the application realizes adaptive adjustment of the audio packet delivery rhythm and quantity, and improves the robustness and anti-jitter capability of live audio transmission.
[0056] The above, by detecting that the target user enters the live room for the first time, determining whether the timer enabling condition is met according to the audio cache length of the live room and the room audio activity, and the historical network status of the target user, and starting the preset timer when the timer enabling condition is met, the cached audio packet is sent to the target user based on the preset timer, so that the target user plays live audio according to the cached audio packet. The target user does not need to wait for the audio packet uploaded by the user to send the cached audio packet to the target user, but sends the cached audio packet to the target user in time according to the preset timer, the target user can quickly receive the cached audio packet and play the sound, reduces the time length of the user waiting for the sound to play when entering the live room for the first time, realizes the second play effect of live audio, and optimizes the live audio transmission effect. At the same time, the timing period and the audio packet delivery quantity corresponding to the preset timer are updated according to the current network status of the target user, the adaptive adjustment of the audio packet delivery rhythm and quantity is realized, and the robustness and anti-jitter capability of live audio transmission are improved.
[0057] Figure 3 A structural schematic diagram of a live audio transmission device provided by an embodiment of the present application is given. Referring to Figure 3 The live audio transmission device includes an information acquisition module 31, an enabling judgment module 32, a timing enabling module 33, and an audio sending module 34.
[0058] The information acquisition module 31 is configured to, in a case where it is detected that a target user enters a live room for the first time, determine an audio cache length of the live room and a room audio activity level, and a historical network condition of the target user; the enabling judgment module 32 is configured to determine whether a timer enabling condition is met according to the audio cache length, the room audio activity level, and the historical network condition; the timing enabling module 33 is configured to start a preset timer in a case where the timer enabling condition is met; and the audio sending module 34 is configured to send a cache audio packet to the target user based on the preset timer, for the target user to play live audio according to the cache audio packet.
[0059] The above, by detecting that the target user enters the live room for the first time, determining whether the timer enabling condition is met according to the audio cache length of the live room and the room audio activity level, and the historical network condition of the target user, and starting the preset timer when the timer enabling condition is met, sending the cache audio packet to the target user based on the preset timer, so that the target user plays the live audio according to the cache audio packet, without waiting for the user to upload the audio packet before sending the cache audio packet to the target user, but sending the cache audio packet to the target user in a timely manner according to the preset timer, so that the target user can quickly receive the cache audio packet and play the sound, reducing the time length of waiting for the sound to be played when the user enters the live room for the first time, realizing the second play effect of the live audio, and optimizing the live audio transmission effect.
[0060] In one possible embodiment, the enabling judgment module 32 determines whether the timer enabling condition is met according to the audio cache length, the room audio activity level, and the historical network condition, and is configured to: In a case where the audio cache length reaches a preset length threshold, the room audio activity level reaches a preset activity level threshold, and the historical network condition meets a preset network condition, it is determined that the timer enabling condition is met.
[0061] In one possible embodiment, the audio sending module 34 sends the cache audio packet to the target user based on the preset timer, and is configured to: determine a timing period corresponding to the preset timer and an audio packet delivery quantity; send the cache audio packet to the target user according to the timing period and the audio packet delivery quantity.
[0062] In a possible embodiment, the live audio transmission apparatus further comprises an update processing module, configured to: determine a current network condition of the target user, and update a timing period corresponding to the preset timer and a number of audio packets to be delivered according to the current network condition. Correspondingly, the audio sending module 34 is further configured to send the buffered audio packets to the target user based on the preset timer after the timing period and the number of audio packets to be delivered are updated.
[0063] In a possible embodiment, the audio sending module 34 sends the buffered audio packets to the target user based on the preset timer, and is configured to: determine time stamps corresponding to the plurality of buffered audio packets, and determine a priority audio packet from the plurality of buffered audio packets according to the time stamps; send the priority audio packet to the target user based on the preset timer, and send the buffered audio packets after the priority audio packet to the target user.
[0064] In a possible embodiment, the audio sending module 34 determines the priority audio packet from the plurality of buffered audio packets according to the time stamps, and is configured to: determine a key frame audio packet in which an audio key frame is recorded from the plurality of buffered audio packets, and determine the key frame audio packet with the shortest time length from the current time as the priority audio packet.
[0065] In a possible embodiment, the audio sending module 34 sends the buffered audio packets to the target user based on the preset timer, and is configured to: In a case where the current server and a server where the target user is located are different servers, the audio sending module 34 sends the buffered audio packets to the server where the target user is located based on the preset timer, so that the server where the target user is located delivers the buffered audio packets to the target user.
[0066] It should be noted that, in the embodiments of the live audio transmission apparatus described above, each unit and module included is only logically divided according to functions, but is not limited to the above division, as long as the corresponding functions can be implemented; in addition, the specific names of each functional unit are only for mutual distinction, and do not limit the protection scope of the embodiments of the present application.
[0067] The embodiments of the present application further provide a live audio transmission device, which can integrate the live audio transmission apparatus provided by the embodiments of the present application. Figure 4 FIG. 1 is a structural schematic diagram of a live audio transmission device provided by an embodiment of the present application. Referring to FIG. 1, Figure 4The live audio transmission device includes: an input apparatus 43, an output apparatus 44, a memory 42, and one or more processors 41; the memory 42 is configured to store one or more programs; when the one or more programs are executed by the one or more processors 41, the one or more processors 41 implement the live audio transmission method provided by the above embodiments. The live audio transmission device, apparatus and computer provided by the above embodiments can be used to execute the live audio transmission method provided by any of the above embodiments, and have the corresponding functions and beneficial effects.
[0068] The embodiments of the present application further provide a non-volatile storage medium storing computer executable instructions, which, when executed by a computer processor, are used to execute the live audio transmission method provided by the above embodiments. Of course, the non-volatile storage medium storing computer executable instructions provided by the embodiments of the present application is not limited to the live audio transmission method provided above, but can also execute the related operations in the live audio transmission method provided by any of the embodiments of the present application. The live audio transmission device, apparatus and storage medium provided in the above embodiments can execute the live audio transmission method provided by any of the embodiments of the present application, and the technical details not described in the above embodiments can be referred to the live audio transmission method provided by any of the embodiments of the present application.
[0069] On the basis of the above embodiments, the embodiments of the present application further provide a computer program product, the technical solutions of the present application essentially or the part of the contribution to the prior art or the whole or part of the technical solutions can be embodied in the form of software product, the computer program product is stored in a storage medium, includes a plurality of instructions to make a computer device, mobile terminal or processor therein execute all or part of the steps of the live audio transmission method provided by the embodiments of the present application.
Claims
1. A method for live audio transmission, characterized in that, include: Upon detecting that a target user has entered the live stream room for the first time, determine the audio buffer length and room audio activity of the live stream room, as well as the target user's historical network status; Determine whether the timer activation conditions are met based on the audio buffer length, the room audio activity level, and the historical network conditions. If the timer activation conditions are met, the preset timer will be started. Based on the preset timer, a cached audio packet is sent to the target user, so that the target user can play the live audio according to the cached audio packet.
2. The live audio transmission method according to claim 1, characterized in that, The step of determining whether the timer activation conditions are met based on the audio buffer length, the room audio activity level, and the historical network conditions includes: If the audio buffer length reaches a preset length threshold, the room audio activity reaches a preset activity threshold, and the historical network conditions meet preset network conditions, then the timer activation condition is determined to be met.
3. The live audio transmission method according to claim 1, characterized in that, Sending cached audio packets to the target user based on the preset timer includes: Determine the timing period and the number of audio packets to be sent corresponding to the preset timer; Based on the timeout period and the number of audio packets sent, cached audio packets are sent to the target user.
4. The live audio transmission method according to claim 3, characterized in that, After sending the cached audio packet to the target user based on the preset timer, the method further includes: Determine the current network status of the target user, and update the timing period and audio packet delivery quantity of the preset timer according to the current network status; Based on the preset timer after updating the timing period and the number of audio packets sent, cached audio packets are sent to the target user.
5. The live audio transmission method according to claim 1, characterized in that, Sending cached audio packets to the target user based on the preset timer includes: Determine the timestamps corresponding to multiple cached audio packets, and determine the priority audio packet from the multiple cached audio packets based on the timestamps; The system sends the priority audio packet and the cached audio packet following the priority audio packet to the target user based on the preset timer.
6. The live audio transmission method according to claim 5, characterized in that, The step of determining the priority audio packet from the plurality of cached audio packets based on the timestamp includes: From the multiple cached audio packets, determine the keyframe audio packet that records audio keyframes, and determine the keyframe audio packet with the shortest time length between the timestamp and the current time as the priority audio packet.
7. The live audio transmission method according to claim 1, characterized in that, Sending cached audio packets to the target user based on the preset timer includes: When the current server and the target user's server are different servers, a cached audio packet is sent to the target user's server based on the preset timer, so that the target user's server can send the cached audio packet to the target user.
8. A live audio transmission device, characterized in that, It includes an information acquisition module, an activation judgment module, a timed activation module, and an audio transmission module, among which: The information acquisition module is configured to determine the audio buffer length and room audio activity of the live broadcast room, as well as the historical network status of the target user, when the target user enters the live broadcast room for the first time. The activation judgment module is configured to determine whether the timer activation conditions are met based on the audio buffer length, the room audio activity level, and the historical network conditions. The timer activation module is configured to start a preset timer when the timer activation conditions are met; The audio sending module is configured to send a cached audio packet to the target user based on the preset timer, so that the target user can play live audio according to the cached audio packet.
9. A live audio transmission device, characterized in that, include: Memory and one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the live audio transmission method as described in any one of claims 1-7.
10. A non-volatile storage medium for storing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are used to perform the live audio transmission method as described in any one of claims 1-7.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the live audio transmission method according to any one of claims 1-7.