A method and device for controlling audio output mode

By monitoring the user's audio output mode in real time and directly outputting or decoding audio data streams, it solves the problem of high resource usage in audio output and improves audio output efficiency and synchronization capabilities.

CN114339388BActive Publication Date: 2024-09-10HISENSE VISUAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111482365.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-07
Publication Date
2024-09-10
Estimated Expiration
2041-12-07

AI Technical Summary

Technical Problem

The existing technology requires secondary encoding and data backup when outputting audio, resulting in high CPU resource usage and high memory resource usage.

Method used

Monitor the audio output mode set by the user in real time through the media player, directly output or decode the audio data stream, avoid secondary encoding, reduce memory usage, and obtain the playback progress of the audio data stream to synchronize the audio and video streams when necessary.

Benefits of technology

It effectively reduces the usage of CPU and memory resources, improves the efficiency and playback effect of audio output, and avoids unnecessary encoding and backup processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114339388B
    Figure CN114339388B
Patent Text Reader

Abstract

The present application provides a method and device for controlling an audio output mode, which is used to solve the problem of high memory usage in audio output. The method includes: a media player receives a first audio data stream, and the audio format used by the first audio data stream is a first format; the media player monitors the audio mode set by the user; when the output audio data stream format indicated by the audio mode is the first format, the audio data included in the first audio data stream is output; or when the output audio data stream format indicated by the audio mode is a second format, the first audio data stream is decoded into a second audio data stream, and the audio data included in the second audio data stream is output, and the audio format used by the second audio data stream is the second format.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of audio processing technology, and in particular to a method and device for controlling an audio output mode. Background Art

[0002] Current televisions support audio data in two formats: Pulse Code Modulation (PCM) data and Elementary Stream (ES) data of the original audio. When the sound quality of the PCM data stream (hereinafter referred to as PCM stream) is poor, you can choose to directly output the ES data stream of the original audio (hereinafter referred to as ES stream). Therefore, the television needs to meet the requirements of supporting dynamic output of different audio formats. One of them is that the media player (Media Player) decodes the ES stream into a PCM stream and transmits it to the audio driver (Audio Driver). The Audio Driver outputs the PCM stream. When the user chooses to output ES data, the Media Player encodes the PCM stream into an ES stream and then outputs it. The re-encoding process will increase the CPU resource usage. The other is the ES stream of the backup audio, that is, after the Media Player receives the ES data of the original audio, it first backs up the ES stream and then decodes the ES data into a PCM stream. The Audio Driver decides to output the PCM stream or the backup ES stream based on the user's choice, but this method requires data backup, resulting in a high memory resource usage. Summary of the invention

[0003] The embodiments of the present application provide a method and device for controlling an audio output mode, so as to solve the problem of high memory usage in audio output.

[0004] In a first aspect, an embodiment of the present application provides a method for controlling an audio output mode, comprising:

[0005] A media player receives a first audio data stream, the audio format used by the first audio data stream is a first format; the media player monitors an audio mode set by a user; when the output audio data stream format indicated by the audio mode is the first format, the audio data included in the first audio data stream is output; or, when the output audio data stream format indicated by the audio mode is a second format, the first audio data stream is decoded into a second audio data stream, and the audio data included in the second audio data stream is output, the audio format used by the second audio data stream is the second format.

[0006] Based on the above scheme, the media player can monitor the audio output mode set by the user in real time. When the output audio data stream format indicated by the audio output mode set by the user is in the first format, the audio data stream in the first format is directly output, and the media player does not process the audio data stream. When the output audio data stream format indicated by the audio output mode set by the user is in the second format, the first audio data stream is decoded into a second audio data stream in the second format, and the second audio data stream is output. This scheme avoids secondary encoding and reduces memory occupancy.

[0007] In some embodiments, the first format is a basic code stream format, and the second format is a pulse code modulation format.

[0008] Based on the above solution, there are two formats corresponding to the audio data stream. When the playback effect of the audio data stream in the first format is not very good, the audio data stream in the second format can be selected for playback.

[0009] In some embodiments, when the output audio data stream format indicated by the audio mode is a second format, the method further includes: receiving a video stream, the video stream including video data corresponding to the second audio data stream; obtaining the end time of the currently output audio data, and obtaining the first duration of the audio data output in the second audio data stream; obtaining the second duration of the audio data played in the second audio data stream; determining the current playback progress of the second audio data stream based on the end time, the first duration and the second duration; and synchronizing the second audio data stream and the video stream based on the current playback progress of the second audio data stream.

[0010] Based on the above solution, when the media device plays the audio data stream and the video stream simultaneously, the media player needs to obtain the playback progress of the audio data stream to synchronize the audio data stream and the video stream, thereby improving the playback effect of the media device.

[0011] In some embodiments, determining the current playback progress of the second audio data stream according to the end time, the first duration, and the second duration includes: determining the current playback progress of the second audio data stream by the following formula; T=T1-(S1-S2);

[0012] Among them, T is the current playback progress of the second audio data stream; T1 is the end time of the currently output audio data, S1 is the first duration, and S2 is the second duration.

[0013] Based on the above solution, the current playing progress of the second audio data stream can be calculated, and the calculation method is simple and the resource occupancy rate is low.

[0014] In some embodiments, when the output audio data stream format indicated by the audio mode is a first format, the method further includes: obtaining a video stream, the video stream including video data corresponding to the first audio data stream; obtaining a first start time of the audio data currently output, a second start time of the audio data last output and a third duration in the first audio data stream; obtaining a fourth duration of the audio data output before the current time included in the first audio data stream and a fifth duration of the currently played audio data included in the first audio data stream; determining a current playback progress of the first audio data stream based on the first start time, the second start time, the third duration, the fourth duration and the fifth duration; and synchronizing the first audio data stream and the video stream based on the current playback progress of the first audio data stream.

[0015] Based on the above solution, when the format corresponding to the audio data stream is the first format, the media player also needs to obtain the current playback progress of the audio data stream in the first format to synchronize the audio data stream with the video stream, thereby improving the playback effect of the media device.

[0016] In some embodiments, the current playback progress of the first audio data stream is determined based on the first start time, the second start time, the third duration, the fourth duration and the fifth duration, including: when the end time determined based on the second start time of the last output audio data and the third duration is continuous with the first start time, determining that the time corresponding to the sum of the start time of the first audio data stream and the fifth duration is the current playback progress of the first audio data stream.

[0017] Based on the above scheme, when determining the current audio playback progress of the first audio data stream, it is also necessary to determine whether the currently output audio data stream is continuous with the last output audio data stream. If they are continuous, the current playback progress of the first audio data stream is calculated using the above method.

[0018] In some embodiments, determining the current playback progress of the first audio data stream according to the first start time, the second start time, the third duration, the fourth duration, and the fifth duration includes:

[0019] When the end time determined according to the second start time of the last audio data output and the third duration is discontinuous with the first start time, and the fourth duration is less than or equal to the fifth duration, determine that the time corresponding to the sum of the start time of the first audio data stream and the fifth duration is the current playback progress of the first audio data stream; or, when the end time determined according to the second start time of the last audio data output and the third duration is discontinuous with the first start time, and the fourth duration is greater than the fifth duration, determine that the time corresponding to the sum of the start time of the first audio data stream, the fifth duration and the time difference is the current playback progress of the first audio data stream; wherein the time difference is the difference between the first start time and the end time.

[0020] Based on the above scheme, when the currently output audio data stream is discontinuous with the last output audio data stream, the discontinuous time difference is also calculated to obtain the current playback progress of the audio data stream, thereby improving accuracy.

[0021] In a second aspect, an embodiment of the present application provides a control device for an audio output mode, including a communication interface, a processor, and a speaker;

[0022] The communication interface is used to receive a first audio data stream, where the audio format used by the first audio data stream is a first format;

[0023] The processor is configured to monitor an audio mode set by a user; when the output audio data stream format indicated by the audio mode is a first format, output the audio data included in the first audio data stream to the speaker; or, when the output audio data stream format indicated by the audio mode is a second format, decode the first audio data stream into a second audio data stream, output the audio data included in the second audio data stream to the speaker, and the audio format adopted by the second audio data stream is the second format;

[0024] The speaker is used to receive and output the audio data sent by the processor.

[0025] In some embodiments, the first format is a basic code stream format, and the second format is a pulse code modulation format.

[0026] In some embodiments, the communication interface is further used to: receive a video stream, the video stream including video data corresponding to the second audio data stream;

[0027] The processor is further used to obtain the end time of the audio data currently output and the first duration of the audio data output in the second audio data stream when the output audio data stream format indicated by the audio mode is the second format; obtain the second duration of the audio data played in the second audio data stream; determine the current playback progress of the second audio data stream based on the end time, the first duration and the second duration; and synchronize the second audio data stream with the video stream based on the current playback progress of the second audio data stream.

[0028] In some embodiments, when determining the current playback progress of the second audio data stream according to the end time, the first duration, and the second duration, the processor is specifically configured to:

[0029] Determine the current playback progress of the second audio data stream by the following formula;

[0030] T = T1 - (S1 - S2);

[0031] Among them, T is the current playback progress of the second audio data stream; T1 is the end time of the currently output audio data, S1 is the first duration, and S2 is the second duration.

[0032] In some embodiments, the communication interface is further used to: obtain a video stream, the video stream including video data corresponding to the first audio data stream;

[0033] The processor is further used to, when the output audio data stream format indicated by the audio mode is the first format, obtain the first start time of the audio data currently outputted, the second start time of the audio data previously outputted, and the third duration; obtain the fourth duration of the audio data outputted before the current time included in the first audio data stream and the fifth duration of the currently played audio data included in the first audio data stream; determine the current playback progress of the first audio data stream according to the first start time, the second start time, the third duration, the fourth duration, and the fifth duration; and synchronize the first audio data stream and the video stream according to the current playback progress of the first audio data stream.

[0034] In some embodiments, when the processor determines the current playback progress of the first audio data stream based on the first start time, the second start time, the third duration, the fourth duration and the fifth duration, it is specifically used to: when the end time determined based on the second start time of the last output audio data and the third duration is continuous with the first start time, determine that the time corresponding to the sum of the start time of the first audio data stream and the fifth duration is the current playback progress of the first audio data stream.

[0035] In some embodiments, when determining the current playback progress of the first audio data stream according to the first start time, the second start time, the third duration, the fourth duration, and the fifth duration, the processor is specifically used to: when the end time determined according to the second start time of the last output of the audio data and the third duration is not continuous with the first start time, and the fourth duration is less than or equal to the fifth duration, determine that the time corresponding to the sum of the start time of the first audio data stream and the fifth duration is the current playback progress of the first audio data stream; or,

[0036] When the end time determined according to the second start time of the last output of the audio data and the third duration is not continuous with the first start time, and the fourth duration is greater than the fifth duration, determining that the time corresponding to the sum of the start time of the first audio data stream, the fifth duration, and the time difference is the current playback progress of the first audio data stream;

[0037] The time difference value is the difference between the first start time and the end time.

[0038] In a third aspect, an embodiment of the present application provides a control device for an audio output mode, including a memory and a processor;

[0039] A memory for storing program instructions;

[0040] A processor is used to call the program instructions stored in the memory, and execute the method described in the first aspect and any possible implementation method included in the first aspect according to the obtained program.

[0041] In a fourth aspect, an embodiment of the present application further provides a computer storage medium, wherein the computer storage medium stores computer program instructions, and when the instructions are executed on a computer, the computer executes the method described in the first aspect and any possible implementation method included in the first aspect.

[0042] In addition, the technical effects brought about by any implementation method of the second to fourth aspects can refer to the technical effects brought about by the first aspect and different implementation methods of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0044] Figure 1A schematic diagram of a control method for an audio output mode in the prior art provided in an embodiment of the present application;

[0045] Figure 2 A schematic diagram of another prior art method for controlling an audio output mode provided in an embodiment of the present application;

[0046] Figure 3 A schematic diagram of a usage scenario of a display device provided in an embodiment of the present application;

[0047] Figure 4 A configuration block diagram of a control device provided in an embodiment of the present application;

[0048] Figure 5 A schematic diagram of the hardware structure of a display device provided in an embodiment of the present application;

[0049] Figure 6 A schematic diagram of a system of a display device provided in an embodiment of the present application;

[0050] Figure 7 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application;

[0051] Figure 8 A schematic diagram of a method for controlling an audio output mode provided in an embodiment of the present application;

[0052] Fig. 9 A schematic diagram of another method for controlling an audio output mode provided in an embodiment of the present application;

[0053] Fig.10 A flowchart of a method for determining the current playback progress of an audio data stream provided in an embodiment of the present application;

[0054] Fig.11 A flowchart of another method for determining the current playback progress of an audio data stream provided in an embodiment of the present application;

[0055] Fig.12 A flowchart of a method for controlling an audio output mode provided in an embodiment of the present application. DETAILED DESCRIPTION

[0056] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.

[0057] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0058] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0059] Before introducing the embodiments of the present application, the technical terms involved in the embodiments of the present application are first explained:

[0060] (1) Elementary Stream (ES) is the original bitstream output by the encoder for transmitting audio and video signals. ES contains only one type of content, such as video or audio.

[0061] (2) Pulse Code Modulation (PCM) is one of the coding methods for digital communication. The main process of PCM is to sample analog signals such as voice and images at regular intervals to discretize them, round off the sampled values ​​to integers and quantize them according to hierarchical units, and represent the amplitude of the sampled pulses according to a set of binary codes. Pulse Code Modulation can be used to obtain an audio data stream in PCM format.

[0062] Current display devices support playing audio data through an audio return function (ARC) amplifier. The ARC amplifier has a decoding function and can support the playback of the original audio ES stream. When the PCM data decoded by the TV's audio decoder does not sound very good, the user can choose to let the TV directly output the ES stream before decoding, and decode the audio through the amplifier's own decoder to obtain better sound effects. Therefore, a method for controlling the audio output mode is needed to meet the requirements of the audio playback device supporting the dynamic output of PCM data or ES data.

[0063] In some scenarios, the media player (Media Player) itself has a demultiplexing (demux) function, which can separate the audio data stream from the audio and video files. MediaPlayer decodes the received audio data stream in ES format (hereinafter referred to as ES stream) into an audio data stream in PCM format (hereinafter referred to as PCM stream) through the decoder inside MediaPlayer, and then transmits the PCM stream to the audio driver (Audio Driver). When the user chooses to output the audio data stream format as PCM, the Audio Driver receives the PCM stream sent by the Media Player and directly outputs the received PCM stream to the power amplifier. When the user chooses ES stream output, the Audio Driver receives the PCM stream sent by the Media Player. There is an encoder in the Audio Driver, which encodes the received PCM stream into an ES stream through the encoder and then outputs it to the power amplifier, such as Figure 1 This method directly decodes all received ES streams into PCM streams. When the user selects ES stream output, the decoded PCM stream is encoded into ES stream output, that is, two encoding processes are performed, and the CPU resource usage is high.

[0064] In other scenarios, when Media Player decodes the received audio data stream, it backs up the ES stream, such as Figure 2 As shown. Media Player receives the ES stream, and the encoder in Media Player decodes the ES stream into a PCM stream, backs up the ES stream, and sends the PCM stream and ES stream to the Audio Driver. The Audio Driver decides to output the PCM stream or the backup ES stream based on the output audio data stream format of the audio mode selected by the user. This solution has an additional data backup process during decoding, which will cause the problem of high memory resource usage.

[0065] Based on this, the present application proposes a method and device for controlling an audio output mode, in which the Media Player monitors the audio output mode set by the user in real time. When it is detected that the output audio data stream format indicated by the audio mode set by the user is in ES format, the Media Player directly outputs the received ES audio data stream; when it is detected that the output audio data stream format indicated by the audio mode set by the user is in PCM format, the Media Player processes the received audio data stream in ES format to obtain an audio data stream in PCM format, and outputs the audio data stream in PCM format.

[0066] Below, in order to facilitate understanding of the solution of the present application, the solution of the present application will be described with multiple embodiments in different scenarios. The solution proposed in the present application can be applied to a terminal device, and the terminal device involved in the present application has an audio output function, such as a radio, MP4, speaker, computer, TV, smart phone or tablet computer. In some embodiments, the terminal device involved in the embodiments of the present application may also have a display function. For example, the terminal device may be an audio and video playback device (or display device), such as a TV.

[0067] Figure 3 Schematic diagram of a usage scenario of a display device according to an embodiment. Figure 3 As shown, the display device 200 also performs data communication with the server 400 , and the user can operate the display device 200 by establishing a Bluetooth connection or an infrared connection with the display device 200 through the smart device 300 or the control apparatus 100 .

[0068] In some embodiments, the control device 100 may be a remote controller, and the communication between the remote controller and the display device 200 includes infrared protocol communication or Bluetooth protocol communication, and at least one of other short-range communication methods, and the display device 200 is controlled wirelessly or wired. The user may input user commands through at least one of buttons on the remote controller, voice input, and control panel input to control the display device 200. For example, the user may input corresponding control commands through the volume plus and minus keys, channel control keys, up / down / left / right movement keys, voice input keys, menu keys, power on / off keys, etc. on the remote controller to realize the function of controlling the display device 200.

[0069] In some embodiments, the smart device 300 may include any one of a mobile terminal, a tablet computer, a computer, a laptop computer, an augmented reality (AR) or virtual reality (VR) device, etc. In some embodiments, the smart device 300 may also be used to control the display device 200. For example, the display device 200 is controlled using an application running on the smart device.

[0070] In some embodiments, the display device 200 can also be controlled in a manner other than the control device 100 and the smart device 300. For example, the display device 200 can directly receive the user's voice command control through a module for acquiring voice commands configured inside the display device 200, or can receive the user's voice command control through a voice control device provided outside the display device 200. In some scenarios, the display device 200 is configured with a touch screen panel, and a plurality of virtual keys are provided on the touch screen panel. The user can input corresponding control commands through the plurality of virtual keys on the touch screen panel to realize the function of controlling the display device 200.

[0071] In some embodiments, the display device 200 also communicates data with the server 400. The display device 200 may be allowed to communicate via a local area network (LAN), a wireless local area network (WLAN), and other networks. The server 400 may provide various content and interactions to the display device 200. The server 400 may be a cluster or multiple clusters, and may include one or more types of servers. The server 400 may provide audio data streams and video streams for the display device 200.

[0072] Figure 4 Schematically shows a block diagram of a configuration of the control device 100 according to an exemplary embodiment. Figure 4 As shown, the control device 100 includes a processor 110, a memory 120, a communication interface 130, a user input / output interface 140, and a power supply 150. The control device 100 can receive the user's input operation instructions, and convert the operation instructions into instructions that the display device 200 can recognize and respond to, and play the role of an interactive intermediary between the user and the display device 200. In some embodiments, the communication interface 130 is used to communicate with the outside, including at least one of a WIFI chip 131, a Bluetooth component 132, NFC133 or a replaceable module. The Bluetooth component includes an antenna for sending and receiving Bluetooth signals, and may also include a controller for receiving instructions sent by the processor 110. The Bluetooth component can be used to send Bluetooth signals to the outside or receive external Bluetooth signals under the control of the processor 110. For example, the processor 110 can establish a Bluetooth connection with the display device 200 through the Bluetooth component, thereby controlling the display device 200. In some embodiments, the user input / output interface 140 includes at least one of a microphone 141, a touchpad 142, a sensor 143, a button 144 or a replaceable module.

[0073] Figure 5 The hardware structure diagram of the display device 200 is exemplarily shown. In some embodiments, the display device 200 includes: a radio frequency (RF) circuit 210, a memory 220, a display unit 230, a camera 240, a sensor 250, an audio circuit 260, a wireless fidelity (Wi-Fi) module 270, a processor 280, a Bluetooth component 281, a power supply 290 and other components.

[0074] The RF circuit 210 can be used to receive and send signals during the process of sending and receiving information or making calls. It can receive downlink data from the base station and hand it over to the processor 280 for processing; it can send uplink data to the base station. The memory 220 can be used to store software programs and data, an operating system that enables the display device 200 to run, and code for executing the method of the embodiment of the present application. The processor 280 executes various functions and data processing of the display device 200 by running the software programs or data stored in the memory 220.

[0075] The display unit 230 may be used to receive input digital or character information and generate signal inputs related to user settings and function control of the display device 200. Specifically, the display unit 230 may include a touch screen 231 disposed on the front of the display device 200, which may collect user touch operations on or near it. The display unit 230 may also be used to display information input by the user or information provided to the user and a graphical user interface (GUI) of various menus of the display device 200. Specifically, the display unit 230 may include a display screen 232 disposed on the front of the display device 200. The display unit 230 may be used to display various graphical user interfaces in the present application.

[0076] The camera 240 can be used to capture still images or videos. The object is projected onto the photosensitive element through the lens to generate an optical image. The photosensitive element converts the optical signal into an electrical signal, which is then transmitted to the processor 280 to be converted into a digital image signal.

[0077] The display device 200 may further include at least one sensor 250 , such as an acceleration sensor 251 , a distance sensor 252 , a fingerprint sensor 253 , and a temperature sensor 254 .

[0078] The audio circuit 260, the speaker 261, and the microphone 262 can provide an audio interface between the user and the display device 200. The audio circuit 260 can transmit the electrical signal converted from the received audio data to the speaker 261, which is converted into a sound signal for output. The display device 200 can also be configured with a volume button for adjusting the volume of the sound signal. On the other hand, the microphone 262 converts the collected sound signal into an electrical signal, which is received by the audio circuit 260 and converted into audio data, and then outputs the audio data to the RF circuit 210 to send it to, for example, another display device, or outputs the audio data to the memory 220 for further processing. In this application, the microphone 262 can obtain the user's voice. The display device 200 also includes a Wi-Fi module 270, which provides the user with wireless broadband Internet access. The processor 280 is the control center of the display device 200, which uses various interfaces and lines to connect the various parts of the entire display device, and executes various functions and processes data of the display device 200 by running or executing software programs stored in the memory 220, and calling data stored in the memory 220. In some embodiments, the processor 280 may include one or more processing units. In the present application, the processor 280 may run an operating system, an application program, a user interface display and a touch response, and a processing method of an embodiment of the present application. In addition, the processor 280 is coupled to the display unit 230.

[0079] The Bluetooth component 281 is used to exchange information with other Bluetooth devices having Bluetooth components through the Bluetooth protocol and may include multiple antennas for receiving and sending Bluetooth signals.

[0080] The display device 200 also includes a power supply 290 (such as a battery) for supplying power to various components. The power supply can be logically connected to the processor 280 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption. The display device 200 can also be configured with a power button for turning on and off the display device, as well as locking the screen and other functions.

[0081] In some embodiments, from a software perspective, the system of the display device may include a kernel, a command parser (shell), a file system, and an application. The kernel, shell, and file system together form the basic operating system structure, which allows users to manage files, run programs, and use the system. After power-on, the kernel starts, activates the kernel space, abstracts the hardware, initializes hardware parameters, etc., runs and maintains virtual memory, schedulers, signals, and inter-process communication (IPC). After the kernel starts, the shell and user applications are loaded. After startup, the application is compiled into machine code to form a process, see Figure 6 .

[0082] It should be noted that the hardware configuration of different display devices may be different, so the above Figure 4-Figure 6 This is just an exemplary description.

