CN115378920B - Method and equipment for adjusting audio time delay - Google Patents

Method and equipment for adjusting audio time delay Download PDF

Info

Publication number
CN115378920B
CN115378920B CN202211314960.6A CN202211314960A CN115378920B CN 115378920 B CN115378920 B CN 115378920B CN 202211314960 A CN202211314960 A CN 202211314960A CN 115378920 B CN115378920 B CN 115378920B
Authority
CN
China
Prior art keywords
duration
audio data
new
cache
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211314960.6A
Other languages
Chinese (zh)
Other versions
CN115378920A (en
Inventor
仲志伟
肖踞雄
朱凌
王娜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Dayu Semiconductor Co ltd
Original Assignee
Nanjing Dayu Semiconductor Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Dayu Semiconductor Co ltd filed Critical Nanjing Dayu Semiconductor Co ltd
Priority to CN202211314960.6A priority Critical patent/CN115378920B/en
Publication of CN115378920A publication Critical patent/CN115378920A/en
Application granted granted Critical
Publication of CN115378920B publication Critical patent/CN115378920B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/38Flow control; Congestion control by adapting coding or compression rate
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a method and equipment for adjusting audio time delay, and relates to the technical field of communication. The method comprises the steps of obtaining the caching duration and the decoding duration of audio data sent by audio transmitting equipment; if the cache duration is less than the decoding duration, increasing the cache duration to obtain a new cache duration; adopting the new buffer duration to carry out smoothing processing on the audio data to obtain new audio data; and if the cache duration is determined to be greater than or equal to the decoding duration according to the new audio data, playing the new audio data. Therefore, the audio data is subjected to smoothing processing according to the increased buffer time length, so that the buffer time length is greater than the decoding time length, the playing pause condition is overcome, and the audio data is played more smoothly and more continuously.

Description

Method and equipment for adjusting audio time delay
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and a device for adjusting an audio delay.
Background
Currently, many microphone devices transmit audio data based on wireless communication, such as: bluetooth, etc. In the transmission process, the quality of audio is closely related to the quality of wireless communication, and poor communication quality may cause the voice data to be blocked and experience to be poor, otherwise, the listening feeling is smoother. Inevitably, as the distance between the transmitting end and the receiving end increases, the anti-interference capability of the communication quality deteriorates, the transmission quality also degrades, and the audio becomes jammed.
Taking bluetooth as an example, the buffer packet of the bluetooth audio data is fixed, the interval between the audio data playing and the bluetooth packet sending is also fixed, if the wireless communication becomes worse, a packet is not sent successfully until the time when the bluetooth should send the packet, so that after the buffer audio data of the receiving end is played, no audio data which can be played continuously exists, and the card pause occurs.
Disclosure of Invention
The present invention provides a method and an apparatus for adjusting audio delay to solve the problem of stuttering audio data playing in the prior art.
In order to achieve the above purpose, the embodiments of the present application adopt the following technical solutions:
in a first aspect, an embodiment of the present application provides a method for adjusting an audio delay, where the method is applied to a receiving terminal, the receiving terminal is in wireless communication with an audio transmitting device, and the audio transmitting device is configured to transmit audio data, where the method includes:
acquiring the caching duration and the decoding duration of the audio data sent by the audio transmitting equipment;
if the cache duration is less than the decoding duration, increasing the cache duration to obtain a new cache duration;
adopting the new buffer duration to carry out smoothing processing on the audio data to obtain new audio data;
and if the cache duration is determined to be greater than or equal to the decoding duration according to the new audio data, playing the new audio data.
Optionally, if the buffering duration is less than the decoding duration, increasing the buffering duration, and before obtaining a new buffering duration, further including:
and judging whether the audio data is normally transmitted and received.
Optionally, the increasing the cache duration to obtain a new cache duration includes:
and adding the cache duration and a preset unit cache duration to obtain the new cache duration.
Optionally, before playing the new audio data, the method further includes:
obtaining a received signal strength RSSI measurement value of the new audio data;
adjusting the new caching duration according to the RSSI measured value to obtain the adjusted caching duration;
the playing the new audio data comprises:
and adopting the adjusted cache duration to carry out smoothing processing on the new audio data, and playing the audio data after the smoothing processing.
Optionally, the adjusting the buffering duration according to the RSSI measurement value and obtaining the adjusted buffering duration include:
if the RSSI measured value is greater than a preset RSSI reference value, taking the preset unit cache duration as the adjusted cache duration;
and if the RSSI measured value is less than or equal to the preset RSSI reference value, keeping the new cache duration unchanged.
Optionally, before playing the new audio data, the method further includes:
acquiring the communication accuracy of the new audio data;
adjusting the new cache duration according to the communication accuracy to obtain the adjusted cache duration;
the playing the new audio data comprises:
and smoothing the new audio data by adopting the adjusted buffer duration, and playing the smoothed audio data.
Optionally, the adjusting the new buffering duration according to the communication accuracy to obtain the adjusted buffering duration includes:
if the communication accuracy is greater than a preset communication accuracy reference value, taking the preset unit cache duration as the adjusted cache duration;
and if the communication accuracy is less than or equal to the preset communication accuracy reference value, keeping the new cache duration unchanged.
Optionally, before playing the new audio data, the method further includes:
obtaining the RSSI measuring value and the communication accuracy of the new audio data;
adjusting the new caching duration according to the RSSI measurement value and the communication accuracy rate, and acquiring the adjusted caching duration;
the playing the new audio data includes:
and adopting the adjusted cache duration to carry out smoothing processing on the new audio data, and playing the audio data after the smoothing processing.
Optionally, the adjusting the new buffering duration according to the RSSI measurement value and the communication accuracy to obtain the adjusted buffering duration includes:
if the communication accuracy is greater than a preset communication accuracy reference value, taking the preset unit cache duration as the adjusted cache duration;
if the communication accuracy is less than or equal to the preset communication accuracy reference value and the RSSI measurement value is greater than the preset RSSI reference value, taking the preset unit cache duration as the adjusted cache duration;
and if the communication correct rate is less than or equal to the preset communication correct rate reference value and the RSSI measured value is less than or equal to the preset RSSI reference value, keeping the new cache duration unchanged.
In a second aspect, an embodiment of the present application provides a terminal device, including: the processor and the storage medium are connected through a bus in a communication manner, the storage medium stores program instructions executable by the processor, and the processor calls a program stored in the storage medium to execute the steps of the method for adjusting audio time delay according to any one of the first aspect.
Compared with the prior art, the method has the following beneficial effects:
the application provides a method and equipment for adjusting audio time delay, wherein the method comprises the steps of obtaining the cache duration and the decoding duration of audio data sent by audio transmitting equipment; if the cache duration is less than the decoding duration, increasing the cache duration to obtain a new cache duration; adopting the new buffer duration to carry out smoothing processing on the audio data to obtain new audio data; and if the cache duration is determined to be greater than or equal to the decoding duration according to the new audio data, playing the new audio data. Therefore, the audio data is subjected to smoothing processing according to the increased buffer time length, so that the buffer time length is greater than the decoding time length, the playing pause condition is overcome, and the audio data is played more smoothly and more continuously.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a schematic structural diagram of an audio transmission system according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a method for adjusting an audio delay according to the present application;
fig. 3 is a schematic flowchart of a method for adjusting a cache duration according to this embodiment;
fig. 4 is a schematic flowchart of a method for adjusting a buffer duration according to an RSSI measurement value according to an embodiment of the present disclosure;
fig. 5 is a schematic flow chart of another method for adjusting a cache duration according to this embodiment;
fig. 6 is a flowchart illustrating a method for adjusting a cache duration according to a communication accuracy according to an embodiment of the present application;
fig. 7 is a schematic flowchart of another method for adjusting a cache duration according to this embodiment;
fig. 8 is a schematic flowchart of a method for adjusting a buffer duration according to an RSSI measurement value and a communication accuracy according to an embodiment of the present disclosure;
fig. 9 is a schematic diagram of an apparatus for adjusting an audio delay according to an embodiment of the present application;
fig. 10 is a schematic diagram of a terminal device according to an embodiment of the present application.
Icon: 100-receiving terminal, 200-audio transmitting device, 901-obtaining module, 902-adding module, 903-processing module, 904-playing module, 1001-processor, 1002-storage medium.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined or explained in subsequent figures.
Furthermore, the appearances of the terms "first," "second," and the like, if any, are used solely to distinguish one from another and are not to be construed as indicating or implying relative importance.
It should be noted that the features of the embodiments of the present invention may be combined with each other without conflict.
In order to reduce the delay of audio data and improve user experience, the application provides a method and equipment for adjusting audio time delay.
Before introducing the method of adjusting audio delay, an explanation of an audio transmission system will be given. Fig. 1 is a schematic structural diagram of an audio transmission system according to an embodiment of the present disclosure. As shown in fig. 1, the system includes: the receiving terminal 100, the audio transmitting apparatus 200, and the receiving terminal 100 and the audio transmitting apparatus 200 are communicatively connected, wherein in the embodiment of the present application, a wireless Communication connection is taken as an example, for example, a bluetooth connection, an NFC (Near Field Communication) connection, and the like, which are not limited herein.
The audio transmitting apparatus 200 is configured to generate audio data, encode the audio data and transmit the encoded audio data to the receiving terminal 100, and the receiving terminal 100 decodes the audio data and plays the decoded audio data. For example, taking bluetooth communication as an example, when the bluetooth headset receives audio, the bluetooth headset is a receiving terminal, and the terminal device bluetooth-connected to the bluetooth headset is the audio transmitting device 200. Taking a microphone as an example, a microphone with bluetooth function may be used as the audio transmitting device 200, and a terminal device (such as a mobile terminal, an earphone, a sound device, etc.) for receiving audio emitted by the microphone may be used as the receiving terminal 100.
During bluetooth communication, as the distance between the receiving terminal 100 and the audio transmitting device 200 increases, the bluetooth communication quality may decrease, and at this time, the receiving terminal 100 executes a method of adjusting the audio delay to adjust the audio delay, so as to reduce the delay of audio data and improve user experience.
A method for adjusting audio delay provided by the present application is explained by specific examples as follows. Fig. 2 is a schematic flowchart of a method for adjusting an audio delay provided in the present application, where an execution subject of the method is a receiving terminal, and the terminal device may be a device having a function of calculating, processing, and receiving. As shown in fig. 2, the method includes:
s101, obtaining the buffering time length and the decoding time length of audio data sent by audio transmitting equipment.
And after receiving the audio data sent by the audio transmitting equipment, the audio data is not immediately played, the audio data needs to be queued for decoding, and the audio data is played after the decoding is finished. The time length of the audio data waiting for decoding in queue is the buffer time length, and the time length spent in the audio data decoding process is the decoding time length.
In the transmission process, the audio data is transmitted in data packets, for example, the playing time of each packet of audio data is 7.5ms. The buffering duration can also change along with the change of the communication quality, if the communication quality is better, the audio data is sent in time, the audio data packets to be decoded are queued to be increased, and if the communication quality is poorer, the audio data is sent in a pause state, and the audio data packets to be decoded are queued to be decreased. Different numbers of audio data packets can result in different buffering time lengths, wherein 1 audio data packet is queued for 7.5ms and 2 audio data packets are queued for 15ms and 3 audio data packets are queued for 22.5ms. Communication quality at different times is different, and therefore, the buffer duration of the audio data at the current time needs to be acquired.
And S102, comparing the caching duration with the decoding duration.
S103, if the caching duration is smaller than the decoding duration, the caching duration is increased to obtain a new caching duration.
And comparing the caching duration with the decoding duration, and if the caching duration is greater than or equal to the decoding duration, queuing the audio data to be decoded when the decoding of the packet of audio data is finished, so that the situation of pause cannot occur.
If the buffering duration is less than the decoding duration, when the decoding of one packet of audio data is completed, the next packet of audio data does not reach the receiving terminal, no audio data to be decoded is queued, new audio data must be received, in the waiting process, no audio data is played, and the user perceives that the audio playing is blocked. Therefore, if the buffering duration is less than the decoding duration, the buffering duration needs to be increased to obtain a new buffering duration, so as to prolong the playing duration of the audio data, and eliminate the interruption and pause time as much as possible, so that the audio data is played more smoothly.
For example, if the buffering duration is less than the decoding duration and the current buffering duration is 7.5ms, the buffering duration may be increased to 20ms, so that when decoding of one packet of audio data is completed, the next packet of audio data has already arrived at the receiving terminal.
And S104, smoothing the audio data by adopting the new buffer duration to acquire new audio data.
After the buffer time length is increased, the playing time length of the audio data is increased, and if the audio data is played according to the buffer time length before the increase, the situation that the audio data is stuck after the playing is finished still occurs. Therefore, the audio data needs to be smoothed by using the new buffer duration to obtain the new audio data, so that the audio content of the audio data can be played according to the new buffer duration.
And S105, if the cache duration is determined to be greater than or equal to the decoding duration according to the new audio data, playing the new audio data.
After the new audio data is obtained, whether the new buffer duration corresponding to the new audio data can overcome the playing pause condition needs to be continuously compared with the decoding duration. And if the cache duration is greater than or equal to the decoding duration, namely the new cache duration can overcome the playing pause condition, playing the new audio data. If the buffering duration is less than the decoding duration, continuing to loop the steps S102 and S103 until the buffering duration corresponding to the new audio data is greater than or equal to the decoding duration, and playing the new audio data.
In summary, in the embodiment, the buffering duration and the decoding duration of the audio data sent by the audio transmitting device are obtained; if the cache duration is less than the decoding duration, increasing the cache duration to obtain a new cache duration; adopting the new buffer duration to carry out smoothing processing on the audio data to obtain new audio data; and if the cache duration is determined to be greater than or equal to the decoding duration according to the new audio data, playing the new audio data. Therefore, the audio data is subjected to smoothing processing according to the increased buffer time length, so that the buffer time length is greater than the decoding time length, the playing pause condition is overcome, and the audio data is played more smoothly and more continuously.
On the basis of the embodiment corresponding to fig. 2, in S102, before increasing the buffering duration and obtaining a new buffering duration if the buffering duration is less than the decoding duration, the method further includes:
and judging whether the audio data is normally transmitted and received.
Specifically, a preset sampling duration is set, and if an audio data packet is received within the preset sampling duration, the audio data is normally received and transmitted; and within the preset sampling duration, if the audio data packet is not received, the audio data is abnormal in receiving and sending.
On the basis of the embodiment corresponding to fig. 2, the increasing the cache duration in S102 to obtain a new cache duration includes:
and adding the cache duration and the preset unit cache duration to obtain new cache duration.
When the cache duration needs to be increased, in order to improve the increased accuracy, only one preset unit cache duration is increased each time. When the next round still needs to increase the cache duration, a preset unit cache duration is increased, and the cache duration is increased in sequence.
For example, the preset unit buffer duration may be an original playing duration of each packet of audio data, for example, 7.5ms, but not limited thereto, and may be a preconfigured duration.
Fig. 3 is a schematic flowchart of a method for adjusting a cache duration according to this embodiment. As shown in fig. 3, before playing the new audio data in S104, the method further includes:
s201, obtaining a received signal strength RSSI measured value of new audio data.
Since the communication quality is constantly changed, even after the buffering time length is adjusted according to the encoding time length at the previous moment, the communication quality at the next moment is also changed. Therefore, it is also necessary to acquire communication quality before playing new audio data.
Alternatively, a new RSSI (Received Signal Strength) measurement of the audio data may be obtained. RSSI measurements represent the strength of a signal in a wireless network, which decays with increasing distance, typically negative. That is, the larger the RSSI measurement value of the new audio data is, the better the communication quality is, and the smaller the RSSI measurement value of the new audio data is, the worse the communication quality is.
For example, the audio data is transmitted in the form of data packets, and the RSSI measurement value of the audio data may be obtained as an average value of the RSSI measurement values of 100 audio data packets received most recently.
Of course, other communication quality parameters may also be used as the determination criteria, and this embodiment is not limited.
S202, adjusting the new caching duration according to the RSSI measured value, and obtaining the adjusted caching duration.
After the RSSI measurements are obtained, a new buffering duration may be further adjusted based on the RSSI measurements. The RSSI measurement value characterizes the communication quality, i.e., the new buffering duration is adjusted by the communication quality to obtain the adjusted buffering duration. The adjusted buffer time length meets the transmission and playing requirements under the current communication quality.
Further, playing the new audio data in S104 includes:
s203, smoothing the new audio data by adopting the adjusted buffer duration, and playing the smoothed audio data.
The adjusted buffer time length meets the transmission and playing requirements under the current communication quality, and the new audio data is subjected to smoothing processing by adopting the adjusted buffer time length. Under the current communication quality, the audio data after the smoothing processing can be continuously played without the situations of pause and the like.
In summary, in the embodiment, the RSSI measurement value of the new audio data is obtained; adjusting the new cache duration according to the RSSI measured value, and acquiring the adjusted cache duration; and smoothing the new audio data by adopting the adjusted buffer duration, and playing the smoothed audio data. Therefore, the RSSI measured value of the audio data is obtained in real time, the buffer time length is adjusted, the buffer time length of the audio data changes along with the RSSI measured value more accurately, the audio data can be played continuously, and the situations of blocking and the like can be avoided.
Fig. 4 is a flowchart illustrating a method for adjusting a buffering duration according to an RSSI measurement value according to an embodiment of the present disclosure. As shown in fig. 4, the adjusting the buffering duration according to the RSSI measurement value in S202 to obtain the adjusted buffering duration includes:
s301, if the RSSI measured value is larger than the preset RSSI reference value, the preset unit cache duration is used as the adjusted cache duration.
In order to enable the buffer time length to be adjusted more accurately according to the RSSI measured value, a preset RSSI reference value is set. For example, the average RSSI measurement value of 500 packets of audio data packets with good communication quality may be determined as a preset RSSI reference value according to working experience, for example, the preset RSSI reference value is-70 dbm.
If the RSSI measured value is greater than the preset RSSI reference value, the communication quality is better, the cache duration is not required to be increased, and the preset unit cache duration can be directly used as the adjusted cache duration. Under the condition of avoiding the pause, the playing efficiency of the audio data is improved.
And S302, if the RSSI measured value is less than or equal to the preset RSSI reference value, keeping the new caching duration unchanged.
If the measured value of the RSSI is less than or equal to the preset reference value of the RSSI, the communication quality is poor, and the audio data playing can be interrupted or blocked. And the new buffer duration overcomes the stuck condition, so the new buffer duration is continuously kept unchanged.
In this embodiment, if the RSSI measurement value is greater than the preset RSSI reference value, the preset unit buffer duration is used as the adjusted buffer duration; and if the RSSI measured value is less than or equal to the preset RSSI reference value, keeping the new caching duration unchanged. Therefore, the cache duration is adjusted more accurately by comparing the reference value with the preset RSSI reference value.
Fig. 5 is a schematic flowchart of another method for adjusting a buffer duration according to this embodiment. As shown in fig. 5, before playing the new audio data in S104, the method further includes:
s401, obtaining the communication accuracy of the new audio data.
The communication accuracy rate represents the communication quality, the higher the communication accuracy rate is, the better the communication quality is, and the lower the communication accuracy rate is, the worse the communication quality is.
For example, the audio data is transmitted in the form of data packets, and when the communication accuracy of the audio data is obtained, the communication accuracy may be an average value of the communication accuracy of 100 audio data packets received most recently.
S402, adjusting the new cache duration according to the communication accuracy, and obtaining the adjusted cache duration.
After the communication accuracy is obtained, the new buffer duration can be further adjusted according to the communication accuracy. The communication accuracy rate represents the communication quality, namely the new cache duration is adjusted through the communication quality to obtain the adjusted cache duration. The adjusted buffer time length meets the transmission and playing requirements under the current communication quality.
Further, the playing the new audio data includes:
and S403, smoothing the new audio data by adopting the adjusted cache duration, and playing the smoothed audio data.
The adjusted buffer time length meets the transmission and playing requirements under the current communication quality, and the new audio data is subjected to smoothing processing by adopting the adjusted buffer time length. Under the current communication quality, the audio data after the smoothing processing can be continuously played without the situations of jamming and the like.
In summary, in the present embodiment, by acquiring the communication accuracy of the new audio data; adjusting the new cache duration according to the communication accuracy to obtain the adjusted cache duration; and adopting the adjusted cache duration to carry out smoothing processing on the new audio data, and playing the audio data after the smoothing processing. Therefore, the communication accuracy of the audio data is obtained in real time, and the cache duration is adjusted, so that the cache duration of the audio data is more accurately changed along with the communication accuracy, the audio data can be continuously played, and the situations of blocking and the like can be avoided.
Fig. 6 is a flowchart illustrating a method for adjusting a buffering duration according to a communication accuracy according to an embodiment of the present application. As shown in fig. 6, the adjusting the new buffering duration according to the communication accuracy in S402 to obtain the adjusted buffering duration includes:
and S501, if the communication accuracy is greater than the preset communication accuracy reference value, taking the preset unit cache duration as the adjusted cache duration.
In order to enable the cache duration to be adjusted more accurately according to the communication accuracy, a preset communication accuracy reference value is set. For example, it may be determined from working experience that the average value of the communication accuracy of 500 packets of audio data packets with good communication quality is the preset communication accuracy reference value, for example, the preset communication accuracy reference value is 90%.
If the communication accuracy is greater than the preset communication accuracy reference value, the communication quality is better, the cache duration is not required to be increased, and the preset unit cache duration can be directly used as the adjusted cache duration. Under the condition of avoiding the jamming, the playing efficiency of the audio data is improved.
And S502, if the communication accuracy is less than or equal to the preset communication accuracy reference value, keeping the new cache duration unchanged.
If the communication accuracy is less than or equal to the preset communication accuracy reference value, the communication quality is poor, and the audio data playing also has the conditions of interruption and pause. The new buffer duration has overcome the stuck condition, and therefore, the new buffer duration is kept unchanged.
In summary, in the above embodiment, if the communication accuracy is greater than the preset communication accuracy reference value, the preset unit cache duration is used as the adjusted cache duration; and if the communication accuracy is less than or equal to the preset communication accuracy reference value, keeping the new cache duration unchanged. Therefore, the cache duration is adjusted more accurately by comparing the communication duration with the preset communication accuracy reference value.
Fig. 7 is a schematic flowchart of another method for adjusting a buffering duration according to this embodiment. As shown in fig. 7, before playing the new audio data in S104, the method further includes:
s601, obtaining the RSSI measured value and the communication accuracy of the new audio data.
In addition to the above, when the communication quality is determined by separately using the RSSI measurement value or the communication accuracy of the new audio data, the communication quality may be determined by comprehensively considering the RSSI measurement value and the communication accuracy of the new audio data.
The RSSI measured value and the communication accuracy rate both represent the communication quality, the higher the RSSI measured value and the communication accuracy rate are, the better the communication quality is, and the lower the RSSI measured value and the communication accuracy rate are, the worse the communication quality is.
For example, the audio data is transmitted in the form of data packets, and the RSSI measurement value of the audio data may be obtained as an average value of the RSSI measurement values of 100 audio data packets received recently.
For example, the audio data is transmitted in the form of data packets, and when the communication accuracy of the audio data is obtained, the communication accuracy may be an average value of the communication accuracy of 100 audio data packets received most recently.
And S602, adjusting the new caching duration according to the RSSI measurement value and the communication accuracy rate, and acquiring the adjusted caching duration.
After the RSSI measurement value and the communication accuracy are obtained, the new buffering duration can be further adjusted according to the RSSI measurement value and the communication accuracy. The RSSI measured value and the communication accuracy rate represent the communication quality, namely, the new buffer time length is adjusted through the communication quality to obtain the adjusted buffer time length. The adjusted buffer time length meets the transmission and playing requirements under the current communication quality.
Further, playing the new audio data includes:
s603, smoothing the new audio data by adopting the adjusted buffer duration, and playing the smoothed audio data.
The adjusted cache duration meets the transmission and playing requirements under the current communication quality, and the new audio data is subjected to smoothing processing by adopting the adjusted cache duration. Under the current communication quality, the audio data after the smoothing processing can be continuously played without the situations of jamming and the like.
In summary, in the present embodiment, the RSSI measurement value and the communication accuracy of the new audio data are obtained; adjusting the new cache duration according to the RSSI measurement value and the communication accuracy rate, and acquiring the adjusted cache duration; and adopting the adjusted cache duration to carry out smoothing processing on the new audio data, and playing the audio data after the smoothing processing. Therefore, the RSSI measured value and the communication accuracy of the audio data are obtained in real time, and the cache duration is adjusted, so that the cache duration of the audio data is more accurately changed along with the RSSI measured value and the communication accuracy, the audio data can be continuously played, and the situations of blocking and the like can be avoided.
Fig. 8 is a flowchart illustrating a method for adjusting a buffering duration according to an RSSI measurement value and a communication accuracy according to an embodiment of the present disclosure. As shown in fig. 8, the adjusting the new buffering duration according to the RSSI measurement value and the communication accuracy in S602 to obtain the adjusted buffering duration includes:
and S701, if the communication accuracy is greater than the preset communication accuracy reference value, taking the preset unit cache duration as the adjusted cache duration.
If the communication accuracy is greater than the preset communication accuracy reference value, no matter what the RSSI measured value is, the communication quality is better, the cache duration is not required to be increased, and the preset unit cache duration can be directly used as the adjusted cache duration. Under the condition of avoiding the jamming, the playing efficiency of the audio data is improved.
S702, if the communication accuracy is less than or equal to the preset communication accuracy reference value and the RSSI measurement value is greater than the preset RSSI reference value, taking the preset unit cache duration as the adjusted cache duration.
If the communication accuracy is less than or equal to the preset communication accuracy reference value and the RSSI measurement value is greater than the preset RSSI reference value, the communication quality is better, and the buffer duration does not need to be increased, and the preset unit buffer duration can be directly used as the adjusted buffer duration. Under the condition of avoiding the jamming, the playing efficiency of the audio data is improved.
And S703, if the communication accuracy is less than or equal to the preset communication accuracy reference value and the RSSI measurement value is less than or equal to the preset RSSI reference value, keeping the new caching duration unchanged.
If the communication accuracy is less than or equal to the preset communication accuracy reference value and the RSSI measurement value is less than or equal to the preset RSSI reference value, it indicates that the communication quality is poor, and the audio data playing will be interrupted or blocked. The new buffer duration has overcome the stuck condition, and therefore, the new buffer duration is kept unchanged.
In summary, in this embodiment, if the communication accuracy is greater than the preset communication accuracy reference value, the preset unit buffer duration is used as the adjusted buffer duration; if the communication accuracy is less than or equal to the preset communication accuracy reference value and the RSSI measured value is greater than the preset RSSI reference value, taking the preset unit cache duration as the adjusted cache duration; and if the communication accuracy is less than or equal to the preset communication accuracy reference value and the RSSI measurement value is less than or equal to the preset RSSI reference value, keeping the new cache duration unchanged. Therefore, the cache duration is adjusted more accurately by comparing the preset communication accuracy reference value with the preset RSSI reference value.
The following describes a device, an apparatus, a storage medium, and the like for adjusting audio delay provided by the present application, and specific implementation processes and technical effects thereof are referred to above, and will not be described again below.
Fig. 9 is a schematic diagram of an apparatus for adjusting an audio delay according to an embodiment of the present application. As shown in fig. 9, the apparatus is applied to a receiving terminal which wirelessly communicates with an audio transmitting device for transmitting audio data, and includes:
the obtaining module 901 is configured to obtain a buffering duration and a decoding duration of audio data sent by an audio sending device.
An increasing module 902, configured to increase the buffering duration to obtain a new buffering duration if the buffering duration is less than the decoding duration.
A processing module 903, configured to perform smoothing processing on the audio data by using a new buffer duration to obtain new audio data;
the playing module 904 plays the new audio data if it is determined that the buffering duration is greater than or equal to the decoding duration according to the new audio data.
Further, a module 902 is added, specifically configured to determine whether the audio data is normally received and transmitted.
Further, an adding module 902 is specifically configured to add the cache duration to a preset unit cache duration to obtain a new cache duration.
Further, the playing module 904 is specifically configured to obtain a measured RSSI value of the new audio data; adjusting the new cache duration according to the RSSI measured value, and acquiring the adjusted cache duration; and adopting the adjusted cache duration to carry out smoothing processing on the new audio data, and playing the audio data after the smoothing processing.
Further, the playing module 904 is specifically configured to, if the RSSI measurement value is greater than the preset RSSI reference value, take the preset unit cache duration as the adjusted cache duration; and if the RSSI measured value is less than or equal to the preset RSSI reference value, keeping the new caching duration unchanged.
Further, the playing module 904 is specifically configured to obtain a communication accuracy of the new audio data; adjusting the new cache duration according to the communication accuracy to obtain the adjusted cache duration; and smoothing the new audio data by adopting the adjusted buffer duration, and playing the smoothed audio data.
Further, the playing module 904 is specifically configured to, if the communication accuracy is greater than the preset communication accuracy reference value, take the preset unit cache duration as the adjusted cache duration; and if the communication accuracy is less than or equal to the preset communication accuracy reference value, keeping the new cache duration unchanged.
Further, the playing module 904 is specifically configured to obtain an RSSI measurement value and a communication accuracy of the new audio data; adjusting the new cache duration according to the RSSI measurement value and the communication accuracy rate, and acquiring the adjusted cache duration; and smoothing the new audio data by adopting the adjusted buffer duration, and playing the smoothed audio data.
Further, the playing module 904 is specifically configured to, if the communication accuracy is greater than the preset communication accuracy reference value, take the preset unit cache duration as the adjusted cache duration; if the communication accuracy is less than or equal to the preset communication accuracy reference value and the RSSI measured value is greater than the preset RSSI reference value, taking the preset unit cache duration as the adjusted cache duration; and if the communication accuracy is less than or equal to the preset communication accuracy reference value and the RSSI measurement value is less than or equal to the preset RSSI reference value, keeping the new cache duration unchanged.
Fig. 10 is a schematic diagram of a terminal device according to an embodiment of the present application, where the terminal device may be a device with a computing processing function.
The terminal device includes: a processor 1001, and a storage medium 1002. The processor 1001 and the storage medium 1002 are connected by a bus.
The storage medium 1002 is used for storing a program, and the processor 1001 calls the program stored in the storage medium 1002 to execute the above-described method embodiment. The specific implementation and technical effects are similar, and are not described herein again.
Optionally, the present invention also provides a storage medium comprising a program which, when executed by a processor, is adapted to perform the above-described method embodiments. In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one type of logical functional division, and other divisions may be realized in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (in english: processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

Claims (7)

1. A method for adjusting audio delay, applied to a receiving terminal, the receiving terminal wirelessly communicating with an audio transmitting device, the audio transmitting device being configured to transmit audio data, the method comprising:
acquiring the caching duration and the decoding duration of the audio data sent by the audio transmitting equipment;
if the cache duration is less than the decoding duration, increasing the cache duration to obtain a new cache duration;
adopting the new buffer duration to carry out smoothing processing on the audio data to obtain new audio data;
if the cache duration is determined to be greater than or equal to the decoding duration according to the new audio data, playing the new audio data;
wherein, before playing the new audio data, further comprising:
obtaining an RSSI (received signal strength indicator) measurement value and/or a communication correct rate of the new audio data;
adjusting the new cache duration according to the RSSI measurement value and/or the communication accuracy to obtain the adjusted cache duration;
the playing the new audio data includes:
and smoothing the new audio data by adopting the adjusted buffer duration, and playing the smoothed audio data.
2. The method of claim 1, wherein if the buffering duration is less than the decoding duration, increasing the buffering duration before obtaining a new buffering duration, further comprising:
and judging whether the audio data is normally transmitted and received.
3. The method of claim 1, wherein the increasing the buffering duration to obtain a new buffering duration comprises:
and adding the cache duration and a preset unit cache duration to obtain the new cache duration.
4. The method of claim 1, wherein the adjusting the buffering duration according to the RSSI measurement value to obtain the adjusted buffering duration comprises:
if the RSSI measured value is greater than a preset RSSI reference value, taking the preset unit cache duration as the adjusted cache duration;
and if the RSSI measured value is less than or equal to the preset RSSI reference value, keeping the new caching duration unchanged.
5. The method according to claim 1, wherein the adjusting the new buffering duration according to the communication correctness rate and obtaining the adjusted buffering duration comprises:
if the communication accuracy is greater than a preset communication accuracy reference value, taking the preset unit cache duration as the adjusted cache duration;
and if the communication accuracy is less than or equal to the preset communication accuracy reference value, keeping the new cache duration unchanged.
6. The method of claim 1, wherein the adjusting the new buffering duration according to the RSSI measurement value and the communication accuracy to obtain the adjusted buffering duration comprises:
if the communication accuracy is greater than a preset communication accuracy reference value, taking the preset unit cache duration as the adjusted cache duration;
if the communication accuracy is less than or equal to the preset communication accuracy reference value and the RSSI measurement value is greater than the preset RSSI reference value, taking the preset unit cache duration as the adjusted cache duration;
and if the communication accuracy is less than or equal to the preset communication accuracy reference value and the RSSI measurement value is less than or equal to the preset RSSI reference value, keeping the new caching duration unchanged.
7. A terminal device, comprising: a processor, a storage medium, the processor and the storage medium being connected by a bus communication, the storage medium storing program instructions executable by the processor, the processor calling the program stored in the storage medium to execute the steps of the method of adjusting audio delay according to any one of claims 1 to 6.
CN202211314960.6A 2022-10-26 2022-10-26 Method and equipment for adjusting audio time delay Active CN115378920B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211314960.6A CN115378920B (en) 2022-10-26 2022-10-26 Method and equipment for adjusting audio time delay

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211314960.6A CN115378920B (en) 2022-10-26 2022-10-26 Method and equipment for adjusting audio time delay

Publications (2)

Publication Number Publication Date
CN115378920A CN115378920A (en) 2022-11-22
CN115378920B true CN115378920B (en) 2023-04-14

Family

ID=84073207

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211314960.6A Active CN115378920B (en) 2022-10-26 2022-10-26 Method and equipment for adjusting audio time delay

Country Status (1)

Country Link
CN (1) CN115378920B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115866803B (en) * 2023-03-03 2023-05-16 深圳市迈斯高科技有限公司 Method and device for transmitting audio information by using wireless earphone

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113963680A (en) * 2021-10-19 2022-01-21 咪咕文化科技有限公司 Audio playing method, device and equipment
WO2022206487A1 (en) * 2021-03-30 2022-10-06 贵州白山云科技股份有限公司 Cache object updating method and apparatus, device, and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106131657A (en) * 2016-06-29 2016-11-16 乐视控股(北京)有限公司 Video playing control method and device
CN110430457B (en) * 2019-07-25 2021-09-10 北京奇艺世纪科技有限公司 Method and device for playing different-end audio and video and audio playing system
CN113364767B (en) * 2021-06-03 2022-07-12 北京字节跳动网络技术有限公司 Streaming media data display method and device, electronic equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022206487A1 (en) * 2021-03-30 2022-10-06 贵州白山云科技股份有限公司 Cache object updating method and apparatus, device, and storage medium
CN113963680A (en) * 2021-10-19 2022-01-21 咪咕文化科技有限公司 Audio playing method, device and equipment

Also Published As

Publication number Publication date
CN115378920A (en) 2022-11-22

Similar Documents

Publication Publication Date Title
EP3550743B1 (en) Jitter buffer control based on monitoring of delay jitter and conversational dynamics
EP2936770B1 (en) Apparatus and methods for controlling jitter buffer
CN115378920B (en) Method and equipment for adjusting audio time delay
EP3132579B1 (en) Jitter buffer level estimation
JP2006295921A (en) Method and apparatus for detecting presence or absence of wrong sequence number on state report unit in radio communication system
EP3217638B1 (en) Transferring information from a sender to a recipient during a telephone call under noisy environment
CN111199743B (en) Audio coding format determining method and device, storage medium and electronic equipment
CN109847342B (en) Network detection method and related device
EP1364542B1 (en) Method and apparatus for controlling an operative setting of a communications link
CN107979507A (en) A kind of data transmission method, device, equipment and storage medium
US20130273978A1 (en) Controlling Audio Signals
CN110035167B (en) Recording method and related device
CN111787513A (en) Method and apparatus for playing audio
CN109194998B (en) Data transmission method and device, electronic equipment and computer readable medium
CN112953847B (en) Network congestion control method and device, electronic equipment and storage medium
WO2024099035A1 (en) Parameter adjustment method and related apparatus
CN110225213B (en) Recognition method of voice call scene and audio policy server
US8238827B2 (en) Information processing apparatus
US8503945B1 (en) Measuring signal strength in a multiple-input multiple-output antenna environment
CN114666776A (en) Data transmission method, device, equipment and readable storage medium
US10812894B2 (en) Portable communication device and method of operating the same in covert operation mode
WO2022120782A1 (en) Multimedia playback synchronization
CN109743263B (en) Dynamic jitter buffering method and device and computer equipment
US20050186936A1 (en) Wireless peripheral and related system capable of indicating wireless connection status with alarm
CN114157764B (en) Method and device for selecting seat line of Vo-LTE audio/video queuing scheduler

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant