CN117061949B - Earphone volume adjusting method and electronic equipment - Google Patents

Earphone volume adjusting method and electronic equipment Download PDF

Info

Publication number
CN117061949B
CN117061949B CN202311289316.2A CN202311289316A CN117061949B CN 117061949 B CN117061949 B CN 117061949B CN 202311289316 A CN202311289316 A CN 202311289316A CN 117061949 B CN117061949 B CN 117061949B
Authority
CN
China
Prior art keywords
earphone
impedance
audio
target
headphone
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311289316.2A
Other languages
Chinese (zh)
Other versions
CN117061949A (en
Inventor
苏俊峰
刘方超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202311289316.2A priority Critical patent/CN117061949B/en
Publication of CN117061949A publication Critical patent/CN117061949A/en
Application granted granted Critical
Publication of CN117061949B publication Critical patent/CN117061949B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R3/00Circuits for transducers, loudspeakers or microphones
    • H04R3/12Circuits for transducers, loudspeakers or microphones for distributing signals to two or more loudspeakers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R2430/00Signal processing covered by H04R, not provided for in its groups

Abstract

The application is applicable to the technical field of terminals and provides a method for adjusting volume of an earphone and electronic equipment, wherein the method comprises the following steps: acquiring a first impedance of a first earphone connected with an earphone interface of the electronic equipment; under the condition that the first impedance is larger than the target matching impedance, determining an expected value of a target parameter in the earphone playing link corresponding to the first impedance; the target matching impedance is the impedance of a reference earphone matched with the default output power of an audio module of the electronic device; the target parameters include a first parameter for controlling the headphone volume, a first headphone gain in the audio digital signal processor, and/or a second headphone gain in the audio codec; and adjusting the actual value of the target parameter to be an expected value so that the volume emitted by the first earphone when playing the audio is the same as the volume emitted by the reference earphone when playing the audio under the same multimedia volume, thereby improving the use experience when a user listens to the audio on the electronic equipment by adopting different earphones.

Description

Earphone volume adjusting method and electronic equipment
Technical Field
The application relates to the technical field of terminals, in particular to a method for adjusting volume of an earphone and electronic equipment.
Background
At present, the earphone has become an indispensable electronic accessory in people's daily life. With the continuous development of earphone technology, the variety of earphone is increasing. When a user listens to audio played by an audio device by adopting different headphones, the problem that the volume of the audio played by the different headphones is different under the condition that the multimedia volume of the electronic device such as a mobile phone is the same can be solved, so that the use experience of the user listening to the audio on the electronic device by adopting the different headphones is affected.
Disclosure of Invention
According to the earphone volume adjusting method and the electronic device, the volume of the audio heard by the earphone with higher impedance is consistent with the volume of the audio heard by the reference earphone under the same multimedia volume, so that the use experience of a user when listening to the audio on the electronic device by using different earphones is improved.
In a first aspect, an embodiment of the present application provides a method for adjusting the volume of an earphone, which is applied to an electronic device, where the method for adjusting the volume of the earphone includes:
acquiring a first impedance of a first earphone connected with an earphone interface of the electronic equipment;
determining an expected value of a target parameter in an earphone playing link corresponding to the first impedance under the condition that the first impedance is larger than a target matching impedance; the target matching impedance is the impedance of a reference earphone matched with the default output power of an audio module of the electronic equipment; the target parameters include a first parameter for controlling headphone volume, a first headphone gain in an audio digital signal processor, and/or a second headphone gain in an audio codec;
And adjusting the actual value of the target parameter to the expected value so that the volume emitted by the first earphone when playing the audio is the same as the volume emitted by the reference earphone when playing the audio under the same multimedia volume.
The first parameter for controlling the volume of the earphone may be a first parameter for controlling the volume of the earphone in an earphone sound effect processing algorithm. The headphone sound processing algorithm may refer to a headphone sound processing algorithm running in a headphone sound processing module in the application framework layer. The first parameters used to control the volume of the headphones in different headphone sound processing algorithms may be the same or different.
The default output power of the audio module may be the output power of the audio module defaulted when the electronic device leaves the factory.
The second headphone gain in the audio codec may comprise a digital gain in a digital codec or an analog gain in an analog codec; or a digital gain in a digital codec and an analog gain in an analog codec.
The expected value of the target parameter may be a value of the target parameter that enables the volume of the first earphone when playing audio to be the same as the volume of the reference earphone when playing audio at the same multimedia volume of the mobile phone.
Alternatively, the first impedance of the first earpiece may be obtained when the first earpiece is detected as being inserted in the earpiece interface.
Alternatively, the first impedance of the first earphone may be obtained after detecting that the earphone interface has the first earphone inserted.
Optionally, a headset plug detection (detect) pin may be provided on the headset interface. Based on the above, whether the first earphone is inserted into the earphone interface can be judged according to the voltage change on the earphone insertion detection pin.
For example, it may be determined that the earphone interface on the mobile phone has a first earphone insertion, that is, it is determined that an earphone insertion event occurs, when it is detected that the voltage on the earphone plug detection pin changes from a low level to a high level; or, the mobile phone may determine that the first earphone is pulled out from the earphone interface on the mobile phone, that is, determine that an earphone pulling event occurs, when it is detected that the voltage on the earphone plug detection pin changes from a high level to a low level.
For example, it may be determined that the earphone interface on the mobile phone has a first earphone insertion, that is, it is determined that an earphone insertion event occurs, when it is detected that the voltage on the earphone plug detection pin changes from a high level to a low level; or, the mobile phone may determine that the first earphone is pulled out from the earphone interface on the mobile phone, that is, determine that an earphone pulling event occurs, when it is detected that the voltage on the earphone plug detection pin changes from a low level to a high level.
According to the earphone volume adjusting method provided by the embodiment of the invention, under the condition that the first impedance of the first earphone inserted into the electronic equipment is recognized to be larger than the target matching impedance, the expected value of the target parameter in the earphone playing link corresponding to the first impedance is determined, and the actual value of the target parameter is adjusted to be the expected value of the target parameter corresponding to the first impedance.
In an optional implementation manner of the first aspect, expected values of target parameters in the headphone playing links corresponding to a plurality of preset impedances are stored in the electronic device in advance; correspondingly, the determining the expected value of the target parameter in the headphone playing link corresponding to the first impedance includes:
And under the condition that the first impedance is equal to a target preset impedance, determining the expected value of the target parameter in the earphone playing link corresponding to the target preset impedance as the expected value of the target parameter in the earphone playing link corresponding to the first impedance.
In an optional implementation manner of the first aspect, expected values of target parameters in the headphone playing links corresponding to a plurality of preset impedances are stored in the electronic device in advance; correspondingly, the determining the expected value of the target parameter in the headphone playing link corresponding to the first impedance includes:
and under the condition that the first impedance is not equal to all preset impedances, determining the expected value of the target parameter in the earphone playing link corresponding to the target preset impedance closest to the first impedance as the expected value of the target parameter in the earphone playing link corresponding to the first impedance.
In an optional implementation manner of the first aspect, the determining, as the expected value of the target parameter in the headphone playing link corresponding to the first impedance, the expected value of the target parameter in the headphone playing link corresponding to the target preset impedance closest to the first impedance includes:
And determining the expected value of the target parameter in the earphone playing link which is larger than the first impedance and corresponds to the target preset impedance closest to the first impedance as the expected value of the target parameter in the earphone playing link corresponding to the first impedance.
According to the earphone volume adjusting method provided by the embodiment of the invention, through pre-storing the expected values of the target parameters in the earphone playing links corresponding to the preset impedances respectively, the expected values of the target parameters corresponding to the first impedance can be determined by inquiring the pre-stored expected values of the target parameters in the earphone playing links corresponding to the preset impedances respectively under the condition that the first impedance of the first earphone is larger than the target matching impedance, so that the earphone volume adjusting efficiency can be improved.
In addition, under the condition that the first impedance is not equal to all preset impedances, the expected value of the target parameter corresponding to the target preset impedance which is larger than the first impedance and is closest to the first impedance is determined as the expected value of the target parameter corresponding to the first impedance, so that the volume of the first earphone when the audio is played by adopting the first earphone is not smaller than the volume of the reference earphone when the audio is played by adopting the same multimedia volume of the mobile phone.
In an optional implementation manner of the first aspect, expected values of target parameters in the headphone playing link corresponding to a plurality of impedance gear ranges are prestored in the electronic device; correspondingly, the determining the expected value of the target parameter in the headphone playing link corresponding to the first impedance includes:
determining a target impedance gear range in which the first impedance is located from a plurality of impedance gear ranges;
and determining the expected value of the target parameter in the earphone playing link corresponding to the target impedance gear range as the expected value of the target parameter in the earphone playing link corresponding to the first impedance.
According to the earphone volume adjusting method provided by the embodiment of the application, through pre-storing the expected values of the target parameters in the earphone playing links corresponding to the impedance gear ranges, the expected values of the target parameters corresponding to the first impedance can be determined by inquiring the pre-stored expected values of the target parameters in the earphone playing links corresponding to the impedance gear ranges when the first impedance of the first earphone is larger than the target matching impedance; moreover, as the impedance covered by the impedance gear range is wider, the electronic equipment can be adapted to different earphones, and the earphone adaptation capability of the electronic equipment is improved.
In an optional implementation manner of the first aspect, the obtaining a first impedance of a first earphone connected to the earphone interface includes:
and when the first earphone is inserted into the earphone interface, acquiring a first impedance of the first earphone.
In an optional implementation manner of the first aspect, the electronic device includes a multi-band hybrid driver, a driver of an audio codec, an audio management module, an earphone sound effect processing module, and a driver of an audio digital signal processor:
the obtaining the first impedance of the first earphone connected by the earphone interface includes:
when receiving an earphone insertion event reported by an earphone interface, the multi-band hybrid composite driver acquires first impedance of a first earphone connected with the earphone interface;
and determining an expected value of a target parameter in the headphone playing link corresponding to the first impedance under the condition that the first impedance is larger than a target matching impedance, wherein the method comprises the following steps:
the audio management module obtains the first impedance from the multi-band hybrid composite driver;
in the case that the first impedance is greater than the target matching impedance, the audio management module determines a desired value of the first parameter corresponding to the first impedance and a desired value of the first headphone gain;
The audio management module sends the expected value of the first parameter to the earphone sound effect processing module and sends the expected value of the first earphone gain to a driver of the audio digital signal processor;
in the case that the first impedance is greater than the target matching impedance, the multi-band hybrid driver determines a desired value of a second headphone gain in an audio codec corresponding to the first impedance, and transmits the desired value of the second headphone gain to a driver of the audio codec;
the adjusting the actual value of the target parameter to the expected value includes:
the earphone sound effect processing module adjusts the actual value of the first parameter in an earphone sound effect processing algorithm to be an expected value of the first parameter;
the driver of the audio digital signal processor adjusts the actual value of the first earphone gain in the audio digital signal processor to the expected value of the first earphone gain;
the driver of the audio codec adjusts an actual value of a second headphone gain in the audio codec to a desired value of the second headphone gain.
In a second aspect, an embodiment of the present application provides an electronic device, including: one or more processors; one or more memories; the one or more memories store one or more computer-executable programs comprising instructions that, when executed by the one or more processors, cause the electronic device to perform steps in the headset volume adjustment method as described in any implementation of the first aspect above.
In a third aspect, embodiments of the present application provide a computer-readable storage medium storing a computer-executable program which, when invoked by a computer, causes the computer to perform the steps of the earphone volume adjustment method according to any one of the implementation manners of the first aspect.
In a fourth aspect, embodiments of the present application provide a computer-executable program product which, when run on an electronic device, causes the electronic device to perform the steps of the earphone volume adjustment method according to any implementation manner of the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip system, including a processor, where the processor is coupled to a memory, and the processor executes a computer executable program stored in the memory, to implement each step in the method for adjusting the volume of an earphone according to any implementation manner of the first aspect. The chip system can be a single chip or a chip module composed of a plurality of chips.
It will be appreciated that the advantages of the second to fifth aspects may be found in the relevant description of the first aspect, and are not described here again.
Drawings
Fig. 1 is a schematic structural diagram of an earphone;
fig. 2 is a schematic structural diagram of a mobile phone according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an audio module in an electronic device according to an embodiment of the present application;
fig. 4 is a schematic software architecture of an electronic device according to an embodiment of the present application;
fig. 5 is a schematic flowchart of a method for adjusting volume of an earphone according to an embodiment of the present application;
fig. 6 is a schematic diagram of an interaction process between each module in an implementation process of an earphone volume adjustment method according to an embodiment of the present application;
fig. 7 is a timing chart of a method for adjusting volume of an earphone according to an embodiment of the present application.
Detailed Description
It should be noted that the terms used in the implementation section of the embodiments of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application. In the description of the embodiments of the present application, unless otherwise indicated, "/" means or, for example, a/B may represent a or B; "and/or" herein is merely an association relationship describing a relationship, meaning that there may be three relationships, e.g., a and/or B, may mean: a exists alone, A and B exist together, and B exists alone. In addition, in the description of the embodiments of the present application, unless otherwise indicated, "a plurality" means two or more, and "at least one", "one or more" means one, two or more.
The terms "first" and "second" are used below for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a definition of "a first", "a second" feature may explicitly or implicitly include one or more of such features.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
At present, the earphone has become an indispensable electronic accessory in people's daily life. In many scenarios, such as in noisy subways, or in quiet libraries, etc., one may connect headphones with an audio device (e.g., a cell phone) through which one listens for audio played by the audio device. With the continuous development of earphone technology, the variety of earphone is increasing. When users listen to audio played by an audio device using different headphones, the problem that the volume of the audio played by the different headphones is different under the condition that the multimedia volume of the mobile phone is the same may be encountered, which is generally caused by different impedances of the different headphones.
The impedance of the earphone is an important parameter affecting the performance of the earphone. The impedance of a headset generally refers to the electrical impedance of the drive unit portion of the headset, which may be used to describe the resistance experienced by an electrical current flowing through the drive unit of the headset. For example, please refer to fig. 1, which is a schematic structural diagram of an earphone. As shown in fig. 1, the earphone may include an earphone plug 11, a cable 12, and a driving unit 13 and a driving unit 14 connected to the earphone plug 11 through the cable 12. The driving unit of the earphone is typically provided with a voice coil located in a magnetic field gap (which may also be referred to as an air gap) and a diaphragm (not shown) connected to the voice coil. When the earphone receives an analog audio signal, it is equivalent to receiving a current that varies like sound waves. When the current flows through the voice coil, ampere force is generated under the action of the magnetic field, and the ampere force is exactly perpendicular to the vibrating diaphragm, so that the vibrating diaphragm is driven to vibrate, sound is generated, and output of an audio signal is achieved. The electrical impedance of the drive unit portion is typically related to a voice coil parameter (e.g., the number of voice coil turns). Different headphones may have different impedances and thus different performance due to different voice coil parameters.
In general, the greater the impedance of the earphone, the better the sound quality of the earphone. But the larger the impedance of the earphone, the lower the sensitivity of the earphone, and the larger the required driving power, i.e. the less easily the earphone is driven. That is, the larger the impedance of the earphone is, the smaller the volume of the earphone is at the same driving power. For example, when two headphones with different impedances are connected to the same mobile phone in sequence, the driving power provided by the mobile phone to the two headphones is unchanged without adjusting the multimedia volume of the mobile phone, and in this case, the volume of the headphones with larger impedance is smaller than that of the headphones with smaller impedance.
At present, with the continuous development of terminal technology, the requirements of users on the cruising ability of terminal equipment are higher and higher. In order to improve the cruising ability of a mobile phone, manufacturers of terminal devices such as the mobile phone generally set the output power of an earphone circuit in the mobile phone to be relatively low, so that the thrust of the mobile phone to the earphone is relatively small, and therefore, when a user plays audio by using the earphone with high impedance, the sound heard by the user is smaller than that when the user plays audio by using the earphone with low impedance, and the use experience of the user is affected.
In view of this, the embodiments of the present application provide a method for adjusting the volume of an earphone and an electronic device, where when it is identified that a first impedance of a first earphone inserted into the electronic device is greater than a target matching impedance, an expected value of a target parameter in an earphone playing link corresponding to the first impedance is determined, and an actual value of the target parameter is adjusted to an expected value of the target parameter corresponding to the first impedance.
An execution body of the earphone volume adjustment method provided by the embodiment of the application may be an electronic device, where the electronic device may include a dynamic expert group audio layer 3 (moving picture experts group audio layer-3, mp 3), a dynamic expert group audio layer 4 (moving picture experts group audio layer-4, mp 4), a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (augmented reality, AR)/Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), an internet surfing book, a personal digital assistant (personal digital assistant, PDA), and the like, and the embodiment of the application does not limit specific types of the electronic device.
The structure of the electronic device provided in the embodiment of the present application will be described below by taking the electronic device as an example of a mobile phone.
Fig. 2 is a schematic structural diagram of a mobile phone according to an embodiment of the present application. As shown in fig. 2, the mobile phone 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge 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, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identity module (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 sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It should be understood that the structure illustrated in fig. 2 is not limited to the specific configuration of the mobile phone 100. In other embodiments of the present application, the handset 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a video codec, a digital signal processor (digital signal processor, DSP), a controller, and the like. The different processing units may be separate devices or may be integrated in one or more processors.
The DSP may include an Audio Digital Signal Processor (ADSP), among others. Hardware and instruction sets for audio processing may be included in the ADSP to efficiently perform operations related to audio processing.
By way of example, ADSP may be used to perform mixing, resampling, gain adjustment, filtering, etc. functions on an audio signal.
Wherein the mixing function may be used to mix a plurality of audio signals and output through one output channel.
The resampling function may be used to adapt to different audio signal processing or output requirements by changing the sampling rate of the audio signal.
The gain adjustment function may be used to adjust the volume of the earphone output audio signal by adjusting the amplitude of the audio signal.
The filtering function may be used to attenuate or emphasize certain frequency components in the audio signal to achieve adjustment of the earphone output sound effects.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a general-purpose input/output (GPIO) interface, and/or a USB interface, among others.
The I2S interface may be used for audio communication. In some embodiments, the processor 110 may contain multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through the I2S interface, to implement a function of answering a call through the bluetooth headset.
PCM interfaces may also be used for audio communication to sample, quantize and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface to implement a function of answering a call through the bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
In some embodiments, the audio module 170 may also transmit an audio signal to the wireless communication module 160 through a UART interface, so as to implement a function of playing music through a bluetooth headset.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal or as a data signal. In some embodiments, GPIO interfaces may be used to connect processor 110, wireless communication module 160, audio module 170, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, an MIPI interface, etc.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect to a charger to charge the mobile phone 100, or may be used to transfer data between the mobile phone 100 and a peripheral device. And can also be used for connecting with a headset, and playing audio through the headset.
It should be understood that the connection relationship between the modules illustrated in the embodiments of the present application is only illustrative, and is not limited to the structure of the mobile phone 100. In other embodiments of the present application, the mobile phone 100 may also use different interfacing manners, or a combination of multiple interfacing manners in the foregoing embodiments.
The handset 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals.
Illustratively, as shown in FIG. 3, the audio module 170 may include a digital codec (digital codec), an analog codec (analog codec), an audio analog-to-digital converter (ADC), and the like.
Wherein the digital codec may be connected to an ADSP, the analog codec may be connected to an earphone interface, and the ADC may be connected between the digital codec and the analog codec.
Illustratively, the digital codec may be used to process digital audio signals.
The ADC may be used to convert an analog audio signal to a digital audio signal or may be used to convert a digital audio signal to an analog audio signal.
Analog codec may be used to process analog audio signals.
The digital codec may be used to perform operations such as encoding processing and/or signal amplifying processing on a digital audio signal to be output by the mobile phone, and send the processed digital audio signal to the ADC; the ADC may be used to convert the received digital audio signal to an analog audio signal and send the analog audio signal to an analog codec; the analog codec may be used to perform operations such as encoding processing and/or signal amplifying processing on a received analog audio signal, and output the processed analog audio signal through an earphone interface, so as to implement output of the audio signal.
The analog codec may also be used to decode analog audio signals received through the earphone interface and send the processed analog audio signals to the ADC; the ADC may be configured to convert the received analog audio signal into a digital audio signal and transmit the digital audio signal to the digital codec; the digital codec may be used to decode the received digital audio signal and send the processed digital audio signal to the ADSP to enable reception of the audio signal.
In other embodiments, an earphone impedance detection circuit may be provided in the ADC.
By way of example, the earphone impedance detection circuit may include a current source, a current sensor, a voltage sensor, and the like.
The current source can be used for outputting a current signal to an earphone connected with the mobile phone through an earphone interface of the mobile phone.
The current sensor may be used to detect a current value of a current signal flowing through the earphone.
The voltage sensor may be used to detect a voltage value of the earphone interface.
Based on this, the impedance of the earphone connected to the mobile phone can be obtained by calculating the ratio of the voltage value detected by the voltage sensor to the current value detected by the current sensor.
In some embodiments, the audio module 170 may be disposed in the processor 110, or a portion of the functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. The handset 100 may listen to music, or to hands-free calls, through the speaker 170A.
A receiver 170B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. When the handset 100 is answering a telephone call or voice message, the voice can be received by placing the receiver 170B close to the human ear.
Microphone 170C, also referred to as a "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can sound near the microphone 170C through the mouth, inputting a sound signal to the microphone 170C. The handset 100 may be provided with at least one microphone 170C.
The earphone interface 170D is used to connect a wired earphone. The headset interface 170D may be a USB interface 130 or a 3.5mm open mobile electronic device platform (open mobile terminal platform, OMTP) standard interface, a american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The software system of the mobile phone 100 may employ a layered architecture, an event driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. In this embodiment, taking an Android system with a layered architecture as an example, a software structure of the mobile phone 100 is illustrated.
Fig. 4 is a schematic diagram of a software architecture of a mobile phone according to an embodiment of the present application. As shown in fig. 4, the layered architecture divides the software into several layers, each with a clear role and division of work. The layers communicate with each other through a software interface.
In some embodiments, the Android system may be divided into five layers, from top to bottom, an application layer (applications), an application framework layer (application framework), a system layer, a hardware abstraction layer (hardware abstraction layer, HAL), and a kernel layer (kernel), respectively.
The application layer may include a series of application packages, among other things.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions.
By way of example, the application framework layer may include an event broadcast module, an audio management module, and a headphone sound processing module.
The event broadcasting module may be configured to notify the audio management module to switch the audio playing link after receiving an earphone insertion event sent by the earphone interface.
The audio management module may be configured to notify the headphone event notification module to switch the audio playback link from the speaker playback link to the headphone playback link after receiving the audio playback link switch notification.
In addition, the audio management module may be further configured to notify the earphone information acquisition module in the hardware abstraction layer to acquire a first impedance of a first earphone connected to the earphone interface from a multi-key earphone control module (multi-button headset control, MBHC) in the kernel layer.
In addition, the audio management module may be further configured to invoke a parameter acquisition interface (getparamter interface) to acquire a first impedance of the first earphone from the earphone information acquisition module, and compare the first impedance with a target matching impedance.
Optionally, in the case that the first impedance is greater than the target matching impedance, the audio management module may be configured to determine an expected value of a first parameter for controlling the volume of the earphone in the earphone sound effect processing algorithm corresponding to the first impedance and an expected value of a first earphone gain in the ADSP, and control the earphone sound effect processing module to adjust an actual value of the first parameter for controlling the volume of the earphone in the earphone sound effect processing algorithm to the expected value. Meanwhile, the audio management module may be further configured to send the expected value of the first earpiece gain in the ADSP corresponding to the first impedance to the earpiece event notification module in the hardware abstraction layer.
And an earphone sound effect processing method can be operated in the earphone sound effect processing module. The headphone sound processing algorithm may be used to adjust the sound effects of the headphone output audio signals, for example, may be used to adjust the volume of the headphone output audio signals.
The earphone sound processing algorithm may include, for example, dolby (dolby) sound algorithm, digital theater system (digital theater system, DTS) sound algorithm, advanced audio coding (advanced audio codec, AAC) sound algorithm, and so on. The embodiment of the application does not particularly limit the type of the earphone sound effect algorithm running in the earphone sound effect processing module.
The earphone sound effect processing module may be configured to adjust an actual value of a first parameter for controlling the earphone volume in the earphone sound effect processing algorithm to an expected value of the first parameter corresponding to the first impedance after receiving the parameter adjustment notification of the audio management module.
The system layer may include a system library and Android runtime (Android run time).
The system library may include a plurality of functional modules.
Android run times may include core libraries and virtual machines. Android run time is responsible for scheduling and management of the Android system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer may run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The hardware abstraction layer is an interface layer between the kernel layer and the hardware circuitry, which aims at abstracting the hardware.
The hardware abstraction layer may include a headset information acquisition module and a headset event notification module.
The earphone information obtaining module may be configured to obtain, after receiving the impedance obtaining notification, a first impedance of the first earphone from the MBHC in the kernel layer by adopting a mode of obtaining the kernel node information.
The earphone event notification module may be configured to, when receiving the expected value of the first earphone gain in the ADSP corresponding to the first impedance sent by the audio management module, send the expected value of the first earphone gain in the ADSP corresponding to the first impedance to an ADSP driver in the kernel layer by calling the ADSP interface, so that the ADSP driver adjusts the actual value of the first earphone gain in the ADSP to the expected value.
The kernel layer is a layer between hardware and software. The kernel layer may contain display drivers, camera drivers, audio drivers, sensor drivers, MBHC, digital codec drivers, analog codec drivers, and ADSP drivers.
The MBHC may be configured to report the headphone jack event to an event broadcast module of the application framework layer after receiving the headphone jack event reported by the headphone jack.
In addition, the MBHC may be further configured to notify the earphone impedance detection circuit in the audio ADC module to detect the first impedance of the first earphone after receiving the earphone insertion event reported by the earphone interface, and store the detected first impedance of the first earphone for use in a subsequent earphone volume adjustment process.
For example, the MBHC may compare the first impedance to the target matching impedance after obtaining the first impedance of the first earpiece. In the case where the first impedance is greater than the target matching impedance, the MBHC may determine an expected value of a digital gain in the digital codec and an expected value of an analog gain in the analog codec corresponding to the first impedance, and control the digital codec driver to adjust an actual value of the digital gain in the digital codec to the corresponding expected value, and control the analog codec driver to adjust an actual value of the analog gain in the analog codec to the corresponding expected value.
The ADSP driver may be configured to adjust an actual value of the first headphone gain in the ADSP to a desired value of the first headphone gain corresponding to the first impedance upon invocation of the headphone event notification module.
The following describes in detail the earphone volume adjustment method provided in the embodiment of the present application, taking an execution body of the earphone volume adjustment method as an example of a mobile phone. Referring to fig. 5, a schematic flowchart of a method for adjusting volume of an earphone according to an embodiment of the present application is provided. As shown in fig. 5, the method for adjusting the volume of the earphone may include S51 to S53, which are described in detail as follows:
s51, acquiring first impedance of a first earphone connected with an earphone interface of the electronic equipment.
In some embodiments, where the USB interface and the earphone interface of the mobile phone are two independent interfaces, the earphone interface may refer to an earphone interface on the mobile phone, for example, a conventional 3.5mm earphone interface or a 6.3mm earphone interface.
In other embodiments, the above-mentioned earphone interface may refer to a USB interface on a mobile phone in a case where the USB interface of the mobile phone is shared with the earphone interface, that is, in a case where the USB interface of the mobile phone is used as the earphone interface at the same time.
The first earphone connected to the earphone interface may refer to any earphone inserted into the mobile phone through the earphone interface or the USB interface on the mobile phone, that is, the "first earphone" herein does not refer to a certain earphone.
Optionally, the mobile phone may acquire the first impedance of the first earphone when detecting that the earphone interface has the first earphone inserted.
Optionally, the mobile phone may obtain the first impedance of the first earphone after detecting that the earphone interface has the first earphone inserted.
In one particular implementation, a headset plug detect (detect) pin may be provided on the headset interface. Based on the above, the mobile phone can judge whether the first earphone is inserted into the earphone interface according to the voltage change on the earphone plug detection pin.
In one possible implementation manner, the mobile phone may determine that the earphone interface on the mobile phone has a first earphone insertion, that is, determine that an earphone insertion event occurs, when detecting that the voltage on the earphone plug detection pin changes from a low level to a high level; or, the mobile phone may determine that the first earphone is pulled out from the earphone interface on the mobile phone, that is, determine that an earphone pulling event occurs, when it is detected that the voltage on the earphone plug detection pin changes from a high level to a low level.
In another possible implementation manner, the mobile phone may determine that the earphone interface on the mobile phone has a first earphone insertion, that is, determine that an earphone insertion event occurs, when detecting that the voltage on the earphone plug detection pin changes from a high level to a low level; or, the mobile phone may determine that the first earphone is pulled out from the earphone interface on the mobile phone, that is, determine that an earphone pulling event occurs, when it is detected that the voltage on the earphone plug detection pin changes from a low level to a high level.
In a specific implementation, the handset may obtain the first impedance of the first earpiece connected by the earpiece interface through an earpiece impedance detection circuit in the ADC. It should be noted that, the specific process of obtaining the first impedance of the first earphone may refer to the related description in the embodiment corresponding to fig. 3, which is not described herein.
In some embodiments, after the mobile phone obtains the first impedance of the first earphone connected to the earphone interface, the first impedance may be stored for use in a subsequent volume adjustment process.
In other embodiments, after the handset obtains the first impedance of the first earphone, the first impedance may be compared with the target matching impedance. The target matching impedance may be an impedance of a reference earphone that matches a default output power of the audio module. The default output power of the audio module may be the output power of the audio module defaulted when the mobile phone leaves the factory.
Optionally, the mobile phone may execute S52 to S53 when the first impedance of the first earphone is greater than the target matching impedance.
Optionally, when the first impedance of the first earphone is less than or equal to the target matching impedance, the mobile phone may not perform the subsequent volume adjustment step, that is, S52 to S53.
S52, determining an expected value of a target parameter in the earphone playing link corresponding to the first impedance under the condition that the first impedance is larger than the target matching impedance.
The target parameter may include one or more of a first parameter in a headphone sound processing algorithm for controlling headphone volume, a first headphone gain in an audio digital signal processor, and a second headphone gain in an audio codec.
By way of example, the headphone sound processing algorithms may refer to headphone sound processing algorithms running in headphone sound processing modules in the application framework layer. It will be appreciated that the first parameters used to control the volume of the headphones in different headphone sound processing algorithms may be the same or different. Therefore, the specific type of the first parameter is not particularly limited in the embodiments of the present application, and the specific type of the first parameter may be determined according to an earphone sound effect processing algorithm actually executed in the earphone sound effect processing module. For example, assuming that the headphone sound effect processing algorithm comprises a dolby sound effect algorithm, the first parameter may comprise a headphone gain in the dolby sound effect algorithm.
Illustratively, the second headphone gain in the audio codec may comprise a digital gain in a digital codec or an analog gain in an analog codec; or a digital gain in a digital codec and an analog gain in an analog codec.
In an optional implementation manner, expected values of target parameters in the earphone playing link corresponding to a plurality of different preset impedances can be stored in the mobile phone in advance. The preset impedance may be greater than the target matching impedance.
In a specific application, the expected value of the target parameter in the headphone playing link corresponding to each preset impedance may be obtained through a test. By way of example and not limitation, the above-described test procedure may include the steps of:
and inserting a reference earphone into the mobile phone, and measuring the volume of the reference earphone when the reference earphone plays the audio under a certain multimedia volume. And respectively inserting a plurality of test headsets with impedance larger than the target matching impedance into the mobile phone, and under the condition of keeping the multimedia volume of the mobile phone unchanged, adjusting the values of all target parameters to enable the volume of each test headset to be the same as the volume of the reference headset when the audio is played. And recording the value of each target parameter which is the same as the volume of the audio played by the reference earphone and is sent by each test earphone, and taking the value as the expected value of the target parameter corresponding to each impedance.
Based on this, the expected value of the target parameter may be a value of the target parameter that enables the volume of the first earphone when playing audio to be the same as the volume of the reference earphone when playing audio at the same multimedia volume of the mobile phone.
In this implementation manner, optionally, when the first impedance is equal to a target preset impedance in the plurality of preset impedances, the mobile phone may determine an expected value of the target parameter in the headphone playing link corresponding to the target preset impedance as the expected value of the target parameter in the headphone playing link corresponding to the first impedance.
Optionally, when the first impedance is not equal to all preset impedances, the mobile phone may determine a target preset impedance closest to the first impedance from the plurality of preset impedances, and determine an expected value of a target parameter in the headphone playing link corresponding to the target preset impedance closest to the first impedance as an expected value of the target parameter in the headphone playing link corresponding to the first impedance. The target preset impedance closest to the first impedance may refer to a preset impedance having a minimum difference from the first impedance.
For example, assuming that the first impedance is 120 ohms, the preset impedance includes 100 ohms, 150 ohms, 180 ohms, 200 ohms, 250 ohms, and the like, the mobile phone may determine the expected value of the target parameter in the headphone playing link corresponding to 100 ohms as the expected value of the target parameter in the headphone playing link corresponding to the first impedance.
It may be appreciated that, because the target preset impedance closest to the first impedance may be greater than the first impedance or may be less than the first impedance, in order to ensure that the volume of the first earphone playing audio is not smaller than the volume of the reference earphone playing audio at the same multimedia volume of the mobile phone, in other embodiments, the mobile phone may determine the expected value of the target parameter in the earphone playing link corresponding to the first impedance as the expected value of the target parameter in the earphone playing link corresponding to the first impedance, where the target preset impedance closest to the first impedance is greater than the first impedance.
For example, assuming that the first impedance is 120 ohms, the preset impedance includes 100 ohms, 150 ohms, 180 ohms, 200 ohms, 250 ohms, and the like, the mobile phone may determine the expected value of the target parameter in the headphone playing link corresponding to 150 ohms as the expected value of the target parameter in the headphone playing link corresponding to the first impedance.
In this implementation manner, by storing in advance expected values of target parameters in the headphone playing links corresponding to the preset impedances, when the first impedance of the first headphone is greater than the target matching impedance, the expected values of the target parameters in the headphone playing links corresponding to the preset impedances can be determined by querying the prestored expected values of the target parameters in the headphone playing links corresponding to the preset impedances, so that the headphone volume adjusting efficiency can be improved.
In addition, under the condition that the first impedance is not equal to all preset impedances, the expected value of the target parameter corresponding to the target preset impedance which is larger than the first impedance and is closest to the first impedance is determined as the expected value of the target parameter corresponding to the first impedance, so that the volume of the first earphone when the audio is played by adopting the first earphone is not smaller than the volume of the reference earphone when the audio is played by adopting the same multimedia volume of the mobile phone.
In another optional implementation manner, the mobile phone may store expected values of target parameters in the headphone playing link corresponding to a plurality of different impedance gear ranges in advance. The impedance covered by each impedance gear range is larger than the target matching impedance. By way of example, assuming a target matching impedance of 32 ohms, a plurality of different impedance gear ranges may include: 100-150 ohms, 150-200 ohms, 200-300 ohms, 300-450 ohms, etc.
The expected value of the target parameter in the earphone playing link corresponding to each impedance gear range can be obtained through experiments. Specific test procedures may be referred to the relevant descriptions in the foregoing embodiments, and will not be described herein.
Based on the above, after the mobile phone obtains the first impedance of the first earphone, a target impedance gear range where the first impedance is located can be determined from a plurality of impedance gear ranges, and an expected value of a target parameter in the earphone playing link corresponding to the target impedance gear range is determined as an expected value of the target parameter in the earphone playing link corresponding to the first impedance.
For example, assuming that the first impedance is 180 ohms, the mobile phone may determine an expected value of the target parameter in the headphone playing link corresponding to the impedance range of 150 ohms to 200 ohms as the expected value of the target parameter in the headphone playing link corresponding to the first impedance.
In this implementation manner, through pre-storing the expected values of the target parameters in the earphone playing links corresponding to the multiple impedance gear ranges, the expected values of the target parameters corresponding to the first impedance can be determined by querying the pre-stored expected values of the target parameters in the earphone playing links corresponding to the respective impedance gear ranges when the first impedance of the first earphone is greater than the target matching impedance; moreover, as the impedance covered by the impedance gear range is wider, the electronic equipment can be adapted to different earphones, and the earphone adaptation capability of the electronic equipment is improved.
And S53, adjusting the actual value of the target parameter to be an expected value so that the volume emitted by the first earphone when playing the audio is the same as the volume emitted by the reference earphone when playing the audio under the same multimedia volume.
Because the expected value of the target parameter in the earphone playing link corresponding to the first impedance is the value of the target parameter which can enable the volume size sent out by the first earphone to be the same as the volume size sent out by the reference earphone when the first earphone plays the audio under the same mobile phone multimedia volume, the actual value of the target parameter is adjusted to the expected value of the target parameter corresponding to the first impedance, so that the volume size sent out by the first earphone when the first earphone plays the audio is the same as the volume size sent out by the reference earphone when the first earphone plays the audio under the same mobile phone multimedia volume.
As can be seen from the foregoing, in the method for adjusting the volume of the earphone according to the embodiment of the present application, when it is identified that the first impedance of the first earphone inserted into the electronic device is greater than the target matching impedance, the expected value of the target parameter in the earphone playing link corresponding to the first impedance is determined, and the actual value of the target parameter is adjusted to the expected value of the target parameter corresponding to the first impedance.
The following further describes the earphone volume adjusting method provided in the embodiment of the present application in combination with a software and hardware structure of the mobile phone.
Referring to fig. 6, a schematic diagram of an interaction process between each software module and each hardware module in an implementation process of the method for adjusting volume of an earphone according to an embodiment of the present application is shown. As shown in fig. 6, the mobile phone may include a headset interface, an analog codec, an audio ADC, a digital codec, ADSP, MBHC, a digital codec driver, an analog codec driver, an ADSP driver, a headset information acquisition module, a headset event notification module, an event broadcast module, an audio management module, and a headset sound effect processing module.
The earphone interface, the analog codec, the audio ADC and the digital codec can be located in a hardware layer of the mobile phone.
The MBHC, digital codec drivers, analog codec drivers, and ADSP drivers may be located at the kernel layer of the software architecture of the handset.
The earphone information acquisition module and the earphone event notification module may be located at a hardware abstraction layer of a software architecture of the mobile phone.
The event broadcasting module, the audio management module and the earphone sound effect processing module can be located in an application program framework layer of a software architecture of the mobile phone.
In combination with the timing chart of the earphone volume adjustment method shown in fig. 7, when the earphone interface of the mobile phone has the first earphone plug-in, the earphone interface recognizes the earphone plug-in event and reports the earphone plug-in event to the MBHC of the kernel layer. The MBHC of the kernel layer will report the headphone jack event to the event broadcast module of the application framework layer. In addition, the MBHC informs the earphone impedance detection circuit in the audio ADC module to detect the first impedance of the first earphone, and stores the detected first impedance of the first earphone in the MBHC for use in a subsequent earphone volume adjustment process.
After the event broadcasting module acquires the earphone insertion event, the audio management module can be informed to switch the audio playing link. After receiving the audio playing link switching notification, the audio management module can notify the earphone event notification module to switch the audio playing link from the speaker playing link to the earphone playing link.
Further, the audio management module may inform the earpiece information acquisition module to acquire the first impedance of the first earpiece from the MBHC. The earphone information obtaining module may obtain the first impedance of the first earphone from the MBHC by obtaining the kernel node information. After the earphone information obtaining module obtains the first impedance of the first earphone, the audio management module may call a parameter obtaining interface (getparamter interface) to obtain the first impedance of the first earphone from the earphone information obtaining module, and compare the first impedance with the target matching impedance. When the first impedance is greater than the target matching impedance, the audio management module may determine an expected value of a first parameter for controlling the volume of the earphone in the earphone sound effect processing algorithm corresponding to the first impedance and an expected value of a first earphone gain in the ADSP, and control the earphone sound effect processing module to adjust an actual value of the first parameter for controlling the volume of the earphone in the earphone sound effect processing algorithm to the expected value. Meanwhile, the audio management module may also transmit the expected value of the first headphone gain in the ADSP corresponding to the first impedance to the headphone event notification module. The headphone event notification module may send an expected value of the first headphone gain in the ADSP corresponding to the first impedance to the ADSP driver by invoking the ADSP interface, so that the ADSP driver adjusts the actual value of the first headphone gain in the ADSP to the expected value.
In addition, after the MBHC obtains the first impedance of the first earphone, the first impedance may also be compared with the target matching impedance. In the case where the first impedance is greater than the target matching impedance, the MBHC may determine an expected value of a digital gain in the digital codec and an expected value of an analog gain in the analog codec corresponding to the first impedance, and control the digital codec driver to adjust an actual value of the digital gain in the digital codec to the corresponding expected value, and control the analog codec driver to adjust an actual value of the analog gain in the analog codec to the corresponding expected value. Thus, the automatic adjustment of the volume of the first earphone is completed.
Based on the same technical concept, the embodiment of the application also provides an electronic device, which may include: one or more processors; one or more memories; the one or more memories store one or more computer programs comprising instructions that, when executed by the one or more processors, cause the electronic device to perform one or more steps of any of the method embodiments described above.
Based on the same technical idea, the embodiments of the present application further provide a computer-readable storage medium storing a computer-executable program, which when called by a computer, causes the computer to perform one or more steps of any of the method embodiments described above.
Based on the same technical concept, the embodiments of the present application further provide a chip system, including a processor, where the processor is coupled to a memory, and the processor executes a computer executable program stored in the memory, so as to implement one or more steps of any of the method embodiments described above. The chip system can be a single chip or a chip module composed of a plurality of chips.
Based on the same technical idea, the embodiments of the present application further provide a computer executable program product, which when run on an electronic device, causes the electronic device to perform one or more steps of any of the method embodiments described above.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference may be made to related descriptions of other embodiments. It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic of each process, and should not limit the implementation process of the embodiment of the present application in any way.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted across a computer-readable storage medium. The computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital subscriber line), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a Solid State Disk (SSD)), or the like.
Those of ordinary skill in the art will appreciate that implementing all or part of the above-described method embodiments may be accomplished by a computer program to instruct related hardware, the program may be stored in a computer readable storage medium, and the program may include the above-described method embodiments when executed. And the aforementioned storage medium includes: ROM or random access memory RAM, magnetic or optical disk, etc.
The foregoing is merely a specific implementation of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the embodiments of the present application should be covered by the protection scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application shall be subject to the protection scope of the claims.

