CN109511037B - Earphone volume adjusting method and device and computer readable storage medium - Google Patents

Earphone volume adjusting method and device and computer readable storage medium Download PDF

Info

Publication number
CN109511037B
CN109511037B CN201811561796.2A CN201811561796A CN109511037B CN 109511037 B CN109511037 B CN 109511037B CN 201811561796 A CN201811561796 A CN 201811561796A CN 109511037 B CN109511037 B CN 109511037B
Authority
CN
China
Prior art keywords
earphone
volume
value
audio
environmental noise
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
CN201811561796.2A
Other languages
Chinese (zh)
Other versions
CN109511037A (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.)
Nubia Technology Co Ltd
Original Assignee
Nubia Technology 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 Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201811561796.2A priority Critical patent/CN109511037B/en
Publication of CN109511037A publication Critical patent/CN109511037A/en
Application granted granted Critical
Publication of CN109511037B publication Critical patent/CN109511037B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R1/00Details of transducers, loudspeakers or microphones
    • H04R1/10Earpieces; Attachments therefor ; Earphones; Monophonic headphones
    • H04R1/1025Accumulators or arrangements for charging
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R2201/00Details of transducers, loudspeakers or microphones covered by H04R1/00 but not provided for in any of its subgroups
    • H04R2201/10Details of earpieces, attachments therefor, earphones or monophonic headphones covered by H04R1/10 but not provided for in any of its subgroups
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The invention discloses a method for adjusting the volume of an earphone, which comprises the following steps: when the connection between the earphone equipment and the terminal is detected and the terminal starts to transmit audio, acquiring an earphone sound value corresponding to the earphone equipment; acquiring a current environmental noise value, and judging whether the earphone volume value accords with a preset volume condition or not based on the environmental noise value; and if the sound volume value does not accord with the sound volume value, adjusting the sound volume value based on the environmental noise value so that the earphone equipment plays the audio based on the adjusted sound volume value. The invention also discloses a device for adjusting the volume of the earphone and a computer readable storage medium. The invention realizes intelligent adjustment of the volume of the earphone.

Description

