Audio playing method and related equipment

By retrieving audio frames from the secondary core's storage space and decoding and playing them, the high power consumption problem caused by frequent communication between the main core and the secondary core is solved, improving the battery life and user experience of wearable devices.

CN121807256APending Publication Date: 2026-04-07HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

In wearable devices, when playing audio based on a multi-core architecture, the frequent communication between the main core and the secondary core leads to high power consumption, reducing the overall battery life of the device.

Method used

By retrieving audio frames from the secondary core's storage space and decoding and playing them, the data transfer and wake-up between the main core and the secondary core are reduced, and the audio playback frequency is dynamically adjusted using frequency adjustment commands.

Benefits of technology

It reduces the power consumption of communication between the main core and the secondary core, thereby improving the overall battery life and user experience of the terminal device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121807256A_ABST
    Figure CN121807256A_ABST
Patent Text Reader

Abstract

The invention relates to an audio playing method and related equipment. And the main core of the terminal equipment responds to an audio playing starting operation of a user and sends a playing instruction to the auxiliary core. The auxiliary core responds to the playing instruction and sets the playing frequency. And the auxiliary core obtains the audio frame of the sound source file from the storage space of the auxiliary core, decodes the audio frame to obtain audio decoding data in a preset format, and plays the audio decoding data based on the playing frequency. According to the invention, the auxiliary core can obtain the audio frame of the sound source file from the local storage space and play the audio frame, so that the main core is prevented from frequently obtaining the sound source file and interacting with the auxiliary core, the power consumption of dual-computer communication data transmission between the main core and the auxiliary core is reduced, the power consumption caused by frequently waking up a host is avoided, and the data transmission efficiency is improved. And the whole-machine cruising ability of the terminal equipment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of audio technology, and in particular to audio playback methods and related equipment. Background Technology

[0002] Wearable devices such as smartwatches are widely used. To improve the processing performance and enrich service functions of wearable devices, they typically adopt a multi-core architecture. However, based on the multi-core architecture, when the wearable device plays some audio (such as sports beats), it needs to frequently wake up the main core and transmit data to the secondary core (such as the audio module). This results in high power consumption of the main core and the dual-machine communication between the main core and the secondary core, reducing the overall battery life of the wearable device. Summary of the Invention

[0003] In view of the above, it is necessary to provide an audio playback method, a terminal device, and a computer storage medium to reduce the power consumption of the device.

[0004] In a first aspect, embodiments of this application provide an audio playback method applied to a terminal device. The terminal device includes a main core and a secondary core. The method includes: the main core responding to a user's operation to initiate audio playback by sending a playback command to the secondary core; the secondary core initializing in response to the playback command, including setting a playback frequency; the secondary core obtaining audio frames of an audio source file from its storage space and decoding the audio frames to obtain audio decoding data in a preset format; and the secondary core playing the audio decoding data based on the playback frequency.

[0005] Through the above technical solution, after receiving the playback command sent by the main core, the secondary core can obtain the audio frames of the audio source file from the secondary core and play them. This avoids the main core frequently obtaining the audio source file and interacting with the secondary core, thereby reducing the power consumption of dual-machine communication data transmission between the main core and the secondary core, and avoiding the power consumption caused by frequently waking up the host, thus improving the overall battery life of the terminal device.

[0006] In some embodiments of this application, the method further includes: the main core sending a frequency adjustment command to the secondary core; and the secondary core adjusting the playback frequency of the audio frame according to the frequency adjustment command. In the above technical solution, the secondary core can automatically adjust the playback frequency of the audio frame according to the frequency adjustment command sent by the main core, thereby achieving adjustment of the playback frequency of the audio source file.

[0007] In some embodiments of this application, the main core sending a frequency adjustment command to the sub-core includes: displaying a metronome function interface, which includes a beat count setting control; if user touches the beat count setting control, displaying a setting interface, which provides a selection box control for selecting a playback frequency; if user selects a target playback frequency through the selection box control, the main core generates a frequency adjustment command and sends it to the sub-core, wherein the frequency adjustment command includes the target playback frequency. With the above technical solution, users can set the playback frequency of an audio source file through the metronome function interface, improving the user experience.

