Audio playing method, terminal, storage medium and program product

By acquiring atmospheric pressure information of the terminal's environment, the audio signal intensity is adjusted to control diaphragm deformation, thus solving the noise problem caused by diaphragm deformation under different atmospheric pressures and improving the stability of audio playback and user experience.

CN121037751APending Publication Date: 2025-11-28HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410627694.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-20
Publication Date
2025-11-28

AI Technical Summary

Technical Problem

When a terminal plays audio under different atmospheric pressure environments, the diaphragm is easily affected by external environmental interference, causing deformation, generating noise, and affecting audio quality.

Method used

By acquiring atmospheric pressure information of the terminal's environment, the intensity of the audio signal is adjusted to control the degree of diaphragm deformation. Different adjustment values ​​are used to attenuate or enhance low-frequency and high-frequency audio signals to ensure that the diaphragm's vibration amplitude is close to the vibration amplitude under standard atmospheric pressure.

Benefits of technology

This reduces the probability of diaphragm deformation under different atmospheric pressures, reduces noise, and improves audio playback stability and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121037751A_ABST
    Figure CN121037751A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an audio playing method, a terminal, a storage medium and a program product, and relates to the technical field of data processing, and the method comprises the steps: obtaining air pressure characterization information reflecting first atmospheric pressure of an environment where the terminal is located; based on the air pressure characterization information, determining an audio playing parameter used for adjusting the strength of an audio signal; adjusting the strength of an audio signal to be played of the terminal based on the audio playing parameter; and driving a loudspeaker arranged in the terminal to play audio based on the adjusted audio signal. By applying the audio playing scheme provided by the embodiment of the invention, the probability of noise when the terminal plays the audio can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and in particular to an audio playing method, a terminal, a storage medium and a program product. BACKGROUND

[0002] A terminal such as a mobile phone or a tablet computer is provided with a loudspeaker. In a scenario where the terminal plays audio externally, the terminal can decode an audio stream to obtain an audio signal, and drive a diaphragm in a loudspeaker cavity based on the audio signal. The driven diaphragm will deform and vibrate, and the vibrating diaphragm will push the air in the loudspeaker cavity to vibrate, thereby forming a sound that can be heard by human ears, realizing the function of playing audio externally.

[0003] However, the diaphragm is flexible and ultra-thin, and is easily affected by the external environment, thereby affecting the quality of audio played by the terminal. For example, when the terminal plays audio externally in some environment, the diaphragm may be deformed greatly and contact the inner wall of the loudspeaker cavity, which will cause noise in the audio played by the terminal. SUMMARY

[0004] Therefore, the present application provides an audio playing method, a terminal, a storage medium and a program product to reduce the probability of noise in audio played by the terminal.

[0005] In a first aspect, an audio playing method is provided by embodiments of the present application and applied to a terminal. The method comprises:

[0006] obtaining air pressure representation information reflecting a first atmospheric pressure of an environment in which the terminal is located;

[0007] determining, based on the air pressure representation information, an audio playing parameter used to adjust the intensity of an audio signal;

[0008] adjusting the intensity of an audio signal to be played by the terminal based on the audio playing parameter;

[0009] playing audio by driving the loudspeaker provided in the terminal based on the adjusted audio signal.

[0010] It can be seen from the above that the audio playing parameter is used to adjust the intensity of the audio signal, and the intensity of the audio signal affects the deformation degree of the diaphragm. Therefore, the audio playing parameter can control the deformation degree of the diaphragm. It can be seen that the scheme provided in the embodiments of the present application considers the influence of atmospheric pressure on the deformation of the diaphragm when playing audio, and can determine the audio playing parameter for controlling the deformation degree of the diaphragm based on the atmospheric pressure. When adjusting the audio signal according to the audio playing parameter and driving the loudspeaker based on the adjusted audio signal, the influence of atmospheric pressure on the deformation of the diaphragm can be reduced through the audio playing parameter, the probability of the diaphragm being greatly deformed due to environmental influence is reduced, and thus the probability of contacting the inner wall of the loudspeaker cavity is reduced, and the probability of noise occurring when playing audio is reduced.

[0011] In addition, in the scheme provided in the embodiments of the present application, the audio playing parameter is not fixed, but can be flexibly set according to the atmospheric pressure of the environment in which the terminal is located. Therefore, when adjusting the audio signal according to the audio playing parameter and driving the loudspeaker based on the adjusted audio signal, the influence of different atmospheric pressures on the diaphragm can be reduced, so that the vibration of the diaphragm tends to be consistent when the terminal plays audio under different atmospheric pressures, and thus the audio effect heard by a person tends to be consistent, the stability of playing audio is improved, and the user experience is improved.

[0012] In an embodiment of the present application, the audio playing parameter for adjusting the audio signal is determined based on the atmospheric pressure representation information, including:

[0013] An adjustment value for adjusting the intensity of the audio signal is determined as the audio playing parameter based on the atmospheric pressure representation information and a standard atmospheric pressure, wherein the adjustment value makes the first vibration amplitude tend to the second vibration amplitude, the first vibration amplitude is the vibration amplitude of the diaphragm when the loudspeaker plays audio based on the adjusted audio signal under the first atmospheric pressure, and the second vibration amplitude is the vibration amplitude of the diaphragm when the loudspeaker plays audio based on the original audio signal under the standard atmospheric pressure.

[0014] It can be seen from the above that when the scheme provided in the embodiments of the present application is applied to audio playing, in a first aspect, the influence of atmospheric pressure on the deformation of the diaphragm is considered, and the audio playing parameter for controlling the degree of deformation of the diaphragm can be determined based on the atmospheric pressure. Then, when the audio signal is adjusted according to the audio playing parameter and the loudspeaker is driven based on the adjusted audio signal, the influence of atmospheric pressure on the deformation of the diaphragm can be reduced by the audio playing parameter, thereby reducing the probability of the diaphragm being greatly deformed due to environmental influence, and thus reducing the probability of contacting the inner wall of the loudspeaker cavity, and further reducing the probability of noise occurring during audio playing. In a second aspect, the audio playing parameter is determined according to the first atmospheric pressure of the environment in which the terminal is located and the standard atmospheric pressure. That is, when the audio playing parameter is determined, the adverse influence of the first atmospheric pressure on the deformation of the diaphragm compared with the standard atmospheric pressure is considered. Then, when the audio signal is adjusted according to the audio playing parameter and the loudspeaker is driven based on the adjusted audio signal, the first vibration amplitude of the diaphragm under the first atmospheric pressure can be close to the second vibration amplitude of the diaphragm under the standard atmospheric pressure, the adverse influence of the first atmospheric pressure on the deformation of the diaphragm compared with the standard atmospheric pressure is reduced, the amplitude of the diaphragm is relatively stable, and the stability during audio playing is improved.

[0015] In an embodiment of the present application, the adjustment value for adjusting the intensity of the audio signal is determined based on the atmospheric pressure characterization information and the standard atmospheric pressure, including:

[0016] In the case where the first atmospheric pressure reflected by the atmospheric pressure characterization information is less than the standard atmospheric pressure, a first adjustment value for performing attenuation processing on the audio signal is determined based on the first atmospheric pressure and the standard atmospheric pressure.

[0017] In the case where the first atmospheric pressure reflected by the atmospheric pressure characterization information is greater than the standard atmospheric pressure, a second adjustment value for performing enhancement processing on the audio signal is determined based on the first atmospheric pressure and the standard atmospheric pressure.

[0018] In the case where the first atmospheric pressure reflected by the atmospheric pressure characterization information is less than the standard atmospheric pressure, after determining the first adjustment value for performing attenuation processing on the audio signal, the audio signal can be attenuated according to the first adjustment value, so that when the loudspeaker is driven to play audio based on the attenuated audio signal, the driving force of the diaphragm is reduced. Since the driving force is proportional to the degree of deformation of the diaphragm, the degree of deformation of the diaphragm can be reduced in this way, the adverse influence of low pressure on the deformation of the diaphragm is offset, the vibration amplitude of the diaphragm approaches the vibration amplitude under the standard atmospheric pressure, and the stability during audio playing is improved.

[0019] In a case where the first atmospheric pressure reflected by the atmospheric pressure characterization information is greater than the standard atmospheric pressure, after determining the second adjustment value for the enhancement processing of the audio signal, the audio signal can be enhanced according to the second adjustment value, so that when the loudspeaker is driven to play audio based on the enhanced audio signal, the driving force of the diaphragm is increased, and since the driving force is proportional to the deformation degree of the diaphragm, the deformation degree of the diaphragm is increased, the adverse effect of high air pressure on the deformation of the diaphragm is offset, the vibration amplitude of the diaphragm approaches the vibration amplitude under the standard atmospheric pressure, and the stability during audio playing is improved.

[0020] In an embodiment of the present application, the adjustment value for adjusting the intensity of the audio signal is determined based on the atmospheric pressure characterization information and the standard atmospheric pressure, and includes:

[0021] The third adjustment value for adjusting the intensity of the low-frequency audio signal and the fourth adjustment value for adjusting the intensity of the high-frequency audio signal are determined based on the first atmospheric pressure reflected by the atmospheric pressure characterization information and the standard atmospheric pressure.

[0022] In the embodiment, the low-frequency audio signal and the high-frequency signal can be treated separately, and different adjustment values are used for different audio signals in a fine-grained manner, so that the adjustment of the audio signal is more reasonable and accurate, and the playing effect during audio playing based on the adjusted audio signal is improved.

[0023] In an embodiment of the present application, in a case where the first atmospheric pressure reflected by the atmospheric pressure characterization information is less than the standard atmospheric pressure:

[0024] The third adjustment value is used for attenuating the low-frequency audio signal, and the fourth adjustment value is used for enhancing the high-frequency audio signal.

[0025] In the embodiment, on the one hand, the low-frequency audio signal is attenuated by the third adjustment value, which can reduce the deformation degree of the diaphragm, reduce the adverse effect of low air pressure on the deformation of the diaphragm, make the vibration amplitude of the diaphragm approach the vibration amplitude under the standard atmospheric pressure, and improve the stability during audio playing; on the other hand, the high-frequency audio signal is enhanced by the fourth adjustment value, the intensity of the high-frequency sound finally played is increased, the influence of weak bass on the listening experience of the user is reduced, and the user experience is improved.

[0026] In an embodiment of the present application, in a case where the first atmospheric pressure reflected by the atmospheric pressure characterization information is less than the standard atmospheric pressure:

[0027] The third adjustment value and the fourth adjustment value are both used for attenuating the audio signal.

[0028] In this way, the third and fourth adjustment values ​​are used to attenuate both low-frequency and high-frequency audio signals. This reduces the degree of diaphragm deformation and mitigates the adverse effect of low air pressure making the diaphragm more prone to deformation. This makes the diaphragm's vibration amplitude closer to that under standard atmospheric pressure, reducing the probability of noise and improving the stability of audio playback.

[0029] In one embodiment of this application, when the first atmospheric pressure reflected by the pressure characterization information is greater than the standard atmospheric pressure:

