Audio-video synchronous playing method and electronic device

By obtaining the timestamp difference to determine the audio and video desynchronization status, and controlling the playback rate or transmission method, the synchronization problem between the car speaker and VR device is solved, thus improving the immersive viewing experience.

CN123164263APending Publication Date: 2026-11-24GEER INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510667937.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-22
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

There is a delay in the audio and video playback between the car speaker and the VR device, resulting in poor synchronization and affecting the immersive viewing experience.

Method used

By obtaining the timestamp difference of electronic devices, the asynchronous state of audio and video can be determined, and the playback rate or transmission method can be controlled according to the asynchronous state to reduce the time difference and achieve audio and video synchronization.

Benefits of technology

It improves the synchronization of audio and video, enhancing the user's immersive viewing experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123164263A_ABST
    Figure CN123164263A_ABST
Patent Text Reader

Abstract

This application discloses an audio and video synchronized playback method and electronic device, relating to the field of audio and video processing. The audio and video data includes multiple video frames and multiple audio frames. The multiple video frames are played through a first electronic device, and the multiple audio frames are played through a second electronic device. The method includes: obtaining a first timestamp of the video frame currently being played by the first electronic device, and obtaining a second timestamp of the audio frame currently being played by the second electronic device; if the absolute time difference between the second timestamp and the first timestamp is greater than or equal to a first time threshold, determining an asynchrony state between the audio playback and the video playback based on the time difference between the second timestamp and the first timestamp; and controlling the playback of the audio and video data to reduce the time difference based on the asynchrony state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of audio and video processing, and more specifically, to a method and electronic device for synchronized audio and video playback. Background Technology

[0002] VR devices and car speakers can work together to create an immersive viewing experience. In this process, the VR device is responsible for generating and displaying immersive visual content, while the car speaker receives the audio data sent by the VR device, decodes the audio data, and plays it, enhancing the user's auditory experience.

[0003] However, car speakers typically receive audio data from VR devices via Bluetooth or WiFi. There is a certain delay between the audio and video data received by the car speakers and the VR device's rendering. For example, Bluetooth connections have a delay of 100-300ms, while WiFi connections, although they can reduce the delay, are still quite noticeable. This results in audio and video playback being out of sync, causing a sense of disconnect when watching movies and affecting the immersive experience. Summary of the Invention

[0004] One objective of this application is to provide a new technical solution for audio and video synchronous playback, so as to improve the playback synchronization between VR images and in-vehicle speaker audio, and enhance the user's immersive viewing experience.

[0005] According to a first aspect of this application, a method for synchronized audio and video playback is provided, wherein the audio and video data includes multiple video frames and multiple audio frames, the multiple video frames are played through a first electronic device, and the multiple audio frames are played through a second electronic device, the method comprising:

[0006] Obtain the first timestamp of the video frame currently being played by the first electronic device, and obtain the second timestamp of the audio frame currently being played by the second electronic device;

[0007] If the absolute time difference between the second timestamp and the first timestamp is greater than or equal to the first time threshold, the asynchronous state of audio playback relative to video playback is determined based on the time difference between the second timestamp and the first timestamp.

[0008] Based on the asynchronous state, the playback of the audio and video data is controlled to reduce the time difference.

[0009] Optionally, determining the asynchronous state of audio playback relative to video playback based on the time difference between the second timestamp and the first timestamp includes:

[0010] If the time difference between the second timestamp and the first timestamp is greater than or equal to the first time threshold, the asynchronous state is determined to be audio ahead.

[0011] If the time difference between the second timestamp and the first timestamp is less than or equal to the second time threshold, the asynchronous state is determined to be audio lag; wherein the first time threshold is greater than the second time threshold.

[0012] Optionally, controlling the playback of the audio and video data according to the asynchronous state includes:

[0013] When the asynchrony state is audio ahead, a first target operation or a second target operation is performed to make the absolute time difference between the second timestamp and the first timestamp less than the first time threshold; wherein, the first target operation is used to reduce the playback rate of the audio frame played by the second electronic device, and the second target operation is used to increase the playback rate of the video frame played by the first electronic device.

[0014] In the case of audio lag in the asynchronous state, a third target operation or a fourth target operation is performed to make the absolute time difference between the second timestamp and the first timestamp less than the first time threshold; wherein, the third target operation is used to reduce the playback rate of video frames played by the first electronic device, and the fourth target operation is used to increase the playback rate of audio frames played by the second electronic device.

[0015] Optionally, if the absolute time difference between the second timestamp and the first timestamp is greater than or equal to a first time threshold, the method further includes:

[0016] The system obtains a first timestamp sequence corresponding to multiple video frames played by the first electronic device within a set time period, and obtains a second timestamp sequence corresponding to multiple audio frames played by the second electronic device within the set time period; wherein, the set time period is a time period of a set duration with the current time as the end time.

[0017] The time difference sequence is determined based on the time difference between the second timestamp and the first timestamp in the same order in the second timestamp sequence and the first timestamp sequence.

[0018] Based on the time difference sequence, determine the type of time series deviation;

[0019] Based on the timing deviation type, perform the target synchronization process corresponding to the timing deviation type.

[0020] Optionally, determining the time series deviation type based on the time difference sequence includes:

[0021] If the absolute time difference of any time difference in the time difference sequence is less than or equal to a third time threshold, and the average time difference of the time difference sequence is less than or equal to a fourth time threshold, the timing deviation type is determined to be instantaneous jitter; wherein the fourth time threshold is less than the third time threshold.

[0022] When the time difference sequence is a continuously increasing or continuously decreasing time difference, the time series deviation type is determined to be a trend-based shift.

[0023] Optionally, the step of performing target synchronization processing corresponding to the timing deviation type includes:

[0024] If the timing deviation is determined to be instantaneous jitter, increase the amount of data in the short-time buffer.

[0025] If the timing deviation type is determined to be a directional shift, a fifth objective operation is performed; wherein the fifth objective operation is at least one of the following:

[0026] Trigger clock synchronization calibration between the first electronic device and the second electronic device;

[0027] If the current audio transmission mode is high latency mode, switch the audio transmission mode to low latency mode.

[0028] Optionally, determining the time series deviation type based on the time difference sequence includes:

[0029] If the absolute value of the time change between two adjacent time differences in the time difference sequence is greater than or equal to a fifth time threshold, the time series deviation type is determined to be continuous fluctuation; wherein, the fifth time threshold is greater than the first time threshold.

[0030] Optionally, the step of performing target synchronization processing corresponding to the timing deviation type includes:

[0031] If the timing deviation is determined to be a continuous fluctuation, a sixth objective operation is performed to reduce the continuous fluctuation.

[0032] Optionally, there may be multiple second electronic devices, and any audio frame may be played through at least one second electronic device, with each second electronic device corresponding to one audio channel.

[0033] According to a second aspect of this application, an electronic device is provided, including a memory and a processor, the memory being configured to store computer instructions, and the processor being configured to invoke the computer instructions from the memory to perform the method as described in the first aspect.

[0034] According to one embodiment of this disclosure, if the absolute time difference between the second timestamp of the audio frame currently played by the second electronic device and the first timestamp of the video frame currently played by the first electronic device is greater than or equal to a first time threshold, an asynchrony state between audio playback and video playback is determined based on the time difference between the second and first timestamps. Based on this asynchrony state, the playback of audio and video data is controlled to reduce the time difference. This improves the synchronization between the video playback from the first electronic device and the audio playback from the second electronic device, enhancing the user's immersive viewing experience.

[0035] Other features and advantages of this application will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description

[0036] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments of the present application and, together with their description, serve to explain the principles of the present application.

[0037] Figure 1 This is a hardware structure block diagram of an electronic device according to an embodiment of this application.

[0038] Figure 2 This is a flowchart of an audio and video synchronized playback method according to an embodiment of this application.

[0039] Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation

[0040] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps set forth in these embodiments do not limit the scope of the present application.

[0041] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the scope of this application and its application or use.

[0042] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.

[0043] In all the examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.

[0044] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.