[0083] In some embodiments, in order to realize the audio or video playback function, the terminal device is deployed with a media player 310 and an audio driver 320. A power amplifier 330 can also be deployed in the terminal device. In some scenarios, the power amplifier 330 can be deployed in a speaker. Among them, the functions of the media player 310 and the audio driver 320 can be implemented by one or more processors described above. The media player 310 is used to receive an audio data stream and an audio signal indicating an audio mode triggered by a user through an operation, and process the received audio data stream according to the audio signal of the received audio mode. For example, the user can configure the audio output mode, such as by using an audio playback application or an audio and video playback application (APP) to set the audio output mode. After the user sets the audio output mode through the audio playback application, the audio playback application can broadcast to the media player 310. The audio playback application can indicate the audio output mode to the media player 310 in a public identification position. For example, after the audio playback application obtains the audio output mode configured by the user, it configures the value of the public identification position, and different values ​​indicate different audio output modes. Then the media player 310 determines the audio output mode according to the value of the public identification position. The media player 310 sends the processed audio data stream to the audio driver 320. After receiving the audio data stream sent by the media player 310, the audio driver 320 transmits the audio data stream to the power amplifier 330. The power amplifier 330 outputs the audio data stream and then plays the audio data through the speaker.

[0084] It should be noted that Figure 7 The structure of the terminal device shown is only an example and is not limited to this embodiment of the present invention.

[0085] The solution provided in this application is described in detail below with reference to embodiments.

[0086] See also Figure 8 As shown, the media player 310 receives a first audio data stream, and the audio format adopted by the first audio data stream is a first format, and the first format is an ES format. When the media player 310 detects that the format of the output audio data stream indicated by the audio mode set by the user is the first format, the media player 310 directly outputs the received first audio data stream to the audio driver 320. When the media player 310 detects that the format of the output audio data stream indicated by the audio mode set by the user is a second format, and the second format is an ES format, the media player 310 decodes the received first audio data stream into a second audio data stream in a second format, and sends the second audio data stream to the audio driver 320.

[0087] In some scenarios, some terminal devices only support outputting audio data streams but not video data streams, such as radios and MP4s; in other scenarios, some terminal devices can output both audio data streams and video data streams, such as TVs, computers, and mobile phones. When the terminal device includes both audio data streams and video data streams corresponding to the audio data streams, it is necessary to obtain the playback progress of the audio data streams, so as to synchronize the audio data streams with the video data streams.

[0088] In some embodiments, when the terminal device supports not only outputting audio data streams but also outputting video streams, the media player 310 will also obtain the current playback progress of the audio data stream when outputting the audio data stream, and synchronize the audio data stream and the video stream according to the current playback progress of the audio data stream. The following is an explanation of the method for synchronizing the audio data stream and the video stream according to the current playback progress of the audio data stream, as follows:

[0089] In the first possible implementation, when the audio format of the audio data stream corresponding to the output video stream is PCM format, the data stream corresponding to the PCM format is the second audio data stream. The current playback progress of the second audio data stream can be obtained in the following manner. Fig. 9 For the convenience of description, the subsequent description of the media player 310 and the audio driver 320 will no longer use numerical identifiers.

[0090] 901. The media player obtains the duration of the audio data that has been output in the second audio data stream, and determines the end time of the audio data that is currently output.

[0091] In some embodiments, the audio data received by the media player is one segment at a time, and multiple segments of audio data belong to one audio data stream. The media player processes the received audio data stream to obtain multiple segments of audio data, and sends each segment of processed audio data to the audio driver. When the media player sends audio data to the audio driver, the audio data may also include a timestamp of the audio data, and the timestamp indicates the start time of the segment of audio data. In addition, a certain segment of audio data sent by the media player to the audio driver also carries the duration of the segment of audio data. When the media player sends a certain segment of audio data to the audio driver, the start time and duration of the segment of audio data can be obtained from the segment of audio data. As an example, when the media player sends the first segment of audio data to the audio driver, the start time and duration of the first segment of audio data can be obtained, and the end time of the first segment of audio data can be calculated. When the media player sends the second segment of audio data to the audio driver, the end time of the second segment of audio data can be calculated based on the start time and duration of the second segment of audio data. Therefore, when the media player sends the current audio data to the audio driver, it can obtain the start time and duration of the audio data currently output, and determine the end time of the audio data currently output. The media player determines the duration of the audio data that has been output in the second audio data stream by the duration of multiple audio data segments including the audio data currently output in the second audio data. For the sake of distinction, the duration of the audio data that has been output in the second audio data stream is referred to as the first duration.

[0092] 902. Obtain the duration of the audio data that has been played in the second audio data stream.

[0093] In some embodiments, the current audio data sent by the media player to the audio driver may not be the audio data currently played in the audio driver. Therefore, the duration of the audio data sent by the media player is not the same as the duration of the audio data played in the audio driver, and the media player needs to obtain the second duration of the audio data played in the second audio data stream. Every time the audio driver plays audio data, it records the duration of the audio data played. The media player can send a request to the audio driver to obtain the duration of the audio data played. After receiving the request, the audio driver sends the duration of the audio data stream played to the media player, and the duration of the second audio data stream played is called the second duration.

[0094] 903 , determining the current playing progress of the second audio data stream according to the end time of the currently output audio data, the duration of the output audio data in the second audio data stream, and the duration of the played audio data.

[0095] In some embodiments, the end time of the audio data currently output in the second audio data stream can be represented by T1, the first duration of the audio data output in the second audio data stream can be represented by S1, the second duration of the audio data played in the second audio data stream can be represented by S2, and the current playback progress of the second audio data stream can be represented by T. Then, the current playback progress of the second audio data stream satisfies the condition shown in the following formula: T=T1-(S1-S2).

[0096] In the second possible implementation, when the audio format of the audio data stream corresponding to the output video stream is ES format, the media player obtains the current playback progress of the first audio data stream, and synchronizes the first audio data stream and the video stream according to the current playback progress of the first audio data stream. Specifically, the playback progress of the first audio data stream can be obtained in the following manner, see Fig.10 shown.

[0097] 1001. A media player obtains a first start time of currently output audio data and a second start time and a third duration of last output audio data in a first audio data stream.

[0098] The third duration is the duration of the audio data output last time.

[0099] 1002. Obtain a fourth duration of audio data output before the current time included in the first audio data stream and a fifth duration of audio data currently played included in the first audio data stream.

[0100] For example, if the current output is the Nth output of the media player, then the output before the current output is the N-1th output. The media player determines the total duration of the audio data outputted before N-1 times as the fourth duration. The media player obtains the duration of the currently played audio data from the audio driver as the fifth duration.

