CN112860211B - Method, device, terminal and storage medium for determining time delay - Google Patents

Method, device, terminal and storage medium for determining time delay Download PDF

Info

Publication number
CN112860211B
CN112860211B CN202110118020.9A CN202110118020A CN112860211B CN 112860211 B CN112860211 B CN 112860211B CN 202110118020 A CN202110118020 A CN 202110118020A CN 112860211 B CN112860211 B CN 112860211B
Authority
CN
China
Prior art keywords
time
time delay
audio
determining
audio data
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
CN202110118020.9A
Other languages
Chinese (zh)
Other versions
CN112860211A (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.)
Chengdu Jimi Technology Co Ltd
Original Assignee
Chengdu Jimi Technology 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 Chengdu Jimi Technology Co Ltd filed Critical Chengdu Jimi Technology Co Ltd
Priority to CN202110118020.9A priority Critical patent/CN112860211B/en
Publication of CN112860211A publication Critical patent/CN112860211A/en
Application granted granted Critical
Publication of CN112860211B publication Critical patent/CN112860211B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output
    • G06F3/165Management of the audio stream, e.g. setting of volume, audio stream path

Abstract

The embodiment of the invention discloses a method, a device, a terminal and a storage medium for determining time delay, wherein the method comprises the following steps: sending preset audio data to the external audio playing device through the audio module; determining a first time at which the preset audio data is sent out of the audio module; determining a second time when the preset audio data reaches the recording device; judging whether a cache in the transmission process of the preset audio data is full, and if the cache in the transmission process is not full, determining the audio time length based on the cache in the transmission process; a preliminary time delay is determined based on the first time, the second time, the audio duration, and the inherent time delay. The scheme finally determines the accurate time delay of the external audio playing device based on a plurality of factors, and is favorable for realizing sound and picture synchronization based on the accurate time delay subsequently.

Description