[0045] Figure 1 This is a block diagram of the hardware configuration of an electronic device for implementing a method for synchronized audio and video playback according to an embodiment of this application.

[0046] Electronic device 1000 can be a terminal.

[0047] The terminal can be a head-mounted device (such as an AR device, MR device, and VR device), a portable computer, a tablet computer, a handheld computer, etc.

[0048] The electronic device can be a first electronic device or a third electronic device. The third electronic device is a device that is communicatively connected to the first electronic device and the second electronic device to execute the audio and video synchronous playback method of the embodiments of this application. No limitation is made here.

[0049] In one example, the electronic device could be a first electronic device, such as a VR device, while the second electronic device could be a car speaker device.

[0050] In another example, the electronic device can also be a third electronic device, such as a mobile phone, in which case the first electronic device can be a VR device and the second electronic device can be a car speaker.

[0051] Electronic device 1000 may include a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker 1700, a microphone 1800, etc. The processor 1100 may be a central processing unit (CPU), a microprocessor (MCU), etc. The memory 1200 may include, for example, ROM (Read-Only Memory), RAM (Random Access Memory), or non-volatile memory such as a hard disk. The interface device 1300 may include, for example, a USB interface, a headphone jack, etc. The communication device 1400 may be capable of wired or wireless communication. The display device 1500 may be, for example, an LCD screen, a touch screen, etc. The input device 1600 may include, for example, a touch screen, a keyboard, etc. Users can input / output voice information through the speaker 1700 and the microphone 1800.

[0052] Despite Figure 1 The electronic device 1000 shows multiple devices, but this application may only involve some of them. For example, electronic device 1000 may only involve memory 1200 and processor 1100.

[0053] In the embodiments applied in this application, the memory 1200 of the electronic device 1000 is used to store instructions for controlling the processor 1100 to execute the audio and video synchronous playback method provided in the embodiments of this application.

[0054] In the above description, those skilled in the art can design instructions based on the scheme disclosed in this application. How the instructions control the processor to operate is well known in the art, and therefore will not be described in detail here.

[0055] Figure 2 This is a flowchart illustrating a method for achieving synchronized audio and video playback according to an embodiment of this application, which can be implemented by... Figure 1 The electronic devices in the process execute.

[0056] like Figure 2 As shown, the audio and video synchronous playback method of this application embodiment includes steps S2100 to S2300.

[0057] Step S2100: Obtain the first timestamp of the video frame currently being played by the first electronic device, and obtain the second timestamp of the audio frame currently being played by the second electronic device.

[0058] In this embodiment, the electronic device stores audio and video data to be played. The audio and video data typically includes audio data and video data, with the video data comprising multiple video frames.

[0059] Audio data can include multiple audio frames. An audio frame can be understood as an audio segment, and these multiple audio segments can be combined to form a time-continuous audio data.

[0060] The number of audio frames and video frames in audio and video data differs. Because audio data is continuous while video frames are discrete, an audio frame typically corresponds to multiple video frames.

[0061] In the example where the electronic device is the first electronic device, the first electronic device passes the multiple audio frames to the second electronic device to play the multiple video frames through the first electronic device, and the second electronic device plays the multiple audio frames.

[0062] In the example where the electronic device is a third electronic device, the electronic device can send multiple audio frames and multiple video frames to a first electronic device, which then sends the multiple audio frames to a second electronic device so that the multiple video frames can be played by the first electronic device and the multiple audio frames can be played by the second electronic device.

[0063] Each video frame corresponds to a first timestamp, which can be the reference playback time of that video frame within the audio and video data, that is, the time between the start of playing the audio and video data and the playback of that video frame. In other words, the first timestamp can also be called the reference timestamp.

[0064] For example, a video frame with a first timestamp of 0.01 seconds can be understood as the video frame being displayed 0.01 seconds after the audio and video data begins playing. A video frame with a first timestamp of 0.10 seconds can be understood as the video frame being displayed 0.10 seconds after the audio and video data begins playing.

[0065] The first timestamp of the currently playing video frame can be the reference playback time of the currently playing video frame in the audio and video data.

[0066] Each audio frame corresponds to a second timestamp. This second timestamp can be the time difference between the actual playback time of the audio frame and the start of playback of the audio and video data. In other words, the second timestamp corresponding to the audio frame is determined in real time based on the actual playback time, while the first timestamp of the video frame remains fixed.

[0067] In one example, a model can be built based on the time delay between the first electronic device and the second electronic device to predict the second timestamp corresponding to each audio frame.

[0068] In another example, the second timestamp of the audio frame can be determined based on the actual playback time when the second electronic device plays the audio frame.

[0069] For example, if audio and video data are played starting at 0:10, and the second electronic device plays a video frame at 0:30, then the second timestamp of that audio frame is 0:20.

[0070] Step S2200: If the absolute time difference between the second timestamp and the first timestamp is greater than or equal to the first time threshold, determine the asynchronous state of audio playback relative to video playback based on the time difference between the second timestamp and the first timestamp.

[0071] In this embodiment, the absolute time difference can be the absolute value of the time difference between the second timestamp and the first timestamp.

[0072] The first time threshold can be a threshold for determining the absolute value of the time difference between the first electronic device and the second electronic device to determine whether there is asynchronous playback.

[0073] In one example, the first time threshold could be 20ms. If the first timestamp is 50ms and the second timestamp is 20ms, then the audio and video data are determined to be out of sync.

[0074] When it is determined that the audio and video data are not synchronized, the asynchronous state of audio playback relative to video playback is determined based on the time difference between the second timestamp and the first timestamp. This asynchronous state can take various forms, such as audio leading or lagging behind.

[0075] In some embodiments, step S2200 determines the asynchronous state of audio playback relative to video playback based on the time difference between the second timestamp and the first timestamp, including steps S2200.1 and S2200.2.

[0076] Step S2200.1: If the time difference between the second timestamp and the first timestamp is greater than or equal to the first time threshold, determine that the asynchronous state is audio ahead.

[0077] In this embodiment, audio precedes video playback.

[0078] Step S2200.2: If the time difference between the second timestamp and the first timestamp is less than or equal to the second time threshold, the asynchronous state is determined to be audio lag.

[0079] In this embodiment, audio lag can mean that the video plays before the audio.

[0080] The first time threshold is greater than the second time threshold.

[0081] In one example, the first time threshold could be 20ms, and the second time threshold could be -20ms.

[0082] Step S2300: Based on the asynchronous state, control the playback of the audio and video to reduce the time difference.

[0083] In some embodiments, the asynchronous state includes audio lead and audio lag.

[0084] In these embodiments, step S2300, which controls the playback of the audio and video according to the asynchronous state, includes steps S2300.1 to S2300.2.

[0085] Step S2300.1: In the case of asynchronous state where the audio is ahead, perform a first target operation or a second target operation to make the absolute time difference between the second timestamp and the first timestamp less than the first time threshold.

[0086] In this embodiment, the first target operation is used to reduce the playback rate of audio frames played by the second electronic device, and the second target operation is used to increase the playback rate of video frames played by the first electronic device.

[0087] In one embodiment, the first target operation includes at least one of dynamically compressing the audio buffer, audio resampling processing, and short-term silence compensation.

[0088] In this embodiment, an audio buffer is located in the first electronic device. The amount of audio data in the audio buffer is reduced by dynamically compressing it. This reduction in audio data volume causes the first electronic device to wait more frequently for audio frames to load, thus lowering the audio frame loading rate. Correspondingly, the playback rate of audio frames by the second electronic device also decreases.

[0089] Audio resampling can adjust the time scale of audio data without significantly changing the audio pitch, allowing the playback rate of audio frames to be reduced while maintaining the natural sound of the audio as much as possible.

[0090] For example, the WSOLA time-scale compression algorithm expands the time scale by inserting audio frames through finding the optimal overlapping region in the audio data. The Phase Vocoder time-scale compression algorithm, on the other hand, adjusts the playback rate by performing frequency domain analysis and resynthesis on the audio data, thereby changing the phase and amplitude of the audio data.

[0091] The playback rate of audio data can be reduced by adding extra silent frames or compensating sounds for smooth transitions across multiple audio frames.