[0030] The third adjustment value is used to enhance the low-frequency audio signal, and the fourth adjustment value is used to attenuate the high-frequency audio signal.

[0031] In this embodiment, on the one hand, the low-frequency audio signal is enhanced by using a third adjustment value, which can enhance the deformation of the diaphragm and reduce the adverse effect of high air pressure making the diaphragm less prone to deformation. This makes the vibration amplitude of the diaphragm closer to the vibration amplitude under standard atmospheric pressure, thus improving the stability when playing audio. On the other hand, the high-frequency audio signal is attenuated by using a fourth adjustment value, which reduces the intensity of the high-frequency sound played in the end, reduces the impact of strong bass on the user's listening experience, and improves the user experience.

[0032] In one embodiment of this application, when the first atmospheric pressure reflected by the pressure characterization information is greater than the standard atmospheric pressure:

[0033] Both the third and fourth adjustment values ​​are used to enhance the audio signal.

[0034] In this way, the third and fourth adjustment values ​​are used to enhance both low-frequency and high-frequency audio signals. This increases the degree of diaphragm deformation, reduces the adverse effect of high air pressure making the diaphragm less prone to deformation, and makes the vibration amplitude of the diaphragm closer to the vibration amplitude under standard atmospheric pressure, thus improving the stability when playing audio.

[0035] In one embodiment of this application, determining the audio playback parameters for adjusting the audio signal based on the air pressure characterization information includes:

[0036] Based on the correspondence between air pressure characterization information and audio playback parameters, the audio playback parameters corresponding to the air pressure characterization information are determined and used as audio playback parameters for adjusting the audio signal.

[0037] In this way, the audio playback parameters corresponding to the barometric pressure information can be quickly determined based on the correspondence between barometric pressure information and audio playback parameters, thus improving the efficiency of determining audio playback parameters.

[0038] In one embodiment of this application, the method further includes:

[0039] Based on the location query results provided by the location query service, the air pressure characterization information of the environment where the terminal is located is obtained, and the air pressure characterization information is written into a hidden partition in the storage space;

[0040] The method of obtaining pressure characterization information reflecting the first atmosphere pressure of the environment where the terminal is located includes:

[0041] The latest stored air pressure characterization information is read from the hidden partition and used as air pressure characterization information reflecting the first atmosphere of the environment in which the terminal is located.

[0042] As can be seen, in this embodiment, the terminal can continuously update the atmospheric pressure characterization information of the environment in which the terminal is located in the hidden partition. The latest atmospheric pressure characterization information stored in the hidden partition reflects the first atmosphere pressure of the environment in which the terminal is located. In this way, when executing the solution provided in this application embodiment, the latest stored atmospheric pressure characterization information can be conveniently read directly from the hidden partition as the atmospheric pressure characterization information reflecting the first atmosphere pressure of the environment in which the terminal is located, without the need for real-time acquisition, thus improving the efficiency of obtaining atmospheric pressure characterization information.

[0043] In one embodiment of this application, the terminal includes: a location query service and an audio control service located at the application framework layer, an audio HAL located at the hardware abstraction layer, and an audio signal adjustment module located at the hardware layer. The step of obtaining barometric pressure characterization information of the environment in which the terminal is located and writing the barometric pressure characterization information into a hidden partition in the storage space includes:

[0044] The location query service obtains the barometric pressure information of the environment where the terminal is located, and sends the barometric pressure information to the audio control service.

[0045] The audio control service sends the barometric pressure information to the audio HAL through a parameter setting interface;

[0046] The audio HAL writes the barometric pressure information into a hidden partition within the storage space.

[0047] The step of reading the latest stored barometric pressure characterization information from the hidden partition includes:

[0048] In response to an audio playback command, the audio HAL reads the latest stored barometric pressure information from the hidden partition as barometric pressure information reflecting the first atmosphere of the environment where the terminal is located, and writes the barometric pressure information into the audio signal adjustment module.

[0049] The step of adjusting the intensity of the audio signal to be played on the terminal based on the audio playback parameters includes:

[0050] The audio signal adjustment module adjusts the intensity of the audio signal to be played on the terminal based on the audio playback parameters.

[0051] As seen above, the location query service and audio control service located in the application framework layer can send barometric pressure information to the HAL layer. The audio HAL can then write this barometric pressure information to a hidden partition in the storage space. Subsequently, upon receiving an audio playback command, the latest stored barometric pressure information can be easily read from the hidden partition and written to the audio signal adjustment module in the hardware layer. This allows the audio signal adjustment module to adjust the intensity of the audio signal to be played on the terminal based on the audio playback parameters. Therefore, through the interaction between modules or services located in different software architecture layers, stable and rapid audio signal adjustment can be achieved.

[0052] In one embodiment of this application, the air pressure characterization information includes:

[0053] The latitude and longitude of the geographical location of the terminal; and / or

[0054] The altitude of the geographical location of the terminal; and / or

[0055] The city where the terminal is located.

[0056] The latitude and longitude of the terminal's geographical location, its altitude, and the city where the terminal is located all have a relatively stable correspondence with the atmospheric pressure of the terminal's environment. Therefore, the latitude and longitude of the terminal's geographical location, its altitude, and the city where the terminal is located can all accurately reflect the first atmosphere pressure of the terminal's environment.

[0057] In one embodiment of this application, obtaining the pressure characterization information reflecting the first atmosphere pressure of the environment where the terminal is located includes:

[0058] Based on the sensing results obtained by the sensor module, pressure characterization information reflecting the first atmosphere pressure of the environment in which the terminal is located is obtained.

[0059] The sensor module can accurately sense the environment in which the terminal is located, so that the terminal can accurately obtain the air pressure characterization information reflecting the first atmosphere pressure of the environment in which the terminal is located based on the sensing results.

[0060] In one embodiment of this application, the terminal includes: a sensor module and an audio parameter adjustment module located at the hardware layer; obtaining pressure characterization information reflecting the first atmosphere pressure of the environment in which the terminal is located includes:

[0061] The sensor module senses information and records the sensing results;

[0062] The audio parameter adjustment module responds to the audio playback command and obtains the perception results recorded in the sensor module, which serve as barometric pressure characterization information reflecting the first atmosphere pressure of the environment in which the terminal is located.

[0063] The step of adjusting the intensity of the audio signal to be played on the terminal based on the audio playback parameters includes:

[0064] The audio signal adjustment module adjusts the intensity of the audio signal to be played on the terminal based on the audio playback parameters.

[0065] As can be seen from the above, the sensor module located at the hardware layer accurately senses the environment in which the terminal is located and sends the sensing results to the audio parameter adjustment module. Thus, the audio signal adjustment module can adjust the intensity of the audio signal to be played on the terminal based on the audio playback parameters. It is evident that through the interaction between modules or services located at different software architecture layers, stable and rapid audio signal adjustment can be achieved.

[0066] In one embodiment of this application, the sensor module performs information sensing and records the sensing results, including:

[0067] The sensor module acquires the altitude of the terminal's geographical location provided by the altitude detection service and records the altitude.

[0068] In this way, the sensor module can easily obtain sensing results through altitude detection services without relying on physical hardware.

[0069] In one embodiment of this application, the sensor module performs information sensing and records the sensing results, including:

[0070] The sensor module is a barometric pressure sensor, which measures and records the atmospheric pressure of the surrounding environment.

[0071] In this way, the barometric pressure sensor can measure the altitude of the terminal's geographical location, thereby obtaining more accurate sensing results.

[0072] In one embodiment of this application, the air pressure characterization information includes:

[0073] The first atmosphere pressure of the environment in which the terminal is located.

[0074] In this way, using the first atmosphere as the atmospheric pressure characterization information makes the atmospheric pressure characterization information more intuitive and accurate.

[0075] In one embodiment of this application, the air pressure characterization information includes:

[0076] The altitude of the geographical location of the terminal.

[0077] There is a relatively stable correlation between the altitude of a geographical location and the atmospheric pressure at that location. Therefore, the altitude of the terminal's geographical location can accurately reflect the atmospheric pressure of the environment in which the terminal is located.

[0078] In one embodiment of this application, obtaining the pressure characterization information reflecting the first atmosphere pressure of the environment where the terminal is located includes:

[0079] Determine the transmission and arrival times of a preset number of downlink pilot signals recently received from different base stations, and determine the base station that transmitted the downlink pilot signals, wherein the preset number is greater than or equal to 3;

[0080] Based on the determined transmission and arrival times, the reception delay of each downlink pilot signal is obtained;

[0081] Based on the obtained reception delay, the distance between the terminal and each base station is determined;

[0082] Based on the distance between the terminal and each base station and the location of each base station, atmospheric pressure characterization information reflecting the first atmosphere pressure of the environment in which the terminal is located is obtained.

[0083] In this way, the terminal can conveniently and quickly obtain atmospheric pressure information reflecting the first atmosphere pressure of the environment in which the terminal is located through base station positioning.

[0084] Secondly, embodiments of this application provide a terminal, including:

[0085] One or more processors and memory;

[0086] The memory is coupled to the one or more processors and is used to store computer program code, the computer program code including computer instructions, which the one or more processors invoke to cause the terminal to perform the method described in the first aspect.

[0087] Thirdly, embodiments of this application provide a computer-readable storage medium including a computer program that, when run on a terminal, causes the terminal to perform the method described in the first aspect.

[0088] Fourthly, embodiments of this application provide a computer program product comprising executable instructions that, when executed on a terminal, cause the terminal to perform the method described in the first aspect.

[0089] Fifthly, embodiments of this application provide a chip system applied to a terminal. The chip system includes one or more processors, which are used to invoke computer instructions to cause the terminal to input data into the chip system and execute the method described in the first aspect for audio playback.

[0090] The beneficial effects of the solutions provided in the embodiments of the second to fifth aspects above can be found in the beneficial effects of the solutions provided in the embodiments of the first aspect above. Attached Figure Description

[0091] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0092] Figure 1 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application;

[0093] Figure 2a A schematic diagram of the amplitude of the inner diaphragm of a loudspeaker provided in the embodiments of this application;

[0094] Figure 2b A schematic diagram of the second type of loudspeaker diaphragm amplitude provided in the embodiments of this application;

[0095] Figure 3 A flowchart illustrating the first audio playback method provided in this application embodiment;

[0096] Figure 4 A flowchart illustrating the second audio playback method provided in this application embodiment;

[0097] Figure 5a A software structure block diagram of a first type of terminal provided in the embodiments of this application;

[0098] Figure 5b A software structure block diagram of a second type of terminal provided in the embodiments of this application;

[0099] Figure 5c A software structure block diagram of a third type of terminal provided in the embodiments of this application;

[0100] Figure 6a A schematic diagram illustrating a first audio playback scenario provided in an embodiment of this application;

[0101] Figure 6b A schematic diagram illustrating a second audio playback scenario provided in an embodiment of this application;

[0102] Figure 6c A schematic diagram illustrating a third audio playback scenario provided in an embodiment of this application;

[0103] Figure 7 This is a schematic diagram of a chip system provided in an embodiment of this application. Detailed Implementation