[0008] In some embodiments of this application, the audio frame includes a valid frame and a silence frame. The sub-core adjusts the playback frequency of the audio frame according to a frequency adjustment command, including: the sub-core determining the length of the silence frame based on the target playback frequency in the frequency adjustment command; the sub-core reading the audio data stream of the valid frame from the audio source file, and reading the audio data stream of the silence data according to the length of the silence frame; and demultiplexing the audio data stream of the valid frame and the audio data stream of the silence data to obtain the audio frame. The above technical solution can read the audio data stream of the silence data according to the length of the silence frame, and demultiplex the read audio data stream to obtain the audio frame. Thus, by adjusting the silence data in the audio frame, the playback frequency of the audio source file can be dynamically adjusted.

[0009] In some embodiments of this application, the sub-core determines the length of the silence frame based on the target playback frequency by: determining the period of the target playback frequency; and determining the length of the silence frame based on the bitrate of the audio frame, the length of the effective frame, and the period. The above technical solution can accurately determine the length of the silence frame based on the bitrate of the audio frame, the length of the effective frame, and the period of the target playback frequency.

[0010] In some embodiments of this application, before the main core responds to the user's operation to start audio playback, the method further includes: displaying a metronome function interface, which includes playback controls; if the playback controls are in a paused state and user touch on the playback controls is detected, the main core determines that it has received an operation to start audio playback. This technical solution allows users to start audio playback by operating the playback controls on the metronome function interface, improving the user experience.

[0011] In some embodiments of this application, the method further includes: if the playback control is in a playback state and user touch on the playback control is detected, the main core determines that an operation to turn off audio playback has been received; in response to the operation to turn off audio playback, playback of audio decoding data is stopped. The above technical solution allows users to turn off audio playback by operating the playback control on the metronome function interface, improving the user experience.

[0012] In some embodiments of this application, the main core responds to the user's operation to initiate audio playback by sending a playback instruction to the secondary core, including: if audio playback has the highest priority among the services already started on the terminal device, sending a playback instruction to the secondary core.

[0013] In some embodiments of this application, the process of the secondary core retrieving audio frames from the audio source file's storage space includes: the secondary core reading an audio data stream from its storage space; and demultiplexing the audio data stream to obtain audio frames. In the above technical solution, the secondary core retrieves and plays the audio frames from the audio source file's storage space, reducing the power consumption caused by the main core frequently retrieving the audio source file and interacting with the secondary core.

[0014] In some embodiments of this application, the method further includes: after sending a playback command to the sub-core, activating the power amplifier device of the terminal device.

[0015] In some embodiments of this application, playing audio decoded data includes playing the audio decoded data through a power amplifier device. In the above technical solution, the secondary core is capable of playing audio decoded data through a power amplifier device.

[0016] Secondly, embodiments of this application provide a terminal device, which includes a memory and a processor: the memory is used to store program instructions; the processor includes a main core and a sub-core, which are used to read and execute the program instructions stored in the memory, and when the program instructions are executed by the main core and the sub-core, the terminal device executes the above-mentioned audio playback method.

[0017] Thirdly, some embodiments of this application provide a computer storage medium storing program instructions that, when executed on a terminal device, cause the terminal device to perform the aforementioned audio playback method.

[0018] Fourthly, some embodiments of this application provide a computer program product, including computer program instructions, which, when executed by a processor, implement the above-described audio playback method.

[0019] Furthermore, the technical effects brought about by the second to fourth aspects can be found in the descriptions of the methods in the above-mentioned method section, and will not be repeated here. Attached Figure Description

[0020] Figure 1 This is a hardware structure diagram of a terminal device provided in an embodiment of this application.

[0021] Figure 2 This is a schematic flowchart of an audio playback method provided in an embodiment of this application.

[0022] Figure 3 This is a hardware structure diagram of a terminal device provided in another embodiment of this application.

[0023] Figure 4 A flowchart of an audio playback method provided in an embodiment of this application.

[0024] Figure 5 This is a schematic diagram of the metronome function interface provided in some embodiments of this application.

[0025] Figure 6 This is a flowchart illustrating a method for adjusting the beat sound of a movement according to an embodiment of this application.

[0026] Figure 7 This is a schematic diagram of the user interface for operating the metronome function provided in some embodiments of this application.

[0027] Figure 8 This is a schematic diagram illustrating the format of audio source files provided in some embodiments of this application.

[0028] Figure 9 A flowchart of an audio playback method provided in an embodiment of this application.

[0029] Figure 10 This is a schematic diagram of the hardware structure of a terminal device provided in some embodiments of this application. Detailed Implementation