[0101] 1003. Determine a current playback progress of the first audio data stream according to the first start time, the second start time, the third duration, the fourth duration, and the fifth duration.

[0102] In some embodiments, when determining the current playback progress of the first audio data stream based on the first start time, the second start time, the third duration, the fourth duration, and the fifth duration, it is first necessary to determine whether the audio data currently output by the media player will jump, and then determine the current playback progress of the first audio data stream based on different situations corresponding to whether the audio data currently output jumps. Fig.11 A method for determining the current playback progress of an audio data stream is shown, and the specific process is as follows:

[0103] 1101. Obtain a first start time, a second start time, and a third duration of a first audio data stream.

[0104] 1102. Determine whether the audio data currently outputted has a jump according to the first start time, the second start time, and the third duration of the first audio data stream.

[0105] In some embodiments, the end time of the last output audio data is determined based on the second start time and the third duration of the last output audio data, and whether the current audio data jumps is determined based on whether the end time of the last output audio data is continuous with the first start time.

[0106] In some scenarios, when the end time of the audio data output last time is continuous with the first start time, and the audio data output currently does not jump, step 1103 is executed.

[0107] In other scenarios, when the end time of the audio data output last time is not continuous with the first start time, the audio data output currently changes, and step 1104 is executed.

[0108] 1103. Determine a current playback progress of the first audio data stream according to the start time of the first audio data stream and the fifth duration.

[0109] Exemplarily, the fifth duration is represented by S3, the start time of the first audio data stream is represented by T2, and the current playback progress of the first audio data stream is represented by T. Then the current playback progress of the first audio data stream satisfies the condition shown in the following formula: T=T2+S3.

[0110] 1104, determine the jump status of the audio data currently output.

[0111] When the audio data currently output by the media player jumps, there are two cases: a large jump and a small jump. When the time difference obtained by subtracting the end time of the audio data output last time from the start time of the audio data output currently is greater than the first set threshold, this audio data jump is called a large jump. When the audio data output currently jumps large, execute step 1105. When the time difference obtained by subtracting the end time of the audio data output last time from the start time of the audio data output currently is less than the second set threshold, this audio data jump is called a small jump. When the audio data output currently is small, execute step 1107.

[0112] 1105, determine the jump time of the audio data currently output.

[0113] When the audio data currently outputted jumps up, the media player determines the end time of the last output audio data according to the second start time of the last output audio data before the current one and the third duration. The jump time is obtained according to the end time of the last output audio data and the first start time of the currently output audio data. Exemplarily, the end time of the last output audio data is represented by T3, the first start time of the currently output audio data is represented by T4, and the jump time is represented by S4, then the jump time satisfies the condition shown in the following formula: S4=T4-T3.

[0114] 1106 , determine the current playback progress of the first audio data stream according to the jump time, the fifth duration, and the start time of the first audio data stream.

[0115] In some embodiments, when the duration of the currently played audio data included in the first audio data stream is greater than the total duration of the audio data output before the current time included in the first audio data stream, that is, the fifth duration is greater than the fourth duration, the current playback progress of the first audio data stream is calculated according to the fifth duration and the jump time. Exemplarily, the fifth duration is represented by S3, and the current playback progress of the first audio data stream is represented by T, then the current playback progress of the first audio data stream is: T = T2 + S3 + S4.

[0116] In other embodiments, when the duration of the currently played audio data included in the first audio data stream is less than or equal to the total duration of the audio data output before the current time included in the first audio data stream, that is, the fifth duration is less than or equal to the fourth duration, the current playback progress of the first audio data stream is: T=T2+S3.

[0117] 1107, determine the skip time of the audio data currently output.

[0118] When the audio data currently output jumps to a smaller time, the media player determines the end time of the last output audio data according to the second start time of the last output audio data before the current time and the third duration. The time of the jump to a smaller time is obtained according to the end time of the last output audio data and the first start time of the currently output audio data. Exemplarily, the end time of the last output audio data is represented by T5, the first start time of the currently output audio data is represented by T6, and the time of the jump to a smaller time is represented by S5, then the time of the jump to a smaller time satisfies the condition shown in the following formula: S5 = T5-T6.

[0119] 1108. Determine the current playback progress of the first audio data stream according to the skip time, the fifth duration, and the start time of the first audio data stream.

[0120] In some embodiments, when the duration of the currently played audio data included in the first audio data stream is greater than the total duration of the audio data output before the current time included in the first audio data stream, that is, the fifth duration is greater than the fourth duration, the current playback progress of the first audio data stream is calculated according to the fifth duration and the skip time. Exemplarily, the fifth duration is represented by S6, and the current playback duration of the first audio data stream is represented by T, then the playback progress of the first audio data stream is: T = T2 + S6 + S5.

[0121] In other embodiments, when the duration of the currently played audio data included in the first audio data stream is less than or equal to the total duration of the audio data output before the current time included in the first audio data stream, that is, the fifth duration is less than or equal to the fourth duration, the playback progress of the first audio data stream is: T=T2+S6.

[0122] In some embodiments, when it is determined that the audio data outputted currently has a jump, the jump may not be analyzed for large or small jumps, and the current playback progress of the first audio data stream may be directly determined. For example, when the fourth duration of the audio data outputted before the current time included in the first audio data stream is less than or equal to the fifth duration of the audio data currently played included in the first audio data stream, the time corresponding to the sum of the start time of the first audio data stream and the fifth duration is determined to be the current playback progress of the first audio data stream. Alternatively, when the fourth duration of the audio data outputted before the current time included in the first audio data stream is greater than the fifth duration of the audio data currently played included in the first audio data stream, the difference between the first start time and the end time is determined to be the jump duration. The time corresponding to the sum of the start time, the fifth duration, and the jump duration of the first audio data stream is determined to be the current playback progress of the first audio data stream.

[0123] The solution provided by the embodiments of the present application is described below in conjunction with the accompanying drawings.

[0124] The present application embodiment provides a method for controlling an audio output mode. Fig.12 The flow of the method for controlling the audio output mode is exemplarily shown, and the method can be executed by a terminal device, or implemented by a media player 310 in the terminal device. The method is described by taking the media player 310 in the terminal device as an example, and for the sake of convenience of description, the identification of each component of the terminal device is not exemplified in the following.