Earphone volume adjusting method and device and computer readable storage medium
Technical Field
The present invention relates to the field of mobile terminals, and in particular, to a method and apparatus for adjusting volume of an earphone, and a computer readable storage medium.
Background
With the development of mobile terminals, headphones have become a standard accessory for mobile terminals, and users can perform activities such as talking, listening to music, watching movies, etc. through the headphones. However, the user suffers from many troubles in the process of using the earphone, such as the user cannot hear the conversation content when using the earphone in a noisy environment as the environment changes; or in a list of activities such as listening to songs by using headphones, a user can rely on the volume for a long time, and when different mobile terminals are used, the sound of other mobile terminals cannot be avoided to exceed the health range of the hearing of the user, and the user can damage ears after long-time use.
Disclosure of Invention
The invention mainly aims to provide a method and a device for adjusting the volume of an earphone and a computer readable storage medium, and aims to solve the technical problem that the volume adjustment of the earphone is not intelligent enough in the prior art.
In order to achieve the above object, the present invention provides a method for adjusting the volume of an earphone, the method for adjusting the volume of an earphone comprising:
when the connection between the earphone equipment and the terminal is detected and the terminal starts to transmit audio, acquiring an earphone sound value corresponding to the earphone equipment;
acquiring a current environmental noise value, and judging whether the earphone volume value accords with a preset volume condition or not based on the environmental noise value;
and if the sound volume value does not accord with the sound volume value, adjusting the sound volume value based on the environmental noise value so that the earphone equipment plays the audio based on the adjusted sound volume value.
Optionally, before the step of acquiring the earphone sound value corresponding to the earphone device when it is detected that the earphone device establishes a connection with the terminal and the terminal starts to transmit audio, the method further includes:
and establishing a noise volume comparison table, wherein the noise volume comparison table records earphone volume thresholds corresponding to different environmental noise values.
Optionally, the step of obtaining the current environmental noise value and determining whether the earphone volume value meets a preset volume condition based on the environmental noise value includes:
acquiring a current environmental noise value based on a sound sensor in the earphone equipment, and inquiring an earphone volume threshold corresponding to the environmental noise value based on the noise volume comparison table;
judging whether the difference value between the earphone volume value and the earphone volume threshold is larger than a preset difference value or not;
if the difference value between the earphone volume value and the earphone volume threshold is larger than a preset difference value, the earphone volume value does not accord with a preset volume condition;
if the difference value between the earphone volume value and the earphone volume threshold is smaller than or equal to a preset difference value, the earphone volume value accords with a preset volume condition.
Optionally, the step of adjusting the headphone volume value based on the ambient noise value so that the headphone device plays the audio based on the adjusted headphone volume value includes:
and acquiring an earphone volume threshold corresponding to the environmental noise value based on the noise volume comparison table, and adjusting the earphone volume value based on the earphone volume threshold so that the earphone device plays the audio based on the adjusted earphone volume value.
Optionally, the step of transmitting the audio includes playing the audio and talking, and after the step of acquiring the earphone sound value corresponding to the earphone device when it is detected that the earphone device establishes a connection with the terminal and the terminal starts transmitting the audio, the method further includes:
determining the type of the audio transmitted by the terminal;
and if the type of the audio transmitted by the terminal is call, executing the step of acquiring the current environmental noise value and judging whether the earphone volume value accords with a preset volume condition or not based on the environmental noise value.
Optionally, after the step of determining the type of audio transmitted by the terminal, the method further includes:
if the type of the audio transmitted by the terminal is the audio playing type, detecting whether the current environment is suitable for audio playing or not;
if so, executing the step of acquiring the current environmental noise value and judging whether the earphone volume value accords with a preset volume condition or not based on the environmental noise value.
Optionally, the step of detecting whether the current environment is suitable for playing audio comprises:
acquiring the environmental noise acquired by the sound sensor in a preset time period, and acquiring a sharpness curve corresponding to the environmental noise according to the environmental noise;
detecting whether the sharpness value corresponding to the sharpness curve is larger than a preset sharpness threshold value or not;
if the sharpness value corresponding to the sharpness curve is larger than the preset sharpness threshold value, the current environment is not suitable for playing the audio, otherwise, the current environment is suitable for playing the audio.
Optionally, after the step of detecting whether the current environment is suitable for playing audio if the type of the audio transmitted by the terminal is playing audio, the method further includes:
and if the current environment is not suitable for playing the audio, feeding back warning information.
In addition, in order to achieve the above object, the present invention also provides an earphone volume adjusting device, including: the system comprises a memory, a processor and a headset volume adjusting program stored on the memory and capable of running on the processor, wherein the headset volume adjusting program realizes the steps of the headset volume adjusting method when being executed by the processor.
In addition, in order to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a headphone volume adjustment program which, when executed by a processor, implements the steps of the headphone volume adjustment method as described above.
According to the earphone volume adjusting method, when the connection between the earphone device and the terminal is detected and the terminal starts to transmit audio, firstly, the earphone volume value corresponding to the earphone device is obtained, further, the current environment noise value is obtained, whether the current earphone volume value meets the preset volume condition or not is judged based on the current environment noise value, if not, the current earphone volume value needs to be adjusted, and the earphone volume value is adjusted through the environment noise value, so that the earphone device plays audio based on the adjusted earphone volume value. According to the earphone volume adjusting method, the earphone volume value which does not meet the preset volume condition is adjusted by acquiring and judging the earphone volume and the external noise volume, so that the adjusted earphone volume value is more suitable, the earphone volume is not required to be manually adjusted by a user, better hearing feeling is provided for the user, and the use experience of the user is improved.
Drawings
FIG. 1 is a schematic diagram of a terminal structure of a hardware operating environment according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a communication network system according to an embodiment of the present invention;
fig. 3 is a flowchart of a first embodiment of a method for adjusting volume of an earphone according to the present invention;
fig. 4 is a schematic diagram of a refinement flow of step S20 in fig. 3;
fig. 5 is a flowchart of a second embodiment of the earphone volume adjusting method of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The main solutions of the embodiments of the present invention are: when the connection between the earphone equipment and the terminal is detected and the terminal starts to transmit audio, acquiring an earphone sound value corresponding to the earphone equipment; acquiring a current environmental noise value, and judging whether the earphone volume value accords with a preset volume condition or not based on the environmental noise value; and if the sound volume value does not accord with the sound volume value, adjusting the sound volume value based on the environmental noise value so that the earphone equipment plays the audio based on the adjusted sound volume value. By the technical scheme provided by the embodiment of the invention, the technical problem that the volume adjustment of the earphone is not intelligent enough in the prior art is solved.
In the following description, suffixes such as "module", "component", or "unit" for representing elements are used only for facilitating the description of the present invention, and have no specific meaning per se. Thus, "module," "component," or "unit" may be used in combination.
The terminal may be implemented in various forms. For example, the terminals described in the present invention may include mobile terminals such as cell phones, tablet computers, notebook computers, palm computers, personal digital assistants (Personal Digital Assistant, PDA), portable media players (Portable Media Player, PMP), navigation devices, wearable devices, smart bracelets, pedometers, and fixed terminals such as digital TVs, desktop computers, and the like.
The following description will be given taking a mobile terminal as an example, and those skilled in the art will understand that the configuration according to the embodiment of the present invention can be applied to a fixed type terminal in addition to elements particularly used for a moving purpose.
Referring to fig. 1, which is a schematic diagram of a hardware structure of a mobile terminal implementing various embodiments of the present invention, the mobile terminal 100 may include: an RF (Radio Frequency) unit 101, a WiFi module 102, an audio output unit 103, an a/V (audio/video) input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, a processor 110, and a power supply 111. Those skilled in the art will appreciate that the mobile terminal structure shown in fig. 1 is not limiting of the mobile terminal and that the mobile terminal may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The following describes the components of the mobile terminal in detail with reference to fig. 1:
the radio frequency unit 101 may be used for receiving and transmitting signals during the information receiving or communication process, specifically, after receiving downlink information of the base station, processing the downlink information by the processor 110; and, the uplink data is transmitted to the base station. Typically, the radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication, global System for Mobile communications), GPRS (General Packet Radio Service ), CDMA2000 (Code Division Multiple Access, CDMA 2000), WCDMA (Wideband Code Division Multiple Access ), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access, time Division synchronous code Division multiple Access), FDD-LTE (Frequency Division Duplexing-Long Term Evolution, frequency Division Duplex Long term evolution), and TDD-LTE (Time Division Duplexing-Long Term Evolution, time Division Duplex Long term evolution), etc.
WiFi belongs to a short-distance wireless transmission technology, and a mobile terminal can help a user to send and receive e-mails, browse web pages, access streaming media and the like through the WiFi module 102, so that wireless broadband Internet access is provided for the user. Although fig. 1 shows a WiFi module 102, it is understood that it does not belong to the necessary constitution of a mobile terminal, and can be omitted entirely as required within a range that does not change the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the mobile terminal 100 is in a call signal reception mode, a talk mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output (e.g., a call signal reception sound, a message reception sound, etc.) related to a specific function performed by the mobile terminal 100. The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive an audio or video signal. The a/V input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042, the graphics processor 1041 processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphics processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 can receive sound (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, and the like, and can process such sound into audio data. The processed audio (voice) data may be converted into a format output that can be transmitted to the mobile communication base station via the radio frequency unit 101 in the case of a telephone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting the audio signal.
The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and the proximity sensor can turn off the display panel 1061 and/or the backlight when the mobile terminal 100 moves to the ear. As one of the motion sensors, the accelerometer sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and direction when stationary, and can be used for applications of recognizing the gesture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; as for other sensors such as fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may also be configured in the mobile phone, the detailed description thereof will be omitted.
The display unit 106 is used to display information input by a user or information provided to the user. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and to generate key signal inputs related to user settings and function control of the mobile terminal. In particular, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect touch operations thereon or thereabout by a user (e.g., operations of the user on the touch panel 1071 or thereabout by using any suitable object or accessory such as a finger, a stylus, etc.) and drive the corresponding connection device according to a predetermined program. The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends the touch point coordinates to the processor 110, and can receive and execute commands sent from the processor 110. Further, the touch panel 1071 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. The user input unit 107 may include other input devices 1072 in addition to the touch panel 1071. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc., as specifically not limited herein.
Further, the touch panel 1071 may overlay the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or thereabout, the touch panel 1071 is transferred to the processor 110 to determine the type of touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of touch event. Although in fig. 1, the touch panel 1071 and the display panel 1061 are two independent components for implementing the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 may be integrated with the display panel 1061 to implement the input and output functions of the mobile terminal, which is not limited herein.
The interface unit 108 serves as an interface through which at least one external device can be connected with the mobile terminal 100. For example, the external devices may include a wired or wireless headset port, an external power (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and an external device.
Memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area that may store an operating system, application programs required for at least one function (such as a sound playing function, an image playing function, etc.), and a storage data area; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, memory 109 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
The processor 110 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by running or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor that primarily handles operating systems, user interfaces, applications, etc., with a modem processor that primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The mobile terminal 100 may further include a power source 111 (e.g., a battery) for supplying power to the respective components, and preferably, the power source 111 may be logically connected to the processor 110 through a power management system, so as to perform functions of managing charging, discharging, and power consumption management through the power management system.
Although not shown in fig. 1, the mobile terminal 100 may further include a bluetooth module or the like, which is not described herein.
In order to facilitate understanding of the embodiments of the present invention, a communication network system on which the mobile terminal of the present invention is based will be described below.
Referring to fig. 2, fig. 2 is a schematic diagram of a communication network system according to an embodiment of the present invention, where the communication network system is an LTE system of a general mobile communication technology, and the LTE system includes a UE (User Equipment) 201, an e-UTRAN (Evolved UMTS Terrestrial Radio Access Network ) 202, an epc (Evolved Packet Core, evolved packet core) 203, and an IP service 204 of an operator that are sequentially connected in communication.
Specifically, the UE201 may be the terminal 100 described above, and will not be described herein.
The E-UTRAN202 includes eNodeB2021 and other eNodeB2022, etc. The eNodeB2021 may be connected with other eNodeB2022 by a backhaul (e.g., an X2 interface), the eNodeB2021 is connected to the EPC203, and the eNodeB2021 may provide access from the UE201 to the EPC 203.
EPC203 may include MME (Mobility Management Entity ) 2031, hss (Home Subscriber Server, home subscriber server) 2032, other MMEs 2033, SGW (Serving Gate Way) 2034, pgw (PDN Gate Way) 2035 and PCRF (Policy and Charging Rules Function, policy and tariff function entity) 2036, and so on. The MME2031 is a control node that handles signaling between the UE201 and EPC203, providing bearer and connection management. HSS2032 is used to provide registers to manage functions such as home location registers (not shown) and to hold user specific information about service characteristics, data rates, etc. All user data may be sent through SGW2034 and PGW2035 may provide IP address allocation and other functions for UE201, PCRF2036 is a policy and charging control policy decision point for traffic data flows and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function (not shown).
IP services 204 may include the internet, intranets, IMS (IP Multimedia Subsystem ), or other IP services, etc.
Although the LTE system is described above as an example, it should be understood by those skilled in the art that the present invention is not limited to LTE systems, but may be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems.
Based on the above mobile terminal hardware structure and the communication network system, various embodiments of the method of the present invention are provided.
Referring to fig. 3, fig. 3 is a flow chart of a first embodiment of the earphone volume adjustment method according to the present invention, in which the method includes:
step S10, when the connection between the earphone equipment and the terminal is detected and the terminal starts to transmit audio, acquiring an earphone sound value corresponding to the earphone equipment;
in order to solve the technical problems that the volume adjustment of the earphone is not intelligent enough and accurate enough in the prior art, the invention provides an earphone volume adjustment method, and the volume of the earphone equipment which is connected with the terminal at present is adjusted by comprehensively judging the volume of the earphone, the volume of the external environment and the standard volume value which is suitable for human health, so that better use feeling and healthy and comfortable experience are provided for a user.
In this embodiment, a corresponding sound sensor is provided in the earphone device, and is configured to collect an external environmental sound value when the earphone volume is required to be adjusted, so that in order to further improve accuracy of the earphone volume adjustment, the sound sensor provided in the earphone device should be away from a sound playing module in the earphone device, to prevent the sound playing module from affecting the sound size collected by the sound sensor, specifically, a sound insulation layer may be provided between the sound sensor and the sound playing module, so as to effectively improve sensitivity of the sound sensor to ambient sound detection. Meanwhile, as a preferred technical scheme in the embodiment, an external power supply of the sound sensor is an earphone connecting wire, when the earphone device is detected to be inserted into the terminal, the terminal supplies power to the sound sensor in the earphone device, the sound sensor starts to work, and volume values of surrounding environments are collected.
Further, when it is detected that the connection between the earphone device and the terminal device is established and the terminal device starts to transmit audio, the current volume value of the earphone device is obtained, and in this embodiment, the terminal device starts to transmit audio including, but not limited to, the terminal device starts to play music, play video, play voice, or the terminal starts to talk by using the earphone device, which is regarded as that there is audio transmission between the terminal and the earphone device, where the current volume value of the earphone device is the volume value corresponding to the terminal device playing the audio.
Step S20, acquiring a current environmental noise value, and judging whether the earphone volume value accords with a preset volume condition or not based on the environmental noise value; if not, executing step S30;
further, the current environmental sound volume value is obtained based on the sound sensor in the earphone device, specifically, in this embodiment, the sound volume value of the earphone device and the current environmental sound volume value are both expressed in decibels, the decibels of the sound volume value of the earphone device are determined based on the sound volume value of the terminal device, and different sound volume values of the terminal device correspond to different decibels; for the external environment volume value, the decibel number is determined based on the noise value detected by the sound sensor, the volume value of the earphone device playing the audio currently is judged based on the environment volume value, and whether the earphone volume value meets the preset volume condition is determined, more specifically, whether the earphone volume value is bigger or smaller is judged, so that the hearing of the user is damaged or the user cannot hear the sound clearly is caused.
Specifically, before the earphone device and the terminal are connected and the terminal starts to transmit audio, in this embodiment, a noise volume comparison table is also pre-established, where the noise volume comparison table records earphone volume thresholds corresponding to different environmental noise values, that is, under different environmental noise values, the corresponding earphone volume thresholds are adopted to play audio or talk, so that a user can conveniently and accurately hear audio or talk content, but the hearing is not damaged due to excessive sound.
Specifically, as shown in fig. 4, the step S20 specifically includes:
step S21, acquiring a current environmental noise value based on a sound sensor in the earphone equipment, and inquiring an earphone volume threshold corresponding to the environmental noise value based on the noise volume comparison table;
the current environmental noise value is collected through the sound sensor arranged in the earphone device, and the earphone volume threshold corresponding to the environmental noise value is queried through the established noise volume comparison table, so that it can be understood that the sensitivity degree of different people to sound is different, therefore, the earphone volume threshold in the noise volume comparison table can be changed and set by a user according to the actual situation of the user,
step S22, judging whether the difference value between the earphone volume value and the earphone volume threshold is larger than a preset difference value; if yes, go to step S23; if not, executing step S24;
further, whether the earphone volume value is larger or smaller is judged, specifically, the difference value between the earphone volume value and the earphone volume threshold is calculated, the difference value between the current earphone volume and the standard earphone volume threshold in the current noise environment is represented, and if the difference value is larger, the current earphone volume is larger or smaller.
Step S23, the earphone volume value does not accord with the preset volume condition;
step S24, the earphone volume value accords with a preset volume condition.
Specifically, if the difference between the earphone volume value and the earphone volume threshold is greater than the preset difference, the current earphone volume is indicated to be too large or too small, so that the hearing of the user is easily damaged or the user cannot hear clear sound, namely the preset volume condition is not met; otherwise, if the difference between the earphone volume value and the earphone volume threshold is smaller than or equal to the preset difference, the current earphone volume value is proper, and adjustment is not needed.
And step S30, adjusting the earphone volume value based on the environmental noise value so that the earphone device plays the audio based on the adjusted earphone volume value.
Further, if the difference between the current earphone volume value and the earphone volume threshold corresponding to the current environmental noise value is detected to be larger than the preset difference, the current earphone volume is indicated to be adjusted, specifically, the earphone volume value is adjusted through the earphone volume threshold, so that the difference between the adjusted earphone volume value and the earphone volume threshold is smaller than or equal to the preset difference, and a comfortable hearing environment is provided for the user.
In this embodiment, when it is detected that the earphone device and the terminal are connected and the terminal starts to transmit audio, firstly, an earphone volume value corresponding to the earphone device is obtained, further, a current environmental noise value is obtained again, whether the current earphone volume value meets a preset volume condition is judged based on the current environmental noise value, if not, it is indicated that the current earphone volume value needs to be adjusted, and the earphone volume value is adjusted through the environmental noise value, so that the earphone device plays audio based on the adjusted earphone volume value. According to the earphone volume adjusting method, the earphone volume value which does not meet the preset volume condition is adjusted by acquiring and judging the earphone volume and the external noise volume, so that the adjusted earphone volume value is more suitable, the earphone volume is not required to be manually adjusted by a user, better hearing feeling is provided for the user, and the use experience of the user is improved.
Further, referring to fig. 5, based on the foregoing embodiment, a second embodiment of the method for adjusting the volume of an earphone according to the present invention is provided, and in this embodiment, the step S10 further includes:
step S40, determining the type of the audio transmitted by the terminal;
in this embodiment, in order to further improve the use experience of the user, when the earphone device and the terminal device establish a connection, and the terminal device starts to transmit audio, the type of the transmitted audio is determined, so that the earphone volume is more accurately adjusted based on different types of the transmitted audio, and damage to the ear of the user is avoided.
Step S50, if the type of the audio transmitted by the terminal is call, executing step S20;
in this embodiment, the terminal device starts to transmit audio including, but not limited to, the terminal device starts to play music, play video, play voice, or the terminal starts to talk with the earphone device, which is regarded as that there is audio transmission between the terminal and the earphone device, that is, the type of audio transmission by the terminal includes play audio and talk. If the current transmission audio type is call, the current environmental noise value is directly obtained through a sound sensor in the earphone device, and the earphone volume value is adjusted based on the environmental noise value, so that a user can conveniently hear the call content, but the hearing is not damaged due to overlarge sound.
Step S60, if the type of the audio transmitted by the terminal is the audio playing type, detecting whether the current environment is suitable for audio playing; if yes, go to step S20; if not, executing step S70;
step S70, feeding back warning information.
On the other hand, if the current transmission audio type is the play audio, firstly, whether the current environment is suitable for audio play is detected and judged, so that the situation that the noise of the current environment is overlarge, and when the audio is played, the volume value of the earphone is adjusted to a larger value is avoided, and the hearing of a user is damaged due to the fact that the user listens to the audio for a long time.
Specifically, the step of detecting whether the current environment is suitable for playing audio includes:
step a, acquiring environmental noise acquired by the sound sensor in a preset time period, and acquiring a sharpness curve corresponding to the environmental noise according to the environmental noise;
step b, detecting whether the sharpness value corresponding to the sharpness curve is larger than a preset sharpness threshold value;
and c, if the sharpness value corresponding to the sharpness curve is larger than the preset sharpness threshold, the current environment is not suitable for playing the audio, otherwise, the current environment is suitable for playing the audio.
Similarly, the sound sensor in the earphone device acquires the environmental noise in the current environment for a period of time, processes the acquired environmental noise after acquiring the current environmental noise, for example, the terminal is internally provided with audio processing software, processes the environmental noise sound, and further adopts a sharpness calculation formula:
Figure BDA0001912162380000121
calculating sharpness corresponding to environmental noise, wherein k 2 =0.11 is a weighting coefficient,
Figure BDA0001912162380000122
z is the critical frequency band number of psychoacoustics; n' (z) is the characteristic loudness function.
And (3) obtaining a sharpness curve corresponding to the environmental noise, analyzing the sharpness curve, and if a certain value is larger than or equal to a preset sharpness threshold (which can be set according to actual needs, for example, 1.0) in a plurality of values corresponding to the sharpness curve, indicating that the current environment is unsuitable for playing, feeding back a warning message, for example, displaying characters such as 'unsuitable for playing audio at present' in a terminal display area, or giving out an audio alarm, flashing light or the like, wherein the method is not limited.
In this embodiment, through analyzing the environmental noise collected in the preset time period, a sharpness curve corresponding to the environmental noise is obtained, whether a certain value is greater than a preset sharpness threshold value or not in a plurality of values corresponding to the sharpness curve is detected, if so, the current environment is fed back to be unsuitable for playing audio, the environmental noise is scientifically analyzed, the subsequent audio playing is guided according to the analysis result, and the damage to hearing caused by too large earphone volume value of the audio played by the user when the environmental noise is overlarge is avoided.
In addition, an embodiment of the present invention further provides a computer readable storage medium, on which a headphone volume adjustment program is stored, the headphone volume adjustment program when executed by a processor implementing the following operations:
when the connection between the earphone equipment and the terminal is detected and the terminal starts to transmit audio, acquiring an earphone sound value corresponding to the earphone equipment;
acquiring a current environmental noise value, and judging whether the earphone volume value accords with a preset volume condition or not based on the environmental noise value;
and if the sound volume value does not accord with the sound volume value, adjusting the sound volume value based on the environmental noise value so that the earphone equipment plays the audio based on the adjusted sound volume value.
Further, the earphone volume adjustment program when executed by the processor further performs the following operations:
and establishing a noise volume comparison table, wherein the noise volume comparison table records earphone volume thresholds corresponding to different environmental noise values.
Further, the earphone volume adjustment program when executed by the processor further performs the following operations:
acquiring a current environmental noise value based on a sound sensor in the earphone equipment, and inquiring an earphone volume threshold corresponding to the environmental noise value based on the noise volume comparison table;
judging whether the difference value between the earphone volume value and the earphone volume threshold is larger than a preset difference value or not;
if the difference value between the earphone volume value and the earphone volume threshold is larger than a preset difference value, the earphone volume value does not accord with a preset volume condition;
if the difference value between the earphone volume value and the earphone volume threshold is smaller than or equal to a preset difference value, the earphone volume value accords with a preset volume condition.
Further, the earphone volume adjustment program when executed by the processor further performs the following operations:
and acquiring an earphone volume threshold corresponding to the environmental noise value based on the noise volume comparison table, and adjusting the earphone volume value based on the earphone volume threshold so that the earphone device plays the audio based on the adjusted earphone volume value.
Further, the earphone volume adjustment program when executed by the processor further performs the following operations:
determining the type of the audio transmitted by the terminal;
and if the type of the audio transmitted by the terminal is call, executing the step of acquiring the current environmental noise value and judging whether the earphone volume value accords with a preset volume condition or not based on the environmental noise value.
Further, the earphone volume adjustment program when executed by the processor further performs the following operations:
if the type of the audio transmitted by the terminal is the audio playing type, detecting whether the current environment is suitable for audio playing or not;
if so, executing the step of acquiring the current environmental noise value and judging whether the earphone volume value accords with a preset volume condition or not based on the environmental noise value.
Further, the earphone volume adjustment program when executed by the processor further performs the following operations:
acquiring the environmental noise acquired by the sound sensor in a preset time period, and acquiring a sharpness curve corresponding to the environmental noise according to the environmental noise;
detecting whether the sharpness value corresponding to the sharpness curve is larger than a preset sharpness threshold value or not;
if the sharpness value corresponding to the sharpness curve is larger than the preset sharpness threshold value, the current environment is not suitable for playing the audio, otherwise, the current environment is suitable for playing the audio.
Further, the earphone volume adjustment program when executed by the processor further performs the following operations:
and if the current environment is not suitable for playing the audio, feeding back warning information.
According to the scheme provided by the embodiment, when the connection between the earphone equipment and the terminal is detected and the terminal starts to transmit audio, firstly, the earphone volume value corresponding to the earphone equipment is obtained, further, the current environment noise value is obtained, whether the current earphone volume value meets the preset volume condition or not is judged based on the current environment noise value, if not, the current earphone volume value needs to be adjusted, and the earphone volume value is adjusted through the environment noise value, so that the earphone equipment plays audio based on the adjusted earphone volume value. According to the earphone volume adjusting method, the earphone volume value which does not meet the preset volume condition is adjusted by acquiring and judging the earphone volume and the external noise volume, so that the adjusted earphone volume value is more suitable, the earphone volume is not required to be manually adjusted by a user, better hearing feeling is provided for the user, and the use experience of the user is improved.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The embodiments of the present invention have been described above with reference to the accompanying drawings, but the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present invention and the scope of the claims, which are to be protected by the present invention.

Claims (6)

1. The earphone volume adjusting method is characterized by being applied to a terminal and comprises the following steps of:
establishing a noise volume comparison table, wherein the noise volume comparison table records earphone volume thresholds corresponding to different environmental noise values; when the connection between the earphone equipment and the terminal is detected and the terminal starts to transmit audio, acquiring an earphone sound value corresponding to the earphone equipment;
acquiring a current environmental noise value based on a sound sensor in the earphone equipment, and inquiring an earphone volume threshold corresponding to the environmental noise value based on the noise volume comparison table;
judging whether the difference value between the earphone volume value and the earphone volume threshold is larger than a preset difference value or not;
if the difference value between the earphone volume value and the earphone volume threshold is larger than a preset difference value, the earphone volume value does not accord with a preset volume condition;
if the difference value between the earphone volume value and the earphone volume threshold is smaller than or equal to a preset difference value, the earphone volume value accords with a preset volume condition;
if the audio is not matched with the audio, adjusting the earphone volume value based on the environmental noise value so that the earphone equipment plays the audio based on the adjusted earphone volume value;
determining the type of the audio transmitted by the terminal;
if the type of the audio transmitted by the terminal is call, executing the step of acquiring the current environmental noise value and judging whether the earphone volume value accords with a preset volume condition or not based on the environmental noise value;
if the type of the audio transmitted by the terminal is the audio playing type, detecting whether the current environment is suitable for audio playing or not; if so, executing the step of acquiring the current environmental noise value and judging whether the earphone volume value accords with a preset volume condition or not based on the environmental noise value.
2. The headphone volume adjustment method according to claim 1, wherein the step of adjusting the headphone volume value based on the ambient noise value so that the headphone device plays the audio based on the adjusted headphone volume value comprises:
and acquiring an earphone volume threshold corresponding to the environmental noise value based on the noise volume comparison table, and adjusting the earphone volume value based on the earphone volume threshold so that the earphone device plays the audio based on the adjusted earphone volume value.
3. The headphone volume adjusting method according to claim 1, wherein the step of detecting whether the current environment is suitable for playing audio comprises:
acquiring the environmental noise acquired by the sound sensor in a preset time period, and acquiring a sharpness curve corresponding to the environmental noise according to the environmental noise;
detecting whether the sharpness value corresponding to the sharpness curve is larger than a preset sharpness threshold value or not;
if the sharpness value corresponding to the sharpness curve is larger than the preset sharpness threshold value, the current environment is not suitable for playing the audio, otherwise, the current environment is suitable for playing the audio.
4. The method for adjusting the volume of an earphone according to claim 3, wherein after the step of detecting whether the current environment is suitable for playing audio if the type of audio transmitted by the terminal is played audio, further comprising:
and if the current environment is not suitable for playing the audio, feeding back warning information.
5. An earphone volume adjusting device, characterized in that the earphone volume adjusting device comprises: a memory, a processor and a headset volume adjustment program stored on the memory and executable on the processor, which when executed by the processor implements the steps of the headset volume adjustment method of any one of claims 1 to 4.
6. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a headphone volume adjustment program, which when executed by a processor, implements the steps of the headphone volume adjustment method according to any one of claims 1 to 4.
CN201811561796.2A 2018-12-19 2018-12-19 Earphone volume adjusting method and device and computer readable storage medium Active CN109511037B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811561796.2A CN109511037B (en) 2018-12-19 2018-12-19 Earphone volume adjusting method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811561796.2A CN109511037B (en) 2018-12-19 2018-12-19 Earphone volume adjusting method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109511037A CN109511037A (en) 2019-03-22
CN109511037B true CN109511037B (en) 2023-05-19

Family

ID=65753992

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811561796.2A Active CN109511037B (en) 2018-12-19 2018-12-19 Earphone volume adjusting method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109511037B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110827863A (en) * 2019-11-08 2020-02-21 西安闻泰电子科技有限公司 Method, device and terminal for intelligently adjusting volume and readable storage medium
CN110809219B (en) * 2019-11-26 2021-06-01 广州酷狗计算机科技有限公司 Method, device and equipment for playing audio and storage medium
CN111443889B (en) * 2020-03-24 2023-08-11 捷开通讯(深圳)有限公司 Volume adjusting method and system, storage medium and terminal equipment thereof
CN111479005B (en) * 2020-04-15 2021-07-16 维沃移动通信有限公司 Volume adjusting method and electronic equipment
CN111800699B (en) * 2020-07-23 2022-10-04 江苏紫米电子技术有限公司 Volume adjustment prompting method and device, earphone equipment and storage medium
CN112291664B (en) * 2020-10-30 2022-03-11 歌尔光学科技有限公司 Volume adjusting method, device and system of head-mounted display equipment
CN112291665B (en) * 2020-10-30 2022-03-29 歌尔光学科技有限公司 Volume adjusting method, device and system of head-mounted display equipment and storage medium
CN112887857B (en) * 2021-01-25 2023-04-07 湖南普奇水环境研究院有限公司 Hearing protection method and system for eliminating reception noise
CN114979357A (en) * 2021-02-19 2022-08-30 深圳市万普拉斯科技有限公司 Volume adjusting method and device, terminal equipment and readable storage medium
CN114979360A (en) * 2021-02-20 2022-08-30 深圳市万普拉斯科技有限公司 Volume adjusting method, device, terminal and storage medium
CN113411707A (en) * 2021-06-17 2021-09-17 歌尔智能科技有限公司 Auxiliary listening earphone, control method, device and system thereof, and readable medium
CN113938795B (en) * 2021-09-10 2024-01-12 深圳市飞科笛系统开发有限公司 Method and device for adjusting volume of earphone, earphone and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101552595A (en) * 2008-03-31 2009-10-07 联想(北京)有限公司 Electronic product volume regulating method and device thereof
CN107247572A (en) * 2017-05-08 2017-10-13 深圳市科迈爱康科技有限公司 Audio frequency playing method, terminal and computer-readable recording medium
CN107371058A (en) * 2017-08-04 2017-11-21 深圳市创维软件有限公司 A kind of player method, smart machine and the storage medium of multimedia file sound intermediate frequency data
CN108307043A (en) * 2017-12-28 2018-07-20 努比亚技术有限公司 Speech message conversion method, mobile terminal and computer readable storage medium
CN108668007A (en) * 2018-03-29 2018-10-16 努比亚技术有限公司 Processing method, mobile terminal and the storage medium of new information in a kind of mobile terminal

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105472497A (en) * 2015-12-07 2016-04-06 京东方科技集团股份有限公司 Headset control device, headset, wearable equipment and headset control method
CN108093142A (en) * 2017-12-28 2018-05-29 努比亚技术有限公司 volume adjusting method, mobile terminal and computer readable storage medium
CN108900951A (en) * 2018-06-13 2018-11-27 歌尔股份有限公司 Volume adjusting method, earphone and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101552595A (en) * 2008-03-31 2009-10-07 联想(北京)有限公司 Electronic product volume regulating method and device thereof
CN107247572A (en) * 2017-05-08 2017-10-13 深圳市科迈爱康科技有限公司 Audio frequency playing method, terminal and computer-readable recording medium
CN107371058A (en) * 2017-08-04 2017-11-21 深圳市创维软件有限公司 A kind of player method, smart machine and the storage medium of multimedia file sound intermediate frequency data
CN108307043A (en) * 2017-12-28 2018-07-20 努比亚技术有限公司 Speech message conversion method, mobile terminal and computer readable storage medium
CN108668007A (en) * 2018-03-29 2018-10-16 努比亚技术有限公司 Processing method, mobile terminal and the storage medium of new information in a kind of mobile terminal

Also Published As

Publication number Publication date
CN109511037A (en) 2019-03-22

Similar Documents

Publication Publication Date Title
CN109511037B (en) Earphone volume adjusting method and device and computer readable storage medium
CN107231473B (en) Audio output regulation and control method, equipment and computer readable storage medium
CN112004173B (en) Bluetooth headset switching method, mobile terminal and computer readable storage medium
CN110175062B (en) Screen refreshing frame rate method of mobile terminal, mobile terminal and storage medium
CN108282575B (en) Volume control method, mobile terminal and computer readable storage medium
CN108512625B (en) Anti-interference method for camera, mobile terminal and storage medium
CN112004174B (en) Noise reduction control method, device and computer readable storage medium
CN110007816B (en) Display area determining method, terminal and computer readable storage medium
CN109195058B (en) Earphone sound channel switching method, earphone sound channel switching device, terminal and storage medium
CN109256151B (en) Call voice regulation and control method and device, mobile terminal and readable storage medium
CN109195213B (en) Mobile terminal screen control method, mobile terminal and computer readable storage medium
CN108958695B (en) Audio output method, device and computer readable storage medium
CN108052304B (en) Volume adjusting method, volume adjusting equipment and computer storage medium
CN107197101B (en) Audio adjusting method, mobile terminal and computer readable storage medium
CN109873894B (en) Volume adjusting method and mobile terminal
CN110052024B (en) Game vibration adjusting method, adjusting device, mobile terminal and storage medium
CN107728990B (en) Audio playing method, mobile terminal and computer readable storage medium
CN107517487B (en) Call control method and mobile terminal
CN111970738B (en) Network switching control method, device and computer readable storage medium
CN111443818B (en) Screen brightness regulation and control method, equipment and computer readable storage medium
CN109561221B (en) Call control method, device and computer readable storage medium
CN112437472A (en) Network switching method, equipment and computer readable storage medium
CN108040311B (en) Audio playing method, terminal and computer readable storage medium
CN109842718B (en) Call adjustment method, terminal and computer readable storage medium
CN112492450B (en) Sound parameter regulation and control method, device and computer readable storage medium

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
GR01 Patent grant