[0030] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of some embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in some embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terminology used in this application's specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. It should be understood that, unless otherwise stated, " / " in this application means "or". For example, A / B can mean A or B. In some embodiments of this application, "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. "At least one" refers to one or more. "More than one" refers to two or more. For example, at least one of a, b, or c can represent: a, b, c, a and b, a and c, b and c, and a, b, and c (seven cases).

[0032] Wearable devices such as smartwatches are widely used. To improve the processing performance and enrich service functions of wearable devices, they typically adopt a multi-core architecture. However, based on the multi-core architecture, when the wearable device plays some audio (such as sports beats), it needs to frequently wake up the main core and transmit data to the secondary core (audio module). This results in high power consumption of the main core and the dual-machine communication between the main core and the secondary core, reducing the overall battery life of the wearable device.

[0033] refer to Figure 1 The diagram shown is a hardware structure diagram of a terminal device provided in an embodiment of this application. An audio playback method is applied in the terminal device. The terminal device 100 includes a file system 11, a main core 12, a secondary core 13, and a power amplifier module 14. The file system 11 is connected to the main core 12, the main core 12 is connected to the secondary core 13, and the secondary core 13 is connected to the power amplifier module 14. The file system 11 stores audio source files; for example, the audio source files may include motion beat sound data. In some embodiments of this application, the file system 11 can be a storage system composed of embedded memory.

[0034] The main core 12 is connected to the file system 11 via a Secure Digital Input and Output (SDIO) interface. In some embodiments of this application, the main core 12 is provided with a first SDIO interface, and the file system 11 is provided with a second SDIO interface, with the first SDIO interface of the main core 12 connected to the second SDIO interface of the file system 11. The main core 12 can read audio source files from the file system 11 through the SDIO interface (such as the connection between the first SDIO interface and the second SDIO interface).

[0035] The main core 12 can also be connected to the secondary core 13 through a serial peripheral interface (SPI), a universal asynchronous receiver / transmitter (UART) interface, or a general purpose input / output (GPIO) interface.

[0036] In some embodiments of this application, the main core 12 is provided with a first SPI interface, a first UART interface, and a first GPIO interface, while the secondary core 13 is provided with a second SPI interface, a second UART interface, and a second GPIO interface. The first SPI interface of the main core 12 is connected to the second SPI interface of the secondary core 13. The main core 12 and the secondary core 13 can interact with each other through the SPI interface (such as the first SPI interface and the second SPI interface).

[0037] In some embodiments of this application, the first UART interface of the main core 12 is connected to the second UART interface of the secondary core 13. The main core 12 and the secondary core 13 can interact with each other through the UART interface (such as the first UART interface and the second UART interface).

[0038] In some embodiments of this application, the first GPIO interface of the main core 12 is connected to the second GPIO interface of the secondary core 13. The main core 12 can wake up the secondary core 13 to start working through the GPIO interface (such as the first GPIO interface and the second GPIO interface).

[0039] In some embodiments of this application, the sub-core 13 is connected to the power amplifier module 14 via an integrated circuit built-in audio bus (Inter-IC Sound, I2S) and an internal integrated circuit bus (Inter-Integrated Circuit, I2C). In some embodiments of this application, the sub-core 13 interacts with the power amplifier module 14 via the I2S bus for command communication and with the power amplifier module 14 via the I2C bus for data communication.

[0040] refer to Figure 2 As shown, combined with the following Figure 1 The hardware architecture diagram of the terminal device shown illustrates the specific process of the audio playback method.

[0041] The main core responds to the user's request to initiate audio playback and determines whether to execute the audio playback service. If it determines to execute the audio playback service, it sends a playback command to the secondary core. The secondary core responds to the playback command by performing initialization operations and sending a start command to the power amplifier module 14 to start the power amplifier module 14.

[0042] After initialization, the secondary core 13 and the primary core execute the audio playback process, including: the secondary core 13 sending a data acquisition request to the primary core 12; the primary core 12 responding to the data acquisition request reading the audio data stream corresponding to an audio frame from the audio source file in the file system 11, demultiplexing the read audio data stream to obtain an audio frame, and sending the audio frame to the secondary core 13; the secondary core 13 storing the audio frame in a preset buffer, then retrieving the audio frame from the preset buffer and decoding it to obtain an audio frame of a preset format; and the secondary core 13 sending the audio frame of the preset format to the power amplifier module 14 for playback. After completing the playback of an audio frame, the secondary core 13 sets the preset flag of the played audio frame to a preset value, enabling the secondary core and the primary core to continue executing the audio playback process to play the next audio frame. However, during the audio playback process of each audio frame, the main core 12 is woken up to obtain the audio frame and send it to the secondary core 13. This results in high power consumption of the main core and the dual-machine communication between the main core and the secondary core, reducing the overall battery life of the wearable device.

