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.
Patent Information
- Application Number
- PCT/CN2025/092001
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-05-20
- Filing Date
- 2025-04-29
- Publication Date
- 2025-11-27
AI Technical Summary
When a terminal plays audio under different atmospheric pressure environments, the diaphragm is easily affected by external interference, causing deformation, generating noise, and affecting audio quality.
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 process low-frequency and high-frequency audio signals to ensure that the diaphragm vibrates consistently under different atmospheric pressures.
This reduces the probability of diaphragm deformation under different atmospheric pressures, reduces noise, and improves audio playback stability and user experience.
Smart Images

Figure CN2025092001_27112025_PF_FP_ABST
Abstract
Description
An audio playing method, terminal, storage medium and program product
[0001] The present application claims priority to the Chinese patent application No. 202410627694.5, filed on May 20, 2024, and entitled "An audio playing method, terminal, storage medium and program product", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0002] The present application relates to the technical field of data processing, in particular to an audio playing method, terminal, storage medium and program product. BACKGROUND
[0003] 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 audio external playing function.
[0004] However, the diaphragm is flexible and ultra-thin, and is easily affected by the external environment, thereby affecting the quality of the 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
[0005] Therefore, the present application provides an audio playing method, terminal, storage medium and program product to reduce the probability of noise in the audio played by the terminal.
[0006] In a first aspect, an embodiment of the present application provides an audio playing method applied to a terminal, and the method comprises:
[0007] obtaining air pressure representation information reflecting a first atmospheric pressure of an environment in which the terminal is located;
[0008] determining an audio playing parameter for adjusting the intensity of an audio signal based on the air pressure representation information;
[0009] adjusting the intensity of an audio signal to be played by the terminal based on the audio playing parameter;
[0010] driving a loudspeaker provided in the terminal to play audio based on the adjusted audio signal.
[0011] 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 adaptively determine the audio playing parameter for controlling the deformation degree of the diaphragm based on the atmospheric pressure. Further, 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 by the audio playing parameter, thereby reducing the probability of the diaphragm being greatly deformed due to environmental influence, thereby reducing the probability of the diaphragm contacting the inner wall of the loudspeaker cavity, and further reducing the probability of noise occurring when playing audio.
[0012] 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. In this way, when adjusting the audio signal according to the audio playing parameter and driving the loudspeaker based on the adjusted audio signal, it is beneficial to reduce the influence of different atmospheric pressures on the diaphragm, so that the vibration of the diaphragm tends to be consistent when the terminal plays audio under different atmospheric pressures, thereby making the audio effect heard by people tend to be consistent, improving the stability of playing audio, and improving the user experience.
[0013] In an embodiment of the present application, the audio playing parameter for adjusting the intensity of the audio signal is determined based on the atmospheric pressure representation information, including:
[0014] 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.
[0015] It can be seen from the above that, in the embodiment, in the first aspect, the influence of the atmospheric pressure on the diaphragm deformation is considered, and the audio playing parameter for controlling the deformation degree of the diaphragm can be determined based on the atmospheric pressure. 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 the atmospheric pressure on the diaphragm deformation can be reduced by the audio playing parameter, the probability of the diaphragm being greatly deformed due to the influence of the environment is reduced, and thus the probability of the diaphragm contacting the inner wall of the loudspeaker cavity is reduced, and the probability of noise occurring during audio playing is reduced. In the 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 diaphragm deformation compared with the standard atmospheric pressure is considered. 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 approach the second vibration amplitude of the diaphragm under the standard atmospheric pressure, the adverse influence of the first atmospheric pressure on the diaphragm deformation compared with the standard atmospheric pressure is reduced, the amplitude of the diaphragm is relatively stable, and the stability during audio playing is improved.
[0016] 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 characteristic information and the standard atmospheric pressure, including:
[0017] In the case that the first atmospheric pressure reflected by the atmospheric pressure characteristic 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.
[0018] In the case that the first atmospheric pressure reflected by the atmospheric pressure characteristic 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.
[0019] In the case that the first atmospheric pressure reflected by the atmospheric pressure characteristic information is less than the standard atmospheric pressure, after the first adjustment value for performing attenuation processing on the audio signal is determined, the audio signal can be attenuated according to the first adjustment value, so that when the loudspeaker is driven based on the attenuated audio signal to play audio, the driving force of the diaphragm is reduced. Since the driving force is proportional to the deformation degree of the diaphragm, the deformation degree of the diaphragm can be reduced in this way, the adverse influence of low pressure on the diaphragm being more easily deformed is reduced, 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 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 equivalent to being increased. Since the driving force is proportional to the deformation degree of the diaphragm, the deformation degree of the diaphragm can be increased in this way, the adverse effect that the diaphragm is not easy to deform under high air pressure is weakened, the vibration amplitude of the diaphragm tends to be close to the vibration amplitude under the standard atmospheric pressure, and the stability when playing audio is improved.
[0021] 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, comprising:
[0022] 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.
[0023] In this 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 when playing audio based on the adjusted audio signal is improved.
[0024] 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:
[0025] 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.
[0026] In this embodiment, on the one hand, the low-frequency audio signal is attenuated by using the third adjustment value, which can reduce the deformation degree of the diaphragm, reduce the adverse effect that the diaphragm is more likely to deform under low air pressure, and make the vibration amplitude of the diaphragm tend to be close to the vibration amplitude under the standard atmospheric pressure, thereby improving the stability when playing audio; on the other hand, the high-frequency audio signal is enhanced by using the fourth adjustment value, which improves the intensity of the high-frequency sound finally played, reduces the influence of weak bass on the user's listening experience, and improves the user experience.
[0027] 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:
[0028] The third adjustment value and the fourth adjustment value are both used for attenuating the audio signal.
[0029] In this way, the low-frequency audio signal and the high-frequency audio signal are both attenuated by the third adjustment value and the fourth adjustment value, which can further 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 close to the vibration amplitude under the standard atmospheric pressure, reduce the probability of noise, and improve the stability when playing audio.
[0030] In an embodiment of the present application, when the first atmospheric pressure reflected by the air pressure representation information is greater 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 attenuate the high-frequency audio signal.
[0031] The third adjustment value is used to attenuate the low-frequency audio signal, and the fourth adjustment value is used to attenuate the high-frequency audio signal.
[0032] In this embodiment, on the one hand, the low-frequency audio signal is enhanced by the third adjustment value, which can enhance the deformation degree of the diaphragm, reduce the adverse effect of high air pressure on the deformation of the diaphragm, make the vibration amplitude of the diaphragm close to the vibration amplitude under the standard atmospheric pressure, and improve the stability when playing audio; on the other hand, the high-frequency audio signal is attenuated by the fourth adjustment value, which reduces the intensity of the high-frequency sound played finally, reduces the influence of strong bass on the user's listening experience, and improves the user experience.
[0033] In an embodiment of the present application, when the first atmospheric pressure reflected by the air pressure representation information is greater 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 attenuate the high-frequency audio signal.
[0034] The third adjustment value and the fourth adjustment value are both used to enhance the audio signal.
[0035] In this way, the low-frequency audio signal and the high-frequency audio signal are both attenuated by the third adjustment value and the fourth adjustment value, which can further 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 close to the vibration amplitude under the standard atmospheric pressure, reduce the probability of noise, and improve the stability when playing audio.
[0036] In an embodiment of the present application, the audio playback parameter used to adjust the intensity of the audio signal is determined based on the air pressure representation information, including:
[0037] According to the correspondence between the air pressure representation information and the audio playback parameter, the audio playback parameter corresponding to the air pressure representation information is determined as the audio playback parameter used to adjust the intensity of the audio signal.
[0038] In this way, the audio playback parameter corresponding to the air pressure representation information can be quickly determined according to the correspondence between the air pressure representation information and the audio playback parameter, and the efficiency of determining the audio playback parameter is improved.
[0039] In one embodiment of the present application, the method further comprises:
[0040] based on the location query result provided by the location query service, obtaining the atmospheric pressure representing information of the environment where the terminal is located, and writing the atmospheric pressure representing information into the hidden partition in the storage space;
[0041] The obtaining of the atmospheric pressure representing information reflecting the first atmospheric pressure of the environment where the terminal is located comprises:
[0042] reading the latest stored atmospheric pressure representing information from the hidden partition as the atmospheric pressure representing information reflecting the first atmospheric pressure of the environment where the terminal is located.
[0043] It can be seen that in the embodiment, the terminal can continuously update the atmospheric pressure representing information of the environment where the terminal is located in the hidden partition, and the latest stored atmospheric pressure representing information in the hidden partition reflects the first atmospheric pressure of the latest environment where the terminal is located. In this way, when the scheme provided by the embodiment of the present application is executed, the latest stored atmospheric pressure representing information can be directly and conveniently read from the hidden partition as the atmospheric pressure representing information reflecting the first atmospheric pressure of the environment where the terminal is located, without the need for real-time acquisition, thereby improving the efficiency of obtaining the atmospheric pressure representing information.
[0044] In one embodiment of the present application, the terminal comprises a location query service and an audio control service located in an application program framework layer, an audio HAL located in a hardware abstraction HAL layer, and an audio signal adjustment module located in a hardware layer, and the obtaining of the atmospheric pressure representing information of the environment where the terminal is located and the writing of the atmospheric pressure representing information into the hidden partition in the storage space comprises:
[0045] The location query service obtains the atmospheric pressure representing information of the environment where the terminal is located, and sends the atmospheric pressure representing information to the audio control service;
[0046] The audio control service sends the atmospheric pressure representing information to the audio HAL through a parameter setting interface;
[0047] The audio HAL writes the atmospheric pressure representing information into the hidden partition in the storage space;
[0048] The reading of the latest stored atmospheric pressure representing information from the hidden partition comprises:
[0049] The audio HAL reads the latest stored atmospheric pressure representing information from the hidden partition as the atmospheric pressure representing information reflecting the first atmospheric pressure of the environment where the terminal is located in response to an audio playing instruction, and writes the atmospheric pressure representing information into the audio signal adjustment module;
[0050] The audio signal adjustment module adjusts the intensity of the audio signal to be played by the terminal based on the audio playing parameter.
[0051] The audio signal adjustment module adjusts the intensity of the audio signal to be played by the terminal based on the audio playing parameter.
[0052] As can be seen from the above, the location query service and the audio control service located in the application framework layer can send the barometric pressure representation information to the HAL layer, so that the audio HAL can write the barometric pressure representation information into the hidden partition in the storage space. In this way, when the audio playing instruction is received subsequently, the latest stored barometric pressure representation information can be conveniently read from the hidden partition, and the barometric pressure representation information is written into the audio signal adjustment module in the hardware layer, so that the audio signal adjustment module can adjust the intensity of the audio signal to be played by the terminal based on the audio playing parameter. As can be seen, through the interaction between the modules or services located in different software structure levels, the adjustment of the audio signal can be stably and quickly realized.
[0053] In an embodiment of the present application, the barometric pressure representation information includes:
[0054] the longitude and latitude of the geographic location where the terminal is located; and / or
[0055] the altitude of the geographic location where the terminal is located; and / or
[0056] the city where the terminal is located.
[0057] The longitude and latitude of the geographic location where the terminal is located, the altitude of the geographic location where the terminal is located, and the city where the terminal is located all have a relatively stable corresponding relationship with the atmospheric pressure of the environment where the terminal is located, so the longitude and latitude of the geographic location where the terminal is located, the altitude of the geographic location where the terminal is located, and the city where the terminal is located can all accurately reflect the first atmospheric pressure of the environment where the terminal is located.
[0058] In an embodiment of the present application, the obtaining of the barometric pressure representation information reflecting the first atmospheric pressure of the environment where the terminal is located includes:
[0059] obtaining the barometric pressure representation information reflecting the first atmospheric pressure of the environment where the terminal is located based on the sensing result obtained by the sensor module.
[0060] The sensor module can accurately sense the environment where the terminal is located, so that the terminal can accurately obtain the barometric pressure representation information reflecting the first atmospheric pressure of the environment where the terminal is located based on the sensing result.
[0061] In an embodiment of the present application, the terminal includes a sensor module and an audio parameter adjustment module located in the hardware layer, and the obtaining of the barometric pressure representation information reflecting the first atmospheric pressure of the environment where the terminal is located includes:
[0062] The sensor module performs information sensing and records the sensing result;
[0063] The audio parameter adjustment module obtains the sensing result recorded in the sensor module as atmospheric pressure representing information of the first atmospheric pressure of the environment where the terminal is located in response to the audio playing instruction;
[0064] The adjustment of the intensity of the audio signal to be played by the terminal based on the audio playing parameter includes:
[0065] The audio signal adjustment module adjusts the intensity of the audio signal to be played by the terminal based on the audio playing parameter.
[0066] As can be seen from the above, the sensor module located in the hardware layer accurately senses the environment where the terminal is located and sends the sensing result to the audio parameter adjustment module, so that the audio signal adjustment module can adjust the intensity of the audio signal to be played by the terminal based on the audio playing parameter. It can be seen that through the interaction between the modules or services in different software structure levels, the adjustment of the audio signal can be stably and quickly realized.
[0067] In an embodiment of the present application, the sensor module performs information sensing and records the sensing result, including:
[0068] The sensor module obtains the altitude of the geographical position where the terminal is located provided by the altitude detection service and records the altitude.
[0069] In this way, the sensor module can conveniently obtain the sensing result through the altitude detection service without the aid of hardware entities.
[0070] In an embodiment of the present application, the sensor module performs information sensing and records the sensing result, including:
[0071] The sensor module is an air pressure sensor, the sensor module measures the atmospheric pressure of the environment where the terminal is located, and records the atmospheric pressure.
[0072] In this way, the hardware of the air pressure sensor can measure the altitude of the geographical position where the terminal is located, so as to obtain a more accurate sensing result.
[0073] In an embodiment of the present application, the atmospheric pressure representing information includes:
[0074] The first atmospheric pressure of the environment where the terminal is located.
[0075] In this way, the first atmospheric pressure is taken as the atmospheric pressure representing information, so that the atmospheric pressure representing information is more intuitive and accurate.
[0076] In one embodiment of the present application, the air pressure representation information comprises:
[0077] an altitude of the geographic location where the terminal is located.
[0078] The altitude of the geographic location where the terminal is located can reflect the first atmospheric pressure of the environment where the terminal is located more accurately.
[0079] In one embodiment of the present application, the air pressure representation information reflecting the first atmospheric pressure of the environment where the terminal is located comprises:
[0080] determining the sending time and the arrival time of the last received preset number of downlink pilot signals from different base stations, and determining the base stations sending the downlink pilot signals, wherein the preset number is greater than or equal to 3;
[0081] obtaining the receiving time delay of each downlink pilot signal based on the determined sending time and arrival time;
[0082] determining the distance between the terminal and each base station based on the obtained receiving time delay;
[0083] obtaining the air pressure representation information reflecting the first atmospheric pressure of the environment where the terminal is located based on the distance between the terminal and each base station and the location of each base station.
[0084] In this way, the terminal can conveniently and quickly obtain the air pressure representation information reflecting the first atmospheric pressure of the environment where the terminal is located through base station positioning.
[0085] In a second aspect, an embodiment of the present application provides a terminal, comprising:
[0086] one or more processors and a memory;
[0087] The memory is coupled to the one or more processors, and the memory is configured to store computer program codes, the computer program codes comprising computer instructions, and the one or more processors are configured to invoke the computer instructions to enable the terminal to execute the method of the first aspect.
[0088] In a third aspect, an embodiment of the present application provides a computer readable storage medium, comprising a computer program, when the computer program is executed on a terminal, enabling the terminal to execute the method of the first aspect.
[0089] In a fourth aspect, an embodiment of the present application provides a computer program product, comprising executable instructions, when the executable instructions are executed on a terminal, enabling the terminal to execute the method of the first aspect.
[0090] In a fifth aspect, an embodiment of the present application provides a chip system, which is applied to a terminal, and the chip system comprises one or more processors, and the processor is configured to invoke a computer instruction to enable the terminal to input data into the chip system and perform the method in the first aspect to play audio.
[0091] The beneficial effects of the solutions provided by the embodiments of the second aspect to the fifth aspect can refer to the beneficial effects of the solutions provided by the embodiments of the first aspect. BRIEF DESCRIPTION OF DRAWINGS
[0092] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0093] Fig. 1 is a structural schematic diagram of a terminal provided by an embodiment of the present application;
[0094] Fig. 2a is a schematic diagram of the diaphragm amplitude in a loudspeaker provided by an embodiment of the present application;
[0095] Fig. 2b is a schematic diagram of the diaphragm amplitude in a loudspeaker provided by an embodiment of the present application;
[0096] Fig. 3 is a flow schematic diagram of a first audio playing method provided by an embodiment of the present application;
[0097] Fig. 4 is a flow schematic diagram of a second audio playing method provided by an embodiment of the present application;
[0098] Fig. 5a is a software structure block diagram of a first terminal provided by an embodiment of the present application;
[0099] Fig. 5b is a software structure block diagram of a second terminal provided by an embodiment of the present application;
[0100] Fig. 5c is a software structure block diagram of a third terminal provided by an embodiment of the present application;
[0101] Fig. 6a is a schematic diagram of a first audio playing scene provided by an embodiment of the present application;
[0102] Fig. 6b is a schematic diagram of a second audio playing scene provided by an embodiment of the present application;
[0103] Fig. 6c is a schematic diagram of a third audio playing scene provided by an embodiment of the present application;
[0104] Fig. 7 is a structural schematic diagram of a chip system provided by an embodiment of the present application. DETAILED DESCRIPTION
[0105] In order to better understand the technical solutions of the present application, the embodiments of the present application are described in detail below with reference to the drawings.
[0106] In order to facilitate clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the same items or similar items with basically the same functions and roles are distinguished by using "first", "second", etc. For example, the first instruction and the second instruction are used to distinguish different user instructions, and the order is not limited. Those skilled in the art can understand that "first", "second", etc. do not limit the quantity and execution order, and "first", "second", etc. also do not necessarily mean different.
[0107] It should be noted that in the present application, the words "exemplarily" or "for example" are used to represent an example, illustration or description. Any embodiment or design scheme described as "exemplarily" or "for example" in the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, the words "exemplarily" or "for example" are intended to present the relevant concept in a specific manner.
[0108] The scheme provided by the embodiments of the present application can be applied to any terminal provided with a loudspeaker and having an audio external output function, such as a mobile phone, a tablet computer, a desktop computer, a smart watch, a wearable electronic device, an augmented reality (AR) device, a virtual reality (VR) device, a vehicle-mounted device, a smart car, a robot, etc.
[0109] For example, FIG. 1 shows a structural schematic diagram of a terminal 100. The terminal 100 can include a processor 110, a display screen 120, a loudspeaker 130, an 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, an antenna 1 and an antenna 2, etc. The sensor module 180 can include a pressure sensor 180A, a touch sensor 180B, etc.
[0110] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the terminal 100. In other embodiments of the present application, the terminal 100 can include more or fewer components than shown, or combine certain components, or split certain components, or different component arrangements. The components shown can be implemented in hardware, software or a combination of software and hardware.
[0111] The processor 110 can include one or more processing units, e.g., the processor 110 can include 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), etc. Different processing units can be independent components or integrated in one or more processors. In some embodiments, the terminal 100 can also include one or more processors 110. Among them, the controller can generate operation control signals according to instruction operation codes and timing signals, complete the control of fetching instructions and executing instructions. In other embodiments, the processor 110 can also be provided with a memory for storing instructions and data. Exemplarily, the memory in the processor 110 can be a cache memory. The memory can save instructions or data that the processor 110 has just used or repeatedly uses. If the processor 110 needs to use the instructions or data again, it can directly call from the memory. In this way, repeated access is avoided, the waiting time of the processor 110 is reduced, and thus the efficiency of the terminal 100 in processing data or executing instructions is improved.
[0112] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can include Inter-Integrated Circuit (I2C) interfaces, Inter-Integrated Circuit Sound (I2S) interfaces, Pulse Code Modulation (PCM) interfaces, Universal Asynchronous Receiver / Transmitter (UART) interfaces, Mobile Industry Processor Interface (MIPI), General-Purpose Input / Output (GPIO) interfaces, SIM card interfaces, and / or USB interfaces, etc. The USB interface 160 is an interface that conforms to the USB standard specification, and can be 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 to transmit data between the terminal 100 and a peripheral device. The USB interface 160 can also be used to connect a headset to play audio through the headset.
[0113] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is used for illustrative description, and does not constitute a structural limitation of the terminal 100. In some other embodiments of the present application, the terminal 100 can also use different interface connection modes or combinations of multiple interface connection modes in the above embodiments.
[0114] The wireless communication function of the terminal 100 can be realized by the antenna 1, the antenna 2, the mobile communication module 190, the wireless communication module 200, the modem processor, and the baseband processor, etc.
[0115] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the terminal 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, the antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In some other embodiments, the antennas can be used in combination with tuning switches.
[0116] The terminal 100 realizes the display function through the GPU, the display screen 120, and the application processor, etc. The GPU is a microprocessor for image processing, which is connected to the display screen 120 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs, which execute program instructions to generate or change display information.
[0117] The display screen 120 is configured to display images, videos, and the like. 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 Flex Light-Emitting Diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a Quantum Dot Light Emitting Diodes (QLED), or the like. In some embodiments, the terminal 100 can include one or more display screens 120.
[0118] In some embodiments of the present application, when the display panel is made of OLED, AMOLED, FLED, or the like, the display screen 120 in FIG. 1 can be bent. Here, the display screen 120 can be bent at any part to any angle and can be kept at the angle, for example, the display screen 120 can be folded left and right from the middle. It can also be folded up and down from the middle.
[0119] The display screen 120 of the terminal 100 can be a flexible screen. At present, the flexible screen is attracting much attention due to its unique characteristics and great potential. Compared with the traditional screen, the flexible screen has the characteristics of strong flexibility and bendability, can provide a new interaction mode based on the bendable characteristics for the user, and can meet more needs of the user for the terminal. For the terminal with a foldable display screen, the foldable display screen on the terminal can be switched between the small screen in the folded form and the large screen in the unfolded form at any time. Therefore, the user uses the split screen function on the terminal with the foldable display screen more and more frequently.
[0120] The speaker 130 is configured to play audio under the driving of an audio signal to realize the audio playing function. The specific manner in which the audio signal drives the speaker to play audio will be described later, which is not described here in detail.
[0121] The digital signal processor is configured to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the terminal 100 selects a frequency point, the digital signal processor is configured to perform Fourier transform on the frequency point energy and the like.
[0122] A video codec is used to compress or decompress digital video. The terminal 100 can support one or more video codecs. In this way, the terminal 100 can play or record videos in a variety of encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG 2, MPEG 3, and MPEG 4.
[0123] An NPU is a Neural-Network (NN) computing processor that quickly processes input information by drawing on the structure of a biological neural network, such as the transmission mode between human brain neurons, and can also constantly self-learn. Through the NPU, intelligent cognitive applications of the terminal 100 can be implemented, such as image recognition, face recognition, voice recognition, text understanding, and the like.
[0124] The internal memory 140 can be used to store one or more computer programs including instructions. The processor 110 can cause the terminal 100 to perform the audio playing method provided in some embodiments of the present application, as well as various applications and data processing, and the like, by running the above-mentioned instructions stored in the internal memory 140. The internal memory 140 can include a program storage area and a data storage area. The program storage area can store an operating system, and the program storage area can also store one or more applications (such as a gallery, contacts, and the like). The data storage area can store data created during use of the terminal 100 (such as photos, contacts, and the like). In addition, the internal memory 140 can include a high-speed random access memory, and can also include a non-volatile memory, such as one or more disk storage components, flash memory components, Universal Flash Storage (UFS), and the like. In some embodiments, the processor 110 can cause the terminal 100 to perform the audio playing method provided in the embodiments of the present application, as well as other applications and data processing, by running the instructions stored in the internal memory 140 and / or the instructions stored in the memory disposed in the processor 110.
[0125] The internal memory 140 can be used to store the related programs of the audio playing method provided in the embodiments of the present application, and the processor 110 can be used to call the related programs of the audio playing method stored in the internal memory 140 when displaying information, and execute the audio playing method of the embodiments of the present application.
[0126] The sensor module 180 can include a pressure sensor 180A, a touch sensor 180B, and the like.
[0127] The pressure sensor 180A is configured to sense a pressure signal and convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be disposed on the display 120. The pressure sensor 180A can be of various types, such as a resistive pressure sensor, an inductive pressure sensor, or a capacitive pressure sensor. The capacitive pressure sensor can include at least two parallel plates of conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes, and the terminal 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation is applied to the display 120, the terminal 100 detects the touch operation based on the pressure sensor 180A. The terminal 100 can also calculate the position of the touch based on the detection signal of the 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 instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, an instruction to view a short message is executed; when a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the short message application icon, an instruction to create a new short message is executed.
[0128] The touch sensor 180B is also referred to as a touch device. The touch sensor 180B can be disposed on the display 120, and the touch sensor 180B and the display 120 together form a touch screen, which is also referred to as a touch screen. The touch sensor 180B is configured to detect a touch operation applied to or near the touch sensor 180B. The 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 the display 120. In other embodiments, the touch sensor 180B can also be disposed on the surface of the terminal 100 and disposed at a different position from the display 120.
[0129] The application scenario of the audio playing scheme provided by the embodiments of the present application will be introduced first.
[0130] The application scenario of the audio playing scheme provided by the embodiments of the present application is a scenario in which a user uses a terminal to play audio.
[0131] For example, the user opens a music application program (application, APP) installed in the terminal, selects a song that the user wants to listen to, and the process of the music APP requests an audio stream of the song from a background server and receives the audio stream sent by the server. The audio stream is a data stream for real-time transmission of audio data, and the process can decode the received audio stream to obtain an audio signal.
[0132] The decoded audio signal is input to a digital-to-analog conversion chip provided in the terminal, the digital-to-analog conversion chip can convert the audio signal into an analog signal, and the analog signal is input to the voice coil of the loudspeaker after being processed such as amplification and noise reduction. At this time, an electric current is generated in the voice coil, and the electric current generated in the voice coil generates a magnetic field due to electromagnetic induction principle. The magnetic field interacts with the magnetic field of the magnet provided in the loudspeaker to generate a pushing force or an attracting force, so that the diaphragm deforms correspondingly and vibrates. Thus, the audio signal drives the loudspeaker. The vibrating diaphragm pushes the air in the loudspeaker cavity to vibrate, thereby forming a sound that can be heard by the human ear, realizing the audio external playing function.
[0133] However, the diaphragm is easily disturbed by the external environment due to its flexibility and ultra-thin characteristics, thereby affecting the quality of the audio played by the terminal. For example, when the terminal plays audio in some environment, the diaphragm may be deformed greatly and contact the inner wall of the loudspeaker cavity, which may cause noise in the audio played by the terminal.
[0134] Referring to FIGS. 2a and 2b, they are respectively a schematic diagram of the amplitude of the diaphragm in the first and second loudspeakers provided by the embodiments of the present application.
[0135] Firstly, referring to FIG. 2a, it is a schematic diagram of the amplitude of the diaphragm in the first loudspeaker provided by the embodiments of the present application. In FIG. 2a, the vertical axis represents the amplitude of the diaphragm, and the unit is millimeter (mm). The horizontal axis represents the frequency of the diaphragm vibration, and the unit is hertz (Hz).
[0136] Among them, the first three curves with the starting point of the curve in the direction of the vertical axis value from large to small are called the first curve, and each first curve represents the upper amplitude of the three different diaphragms when vibrating in the environment of 0.6 standard atmospheric pressure. The fourth to sixth curves with the starting point of the curve in the above direction are called the second curve, and each second curve represents the upper amplitude of the three different diaphragms when vibrating in the environment of 1 standard atmospheric pressure. The seventh to ninth curves with the starting point of the curve in the above direction are called the third curve, and each third curve represents the upper amplitude change amount of the three different diaphragms when vibrating in the environment of 0.6 standard atmospheric pressure and 1 standard atmospheric pressure.
[0137] Similarly, the first three curves with the starting point of the curve in the direction of the vertical axis value from small to large are called the fourth curve, and each fourth curve represents the lower amplitude of the three different diaphragms when vibrating in the environment of 0.6 standard atmospheric pressure. The fourth to sixth curves with the starting point of the curve in the above direction are called the fifth curve, and each fifth curve represents the lower amplitude of the three different diaphragms when vibrating in the environment of 1 standard atmospheric pressure. The seventh to ninth curves with the starting point of the curve in the above direction are called the sixth curve, and each sixth curve represents the lower amplitude change amount of the three different diaphragms when vibrating in the environment of 0.6 standard atmospheric pressure and 1 standard atmospheric pressure.
[0138] As shown in FIG. 2a, the maximum upper amplitude of the three different diaphragms when vibrating in the environment of 0.6 standard atmospheric pressure is about 0.52 mm, and the average change of the upper amplitude relative to 1 standard atmospheric pressure is about 0.20 mm; the maximum lower amplitude of the three different diaphragms when vibrating in the environment of 0.6 standard atmospheric pressure is about 0.49 mm, and the average change of the lower amplitude relative to 1 standard atmospheric pressure is about 0.16 mm.
[0139] Next, referring to FIG. 2b, a second diagram of diaphragm amplitude in a loudspeaker provided by an embodiment of the present application is shown. The coordinate axis units and the meanings of the curves in FIG. 2b are similar to those in FIG. 2a, and the only difference is that the specifications of the loudspeaker shown in FIG. 2b are different from those in FIG. 2a.
[0140] As shown in FIG. 2b, the maximum upper amplitude of the three different diaphragms when vibrating in the environment of 0.6 standard atmospheric pressure is about 0.63 mm, and the average change of the upper amplitude relative to 1 standard atmospheric pressure is about 0.25 mm; the maximum lower amplitude of the three different diaphragms when vibrating in the environment of 0.6 standard atmospheric pressure is about 0.64 mm, and the average change of the lower amplitude relative to 1 standard atmospheric pressure is about 0.23 mm.
[0141] As shown in FIG. 2a and FIG. 2b, when the diaphragm of the loudspeaker works in the environment of 0.6 atmospheric pressure, the maximum upper and lower amplitudes of the diaphragm are both large, and are larger than the maximum upper and lower amplitudes in the standard atmospheric pressure. The cavity space of the loudspeaker arranged in the terminal is very limited, so the diaphragm with large amplitude is more likely to contact the inner wall of the loudspeaker cavity, i.e., the diaphragm is grounded, which may cause noise in the audio played by the terminal.
[0142] In view of the above, an audio playing scheme is provided in the embodiments of the present application to reduce the probability of noise in the audio played by the terminal.
[0143] The audio playing scheme provided by the embodiments of the present application is described in detail.
[0144] Referring to FIG. 3, a flowchart of a first audio playing method provided by an embodiment of the present application is shown. The method includes the following steps S301-S304.
[0145] It should be noted that the audio played by the scheme provided by the embodiments of the present application can be a single audio or an audio obtained by parsing a video.
[0146] In one case, the audio played by the scheme provided in the embodiments of the present application can also be the voice in the hands-free call scenario. In this case, after receiving the digital voice signal from other terminals forwarded by the base station, the scheme provided in the embodiments of the present application can be used to process the digital voice signal, and the processed signal can be used to drive the loudspeaker to play the voice.
[0147] Step S301: Obtain the air pressure representation information reflecting the first atmospheric pressure of the environment where the terminal is located.
[0148] The atmospheric pressure is simply referred to as air pressure, which is the atmospheric pressure acting on a unit area, and can also be understood as the weight of the atmospheric column on a unit area.
[0149] The atmospheric pressure is associated with the air density. Since the air density in different environments can be different, the atmospheric pressure in different environments can also be different.
[0150] Generally speaking, the higher the air density of an environment, the greater the atmospheric pressure of the environment; on the contrary, the lower the air density of an environment, the smaller the atmospheric pressure of the environment.
[0151] The air pressure representation information can be any information that can reflect the size of the first atmospheric pressure of the environment where the terminal is located, such as the first atmospheric pressure of the environment where the terminal is located, the latitude and longitude of the geographical location where the terminal is located, the altitude of the geographical location where the terminal is located, the city where the terminal is located, etc. The embodiments of the present application do not limit this.
[0152] The specific way of obtaining the above-mentioned air pressure representation information is introduced below.
[0153] In one embodiment, the hidden partition in the storage space of the terminal can store the air pressure representation information. In this case, the latest stored air pressure representation information can be read from the hidden partition as the air pressure representation information reflecting the first atmospheric pressure of the environment where the terminal is located.
[0154] Specifically, the terminal can obtain the air pressure representation information of the environment where the terminal is located based on the location query result provided by the location query service, and write the air pressure representation information into the hidden partition in the storage space.
[0155] The location query result can be the latitude and longitude of the geographical location where the terminal is located, the altitude of the geographical location where the terminal is located, the city where the terminal is located, or any two or all three of the above information.
[0156] The longitude and latitude of the geographic location where the terminal is located, the altitude of the geographic location where the terminal is located, and the city where the terminal is located all have a relatively stable corresponding relationship with the atmospheric pressure of the environment where the terminal is located. Therefore, the longitude and latitude of the geographic location where the terminal is located, the altitude of the geographic location where the terminal is located, and the city where the terminal is located can all accurately reflect the first atmospheric pressure of the environment where the terminal is located.
[0157] It should be noted that in the scheme provided by the embodiments of the present application, before the location query service obtains the location query result of the terminal, the terminal needs to first show the user a prompt message asking whether to allow obtaining the current location through a pop-up window or the like. After obtaining the permission of the user, the location query service can obtain the above-mentioned location query result.
[0158] After the terminal obtains the above-mentioned location query result, the terminal can directly write the location query result as the barometric pressure representation information into the hidden partition in the storage space.
[0159] In one case, if the above-mentioned location query result obtained by the terminal is the longitude and latitude, the terminal can determine the city corresponding to the obtained longitude and latitude according to the corresponding relationship between the longitude and latitude and the city, and write the determined city as the barometric pressure representation information into the hidden partition in the storage space.
[0160] The above-mentioned hidden partition can be an Original Equipment Manufacturer (OEM) partition. The data stored in the partition will not be cleared due to terminal shutdown, restart, etc., and the permission required for deleting the data is extremely high, so the data stability and security are high.
[0161] The timing of obtaining the location query result provided by the location query service is introduced below.
[0162] In one case, some APPs installed in the terminal need to use the location service when running, such as map APPs, take-out APPs, shopping APPs, short video APPs, etc. These APPs can send a request to the location query service when running, so that the location query service obtains the location query result from the location query server and feeds back the location query result to the above-mentioned APPs, so that the operating system in the terminal can obtain the location query result fed back by the location query service.
[0163] 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 the barometric pressure representation information into the hidden partition.
[0164] The data stored in the above-mentioned hidden partition is invisible to the device manufacturer and the user, and the data stability and security are high.
[0165] In another case, the operating system in the terminal can periodically send a request to the location query service and obtain the location query result fed back by the location query service.
[0166] It can be seen that in the embodiment, the terminal can continuously update the barometric pressure representation information of the environment in which the terminal is located in the hidden partition, and the latest stored barometric pressure representation information in the hidden partition reflects the first atmospheric pressure of the latest environment in which the terminal is located. In this way, when the scheme provided by the embodiment of the application is executed, the latest stored barometric pressure representation information can be directly and conveniently read from the hidden partition as the barometric pressure representation information reflecting the first atmospheric pressure of the environment in which the terminal is located, without the need for real-time acquisition, thereby improving the efficiency of obtaining the barometric pressure representation information.
[0167] In another embodiment, the terminal can obtain the barometric pressure representation information reflecting the first atmospheric pressure of the environment in which the terminal is located based on the sensing result obtained by the sensor module.
[0168] Unlike the hardware sensor of the entity, the above-mentioned sensor module is a concept at the software level, which is used to obtain the barometric pressure representation information of the environment in which the terminal is located, and from the functional point of view, it is equivalent to a sensor that senses the environment in which the terminal is located.
[0169] The specific manner in which the above-mentioned sensor module obtains the sensing result will be described in detail in the embodiment shown in FIG. 5b below, which will not be described here.
[0170] After the terminal obtains the above-mentioned sensing result, the terminal can take the above-mentioned sensing result as the barometric pressure representation information.
[0171] In one case, the above-mentioned sensing result can be the first atmospheric pressure of the environment in which the terminal is located. In this way, taking the first atmospheric pressure as the barometric pressure representation information makes the barometric pressure representation information more intuitive and accurate.
[0172] In another case, the above-mentioned sensing result can be the altitude of the geographical position in which the terminal is located. The altitude of the geographical position and the atmospheric pressure of the position have a relatively stable corresponding relationship, and therefore, the altitude of the geographical position in which the terminal is located can more accurately reflect the first atmospheric pressure of the environment in which the terminal is located.
[0173] The sensor module can accurately sense the environment in which the terminal is located, and therefore the terminal can accurately obtain the barometric pressure representation information reflecting the first atmospheric pressure of the environment in which the terminal is located based on the sensing result.
[0174] In another implementation, the terminal can determine the time of transmission and the time of arrival of a preset number of most recently received downlink pilot signals from different base stations, determine the base stations that transmit the downlink pilot signals, and then obtain the reception time delay of each downlink pilot signal based on the determined time of transmission and time of arrival. Then, the terminal can determine the distance between the terminal and each base station based on the obtained reception time delay, and finally obtain the barometric pressure representing information of the first atmospheric pressure of the environment in which the terminal is located based on the distance between the terminal and each base station and the position of each base station. The preset number is greater than or equal to 3.
[0175] In the process of using a mobile data network to communicate, the terminal can communicate with multiple base stations. In the process of communication between the terminal and the base station, the base station continuously transmits downlink pilot signals to the terminal. The downlink pilot signals carry control information to support the downlink data transmission of the terminal.
[0176] For the terminal, it can record the time of arrival (TOA) of each received downlink pilot signal, and analyze the downlink pilot signal to obtain the base station identifier that transmits the downlink pilot signal, the base station coordinates that transmit the downlink pilot signal, the time of transmission of the downlink pilot signal, and other information. The time of arrival and the information obtained by analysis can be stored in the cache.
[0177] In this embodiment, the terminal can determine the latest time of arrival from the time of arrival stored in the cache, take the downlink pilot signal corresponding to the determined time of arrival as the first downlink pilot signal, and read the time of transmission of the first downlink pilot signal. Then, from the other time of arrivals stored in the cache, determine the latest time of arrival and the corresponding base station 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 time of transmission of the second downlink pilot signal. In this way, the time of transmission and the time of arrival of a preset number of downlink pilot signals are obtained.
[0178] In this way, the terminal calculates the difference between the time of transmission and the time of arrival of the downlink pilot signal, and obtains the reception time delay of the received downlink pilot signal. Based on the reception time delay and the signal propagation speed, the distance between the terminal and the base station can be obtained. For example, the distance between the terminal and the base station is calculated by multiplying the reception time delay by the signal propagation speed.
[0179] 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 related information.
[0180] For example, taking the preset number 3 as an example, according to the three-point positioning principle, the coordinates of the intersection of three circles with the coordinates of the three base stations as the center and the distance between the terminal and the base station as the radius can be taken as the coordinates of the terminal.
[0181] Further, the above coordinates can be directly taken as the above barometric pressure representation information, or the city where the terminal is located can be determined according to the above coordinates as the above barometric pressure representation information.
[0182] It should be noted that the terminal can obtain the above barometric pressure representation information in the above manner and store it at a certain period, so that the latest barometric pressure representation information stored can be directly read when obtaining the barometric pressure representation information; the terminal can also calculate the above barometric pressure representation information in the above manner when obtaining the barometric pressure representation information, which is reasonable.
[0183] In this way, the terminal can conveniently and quickly obtain the barometric pressure representation information reflecting the first atmospheric pressure of the environment where the terminal is located through base station positioning.
[0184] Step S302: determining an audio playing parameter for adjusting the intensity of the audio signal based on the barometric pressure representation information.
[0185] As introduced in the foregoing scenario description, the audio signal can drive the diaphragm to produce deformation and vibration.
[0186] Among them, the greater the intensity of the audio signal, the greater the intensity of the analog audio signal converted by 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; on the contrary, the smaller the intensity of the digital audio signal, and ultimately the smaller the deformation of the diaphragm.
[0187] Therefore, in order to prevent the first atmospheric pressure of the environment where the terminal is located from interfering with the vibration of the diaphragm, the vibration amplitude of the diaphragm can be adjusted by adjusting the intensity of the audio signal. In this step, the determined audio playing parameter is a parameter for adjusting the intensity of the audio signal.
[0188] In an embodiment, when determining the audio playing parameter, the first atmospheric pressure and the standard atmospheric pressure can be considered, and the specific implementation is described in detail in the embodiment shown in FIG. 4 below, which is not described here.
[0189] In another embodiment, the audio playing parameter corresponding to the barometric pressure representation information can be determined according to the corresponding relationship between the barometric pressure representation information and the audio playing parameter, as the audio playing parameter for adjusting the intensity of the audio signal. The above corresponding relationship can also be called a white list.
[0190] As introduced in the foregoing description, the barometric pressure representation information can have various forms, which will be briefly introduced below. As introduced in the foregoing description, the barometric pressure representation information can have various forms, which will be briefly introduced below.
[0191] The first case is that the barometric pressure information is the city where the terminal is located.
[0192] The corresponding audio playing parameter of the city where the terminal is located can be determined according to the corresponding relationship between the city and the audio playing parameter.
[0193] For example, if the barometric pressure information is the city C1 where the terminal is located, the corresponding audio playing parameter Para1 of the city C1 where the terminal is located can be determined according to the corresponding relationship between the city and the audio playing parameter.
[0194] The second case is that the barometric pressure information is the longitude and latitude of the geographic location where the terminal is located.
[0195] The corresponding audio playing parameter of the longitude and latitude where the terminal is located can be determined according to the corresponding relationship between the longitude and latitude and the audio playing parameter, or the city corresponding to the longitude and latitude can be determined first, and then the corresponding audio playing parameter of the longitude and latitude where the terminal is located can be determined according to the corresponding relationship between the city and the audio playing parameter.
[0196] This case is similar to the first case and will not be described in detail.
[0197] The third case is that the barometric pressure information is the altitude where the terminal is located.
[0198] The corresponding audio playing parameter of the altitude where the terminal is located can be determined according to the corresponding relationship between the altitude and the audio playing parameter.
[0199] For example, if the barometric pressure information is the altitude A1 where the terminal is located, the corresponding audio playing parameter Para2 of the city A1 where the terminal is located can be determined according to the corresponding relationship between the altitude and the audio playing parameter.
[0200] The corresponding audio playing parameter of the altitude where the terminal is located can also be determined according to the corresponding relationship between the altitude interval to which the altitude belongs and the audio playing parameter.
[0201] For example, if the barometric pressure information is the altitude A1 where the terminal is located, the altitude interval I1 to which A1 belongs can be determined first, and then the corresponding audio playing parameter Para2 of the altitude A1 where the terminal is located can be determined according to the corresponding relationship between the altitude interval and the audio playing parameter.
[0202] In one case, before determining the audio playing parameter 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, and if so, the step of determining the audio playing parameter is performed.
[0203] The first altitude threshold and the second altitude threshold can be set by the staff according to experience, and embodiments of the present application do not limit this. For example, the first altitude threshold can be 500 meters, and the second altitude threshold can be -10 meters, etc.
[0204] When the altitude is greater than the first preset altitude threshold or less than the second preset altitude threshold, the atmospheric pressure corresponding to the altitude is greatly different from the standard atmospheric pressure, and the influence on the diaphragm deformation can be more obvious. Therefore, the audio playback parameter can be determined, so that the diaphragm deformation can be controlled according to the audio playback parameter subsequently.
[0205] In the fourth case, if the barometric pressure information is the first atmospheric pressure of the environment where the terminal is located:
[0206] The corresponding audio playback parameter of the first atmospheric pressure can be determined according to the corresponding relationship between the atmospheric pressure and the audio playback parameter.
[0207] The corresponding audio playback parameter of the first atmospheric pressure can also be determined according to the corresponding relationship between the atmospheric pressure and the audio playback parameter.
[0208] This case is similar to the third case, and will not be described in detail here.
[0209] In one case, before determining the corresponding audio playback parameter of the first atmospheric pressure, it can be determined whether the first atmospheric pressure is greater than the first preset pressure threshold or less than the second preset pressure threshold. If yes, the step of determining the audio playback parameter is executed.
[0210] The first pressure threshold and the second pressure threshold can be set by the staff according to experience, and embodiments of the present application do not limit this. For example, the first altitude threshold can be 0.8 standard atmospheric pressure, and the second altitude threshold can be 1.1 standard atmospheric pressure, etc.
[0211] When the first atmospheric pressure is greater than the first preset pressure threshold or less than the second preset pressure threshold, the atmospheric pressure is greatly different from the standard atmospheric pressure, and the influence on the diaphragm deformation can be more obvious. Therefore, the audio playback parameter can be determined, so that the diaphragm deformation can be controlled according to the audio playback parameter subsequently.
[0212] The specific determination method of the corresponding relationship between the four barometric pressure information and the audio playback parameter is shown in the subsequent embodiment of FIG. 4, which will not be described here.
[0213] In this way, the corresponding audio playback parameter of the barometric pressure information can be quickly determined according to the corresponding relationship between the barometric pressure information and the audio playback parameter, and the efficiency of determining the audio playback parameter is improved.
[0214] Step S303: Adjust the intensity of the audio signal to be played on the terminal based on the audio playback parameters.
[0215] The audio signal to be played on the terminal is the audio signal obtained by decoding the audio stream.
[0216] 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.
[0217] 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.
[0218] This means that the intensity of the audio signal has been adjusted.
[0219] Step S304: Drive the speaker set in the terminal to play audio based on the adjusted audio signal.
[0220] 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.
[0221] 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.
[0222] 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 adaptively determine the audio playing parameter for controlling the deformation degree of the diaphragm based on the atmospheric pressure. Further, 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 by the audio playing parameter, thereby reducing the probability of the diaphragm being greatly deformed due to environmental influence, thereby reducing the probability of the diaphragm contacting the inner wall of the loudspeaker cavity, and further reducing the probability of noise occurring when playing audio.
[0223] 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. In this way, when adjusting the audio signal according to the audio playing parameter and driving the loudspeaker based on the adjusted audio signal, it is beneficial to reduce the influence of different atmospheric pressures on the diaphragm, so that the vibration of the diaphragm tends to be consistent when the terminal plays audio under different atmospheric pressures, thereby making the audio effect heard by the person consistent, improving the stability of playing audio, and improving the user experience.
[0224] On the basis of the embodiment shown in FIG. 3, when determining the audio playing parameter, the first atmospheric pressure and the standard atmospheric pressure can be considered comprehensively, and the audio playing parameter for adjusting the intensity of the audio signal is determined based on the atmospheric pressure representation information of the first atmospheric pressure and the standard atmospheric pressure. In view of the above, the second audio playing method is provided in the embodiments of the present application.
[0225] Referring to FIG. 4, it is a flowchart of the second audio playing method provided in the embodiments of the present application. The above method includes the following steps S401-S404.
[0226] Step S401: Obtain atmospheric pressure representation information reflecting the first atmospheric pressure of the environment in which the terminal is located.
[0227] Step S402: Determine an adjustment value for adjusting the intensity of the audio signal as the audio playing parameter based on the atmospheric pressure representation information and the standard atmospheric pressure.
[0228] 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.
[0229] The compliance coefficient can be used to describe the difficulty of the diaphragm of the loudspeaker to generate deformation, and the inventor has found through practice that the compliance coefficient of the diaphragm is related to the atmospheric pressure. Therefore, when the loudspeaker is driven to play audio based on the audio signal under the condition that the first atmospheric pressure is not equal to the standard atmospheric pressure, the difficulty of the diaphragm to generate deformation is different, and thus the vibration amplitude is also different. That is, the first atmospheric pressure has an impact on the vibration of the diaphragm.
[0230] Therefore, the adjustment value makes the first vibration amplitude tend to the second vibration amplitude, that is, the vibration amplitude of the diaphragm when the loudspeaker is driven to play audio based on the adjusted audio signal under the first atmospheric pressure tends to the vibration amplitude of the diaphragm when the loudspeaker is driven to play audio based on the original audio signal under the standard atmospheric pressure. In this way, the impact of the first atmospheric pressure on the vibration of the diaphragm is equivalent to being offset.
[0231] The way of determining the adjustment value will be described in detail below.
[0232] First, the way of determining the adjustment value is described from the perspective of the size relationship between the first atmospheric pressure and the standard atmospheric pressure.
[0233] In an embodiment, when the first atmospheric pressure reflected by the barometer information is less than the standard atmospheric pressure, a first adjustment value for performing attenuation processing on the audio signal can be determined based on the first atmospheric pressure and the standard atmospheric pressure.
[0234] The inventor has found through practice that when the first atmospheric pressure is less than the standard atmospheric pressure, the diaphragm is more likely to deform under the first atmospheric pressure than under the standard atmospheric pressure. In this way, 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 equivalent to being reduced. Since the driving force is directly proportional to the degree of deformation of the diaphragm, in this way, the degree of deformation of the diaphragm can be reduced, and the adverse effect of low atmospheric pressure making the diaphragm more likely to deform is weakened, so that the vibration amplitude of the diaphragm tends to the vibration amplitude under the standard atmospheric pressure, and the stability when playing audio is improved.
[0235] 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.
[0236] In one case, the first adjustment value can be determined to be positively correlated with the difference. That is, the larger the difference, the larger the first adjustment value can be, and the smaller the difference, the smaller the first adjustment value can be.
[0237] As can be, according to the corresponding relationship between the above difference and the preset adjustment coefficient, the adjustment coefficient corresponding to the difference is determined, and then the determined adjustment coefficient is taken as the first adjustment value. Wherein, the above adjustment coefficient can be greater than 1, and the above difference and the adjustment coefficient are in a positive correlation relationship.
[0238] In another embodiment, in the case where the first atmospheric pressure reflected by the atmospheric pressure representation information is greater than the standard atmospheric pressure, the second adjustment value for the enhancement processing of the audio signal can be determined based on the first atmospheric pressure and the standard atmospheric pressure.
[0239] The inventors have found through practice that in the case where the first atmospheric pressure is greater than the standard atmospheric pressure, the diaphragm is less likely to deform under the first atmospheric pressure relative to the standard atmospheric pressure. Thus, 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 effectively increased. Since the driving force is directly proportional to the degree of deformation of the diaphragm, this can increase the degree of deformation of the diaphragm, weaken the adverse effect of high air pressure on the diaphragm, and make the vibration amplitude of the diaphragm close to the vibration amplitude under the standard atmospheric pressure, thereby improving the stability when playing audio.
[0240] 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 above difference.
[0241] In one case, the second adjustment value can be determined to be positively correlated with the above difference. That is, the greater the above difference, the greater the second adjustment value, and the smaller the above difference, the smaller the second adjustment value.
[0242] As can be, according to the corresponding relationship between the above difference and the preset adjustment coefficient, the adjustment coefficient corresponding to the difference is determined, and then the determined adjustment coefficient is taken as the first adjustment value. Wherein, the above adjustment coefficient can be greater than 1, and the above difference and the adjustment coefficient are in a positive correlation relationship.
[0243] Then, the way of determining the adjustment value is introduced from the perspective of the frequency of the audio signal.
[0244] Specifically, 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 can be determined based on the first atmospheric pressure reflected by the atmospheric pressure representation information and the standard atmospheric pressure. Wherein, the signal frequency ranges corresponding to the above low-frequency audio signal and high-frequency audio signal can be set by the staff according to actual needs, and the embodiments of the present application are not limited thereto.
[0245] The way of determining the third adjustment value and the fourth adjustment value is limited as follows.
[0246] In one implementation, the first adjustment value or the second adjustment value can be determined based on the difference between the standard atmospheric pressure and the first atmospheric pressure according to the method introduced in the foregoing implementation, then the product of the first adjustment value or the second adjustment value and the first weight value is calculated as the 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 value is calculated as the fourth adjustment value for adjusting the intensity of the high-frequency audio signal.
[0247] The first weight value is greater than the second weight value, and the first weight value and the second weight value can be determined based on the influence of the low-frequency audio signal and the high-frequency audio signal on the diaphragm deformation, which is not limited in the embodiments of the application.
[0248] In another implementation, the first adjustment value or the second adjustment value can be determined based on the difference between the standard atmospheric pressure and the first atmospheric pressure according to the method introduced in the foregoing implementation, then the first adjustment value or the second adjustment value is determined as 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 is determined as a preset adjustment value.
[0249] The inventors have found through practice that the low-frequency audio signal has a greater influence on the diaphragm deformation, and the high-frequency audio signal has a smaller influence on the diaphragm deformation. In the embodiments, the low-frequency audio signal and the high-frequency signal can be treated separately, and different adjustment values are used to adjust the 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 when playing the audio based on the adjusted audio signal is improved.
[0250] Step S403: Adjusting the intensity of the audio signal to be played by the terminal based on the audio playing parameter.
[0251] The specific implementation of this step can be referred to the step S303 in the embodiment shown in the foregoing FIG. 3, which is not described herein again.
[0252] In one implementation of the application, the intensity of the audio signal can be processed differently in different cases.
[0253] In the case where the first atmospheric pressure reflected by the air pressure representation information is less than the standard atmospheric pressure:
[0254] In one implementation, the third adjustment value and the fourth adjustment value can be used to attenuate the low-frequency audio signal and the high-frequency audio signal, respectively.
[0255] In this way, the low-frequency audio signal and the high-frequency audio signal are both attenuated by the third adjustment value and the fourth adjustment value, which can further 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 close to the vibration amplitude under the standard atmospheric pressure, reduce the probability of noise, and improve the stability when playing audio.
[0256] In another embodiment, the low-frequency audio signal can be attenuated by the third adjustment value, and the high-frequency audio signal can be enhanced by the fourth adjustment value.
[0257] In this 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 close to the vibration amplitude under the standard atmospheric pressure, and improve the stability when playing audio; on the other hand, the high-frequency audio signal is enhanced by the fourth adjustment value, which can increase the intensity of the high-frequency sound played finally, reduce the influence of weak bass on the user's listening experience, and improve the user experience.
[0258] In the case where the first atmospheric pressure reflected by the air pressure representation information is greater than the standard atmospheric pressure:
[0259] In one embodiment, the low-frequency audio signal and the high-frequency audio signal can be enhanced by the third adjustment value and the fourth adjustment value, respectively.
[0260] In this way, the low-frequency audio signal and the high-frequency audio signal are both enhanced by the third adjustment value and the fourth adjustment value, which can further increase the deformation degree of the diaphragm, reduce the adverse effect of high air pressure on the deformation of the diaphragm, make the vibration amplitude of the diaphragm close to the vibration amplitude under the standard atmospheric pressure, and improve the stability when playing audio.
[0261] In another embodiment, the low-frequency audio signal can be enhanced by the third adjustment value, and the high-frequency audio signal can be attenuated by the fourth adjustment value.
[0262] In this embodiment, on the one hand, the low-frequency audio signal is enhanced by the third adjustment value, which can enhance the deformation degree of the diaphragm, reduce the adverse effect of high air pressure on the deformation of the diaphragm, make the vibration amplitude of the diaphragm close to the vibration amplitude under the standard atmospheric pressure, and improve the stability when playing audio; on the other hand, the high-frequency audio signal is attenuated by the fourth adjustment value, which can reduce the intensity of the high-frequency sound played finally, reduce the influence of strong bass on the user's listening experience, and improve the user experience.
[0263] Step S404: driving the speaker arranged in the terminal to play the audio based on the adjusted audio signal.
[0264] This step is the same as step S304 in the foregoing embodiment shown in FIG. 3, and thus will not be described here.
[0265] As can be seen from the above, in this embodiment, in the first aspect, the influence of atmospheric pressure on the diaphragm deformation is considered, and the audio playing parameter for controlling the deformation degree 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 speaker is driven based on the adjusted audio signal, the influence of atmospheric pressure on the diaphragm deformation can be reduced by 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 speaker cavity is reduced, and the probability of noise occurring during audio playing is reduced. In the second aspect, the audio playing parameter is determined according to the first atmospheric pressure of the environment where 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 diaphragm deformation compared with the standard atmospheric pressure is considered. Then, when the audio signal is adjusted according to the audio playing parameter and the speaker is driven based on the adjusted audio signal, the first vibration amplitude of the diaphragm under the first atmospheric pressure can approach the second vibration amplitude of the diaphragm under the standard atmospheric pressure, the adverse influence of the first atmospheric pressure on the diaphragm deformation compared with the standard atmospheric pressure is reduced, the amplitude of the diaphragm is more stable, and the stability during audio playing is improved.
[0266] Next, the determination manner of the correspondence between the air pressure representation information and the audio playing parameter in the foregoing embodiment shown in FIG. 3 will be introduced.
[0267] For the case that the air pressure representation information is the atmospheric pressure:
[0268] The first manner can determine an atmospheric pressure interval to be determined for the correspondence. Then, for each integer atmospheric pressure in the interval, the manner introduced in the embodiment shown in FIG. 4 is directly used to determine the adjustment value according to the atmospheric pressure and the standard atmospheric pressure, and the obtained adjustment value is determined as the audio playing parameter corresponding to the atmospheric pressure.
[0269] The second manner can select an atmospheric pressure representative value from each atmospheric pressure interval. Then, the manner introduced in the embodiment shown in FIG. 4 is used to determine the adjustment value according to the atmospheric pressure representative value and the standard atmospheric pressure, and the obtained adjustment value is determined as the audio playing parameter corresponding to all the atmospheric pressures included in the atmospheric pressure interval. The atmospheric pressure representative value can be the average value, the median, etc. of the atmospheric pressures included in the atmospheric pressure interval.
[0270] The third way, after determining the adjustment value corresponding to each atmospheric pressure in the atmospheric pressure interval, the average of the adjustment value can be calculated, and the average value obtained is used as the audio playback parameter corresponding to each atmospheric pressure included in the atmospheric pressure interval.
[0271] For the case where the air pressure representation information is longitude and latitude:
[0272] First, the corresponding relationship between the atmospheric pressure and the longitude and latitude interval can be determined, and then for each atmospheric pressure determined, the adjustment value can be determined according to the atmospheric pressure and the standard atmospheric pressure using the method introduced in the embodiment shown in FIG. 4, and the adjustment value obtained is used as the audio playback parameter corresponding to all longitudes and latitudes included in the longitude and latitude interval.
[0273] For the case where the air pressure representation information is a city:
[0274] First, the atmospheric pressure representative value corresponding to each city can be determined, and then for each atmospheric pressure representative value determined, the adjustment value can be determined according to the atmospheric pressure representative value and the standard atmospheric pressure using the method introduced in the embodiment shown in FIG. 4, and the adjustment value obtained is used as the audio playback parameter corresponding to the city.
[0275] The atmospheric pressure representative value corresponding to the city can be the average, median, etc. of the atmospheric pressure of each region of the city.
[0276] For the case where the air pressure representation information is altitude:
[0277] The first way, for each integer altitude in the altitude interval for which the corresponding relationship is to be determined, the atmospheric pressure corresponding to the altitude can be determined according to the corresponding relationship between the altitude and the atmospheric pressure, and then the adjustment value can be determined according to the atmospheric pressure and the standard atmospheric pressure using the method introduced in the embodiment shown in FIG. 4, and the adjustment value obtained is used as the audio playback parameter corresponding to the altitude.
[0278] The second way, the altitude representative value can be selected from each altitude interval, and then the atmospheric pressure corresponding to the altitude representative value can be determined, and then the adjustment value can be determined according to the determined atmospheric pressure and the standard atmospheric pressure using the method introduced in the embodiment shown in FIG. 4, and the adjustment value obtained is used as the audio playback parameter corresponding to the altitude included in the altitude interval. The altitude representative value can be the average, median, etc. of the atmospheric pressure interval.
[0279] The third way, after determining the adjustment value corresponding to each altitude in the altitude interval, the average of the adjustment value can be calculated, and the average value obtained is used as the audio playback parameter corresponding to each altitude included in the altitude interval.
[0280] According to the introduction of the embodiments shown in FIG. 3 and FIG. 4, the present application provides three possible software structures applicable to the embodiments of the present application.
[0281] The three possible software structures applicable to the embodiments of the present application are introduced below through FIG. 5a-FIG. 5c.
[0282] Firstly, referring to FIG. 5a, it is a first software structure block diagram of a terminal applicable to the embodiments of the present application. The software system of the terminal can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
[0283] The layered architecture divides the software system of the terminal into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the software system can be divided into four layers, which are applications, application framework, hardware abstraction layer (HAL), and hardware layer.
[0284] The application layer can include a series of application packages, and the application layer runs the application by calling the application programming interface (API) provided by the application framework layer. For example, the application packages can include music, video, and other applications. It can be understood that each application port described above can be used to receive data.
[0285] The application framework layer provides APIs and programming frameworks for the applications of the application layer. The application framework layer includes some pre-defined functions. For example, the application framework layer can include an audio framework, a positioning framework, etc. The audio framework can include modules such as media player (MediaPlayer), audio track (AudioTrack), audio stream output (AudioStreamOut), audio manager (AudioManager), audio service (AudioService), and audio processing; the positioning framework can include modules such as positioning manager (LocationManager) and positioning service (LocationService).
[0286] The hardware abstraction layer can include a plurality of hardware abstraction modules, such as an audio hardware abstraction (AudioHal) module, which can include a stream management (Stream Mgmt) module and a smart parameter adjustment (SmartpaCust) module.
[0287] The hardware layer is the lowest layer of the terminal system and can include various physical components required by the processor, the memory, the input / output interface (I / O), and the like. The hardware layer can also include an audio digital signal processor. The audio digital signal processor can include an audio processing domain (APD) including an audio signal adjustment module for processing an audio signal.
[0288] The following describes the scheme provided by the embodiments of the present application from the perspective of the interaction flow between the layers of the software system by taking a music APP as an example through steps S1-S6 in FIG. 5a.
[0289] Step S1: The music APP in the application layer is started, and the operating system creates a media player and a sound track in the application framework layer in response to the application of the APP process.
[0290] Step S2: The audio stream is decoded by using the media player to obtain a pulse code modulation (PCM) stream, and the PCM stream is input to the sound track for mixing and the like. The audio stream output module transmits the audio signal stream processed by the sound track to the stream management module in the audio HAL.
[0291] Step S3: The stream management module sends an audio playing instruction to the smart parameter adjustment module and transmits the audio signal stream to the audio signal adjustment module.
[0292] Step S4: After receiving the audio playing instruction, the smart parameter adjustment module reads the latest stored barometric pressure representation information from the hidden partition 1 as the barometric pressure representation information reflecting the first atmospheric pressure of the environment in which the terminal is located, and writes the barometric pressure representation information into the audio signal adjustment module.
[0293] Step S5: The audio signal adjustment module determines the audio playing parameter according to the barometric pressure representation information, adjusts the audio signal in the audio signal stream according to the audio playing parameter, and inputs the adjusted audio signal into a digital-to-analog conversion chip.
[0294] Step S6: The digital-to-analog conversion chip converts the adjusted audio signal into an analog signal and inputs the analog signal into a loudspeaker to drive the loudspeaker to play audio.
[0295] In step S1, the audio track can also be created only, in which case the APP itself decodes the audio stream to obtain the PCM stream in step S2, and inputs the PCM stream into the audio track.
[0296] The flow corresponding to the video APP is similar to the above flow, which will not be described in detail. After the video APP is started, the media player can first parse the audio stream from the video stream, then decode the audio stream, and execute the subsequent steps.
[0297] The audio effect file used for mixing, adding sound effects, etc. to the audio signal and the algorithm file used by the above audio signal adjustment module to determine the audio playing parameter can be saved in the hidden partition 2, and the above hidden partition 2 can be an original design manufacturer (ODM) partition.
[0298] The positioning service and the positioning management in FIG. 5a can be collectively referred to as a location query service, and the audio service, the audio management and the audio processing can be collectively referred to as an audio control service. The source of the barometric pressure representation information recorded in the hidden partition 1 is introduced below.
[0299] First, the location query service located in the positioning framework obtains the barometric pressure representation information of the environment where the terminal is located, and sends the barometric pressure representation information to the audio control service. The timing at which the location query service obtains the barometric pressure representation information has been introduced in the foregoing embodiments.
[0300] Specifically, the positioning management module in the location query service is responsible for requesting the barometric pressure representation information (such as latitude and longitude, city, altitude) of the environment where the terminal is located from the background server, and the positioning service is responsible for interfacing with the audio control service and sending the barometric pressure representation information to the audio control service.
[0301] Secondly, the audio service in the audio control service is responsible for interfacing with the positioning service, obtaining the barometric pressure representation information, and sending the barometric pressure representation information to the audio management module through the parameter setting interface. The audio management module sends the barometric pressure representation information to the audio processing, and the audio processing is responsible for adding sound effects to the audio and is responsible for interfacing with the HAL layer and sending the barometric pressure representation information to the intelligent parameter adjustment module in the audio HAL. The audio processing can be referred to as an audio flinger (AudioFlinger).
[0302] Finally, the intelligent parameter adjustment module writes the obtained barometric pressure representation information into the hidden partition 1 in the storage space.
[0303] From the above, the location query service and the audio control service located in the application framework layer can send the barometric pressure characterization information to the HAL layer, so that the audio HAL can write the barometric pressure characterization information into the hidden partition in the storage space. In this way, when the audio playing instruction is received subsequently, the latest stored barometric pressure characterization information can be conveniently read from the hidden partition and written into the audio signal adjustment module in the hardware layer, so that the audio signal adjustment module can adjust the intensity of the audio signal to be played by the terminal based on the audio playing parameter. It can be seen that through the interaction between the modules or services located in different software structure levels, the adjustment of the audio signal can be stably and quickly realized.
[0304] Referring to FIG. 5b again, it is a second software structure block diagram of a terminal to which the embodiment of the present application is applicable.
[0305] Compared with FIG. 5a, in the software structure shown in FIG. 5b, the application framework layer can not include the location framework, and the hardware layer can include a sensor region (Sensor Process Domain, Sensor PD), which includes a sensor module 1 and a sensor module 2.
[0306] Next, taking a music APP as an example, the scheme provided by the embodiment of the present application is introduced from the perspective of the interaction flow between the layers of the software system through steps M1-M6 in combination with FIG. 5b.
[0307] Step M1: The music APP in the application layer is started, and the operating system creates a media player and a sound track in the application framework layer in response to the application of the APP.
[0308] Step M2: The media player is used to decode the audio stream to obtain a PCM stream, and the PCM stream is input into the sound track for mixing and other processing. The audio stream output module transmits the audio signal stream processed by the sound track to the stream management module in the audio HAL.
[0309] Step M3: The stream management module transmits the audio signal stream to the audio signal adjustment module.
[0310] Step M4: After receiving the audio playing instruction, the intelligent parameter adjustment module registers the sensor module 1 and / or the sensor module 2, so that the sensor module 1 and / or the sensor module 2 can perform information sensing, record the sensing results, and send the sensing results to the intelligent parameter adjustment module through a socket (Qsocket) interface.
[0311] Next, the way in which the sensor module obtains the sensing results is introduced.
[0312] In one embodiment, the sensor module can acquire the altitude of the geographic location where the terminal is located from an altitude detection service. That is, the sensor module sends a request to the altitude detection service and acquires the altitude fed back by the altitude detection service. The sensor module can be referred to as a virtual sensor. In this way, the sensor module can acquire the sensing result from the altitude detection service without the aid of a hardware entity.
[0313] In another embodiment, the sensor module controls the air pressure sensor to measure the atmospheric pressure of the environment where the terminal is located and records the atmospheric pressure. In this way, the air pressure sensor can measure the altitude of the geographic location where the terminal is located, thereby obtaining a more accurate sensing result.
[0314] Step M5: The intelligent parameter adjustment module acquires, according to the sensing result, air pressure representation information reflecting the first atmospheric pressure of the environment where the terminal is located, determines the audio playing parameter according to the air pressure representation information, adjusts the audio signal in the audio signal stream according to the audio playing parameter, and inputs the adjusted audio signal into the digital-to-analog conversion chip.
[0315] Step M6: The digital-to-analog conversion chip converts the adjusted audio signal into an analog signal and inputs the analog signal into the loudspeaker to drive the loudspeaker to play audio.
[0316] As can be seen from the above, the sensor module located in the hardware layer accurately senses the environment where the terminal is located and sends the sensing result to the audio parameter adjustment module, so that the audio signal adjustment module can adjust the intensity of the audio signal to be played by the terminal based on the audio playing parameter. As can be seen, the interaction between the modules or services located in different software structure levels can stably and quickly realize the adjustment of the audio signal.
[0317] Finally, referring to FIG. 5c, a third software structure block diagram of a terminal to which the embodiments of the present application are applicable is shown.
[0318] The software structure shown in FIG. 5c includes all the modules or services in FIGS. 5a and 5b. When the scheme provided by the embodiments of the present application is executed based on the software structure shown in FIG. 5c, the layers of the software system can interact according to the interaction process shown in steps S1-S6 or according to the interaction process shown in steps M1-M6.
[0319] The scheme provided by the embodiments of the present application will be introduced from the perspective of user-terminal interaction by referring to the schematic diagrams of three audio playing scenarios shown in FIGS. 6a-6c.
[0320] As shown in FIG. 6a, the desktop of the terminal operating system includes multiple application programs such as settings, camera, music, etc. The user clicks the music APP on the desktop of the terminal operating system, the music APP is started, and a song list interface as shown in FIG. 6b is displayed, which displays the names of audio 1-4 and the corresponding audio information 1-4. The user selects audio 1 from audio 1-audio 4, enters the interface shown in FIG. 6c, and starts audio playing. At this time, the internal interaction process as described in the foregoing FIG. 5a-FIG. 5c is used inside the terminal to obtain the atmospheric pressure under the environment where the terminal is located, and the audio playing parameter is determined based on the obtained atmospheric pressure. Then, a prompt information can be popped up on the playing interface of the music APP, for example, the prompt information can be "the audio playing parameter suitable for the current atmospheric pressure has been determined for you, do you want to adjust the sound effect?", if the user selects yes, the terminal can adjust the intensity of the audio signal to be played based on the audio playing parameter, and drive the speaker set in the terminal to play the audio based on the adjusted audio signal.
[0321] The user information involved in the embodiments of the present application is all authorized information of the user. The acquisition, storage, use, processing, transmission, provision and disclosure of the user information all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.
[0322] In a specific implementation, the present application also provides a computer storage medium, wherein the computer storage medium can store a program, and when the program runs, the device in which the computer storage medium is located can execute part or all of the steps in the above embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM) and the like.
[0323] In a specific implementation, the present application also provides a computer program product, and the computer program product contains executable instructions, which, when executed on a terminal, cause the terminal to execute part or all of the steps in the above method embodiments.
[0324] In a specific implementation, the present application also provides a terminal, which includes one or more processors and a memory.
[0325] The memory is coupled to the one or more processors, and the memory is configured to store computer program code, the computer program code including computer instructions, and the one or more processors invoke the computer instructions to cause the terminal to execute the audio playing method provided by the embodiments of the present application.
[0326] As shown in FIG. 7, the application further provides a chip system applied to the terminal 100, the chip system comprising one or more processors 701, the processor 701 being configured to invoke computer instructions to enable the terminal 100 to input data to be processed into the chip system, and the chip system performing audio playing based on the audio playing method provided by the embodiments of the application.
[0327] In a possible implementation, the chip system further comprises an input and output interface for inputting and outputting data.
[0328] Embodiments of the mechanism disclosed in the application can be implemented in hardware, software, firmware or a combination of these implementation methods. The embodiments of the application can be implemented as computer programs or program codes executed on a programmable system, which comprises at least one processor, a storage system (including volatile and non-volatile memories and / or storage elements), at least one input device and at least one output device.
[0329] The program code can be applied to input instructions to perform the functions described in the application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purpose of the 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.
[0330] The program code can be implemented in a high-level programming language or an object-oriented programming language to communicate with the processing system. If necessary, the program code can also be implemented in assembly language or machine language. In fact, the mechanism described in the application is not limited to the scope of any specific programming language. In any case, the language can be a compiled language or an interpreted language.
[0331] In some cases, the disclosed embodiments can be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments can also be implemented as instructions carried by or stored on a transitory or non-transitory machine-readable (e.g., computer-readable) medium, which can be read and executed by one or more processors. For example, the instructions can be downloaded from a network or by way of another computer readable medium. Thus, a machine-readable medium can include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), including without limitation floppy disks, optical disks, optical disks, Compact Disc Read Only Memories (CD-ROMs), magnetic cased or optical cased cards, read-only memories, random access memories, erasable programmable read-only memories (EPROMs), electrically erasable programmable read-only memories (EEPROMs), magnetic or optical tape, flash memory, or any other suitable medium upon which information can be stored or transmitted. Thus, a machine-readable medium includes any type of medium suitable for storing or transmitting electronic instructions or information in a form readable by a machine (e.g., a computer).
[0332] In the drawings, some of the structural or methodological features can be shown in particular arrangements and / or orders. However, it should be understood that such particular arrangements and / or orders can not be required. Instead, in some embodiments, the features can be arranged differently than shown in the figures of the specification. Also, inclusion of a structural or methodological feature in a particular figure does not imply that the feature is required in all embodiments, and in some embodiments, the feature can not be included or can be combined with other features.
[0333] It should be noted that each unit / module mentioned in the device embodiments of the present application is a logical unit / module, in the physical world, one logical unit / module can be one physical unit / module, also can be a part of one physical unit / module, also can be realized in combination of multiple physical unit / modules, the physical realization of these logical units / modules is not the most important, the combination of the functions realized by these logical units / modules is the key to solve the technical problems proposed in the present application. In addition, in order to highlight the innovative part of the present application, the above-mentioned device embodiments of the present application do not introduce the units / modules which are not closely related to solving the technical problems proposed in the present application, which does not mean that the above-mentioned device embodiments do not have other units / modules.
[0334] It has to be noted that, in the description of the application, the terms "first", "second", etc. are used only for distinguishing between similar elements, and do not connote any order, sequence or priority. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0335] While the application has been illustrated and described in detail in the drawings and foregoing description, the same is to be considered as illustrative and not restrictive in character, it being understood that only the preferred embodiments have been shown and described and that all changes and modifications that come within the spirit of the application are desired to be protected.
Claims
1. An audio playback method, characterized by, Applied to a terminal, the method comprises: obtaining air pressure characteristic information reflecting a first atmospheric pressure of an environment in which the terminal is located; determining, based on the air pressure characteristic information, an audio playing parameter for adjusting the intensity of an audio signal; adjusting the intensity of the audio signal to be played by the terminal based on the audio playing parameter; driving a loudspeaker arranged in the terminal to play audio based on the adjusted audio signal.
2. The method of claim 1, wherein, The determining, based on the air pressure characteristic information, of the audio playing parameter for adjusting the intensity of the audio signal comprises: determining, based on the air pressure characteristic information and a standard atmospheric pressure, an adjustment value for adjusting the intensity of the audio signal as the audio playing parameter, wherein the adjustment value causes a first vibration amplitude to tend to a second vibration amplitude, the first vibration amplitude being the vibration amplitude of a diaphragm when the loudspeaker plays audio based on the adjusted audio signal under the first atmospheric pressure, and the second vibration amplitude being the vibration amplitude of the diaphragm when the loudspeaker plays audio based on an original audio signal under the standard atmospheric pressure.
3. The method of claim 2, wherein, The determining, based on the air pressure characteristic information and a standard atmospheric pressure, of the adjustment value for adjusting the intensity of the audio signal comprises: in a case where the first atmospheric pressure reflected by the air pressure characteristic information is less than the standard atmospheric pressure, determining, based on the first atmospheric pressure and the standard atmospheric pressure, a first adjustment value for performing attenuation processing on the audio signal; in a case where the first atmospheric pressure reflected by the air pressure characteristic information is greater than the standard atmospheric pressure, determining, based on the first atmospheric pressure and the standard atmospheric pressure, a second adjustment value for performing enhancement processing on the audio signal.
4. The method of claim 2, wherein, The determining, based on the air pressure characteristic information and a standard atmospheric pressure, of the adjustment value for adjusting the intensity of the audio signal comprises: determining, based on the first atmospheric pressure reflected by the air pressure characteristic information and the standard atmospheric pressure, a third adjustment value for adjusting the intensity of a low-frequency audio signal and a fourth adjustment value for adjusting the intensity of a high-frequency audio signal.
5. The method of claim 4, wherein, in a case where the first atmospheric pressure reflected by the air pressure characteristic information is less than the standard atmospheric pressure: the third adjustment value is used for performing attenuation processing on the low-frequency audio signal, and the fourth adjustment value is used for performing enhancement processing on the high-frequency audio signal; or the third adjustment value and the fourth adjustment value are both used for performing attenuation processing on the audio signal. in a case where the first atmospheric pressure reflected by the air pressure characteristic information is greater than the standard atmospheric pressure:
6. The method of claim 4, wherein, the third adjustment value is used for performing enhancement processing on the low-frequency audio signal, and the fourth adjustment value is used for performing attenuation processing on the high-frequency audio signal; or the third adjustment value and the fourth adjustment value are both used for performing enhancement processing on the audio signal. The determining, based on the air pressure characteristic information, of the audio playing parameter for adjusting the intensity of the audio signal comprises: determining, according to a corresponding relationship between the air pressure characteristic information and the audio playing parameter, the audio playing parameter corresponding to the air pressure characteristic information as the audio playing parameter for adjusting the intensity of the audio signal.
7. The method of claim 1, wherein, The method further comprises: 8. The method according to any one of claims 1 to 7, characterized in that, The location query result provided by the location query service is used to obtain atmospheric pressure information of an environment where the terminal is located, and the atmospheric pressure information is written into a hidden partition in a storage space; The atmospheric pressure information reflecting the first atmospheric pressure of the environment where the terminal is located is obtained by: The latest stored atmospheric pressure information in the hidden partition is read as the atmospheric pressure information reflecting the first atmospheric pressure of the environment where the terminal is located.
9. The method of claim 8, wherein, The terminal comprises a location query service and an audio control service located in an application program framework layer, an audio HAL located in a hardware abstraction HAL layer, and an audio signal adjustment module located in a hardware layer. The atmospheric pressure information of the environment where the terminal is located is obtained, and the atmospheric pressure information is written into a hidden partition in a storage space, comprising: The location query service obtains the atmospheric pressure information of the environment where the terminal is located, and sends the atmospheric pressure information to the audio control service; The audio control service sends the atmospheric pressure information to the audio HAL through a parameter setting interface; The audio HAL writes the atmospheric pressure information into a hidden partition in a storage space; The latest stored atmospheric pressure information in the hidden partition is read, comprising: The audio HAL reads the latest stored atmospheric pressure information in the hidden partition as the atmospheric pressure information reflecting the first atmospheric pressure of the environment where the terminal is located in response to an audio playing instruction, and writes the atmospheric pressure information into the audio signal adjustment module; The strength of the audio signal to be played by the terminal is adjusted based on the audio playing parameter, comprising: The audio signal adjustment module adjusts the strength of the audio signal to be played by the terminal based on the audio playing parameter.
10. The method of claim 8, wherein, The atmospheric pressure information comprises: The longitude and latitude of the geographical position where the terminal is located; and / or The altitude of the geographical position where the terminal is located; and / or The city where the terminal is located.
11. The method according to any one of claims 1-7, characterized in that, The atmospheric pressure information reflecting the first atmospheric pressure of the environment where the terminal is located is obtained by: The atmospheric pressure information reflecting the first atmospheric pressure of the environment where the terminal is located is obtained based on sensing results obtained by a sensor module.
12. The method of claim 11, wherein, The terminal comprises a sensor module and an audio parameter adjustment module located in a hardware layer. The atmospheric pressure information reflecting the first atmospheric pressure of the environment where the terminal is located is obtained by: The sensor module senses information and records the sensing results; The audio parameter adjustment module obtains the sensing results recorded in the sensor module as the atmospheric pressure information reflecting the first atmospheric pressure of the environment where the terminal is located in response to an audio playing instruction; The strength of the audio signal to be played by the terminal is adjusted based on the audio playing parameter, comprising: The audio signal adjustment module adjusts the strength of the audio signal to be played by the terminal based on the audio playing parameter.
13. The method of claim 12, wherein, The sensor module senses information and records the sensing results, comprising: The sensor module obtains the altitude of the geographical position where the terminal is located provided by an altitude detection service, and records the altitude; and / or The sensor module is a barometer, which measures the atmospheric pressure of the environment and records the atmospheric pressure.
14. The method of claim 11, wherein, The barometer information includes: The first atmospheric pressure of the environment where the terminal is located; and / or The altitude of the geographical location where the terminal is located.
15. The method of any one of claims 1-7, wherein, The barometer information reflecting the first atmospheric pressure of the environment where the terminal is located includes: Determining the sending time and arrival time of the last received preset number of downlink pilot signals from different base stations, and determining the base station sending the downlink pilot signals, wherein the preset number is greater than or equal to 3; Based on the determined sending time and arrival time, obtaining the receiving time delay of each downlink pilot signal; Based on the obtained receiving time delay, determining the distance between the terminal and each base station; Based on the distance between the terminal and each base station and the location of each base station, obtaining the barometer information reflecting the first atmospheric pressure of the environment where the terminal is located.
16. A terminal, characterized by It includes: One or more processors and memories; The memory is coupled with the one or more processors, and the memory is used to store computer program codes, the computer program codes include computer instructions, and the one or more processors call the computer instructions to make the terminal execute the method in any one of claims 1 to 15.
17. A computer-readable storage medium, characterized in that, It includes a computer program, which makes the terminal execute the method in any one of claims 1 to 15 when the computer program runs on the terminal.
18. A computer program product, characterised in that, The computer program product contains executable instructions, which make the terminal execute the method in any one of claims 1 to 15 when the executable instructions are executed on the terminal.
19. A chip system, characterized by The chip system is applied to the terminal, and the chip system includes one or more processors, and the processor is used to call computer instructions to make the terminal input data into the chip system and execute the method in any one of claims 1 to 15 for audio playing.
Citation Information
Patent Citations
Audio playing method and mobile terminal
CN108848267A
Method and apparatus for processing audio signal
CN112204998A
Audio output method, device and system, storage medium and electronic equipment
CN112616108A
Audio playing method and device, audio playing equipment and readable storage medium
CN113655983A
Volume adjustment method and device and storage medium
CN116017235A