[0104] To better understand the technical solution of this application, the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0105] To facilitate a clear description of the technical solutions in the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish identical or similar items with essentially the same function and effect. For example, "first instruction" and "second instruction" are used to distinguish different user instructions and do not limit their order. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" are not necessarily different.

[0106] It should be noted that, in this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.

[0107] The solutions provided in this application can be applied to any terminal equipped with a speaker and capable of external audio playback, such as mobile phones, tablets, desktop computers, smartwatches, wearable electronic devices, augmented reality (AR) devices, virtual reality (VR) devices, in-vehicle devices, smart cars, and robots.

[0108] For example, Figure 1 A schematic diagram of the terminal 100 is shown. The terminal 100 may include a processor 110, a display screen 120, a speaker 130, internal memory 140, a Subscriber Identification Module (SIM) card interface 150, a Universal Serial Bus (USB) interface 160, a charging management module 170, a battery management module 171, a battery 172, a sensor module 180, a mobile communication module 190, a wireless communication module 200, antenna 1, and antenna 2, etc. The sensor module 180 may include a pressure sensor 180A, a touch sensor 180B, etc.

[0109] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the terminal 100. In other embodiments of this application, the terminal 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.

[0110] Processor 110 may include one or more processing units, such as a Central Processing Unit (CPU), an Application Processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent components or integrated into one or more processors. In some embodiments, terminal 100 may also include one or more processors 110. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution. In other embodiments, processor 110 may also include a memory for storing instructions and data. For example, the memory in processor 110 may be a cache memory. This memory can store instructions or data that processor 110 has just used or is repeatedly used. If processor 110 needs to reuse the instruction or data, it can directly retrieve it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the terminal 100 in processing data or executing instructions.

[0111] In some embodiments, the processor 110 may include one or more interfaces. These interfaces may include an Inter-Integrated Circuit (I2C) interface, an Inter-Integrated Circuit Sound (I2S) interface, a Pulse Code Modulation (PCM) interface, a Universal Asynchronous Receiver / Transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI) interface, a General-Purpose Input / Output (GPIO) interface, a SIM card interface, and / or a USB interface, etc. The USB interface 160 is a USB standard-compliant interface, specifically a Mini USB interface, a Micro USB interface, a USB Type-C interface, etc. The USB interface 160 can be used to connect a charger to charge the terminal 100, and can also be used for data transfer between the terminal 100 and peripheral devices. The USB interface 160 can also be used to connect headphones for audio playback.

[0112] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are for illustrative purposes only and do not constitute a structural limitation on the terminal 100. In other embodiments of this application, the terminal 100 may also adopt different interface connection methods or a combination of multiple interface connection methods as described in the above embodiments.

[0113] The wireless communication function of terminal 100 can be implemented through antenna 1, antenna 2, mobile communication module 190, wireless communication module 200, modem processor and baseband processor.

[0114] Antennas 1 and 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.

[0115] Terminal 100 implements display functions through a GPU, display screen 120, and application processor. The GPU is a microprocessor for image processing, connected to the display screen 120 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0116] The display screen 120 is used to display images, videos, etc. The display screen 120 includes a display panel. The display panel can 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, the terminal 100 may include one or more display screens 120.

[0117] In some embodiments of this application, when the display panel uses materials such as OLED, AMOLED, and FLED, the above-mentioned Figure 1 The display screen 120 can be bent. Here, "the display screen 120 can be bent" means that the display screen can be bent to any angle at any part and can maintain that angle. For example, the display screen 120 can be folded from the middle left to right. It can also be folded from the middle up and down.

[0118] The display screen 120 of terminal 100 can be a flexible screen. Currently, flexible screens are attracting much attention due to their unique characteristics and enormous potential. Compared to traditional screens, flexible screens are highly flexible and bendable, providing users with new interaction methods based on their bendability and meeting more user needs for terminals. For terminals equipped with foldable displays, the foldable display can switch between a small screen in folded mode and a large screen in unfolded mode at any time. Therefore, users are increasingly using split-screen functionality on terminals equipped with foldable displays.

[0119] Speaker 130 is used to play audio under the drive of an audio signal, realizing the audio playback function. The specific method of how the audio signal drives the speaker to play audio will be described in detail later, and will not be described here.

[0120] A digital signal processor (DSP) is used to process digital signals. Besides digital image signals, it can also process other digital signals. For example, when terminal 100 selects a frequency point, the DSP can perform Fourier transforms on the frequency energy.

[0121] Video codecs are used to compress or decompress digital video. Terminal 100 may support one or more video codecs. Thus, terminal 100 can play or record video in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG 2, MPEG 3, and MPEG 4.

[0122] NPU stands for Neural Network (NN) computing processor. By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs can enable intelligent cognitive applications in terminals, such as image recognition, facial recognition, speech recognition, and text understanding.

[0123] The internal memory 140 can be used to store one or more computer programs, which include instructions. The processor 110 can execute the instructions stored in the internal memory 140, thereby causing the terminal 100 to perform the audio playback method, various applications, and data processing provided in some embodiments of this application. The internal memory 140 may include a program storage area and a data storage area. The program storage area may store the operating system; it may also store one or more applications (such as a gallery, contacts, etc.). The data storage area may store data created by the terminal 100 during use (such as photos, contacts, etc.). Furthermore, the internal memory 140 may include high-speed random access memory and non-volatile memory, such as one or more disk storage components, flash memory components, Universal Flash Storage (UFS), etc. In some embodiments, the processor 110 can execute instructions stored in the internal memory 140 and / or instructions stored in memory disposed in the processor 110, thereby causing the terminal 100 to perform the audio playback method, other applications, and data processing provided in the embodiments of this application.

[0124] The internal memory 140 can be used to store the relevant program of the audio playback method provided in the embodiments of this application. The processor 110 can be used to call the relevant program of the audio playback method stored in the internal memory 140 when displaying information, and execute the audio playback method of the embodiments of this application.

[0125] The sensor module 180 may include a pressure sensor 180A, a touch sensor 180B, etc.

[0126] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be disposed on display screen 120. Pressure sensor 180A can be of many types, such as resistive pressure sensor, inductive pressure sensor, or capacitive pressure sensor. A capacitive pressure sensor can include at least two parallel plates with conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes, and terminal 100 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 120, terminal 100 detects the touch operation based on pressure sensor 180A. Terminal 100 can also calculate the touch position based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example, when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS is executed; when a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS is executed.

[0127] Touch sensor 180B, also known as a touch device, can be disposed on display screen 120. The touch sensor 180B and display screen 120 together form a touchscreen, also known as a touch display. Touch sensor 180B is used to detect touch operations applied to or near it. Touch sensor 180B 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 120. In other embodiments, touch sensor 180B may also be disposed on the surface of terminal 100, and in a different location from display screen 120.

[0128] The application scenarios of the audio playback solution provided in the embodiments of this application will be introduced below.

[0129] The application scenario of the audio playback solution provided in this application embodiment is: the scenario where the user uses the terminal to play audio externally.

[0130] For example, when a user opens a music application (APP) installed on their terminal and selects a song they want to listen to, the music APP process requests the audio stream of the song from the background server and receives the audio stream sent by the server. The audio stream is a data stream used to transmit audio data in real time. The process can decode the received audio stream to obtain the audio signal.

[0131] The decoded audio signal is input to a digital-to-analog converter (DAC) chip within the terminal. This DAC converts the audio signal into an analog signal. After amplification and noise reduction, the analog signal is input to the speaker's voice coil. A current is generated within the voice coil, which, due to electromagnetic induction, produces a magnetic field. This magnetic field interacts with the magnetic field of a magnet inside the speaker, generating a thrust or attraction that causes the diaphragm to deform and vibrate. In this way, the audio signal drives the speaker. The vibrating diaphragm then pushes the air inside the speaker cavity to vibrate, creating sound that can be heard, thus achieving the audio playback function.

[0132] However, due to its flexibility and ultra-thin properties, the diaphragm is easily affected by external environmental interference, which can impact the quality of audio playback. For example, when the terminal plays audio in certain environments, the diaphragm may undergo significant deformation and come into contact with the inner wall of the speaker cavity. In this case, noise may occur in the audio played by the terminal.

[0133] See Figure 2a and Figure 2b These are schematic diagrams of the first and second types of diaphragm amplitudes in loudspeakers provided in the embodiments of this application.

[0134] First see Figure 2a This is a schematic diagram of the amplitude of the inner diaphragm of a loudspeaker provided in the embodiments of this application. Figure 2a The vertical axis of the coordinate system represents the amplitude of the diaphragm, measured in milliseconds (mm), while the horizontal axis represents the frequency of the diaphragm's vibration, measured in Hertz (Hz).

[0135] The first three curves, whose starting points are on the vertical axis and whose values ​​decrease from large to small, are called the first curves. Each first curve represents the upper amplitude of the three different diaphragms vibrating at 0.6 atmospheres. The fourth to sixth curves, whose starting points are on the vertical axis, are called the second curves. Each second curve represents the upper amplitude of the three different diaphragms vibrating at 1 atmosphere. The seventh to ninth curves, whose starting points are on the vertical axis, are called the third curves. Each third curve represents the change in upper amplitude of the three different diaphragms vibrating at 0.6 atmospheres and 1 atmosphere.

[0136] Similarly, the first three curves whose starting points are in the direction of increasing vertical axis values ​​are called the fourth curves, each representing the lower amplitude of the three different diaphragms vibrating at 0.6 standard atmospheres; the fourth to sixth curves whose starting points are in the same direction are called the fifth curves, each representing the lower amplitude of the three different diaphragms vibrating at 1 standard atmosphere; and the seventh to ninth curves whose starting points are in the same direction are called the sixth curves, each representing the change in lower amplitude of the three different diaphragms vibrating at 0.6 standard atmospheres and 1 standard atmosphere.

[0137] Depend on Figure 2a It can be seen that the maximum upper amplitude of the three different diaphragms vibrating under 0.6 standard atmospheres is about 0.52 mm, and the average change in upper amplitude relative to 1 standard atmosphere is about 0.20 mm; the maximum lower amplitude of the three different diaphragms vibrating under 0.6 standard atmospheres is about 0.49 mm, and the average change in lower amplitude relative to 1 standard atmosphere is about 0.16 mm.

[0138] See below. Figure 2b This is a schematic diagram of the second type of loudspeaker diaphragm amplitude provided in the embodiments of this application. Figure 2b The meaning of coordinate axis units and curves in the middle coordinate system Figure 2b Similar, the only difference is Figure 2b The specifications of the speaker shown are the same as Figure 2a different.

[0139] Depend on Figure 2b It can be seen that the maximum upper amplitude of the three different diaphragms vibrating under 0.6 standard atmospheres is about 0.63 mm, and the average change in upper amplitude relative to 1 standard atmosphere is about 0.25 mm; the maximum lower amplitude of the three different diaphragms vibrating under 0.6 standard atmospheres is about 0.64 mm, and the average change in lower amplitude relative to 1 standard atmosphere is about 0.23 mm.