Claims (6)

1. A method for adjusting the volume of an earphone, which is applied to an electronic device, the method comprising:
acquiring a first impedance of a first earphone connected with an earphone interface of the electronic equipment;
determining an expected value of a target parameter in an earphone playing link corresponding to the first impedance under the condition that the first impedance is larger than a target matching impedance; the target matching impedance is the impedance of a reference earphone matched with the default output power of an audio module of the electronic equipment; the target parameters comprise a first parameter used for controlling the earphone volume in an earphone sound effect processing algorithm, a first earphone gain in an audio digital signal processor and a second earphone gain in an audio coder; the earphone sound effect processing algorithm is an earphone sound effect processing algorithm running in an earphone sound effect processing module of the application program framework layer;
The actual value of the target parameter is adjusted to the expected value, so that the volume sent by the first earphone when playing the audio is the same as the volume sent by the reference earphone when playing the audio under the same multimedia volume;
the electronic equipment is pre-stored with expected values of target parameters in the earphone playing links corresponding to a plurality of preset impedances respectively; correspondingly, the determining the expected value of the target parameter in the headphone playing link corresponding to the first impedance includes:
under the condition that the first impedance is not equal to all preset impedances, determining an expected value of a target parameter in an earphone playing link which is larger than the first impedance and corresponds to the target preset impedance closest to the first impedance as the expected value of the target parameter in the earphone playing link corresponding to the first impedance;
the electronic device comprises a multi-band hybrid composite driver, a driver of an audio codec, an audio management module, an earphone sound effect processing module and a driver of an audio digital signal processor:
the obtaining the first impedance of the first earphone connected by the earphone interface includes:
when receiving an earphone insertion event reported by an earphone interface, the multi-band hybrid composite driver acquires first impedance of a first earphone connected with the earphone interface;
And determining an expected value of a target parameter in the headphone playing link corresponding to the first impedance under the condition that the first impedance is larger than a target matching impedance, wherein the method comprises the following steps:
the audio management module obtains the first impedance from the multi-band hybrid composite driver;
in the case that the first impedance is greater than the target matching impedance, the audio management module determines a desired value of the first parameter corresponding to the first impedance and a desired value of the first headphone gain;
the audio management module sends the expected value of the first parameter to the earphone sound effect processing module and sends the expected value of the first earphone gain to a driver of the audio digital signal processor;
in the case that the first impedance is greater than the target matching impedance, the multi-band hybrid driver determines a desired value of a second headphone gain in an audio codec corresponding to the first impedance, and transmits the desired value of the second headphone gain to a driver of the audio codec;
the adjusting the actual value of the target parameter to the expected value includes:
the earphone sound effect processing module adjusts the actual value of the first parameter in an earphone sound effect processing algorithm to be an expected value of the first parameter;
The driver of the audio digital signal processor adjusts the actual value of the first earphone gain in the audio digital signal processor to the expected value of the first earphone gain;
the driver of the audio codec adjusts an actual value of a second headphone gain in the audio codec to a desired value of the second headphone gain.
2. The method for adjusting the volume of an earphone according to claim 1, wherein expected values of target parameters in a playing link of the earphone corresponding to a plurality of preset impedances are stored in the electronic device in advance; correspondingly, the determining the expected value of the target parameter in the headphone playing link corresponding to the first impedance includes:
and under the condition that the first impedance is equal to a target preset impedance, determining the expected value of the target parameter in the earphone playing link corresponding to the target preset impedance as the expected value of the target parameter in the earphone playing link corresponding to the first impedance.
3. The method of claim 1, wherein obtaining the first impedance of the first earphone connected to the earphone interface comprises:
and when the first earphone is inserted into the earphone interface, acquiring a first impedance of the first earphone.
4. An electronic device, comprising:
one or more processors;
one or more memories;
the one or more memories store one or more computer-executable programs comprising instructions that, when executed by the one or more processors, cause the electronic device to perform the steps in the headphone volume adjustment method of any of claims 1-3.
5. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer-executable program which, when called by a computer, causes the computer to perform the steps in the headphone volume adjustment method according to any one of claims 1-3.
6. A system on a chip, comprising a processor coupled to a memory for storing computer program instructions that, when executed by the processor, cause the system on a chip to perform the steps of the earphone volume adjustment method of any of claims 1-3.
CN202311289316.2A 2023-10-08 2023-10-08 Earphone volume adjusting method and electronic equipment Active CN117061949B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311289316.2A CN117061949B (en) 2023-10-08 2023-10-08 Earphone volume adjusting method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311289316.2A CN117061949B (en) 2023-10-08 2023-10-08 Earphone volume adjusting method and electronic equipment