[0043] To address the high power consumption issue of the aforementioned terminal devices during audio playback, this application provides an audio playback method. The method is applied in... Figure 3 In the terminal device shown. (Reference) Figure 3 The diagram shown is a hardware structure diagram of a terminal device provided in another embodiment of this application. Figure 3 The structure of the terminal device shown is similar to Figure 1 The structures shown are basically the same; the difference between the two terminal devices lies in their structures. Figure 3 The secondary core 13 of the terminal device shown stores the audio data stream of the audio source file in its storage space (such as the storage space corresponding to the preset storage address). The secondary core 13 directly reads the audio data stream of the audio source file from the storage space and obtains the audio frames corresponding to the audio data stream, thus eliminating the need to obtain audio frames from the main core 12. The following is a combination of... Figure 3 The hardware structure of the terminal device shown in this application illustrates the audio playback method in the embodiments.

[0044] refer to Figure 4 The diagram shown is a flowchart of an audio playback method provided in an embodiment of this application. Figure 4 The example method includes one or more steps, but does not constitute a limitation of this application. Furthermore, the order of the steps in the method is merely illustrative and may be changed. Additional steps may be added or steps may be removed without departing from the disclosure of this application. The method includes the following steps.

[0045] In step S401, the main core responds to the user's operation to initiate audio playback and determines whether to execute the audio playback service. In some embodiments of this application, if it is determined that the audio playback service should be executed, step S402 is executed. If it is determined that the audio playback service should not be executed, the process returns to step S401, and the system can continue to detect whether the user has executed the operation to initiate audio playback.

[0046] The following example, using a smartwatch as the terminal device and a beat-based audio file as the audio source file, illustrates the audio playback method in this application. (Reference) Figure 5 As shown, in some embodiments of this application, the smartwatch displays a metronome function interface, through which the user can start audio playback.

[0047] refer to Figure 5 The diagram shows a metronome function interface provided in some embodiments of this application. The metronome function interface 50 includes a beat count setting control 51 and a playback control 52. The beat count setting control 51 is used to set the playback frequency of the beat sound, which can be expressed as the number of times the beat sound is played per minute. The playback control 52 is used to start or pause the playback of the beat sound. The playback control 52 includes a playback state and a pause state; the default state of the playback control 52 is the pause state. In some embodiments of this application, if the playback control 52 on the metronome function interface is in the pause state, the user can start audio playback by touching the playback control 52. In some embodiments of this application, if the playback control 52 on the metronome function interface is in the pause state and the user touches the playback control 52, the main core determines that it has received the user's operation to start audio playback and determines whether to execute the audio playback service in response to the user's operation to start audio playback.

[0048] In some embodiments of this application, if the audio playback service has the highest priority among the services already started on the smartwatch, the audio playback service is determined to be executed. If the audio playback service does not have the highest priority among the services already started on the smartwatch, the audio playback service is determined not to be executed. For example, if the smartwatch is currently in a call, since the call service has the highest priority, the audio playback service will not be executed even if it is triggered.

[0049] In step S402, the main core sends a playback command to the secondary core.

[0050] In some embodiments of this application, the main core sends playback instructions to the sub-core through a first SPI interface, and the sub-core receives playback instructions through a second SPI interface.

[0051] In step S403, the secondary core responds to the playback command to initialize and sends a start command to the power amplifier module to start the power amplifier module.

[0052] In some embodiments of this application, the sub-core's initialization in response to a playback command includes: initializing the playback frequency of the beat tone, for example, setting the playback frequency of the beat tone to 120Hz. Initializing the playback frequency of the beat tone includes setting the playback frequency of the beat tone to a preset frequency. The sub-core also sends a start command to the power amplifier module in response to the playback command to start the power amplifier module. For example, the power amplifier module is initially in a sleep state. Upon receiving the start command from the sub-core, the power amplifier module exits the sleep state and enters the working state.

[0053] In step S404, the sub-core retrieves an audio frame from the stored audio source file.