[0092] In one embodiment, the second objective operation could be to increase the video playback frame rate, increase the amount of data in the video buffer, etc.

[0093] Step S2300.2: In the case of audio lag in the asynchronous state, perform a third target operation or a fourth target operation to make the absolute time difference between the second timestamp and the first timestamp less than the first time threshold.

[0094] In this embodiment, the third target operation is used to reduce the playback rate of video frames played by the first electronic device, and the fourth target operation is used to increase the playback rate of audio frames played by the second electronic device.

[0095] In one embodiment, the third target operation may be at least one of inserting a video buffer frame or reducing the video playback frame rate.

[0096] In this embodiment, after inserting a delayed frame, video playback is paused or the current frame is held for a period of time, and the playback rate of multiple video frames will be reduced.

[0097] In one embodiment, the fourth target operation includes switching the audio transmission mode to a low latency mode when the current audio transmission mode is a high latency mode.

[0098] In this embodiment, latency can be the time delay between the first electronic device sending the audio frame and the second electronic device receiving the video frame. Low-latency mode can be, for example, a WiFi connection or a wired connection, while high-latency mode can be a Bluetooth connection.

[0099] It should be noted that high latency and low latency are relative terms, and the latency from low to high is wired connection, WiFi connection, and Bluetooth connection.

[0100] For example, if the current audio transmission mode is Bluetooth, switch to WIFI mode.

[0101] In some embodiments, if the absolute time difference between the second timestamp and the first timestamp is greater than or equal to a first time threshold, the method further includes steps S3100 to S3400.

[0102] Step S3100: Obtain a first timestamp sequence corresponding to multiple video frames played by the first electronic device within a set time period, and obtain a second timestamp sequence corresponding to multiple audio frames played by the second electronic device within the set time period.

[0103] In this embodiment, the set time period is a set duration with the current time as the end time.

[0104] An electronic device can acquire a first timestamp at a set time interval within a set time period to obtain a first timestamp sequence. It can also acquire a second timestamp at the same set time interval within the same set time period to obtain a second timestamp sequence.

[0105] The time interval can be any time interval between 10 and 30 ms.

[0106] In one example, if the time interval is set to 10ms and the duration is set to 100ms, then the first timestamp sequence includes 10 first timestamps and the second timestamp sequence includes 10 second timestamps.

[0107] Step S3200: Determine a time difference sequence based on the time difference between the second timestamp and the first timestamp in the same order in the second timestamp sequence and the first timestamp sequence.

[0108] Continuing the example above, the first timestamp sequence includes 10 first timestamps, and the second timestamp sequence includes 10 second timestamps. The difference between the first second timestamp in the second timestamp sequence and the first first timestamp in the first timestamp sequence is taken to obtain a time difference value. This process is repeated to obtain a time difference value sequence consisting of 10 time difference values.

[0109] Step S3300: Determine the timing deviation type based on the time difference sequence.

[0110] In this embodiment, the timing deviation type can characterize the change in the time difference between the second timestamp and the first timestamp over time. The timing deviation type can include instantaneous jitter, directional shift, continuous fluctuation, etc.

[0111] In some embodiments, determining the timing deviation type based on the time difference sequence in step S3300 includes steps S3300.1 and S3300.2.

[0112] Step S3300.1: If the absolute time difference of any time difference in the time difference sequence is less than or equal to the third time threshold, and the average time difference of the time difference sequence is less than or equal to the fourth time threshold, the timing deviation type is determined to be instantaneous jitter.

[0113] In this embodiment, the absolute time difference of the time difference can be the absolute value of the time difference.

[0114] The fourth time threshold is less than the third time threshold.

[0115] In one embodiment, the third time threshold is less than the first time threshold and greater than the second time threshold. The fourth time threshold is less than the third time threshold and greater than the second time threshold.

[0116] For example, the first time threshold is 20ms, the second time threshold is -20ms, the third time threshold is 5ms, and the fourth time threshold is 2ms.

[0117] Transient jitter manifests as small, rapid changes in a time difference sequence, representing a random, short-term pattern of temporal deviation. Transient jitter can be caused by variations in network latency, hardware noise, or minor errors in audio frame processing.

[0118] Step S3300.2: If the time difference sequence is a continuously increasing or continuously decreasing time difference, determine that the time series deviation type is a trend-based shift.

[0119] In this embodiment, if the time difference between any two adjacent time differences in the time difference sequence is greater than the time difference between the preceding time differences, then the time difference sequence is a continuously increasing sequence.

[0120] If the time difference in any two adjacent time differences in a time difference sequence is less than the time difference in the preceding time difference, then the time difference sequence is a continuously decreasing sequence.

[0121] Directional shift manifests as the overall trend of time difference over a longer period. Directional shift can be caused by clock drift, changes in system load, or external environmental factors.

[0122] Step S3400: Based on the timing deviation type, perform target synchronization processing corresponding to the timing deviation type.

[0123] In some embodiments, step S3400 involves performing target synchronization processing corresponding to the timing deviation type, including steps S3400.1 and S3400.2.

[0124] Step S3400.1: If the timing deviation type is determined to be instantaneous jitter, increase the amount of data in the short-time buffer.

[0125] In this embodiment, transient jitter may be caused by short-term fluctuations in network or audio / video data processing, such as network latency or system load changes. In this case, increasing the amount of data in the short-term buffer to cache more audio and video data reduces transient jitter.

[0126] Step S3400.2: If the timing deviation type is determined to be a directional offset, perform the fifth target operation.

[0127] In this embodiment, the fifth target operation is at least one of the following: triggering clock synchronization calibration between the first electronic device and the second electronic device; switching the audio transmission mode to low latency mode when the current audio transmission mode is high latency mode.

[0128] After triggering clock synchronization calibration between the first and second electronic devices, the first electronic device performs clock synchronization calibration. Specifically, the first electronic device can send a clock synchronization request to the second electronic device and receive a second clock returned by the second electronic device. The first electronic device determines whether the clocks of the second and first electronic devices are synchronized based on the clock difference between the second and first clocks. If it is determined that the clocks of the second and first electronic devices are not synchronized, the first clock is sent to the second electronic device to enable clock synchronization.

[0129] In one embodiment, the method further includes: triggering clock synchronization calibration between a first electronic device and a second electronic device at a set clock calibration time interval.

[0130] In this embodiment, the clock calibration time interval can be set to, for example, 100ms. By setting the clock calibration time interval to trigger clock synchronization calibration, clock drift that may occur during long-term operation can be addressed.

[0131] If the current audio transmission mode is high latency mode, switch the audio transmission mode to low latency mode. This step is the same as above and will not be repeated here.

[0132] In some embodiments, step S3300 determines the timing deviation type based on the time difference sequence, including step S3300.3.

[0133] Step S3300.3: If the absolute value of the time change between two adjacent time differences in the time difference sequence is greater than or equal to the fifth time threshold, the time series deviation type is determined to be continuous fluctuation.

[0134] In this embodiment, the absolute value of time change can be the absolute value of the time change between two adjacent time differences.

[0135] For example, if two adjacent time differences are 21ms and -19ms, then the change in these two time differences is -40ms, and the absolute value of the time change is 40ms.

[0136] The fifth time threshold is greater than the first time threshold.

[0137] In one example, the first time threshold could be 20ms, and the fifth time threshold could be 30ms.

[0138] Continuous fluctuations can be a sustained, regular change in a time difference sequence, which may be caused by periodic load changes, external disturbances, or periodic behavior within the system.

[0139] In these embodiments, step S3400 involves performing target synchronization processing corresponding to the timing deviation type, including step S3400.3.

[0140] Step S3400.3: If the timing deviation type is determined to be continuous fluctuation, the sixth target operation is performed to reduce the continuous fluctuation.

[0141] In this embodiment, the sixth target operation can be at least one of increasing the clock calibration frequency and increasing the time synchronization detection frequency.

[0142] In an example where an electronic device can acquire a first timestamp at a set time interval within a set time period to obtain a first timestamp sequence, and can acquire a second timestamp at the same set time interval within the same set time period to obtain a second timestamp sequence, increasing the clock calibration frequency can be achieved by decreasing the set time interval.

[0143] For example, if the time interval is set to 10ms, then performing the sixth target operation could be to adjust the set time interval to 5ms.

[0144] In the example where clock synchronization calibration between the first electronic device and the second electronic device is triggered at a set clock calibration time interval, the set clock calibration time interval can be reduced.

[0145] For example, the clock calibration time interval can be set to 100ms, and after performing the sixth target operation, the clock calibration time interval can be set to 10ms.

[0146] In some embodiments, there are multiple second electronic devices, and any audio frame is played through at least one second electronic device, with each second electronic device corresponding to one audio channel.

[0147] In this embodiment, the second electronic device can be, for example, five, namely, the front left channel, the front right channel, the rear left channel, the rear right channel, and the bass channel.

[0148] The first electronic device can send at least one channel corresponding to any audio frame to the corresponding channel to play the audio frame.

[0149] In an embodiment where each second electronic device corresponds to one audio channel, synchronized playback of audio and video for each channel can be achieved.

[0150] In one embodiment, the first electronic device may be a head-mounted device, such as a VR device. The first electronic device processes any audio frame to be played using an audio rendering model to obtain audio data for at least one channel, and then sends this audio data for at least one channel to the corresponding second electronic device for playback. The audio rendering model may be a model that controls the audio rendering of audio frames.

[0151] In one example, the head-mounted device can acquire the wearer's head posture information in real time and update the audio rendering model based on this information. The updated model then processes the audio frame to be played, obtaining at least one channel of audio data to be played. This audio data is then sent to a corresponding second electronic device for playback. This method creates a three-dimensional sound field that changes with head posture, achieving spatial auditory consistency with the video feed from the head-mounted device.

[0152] If the user's posture changes frequently based on head posture information, the update frequency of the audio rendering model can be reduced to decrease the processing latency caused by audio processing, reduce the resources occupied by audio rendering, and avoid the system resources being affected by the increased complexity of audio rendering, thus affecting the audio transmission time.

[0153] According to an embodiment of this application, when the absolute time difference between the second timestamp of the audio frame currently played by the second electronic device and the first timestamp of the video frame currently played by the first electronic device is greater than or equal to a first time threshold, an asynchronous state between the audio playback and the video playback is determined based on the time difference between the second and first timestamps. Based on this asynchronous state, the playback of audio and video data is controlled to reduce the time difference. This improves the synchronization between the video playback on the first electronic device and the audio playback on the second electronic device, enhancing the user's immersive viewing experience.

[0154] Figure 3 This is a structural block diagram of an electronic device 3000 according to an embodiment of the present invention.

[0155] In this embodiment, as Figure 3 As shown, the electronic device 3000 includes a memory 3001 and a processor 3002. The memory 3001 is used to store computer instructions, and the processor 3002 is used to retrieve the computer instructions from the memory to execute the method described in any of the above embodiments.

[0156] This application provides a readable storage medium on which a program or instructions are stored. When the program or instructions are executed by a processor, they implement the steps of the method described in any of the above method embodiments.

[0157] This application may be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of this application.

[0158] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.

[0159] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.

[0160] The computer program instructions used to perform the operations of this application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuits, such as programmable logic circuits, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), are personalized by utilizing state information from the computer-readable program instructions. These electronic circuits can execute the computer-readable program instructions to implement various aspects of this application.

[0161] Various aspects of this application are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0162] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0163] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0164] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions. It will be well known to those skilled in the art that implementation in hardware, implementation in software, and implementation using a combination of software and hardware are equivalent.

[0165] The various embodiments of this application have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical applications, or technical improvements to the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein. The scope of this application is defined by the appended claims.

Claims