Publications (2)

Publication Number Publication Date
CN117061949A CN117061949A (en) 2023-11-14
CN117061949B true CN117061949B (en) 2024-04-12

Family

ID=88653854

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311289316.2A Active CN117061949B (en) 2023-10-08 2023-10-08 Earphone volume adjusting method and electronic equipment

Country Status (1)

Country Link
CN (1) CN117061949B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20160063113A (en) * 2014-11-26 2016-06-03 에릭슨엘지엔터프라이즈 주식회사 Method and apparatus for controlling of sound power
CN106101408A (en) * 2016-06-08 2016-11-09 维沃移动通信有限公司 A kind of mobile terminal and method for regulation of sound volume thereof
WO2016187946A1 (en) * 2015-05-22 2016-12-01 中兴通讯股份有限公司 Volume control method, electronic device and computer storage medium
CN106550301A (en) * 2015-09-21 2017-03-29 中兴通讯股份有限公司 A kind of control method and circuit of earphone output
CN113099343A (en) * 2021-03-31 2021-07-09 头领科技(昆山)有限公司 Audio output control chip and earphone

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20180123879A (en) * 2017-05-10 2018-11-20 삼성전자주식회사 Electronic device and method for controlling audio output according to type of earphone

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20160063113A (en) * 2014-11-26 2016-06-03 에릭슨엘지엔터프라이즈 주식회사 Method and apparatus for controlling of sound power
WO2016187946A1 (en) * 2015-05-22 2016-12-01 中兴通讯股份有限公司 Volume control method, electronic device and computer storage medium
CN106550301A (en) * 2015-09-21 2017-03-29 中兴通讯股份有限公司 A kind of control method and circuit of earphone output
CN106101408A (en) * 2016-06-08 2016-11-09 维沃移动通信有限公司 A kind of mobile terminal and method for regulation of sound volume thereof
CN113099343A (en) * 2021-03-31 2021-07-09 头领科技(昆山)有限公司 Audio output control chip and earphone