[0054] In some embodiments of this application, the sub-core obtaining an audio frame from a stored audio source file includes: the sub-core reading the audio data stream corresponding to an audio frame from the storage space; and demultiplexing the read audio data stream to obtain an audio frame. In one embodiment of this application, demultiplexing refers to the operation of removing non-audio data from the audio data stream and obtaining a complete audio frame.

[0055] In some embodiments of this application, the audio source file format includes Musical Instrument Digital Interface (MIDI) format, Subband Coding (SBC) format, and Pulse-Code Modulation (PCM) format. This application does not limit the format of the audio source file.

[0056] In step S405, the secondary core stores the audio frames in a preset buffer.

[0057] In some embodiments of this application, the secondary core stores audio frames in its ping-pong buffer or double buffer. The data storage efficiency of audio frames is improved by alternately using the two buffer units of the ping-pong buffer. For example, when one buffer unit is writing an audio frame, the other buffer unit can be used to read data.

[0058] In step S406, the secondary core retrieves audio frames from the preset cache and decodes the audio frames to obtain audio frames in the preset format.

[0059] In some embodiments of this application, decoding an audio frame to obtain an audio frame of a preset format includes: decoding the audio frame to obtain PCM format audio decoding data.

[0060] In step S407, the sub-core sends the audio frame in the preset format to the power amplifier module and plays the audio frame through the power amplifier module.

[0061] In some embodiments of this application, the secondary core sends audio frames of a preset format to the power amplifier module via the I2C bus. The power amplifier module stores the audio frames of the preset format in an in-flight order (IFO) buffer, retrieves the audio frames of the preset format from the IFO, amplifies the audio frames, and plays them. In some embodiments of this application, the power amplifier module is an active speaker.

[0062] In step S408, the main core determines whether it has received user input to stop audio playback.

[0063] refer to Figure 5 As shown, if the playback control 52 on the metronome function interface is in playback mode, the user can stop audio playback by touching the playback control 52. In some embodiments of this application, if the playback control 52 on the metronome function interface is in playback mode and the user's touch operation on the playback control 52 is detected, the main core determines that it has received the user's input to stop audio playback.

[0064] In some embodiments of this application, if a user sends an operation to stop audio playback, step S409 is executed; if no user sends an operation to stop audio playback, step S404 is executed, causing the sub-core to obtain the next audio frame from the stored audio source file for playback.

[0065] In step S409, the main core sends a stop playback command to the secondary core.

[0066] In some embodiments of this application, the master core sends a stop playback command to the slave core through a first SPI interface, and the slave core receives the stop playback command through a second SPI interface.

[0067] In step S410, in response to the stop playback command, the secondary core performs deinitialization.

[0068] In some embodiments of this application, deinitialization is the reverse process of initialization. Deinitialization of the sub-core includes restoring the playback frequency of the beat tone from a preset frequency to an initial value (such as the initial setting of 120Hz mentioned above).

[0069] Step S411: The sub-core sends a shutdown command to the power amplifier module to shut down the power amplifier.

[0070] In some embodiments of this application, the power amplifier module, upon receiving a shutdown command from the sub-core, exits the working state and enters a sleep state.

[0071] In this embodiment, after receiving the playback command sent by the main core, the secondary core can obtain the audio frames of the audio source file from the secondary core and play them, avoiding obtaining the audio source file from the main core. This reduces the power consumption of dual-machine communication data transmission between the main core and the secondary core, and avoids the power consumption caused by frequently waking up the host, thereby improving the overall battery life of the terminal device.

[0072] In some embodiments of this application, the method further includes: responding to a user's frequency adjustment operation, the main core sends a frequency adjustment command to the secondary core; the secondary core adjusts the playback frequency of the audio frame according to the frequency adjustment command.

[0073] The following combination Figure 6 This application provides a detailed description of the method and process for adjusting the rhythmic sound of a movement in its embodiments. Figure 6 The example method includes one or more steps, but does not constitute a limitation of this application. Furthermore, the order of the steps in the method is merely illustrative and may be changed. Additional steps may be added or steps may be removed without departing from the disclosure of this application. Figure 6 The method shown includes the following steps.

[0074] In step S601, the main core responds to the user's input frequency adjustment operation and sends a frequency adjustment command to the sub-core.