[0125] 1201. A media player receives a first audio data stream, where an audio format used by the first audio data stream is a first format.

[0126] In some embodiments, the audio data stream adopts ES stream during transmission, so the audio format of the first audio data stream received by the media player is ES stream, that is, the first format is ES format.

[0127] 1202, the media player monitors the audio mode set by the user.

[0128] In some embodiments, the user can set different audio modes, for example, can switch from a first audio mode to a second audio mode. The output audio data stream formats indicated by the first audio mode and the second audio mode are respectively the first format and the second format. The media player monitors the audio mode set by the user, and outputs an audio data stream corresponding to the output audio data stream format indicated by the audio mode set by the user. For example, a monitoring module can be set in the media player, and the monitoring module can monitor the audio output mode set by the user in real time. When the monitoring module detects that the user switches the audio output mode, the media player is controlled to process the audio data of the audio data stream.

[0129] 1203. When the output audio data stream format indicated by the audio mode set by the user is a first format, output the first audio data stream; when the output audio data stream format indicated by the audio mode set by the user is a second format, decode the first audio data stream into a second audio data stream, and output the second audio data stream.

[0130] As an example, the audio data stream received by the media player is an ES stream. When the media player detects that the output audio data stream format indicated by the audio mode set by the user is in ES format, the media player directly outputs the received ES stream. When the media player detects that the output audio data stream format indicated by the audio mode set by the user is in PCM format, the received ES stream is decoded into a PCM stream and output.

[0131] Through the above scheme, the media player monitors the audio mode set by the user in real time. When the output audio data stream indicated by the audio mode set by the user is a PCM stream, the media player decodes the received ES stream to obtain a PCM stream and outputs the PCM stream. When the output audio data stream indicated by the audio mode set by the user is an ES stream, the media player directly outputs the received ES stream without processing it, thus avoiding the secondary encoding process and saving memory resources.

[0132] Optionally, the method for controlling the audio output mode may further include step 1204:

[0133] 1204, obtaining the current playing progress of the video stream and the audio data stream, and synchronizing the audio data stream and the video stream according to the current playing progress of the audio data stream.

[0134] In some embodiments, when the terminal device supports outputting not only audio data streams but also video streams, the media player may obtain the current playback progress of the audio data stream and synchronize the audio data stream and the video stream according to the current playback progress of the audio data stream.

[0135] In some scenarios, when the terminal device outputs a video stream and an audio data stream at the same time and the audio mode set by the user indicates that the audio format of the output audio data is in the second format, a video stream is obtained, which includes video data corresponding to the second audio data stream. The media player obtains the current playback progress of the second audio data stream, and synchronizes the second audio data stream and the video stream according to the current playback progress of the second audio data stream. Specifically, the media player obtains the start time and duration of the audio data currently output, determines the end time of the audio data currently output and the first duration of the audio data output in the second audio data stream, and obtains the second duration of the audio data played in the second audio data stream from the audio driver. The current playback progress of the second audio data stream is determined based on the end time, the first duration, and the second duration, and the current playback progress of the second audio satisfies the conditions shown in the following formula:

[0136] T = T1 - (S1 - S2);

[0137] Among them, T is the current playback progress of the second audio data stream; T1 is the end time of the currently output audio data, S1 is the first duration, and S2 is the second duration.

[0138] The play progress of the video stream is adjusted according to the obtained play progress of the second audio data stream, so that the second audio data stream and the video stream are played synchronously.

[0139] In other scenarios, when the terminal device outputs a video stream and an audio data stream at the same time and the audio mode set by the user indicates that the audio format of the output audio data is a first format, a video stream is obtained, which includes video data corresponding to the first audio data stream. The media player obtains the current playback progress of the first audio data stream, and synchronizes the first audio data stream and the video stream according to the current playback progress of the first audio data stream. Specifically, the media player obtains the first start time of the audio data currently output and the second start time and the third duration of the audio data last output in the first audio data stream; obtains the fourth duration of the audio data output before the current time included in the first audio data stream and the fifth duration of the currently played audio data included in the first audio data stream; determines the current playback progress of the first audio data stream according to the first start time, the second start time, the third duration, the fourth duration and the fifth duration.

[0140] In some embodiments, the media player determines the end time of the audio data output last time according to the second start time and the third duration of the audio data output last time. When the end time of the audio data output last time is continuous with the first start time, the time corresponding to the sum of the start time of the first audio data stream and the fifth duration is determined as the current playback progress of the first audio data stream.

[0141] In other embodiments, the media player determines the end time of the last output audio data according to the second start time and the third duration of the last output audio data. When the end time of the last output audio data is discontinuous with the first start time, and the fourth duration is less than or equal to the fifth duration, the time corresponding to the sum of the start time of the first audio data stream and the fifth duration is determined as the current playback progress of the first audio data stream; or, the end time of the last output audio data is determined according to the second start time and the third duration of the last output audio data; when the last output audio data is discontinuous with the first start time, and the fourth duration is greater than the fifth duration, the time corresponding to the sum of the start time of the first audio data stream, the fifth duration, and the time difference is determined as the current playback progress of the first audio data stream, wherein the time difference is the difference between the first start time and the end time.

[0142] The play progress of the video stream is adjusted according to the current play progress of the first audio data stream, so that the first audio data stream and the video stream are played synchronously.

[0143] Based on the same technical concept, the present application provides a control device for an audio output mode, and the control device 1300 can execute each step in the above method, which will not be described in detail here to avoid repetition.

[0144] The acquiring unit 1301 is configured to acquire a first audio data stream, where the audio format adopted by the first audio data stream is a first format;

[0145] Monitoring unit 1302, used to monitor the audio mode set by the user;

[0146] The processing unit 1303 is configured to output the audio data included in the first audio data stream when the output audio data stream format indicated by the audio mode is the first format; or, when the output audio data stream format indicated by the audio mode is the second format, decode the first audio data stream into a second audio data stream and output the audio data included in the second audio data stream, wherein the audio format adopted by the second audio data stream is the second format. The specific processing method of the processing unit 1303 can be found in the previous description and will not be repeated here.