[0140] comprehensive Figure 2a and Figure 2b It is evident that when the speaker diaphragm operates at 0.6 atmospheres, both its maximum upper and lower amplitudes are relatively large, exceeding those at standard atmospheric pressure. However, the cavity space of the speaker installed within the terminal is very limited. This increased amplitude makes the diaphragm more likely to contact the inner wall of the speaker cavity, a phenomenon known as "diaphragm bottoming out." In this situation, noise may occur in the audio played by the terminal.

[0141] In view of the above, embodiments of this application provide an audio playback solution to reduce the probability of noise occurring when the terminal plays audio.

[0142] The audio playback scheme provided in the embodiments of this application will be described in detail below.

[0143] See Figure 3 This is a flowchart illustrating the first audio playback method provided in this application embodiment, which includes the following steps S301-S304.

[0144] It should be noted that the audio played by applying the solution provided in the embodiments of this application can be standalone audio or audio parsed from a video.

[0145] In one scenario, the audio played using the solution provided in this application can also be voice communication during a hands-free call. In this case, after receiving a digital voice signal forwarded by the base station from another terminal, the solution provided in this application can be used to process the digital voice signal, and the processed signal can be used to drive the speaker to play the voice.

[0146] Step S301: Obtain pressure characterization information reflecting the first atmosphere pressure of the environment where the terminal is located.

[0147] Atmospheric pressure, often simply called air pressure, is the pressure exerted by the atmosphere on a unit area. It can also be understood as the weight of the atmospheric column on a unit area.

[0148] Atmospheric pressure is related to air density. Since air density can vary in different environments, atmospheric pressure can also vary in different environments.

[0149] Generally speaking, the higher the air density in a given environment, the greater the atmospheric pressure of that environment; conversely, the lower the air density in a given environment, the lower the atmospheric pressure of that environment.

[0150] The aforementioned air pressure characterization information can be any information that can reflect the magnitude of the first atmospheric pressure of the environment in which the terminal is located. For example, it can be the first atmospheric pressure of the environment in which the terminal is located, or it can be the latitude and longitude of the geographical location of the terminal, the altitude of the geographical location of the terminal, the city where the terminal is located, etc. This application embodiment does not limit this.

[0151] The specific methods for obtaining the above-mentioned air pressure characterization information are described below.

[0152] In one embodiment, a hidden partition within the terminal's storage space may store barometric pressure characterization information. In this case, the latest stored barometric pressure characterization information can be read from the hidden partition as barometric pressure characterization information reflecting the first atmosphere of the environment in which the terminal is located.

[0153] Specifically, the terminal can obtain the air pressure characterization information of the environment in which the terminal is located based on the location query results provided by the location query service, and write the air pressure characterization information into a hidden partition in the storage space.

[0154] The location query results can be the latitude and longitude of the terminal's geographical location, the altitude of the terminal's geographical location, the city where the terminal is located, or any two or all three of the above information.

[0155] The latitude and longitude of the terminal's geographical location, its altitude, and the city where the terminal is located all have a relatively stable correspondence with the atmospheric pressure of the terminal's environment. Therefore, the latitude and longitude of the terminal's geographical location, its altitude, and the city where the terminal is located can all accurately reflect the first atmosphere pressure of the terminal's environment.

[0156] It should be noted that, in the solution provided in this application embodiment, before the location query service obtains the location query result of the terminal, the terminal needs to first display a prompt message asking the user whether permission is granted to obtain the current location through pop-up windows or other means. Only after obtaining the user's permission can the location query service obtain the aforementioned location query result.

[0157] After obtaining the location query results, the terminal can directly write the location query results as air pressure characterization information into the hidden partition in the storage space.

[0158] In one scenario, if the terminal obtains latitude and longitude as the location query result, the terminal can determine the city corresponding to the obtained latitude and longitude based on the correspondence between latitude and longitude and cities, and write the determined city as air pressure characterization information into a hidden partition in the storage space.

[0159] The aforementioned hidden partition can be an Original Equipment Manufacturer (OEM) partition. Data stored in this partition will not be erased due to terminal shutdown or restart, and the permissions required to delete data are extremely high, resulting in high data stability and security.

[0160] The following section describes when to obtain location query results provided by the location query service.

[0161] In one scenario, certain apps installed on a terminal require location services during runtime, such as map apps, food delivery apps, shopping apps, and short video apps. These apps can send requests to the location query service, which then retrieves the location query results from the location query server and sends them back to the aforementioned apps. As a result, the operating system on the terminal can obtain the location query results from the location query service.

[0162] In this case, as long as any APP requests the location query service and obtains the location query result, the terminal can write the location query result as air pressure characterization information into the hidden partition.

[0163] The data stored in the aforementioned hidden partition is invisible to both device manufacturers and users, ensuring high data stability and security.

[0164] In another scenario, the operating system in the terminal can periodically send requests to the location query service and receive the location query results from the service.

[0165] As can be seen, in this embodiment, the terminal can continuously update the atmospheric pressure characterization information of the environment in which the terminal is located in the hidden partition. The latest atmospheric pressure characterization information stored in the hidden partition reflects the first atmosphere pressure of the environment in which the terminal is located. In this way, when executing the solution provided in this application embodiment, the latest stored atmospheric pressure characterization information can be conveniently read directly from the hidden partition as the atmospheric pressure characterization information reflecting the first atmosphere pressure of the environment in which the terminal is located, without the need for real-time acquisition, thus improving the efficiency of obtaining atmospheric pressure characterization information.

[0166] In another implementation, the terminal can obtain pressure characterization information reflecting the first atmosphere pressure of the environment in which the terminal is located, based on the sensing results obtained by the sensor module.

[0167] Unlike physical hardware sensors, the aforementioned sensor module is a software-level concept. It is used to obtain air pressure information of the environment in which the terminal is located. From a functional perspective, it is equivalent to a sensor that senses the environment in which the terminal is located.

[0168] The specific methods by which the aforementioned sensor modules acquire sensing results will be detailed later. Figure 4 The illustrated embodiment will not be described in detail here.

[0169] After obtaining the above sensing results, the terminal can use them as air pressure characterization information.

[0170] In one scenario, the perceived result can be directly the first atmosphere of pressure in the environment where the terminal is located. Using the first atmosphere as the atmospheric pressure representation information makes the atmospheric pressure representation information more intuitive and accurate.

[0171] In another scenario, the aforementioned sensing result could be the altitude of the terminal's geographical location. There is a relatively stable correlation between the altitude of a geographical location and the atmospheric pressure at that location; therefore, the altitude of the terminal's geographical location can accurately reflect the atmospheric pressure of the environment in which the terminal is located.

[0172] The sensor module can accurately sense the environment in which the terminal is located, so that the terminal can accurately obtain the air pressure characterization information reflecting the first atmosphere pressure of the environment in which the terminal is located based on the sensing results.

[0173] In another embodiment, the terminal can determine the transmission and arrival times of a preset number of downlink pilot signals recently received from different base stations, and identify the base station that transmitted the downlink pilot signals. Then, based on the determined transmission and arrival times, it obtains the reception delay of each downlink pilot signal. Furthermore, based on the obtained reception delay, it can determine the distance between the terminal and each base station. Finally, based on the distance between the terminal and each base station and the location of each base station, it obtains atmospheric pressure characterization information reflecting the first atmosphere of the environment in which the terminal is located. The preset number is greater than or equal to 3.

[0174] During the process of a terminal communicating with a mobile data network, it may communicate with multiple base stations. During the communication between the terminal and the base stations, the base stations will continuously send downlink pilot signals to the terminal. The downlink pilot signals carry control information to support the downlink data transmission of the terminal.

[0175] For the terminal, it can record the time of receipt (Time of Arrival, TOA) for each received downlink pilot signal, and parse the downlink pilot signal to obtain information such as the base station identifier, the base station coordinates, and the time the base station transmitted the downlink pilot signal. The arrival time and the parsed information can be stored in a cache.

[0176] In this embodiment, the terminal can determine the latest arrival time from the arrival times stored in the cache, take the downlink pilot signal corresponding to the determined arrival time as the first downlink pilot signal, and read the transmission time of the first downlink pilot signal; then, from the other arrival times stored in the cache, determine the latest arrival time of the base station that is not the base station corresponding to the first downlink pilot signal, take the downlink pilot signal corresponding to the arrival time as the second downlink pilot signal, and read the transmission time of the second downlink pilot signal, and so on, until the transmission times and arrival times of a preset number of downlink pilot signals are obtained.

[0177] In this way, the terminal calculates the difference between the transmission time and arrival time of the downlink pilot signal to obtain the reception delay of the downlink pilot signal. Based on the aforementioned reception delay and signal propagation speed, the distance between the terminal and the base station can be obtained. For example, calculating the aforementioned reception delay multiplied by the signal propagation speed yields the distance between the terminal and the base station.

[0178] After obtaining the distance between the terminal and the base station, the coordinates of the terminal can be calculated based on the distance and the base station coordinates included in the relevant information.

[0179] For example, taking the above-mentioned preset quantity of 3 as an example, according to the principle of three-point positioning, the coordinates of the intersection of 3 circles with the coordinates of the 3 base stations as the center and the distance between the terminal and the base stations as the radius can be used as the coordinates of the terminal.

[0180] Therefore, the above coordinates can be directly used as the above air pressure characterization information, or the city where the terminal is located can be determined based on the above coordinates and used as the above air pressure characterization information.

[0181] It should be noted that the terminal can obtain and store the above-mentioned air pressure characterization information in a certain period of time using the above method. In this way, when obtaining air pressure characterization information, the latest stored air pressure characterization information can be read directly. The terminal can also calculate the above-mentioned air pressure characterization information in the above method when obtaining air pressure characterization information, which is reasonable.

[0182] In this way, the terminal can conveniently and quickly obtain atmospheric pressure information reflecting the first atmosphere pressure of the environment in which the terminal is located through base station positioning.

[0183] Step S302: Based on the barometric pressure characterization information, determine the audio playback parameters used to adjust the intensity of the audio signal.

[0184] As described in the aforementioned scenario description, audio signals can drive the diaphragm to deform and vibrate.

[0185] The greater the intensity of the audio signal, the greater the intensity of the analog audio signal converted from the audio signal, the greater the current generated in the voice coil, the stronger the magnetic field generated by the voice coil, and ultimately the greater the deformation of the diaphragm; conversely, the smaller the intensity of the digital audio signal, the smaller the deformation of the diaphragm.

[0186] Therefore, to prevent the ambient atmospheric pressure from interfering with the diaphragm vibration, the diaphragm vibration amplitude can be adjusted by changing the intensity of the audio signal. In this step, the determined audio playback parameters are those used to adjust the intensity of the audio signal.

[0187] In one implementation, the first atmosphere pressure and the standard atmosphere pressure can be considered when determining the audio playback parameters. Details of the implementation will be provided later. Figure 4 The illustrated embodiment will not be described in detail here.

[0188] In another implementation, the audio playback parameters corresponding to the barometric pressure information can be determined based on the correspondence between barometric pressure information and audio playback parameters, and used as audio playback parameters for adjusting the audio signal. This correspondence can also be referred to as a whitelist.