[0075] refer to Figure 7 The diagram shown illustrates a user interface for operating a metronome, as provided in some embodiments of this application. (See reference...) Figure 7 As shown in (1), the user can input frequency adjustment operations to the smartwatch by touching the beat number setting control 51 on the metronome function interface 50. If the user touches the beat number setting control 51, the main core displays... Figure 7 The settings interface 70 is shown in (2) above. The settings interface 70 includes a selection box control 71 and a confirmation control 72. After the user selects the playback frequency to be adjusted (the playback frequency to be adjusted can also be called the target playback frequency) through the selection box control 71 and touches the confirmation control 72, the main core generates a frequency adjustment command and sends a frequency adjustment command to the sub-core. The adjustment command includes the target playback frequency selected by the user.

[0076] In step S602, the secondary core receives the frequency adjustment command sent by the primary core and adjusts the length of the silent frame according to the target playback frequency in the frequency adjustment command.

[0077] refer to Figure 8The diagram illustrates the format of an audio source file provided in some embodiments of this application. In some embodiments of this application, the audio frames of the audio source file include valid frames and silence frames. Valid frames have a first initial duration; for example, if the first initial duration is labeled A, it can be 50ms. Silence frames have a second initial duration; for example, if the second initial duration is labeled B, it can be 150ms. The valid frames represent actual motion beat sound data, while the data in the silence frames can be 0.

[0078] In some embodiments of this application, the sub-core calculates the period (marked as T) of the target playback frequency based on the target playback frequency (e.g., the target playback frequency is marked as F), where T = 1 / F; calculates the length of the silence data based on L = M × (TA), where M is the bit rate of the audio frame and L is the length of the silence data; adjusts the length of the silence frame based on the length of the silence data so that the playback frequency can be dynamically adjusted based on the length of the silence frame.

[0079] For example, if the current playback frequency is 20Hz, the corresponding period is 50ms, and the audio frame bitrate is 256kbps, then the length of the audio frame corresponding to the current playback frequency is 50ms x 256kbps = 1600 bytes. In this case, the secondary core only needs to read 1600 bytes of valid frame data from the audio source file for playback, thus achieving playback of the audio source file at a 20Hz playback frequency. If the current playback frequency needs to be adjusted from 20Hz to 10Hz, that is, the target playback frequency is 10Hz, and the corresponding period is 100ms, the secondary core calculates the length of the silence data according to L = M x (TA) as (100ms - 50ms) x 256kbps = 1600 bytes. After reading 1600 bytes of valid frame data from the audio source file, the secondary core then reads 1600 bytes of silence data from the audio frame for playback, thus adjusting the playback frequency of the audio source file from 20Hz to 10Hz.

[0080] In step S603, the sub-core reads the audio data stream of the valid frames from the stored audio source file, and reads the audio data stream of the silence data according to the length of the silence frame, and demultiplexes all the read audio data streams to obtain audio frames.

[0081] In one embodiment of this application, demultiplexing refers to the operation of removing non-audio data from an audio data stream and obtaining a complete audio frame.

[0082] In step S604, the secondary core stores the audio frames in a preset buffer.

[0083] In step S605, the secondary core retrieves audio frames from the preset cache and decodes the audio frames to obtain audio frames in the preset format.

[0084] In some embodiments of this application, the sub-core decodes audio frames to obtain PCM format audio decoded data.

[0085] In step S606, the sub-core sends the audio frame in the preset format to the power amplifier module and plays the audio frame through the power amplifier module.

[0086] In some embodiments of this application, after the sub-core sends an audio frame of a preset format to the power amplifier module, the power amplifier module amplifies the audio frame and plays it.

[0087] In this embodiment, the secondary core receives a frequency adjustment command sent by the primary core, determines the length of the silence frame according to the target playback frequency in the frequency adjustment command, reads the audio data stream of the valid frame from the stored audio source file, reads the audio data stream of the silence data according to the length of the silence frame, and demultiplexes the read audio data stream to obtain the audio frame. In this way, the playback frequency of the audio source file can be dynamically adjusted by adjusting the silence data in the audio frame.

[0088] refer to Figure 9 The diagram shown is a flowchart of an audio playback method provided in an embodiment of this application. Figure 9 The example method includes one or more steps, but does not constitute a limitation of this application. Furthermore, the order of the steps in the method is merely illustrative and may be changed. Additional steps may be added or steps may be removed without departing from the disclosure of this application. The method includes the following steps.

[0089] In step S901, the main core responds to the user's operation to start audio playback and sends a playback command to the secondary core.

[0090] Step S902: The secondary core responds to the playback command and performs initialization, including: initializing and setting the playback frequency.

[0091] In step S903, the secondary core retrieves the audio frames of the audio source file from its storage space and decodes the audio frames to obtain audio decoding data in a preset format.

[0092] In step S904, the sub-core plays the audio decoding data based on the playback frequency.

[0093] The specific implementation details of step S901 in this embodiment can be found by referring to... Figure 4 The descriptions of S401 to S402 shown are illustrated. For the specific implementation details of step S902, please refer to... Figure 4 The description of S403 shown, and the specific implementation details of step S903 can be found by referring to... Figure 4 The descriptions of S403 to S406 shown, and the specific implementation details of step S904 can be found by referring to... Figure 4 The descriptions of S407 to S408 shown herein will not be repeated in this application.

[0094] In this embodiment, after receiving the playback command sent by the main core, the secondary core can obtain the audio frames of the audio source file from the storage space of the secondary core and play them, avoiding obtaining the audio source file from the main core. This reduces the power consumption of dual-machine communication data transmission between the main core and the secondary core, and avoids the power consumption caused by frequently waking up the host, thereby improving the overall battery life of the terminal device.

[0095] The terminal devices in this application include wearable devices with displays such as smartwatches, smart bracelets, and smart glasses. This application does not impose any limitations on these devices.

[0096] refer to Figure 10 This is a schematic diagram of the hardware structure of a terminal device provided for some embodiments of this application. For example... Figure 10 As shown, the terminal device 100 may include a processor 110, a memory 120, a display screen 130, a power module 140, a sensor module 151, a positioning module 160, etc. The sensor module 151 may include a touch sensor 152, etc.

[0097] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the terminal device 100. In other embodiments of this application, the terminal device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0098] The processor 110 may include one or more processing units, such as an application processor (AP), a modem processor, an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), etc. These different processing units may be independent devices or integrated into one or more processors.

[0099] The controller can serve as the central nervous system and command center of the terminal device 100. The controller can generate operation control signals based on the instruction opcode and timing signals to control the fetching and execution of instructions.

[0100] An operating system for electronic device 100 can be installed on the application processor to manage the hardware and software resources of electronic device 100. This includes managing and configuring memory, determining the priority of system resource allocation, controlling input and output devices, operating the network, managing the file system, and managing drivers. The operating system can also provide a user interface for interacting with the system. Various types of software can be installed within the operating system, such as drivers and applications (Apps).

[0101] Memory 120 is used to store instructions and data. In some embodiments, memory 120 is a cache memory. This memory can store instructions or data that have been used or repeatedly used by processor 110. If processor 110 needs to use the instruction or data again, it can directly retrieve it from memory 120, thus avoiding repeated access, reducing the waiting time of processor 110, and thus improving system efficiency.

[0102] In some embodiments, the memory 120 may also be disposed in the processor 110, that is, the processor 110 includes the memory 120. This application embodiment does not limit this.

[0103] Display screen 130 is used to display images, videos, etc. Display screen 130 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, terminal device 100 may include one or N displays 130, where N is a positive integer greater than 1.

[0104] The power module 140 can be used to supply power to the various components included in the terminal device 100. In some embodiments, the power module 140 can be a battery, such as a rechargeable battery.

[0105] Touch sensor 152, also known as a "touch panel," can be located on display screen 130. The touch sensor 152 and display screen 130 together form a touchscreen, also known as a "touch screen." Touch sensor 152 detects touch operations applied to or near it. Touch sensor 152 can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 130. In other embodiments, touch sensor 152 may also be located on the surface of terminal device 100, in a different position than display screen 130.

[0106] The sensor module 151 may also include a pressure sensor, a gyroscope sensor, a heart rate sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a temperature sensor, a touch sensor, and an ambient light sensor, etc.

[0107] A positioning module 160 is used to locate the terminal device 100. In this embodiment, the positioning module 160 can receive data from a global navigation satellite system (GNSS), including latitude and longitude, altitude, etc. The terminal device 100 can obtain its altitude through the GNSS altitude data. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a BeiDou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), a Galileo satellite navigation system (GSNS), and / or a satellite-based augmentation system (SBAS).

[0108] This embodiment also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to implement the audio playback method described in the above embodiment.

[0109] In addition, embodiments of this application also provide an apparatus, which may specifically be a chip, component or module. The apparatus may include a connected processor and a memory. The memory is used to store computer execution instructions. When the apparatus is running, the processor can execute the computer execution instructions stored in the memory to cause the chip to execute the audio playback method in the above-described method embodiments.