Method, device, terminal and storage medium for determining time delay
Technical Field
The present invention relates to the technical field of determining audio playing time delay, and in particular, to a method, an apparatus, a terminal and a storage medium for determining time delay.
Background
Terminal equipment such as a mobile phone, a computer and the like can be externally connected with audio equipment in order to obtain a better sound effect, and the mode of specifically connecting the external audio equipment can adopt two modes of wired connection or wireless connection, but the sound delay of different external audio equipment is different, and the sound delay can cause the problem that sound and pictures are asynchronous when a video is played; in the process, the terminal equipment cannot give consideration to all the equipment to adjust the sound and picture synchronization, so that the sound and picture asynchronism caused by the delay difference of the external audio equipment is a difficult point of the industry all the time.
There is a need for a solution to the problems of the prior art.
Disclosure of Invention
In view of this, the present invention provides a method, an apparatus, a terminal and a storage medium for determining a time delay. Specifically, the present invention proposes the following specific examples:
the embodiment of the invention provides a method for determining time delay, which is applied to a system provided with terminal equipment, external audio playing equipment and recording equipment, wherein the terminal equipment is connected with the external audio playing equipment, an audio module is arranged in the terminal equipment, and the recording equipment is used for acquiring audio data played by the external audio playing equipment; the method comprises the following steps:
sending preset audio data to the external audio playing device through the audio module;
determining a first time at which the preset audio data is sent out from the audio module;
determining a second time when the preset audio data reaches the recording device;
judging whether the cache in the transmission process of the preset audio data is full;
if the cache in the transmission process is not full, determining the audio time length based on the cache in the transmission process;
and determining the preliminary time delay of the external audio playing device based on the first time, the second time, the audio time and the inherent time delay of the terminal device.
In a specific embodiment, before sending preset audio data to the external audio playing device through the audio module, the method further includes:
and clearing the cache of the system.
In a specific embodiment, the clearing of the cache of the system is implemented by controlling the external audio playing device to be turned on after being turned off.
In a specific embodiment, the method further comprises the following steps: and if the cache in the transmission process is full, executing the operation of clearing the cache of the system.
In a specific embodiment, the method further comprises the following steps: obtaining a plurality of the preliminary time delays; and determining the final time delay of the external audio playing equipment based on a plurality of preliminary time delays.
In a specific embodiment, the "determining a final latency of the external audio playing device based on a plurality of the preliminary latencies" includes:
carrying out average calculation on a plurality of preliminary time delays to obtain an average time delay;
judging whether the difference value between each preliminary time delay and the average time delay is larger than a preset threshold value or not;
if the judgment result is yes, setting the preliminary time delay as invalid data; if the judgment result is negative, setting the preliminary time delay as effective data;
and averaging all the effective data to obtain an average value as the final time delay of the external audio playing equipment.
The preset audio data are sine wave signals with preset duration and preset frequency; the determining the second time when the preset audio data reaches the recording device includes:
identifying audio data recorded by the recording equipment to determine whether the audio data is the preset audio data;
and if so, acquiring the time of the preset audio data reaching the recording equipment, and setting the time as a second time.
In a specific embodiment, the preliminary delay and/or the final delay are/is associated with the external audio playing device and then stored in the system and/or uploaded to a cloud server; the final time delay is obtained by a plurality of the preliminary time delays.
In a specific embodiment, before sending preset audio data to the external audio playing device through the audio module, the method further includes: starting the recording device; and the recording equipment is tightly attached to the external audio playing equipment.
The embodiment of the invention also discloses a method for synchronizing the sound and the picture, which comprises the following steps:
carrying out sound and picture synchronization according to the initial time delay and/or the final time delay obtained by the method; the final time delay is obtained by a plurality of the preliminary time delays.
The embodiment of the invention also provides a device for determining the time delay, which is applied to a system provided with terminal equipment, external audio playing equipment and recording equipment, wherein the terminal equipment is connected with the external audio playing equipment, an audio module is arranged in the terminal equipment, and the recording equipment is used for acquiring audio data played by the external audio playing equipment; the device includes:
the transmitting module is used for transmitting preset audio data to the external audio playing equipment through a data transmitting end of the audio module;
the first determining module is used for determining the first time when the preset audio data is sent out from the audio module;
the second determining module is used for determining a second time when the preset audio data reaches the recording equipment;
the judging module is used for judging whether the cache in the preset audio data transmission process is full or not;
a third confirmation module, configured to determine, when the buffer in the transmission process is not full, an audio duration based on the buffer in the transmission process;
and the initial time delay module is used for determining the initial time delay of the external audio playing device based on the first time, the second time, the audio time and the inherent time delay of the terminal device.
In a specific embodiment, the embodiment of the present invention further provides a terminal, which includes a processor and a memory, where the memory stores an application program, and the application program executes the method for determining a time delay when running on the processor.
In a specific embodiment, the embodiment of the present invention further provides a storage medium, where an application program is stored in the storage medium, and the application program, when running on a processor, executes the method for determining a time delay.
In a specific embodiment, the embodiment of the present invention further provides a system for determining a time delay, including a terminal device, an external audio playing device, and a recording device; the terminal equipment is internally provided with an audio module, and the recording equipment is used for acquiring audio data played by the external audio playing equipment; the terminal equipment sends preset audio data to the external audio playing equipment through the audio module; the terminal equipment determines the first time when the preset audio data are sent out from the audio module; the recording device determines a second time when the preset audio data reaches the recording device; the terminal equipment judges whether the cache in the transmission process of the preset audio data is full or not; if the cache in the transmission process is not full, determining the audio time length based on the cache in the transmission process; and the terminal equipment determines the preliminary time delay of the external audio playing equipment based on the first time, the second time, the audio time and the inherent time delay of the terminal equipment.
Compared with the prior art, the invention has the following technical effects:
the scheme of the invention analyzes the factors of the external audio playing device for generating time delay from multiple aspects, finally determines the accurate time delay of the external audio playing device based on the factors, and is beneficial to realizing sound and picture synchronization based on the accurate time delay subsequently.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings required to be used in the embodiments will be briefly described below, and 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 of the present invention. Like components are numbered similarly in the various figures.
FIG. 1 shows a flow diagram of a method of determining a time delay;
FIG. 2 illustrates a system flow diagram of a method of determining latency;
FIG. 3 is a schematic diagram of an apparatus for determining latency;
fig. 4 shows a schematic structural diagram of a terminal.
Illustration of the drawings:
201-a sending module; 202-a first determination module; 203-a second determination module; 204-an execution module; 205-a third confirmation module; 206-initial delay module.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments.
The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
Hereinafter, the terms "including", "having", and their derivatives, which may be used in various embodiments of the present invention, are only intended to indicate specific features, numbers, steps, operations, elements, components, or combinations of the foregoing, and should not be construed as first excluding the existence of, or adding to, one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing.
Furthermore, the terms "first," "second," "third," and the like are used solely to distinguish one from another and are not to be construed as indicating or implying relative importance.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which various embodiments of the present invention belong. The terms (such as those defined in commonly used dictionaries) should be interpreted as having a meaning that is consistent with their contextual meaning in the relevant art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein in various embodiments of the present invention.
Example 1
Embodiment 1 of the present invention discloses a method for determining a time delay, which is applied to a system provided with a terminal device, an external audio playing device, and a recording device, as shown in fig. 1, wherein the terminal device is connected with the external audio playing device, and an audio module is arranged in the terminal device, as shown in fig. 2; the recording equipment is used for acquiring audio data played by the external audio playing equipment; the method comprises the following steps:
step S100, sending preset audio data to an external audio playing device through an audio module;
specifically, the preset audio data is a sine wave signal with a preset duration and a preset frequency. Further, the preset audio data may be a sine wave with a playing time of 50ms and a frequency of 1 KHZ.
Further, before step S100, the method further includes: starting the recording equipment; the recording equipment is tightly attached to the external audio playing equipment; specifically, the terminal device is connected with an external audio playing device, the external audio playing device is provided with a recording device closely attached to the external audio playing device, and after the recording device is started, the audio played by the external audio playing device can be recorded at the first time, so that the whole audio delay measuring and calculating loop is reduced, and the error is finally reduced.
In addition, the recording device can be a module with a recording function in the terminal device, and can also be an external device with a recording function, so as to be connected with the terminal device when needed; in a specific application scenario, since the terminal device is generally configured with a remote controller, and most of the existing remote controllers have a recording function, recorded sound can be returned to the terminal device, so that recording can be performed by using the remote controller (for example, a bluetooth remote controller); specifically, taking a bluetooth remote controller as an example, when the delay detection is started, the terminal device sends a command of opening the recording to the bluetooth remote controller through a bluetooth GATT protocol, so as to drive the remote controller to record.
Specifically, before step S100, the method further includes: clearing the cache of the system; further, the buffer memory of the system is cleared by controlling the external audio playing device to be closed first and then opened, specifically, the external audio playing device can be controlled to be closed first and then opened by the drive of the external audio playing device, and in a specific application scene, an out _ standby function of the drive of the external audio playing device on the terminal device can be actively called to temporarily close the external audio playing device, and then the buffer memory of the system is cleared by opening the external audio playing device. In some cases, if the external audio playing device is not turned off, some audio data may be buffered on a transmission path from the terminal device to the external audio playing device, and when the audio is played, the external audio playing device plays the subsequent data only after playing the buffered audio data, which may result in an excessive delay in measurement; if the external audio playing device is just connected with the terminal device, the clearing operation is not required to be executed.
S200, determining the first time for sending the preset audio data from the audio module;
specifically, the data interface (e.g., the audio out corresponding to the audio hall layer, the last end of the audio playing of the whole terminal device) is closest to the start of the path for transmitting the preset audio data by the audio module, and by performing detection on the data interface, the time for sending the preset audio data from the audio module can be obtained (also described in the above example, for example, the arrival time of the sine wave is analyzed and denoted as T1), and the loop of the whole audio delay measurement can be reduced, so as to reduce the error.
Step S300, determining a second time when the preset audio data reaches the recording device;
specifically, the preset audio data may be a sine wave signal with a preset duration and a preset frequency; thus, step S300 includes:
step S301, identifying frequency and/or waveform of audio data recorded by a recording device to determine whether the audio data is preset audio data; specifically, for example, the preset audio data is a sine wave with a frequency of 1KHZ, and the identified audio can be graphically displayed; taking frequency identification as an example, judging whether the frequency of the graphical audio is 1KHZ, and if so, determining that the identified audio is preset audio data; and then, taking the waveform mode for identification as an example, judging whether the waveform of the graphical audio is a sine wave, and only when the waveform of the graphical audio is the sine wave, determining that the identified audio is preset audio data. As shown in fig. 2, the specific identification is performed by using frequency domain analysis to identify the audio data recorded by the recording device.
Step S302, if the judgment result is yes, acquiring the time when the preset audio data reaches the recording equipment, and setting the time as a second time;
step S303, if the determination result is no, step S301 is executed.
Specifically, still in the above example, the audio data obtained by the recording device is subjected to frequency domain analysis to determine whether the audio data is a 1KHZ sine wave signal, and if not, the audio data is not sent to the audio time measurement unit (as shown in fig. 2, the second audio time measurement is correspondingly performed), where the specific frequency domain analysis is to avoid interference caused by the ambient sound entering the system through the recording device.
Specifically, the recording device is tightly attached to the external audio playing device, so that the time (for example, the recording time of the incoming recording data is T2) when the preset audio data reaches the recording device is determined based on the recording device (further, for example, the position of the audio in corresponding to the audio hal layer of the recording device, that is, the recording head of the whole terminal device), and the loop of the whole audio delay measurement can be reduced to reduce the error.
Step S400, judging whether the cache in the transmission process of the preset audio data is full;
specifically, if the cache in the transmission process is full, the operation of "clearing the cache of the system" is executed.
Step S500, if the cache in the transmission process is not full, determining the audio time length based on the transmission cache;
specifically, the buffer condition in the audio data transmission process is monitored in real time during the above process, if the buffer is fully filled, the detection is terminated, and the delay detection is restarted from step S100; if the audio frequency is not full, the audio frequency time length of the buffers is calculated according to the size of the buffers and is recorded as Tb. The buffer is added into the audio buffer, so that the data accuracy is improved.
Step S600, determining a preliminary time delay of an external audio playing device based on the first time, the second time, the audio time and the inherent time delay of the terminal device;
specifically, the following description will be given by taking the example as follows: the delay from playing to recording loop is recorded as Tc by subtracting the first time T1 from the second time T2. Because the delay from the terminal to play the data to the recorded data loop except the external sound box is unknown, the delay is the module of the terminal device, the audio delay is known, and the sum of the known audio delays (i.e. the inherent delay of the terminal device) is recorded as Ti. The preliminary delay Td = Tc-Ti-Tb of the external audio playing device is obtained.
Further, the scheme also comprises:
acquiring a plurality of preliminary time delays;
and determining the final time delay of the external audio playing equipment based on the plurality of preliminary time delays.
Specifically, the plurality of preliminary time delays are obtained by repeatedly executing steps S100 to S600.
The final time delay is obtained by the following steps:
carrying out average calculation on a plurality of preliminary time delays to obtain average time delay;
judging whether the difference value between each preliminary time delay and the average time delay is larger than a preset threshold value or not;
if the judgment result is yes, setting the preliminary time delay as invalid data; if the judgment result is negative, setting the preliminary time delay as valid data;
and averaging all the effective data to obtain an average value as the final time delay of the external audio playing equipment.
Specifically, in order to reduce the error and make the measured delay more accurate, the steps S100 to S600 are repeatedly executed for a plurality of times, specifically, for example, five times may be executed to obtain five preliminary delays; analyzing the five preliminary time delays, if the difference value between the data and the average value of the five preliminary time delays exceeds 50ms, determining the data as invalid data (the delay is too large because the wireless transmission is easily interfered by the environment), otherwise, determining the data as valid data, and finally, averaging the valid data, namely, the final time delay of the external audio playing equipment.
Further, the scheme also comprises: and associating the preliminary time delay and/or the final time delay with an external audio playing device, and then storing the time delay in the system and/or uploading the time delay to a cloud server.
And storing the preliminary time delay and/or the final time delay into the system, and allowing a standard sound and picture synchronization program of an Android or other system to acquire the preliminary time delay or the final time delay of an external audio playing device so as to adjust sound and picture synchronization. Therefore, for different external audio playing devices such as Bluetooth sound boxes, the time delays of the Bluetooth sound boxes of different models are inconsistent, so that the time delay is measured by the scheme when the external audio playing devices are connected for the first time; the table look-up operation can also be carried out through the detection model during connection, and after the user connects for the first time, the delay measured by the scheme is started to be uploaded to the cloud; other users are connected by using the Bluetooth loudspeaker box, and if the cloud end already has the record of the loudspeaker box, the delay is directly introduced.
Example 2
The embodiment 2 of the invention also discloses a method for synchronizing the sound and the picture, which comprises the following steps:
performing sound-picture synchronization according to the initial time delay or the final time delay obtained by the method in the embodiment 1; the final delay is derived from a plurality of preliminary delays.
Specifically, after the preliminary delay is obtained, the time for playing the picture and the audio can be adjusted based on the preliminary delay, so that the time synchronization of the picture and the audio is realized, and the film watching experience is improved.
Example 3
The embodiment 2 of the invention also discloses a device for determining the time delay, which is applied to a system provided with terminal equipment, external audio playing equipment and recording equipment, wherein the terminal equipment is connected with the external audio playing equipment, an audio module is arranged in the terminal equipment, and the recording equipment is used for acquiring audio data played by the external audio playing equipment; as shown in fig. 3, the apparatus includes:
a sending module 201, configured to send preset audio data to an external audio playing device through an audio module;
a first determining module 202, configured to determine a first time when preset audio data is sent from an audio module;
a second determining module 203, configured to determine a second time when the preset audio data reaches the sound recording device;
the execution module 204 is configured to determine whether a buffer in a transmission process of preset audio data is full;
a third determining module 205, configured to determine, when the buffer in the transmission process is not full, an audio duration based on the buffer in the transmission process;
an initial delay module 206, configured to determine an initial delay of the external audio playing device based on the first time, the second time, the audio duration, and the inherent delay of the terminal device.
In a specific embodiment, the apparatus further comprises: and the clearing module is used for clearing the cache of the system. Furthermore, the cache of the system is cleared by controlling the external audio playing device to be closed and then opened.
In a specific embodiment, the apparatus further comprises: and the execution module is used for starting the clearing module when the cache in the transmission process is full.
In a specific embodiment, the apparatus further comprises: a final delay module for obtaining a plurality of preliminary delays; and determining the final time delay of the external audio playing equipment based on the plurality of preliminary time delays.
The final time delay module determines a final time delay of the external audio playing device based on a plurality of preliminary time delays, and the final time delay module comprises: carrying out average calculation on a plurality of preliminary time delays to obtain an average time delay; judging whether the difference value between each preliminary time delay and the average time delay is larger than a preset threshold value or not; if the judgment result is yes, setting the preliminary time delay as invalid data; if the judgment result is negative, setting the preliminary time delay as valid data; and averaging all the effective data to obtain an average value as the final time delay of the external audio playing equipment.
In a specific embodiment, the preset audio data is a sine wave signal with a preset duration and a preset frequency;
the second determination module 203 includes:
the identification module is used for identifying the frequency and/or waveform of the audio data recorded by the recording equipment so as to determine whether the audio data is preset audio data;
the time module is used for acquiring the time when the preset audio data reaches the recording equipment and setting the time as second time when the judgment result is yes;
and the processing module is used for executing the identification module when the judgment result is negative.
In a specific embodiment, the method further comprises the following steps: the storage module is used for associating the preliminary time delay and/or the final time delay with an external audio playing device and then storing the time delay in the system and/or uploading the time delay to the cloud server; the final delay is derived from a plurality of preliminary delays.
In a specific embodiment, the method further comprises the following steps:
the starting module is used for starting the recording equipment; wherein, the recording equipment is clung to the external audio playing equipment.
Example 4
Embodiment 4 of the present invention further discloses a terminal, as shown in fig. 4, which includes a processor and a memory, where the memory stores an application program, and the method for determining a time delay in embodiment 1 is executed when the application program runs on the processor. Specifically, the terminal may include, for example, a projector, a television, or a laser television, so that when video playing is performed, the time delay may be determined based on the scheme, and then adjustment may be performed based on the determined time delay, thereby realizing sound and picture synchronization.
Example 5
Embodiment 5 of the present invention further discloses a storage medium, where an application program is stored in the storage medium, and the method for determining the time delay in embodiment 1 is executed when the application program runs on a processor.
Example 6
The embodiment 6 of the invention also discloses a system for determining the time delay, which comprises terminal equipment, external audio playing equipment and recording equipment; the terminal equipment is internally provided with an audio module, and the recording equipment is used for acquiring audio data played by external audio playing equipment;
the terminal equipment sends preset audio data to the external audio playing equipment through the audio module;
the method comprises the steps that the terminal equipment determines the first time when preset audio data are sent out from an audio module;
the recording device determines a second time when the preset audio data reaches the recording device;
the terminal equipment judges whether a cache in the transmission process of the preset audio data is full; if the cache in the transmission process is not full, determining the audio time length based on the cache in the transmission process;
the terminal equipment determines the initial time delay of the external audio playing equipment based on the first time, the second time, the audio time and the inherent time delay of the terminal equipment.
Specifically, the terminal device is further configured to execute other related method steps, and for the specific other related method steps, reference is made to the record in embodiment 1, which is not described herein again.
The embodiment of the invention discloses a method and a device for determining time delay, a terminal and a storage medium, which are applied to a system provided with terminal equipment and external audio playing equipment, wherein the terminal equipment is connected with the external audio playing equipment, and an audio module is arranged in the terminal equipment; the method comprises the following steps: step S100, sending preset audio data to an external audio playing device through an audio module; s200, determining the first time for sending the preset audio data from the audio module; step S300, determining a second time when the preset audio data reaches the recording device; step S400, judging whether a transmission cache in the transmission process of the preset audio data is full; step S500, if the transmission cache is not full, determining the audio time length based on the transmission cache; step S600, determining a preliminary time delay of the external audio playing device based on the first time, the second time, the audio time and the inherent time delay of the terminal device. The scheme of the invention analyzes the factors of the external audio playing equipment generating time delay from multiple aspects, finally determines the accurate time delay of the external audio playing equipment based on multiple factors, and is beneficial to realizing sound and picture synchronization based on the accurate time delay subsequently.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative and, for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, each functional module or unit in each embodiment of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention or a part of the technical solution that contributes to the prior art in essence can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a smart phone, a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method 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.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention.

Claims (14)

1. A method for determining time delay is characterized in that the method is applied to a system provided with terminal equipment, external audio playing equipment and recording equipment, wherein an audio module is arranged in the terminal equipment, and the recording equipment is used for acquiring audio data played by the external audio playing equipment; the method comprises the following steps:
sending preset audio data to the external audio playing device through the audio module;
determining a first time at which the preset audio data is sent out of the audio module;
determining a second time when the preset audio data reaches the recording device;
judging whether the cache in the preset audio data transmission process is full or not;
if the cache in the transmission process is not full, determining the audio time length based on the cache in the transmission process;
and determining the preliminary time delay of the external audio playing device based on the first time, the second time, the audio time and the inherent time delay of the terminal device.
2. The method of claim 1, wherein before sending preset audio data to the external audio playing device through the audio module, the method further comprises:
and clearing the cache of the system.
3. The method of claim 2, wherein the clearing the cache of the system is performed by controlling the external audio playing device to be turned on after being turned off.
4. The method of claim 2, further comprising:
and if the cache in the transmission process is full, executing the operation of clearing the cache of the system.
5. The method of claim 1, further comprising:
obtaining a plurality of the preliminary time delays;
and determining the final time delay of the external audio playing equipment based on a plurality of preliminary time delays.
6. The method of claim 5, wherein determining the final latency of the external audio playback device based on the plurality of preliminary latencies comprises:
carrying out average calculation on a plurality of preliminary time delays to obtain an average time delay;
judging whether the difference value between each preliminary time delay and the average time delay is larger than a preset threshold value or not;
if the judgment result is yes, setting the preliminary time delay as invalid data; if the judgment result is negative, setting the preliminary time delay as effective data;
and averaging all the effective data to obtain an average value as the final time delay of the external audio playing equipment.
7. The method of claim 1, wherein the predetermined audio data is a sine wave signal with a predetermined duration and a predetermined frequency;
the determining the second time when the preset audio data reaches the recording device includes:
identifying the frequency and/or waveform of the audio data recorded by the recording equipment to determine whether the audio data is the preset audio data;
and if so, acquiring the time of the preset audio data reaching the recording equipment, and setting the time as a second time.
8. The method of claim 1, further comprising:
associating the preliminary time delay and/or the final time delay with the external audio playing equipment, and then storing the time delay and/or the final time delay in the system and/or uploading the time delay to a cloud server; the final time delay is obtained by a plurality of the preliminary time delays.
9. The method of claim 1, wherein before sending preset audio data to the external audio playing device through the audio module, the method further comprises:
starting the recording device; wherein, the recording equipment is clung to the external audio playing equipment.
10. A method for synchronizing sound and pictures is characterized by comprising the following steps:
performing sound and picture synchronization on the initial time delay or the final time delay obtained according to the method of any one of claims 1 to 9; the final time delay is obtained by a plurality of the preliminary time delays.
11. A device for determining time delay is characterized by being applied to a system provided with a terminal device, an external audio playing device and a recording device, wherein the terminal device is connected with the external audio playing device, an audio module is arranged in the terminal device, and the recording device is used for acquiring audio data played by the external audio playing device; the device includes:
the sending module is used for sending preset audio data to the external audio playing equipment through the audio module;
the first determining module is used for determining the first time when the preset audio data is sent out from the audio module;
the second determining module is used for determining a second time when the preset audio data reaches the recording equipment;
the judging module is used for judging whether the cache in the preset audio data transmission process is full or not;
a third confirmation module, configured to determine, when the buffer in the transmission process is not full, an audio duration based on the buffer in the transmission process;
and the initial time delay module is used for determining the initial time delay of the external audio playing device based on the first time, the second time, the audio time and the inherent time delay of the terminal device.
12. A terminal comprising a processor and a memory, the memory having an application stored thereon, the application when running on the processor performing the method of determining a time delay of any one of claims 1 to 9.
13. A storage medium having an application stored thereon, wherein the application, when executed on a processor, performs the method of determining a time delay of any one of claims 1-9.
14. A system for determining time delay is characterized by comprising terminal equipment, external audio playing equipment and recording equipment; the terminal equipment is internally provided with an audio module, and the recording equipment is used for acquiring audio data played by the external audio playing equipment;
the terminal equipment sends preset audio data to the external audio playing equipment through the audio module;
the terminal equipment determines the first time when the preset audio data are sent out from the audio module;
the recording device determines a second time when the preset audio data reaches the recording device;
the terminal equipment judges whether the cache in the transmission process of the preset audio data is full or not; if the cache in the transmission process is not full, determining the audio time length based on the cache in the transmission process;
and the terminal equipment determines the preliminary time delay of the external audio playing equipment based on the first time, the second time, the audio time and the inherent time delay of the terminal equipment.
CN202110118020.9A 2021-01-28 2021-01-28 Method, device, terminal and storage medium for determining time delay Active CN112860211B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110118020.9A CN112860211B (en) 2021-01-28 2021-01-28 Method, device, terminal and storage medium for determining time delay

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110118020.9A CN112860211B (en) 2021-01-28 2021-01-28 Method, device, terminal and storage medium for determining time delay