[0189] As explained above, air pressure information can take many forms, which will be briefly introduced below.

[0190] In the first scenario, if the air pressure information represents the city where the terminal is located:

[0191] The audio playback parameters corresponding to the city where the terminal is located can be determined based on the correspondence between the city and the audio playback parameters.

[0192] For example, if the air pressure information is the city C1 where the terminal is located, then the audio playback parameter Para1 corresponding to the city C1 where the terminal is located can be determined according to the correspondence between the city and the audio playback parameters.

[0193] In the second scenario, if the air pressure information is represented by the latitude and longitude of the terminal's geographical location:

[0194] The audio playback parameters corresponding to the latitude and longitude of the terminal can be determined based on the correspondence between latitude and longitude and audio playback parameters. Alternatively, the city corresponding to the latitude and longitude can be determined first, and then the audio playback parameters corresponding to the latitude and longitude of the terminal can be determined based on the correspondence between the city and audio playback parameters.

[0195] This situation is similar to the first one, so I will not give a detailed example.

[0196] In the third scenario, if the air pressure information represents the altitude of the terminal:

[0197] The corresponding audio playback parameters for the terminal's altitude can be determined based on the relationship between altitude and audio playback parameters.

[0198] For example, if the air pressure information is the altitude A1 of the terminal, then the audio playback parameter Para2 corresponding to the city A1 of the terminal can be determined according to the correspondence between altitude and audio playback parameters.

[0199] Alternatively, you can first determine the altitude range to which the current altitude belongs, and then determine the audio playback parameters corresponding to the altitude of the terminal based on the correspondence between the altitude range and the audio playback parameters.

[0200] For example, if the air pressure information is the altitude A1 of the terminal, then we can first determine the altitude range to which A1 belongs as I1, and then determine the audio playback parameter Para2 corresponding to the altitude A1 of the terminal according to the correspondence between the altitude range and the audio playback parameters.

[0201] In one scenario, before determining the audio playback parameters corresponding to the altitude, it can be determined whether the altitude is greater than a preset first altitude threshold or less than a preset second altitude threshold. If so, the step of determining the audio playback parameters can then be executed.

[0202] The first and second altitude thresholds mentioned above can be set by staff based on experience. This application embodiment does not limit this. For example, the first altitude threshold can be 500 meters and the second altitude threshold can be -10 meters, etc.

[0203] When the altitude is greater than the preset first altitude threshold or less than the preset second altitude threshold, the atmospheric pressure corresponding to the altitude differs significantly from the standard atmospheric pressure, which may have a more obvious impact on the diaphragm deformation. Therefore, the audio playback parameters can be determined, and the diaphragm deformation can be controlled according to the audio playback parameters.

[0204] In the fourth scenario, if the air pressure information represents the first atmosphere of the environment where the terminal is located:

[0205] The audio playback parameters corresponding to the first atmosphere can be determined based on the correspondence between atmospheric pressure and audio playback parameters.

[0206] Alternatively, you can first determine the pressure range to which the first atmosphere belongs, and then determine the audio playback parameters corresponding to the first atmosphere based on the correspondence between the pressure range and the audio playback parameters.

[0207] This situation is similar to the third situation, and will not be described in detail here.

[0208] In one scenario, before determining the audio playback parameters corresponding to the first atmospheric pressure, it can be determined whether the first atmospheric pressure is greater than a preset first atmospheric pressure threshold or less than a preset second atmospheric pressure threshold. If so, the step of determining the audio playback parameters can then be executed.

[0209] The first and second atmospheric pressure thresholds mentioned above can be set by staff based on experience. This application embodiment does not limit this. For example, the first altitude threshold can be 0.8 standard atmospheres, and the second altitude threshold can be 1.1 standard atmospheres, etc.

[0210] When the first atmospheric pressure is greater than the preset first atmospheric pressure threshold or less than the preset second atmospheric pressure threshold, the difference between the atmospheric pressure and the standard atmospheric pressure is large, which may have a significant impact on the diaphragm deformation. Therefore, the audio playback parameters can be determined, and the diaphragm deformation can be controlled according to the audio playback parameters.

[0211] The specific methods for determining the correspondence between the above four types of barometric pressure information and audio playback parameters will be detailed later. Figure 4The illustrated embodiment will not be described in detail here.

[0212] In this way, the audio playback parameters corresponding to the barometric pressure information can be quickly determined based on the correspondence between barometric pressure information and audio playback parameters, thus improving the efficiency of determining audio playback parameters.

[0213] Step S303: Adjust the intensity of the audio signal to be played on the terminal based on the audio playback parameters.

[0214] The audio signal to be played on the terminal is the audio signal obtained by decoding the audio stream.

[0215] The audio stream mentioned above can be an audio stream sent directly by the backend server. For example, in a scenario where an audio app is used to play audio, the terminal can request an audio stream from the backend server of the audio app. Alternatively, the audio stream can be parsed from a video stream sent by the backend server. For example, in a scenario where a video app is used to play video, the terminal can request a video stream from the backend server of the video app, and then parse the video stream to obtain an audio stream.

[0216] This application does not limit the method of adjusting the audio signal using audio playback parameters. For example, the product between the audio playback parameters and the signal values ​​of each audio signal can be calculated, the quotient between the signal values ​​of each audio signal and the audio playback parameters can be calculated, or the difference between the audio playback parameters and the signal values ​​of each audio signal can be calculated, and the calculation result can be used as the signal value of the adjusted audio signal.

[0217] This means that the intensity of the audio signal has been adjusted.

[0218] Step S304: Drive the speaker set in the terminal to play audio based on the adjusted audio signal.

[0219] For details on how to drive the speaker to play audio based on the adjusted audio signal, please refer to the description in the aforementioned scenario section. The only difference is that the audio signal used in this step is the adjusted audio signal, which will not be repeated here.

[0220] As can be seen from the above, when using the solution provided in the embodiments of this application for audio playback, it is possible to obtain atmospheric pressure characterization information reflecting the first atmosphere pressure of the environment where the terminal is located. Based on the atmospheric pressure characterization information, audio playback parameters for adjusting the intensity of the audio signal can be determined. In this way, the intensity of the audio signal to be played on the terminal can be adjusted based on the audio playback parameters, and the speaker set in the terminal can be driven to play audio based on the adjusted audio signal.

[0221] The audio playback parameters are used to adjust the intensity of the audio signal, which in turn affects the degree of diaphragm deformation. Therefore, the audio playback parameters can control the degree of diaphragm deformation. It can be seen that the solution provided in this application takes into account the influence of atmospheric pressure on diaphragm deformation during audio playback. It can determine the audio playback parameters for controlling the degree of diaphragm deformation based on atmospheric pressure. Furthermore, by adjusting the audio signal according to the audio playback parameters and driving the speaker based on the adjusted audio signal, the influence of atmospheric pressure on diaphragm deformation can be reduced through the audio playback parameters. This reduces the probability of the diaphragm undergoing significant deformation due to environmental influences, thereby reducing the probability of contact with the inner wall of the speaker cavity and consequently reducing the probability of noise during audio playback.

[0222] Furthermore, in the solution provided in this application embodiment, the audio playback parameters are not fixed, but can be flexibly set according to the different atmospheric pressures of the terminal's environment. In this way, when adjusting the audio signal according to the audio playback parameters and driving the speaker based on the adjusted audio signal, it is beneficial to reduce the impact of different atmospheric pressures on the diaphragm, so that when the terminal plays audio under different atmospheric pressures, the vibration of the diaphragm tends to be consistent, thereby making the audio effect heard by people tend to be consistent, improving the stability of audio playback, and improving the user experience.

[0223] exist Figure 3 Based on the illustrated embodiment, when determining audio playback parameters, both the first atmospheric pressure and the standard atmospheric pressure can be considered comprehensively. The audio playback parameters are determined based on the pressure characterization information of the first atmospheric pressure and the standard atmospheric pressure. In view of the above, this application provides a second audio playback method.

[0224] See Figure 4 This is a flowchart illustrating the second audio playback method provided in this application embodiment. The method includes the following steps S401-S404.

[0225] Step S401: Obtain pressure characterization information reflecting the first atmosphere pressure of the environment where the terminal is located.

[0226] Step S402: Based on the barometric pressure characterization information and standard atmospheric pressure, determine the adjustment value used to adjust the intensity of the audio signal as an audio playback parameter.

[0227] The aforementioned adjustment value makes the first vibration amplitude approach the second vibration amplitude. The first vibration amplitude is the vibration amplitude of the diaphragm when the speaker is driven to play audio based on the adjusted audio signal under the first atmospheric pressure. The second vibration amplitude is the vibration amplitude of the diaphragm when the speaker is driven to play audio based on the original audio signal under the standard atmospheric pressure.

[0228] The compliance coefficient describes the ease with which a loudspeaker diaphragm deforms. The inventors discovered through experimentation that the diaphragm's compliance coefficient is related to atmospheric pressure. Therefore, when the initial atmospheric pressure is not equal to the standard atmospheric pressure, the ease with which the diaphragm deforms when the loudspeaker plays audio based on an audio signal, resulting in different vibration amplitudes. In other words, the initial atmospheric pressure affects the diaphragm's vibration.

[0229] Therefore, the adjustment value makes the first vibration amplitude approach the second vibration amplitude. That is, the vibration amplitude of the diaphragm when the speaker is driven to play audio based on the adjusted audio signal under the first atmospheric pressure is close to the vibration amplitude of the diaphragm when the speaker is driven to play audio based on the original audio signal under standard atmospheric pressure. In this way, the effect of the first atmospheric pressure on the diaphragm vibration is effectively canceled out.

[0230] The method for determining the above adjustment values ​​will be explained in detail below.

[0231] First, we will introduce the method for determining the adjustment value from the perspective of the relationship between the first atmosphere and the standard atmosphere.

[0232] In one embodiment, if the first atmospheric pressure reflected by the air pressure characterization information is less than the standard atmospheric pressure, a first adjustment value for attenuating the audio signal can be determined based on the first atmospheric pressure and the standard atmospheric pressure.

[0233] Through practical experience, the inventors discovered that when the first atmospheric pressure is lower than the standard atmospheric pressure, the diaphragm deforms more easily under the first atmospheric pressure compared to the standard atmospheric pressure. Therefore, after determining a first adjustment value for attenuating the audio signal, the audio signal can be attenuated according to this first adjustment value. Thus, when the speaker is driven to play audio based on the attenuated audio signal, the driving force of the diaphragm is reduced. Since the driving force is proportional to the degree of diaphragm deformation, this reduces the degree of diaphragm deformation, offsetting the adverse effect of low air pressure making the diaphragm more prone to deformation. This makes the diaphragm's vibration amplitude closer to that under standard atmospheric pressure, improving the stability during audio playback.

[0234] Specifically, the difference between the standard atmospheric pressure and the first atmospheric pressure can be calculated, and the first adjustment value can be determined based on the difference.

