An audio playback loudness control method and an electronic device
By automatically adjusting the audio playback gain during application switching, the loudness is consistent with the loudness before switching, the problem of loudness difference between applications is solved and the user experience is improved.
Patent Information
- Application Number
- CN202411904355.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2044-12-23
AI Technical Summary
When users switch between multiple applications, there is a significant difference in audio loudness, resulting in poor user experience in quiet environments.
By determining the reference loudness in the first application, and upon switching to the second application, the audio playback gain in the second application is automatically adjusted according to the difference between the feedback audio loudness and the reference loudness collected by the microphone to uniformly achieve loudness.
It realizes the unification of global audio loudness, reduces the need for users to manually adjust the volume after application switching, and improves the user's terminal experience.
Smart Images

Figure CN119576271B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of terminals, and in particular, to an audio playback loudness control method and an electronic device. Background Art
[0002] When a user switches between different application programs on an electronic device to play corresponding audio and video content, due to the inconsistent sound volumes of each audio and video and different sound effect parameters of each application, even if the user adjusts the volume to a suitable level when playing audio and video in a certain application, the sound when switching to play audio and video in other applications may be too loud or too soft. That is, when the current user switches between multiple application programs to play different audio and videos, there will be an obvious difference in loudness, especially in a quiet environment, and the sudden change in loudness will cause an uncomfortable experience for the user. Summary of the Invention
[0003] To solve the above technical problems, this application provides an audio playback loudness control method and an electronic device to achieve unified global audio loudness, reduce the situation where the user needs to manually adjust the volume after application switching, and thus improve the user's terminal usage experience.
[0004] In a first aspect, this application provides an audio playback loudness control method. In this method, based on a first loudness during audio playback in a first application, a reference loudness is determined. The first loudness refers to the loudness of the feedback audio collected at the microphone during audio playback in the first application; in the case of switching from the first application to a second application, a second loudness during audio playback in the second application is determined. The second loudness refers to the loudness of the feedback audio collected at the microphone during audio playback in the second application; the difference between the second loudness and the reference loudness is determined; in the case where the difference between the second loudness and the reference loudness exceeds a loudness threshold range, based on the difference, the current volume level, and a gain adjustment reference curve between the first application and the second application, the playback gain for the audio in the second application is adjusted so that the second loudness equals the reference loudness after the playback gain is adjusted.
[0005] In the audio playback loudness control method provided in the embodiments of the present application, a reference loudness is determined based on the first loudness when the user plays audio in the first application. In the case where the first application is switched to the second application, if the second loudness when playing audio in the second application changes significantly relative to the reference loudness, the audio playback gain after the application switch is automatically adjusted so that the second loudness when playing audio in the second application after the playback gain adjustment is equal to the reference loudness. That is, if the loudness when playing audio after the application switch is significantly different from the loudness before the switch, the electronic device can instantaneously increase or decrease the loudness when playing audio after the application switch, thereby achieving global audio loudness unity, reducing the situation where the user needs to manually adjust the volume after the application switch, and improving the user's terminal usage experience.
[0006] According to the first aspect, determining the reference loudness based on the first loudness when playing audio in the first application includes: in the case where the user adjusts the volume level, re-executing the step of determining the reference loudness based on the first loudness when playing audio in the first application to update the reference loudness.
[0007] In the embodiments of the present application, in the case where the user adjusts the volume level, it indicates that the first loudness when playing audio in the first application at this time is not the loudness satisfactory to the user. Therefore, the step of determining the reference loudness based on the first loudness when playing audio in the first application is re-executed to update the reference loudness.
[0008] According to the first aspect, or any one of the implementation manners of the above first aspect, determining the reference loudness based on the first loudness when playing audio in the first application includes: in the case where the continuous duration of stable audio playback in the first application is greater than the duration threshold, determining the first loudness when playing audio in the first application as the reference loudness.
[0009] In the embodiments of the present application, stable audio playback means that the audio does not experience interference during playback that causes the volume to increase or decrease (for example, there is no situation where a prompt sound appears when music is not playing, causing the music sound to decrease and then recover, nor is there a situation where the user actively adjusts the volume). The duration threshold can be set according to the actual application situation. For example, it can be set to 10s, 20s, or 30s, and no specific limitation is made in the embodiments of the present application. It can be understood that only when the continuous duration of stable audio playback in the first application is greater than the duration threshold, it indicates that the first loudness when playing the audio is the loudness satisfactory to the user. Therefore, the first loudness when playing audio in the first application can be determined as the reference loudness. Therefore, if the stable audio playback state in the first application is broken, the duration of stable audio playback in the first application is re-timed.
[0010] According to the first aspect, or any implementation of the above first aspect, adjusting the playback gain for the audio in the second application based on the difference value, the current volume level, and the gain adjustment reference curve between the first application and the second application includes: determining a target curve from the gain adjustment reference curve between the first application and the second application based on the current volume level; determining a to-be-changed loudness value corresponding to the sound output by the speaker based on the fitting formula of the target curve and the difference value; adjusting the playback gain for the audio in the second application according to the to-be-changed loudness value so that the second loudness after the playback gain adjustment is equal to the reference loudness.
[0011] In an embodiment of the present application, when the difference between the second loudness and the reference loudness exceeds the loudness threshold range, the playback gain for the audio in the second application is adjusted so that after the playback gain adjustment, the difference between the second loudness and the reference loudness is 0, achieving global unity of the audio loudness in the electronic device.
[0012] According to the first aspect, or any implementation of the above first aspect, before determining the reference loudness based on the first loudness during audio playback in the first application, the method further includes: obtaining the target loudness information before and after switching between the first application and the second application at each volume level; determining the gain adjustment reference curve between the first application and the second application based on the target loudness information for each volume level.
[0013] In an embodiment of the present application, the gain adjustment reference curve is a relationship curve between the loudness change of the sound output by the speaker and the loudness change of the sound collected by the microphone when switching from the first application to the second application at a certain volume level. The volume level is a level or grade used in an electronic device to represent the strength or size of sound. Different electronic devices and brands may have different volume level divisions, but generally, the volume levels of mobile phones are between 15 and 20 levels. Each level represents a specific intensity of sound, increasing gradually from the lowest volume to the highest volume.
[0014] According to the first aspect, or any implementation of the above first aspect, the obtaining the target loudness information before and after switching between the first application and the second application at each volume level includes: when the first application requests to play audio, performing gain processing on the first source audio based on the current volume level to obtain a first processed audio; driving the speaker to play the first processed audio; the microphone collecting a first feedback audio in response to the speaker playing; after switching from the first application to the second application, when the second application requests to play audio, performing gain processing on the second source audio based on the current volume level to obtain a second processed audio; driving the speaker to play the second processed audio; the microphone collecting a second feedback audio in response to the speaker playing.
[0015] In the embodiments of the present application, the gain of the audio in the electronic device is the gain for the source audio, and the obtained and played audio after gain is the processed audio. Since the environment contains information such as noise, the audio heard by the user's human ear can be considered as the feedback audio collected by the microphone. Therefore, the loudness of the processed audio and the loudness of the feedback audio in the two scenarios before and after the application switch are both effective information and need to be obtained. In addition, the electronic device will perform multiple learning processes to record data in various scenarios and at various volume levels, so as to facilitate the subsequent determination of the gain adjustment reference curve between the first application and the second application.
[0016] According to the first aspect, or any implementation manner of the above first aspect, for each of the volume levels, determining the gain adjustment reference curve between the first application and the second application based on the target loudness information includes: for each of the volume levels, performing a correlation process based on the difference between the loudness of the first feedback audio and the corresponding second feedback audio, and the difference between the loudness of the first processed audio and the corresponding second processed audio, to obtain the gain adjustment reference curve between the first application and the second application.
[0017] In the embodiments of the present application, the gain adjustment reference curve set includes: at each volume level, when switching from the first application to the second application, the relationship curve between the change in the loudness of the sound output by the speaker (the difference between the loudness of the first feedback audio and the second feedback audio) and the change in the loudness of the sound collected by the microphone (the difference between the loudness of the first processed audio and the second processed audio). The gain adjustment reference curve can be used to determine the magnitude of the gain adjustment before and after the application switch, so as to assist the electronic device to achieve accurate adjustment of the playback gain and improve the user's terminal usage experience.
[0018] According to the first aspect, or any implementation manner of the above first aspect, the method further includes: when initially playing audio after the device is started, displaying a loudness maintenance prompt window; the loudness maintenance prompt window includes a control for enabling the global loudness maintenance function; in response to the user's enabling operation on the global loudness maintenance function, performing the method according to any one of the foregoing items.
[0019] In the embodiments of the present application, the electronic device provides a convenient and intelligent way for the user to enable the global loudness maintenance function, so as to improve the user's terminal usage experience.
[0020] In a second aspect, the present application provides an electronic device, which includes: one or more processors; a memory; and a computer program, where the computer program is stored in the memory, and when the computer program is executed by the one or more processors, it enables the electronic device to execute the instructions of the method in the first aspect or any possible implementation manner of the first aspect.
[0021] The second aspect and any implementation manner of the second aspect respectively correspond to the first aspect and any implementation manner of the first aspect. For the technical effects corresponding to the second aspect and any implementation manner of the second aspect, reference may be made to the technical effects corresponding to the first aspect and any implementation manner of the first aspect above, which will not be elaborated herein.
[0022] In a third aspect, the present application provides a computer storage medium, including computer instructions, which, when running on an electronic device, cause the electronic device to execute the instructions of the method in the first aspect or any possible implementation manner of the first aspect.
[0023] The third aspect and any implementation manner of the third aspect respectively correspond to the first aspect and any implementation manner of the first aspect. For the technical effects corresponding to the third aspect and any implementation manner of the third aspect, reference may be made to the technical effects corresponding to the first aspect and any implementation manner of the first aspect above, which will not be elaborated herein. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 FIG. is a schematic diagram of an application scenario provided by an embodiment of the present application;
[0025] Figure 2 FIG. is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
[0026] Figure 3 FIG. is a software structure block diagram of an electronic device provided by an embodiment of the present application;
[0027] Figure 4 FIG. is a schematic flowchart of a method for controlling audio playback loudness provided by an embodiment of the present application;
[0028] Figure 5 FIG. is a schematic flowchart of a method for determining a gain adjustment reference curve between applications provided by an embodiment of the present application;
[0029] Figure 6 FIG. is a schematic flowchart of a method for determining a reference loudness provided by an embodiment of the present application;
[0030] Figure 7 FIG. is a schematic flowchart of another method for controlling audio playback loudness provided by an embodiment of the present application;
[0031] Figure 8 FIG. is a schematic flowchart of a method for adjusting audio playback gain provided by an embodiment of the present application;
[0032] Figure 9 FIG. is a flowchart of a method for enabling audio playback loudness control provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0033] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Apparently, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0034] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0035] The terms "first", "second", etc. in the description and claims of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order of the objects. For example, the first target object and the second target object are used to distinguish different target objects, rather than to describe the specific order of the target objects.
[0036] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific manner.
[0037] In the description of the embodiments of the present application, unless otherwise specified, the meaning of "a plurality" refers to two or more. For example, a plurality of processing units refers to two or more processing units; a plurality of systems refers to two or more systems.
[0038] When a user switches between different application programs on an electronic device to play corresponding audio and video content, due to the inconsistent sound volumes of the audio and video and the different sound effect parameters of the applications, even if the user adjusts the volume to an appropriate size when playing audio and video in a certain application, the sound may be too loud or too small when switching to other applications to play audio and video. That is, there will be an obvious difference in loudness when the current user switches between multiple application programs to play different audio and video. Especially in a quiet environment, sudden loudness changes will cause an uncomfortable experience for the user.
[0039] Figure 1 It is a schematic diagram of an application scenario provided for the embodiments of the present application. Before introducing the embodiments of the present application, first, based on Figure 1 the application scenario of the embodiments of the present application will be described. Figure 1 (1) and (3) of show the first application interface 101 when the user is using the first application.Figure 1 (2) shows the second application interface 102 when the user is using the second application.
[0040] As Figure 1 shown in (1) therein, the user browses a video in the first application interface 101 of the first application, and the sound loudness during the video playback is 40 db. At this time, the second application receives a voice message, so the user switches to the second application interface 102 of the second application to listen to the voice message. Due to the differences in the material sound sources and sound effect algorithms, even at the same device volume, the loudness of different sound sources during playback will be different. As Figure 1 shown in (2) therein, when the user clicks on the voice bar 1021 to listen to the voice message, the user feels that the sound loudness is relatively low (lower than the loudness during the video playback in the first application), so the user turns up the volume of the sound through the volume bar 1022. After the volume is turned up, the loudness during the playback of this voice message is 40 db. After the playback of the voice message ends, as Figure 1 shown in (3) therein, the user switches back to the first application interface 101 of the first application to continue playing the video. Since the volume was turned up when listening to the foregoing voice message, therefore, the loudness during the video playback at this time will also increase, for example, it becomes 70 db, and the sudden increase in the sound loudness will cause an uncomfortable experience for the user.
[0041] It can be understood that based on the fact that current different applications each have their own sound effects, and in different scenarios such as audio and video playback and voice message playback, the sound effect parameters used by the device itself are different, which will cause obvious differences in volume when the user switches between multiple APPs. Especially in a quiet environment, a sudden change in volume will cause an uncomfortable experience for the user.
[0042] For this reason, the embodiments of the present application provide an audio playback loudness control method and an electronic device. This method can reduce the loudness difference caused by the differences in the material sound sources and sound effect algorithms during the process of the user switching APPs or switching different audio and videos, so as to improve the user's terminal usage experience.
[0043] The audio playback loudness control method provided by the embodiments of the present application can be applied to an electronic device. The electronic device can be a wearable electronic device (such as a watch), a portable computer (such as a mobile phone), a tablet computer, a notebook computer, a personal computer (PC), an augmented reality (AR) / virtual reality (VR) device, an in-vehicle computer, etc. The following embodiments do not make special restrictions on the specific form of this electronic device.
[0044] Before explaining the technical solutions of the embodiments of the present application, first, the electronic device of the embodiments of the present application will be described in combination with the accompanying drawings. Figure 2This is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present application. It should be understood that: Figure 2 The illustrated electronic device 100 is merely one example of an electronic device, and the electronic device 100 may have more or fewer components than those shown in the figure, may combine two or more components, or may have a different configuration of components. Figure 2 The various components shown in the EMBODIMENTS 2000 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.
[0045] The electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0046] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0047] Among them, the controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0048] In the embodiments of the present application, the DSP may include an audio digital signal processor (ADSP). The ADSP may include hardware and instruction sets for audio processing to efficiently execute operations related to audio processing. Exemplarily, the ADSP may implement functions such as mixing, resampling, gain adjustment, and filtering of audio signals. Among them, the gain adjustment function can be used to adjust the volume of the headphone output audio signal by adjusting the amplitude of the audio signal.
[0049] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can save the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0050] The wireless communication function of the electronic device 100 can be implemented by the antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modulation and demodulation processor, and baseband processor, etc.
[0051] The antenna 1 and antenna 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 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 the diversity antenna of the wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0052] The mobile communication module 150 can provide solutions for wireless communications such as 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
[0053] The wireless communication module 160 may provide solutions for wireless communications applied to the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite systems (GNSSs), frequency modulation (FM), near field communication (NFC), infrared (IR), etc.
[0054] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, enabling the electronic device 100 to communicate with networks and other devices through wireless communication technologies.
[0055] The electronic device 100 implements the display function through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
[0056] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel may adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0057] The electronic device 100 can implement the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor, etc.
[0058] The camera 193 is used to capture static images or videos. An object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard format such as RGB or YUV. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.
[0059] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.
[0060] The video codec is used to compress or decompress digital videos. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple coding formats, such as: Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0061] The NPU is a neural-network (NN) computing processor. By learning from the biological neural network structure, such as learning from the transmission pattern between human brain neurons, it can quickly process the input information and can also continuously self-learn. Through the NPU, applications such as intelligent cognition of the electronic device 100 can be realized, such as: image recognition, face recognition, speech recognition, text understanding, etc.
[0062] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to achieve the data storage function. For example, files such as music and videos are saved in the external memory card.
[0063] The internal memory 121 can be used to store computer-executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.). The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.). In addition, the internal memory 121 can include a high-speed random access memory and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0064] The electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor, etc. For example, music playback, recording, etc.
[0065] The audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal. The audio module 170 can also be used for encoding and decoding audio signals. The audio module 170 can include an audio codec (codec), etc., and the audio codec can implement analog-to-digital conversion or digital-to-analog conversion of audio signals.
[0066] In some embodiments, the audio module 170 can be disposed in the processor 110, or some functional modules of the audio module 170 can be disposed in the processor 110.
[0067] The speaker 170A, also known as the "loudspeaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or a hands-free call through the speaker 170A.
[0068] The receiver 170B, also known as the "earpiece", is used to convert an audio electrical signal into a sound signal. When the electronic device 100 answers a call or a voice message, the voice can be listened to by placing the receiver 170B close to the human ear.
[0069] The microphone 170C, also known as a "microphone" or "transmitter", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak close to the microphone 170C with their mouth to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In some other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also implement a noise reduction function. In some other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C, which can collect sound signals, reduce noise, identify the sound source, and implement functions such as directional recording.
[0070] The headphone jack 170D is used to connect a wired headphone. The headphone jack 170D can be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0071] The pressure sensor 180A is used to sense pressure signals and can convert pressure signals into electrical signals. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can include at least two parallel plates with conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations with the same touch position but different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, the instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, the instruction to create a new short message is executed.
[0072] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass 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 screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.
[0073] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone. The audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function. The application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.
[0074] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.
[0075] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects.
[0076] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0077] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.
[0078] Figure 3 A software structure block diagram of an electronic device 100 provided in an embodiment of the present application.
[0079] The layered architecture of the electronic device 100 divides software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, the hardware abstraction layer (HAL), and the kernel layer.
[0080] The application layer may include a series of application packages. The application layer runs applications by calling the application programming interfaces (APIs) provided by the application framework layer.
[0081] As shown, the application packages may include applications such as cameras, galleries, calendars, calls, maps, navigation, WLAN, Bluetooth, music, videos, text messages, etc.
[0082] Such as Figure 3 shown, the application packages may include applications such as cameras, galleries, calendars, calls, maps, navigation, WLAN, Bluetooth, music, videos, text messages, etc.
[0083] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions.
[0084] Such as Figure 3 shown, the application framework layer may include an audio management module, a content provider, a view system, a resource manager, etc.
[0085] Among them, the audio management module is used to transfer information such as audio control and audio playback of applications to the corresponding modules in the hardware abstraction layer.
[0086] The content provider is used to store and obtain data, and make this data accessible to applications. The data may include videos, images, audio, dialed and answered calls, browsing history and bookmarks, phone books, etc.
[0087] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
[0088] The resource manager provides various resources for applications, such as localized strings, icons, pictures, layout files, video files, and so on.
[0089] The Android Runtime includes core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
[0090] The core libraries consist of two parts: one part is the functional functions that need to be called by the Java language, and the other part is the core libraries of Android.
[0091] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as the management of object life cycles, stack management, thread management, security and exception management, and garbage collection.
[0092] The system libraries can include multiple functional modules. For example: Media Libraries, etc. The media libraries support the playback and recording of multiple common audio and video formats, as well as static image files, etc. The media libraries can support multiple audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0093] The hardware abstraction layer includes an audio algorithm processing module. This audio algorithm processing module is used to implement the global loudness control function, such as for determining the reference loudness, determining the loudness of the feedback audio collected by the microphone, determining whether the loudness of the feedback audio collected by the microphone exceeds the reference loudness, and adjusting the audio playback gain when the loudness of the feedback audio exceeds the reference loudness.
[0094] The kernel layer is the layer between the hardware and the software. The kernel layer at least includes an ADSP driver, a codec driver, an audio driver, a sensor driver, etc.
[0095] In the embodiments of the present application, the hardware layer connected to the kernel layer may include: an ADSP module, an audio codec, a speaker, and a microphone, etc.
[0096] Among them, the ADSP module is deployed in the ADSP chip, and this ADSP module is used to process digital audio signals and digitally process the audio signals to achieve specific effects, such as noise reduction, sound quality enhancement, etc.
[0097] In some embodiments, the global loudness control function of the foregoing audio algorithm processing module may also be integrated in the ADSP chip, and the ADSP chip implements the global loudness control function.
[0098] An audio codec can encode analog audio into digital audio and decode digital audio into analog audio. It is usually built into a sound card, supports audio input and output, and includes an analog-to-digital converter (ADC) and a digital-to-analog converter (DAC). In some examples, the audio codec can also implement sound gain control.
[0099] In some other embodiments, the global loudness control function of the aforementioned audio algorithm processing module can also be integrated into the audio codec, and the audio codec implements the global loudness control function.
[0100] The speaker is used to output the audio signal transmitted by the audio codec. The microphone includes a digital microphone or an analog microphone. In the case where the microphone is a digital microphone, after the microphone picks up the sound, the sound can be directly transmitted to the ADSP; while in the case where the microphone is an analog microphone, after the microphone picks up the sound, the sound is transmitted to the audio codec, so that the audio codec converts the analog sound signal into a digital sound signal and then transmits it to the ADSP module.
[0101] It can be understood that Figure 3 The layers in the shown software structure and the components included in each layer do not constitute a specific limitation on the electronic device 100. In some other embodiments of the present application, the electronic device 100 may include more or fewer layers than shown, and each layer may include more or fewer components, which are not limited in the present application.
[0102] Figure 4 It is a schematic flowchart of an audio playback loudness control method provided by an embodiment of the present application. The audio playback loudness control method is applied to an electronic device. As Figure 4 shown, the audio playback loudness control method includes steps S401 - step S405.
[0103] Step S401, determine the gain adjustment reference curve among applications in the electronic device.
[0104] Among them, the gain adjustment reference curve is a relationship curve between the loudness change of the sound output by the speaker and the loudness change of the sound collected by the microphone when the first application switches to the second application at a certain volume level.
[0105] The volume level is a level or grade used to represent the strength or size of sound in an electronic device. Different electronic devices and brands may have different volume level divisions. Generally speaking, the volume levels of mobile phones are between 15 and 20 levels. Each level represents a specific intensity of sound, increasing gradually from the lowest volume to the highest volume.
[0106] It can be understood that there are multiple gain adjustment reference curves between the first application and the second application, and each volume level corresponds to one gain adjustment reference curve, that is, the number of gain adjustment reference curves between the first application and the second application is the same as the number of levels of the volume levels in the electronic device. For example, if the volume level in the electronic device is 16 levels, then the number of gain adjustment reference curves between the first application and the second application is 16.
[0107] Step S402: Determine a reference loudness based on the first loudness during audio playback in the first application, and update the reference loudness when the user adjusts the volume level.
[0108] Among them, the first loudness refers to the loudness of the feedback audio collected at the microphone during audio playback in the first application, and this first loudness is used to fit the loudness that the user hears during audio playback in the first application.
[0109] It can be understood that when the user turns up the volume level, the first loudness will increase accordingly; when the user turns down the volume level, the first loudness will decrease accordingly. That is, when the user adjusts the volume level, it means that the current first loudness during audio playback in the first application is an inappropriate loudness for the user. Therefore, when the user adjusts the volume level, it is necessary to update the reference loudness based on the new loudness during audio playback in the first application.
[0110] Step S403: When switching from the first application to the second application, determine the second loudness during audio playback in the second application.
[0111] Among them, the second loudness refers to the loudness of the feedback audio collected at the microphone during audio playback in the second application, and this second loudness is used to fit the loudness that the user hears during audio playback in the second application.
[0112] Step S404: Determine the difference between the second loudness and the reference loudness.
[0113] It can be understood that the reference loudness and the second loudness correspond to the same volume level.
[0114] Step S405: When the difference between the second loudness and the reference loudness exceeds the loudness threshold range, adjust the playback gain for the audio in the second application based on this difference, the current volume level, and the gain adjustment reference curve between the first application and the second application, so that the second loudness during audio playback in the second application is equal to the reference loudness.
[0115] Among them, the loudness threshold range can be set according to the actual usage situation, for example, set to ±3 db (decibels) or ±5 db, and the embodiments of the present application do not make specific limitations.
[0116] In the audio playback loudness control method provided by the embodiments of the present application, first, a reference loudness is determined based on the first loudness when the user plays audio in the first application. In the case where the first application is switched to the second application, if the loudness of the audio played in the second application changes significantly relative to the reference loudness, the audio playback gain after the application switch is automatically adjusted so that the second loudness when the audio is played in the second application is equal to the reference loudness, achieving the unity of the loudness of global audio playback and reducing the situation where the user needs to manually adjust the volume after the application switch, thereby improving the user's terminal usage experience.
[0117] Figure 5 FIG. is a schematic flowchart of a method for determining a gain adjustment reference curve between applications provided by an embodiment of the present application. This method is applied to an electronic device, which includes a first application, a second application, an audio algorithm processing module, an audio driver, a speaker, and a microphone. The first application and the second application belong to the application program layer of the electronic device, the audio algorithm processing module belongs to the hardware abstraction layer of the electronic device, the audio driver belongs to the kernel layer of the electronic device, and the speaker and the microphone belong to the hardware layer of the electronic device. As Figure 5 shown, the steps for determining the gain adjustment reference curve between applications in the electronic device (the above step S401) include steps S501 - S515.
[0118] Step S501: The first application sends a first audio playback request to the audio algorithm processing module.
[0119] Among them, the first audio playback request is used to request playing the first source audio. The first playback request includes the application identifier of the first application.
[0120] Taking Figure 1 the scenario shown in Figure 1 as an example, the first source audio may be the audio corresponding to the video displayed in the first application shown in (1) of
[0121] Step S502: The audio algorithm processing module performs gain processing on the first source audio based on the first audio playback request and the current volume level to obtain the first processed audio.
[0122] It can be understood that different applications generally require different gain processing for audio, and also, different volume levels require different gain processing for audio. For example, the first application requires that the sound source from the first application be amplified by at least α times, while the second application requires that the sound source from the second application be amplified by at least β times. Another example is that when the volume level is 1, the sound source from the application is amplified by a times; when the volume level is 5, the sound source from the application is amplified by b times.
[0123] Step S503: The audio algorithm processing module sends a playback instruction to the audio driver module.
[0124] The play instruction is used to instruct the audio driver module to control the speaker to play the specified audio.
[0125] It is understandable that multiple processing steps of audio playback are omitted in the embodiments of the present application. For example, the audio algorithm processing module can send the audio after gain processing to the ADSP for other processing (such as noise reduction and enhancement), and then the ADSP sends the processed audio to the codec for digital-to-analog conversion, and the codec sends the converted audio to the speaker to control the speaker to play the audio.
[0126] Step S504: The audio driving module drives the speaker to play the first processed audio in response to the play instruction.
[0127] Step S505: The microphone collects the first feedback audio in response to the speaker playing.
[0128] The first feedback audio includes signals such as the first processed audio played by the speaker and environmental noise.
[0129] It is understandable that the loudness of audio will attenuate as the distance of sound propagation increases. After the speaker outputs the audio, the audio is propagated and then collected by the microphone, and the loudness of the audio output by the speaker collected by the microphone will decrease. In addition, the sound effects and volume of the audio will also affect the degree of loudness attenuation. Therefore, even if the loudness of different audio played by the speaker is the same when playing, their loudness attenuation may be different after propagation, that is, the loudness of the audio collected by the microphone will be different.
[0130] It can also be understood that, since the solution of the present application is aimed at the user's human ear auditory scene, the loudness of the first feedback audio collected by the default microphone in this solution is the loudness of the first processed audio heard by the user's human ear.
[0131] Step S506: The microphone sends the first feedback audio to the audio algorithm processing module.
[0132] Step S507: The audio algorithm processing module determines the loudness of the first feedback audio.
[0133] The audio algorithm processing module may determine the loudness of the first feedback audio by performing A-weighted sound pressure processing on the first feedback audio, etc. The result obtained by A-weighted sound pressure processing may better reflect the auditory perception of the user's ear.
[0134] In the embodiment of the present application, the user switches to the second application while using the first application. Figure 1 Take the scenario shown as an example, Figure 1 The video application shown in (1) switches to Figure 1The social application shown in (2) of. In the second application, the user also needs to play audio. In the scenario of application switching accompanied by audio playback, the electronic device can automatically learn the gain adjustment reference curve between the first application and the second application.
[0135] Step S508: The second application sends a second audio playback request to the audio algorithm processing module.
[0136] Among them, the second audio playback request is used to request playing the second source audio. The second playback request includes the application identifier of the second application.
[0137] Taking Figure 1 the scenario shown as an example, the second source audio can be Figure 1 the voice audio in the second application shown in (2) of.
[0138] Step S509: The audio algorithm processing module performs gain processing on the second source audio based on the second audio playback request and the current volume level to obtain the second processed audio.
[0139] Step S510: The audio algorithm processing module sends a playback instruction to the audio driver module.
[0140] Step S511: The audio driver module responds to the playback instruction and drives the speaker to play the second processed audio.
[0141] Step S512: The microphone responds to the speaker playback and collects the second feedback audio.
[0142] Among them, the second feedback audio includes signals such as the second processed audio played by the speaker and ambient noise.
[0143] Step S513: The microphone sends the second feedback audio to the audio algorithm processing module.
[0144] Step S514: The audio algorithm processing module determines the loudness of the second feedback audio.
[0145] Step S515: The audio algorithm processing module performs correlation processing based on the difference between the loudness of the first feedback audio and the loudness of the second feedback audio, the difference between the loudness of the first processed audio and the loudness of the second processed audio, and the corresponding volume level, to obtain the gain adjustment reference curve between the first application and the second application.
[0146] In the embodiments of the present application, the gain adjustment reference curve set includes: at each volume level, when switching from the first application to the second application, the relationship curve between the change in the loudness of the sound output by the speaker (the difference between the loudness of the first feedback audio and the loudness of the second feedback audio) and the change in the loudness of the sound collected by the microphone (the difference between the loudness of the first processed audio and the loudness of the second processed audio).
[0147] It can be understood that the above steps S501 - S515 are only an illustration of a learning process for the electronic device (recording the difference in loudness between the first feedback audio and the second feedback audio, the difference in loudness between the first processed audio and the second processed audio, and the corresponding volume levels). In actual applications, the electronic device will execute this learning process multiple times, record data under various scenarios and at various volume levels, so as to determine an accurate gain adjustment reference curve between the first application and the second application.
[0148] Figure 6 FIG. [not specified] is a schematic flowchart of a method for determining a reference loudness provided by an embodiment of the present application. This method is applied to an electronic device, which includes a first application, a second application, an audio algorithm processing module, an audio driver, a speaker, and a microphone. The first application and the second application belong to the application program layer of the electronic device, the audio algorithm processing module belongs to the hardware abstraction layer of the electronic device, the audio driver belongs to the kernel layer of the electronic device, and the speaker and the microphone belong to the hardware layer of the electronic device. As Figure 6 shown, the steps of determining the reference loudness based on the first loudness during audio playback in the first application, and updating the reference loudness when the user adjusts the volume level (the above step S402) include: steps S601 - S609.
[0149] Step S601: The first application sends a first audio playback request to the audio algorithm processing module.
[0150] Step S602: The audio algorithm processing module performs gain processing on the first source audio based on the first audio playback request and the current volume level to obtain the first processed audio.
[0151] Step S603: The audio algorithm processing module sends a playback instruction to the audio driver.
[0152] Step S604: The audio driver responds to the playback instruction and drives the speaker to play the first processed audio.
[0153] Step S605: The microphone responds to the speaker playback and collects the first feedback audio.
[0154] Step S606: The microphone sends the first feedback audio to the audio algorithm processing module.
[0155] Step S607: The audio algorithm processing module determines the loudness of the first feedback audio.
[0156] Step S608: When the continuous duration of stable audio playback in the first application is greater than the duration threshold, the audio algorithm processing module determines the first loudness during audio playback in the first application as the reference loudness.
[0157] Among them, stable audio playback means that the audio is not disturbed midway, resulting in an increase or decrease in volume (for example, there is no situation where a prompt sound appears when no music is being played, causing the music volume to decrease and then recover, nor is there a situation where the user actively adjusts the volume). The duration threshold can be set according to the actual application situation. For example, it can be set to 10s, 20s, or 30s. In the embodiments of the present application, no specific limitation is made.
[0158] It can be understood that only when the duration of stable audio playback in the first application is greater than the duration threshold, it indicates that the first loudness during the audio playback in the first application is the loudness that the user is satisfied with. Therefore, the first loudness during the audio playback in the first application can be determined as the reference loudness. Therefore, if the stable audio playback state in the first application is broken, the duration of stable audio playback in the first application is re-timed.
[0159] It should be noted that the process by which the electronic device determines the first loudness during the audio playback in the first application is similar to the steps from step S503 to step S507 described above. Therefore, in this embodiment, the process by which the electronic device determines the first loudness during the audio playback in the first application will not be elaborated.
[0160] Step S609: When the user adjusts the volume level, re-execute the above-mentioned step S608 to update the reference loudness.
[0161] It can be understood that when the user adjusts the volume level, it indicates that the first loudness during the audio playback in the first application at this time is not the loudness that the user is satisfied with. Therefore, re-execute step S608 to update the first loudness of the audio that is stably played in the first application after the volume level is adjusted as the reference loudness.
[0162] It can also be understood that regardless of whether the user switches applications, every time the user adjusts the volume level, the above-mentioned step S608 needs to be re-executed. That is to say, in the step S608 executed at different time points, the first application can be different application programs. In this embodiment, the first application refers to the application that the user is currently using.
[0163] In the embodiments of the present application, the reference loudness is a loudness measurement standard for achieving global volume (loudness) uniformity. When the loudness of the audio played in the new application is significantly different from the reference loudness after the application is switched, the loudness of the audio played in the new application is automatically adjusted to adjust the loudness of the audio played in the new application to the reference loudness.
[0164] Figure 7 It is a schematic flowchart of another audio playback loudness control method provided by the embodiments of the present application. This another audio playback loudness control method is based on the foregoing Figure 6It is executed on the basis of determining the reference loudness. In this another audio playback loudness control method, the aforementioned steps S403 to S405 are further described. As Figure 7 shown, this another audio playback loudness control method includes: steps S601 to S618.
[0165] Step S601, the first application sends a first audio playback request to the audio algorithm processing module.
[0166] Step S602, the audio algorithm processing module performs gain processing on the first source audio based on the first audio playback request and the current volume level to obtain the first processed audio.
[0167] Step S603, the audio algorithm processing module sends a playback instruction to the audio driver.
[0168] Step S604, the audio driver responds to the playback instruction and drives the speaker to play the first processed audio.
[0169] Step S605, the microphone responds to the speaker playback and collects the first feedback audio.
[0170] Step S606, the microphone sends the first feedback audio to the audio algorithm processing module.
[0171] Step S607, the audio algorithm processing module determines the loudness of the first feedback audio.
[0172] Step S608, when the continuous duration of the audio playing stably in the first application is greater than the duration threshold, the audio algorithm processing module determines the first loudness during the audio playback in the first application as the reference loudness.
[0173] Step S609, when the user adjusts the volume level, the above step S608 is executed again to update the reference loudness.
[0174] In the embodiments of the present application, when the user is using the first application, they switch to the second application. Taking Figure 1 the shown scenario as an example, such as switching from the video application shown in Figure 1 (1) to the social application shown in Figure 1 (2). In the second application, the user also needs to play audio. In the scenario of application switching accompanied by audio playback, the electronic device can automatically learn the gain adjustment reference curve between the first application and the second application.
[0175] Step S610, the second application sends a second audio playback request to the audio algorithm processing module.
[0176] Step S611: The audio algorithm processing module performs gain processing on the second source audio based on the second audio playback request and the current volume level to obtain the second processed audio.
[0177] Step S612: The audio algorithm processing module sends a playback instruction to the audio driver module.
[0178] Step S613: In response to the playback instruction, the audio driver module drives the speaker to play the second processed audio.
[0179] Step S614: In response to the speaker playing, the microphone collects the second feedback audio.
[0180] Among them, the second feedback audio includes signals such as the second processed audio played by the speaker and environmental noise.
[0181] Step S615: The microphone sends the second feedback audio to the audio algorithm processing module.
[0182] Step S616: The audio algorithm processing module determines the loudness of the second feedback audio.
[0183] Step S617: The audio algorithm processing module determines the difference between the second loudness and the reference loudness.
[0184] Step S618: In the case where the difference between the second loudness and the reference loudness exceeds the loudness threshold range, based on the difference, the current volume level, and the gain adjustment reference curve between the first application and the second application, adjust the playback gain for the audio in the second application so that the second loudness when the audio in the second application is played is equal to the reference loudness.
[0185] In the embodiment of the present application, when the user is using the first application, they switch to the second application. Taking Figure 1 the shown scenario as an example, such as switching from the video application shown in (1) of Figure 1 to the social application shown in (2) of Figure 1 . In (2) of Figure 1 , the user also needs to manually adjust the volume to make the loudness of the played voice appropriate. After applying the another audio playback loudness control method provided by the embodiment of the present application, the electronic device can automatically adjust the playback gain for the voice information at the moment of playing the voice information, so that the loudness when the voice information is played is suitable for the user's hearing.
[0186] In another audio playback loudness control method provided by an embodiment of the present application, first, a reference loudness is determined based on the first loudness when a user plays audio in a first application. In the case where the first application switches to a second application, if the loudness of the audio played in the second application changes significantly relative to the reference loudness, the audio playback gain after the application switch is automatically adjusted so that the second loudness when the audio is played in the second application is equal to the reference loudness, achieving unified loudness for global audio playback and reducing the situation where the user needs to manually adjust the volume after the application switch, thereby improving the user's terminal usage experience.
[0187] Figure 8 It is a schematic flowchart of a method for adjusting audio playback gain provided by an embodiment of the present application. This method is applied to an electronic device, which includes a first application, a second application, an audio algorithm processing module, an audio driver, a speaker, and a microphone. The first application and the second application belong to the application program layer of the electronic device, the audio algorithm processing module belongs to the hardware abstraction layer of the electronic device, the audio driver belongs to the kernel layer of the electronic device, and the speaker and the microphone belong to the hardware layer of the electronic device. As Figure 8 shown, the step of adjusting the playback gain for the audio in the second application based on the difference, the current volume level, and the gain adjustment reference curve between the first application and the second application when the difference between the second loudness and the reference loudness exceeds the loudness threshold range (the above step S405 or step S618) includes: step S801-step S803.
[0188] Step S801: The audio algorithm processing module determines a target curve from the gain adjustment reference curve between the first application and the second application based on the current volume level.
[0189] Among them, the target curve is the gain adjustment reference curve between the first application and the second application corresponding to the current volume level.
[0190] Step S802: The audio algorithm processing module determines the loudness value to be changed corresponding to the sound output by the speaker based on the fitting formula of the target curve and the difference.
[0191] Step S803: The audio algorithm processing module adjusts the playback gain for the audio in the second application according to the loudness value to be changed.
[0192] In one embodiment, the audio algorithm processing module adjusts the playback gain for the audio in the second application according to the loudness value to be changed, including: the audio algorithm processing module determines a gain adjustment coefficient according to the loudness value to be changed and the current playback gain coefficient, and adjusts the playback gain for the audio in the second application based on the gain adjustment coefficient.
[0193] The above steps S802 and S803 will be described by the following example.
[0194] In this example, if the fitting formula of the target curve is Y - Y1 = k(X - X1) + W, where Y is the reference loudness, Y1 is the second loudness, X is the loudness of the audio output by the speaker when the first application plays the audio, X1 is the loudness of the audio output by the speaker when the second application plays the audio, k is the slope of the fitting curve, and W is the intercept of the fitting curve. Then, the difference is input into this fitting formula to obtain: difference = k(X - X1) + W, then X - X1 = (difference - W) / k, that is, X - [X1 + (difference - W) / k] = 0, that is, the loudness value to be changed corresponding to the sound output by the speaker is: (difference - W) / k.
[0195] Since X and Y will no longer change, therefore, the value of X1 needs to be changed to cause Y1 to change, so that the difference (i.e., Y - Y1) is 0 after changing X1. And currently X1 = pX0, where X0 is the loudness of the second source sound in the second application, and p is the current playback gain coefficient for the audio in the second application. The current playback gain for the audio in the second application is adjusted. After the playback gain is adjusted, the value of X1 is: X1 = (p - q)X0, q is the gain adjustment coefficient, then (p - q)X0 - pX0 = (difference - W) / k, that is, q = -(difference - W) / (k - X0).
[0196] It can be understood that the above example takes the fitting formula of the target curve as Y - Y1 = k(X - X1) + W for illustration, which does not constitute a limitation on the fitting formula of the target curve. In practical applications, the fitting formula of the target curve can be determined according to the actually collected values, and no specific limitation is made in the embodiments of the present application.
[0197] In the embodiments of the present application, when the difference between the second loudness and the reference loudness exceeds the loudness threshold range, the playback gain for the audio in the second application is adjusted so that after the playback gain is adjusted, the difference between the second loudness and the reference loudness is 0, realizing the global unity of the audio loudness in the electronic device.
[0198] The application scenarios of the audio playback loudness control method provided by the embodiments of this application are illustrated by examples: When listening to voice messages through the earpiece of WeChat and suddenly receiving a WeChat video, or when receiving a phone call or a WeChat call while listening to music in the headphone mode, etc. In such scenarios, if the ringtone loudness of the phone call or WeChat call is relatively high, there will be a problem of ear-piercing. If this solution is used, the loudness can be lowered instantly when the ringtone comes to avoid discomfort for the user. That is, in the scenarios where the embodiments of this application are applied, after the user switches applications, when the electronic device recognizes a large change in the loudness of the audio collected by the microphone, it automatically adjusts the playback gain for the audio to achieve loudness balance that the user feels before and after the application switch, and improve the user's terminal usage experience.
[0199] Whether to enable the audio playback loudness control method provided by the embodiments themselves can be determined by the user. When the audio playback loudness control method is enabled, the electronic device can achieve global control of the audio loudness through the above steps S402 - S405.
[0200] Figure 9 It is a flowchart of a method for enabling audio playback loudness control provided by the embodiments of this application. As Figure 9 shown, in the embodiments of this application, after the electronic device is started, in response to the initially received audio playback request, a window 902 is popped up in the application interface 901 currently used by the user. The window 902 includes: a prompt message of "Whether to enable the global loudness retention function" and controls of "Yes" and "No".
[0201] In one example, in response to the user's click operation on the "Yes" control, the electronic device enables the audio playback loudness control method provided by the embodiments of this application to achieve global audio loudness control.
[0202] In another example, in response to the user's click operation on the "No" control, the electronic device does not enable the audio playback loudness control method provided by the embodiments of this application. If the user wants to enable the audio playback loudness control function later, the user can also manually enable the audio playback loudness control function on the settings page or other pages.
[0203] It can be understood that in order for the electronic device to implement the above functions, it includes the corresponding hardware and / or software modules for executing each function. Combining the algorithm steps of each example described in the embodiments disclosed in this article, this application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to exceed the scope of this application.
[0204] In the steps performed by an electronic device in the audio playback loudness control method provided in the embodiment of the present application above, the steps can also be performed by a chip system included in the electronic device. Among them, the chip system can include a processor and a Bluetooth chip. The chip system can be coupled to a memory, so that when the chip system runs, it calls the computer program stored in the memory to implement the steps performed by the above-mentioned electronic device. Among them, the processor in the chip system can be an application processor or a processor other than an application processor.
[0205] This embodiment also provides a computer-readable medium, in which computer instructions are stored. When the computer instructions run on an electronic device, the electronic device is enabled to perform the above-related method steps to implement the method in the above embodiment.
[0206] This embodiment also provides a computer program product. When the computer program product runs on a computer, the computer is enabled to perform the above-related steps to implement the method in the above embodiment.
[0207] In addition, the embodiment of the present application also provides a device, which can specifically be a chip, a component or a module. The device can include a processor and a memory connected to each other; among them, the memory is used to store computer execution instructions. When the device runs, the processor can execute the computer execution instructions stored in the memory, so that the chip performs the methods in the above-mentioned method embodiments.
[0208] Among them, the electronic device, computer-readable medium, computer program product or chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be elaborated here.
[0209] Through the description of the above embodiments, those skilled in the art can understand that for the convenience and conciseness of description, only the above division of each functional module is used as an example. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
[0210] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections between each other can be through some interfaces. The indirect couplings or communication connections of devices or units can be in electrical, mechanical or other forms.
[0211] The units described as separate components may or may not be physically separated. The components displayed as units can be one physical unit or multiple physical units, that is, they can be located in one place, or they can be distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0212] Any content of each embodiment of the present application, as well as any content of the same embodiment, can be freely combined. Any combination of the above content is within the scope of the present application. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiments of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. The software product is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods of each embodiment of the present application. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read only memory (ROM), random access memory (RAM), magnetic disks or optical discs and other various media that can store program codes.
[0213] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than limiting them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for controlling the loudness of audio playback, characterized in that: The method comprises: Determine a reference loudness based on a first loudness when the audio in the first application is played, where the first loudness refers to the loudness of feedback audio collected at a microphone when the audio in the first application is played; In the case of switching from the first application to the second application, determining a second loudness of audio playback in the second application, where the second loudness refers to the loudness of feedback audio collected at the microphone when the audio is played in the second application; Determine a difference between the second loudness and the reference loudness; wherein the reference loudness and the second loudness correspond to the same volume level; When a difference between the second loudness and the reference loudness exceeds a loudness threshold range, adjusting the playback gain for the audio in the second application based on the difference, the current volume level, and a gain adjustment reference curve between the first application and the second application, so that the second loudness is equal to the reference loudness after the playback gain adjustment; The gain adjustment reference curve between the first application and the second application is a relationship curve between the loudness change of the sound output by the speaker and the loudness change of the sound collected by the microphone when the first application switches to the second application at any of the volume levels; There are multiple gain adjustment reference curves between the first application and the second application, and one volume level corresponds to one gain adjustment reference curve.
2. The method according to claim 1, characterized in that: The determining of the reference loudness based on the first loudness of the audio played in the first application includes: When the user adjusts the volume level, the step of determining the reference loudness based on the first loudness of the audio played in the first application is re-executed to update the reference loudness.
3. The method according to claim 2, characterized in that The determining of the reference loudness based on the first loudness of the audio played in the first application includes: When the duration of the stable audio playback in the first application is greater than the duration threshold, the first loudness of the audio playback in the first application is determined as the reference loudness.
4. The method according to claim 1, characterized in that: The adjusting the playback gain for the audio in the second application based on the difference, the current volume level, and a gain adjustment reference curve between the first application and the second application includes: Based on the current volume level, determining a target curve from a gain adjustment reference curve between the first application and the second application; Determining a loudness value to be changed corresponding to the sound output by the speaker based on the fitting formula of the target curve and the difference; According to the loudness value to be changed, the playback gain for the audio in the second application is adjusted so that the second loudness is equal to the reference loudness after the playback gain is adjusted.
5. The method according to claim 1, characterized in that Before determining the reference loudness based on the first loudness of the audio played in the first application, the method further includes: Obtain target loudness information before and after switching between the first application and the second application at each volume level; For each of the volume levels, a gain adjustment reference curve between the first application and the second application is determined based on the target loudness information.
6. The method according to claim 5, characterized in that The obtaining of target loudness information before and after the switching between the first application and the second application at each volume level includes: When the first application requests to play audio, based on the current volume level, gain processing is performed on the first source audio to obtain a first processed audio; Driving the speaker to play the first processed audio; The microphone collects the first feedback audio in response to the speaker playing; After switching from the first application to the second application, when the second application requests to play audio, based on the current volume level, performing gain processing on the second source audio to obtain second processed audio; driving the speaker to play the second processed audio; The microphone collects the second feedback audio in response to the speaker playing.
7. The method according to claim 6, characterized in that The step of determining, for each of the volume levels, a gain adjustment reference curve between the first application and the second application based on the target loudness information comprises: For each of the volume levels, correlation processing is performed based on the difference between the loudness of the first feedback audio and the corresponding loudness of the second feedback audio, and the difference between the loudness of the first processed audio and the corresponding loudness of the second processed audio to obtain a gain adjustment reference curve between the first application and the second application.
8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: When the device plays audio for the first time after startup, a loudness maintenance prompt window is displayed; the loudness maintenance prompt window includes a control for enabling a global loudness maintenance function; In response to a user's operation of enabling the global loudness preservation function, the method according to any one of claims 1 to 7 is executed.
9. An electronic device, characterized in that: The electronic device comprises: one or more processors; Memory; And a computer program, wherein the computer program is stored in the memory, and when the computer program is executed by the one or more processors, the electronic device performs the method according to any one of claims 1 to 8.
10. A computer storage medium, characterized in that: The method comprises computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Audio playing method and mobile terminal
CN107277268A