Publications (2)

Publication Number Publication Date
CN112860211A CN112860211A (en) 2021-05-28
CN112860211B true CN112860211B (en) 2022-12-27

Family

ID=75987604

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110118020.9A Active CN112860211B (en) 2021-01-28 2021-01-28 Method, device, terminal and storage medium for determining time delay

Country Status (1)

Country Link
CN (1) CN112860211B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113891131A (en) * 2021-09-29 2022-01-04 四川长虹电器股份有限公司 Video playing method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101916577A (en) * 2010-08-19 2010-12-15 北京中星微电子有限公司 Method and device for synchronously playing audio and video
CN107509100A (en) * 2017-09-15 2017-12-22 深圳国微技术有限公司 Audio and video synchronization method, system, computer installation and computer-readable recording medium
WO2019098536A1 (en) * 2017-11-16 2019-05-23 삼성전자주식회사 Electronic device and control method thereof
CN111277885A (en) * 2020-03-09 2020-06-12 北京三体云时代科技有限公司 Audio and video synchronization method and device, server and computer readable storage medium
CN111479154A (en) * 2020-04-03 2020-07-31 海信视像科技股份有限公司 Equipment and method for realizing sound and picture synchronization and computer readable storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7353284B2 (en) * 2003-06-13 2008-04-01 Apple Inc. Synchronized transmission of audio and video data from a computer to a client via an interface
US20060209210A1 (en) * 2005-03-18 2006-09-21 Ati Technologies Inc. Automatic audio and video synchronization
CN106686438B (en) * 2016-12-29 2019-12-13 北京奇艺世纪科技有限公司 method, device and system for synchronously playing audio images across equipment
CN109525881A (en) * 2018-11-29 2019-03-26 青岛海信电器股份有限公司 Sound draws synchronous method, device and equipment
CN110430457B (en) * 2019-07-25 2021-09-10 北京奇艺世纪科技有限公司 Method and device for playing different-end audio and video and audio playing system
CN110830832B (en) * 2019-10-31 2022-06-14 广州市百果园信息技术有限公司 Audio playing parameter configuration method of mobile terminal and related equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101916577A (en) * 2010-08-19 2010-12-15 北京中星微电子有限公司 Method and device for synchronously playing audio and video
CN107509100A (en) * 2017-09-15 2017-12-22 深圳国微技术有限公司 Audio and video synchronization method, system, computer installation and computer-readable recording medium
WO2019098536A1 (en) * 2017-11-16 2019-05-23 삼성전자주식회사 Electronic device and control method thereof
CN111277885A (en) * 2020-03-09 2020-06-12 北京三体云时代科技有限公司 Audio and video synchronization method and device, server and computer readable storage medium
CN111479154A (en) * 2020-04-03 2020-07-31 海信视像科技股份有限公司 Equipment and method for realizing sound and picture synchronization and computer readable storage medium

Also Published As

Publication number Publication date
CN112860211A (en) 2021-05-28

Similar Documents

Publication Publication Date Title
US9723180B2 (en) Device and method for correcting lip sync problems on display devices
JP2019185011A (en) Processing method for waking up application program, apparatus, and storage medium
EP3163887A1 (en) Method and apparatus for performing media synchronization
JP6703627B2 (en) Device and related methods
CN104038827A (en) Multimedia playing method and device
CN103546839A (en) Audio signal processing system and echo signal removing method thereof
CN112860211B (en) Method, device, terminal and storage medium for determining time delay
CN112261461B (en) Bluetooth sound and picture synchronization method and device, display equipment and readable storage medium
WO2020052062A1 (en) Detection method and device
TWI648732B (en) Method for synchronously accessing audio data and audio playback system using the same
CN101909191A (en) Video processing equipment and method for processing video frequency
US7929827B2 (en) Information recording apparatus
EP3174312A1 (en) Playback method and playback device for a multiroom sound system
US11956621B2 (en) Information processing apparatus, information processing method, and information processing program
JP5031039B2 (en) Method and system for accurate synchronization of subframes
CN102479515A (en) Audio processing device, audio processing method and audio acquisition apparatus
CN116437068A (en) Lip synchronization test method and device, electronic equipment and storage medium
CN107087210A (en) The method and terminal of video broadcasting condition are judged based on cache-time
CN110622517A (en) Video processing method and device
JP7087779B2 (en) Terminal devices, conference systems, terminal device control methods, and programs
US20220166939A1 (en) Information processing apparatus, method, and recording medium
TWI581626B (en) System and method for processing media files automatically
US10855435B2 (en) Communication apparatus, generated data size controlling method, and program
WO2005104125A1 (en) Record reproducing device, simultaneous record reproduction control method and simultaneous record reproduction control program
US20190012135A1 (en) Automatic playback time adjustment

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