[0147] Based on the same technical concept, the present application provides a control device 1400 for an audio output mode, which can execute each step in the above method. To avoid repetition, the control device 1400 is not described in detail. The control device 1400 includes a communication interface 1401 , a processor 1402 and a speaker 1403 .

[0148] In some embodiments, the communication interface 1401 is used to receive a first audio data stream, and the audio format used by the first audio data stream is a first format. The processor 1402 is used to monitor the audio mode set by the user; when the output audio data stream format indicated by the audio mode is the first format, the audio data included in the first audio data stream is output to the speaker; or when the output audio data stream format indicated by the audio mode is a second format, the first audio data stream is decoded into a second audio data stream, and the audio data included in the second audio data stream is output to the speaker, and the audio format used by the second audio data stream is the second format. The speaker 1403 is used to receive and output the audio data sent by the processor.

[0149] Based on the same technical concept, the present application provides a control device 1500 for an audio output mode. The control device 1500 includes: a processor 1501 and a memory 1502 .

[0150] Memory 1501, used for storing program instructions;

[0151] The processor 1502 is used to call the program instructions stored in the memory and execute the above-mentioned audio output mode control method according to the obtained program.

[0152] In the embodiments of the present application, the processor may be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0153] As a non-volatile computer-readable storage medium, the memory can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory can include at least one type of storage medium, for example, it can include flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), programmable read-only memory (Programmable Read Only Memory, PROM), read-only memory (Read Only Memory, ROM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), magnetic memory, disk, CD, etc. The memory is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0154] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0155] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0156] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0157] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0158] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for controlling an audio output mode, It is characterized in that include: The media player receives a first audio data stream, where the audio format adopted by the first audio data stream is a first format; The media player monitors the audio mode set by the user; When the output audio data stream format indicated by the audio mode is a first format, outputting the audio data included in the first audio data stream; When the output audio data stream format indicated by the audio mode is the second format, decoding the first audio data stream into a second audio data stream, and outputting the audio data included in the second audio data stream, wherein the audio format adopted by the second audio data stream is the second format; The first format is a basic code stream format, and the second format is a pulse code modulation format.

2. The method according to claim 1, It is characterized in that When the output audio data stream format indicated by the audio mode is a second format, the method further includes: receiving a video stream, wherein the video stream includes video data corresponding to the second audio data stream; Obtaining the end time of the audio data currently output, and obtaining the first duration of the audio data output in the second audio data stream; Obtaining a second duration of the audio data played in the second audio data stream; Determine a current playback progress of the second audio data stream according to the end time, the first duration, and the second duration; The second audio data stream and the video stream are synchronized according to the current playing progress of the second audio data stream.

3. The method according to claim 2, It is characterized in that Determining a current playback progress of the second audio data stream according to the end time, the first duration, and the second duration includes: The current playback progress of the second audio data stream is determined by the following formula; T = T1 - (S1 - S2); Among them, T is the current playback progress of the second audio data stream; T1 is the end time of the currently output audio data, S1 is the first duration, and S2 is the second duration.

4. The method according to claim 1, It is characterized in that When the output audio data stream format indicated by the audio mode is a first format, the method further includes: Acquire a video stream, where the video stream includes video data corresponding to the first audio data stream; Obtain a first start time of the currently output audio data and a second start time and a third duration of the last output audio data in the first audio data stream; Acquire a fourth duration of audio data output before the current time included in the first audio data stream and a fifth duration of audio data currently played included in the first audio data stream; Determine a current playback progress of the first audio data stream according to the first start time, the second start time, the third duration, the fourth duration, and the fifth duration; The first audio data stream and the video stream are synchronized according to the current playing progress of the first audio data stream.

5. The method according to claim 4, It is characterized in that Determining a current playback progress of the first audio data stream according to the first start time, the second start time, the third duration, the fourth duration, and the fifth duration includes: According to the second start time of the last output audio data and the end time determined by the third duration, when they are continuous with the first start time, the time corresponding to the sum of the start time of the first audio data stream and the fifth duration is determined as the current playback progress of the first audio data stream.

6. The method according to claim 4, It is characterized in that Determining a current playback progress of the first audio data stream according to the first start time, the second start time, the third duration, the fourth duration, and the fifth duration includes: When the end time determined according to the second start time of the last output of the audio data and the third duration is not continuous with the first start time, and the fourth duration is less than or equal to the fifth duration, determining the time corresponding to the sum of the start time of the first audio data stream and the fifth duration as the current playback progress of the first audio data stream; or, When the end time determined according to the second start time of the last output of the audio data and the third duration is not continuous with the first start time, and the fourth duration is greater than the fifth duration, determining that the time corresponding to the sum of the start time of the first audio data stream, the fifth duration, and the time difference is the current playback progress of the first audio data stream; The time difference value is the difference between the first start time and the end time.

7. A control device for an audio output mode, It is characterized in that including a communication interface, a processor and a speaker; The communication interface is used to receive a first audio data stream, where the audio format used by the first audio data stream is a first format; The processor is configured to monitor an audio mode set by a user; when the output audio data stream format indicated by the audio mode is a first format, output the audio data included in the first audio data stream to the speaker; when the output audio data stream format indicated by the audio mode is a second format, decode the first audio data stream into a second audio data stream, output the audio data included in the second audio data stream to the speaker, and the audio format adopted by the second audio data stream is the second format; The speaker is used to receive and output the audio data sent by the processor; The first format is a basic code stream format, and the second format is a pulse code modulation format.

8. The device according to claim 7, It is characterized in that The communication interface is further used to receive a video stream, wherein the video stream includes video data corresponding to the second audio data stream; The processor is further used to obtain the end time of the audio data currently output, and obtain the first duration of the audio data output in the second audio data stream; obtain the second duration of the audio data played in the second audio data stream; determine the current playback progress of the second audio data stream based on the end time, the first duration and the second duration; and synchronize the second audio data stream and the video stream based on the current playback progress of the second audio data stream.

9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on a computer, the computer is enabled to execute the method according to any one of claims 1 to 6.