[0235] In one scenario, a first adjustment value that is positively correlated with the aforementioned difference can be determined. That is, the larger the aforementioned difference, the larger the first adjustment value can be, and the smaller the aforementioned difference, the smaller the first adjustment value can be.

[0236] For example, the adjustment coefficient corresponding to the difference can be determined based on the correspondence between the above difference and the preset adjustment coefficient. Then, the determined adjustment coefficient can be used as the first adjustment value. The adjustment coefficient can be greater than 1, and the difference is positively correlated with the adjustment coefficient.

[0237] In another implementation, if the first atmospheric pressure reflected by the pressure characterization information is greater than the standard atmospheric pressure, a second adjustment value for enhancing the audio signal can be determined based on the first atmospheric pressure and the standard atmospheric pressure.

[0238] Through experimentation, the inventors discovered that when the first atmospheric pressure is greater than the standard atmospheric pressure, the diaphragm is less prone to deformation compared to the standard atmospheric pressure. Therefore, after determining a second adjustment value for enhancing the audio signal, the audio signal can be enhanced according to this value. When the enhanced audio signal drives the speaker to play audio, it is equivalent to increasing the driving force of the diaphragm. Since the driving force is proportional to the degree of diaphragm deformation, this increases the degree of diaphragm deformation, offsetting the adverse effect of high pressure making the diaphragm less prone to deformation. This allows the diaphragm's vibration amplitude to approach the vibration amplitude under standard atmospheric pressure, improving the stability during audio playback.

[0239] Specifically, the difference between the first atmospheric pressure and the standard atmospheric pressure can be calculated, and the second adjustment value can be determined based on the difference.

[0240] In one scenario, a second adjustment value can be determined that is positively correlated with the aforementioned difference. That is, the larger the aforementioned difference, the larger the second adjustment value can be, and the smaller the aforementioned difference, the smaller the second adjustment value can be.

[0241] For example, the adjustment coefficient corresponding to the difference can be determined based on the correspondence between the above difference and the preset adjustment coefficient. Then, the determined adjustment coefficient can be used as the first adjustment value. The adjustment coefficient can be greater than 1, and the difference is positively correlated with the adjustment coefficient.

[0242] Next, we will introduce how to determine the adjustment value from the perspective of the frequency of the audio signal.

[0243] Specifically, based on the first atmospheric pressure and standard atmospheric pressure reflected by the barometric pressure characterization information, a third adjustment value can be determined for adjusting the intensity of the low-frequency audio signal, and a fourth adjustment value can be determined for adjusting the intensity of the high-frequency audio signal. The frequency ranges corresponding to the low-frequency and high-frequency audio signals can be set by the operator according to actual needs; this embodiment does not limit this setting.

[0244] The following section defines the methods for determining the third and fourth adjustment values.

[0245] In one embodiment, the method described in the preceding embodiments can be followed first to determine a first adjustment value or a second adjustment value based on the difference between the standard atmospheric pressure and the first atmospheric pressure. Then, the product of the first adjustment value or the second adjustment value and the first weight is calculated as a third adjustment value for adjusting the intensity of the low-frequency audio signal, and the product of the first adjustment value or the second adjustment value and the second weight is calculated as a fourth adjustment value for adjusting the intensity of the high-frequency audio signal.

[0246] The first weight is greater than the second weight. The first weight and the second weight can be determined based on the degree of influence of low-frequency audio signals and high-frequency audio signals on diaphragm deformation, respectively. This application does not limit this.

[0247] In another implementation, the method described in the previous implementation can be followed first to determine a first adjustment value or a second adjustment value based on the difference between the standard atmospheric pressure and the first atmospheric pressure. Then, the first adjustment value or the second adjustment value can be determined as a third adjustment value for adjusting the intensity of the low-frequency audio signal. Finally, a fourth adjustment value for adjusting the intensity of the high-frequency audio signal can be determined as a preset adjustment value.

[0248] Through practical experience, the inventors discovered that low-frequency audio signals have a greater impact on diaphragm deformation, while high-frequency audio signals have a smaller impact. In this embodiment, low-frequency and high-frequency audio signals can be addressed separately, with fine-grained adjustments using different values ​​for different audio signals. This makes the adjustments to the audio signals more reasonable and accurate, improving the playback effect when playing audio based on the adjusted audio signals.

[0249] Step S403: Adjust the intensity of the audio signal to be played on the terminal based on the audio playback parameters.

[0250] For details on how to implement this step, please refer to the foregoing. Figure 3 Step S303 in the illustrated embodiment will not be repeated here.

[0251] In one embodiment of this application, the intensity of the audio signal can be processed differently depending on the situation.

[0252] When the pressure readings reflect a pressure of less than the standard atmospheric pressure:

[0253] In one implementation, a third adjustment value and a fourth adjustment value can be used to attenuate the low-frequency audio signal and the high-frequency audio signal, respectively.

[0254] In this way, the third and fourth adjustment values ​​are used to attenuate both low-frequency and high-frequency audio signals. This reduces the degree of diaphragm deformation and mitigates the adverse effect of low air pressure making the diaphragm more prone to deformation. This makes the diaphragm's vibration amplitude closer to that under standard atmospheric pressure, reducing the probability of noise and improving the stability of audio playback.

[0255] In another implementation, a third adjustment value can be used to attenuate the low-frequency audio signal, and a fourth adjustment value can be used to enhance the high-frequency audio signal.

[0256] In this embodiment, on the one hand, the low-frequency audio signal is attenuated using a third adjustment value, which reduces the degree of diaphragm deformation and mitigates the adverse effect of low air pressure making the diaphragm more prone to deformation. This makes the vibration amplitude of the diaphragm closer to that under standard atmospheric pressure, thus improving the stability when playing audio. On the other hand, the high-frequency audio signal is enhanced using a fourth adjustment value, which increases the intensity of the final high-frequency sound and reduces the impact of weak bass on the user's listening experience, thereby improving the user experience.

[0257] When the pressure rating information reflects a first atmosphere greater than the standard atmosphere:

[0258] In one implementation, a third adjustment value and a fourth adjustment value can be used to enhance the low-frequency audio signal and the high-frequency audio signal, respectively.

[0259] In this way, the third and fourth adjustment values ​​are used to enhance both low-frequency and high-frequency audio signals. This increases the degree of diaphragm deformation, reduces the adverse effect of high air pressure making the diaphragm less prone to deformation, and makes the vibration amplitude of the diaphragm closer to the vibration amplitude under standard atmospheric pressure, thus improving the stability when playing audio.

[0260] In another implementation, a third adjustment value can be used to enhance the low-frequency audio signal, and a fourth adjustment value can be used to attenuate the high-frequency audio signal.

[0261] In this embodiment, on the one hand, the low-frequency audio signal is enhanced by using a third adjustment value, which can enhance the deformation of the diaphragm and reduce the adverse effect of high air pressure making the diaphragm less prone to deformation. This makes the vibration amplitude of the diaphragm closer to the vibration amplitude under standard atmospheric pressure, thus improving the stability when playing audio. On the other hand, the high-frequency audio signal is attenuated by using a fourth adjustment value, which reduces the intensity of the high-frequency sound played in the end, reduces the impact of strong bass on the user's listening experience, and improves the user experience.

[0262] Step S404: Drive the speaker set in the terminal to play audio based on the adjusted audio signal.

[0263] This step is the same as the one mentioned above. Figure 3 Step S304 is the same in the illustrated embodiment, and will not be repeated here.

[0264] As can be seen from the above, when using the solution provided in this application embodiment for audio playback, firstly, the influence of atmospheric pressure on diaphragm deformation is considered. Audio playback parameters for controlling the degree of diaphragm deformation can be determined based on atmospheric pressure. Furthermore, when adjusting the audio signal according to the audio playback parameters and driving the speaker based on the adjusted audio signal, the influence of atmospheric pressure on diaphragm deformation can be reduced through the audio playback parameters. This reduces the probability of the diaphragm undergoing significant deformation due to environmental influences, thereby reducing the probability of contact with the inner wall of the speaker cavity, and consequently reducing the probability of noise during audio playback. Secondly, the audio playback parameters... The parameters are determined based on the first atmospheric pressure and the standard atmospheric pressure of the terminal's environment. In other words, when determining the audio playback parameters, the adverse effects of the first atmospheric pressure on diaphragm deformation compared to the standard atmospheric pressure are taken into account. Therefore, when adjusting the audio signal based on the audio playback parameters and driving the speaker based on the adjusted audio signal, the first vibration amplitude of the diaphragm under the first atmospheric pressure is made closer to the second vibration amplitude of the diaphragm under the standard atmospheric pressure. This reduces the adverse effects of the first atmospheric pressure on diaphragm deformation compared to the standard atmospheric pressure, making the diaphragm amplitude more stable and improving the stability when playing audio.

[0265] The following is a summary of the aforementioned... Figure 3 The method for determining the correspondence between air pressure characterization information and audio playback parameters is described in the illustrated embodiment.

[0266] For cases where the air pressure information is represented by atmospheric pressure:

[0267] The first method involves determining the atmospheric pressure range for which the correspondence needs to be established, and then, for each integer atmospheric pressure within the range, directly applying... Figure 4 The method described in the illustrated embodiment determines the adjustment value based on the atmospheric pressure and the standard atmospheric pressure, and the obtained adjustment value is determined as the audio playback parameter corresponding to the atmospheric pressure.

[0268] The second method involves selecting representative atmospheric pressure values ​​from various atmospheric pressure ranges and then using... Figure 4 The method described in the illustrated embodiment determines an adjustment value based on a representative atmospheric pressure value and standard atmospheric pressure. This adjusted value is then used as the audio playback parameter corresponding to all atmospheric pressures within the specified atmospheric pressure range. The aforementioned representative atmospheric pressure value can be the average, median, or other values ​​of the atmospheric pressures within the range.

[0269] The third method involves determining the adjustment value corresponding to each atmospheric pressure within the atmospheric pressure range, then calculating the average value of the above adjustment values, and using the resulting average value as the audio playback parameter corresponding to each atmospheric pressure within the atmospheric pressure range.

[0270] For cases where air pressure information is represented by latitude and longitude:

[0271] First, the atmospheric pressure corresponding to each latitude and longitude interval can be determined based on the correspondence between latitude and longitude intervals and atmospheric pressure. Then, for each determined atmospheric pressure, the following methods can be used... Figure 4 The method described in the illustrated embodiment determines the adjustment value based on atmospheric pressure and standard atmospheric pressure, and the obtained adjustment value is used as the audio playback parameter for all latitudes and longitudes included in the latitude and longitude interval.

[0272] For cases where the air pressure information is for cities:

[0273] First, representative atmospheric pressure values ​​for each city can be determined. Then, for each determined representative atmospheric pressure value, the following methods are used: Figure 4 The method described in the illustrated embodiment determines the adjustment value based on the representative value of atmospheric pressure and the standard atmospheric pressure, and the obtained adjustment value is determined as the audio playback parameter corresponding to the city.

[0274] The representative value of atmospheric pressure corresponding to a city can be the average or median atmospheric pressure of various regions within the city.

[0275] For cases where air pressure information is represented by altitude:

[0276] The first method involves determining the atmospheric pressure corresponding to each integer altitude within the altitude range where the correspondence needs to be established, based on the relationship between altitude and atmospheric pressure. Then, it uses... Figure 4 The method described in the illustrated embodiment determines the adjustment value based on the atmospheric pressure and the standard atmospheric pressure, and the obtained adjustment value is determined as the audio playback parameter corresponding to the altitude.

[0277] The second method involves selecting representative altitude values ​​from various altitude ranges, determining the corresponding atmospheric pressure for each altitude value, and then using... Figure 4 The method described in the illustrated embodiment determines an adjustment value based on the determined atmospheric pressure and standard atmospheric pressure, and then uses this adjustment value as the audio playback parameter corresponding to the altitude range included in that altitude range. The aforementioned altitude representative value can be the average, median, or other values ​​of the altitudes included in the atmospheric pressure range.

[0278] The third method involves determining the adjustment value corresponding to each altitude within the altitude range, then calculating the average of these adjustment values, and using the resulting average as the audio playback parameter corresponding to each altitude within the altitude range.

[0279] according to Figure 3 and Figure 4 The embodiments shown in this application provide three possible software structures applicable to the embodiments of this application.

[0280] The following is through Figures 5a-5c This paper introduces three possible software structures applicable to the embodiments of this application.

[0281] First see Figure 5a This is a first software architecture block diagram for a terminal applicable to the embodiments of this application. The software system of the aforementioned terminal can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture.

[0282] A layered architecture divides the terminal's software system into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the software system can be divided into four layers: applications, application framework, hardware abstraction layer (HAL), and hardware layer.

[0283] The application layer can include a series of application packages. The application layer runs applications by calling the Application Programming Interface (API) provided by the application framework layer. For example, application packages can include music, video, and other applications. Understandably, the port of each of the above applications can be used to receive data.

[0284] The application framework layer provides APIs and a programming framework for applications within the application layer. It includes predefined functions. For example, the application framework layer may include an audio framework and a location framework. The audio framework may include modules such as MediaPlayer, AudioTrack, AudioStreamOut, AudioManager, AudioService, and audio processing; the location framework may include modules such as LocationManager and LocationService.

[0285] The hardware abstraction layer can contain multiple hardware abstraction modules, such as an audio hardware abstraction module (AudioHal), which may include modules like stream management (StreamMgmt) and smart parameter tuning (SmartpaCust). The terminal system can load the corresponding library modules for the device hardware, thereby enabling the application framework layer to access the device hardware.

[0286] The hardware layer is the lowest level of the terminal system and can consist of various physical components such as a processor, memory, and input / output interfaces (I / O). The hardware layer may also include an audio digital signal processor. This audio digital signal processor may include an audio processing domain (APD), which contains audio signal adjustment modules for processing audio signals.

[0287] The following is combined with Figure 5a Taking a music app as an example, this application describes the solution provided in its embodiments from the perspective of the interaction process between different layers of the software system through steps S1-S6.

[0288] Step S1: The music app at the application layer starts, and the operating system responds to the app process's request by creating a media player and audio tracks at the application framework layer.

[0289] Step S2: Use a media player to decode the audio stream to obtain a Pulse Code Modulation (PCM) stream. Input the PCM stream into the audio track for mixing and other processing. The audio stream output module transmits the processed audio signal stream to the stream management module in the audio HAL.

[0290] Step S3: The stream management module sends an audio playback command to the intelligent parameter adjustment module on the one hand, and transmits the audio signal stream to the audio signal adjustment module on the other hand.

[0291] Step S4: After receiving the audio playback command, the intelligent parameter adjustment module reads the latest stored air pressure characterization information from the hidden partition 1 as the air pressure characterization information reflecting the first atmosphere of the environment where the terminal is located, and writes the air pressure characterization information into the audio signal adjustment module.

[0292] Step S5: The audio signal adjustment module determines the audio playback parameters based on the air pressure characterization information, adjusts the audio signal in the audio signal stream according to the audio playback parameters, and inputs the adjusted audio signal into the digital-to-analog converter chip.

[0293] Step S6: The digital-to-analog converter chip converts the adjusted audio signal into an analog signal and inputs the analog signal into the speaker to drive the speaker to play audio.

[0294] In step S1, only the audio track can be created. In this case, in step S2, the APP decodes the audio stream to obtain the PCM stream and inputs the PCM stream into the audio track.

[0295] The process for video apps is similar to that described above, and will not be detailed here. After the video app starts, the media player first extracts the audio stream from the video stream, then decodes the audio stream, and executes subsequent steps.

[0296] The audio effect files used for mixing and adding audio effects to the audio signal, as well as the algorithm files used by the audio signal adjustment module to determine the audio playback parameters, can be stored in hidden partition 2. Hidden partition 2 can be the original design manufacturer (ODM) partition.

[0297] Figure 5a The location service and location management can be collectively referred to as location query service, and the audio service, audio management and audio processing can be collectively referred to as audio control service. The source of the barometric pressure characterization information recorded in hidden partition 1 is introduced below.

[0298] First, the location query service within the positioning framework obtains the barometric pressure information of the terminal's environment and sends the barometric pressure information to the audio control service. The timing of the location query service obtaining the barometric pressure information has been described in the preceding embodiments.

[0299] Specifically, the location management module in the location query service is responsible for requesting the barometric pressure information (latitude, longitude, city, and altitude) of the terminal's environment from the backend server. The location service is also responsible for interfacing with the audio control service and sending the barometric pressure information to the audio control service.

[0300] Secondly, the audio service in the audio control service is responsible for interfacing with the positioning service to obtain barometric pressure information. This information is then sent to the audio management module via a parameter setting interface. The audio management module forwards the barometric pressure information to the audio processing module, which adds sound effects and interfaces with the HAL layer to send the barometric pressure information to the intelligent parameter adjustment module within the audio HAL. The audio processing module can be referred to as AudioFlinger.

[0301] Finally, the intelligent parameter adjustment module writes the obtained air pressure characterization information into hidden partition 1 in the storage space.

[0302] As seen above, the location query service and audio control service located in the application framework layer can send barometric pressure information to the HAL layer. The audio HAL can then write this barometric pressure information to a hidden partition in the storage space. Subsequently, upon receiving an audio playback command, the latest stored barometric pressure information can be easily read from the hidden partition and written to the audio signal adjustment module in the hardware layer. This allows the audio signal adjustment module to adjust the intensity of the audio signal to be played on the terminal based on the audio playback parameters. Therefore, through the interaction between modules or services located in different software architecture layers, stable and rapid audio signal adjustment can be achieved.

[0303] See also Figure 5b This is a second software structure block diagram of the terminal to which this application embodiment applies.

[0304] and Figure 5a compared to, Figure 5b In the software structure shown, the application framework layer may not include the positioning framework, and the hardware layer may include the Sensor Process Domain (SensorPD), which includes sensor module 1 and sensor module 2.

[0305] The following is combined with Figure 5b Taking a music app as an example, this application describes the solution provided in its embodiments from the perspective of the interaction process between different layers of the software system through steps M1-M6.

[0306] Step M1: The music app at the application layer starts, and the operating system responds to the app's request by creating a media player and audio tracks at the application framework layer.

[0307] Step M2: Use a media player to decode the audio stream to obtain a PCM stream. Input the PCM stream into the audio track for mixing and other processing. The audio stream output module transmits the processed audio signal stream to the stream management module in the audio HAL.

[0308] Step M3: The stream management module transmits the audio signal stream to the audio signal adjustment module.

[0309] Step M4: After receiving the audio playback command, the intelligent parameter adjustment module registers sensor module 1 and / or sensor module 2. In this way, sensor module 1 and / or sensor module 2 can perform information sensing, record the sensing results, and send the sensing results to the intelligent parameter adjustment module through the socket (Qsocket) interface.

[0310] The following describes how the sensor module obtains the sensing results.

[0311] In one implementation, the sensor module can obtain the altitude of the terminal's geographical location provided by the altitude detection service. That is, the sensor module sends a request to the altitude detection service and receives the altitude returned by the service. This sensor module can be referred to as a virtual sensor. In this way, the sensor module can conveniently obtain sensing results through the altitude detection service without relying on physical hardware.

[0312] In another implementation, the sensor module controls a barometric pressure sensor to measure and record the atmospheric pressure of the surrounding environment. In this way, the barometric pressure sensor can measure the altitude of the terminal's geographical location, thus obtaining more accurate sensing results.

[0313] Step M5: The intelligent parameter adjustment module obtains the air pressure characterization information reflecting the first atmosphere of the environment where the terminal is located based on the sensing results, determines the audio playback parameters based on the air pressure characterization information, adjusts the audio signal in the audio signal stream according to the audio playback parameters, and inputs the adjusted audio signal into the digital-to-analog converter chip.

[0314] Step M6: The digital-to-analog converter chip converts the adjusted audio signal into an analog signal and inputs the analog signal into the speaker to drive the speaker to play audio.

[0315] As can be seen from the above, the sensor module located at the hardware layer accurately senses the environment in which the terminal is located and sends the sensing results to the audio parameter adjustment module. Thus, the audio signal adjustment module can adjust the intensity of the audio signal to be played on the terminal based on the audio playback parameters. It is evident that through the interaction between modules or services located at different software architecture layers, stable and rapid audio signal adjustment can be achieved.

[0316] See you again at the end. Figure 5c This is a third software structure block diagram of the terminal to which this application embodiment applies.

[0317] Figure 5c The software structure shown includes Figure 5a and Figure 5b All modules or services in, based on Figure 5c When the software structure shown executes the solution provided in the embodiments of this application, the layers of the software system can interact either according to the interaction flow shown in steps S1-S6 above, or according to the interaction flow shown in steps M1-M6 above.

[0318] Next, we will proceed through... Figures 6a-6c The diagrams illustrating the three audio playback scenarios introduce the solutions provided in this application from the perspective of user-terminal interaction.

[0319] like Figure 6aAs shown, the desktop of the terminal operating system includes multiple applications such as settings, camera, and music. When the user clicks on the music app on the desktop, the music app launches and displays the following: Figure 6b The playlist interface shown displays the names of audio tracks 1-4, along with their corresponding audio information 1-4. The user selects audio track 1 from among audio tracks 1-4 and enters the playlist. Figure 6c The interface shown will begin audio playback. At this time, the terminal internally uses the methods described above. Figures 5a-5c The internal interaction process described involves obtaining the atmospheric pressure of the terminal's environment and determining the audio playback parameters based on this pressure. Then, a prompt message can pop up on the music app's playback interface, such as, "We have determined suitable audio playback parameters for your current atmospheric pressure. Would you like to adjust the sound effects?" If the user selects "yes," the terminal can adjust the intensity of the audio signal to be played based on the audio playback parameters and drive the speaker set in the terminal to play the audio based on the adjusted audio signal.