1. An audio-video synchronous playing method, characterized in that, The audio and video data includes multiple video frames and multiple audio frames. The multiple video frames are played through a first electronic device, and the multiple audio frames are played through a second electronic device. The method includes: Obtain the first timestamp of the video frame currently being played by the first electronic device, and obtain the second timestamp of the audio frame currently being played by the second electronic device; If the absolute time difference between the second timestamp and the first timestamp is greater than or equal to the first time threshold, the asynchronous state of audio playback relative to video playback is determined based on the time difference between the second timestamp and the first timestamp. Based on the asynchronous state, the playback of the audio and video data is controlled to reduce the time difference.

2. The method of claim 1, wherein, Determining the asynchronous state of audio playback relative to video playback based on the time difference between the second timestamp and the first timestamp includes: If the time difference between the second timestamp and the first timestamp is greater than or equal to the first time threshold, the asynchronous state is determined to be audio ahead. If the time difference between the second timestamp and the first timestamp is less than or equal to the second time threshold, the asynchronous state is determined to be audio lag; wherein the first time threshold is greater than the second time threshold.

3. The method of claim 2, wherein, The step of controlling the playback of the audio and video data according to the asynchronous state includes: When the asynchrony state is audio ahead, a first target operation or a second target operation is performed to make the absolute time difference between the second timestamp and the first timestamp less than the first time threshold; wherein, the first target operation is used to reduce the playback rate of the audio frame played by the second electronic device, and the second target operation is used to increase the playback rate of the video frame played by the first electronic device. In the case of audio lag in the asynchronous state, a third target operation or a fourth target operation is performed to make the absolute time difference between the second timestamp and the first timestamp less than the first time threshold; wherein, the third target operation is used to reduce the playback rate of video frames played by the first electronic device, and the fourth target operation is used to increase the playback rate of audio frames played by the second electronic device.

4. The method of claim 1, wherein, If the absolute time difference between the second timestamp and the first timestamp is greater than or equal to a first time threshold, the method further includes: The system obtains a first timestamp sequence corresponding to multiple video frames played by the first electronic device within a set time period, and obtains a second timestamp sequence corresponding to multiple audio frames played by the second electronic device within the set time period; wherein, the set time period is a time period of a set duration with the current time as the end time. The time difference sequence is determined based on the time difference between the second timestamp and the first timestamp in the same order in the second timestamp sequence and the first timestamp sequence. Based on the time difference sequence, determine the type of time series deviation; Based on the timing deviation type, perform the target synchronization process corresponding to the timing deviation type.

5. The method of claim 4, wherein, The step of determining the time series deviation type based on the time difference sequence includes: If the absolute time difference of any time difference in the time difference sequence is less than or equal to a third time threshold, and the average time difference of the time difference sequence is less than or equal to a fourth time threshold, the timing deviation type is determined to be instantaneous jitter; wherein the fourth time threshold is less than the third time threshold. When the time difference sequence is a continuously increasing or continuously decreasing time difference, the time series deviation type is determined to be a trend-based shift.

6. The method of claim 5, wherein, The step of performing target synchronization processing corresponding to the timing deviation type includes: If the timing deviation is determined to be instantaneous jitter, increase the amount of data in the short-time buffer. If the timing deviation type is determined to be a directional shift, a fifth objective operation is performed; wherein the fifth objective operation is at least one of the following: Trigger clock synchronization calibration between the first electronic device and the second electronic device; If the current audio transmission mode is high latency mode, switch the audio transmission mode to low latency mode.

7. The method of claim 4, wherein, The step of determining the time series deviation type based on the time difference sequence includes: If the absolute value of the time change between two adjacent time differences in the time difference sequence is greater than or equal to a fifth time threshold, the time series deviation type is determined to be continuous fluctuation; wherein, the fifth time threshold is greater than the first time threshold.

8. The method of claim 7, wherein, The step of performing target synchronization processing corresponding to the timing deviation type includes: If the timing deviation is determined to be a continuous fluctuation, a sixth objective operation is performed to reduce the continuous fluctuation.

9. The method of claim 1, wherein, There are multiple second electronic devices, and any audio frame is played through at least one second electronic device, with each second electronic device corresponding to one audio channel.

10. An electronic device, comprising: It includes a memory and a processor, the memory being used to store computer instructions, and the processor being used to retrieve the computer instructions from the memory to perform the method as described in any one of claims 1-9.