[0110] In this embodiment, the terminal device, computer storage medium, computer program product or chip are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0111] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0112] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0113] The unit described as a separate component may or may not be physically separate. The component shown as a unit can be one physical unit or multiple physical units, that is, it can be located in one place or distributed in multiple different places. Some or all of the units can be selected to achieve the purpose of the solution in this embodiment according to actual needs.

[0114] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0115] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0116] The above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit it. Although this application has been described in detail with reference to the above preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions to the technical solutions of this application should not depart from the spirit and scope of the technical solutions of this application.

Claims

1. An audio playback method, applied to a terminal device, characterized in that, The terminal device includes a main core and a secondary core, and the method includes: The main core responds to the user's operation to start audio playback and sends a playback command to the secondary core; The secondary core initializes in response to the playback command, including setting the playback frequency; The sub-core obtains audio frames from the audio source file from its storage space and decodes the audio frames to obtain audio decoding data in a preset format. The sub-core plays the audio decoding data based on the playback frequency.

2. The audio playback method as described in claim 1, characterized in that, The method further includes: The main core sends a frequency adjustment command to the sub-core; The sub-core adjusts the playback frequency of the audio frame according to the frequency adjustment command.

3. The audio playback method as described in claim 2, characterized in that, The main core sending the frequency adjustment command to the sub-core includes: The display metronome function interface includes a beat count setting control. If a user touches the beat count setting control, a setting interface is displayed, which provides a selection box control for selecting the playback frequency. If the user selects a target playback frequency through the selection box control, the main core generates the frequency adjustment command and sends the frequency adjustment command to the sub-core, wherein the frequency adjustment command includes the target playback frequency.

4. The audio playback method as described in claim 2, wherein the audio frame includes a valid frame and a silent frame, characterized in that, The sub-core adjusts the playback frequency of the audio frame according to the frequency adjustment command, including: The sub-core determines the length of the silent frame based on the target playback frequency in the frequency adjustment command; The sub-core reads the audio data stream of the valid frame from the audio source file, and reads the audio data stream of the silence data according to the length of the silence frame; The audio frame is obtained by demultiplexing the audio data stream of the valid frame and the audio data stream of the silence data.

5. The audio playback method as described in claim 4, characterized in that, The sub-core determines the length of the silent frame based on the target playback frequency, including: Determine the period of the target playback frequency; The length of the silence frame is determined based on the bitrate of the audio frame, the length of the effective frame, and the period.

6. The audio playback method as described in claim 1, characterized in that, Before the main core responds to the user's operation to initiate audio playback, the method further includes: The display metronome function interface includes playback controls. If the playback control is in a paused state and the user touches the playback control, the main core determines that it has received the operation to start audio playback.

7. The audio playback method as described in claim 6, characterized in that, The method further includes: If the playback control is in a playback state and the user touches the playback control, the main core determines that it has received an operation to turn off audio playback; In response to the operation of closing audio playback, the playback of the audio decoded data is stopped.

8. The audio playback method as described in claim 1, characterized in that, The main core responds to the user's operation to initiate audio playback by sending the playback command to the secondary core, including: If the audio playback has the highest priority among the services already started on the terminal device, the playback command is sent to the secondary core.

9. The audio playback method as described in claim 1, characterized in that, The sub-core retrieves the audio frames of the audio source file from its storage space, including: The secondary core reads the audio data stream from its storage space; The audio data stream is demultiplexed to obtain the audio frame.

10. The audio playback method as described in claim 1, characterized in that, The method further includes: After sending the playback command to the sub-core, the power amplifier device of the terminal device is activated.

11. The audio playback method as described in claim 10, characterized in that, The playback of the audio decoding data includes: The audio decoded data is played through the power amplifier device.

12. A terminal device, characterized in that, The terminal device includes a memory and a processor: The memory is used to store program instructions; The processor includes a main core and a sub-core, the main core and the sub-core being used to read and execute the program instructions stored in the memory, and when the program instructions are executed by the main core and the sub-core, the terminal device performs the audio playback method as described in any one of claims 1 to 11.

13. A computer storage medium, characterized in that, The computer storage medium stores program instructions that, when executed on a terminal device, cause the terminal device to perform the audio playback method as described in any one of claims 1 to 11.