[0320] The user information involved in the embodiments of this application is all information authorized by the user. The acquisition, storage, use, processing, transmission, provision and disclosure of user information all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0321] In a specific implementation, this application also provides a computer storage medium, wherein the computer storage medium may store a program, wherein when the program runs, it controls the device where the computer-readable storage medium is located to execute some or all of the steps in the above embodiments. The storage medium may be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0322] In a specific implementation, this application also provides a computer program product, which includes executable instructions. When the executable instructions are executed on a terminal, the terminal performs some or all of the steps in the above method embodiments.

[0323] In a specific implementation, this application embodiment also provides a terminal, including: one or more processors and a memory;

[0324] The memory is coupled to the one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the terminal to execute the audio playback method provided in the embodiments of this application.

[0325] like Figure 7As shown, this application also provides a chip system applied to a terminal 100. The chip system includes one or more processors 701. The processors 701 are used to call computer instructions to cause the terminal 100 to input data to be processed into the chip system. The chip system performs audio playback based on the audio playback method provided in the embodiments of this application.

[0326] In one possible implementation, the chip system also includes input and output interfaces for inputting and outputting data.

[0327] The various embodiments of the mechanisms disclosed in this application can be implemented in hardware, software, firmware, or a combination of these implementation methods. Embodiments of this application can be implemented as computer programs or program code executable on a programmable system, the programmable system including at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.

[0328] Program code can be applied to input instructions to execute the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, the processing system includes any system having a processor such as, for example, a Digital Signal Processor (DSP), a microcontroller, an Application Specific Integrated Circuit (ASIC), or a microprocessor.

[0329] The program code can be implemented using a high-level procedural language or an object-oriented programming language to communicate with the processing system. Assembly language or machine language can also be used when needed. In fact, the mechanisms described in this application are not limited to any particular programming language. In either case, the language can be a compiled language or an interpreted language.

[0330] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored thereon on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, the instructions may be distributed via a network or through other computer-readable media. Therefore, machine-readable media may include any mechanism for storing or transmitting information in a machine-readable (e.g., computer-readable) form, including but not limited to floppy disks, optical disks, CD-ROMs, compact disc read-only memory (CD-ROMs), magneto-optical disks, read-only memory, random access memory, erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic cards or optical cards, flash memory, or tangible machine-readable storage for transmitting information (e.g., carrier waves, infrared signals, digital signals, etc.) using the Internet in the form of electrical, optical, acoustic, or other forms of propagated signals. Therefore, machine-readable media includes any type of machine-readable medium suitable for storing or transmitting electronic instructions or information in a machine-readable (e.g., computer-readable) form.

[0331] In the accompanying drawings, some structural or methodological features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be necessary. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the accompanying drawings. Furthermore, including structural or methodological features in a particular figure does not imply that such features are required in all embodiments, and in some embodiments, these features may be omitted or may be combined with other features.

[0332] It should be noted that all units / modules mentioned in the device embodiments of this application are logical units / modules. Physically, a logical unit / module can be a physical unit / module, a part of a physical unit / module, or a combination of multiple physical units / modules. The physical implementation of these logical units / modules themselves is not the most important factor; the combination of functions implemented by these logical units / modules is the key to solving the technical problems proposed in this application. Furthermore, to highlight the innovative aspects of this application, the above-described device embodiments of this application have not introduced units / modules that are not closely related to solving the technical problems proposed in this application. This does not mean that the above-described device embodiments do not contain other units / modules.

[0333] It should be noted that in the examples and description of this patent, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0334] Although this application has been illustrated and described with reference to certain preferred embodiments thereof, those skilled in the art should understand that various changes in form and detail may be made thereto without departing from the spirit and scope of this application.

Claims

1. An audio playback method, characterized in that, Applied to a terminal, the method includes: Obtain pressure characterization information reflecting the first atmosphere of the environment where the terminal is located; Based on the air pressure characterization information, audio playback parameters for adjusting the intensity of the audio signal are determined; Based on the audio playback parameters, the intensity of the audio signal to be played on the terminal is adjusted; The adjusted audio signal drives the speaker in the terminal to play audio.

2. The method according to claim 1, characterized in that, The step of determining audio playback parameters for adjusting the audio signal based on the air pressure characterization information includes: Based on the air pressure characterization information and standard atmospheric pressure, an adjustment value is determined to adjust the intensity of the audio signal as an audio playback parameter. The adjustment value makes the first vibration amplitude approach the second vibration amplitude. The first vibration amplitude is the vibration amplitude of the diaphragm when the speaker is driven to play audio based on the adjusted audio signal under the first atmospheric pressure. The second vibration amplitude is the vibration amplitude of the diaphragm when the speaker is driven to play audio based on the original audio signal under the standard atmospheric pressure.

3. The method according to claim 2, characterized in that, The determination of adjustment values ​​for adjusting the intensity of the audio signal based on the air pressure characterization information and standard atmospheric pressure includes: When the first atmospheric pressure reflected by the air pressure characterization information is less than the standard atmospheric pressure, a first adjustment value for attenuating the audio signal is determined based on the first atmospheric pressure and the standard atmospheric pressure. If the first atmospheric pressure reflected by the pressure characterization information is greater than the standard atmospheric pressure, a second adjustment value for enhancing the audio signal is determined based on the first atmospheric pressure and the standard atmospheric pressure.

4. The method according to claim 2, characterized in that, The determination of adjustment values ​​for adjusting the intensity of the audio signal based on the air pressure characterization information and standard atmospheric pressure includes: Based on the first atmospheric pressure and standard atmospheric pressure reflected by the air pressure characterization information, a third adjustment value is determined for adjusting the intensity of the low-frequency audio signal, and a fourth adjustment value is determined for adjusting the intensity of the high-frequency audio signal.

5. The method according to claim 4, characterized in that, When the pressure characterization information reflects a first atmospheric pressure that is less than the standard atmospheric pressure: The third adjustment value is used to attenuate the low-frequency audio signal, and the fourth adjustment value is used to enhance the high-frequency audio signal. or Both the third and fourth adjustment values ​​are used to attenuate the audio signal.

6. The method according to claim 4, characterized in that, When the pressure characterization information reflects a first atmosphere greater than the standard atmospheric pressure: The third adjustment value is used to enhance the low-frequency audio signal, and the fourth adjustment value is used to attenuate the high-frequency audio signal. or Both the third and fourth adjustment values ​​are used to enhance the audio signal.

7. The method according to claim 1, characterized in that, The step of determining audio playback parameters for adjusting the audio signal based on the air pressure characterization information includes: Based on the correspondence between air pressure characterization information and audio playback parameters, the audio playback parameters corresponding to the air pressure characterization information are determined and used as audio playback parameters for adjusting the audio signal.

8. The method according to any one of claims 1-7, characterized in that, The method further includes: Based on the location query results provided by the location query service, the air pressure characterization information of the environment where the terminal is located is obtained, and the air pressure characterization information is written into a hidden partition in the storage space; The method of obtaining pressure characterization information reflecting the first atmosphere pressure of the environment where the terminal is located includes: The latest stored air pressure characterization information is read from the hidden partition and used as air pressure characterization information reflecting the first atmosphere of the environment in which the terminal is located.

9. The method according to claim 8, characterized in that, The terminal includes: a location query service and an audio control service located at the application framework layer; an audio HAL located at the hardware abstraction layer; and an audio signal adjustment module located at the hardware layer. The step of obtaining the barometric pressure characterization information of the environment in which the terminal is located and writing the barometric pressure characterization information into a hidden partition in the storage space includes: The location query service obtains the barometric pressure information of the environment where the terminal is located, and sends the barometric pressure information to the audio control service. The audio control service sends the barometric pressure information to the audio HAL through a parameter setting interface; The audio HAL writes the barometric pressure information into a hidden partition within the storage space. The step of reading the latest stored barometric pressure characterization information from the hidden partition includes: In response to an audio playback command, the audio HAL reads the latest stored barometric pressure information from the hidden partition as barometric pressure information reflecting the first atmosphere of the environment where the terminal is located, and writes the barometric pressure information into the audio signal adjustment module. The step of adjusting the intensity of the audio signal to be played on the terminal based on the audio playback parameters includes: The audio signal adjustment module adjusts the intensity of the audio signal to be played on the terminal based on the audio playback parameters.

10. The method according to claim 8, characterized in that, The air pressure characterization information includes: The latitude and longitude of the geographical location of the terminal; and / or The altitude of the geographical location of the terminal; and / or The city where the terminal is located.

11. The method according to any one of claims 1-7, characterized in that, The method of obtaining pressure characterization information reflecting the first atmosphere pressure of the environment where the terminal is located includes: Based on the sensing results obtained by the sensor module, pressure characterization information reflecting the first atmosphere pressure of the environment in which the terminal is located is obtained.

12. The method according to claim 11, characterized in that, The terminal includes: a sensor module and an audio parameter adjustment module located at the hardware layer. Obtaining the barometric pressure characterization information reflecting the first atmosphere of the terminal's environment includes: The sensor module senses information and records the sensing results; The audio parameter adjustment module responds to the audio playback command and obtains the perception results recorded in the sensor module, which serve as barometric pressure characterization information reflecting the first atmosphere pressure of the environment in which the terminal is located. The step of adjusting the intensity of the audio signal to be played on the terminal based on the audio playback parameters includes: The audio signal adjustment module adjusts the intensity of the audio signal to be played on the terminal based on the audio playback parameters.

13. The method according to claim 12, characterized in that, The sensor module senses information and records the sensing results, including: The sensor module acquires the altitude of the terminal's geographical location provided by the altitude detection service and records the altitude. and / or The sensor module is a barometric pressure sensor, which measures and records the atmospheric pressure of the surrounding environment.

14. The method according to claim 11, characterized in that, The air pressure characterization information includes: The first atmospheric pressure of the environment in which the terminal is located; and / or The altitude of the geographical location of the terminal.

15. The method according to any one of claims 1-7, characterized in that, The method of obtaining pressure characterization information reflecting the first atmosphere pressure of the environment where the terminal is located includes: Determine the transmission and arrival times of a preset number of downlink pilot signals recently received from different base stations, and determine the base station that transmitted the downlink pilot signals, wherein the preset number is greater than or equal to 3; Based on the determined transmission and arrival times, the reception delay of each downlink pilot signal is obtained; Based on the obtained reception delay, the distance between the terminal and each base station is determined; Based on the distance between the terminal and each base station and the location of each base station, pressure characterization information reflecting the first atmosphere pressure of the environment in which the terminal is located is obtained.

16. A terminal, characterized in that, include: One or more processors and memory; The memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the terminal to perform the method as described in any one of claims 1 to 15.

17. A computer-readable storage medium, characterized in that, Includes a computer program that, when run on a terminal, causes the terminal to perform the method as described in any one of claims 1 to 15.

18. A computer program product, characterized in that, The computer program product includes executable instructions that, when executed on a terminal, cause the terminal to perform the method of any one of claims 1 to 15.

19. A chip system, characterized in that, The chip system is applied to a terminal, and the chip system includes one or more processors, the processors being used to invoke computer instructions to cause the terminal to input data into the chip system and execute the method of any one of claims 1 to 15 to play audio.