Also Published As

Publication number Publication date
CN117061949A (en) 2023-11-14

Similar Documents

Publication Publication Date Title
EP3629561B1 (en) Data transmission method and system, and bluetooth headphone
CN1203709C (en) Portable terminal
US9378723B2 (en) Apparatus and method for acquiring configuration data
WO2021180083A1 (en) Bluetooth communication system and wireless communication system
WO2021160040A1 (en) Audio transmission method and electronic device
KR101809859B1 (en) Apparatus and method for acquiring configuration data
EP4096202A1 (en) Wireless sound amplification system and terminal
US20050255817A1 (en) Method and device for background monitoring of an audio source
JP4569414B2 (en) Audio output device
US11089429B1 (en) Indication for correct audio device orientation
CN103813228A (en) Earphones and activation method thereof
CN117061949B (en) Earphone volume adjusting method and electronic equipment
CN115175159B (en) Bluetooth headset playing method and equipment
CN111083250A (en) Mobile terminal and noise reduction method thereof
CN113709906B (en) Wireless audio system, wireless communication method and equipment
CN109195044B (en) Noise reduction earphone, call terminal, noise reduction control method and recording method
KR100724888B1 (en) Mobile terminal having radio frequency module and method for controlling sound output of mobile terminal
US20130039154A1 (en) Remote control of a portable electronic device and method therefor
CN113196800A (en) Hybrid microphone for wireless headset
CN111031433A (en) Wireless earphone and interaction method and interaction system thereof
KR100605894B1 (en) Apparatus and method for automatic controlling audio and radio signal in mobile communication terminal
CN117492689B (en) Audio processing method and electronic equipment
CN116744244B (en) Communication method, storage medium and electronic equipment
CN212876100U (en) Earphone connector
KR100684519B1 (en) Voice recognition hands-free device for car audio and car audio having thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant