CN110708630B - Method, device and equipment for controlling earphone and storage medium - Google Patents

Method, device and equipment for controlling earphone and storage medium Download PDF

Info

Publication number
CN110708630B
CN110708630B CN201911102045.9A CN201911102045A CN110708630B CN 110708630 B CN110708630 B CN 110708630B CN 201911102045 A CN201911102045 A CN 201911102045A CN 110708630 B CN110708630 B CN 110708630B
Authority
CN
China
Prior art keywords
audio
earphone
terminal
playing
target
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
CN201911102045.9A
Other languages
Chinese (zh)
Other versions
CN110708630A (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.)
Guangzhou Kugou Computer Technology Co Ltd
Original Assignee
Guangzhou Kugou Computer 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 Guangzhou Kugou Computer Technology Co Ltd filed Critical Guangzhou Kugou Computer Technology Co Ltd
Priority to CN201911102045.9A priority Critical patent/CN110708630B/en
Publication of CN110708630A publication Critical patent/CN110708630A/en
Application granted granted Critical
Publication of CN110708630B publication Critical patent/CN110708630B/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/1091Details not provided for in groups H04R1/1008 - H04R1/1083
    • 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/20Arrangements for obtaining desired frequency or directional characteristics

Abstract

The application discloses a method, a device, equipment and a storage medium for controlling an earphone, and belongs to the technical field of electronics. The method comprises the following steps: when the terminal is detected to be in an outdoor environment and an earphone of the terminal is in a connection state, starting an audio acquisition component; collecting environmental audio through the audio collection component; and playing the collected environmental audio through the earphone. According to the method and the device, the microphone is used for recording the ambient audio around the user, and the recorded ambient audio is played in the earphone, so that the user can hear ambient sound clearly in the earphone, and the safety can be improved.

Description

Method, device and equipment for controlling earphone and storage medium
Technical Field
The present application relates to the field of electronic technologies, and in particular, to a method, an apparatus, a device, and a storage medium for controlling an earphone.
Background
With the progress of electronic technology, it is very common that people wear earphones to listen to music, and people have higher and higher requirements on the tone quality of music played by the earphones.
Some earphone manufacturers can use rubber and other materials as the earplugs of the earphones in order to improve the sound quality, so that the noise of the surrounding environment of the user is effectively blocked, and the user can listen to the music played by the earphones more clearly.
In the process of implementing the present application, the inventor finds that the prior art has at least the following problems:
in outdoor environments, such as streets, stations, etc., users wearing such earphones are likely to be unable to hear the sound of the surrounding environment and to respond to what happens in the surroundings in a timely manner, resulting in poor safety.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a storage medium for controlling an earphone, which can solve the problem that a user is easy to have safety accidents because the user cannot hear surrounding environment sound when wearing the earphone in an outdoor environment. The technical scheme is as follows:
in one aspect, a method of controlling a headset is provided, the method comprising:
when the terminal is detected to be in an outdoor environment and an earphone of the terminal is in a connection state, starting an audio acquisition component;
collecting environmental audio through the audio collection component;
and playing the collected environmental audio through the earphone.
Optionally, the audio capture component is turned on, including:
detecting whether the headset contains an audio acquisition component;
if the earphone comprises an audio acquisition part, starting the audio acquisition part of the earphone;
and if the earphone does not comprise an audio acquisition component, starting the audio acquisition component of the terminal.
Optionally, the playing the collected environmental audio through the earphone includes:
acquiring the current playing volume of the terminal;
determining a target playing volume based on the playing volume and a target adjusting proportion coefficient;
and playing the collected environmental audio through the earphone according to the target playing volume.
Optionally, before determining the target playing volume based on the playing volume and the target adjusting scaling factor, the method further includes:
acquiring the current movement speed of the terminal;
and determining a target adjusting proportion coefficient corresponding to the current movement speed based on a corresponding relation between the movement speed and the adjusting proportion coefficient, wherein in the corresponding relation, the larger the movement speed is, the larger the corresponding adjusting proportion coefficient is.
Optionally, the determining the target playing volume based on the playing volume and the target adjusting scaling factor includes:
and multiplying the playing volume by a target adjusting proportion coefficient to obtain the target playing volume.
Optionally, the method further includes:
inputting the environment audio into an audio type identification model to obtain an audio type corresponding to the environment audio;
and if the audio type is the audio type to be prompted and the amplitude of the environmental audio is greater than the amplitude threshold value, playing an alarm audio through the earphone.
In another aspect, there is provided an apparatus for controlling a headset, the apparatus including:
the terminal comprises an opening module, a control module and a processing module, wherein the opening module is configured to open an audio acquisition component when the terminal is detected to be in an outdoor environment and an earphone of the terminal is in a connection state;
a capture module configured to capture ambient audio by the audio capture component;
a playing module configured to play the captured environmental audio through the headphones.
Optionally, the starting module is configured to:
detecting whether the headset contains an audio acquisition component;
if the earphone comprises an audio acquisition part, starting the audio acquisition part of the earphone;
and if the earphone does not comprise an audio acquisition component, starting the audio acquisition component of the terminal.
Optionally, the playing module is configured to:
acquiring the current playing volume of the terminal;
determining a target playing volume based on the playing volume and a target adjusting proportion coefficient;
and playing the collected environmental audio through the earphone according to the target playing volume.
Optionally, the apparatus further comprises a determining module configured to:
acquiring the current movement speed of the terminal;
and determining a target adjusting proportion coefficient corresponding to the current movement speed based on a corresponding relation between the movement speed and the adjusting proportion coefficient, wherein in the corresponding relation, the larger the movement speed is, the larger the corresponding adjusting proportion coefficient is.
Optionally, the playing module is configured to:
and multiplying the playing volume by a target adjusting proportion coefficient to obtain the target playing volume.
Optionally, the apparatus further comprises an alarm module configured to:
inputting the environment audio into an audio type identification model to obtain an audio type corresponding to the environment audio;
and if the audio type is the audio type to be prompted and the amplitude of the environmental audio is greater than the amplitude threshold value, playing an alarm audio through the earphone.
In yet another aspect, a computer device is provided that includes a processor and a memory, where at least one instruction is stored, loaded and executed by the processor to implement the operations performed by the method of controlling a headset as described above.
In yet another aspect, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement the operations performed by the method for controlling a headset as described above.
The technical scheme provided by the embodiment of the application has the following beneficial effects:
when a user listens to a song outdoors by using the earphone, the microphone records the ambient audio around the user, and the recorded ambient audio is played in the earphone, so that the user can hear ambient sound more clearly in the earphone, and the safety can be improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic illustration of an implementation environment provided by an embodiment of the present application;
fig. 2 is a flowchart of a method for controlling a headset according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an apparatus for controlling a headset according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a terminal provided in an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Fig. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application. Referring to fig. 1, the method for controlling a headset provided by the present application may be implemented by a terminal. The terminal can possess parts such as microphone, earphone interface, speaker, and the terminal has communication function, can insert the internet, and the terminal can also have bluetooth module, carries out bluetooth communication with other equipment. The terminal can be a mobile phone, a tablet computer, intelligent wearable equipment, a desktop computer, a notebook computer and the like.
The method for controlling the earphone provided by the embodiment of the application can be applied to various application programs capable of playing audio, such as a music playing application program, a video chatting application program, a listening application program and the like, and can also be directly applied to a terminal as a function. When a user is in an outdoor environment, the terminal is used for playing the audio in the target application program and wears the earphone to listen, the scheme of the application can play a role, the terminal or the microphone of the earphone is used for recording the ambient audio around the user, and the recorded audio is played to the user through the earphone, so that the user can still hear the ambient sound when wearing the earphone. The embodiment of the present application takes the target application as the music playing application as an example to describe the present application in detail, and other situations are similar and will not be described again.
Fig. 2 is a flowchart of controlling a headset according to an embodiment of the present disclosure. Referring to fig. 2, the embodiment includes:
step 201, when it is detected that the terminal is in an outdoor environment and an earphone of the terminal is in a connected state, an audio acquisition component is turned on.
The audio acquisition component can be a microphone of a terminal or an earphone, and the earphone can be a wired earphone or a wireless Bluetooth earphone.
In an implementation, when a user plays music using a music playing application in a terminal and listens to the music played by the music playing application through an earphone, the music playing application may detect whether the terminal is in an outdoor environment, such as a square, a park, or a street, through a detection program preset by a technician. The detection method can set a corresponding outdoor area in the positioning map, and when the positioning place of the terminal is in the set outdoor area, the terminal can be considered to be in an outdoor environment. In addition, a microphone of the terminal or the earphone can be turned on in advance to record the ambient audio around the terminal, but the recorded ambient audio is not played, and when the recorded ambient audio exceeds a preset decibel value, the terminal can be considered to be in an outdoor environment. When a user uses the earphone to listen to music played by the terminal and detects that the terminal is in an outdoor environment, the terminal or a microphone of the earphone is started.
In addition, a switch option for listening to songs outdoors can be set in the music playing application program, and a user can select to turn on a microphone of the terminal or the earphone outdoors through the switch option for listening to songs outdoors, so that the music playing application program can execute the following steps 202 to 203.
In addition, the music playing application program may also monitor the current speed and the stride frequency of the terminal, and when the current speed and the stride frequency of the monitoring terminal are both greater than the preset speed threshold and the preset stride frequency threshold, it may be considered that the user is running, and then the microphone of the terminal or the earphone may be turned on, and the music playing application program may perform the following steps 202 to 203.
Optionally, the microphone that is turned on may be selected, and the corresponding processing may be as follows: detecting whether the earphone comprises an audio acquisition component; if the earphone comprises the audio acquisition part, the audio acquisition part of the earphone is started; and if the earphone does not comprise the audio acquisition part, starting the audio acquisition part of the terminal.
In implementation, some wired or wireless bluetooth headsets do not have an audio acquisition component, i.e., a microphone. When the terminal starts the audio acquisition part, whether the earphone currently used by the user is provided with the microphone or not can be detected, when the earphone currently used by the user is detected to be provided with the microphone, the microphone on the earphone can be selected to be started, and when the earphone currently used by the user is detected not to be provided with the microphone, the microphone on the terminal is started.
At step 202, environmental audio is captured by an audio capture component.
In an implementation, after the microphone of the terminal or the headset is turned on, the microphone may record the ambient audio around the user. For example, when a user uses an earphone and listens to a song on a road, the microphone may record various sounds on the road, such as various car whistles, engine sounds, human sounds, and the like, and as the position of the user gets closer to the position of a certain sound source, the volume of the recorded audio from the sound source becomes larger.
And step 203, playing the collected environmental audio through the earphone.
In practice, the terminal may play the ambient audio around the user recorded in step 202 above through a headset.
Optionally, the playing volume of the received and recorded environmental audio may be adjusted according to the volume of the music played by the terminal in the music playing application, and the corresponding processing may be as follows: acquiring the current playing volume of the terminal; and multiplying the playing volume by the target adjusting proportion coefficient based on the playing volume and the target adjusting proportion coefficient to obtain the target playing volume, and playing the acquired environmental audio at the target playing volume through the earphone. For example, when a user uses an earphone to listen to a song on a road, the earphone can play various sounds such as various car whistles, engine sounds, human sounds, etc. recorded by the microphone, and when the user's position is gradually close to the position of a certain sound source, the sound volume of the sound source is increased.
In implementation, the volume of the music currently played by the terminal may be obtained, the product of the volume of the music currently played by the terminal and the target scaling factor is determined according to the target scaling factor preset by a technician, and the playing volume of the ambient audio around the user recorded by the terminal playing microphone is determined, for example, the volume of the music currently played by the terminal is 50%, and the target scaling factor is 0.9, the terminal may multiply the playing volume by the target scaling factor to obtain a target playing volume of 45%, and the terminal plays the ambient audio around the user recorded in step 202 according to the playing volume of 45%.
Optionally, the volume of the environmental audio played by the earphone may be determined by the movement speed of the user, and the corresponding processing may be as follows: acquiring the current movement speed of the terminal; and determining a target adjusting proportion coefficient corresponding to the current movement speed based on a corresponding relation between the movement speed and the adjusting proportion coefficient, wherein in the corresponding relation, the larger the movement speed is, the larger the corresponding adjusting proportion coefficient is.
In implementation, the music playing application program may obtain a current speed value (i.e., a motion speed) of the terminal by calling a speed interface in the terminal system, and may determine a current adjustment scaling factor in a corresponding relationship between the speed value and the adjustment scaling factor stored in the terminal. When the user accelerates the movement speed, the speed value of the terminal is increased, when the value of the speed value of the terminal is increased, the proportional coefficient can be correspondingly increased and adjusted, so that the volume of the sound of the surrounding environment played by the earphone is increased, when the user reduces the movement speed, the speed value of the terminal is reduced, and when the value of the speed information of the terminal is reduced, the proportional coefficient can be correspondingly reduced and adjusted, so that the volume of the sound of the surrounding environment played by the earphone is reduced. It should be noted that an adjustment range may be set for the adjustment scaling factor, that is, the adjustment scaling factor may be adjusted according to the terminal speed, but does not exceed the set adjustment range.
Optionally, the type of the environmental audio may be identified, and an alarm prompt may be performed on the user, and the corresponding processing may be as follows: inputting the environment audio into an audio type identification model to obtain an audio type corresponding to the environment audio; and if the audio type is the audio type to be prompted and the amplitude of the environmental audio is greater than the amplitude threshold value, playing an alarm audio through the earphone.
In implementation, a technician may set an audio type identification model in a music playing application program, and set several audio types to be prompted, and the terminal may input environmental audio around the user to the audio type identification model in segments through a microphone, and detect the type of the environmental audio of each segment, for example, it may be a car whistle, a human voice, music, and the like. When the detected type of the section of the environmental audio is the type of the audio to be prompted, such as a car whistle, and the amplitude of the section of the environmental audio is greater than the preset audio amplitude, the music playing application program can play the alarm audio through the earphone, wherein the alarm audio can be continuous dripping sound, and in addition, the playing time length of the alarm audio can be set, for example, the time length of each alarm is 3 seconds. When the alarm audio is played, the terminal can stop playing the environmental audio recorded by the microphone.
According to the embodiment of the application, when a user uses the earphone outdoors to listen to songs, the microphone is used for recording the ambient audio around the user, and the recorded ambient audio is played in the earphone, so that the user can hear ambient sound in the earphone more clearly, and the safety of the user using the earphone outdoors can be improved.
All the above optional technical solutions may be combined arbitrarily to form the optional embodiments of the present disclosure, and are not described herein again.
Fig. 3 is a schematic structural diagram of an apparatus for controlling an earphone according to an embodiment of the present application, where the apparatus may be a terminal in the foregoing embodiment. Referring to fig. 3, the apparatus includes:
the starting module 310 is configured to start an audio acquisition component when the terminal is detected to be in an outdoor environment and an earphone of the terminal is in a connected state;
a capture module 320 configured to capture ambient audio by the audio capture component;
a playing module 330 configured to play the captured environmental audio through the earphone.
Optionally, the starting module 310 is configured to:
detecting whether the headset contains an audio acquisition component;
if the earphone comprises an audio acquisition part, starting the audio acquisition part of the earphone;
and if the earphone does not comprise an audio acquisition component, starting the audio acquisition component of the terminal.
Optionally, the playing module 330 is configured to:
acquiring the current playing volume of the terminal;
determining a target playing volume based on the playing volume and a target adjusting proportion coefficient;
and playing the collected environmental audio through the earphone according to the target playing volume.
Optionally, the apparatus further comprises a determining module configured to:
acquiring the current movement speed of the terminal;
and determining a target adjusting proportion coefficient corresponding to the current movement speed based on a corresponding relation between the movement speed and the adjusting proportion coefficient, wherein in the corresponding relation, the larger the movement speed is, the larger the corresponding adjusting proportion coefficient is.
Optionally, the playing module is configured to:
and multiplying the playing volume by a target adjusting proportion coefficient to obtain the target playing volume.
Optionally, the apparatus further comprises an alarm module configured to:
inputting the environment audio into an audio type identification model to obtain an audio type corresponding to the environment audio;
and if the audio type is the audio type to be prompted and the amplitude of the environmental audio is greater than the amplitude threshold value, playing an alarm audio through the earphone.
It should be noted that: in the above embodiment, when controlling the earphone, the device for controlling the earphone is illustrated by only dividing the functional modules, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device for controlling an earphone and the method for controlling an earphone provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Fig. 4 shows a block diagram of a terminal 400 according to an exemplary embodiment of the present application. The terminal 400 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion video Experts compression standard Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, motion video Experts compression standard Audio Layer 4), a notebook computer, or a desktop computer. The terminal 400 may also be referred to by other names such as user equipment, portable terminal, laptop terminal, desktop terminal, etc.
Generally, the terminal 400 includes: a processor 401 and a memory 402.
Processor 401 may include one or more processing cores, such as a 4-core processor, an 8-core processor, or the like. The processor 401 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 401 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 401 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed by the display screen. In some embodiments, the processor 401 may further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
Memory 402 may include one or more computer-readable storage media, which may be non-transitory. Memory 402 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 402 is used to store at least one instruction for execution by processor 401 to implement the method of controlling a headset provided by method embodiments herein.
In some embodiments, the terminal 400 may further optionally include: a peripheral interface 403 and at least one peripheral. The processor 401, memory 402 and peripheral interface 403 may be connected by bus or signal lines. Each peripheral may be connected to the peripheral interface 403 via a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 404, touch screen display 405, camera 406, audio circuitry 407, positioning components 408, and power supply 409.
The peripheral interface 403 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 401 and the memory 402. In some embodiments, processor 401, memory 402, and peripheral interface 403 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 401, the memory 402 and the peripheral interface 403 may be implemented on a separate chip or circuit board, which is not limited by this embodiment.
The Radio Frequency circuit 404 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuitry 404 communicates with communication networks and other communication devices via electromagnetic signals. The rf circuit 404 converts an electrical signal into an electromagnetic signal to transmit, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 404 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuitry 404 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: metropolitan area networks, various generation mobile communication networks (2G, 3G, 4G, and 5G), Wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the rf circuit 404 may further include NFC (Near Field Communication) related circuits, which are not limited in this application.
The display screen 405 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 405 is a touch display screen, the display screen 405 also has the ability to capture touch signals on or over the surface of the display screen 405. The touch signal may be input to the processor 401 as a control signal for processing. At this point, the display screen 405 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display screen 405 may be one, providing the front panel of the terminal 400; in other embodiments, the display screen 405 may be at least two, respectively disposed on different surfaces of the terminal 400 or in a folded design; in still other embodiments, the display 405 may be a flexible display disposed on a curved surface or a folded surface of the terminal 400. Even further, the display screen 405 may be arranged in a non-rectangular irregular pattern, i.e. a shaped screen. The Display screen 405 may be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), and other materials.
The camera assembly 406 is used to capture images or video. Optionally, camera assembly 406 includes a front camera and a rear camera. Generally, a front camera is disposed at a front panel of the terminal, and a rear camera is disposed at a rear surface of the terminal. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments, camera assembly 406 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
The audio circuit 407 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 401 for processing, or inputting the electric signals to the radio frequency circuit 404 for realizing voice communication. For the purpose of stereo sound collection or noise reduction, a plurality of microphones may be provided at different portions of the terminal 400. The microphone may also be an array microphone or an omni-directional pick-up microphone. The speaker is used to convert electrical signals from the processor 401 or the radio frequency circuit 404 into sound waves. The loudspeaker can be a traditional film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, the speaker can be used for purposes such as converting an electric signal into a sound wave audible to a human being, or converting an electric signal into a sound wave inaudible to a human being to measure a distance. In some embodiments, audio circuitry 407 may also include a headphone jack.
The positioning component 408 is used to locate the current geographic position of the terminal 400 for navigation or LBS (Location Based Service). The Positioning component 408 may be a Positioning component based on the GPS (Global Positioning System) of the united states, the beidou System of china, the graves System of russia, or the galileo System of the european union.
The power supply 409 is used to supply power to the various components in the terminal 400. The power source 409 may be alternating current, direct current, disposable or rechargeable. When power source 409 comprises a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, the terminal 400 also includes one or more sensors 410. The one or more sensors 410 include, but are not limited to: acceleration sensor 411, gyro sensor 412, pressure sensor 413, fingerprint sensor 414, optical sensor 415, and proximity sensor 416.
The acceleration sensor 411 may detect the magnitude of acceleration in three coordinate axes of the coordinate system established with the terminal 400. For example, the acceleration sensor 411 may be used to detect components of the gravitational acceleration in three coordinate axes. The processor 401 may control the touch display screen 405 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 411. The acceleration sensor 411 may also be used for acquisition of motion data of a game or a user.
The gyro sensor 412 may detect a body direction and a rotation angle of the terminal 400, and the gyro sensor 412 may cooperate with the acceleration sensor 411 to acquire a 3D motion of the terminal 400 by the user. From the data collected by the gyro sensor 412, the processor 401 may implement the following functions: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization at the time of photographing, game control, and inertial navigation.
The pressure sensor 413 may be disposed on a side bezel of the terminal 400 and/or a lower layer of the touch display screen 405. When the pressure sensor 413 is disposed on the side frame of the terminal 400, a user's holding signal to the terminal 400 can be detected, and the processor 401 performs left-right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 413. When the pressure sensor 413 is disposed at the lower layer of the touch display screen 405, the processor 401 controls the operability control on the UI interface according to the pressure operation of the user on the touch display screen 405. The operability control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 414 is used for collecting a fingerprint of the user, and the processor 401 identifies the identity of the user according to the fingerprint collected by the fingerprint sensor 414, or the fingerprint sensor 414 identifies the identity of the user according to the collected fingerprint. Upon recognizing that the user's identity is a trusted identity, processor 401 authorizes the user to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings, etc. The fingerprint sensor 414 may be disposed on the front, back, or side of the terminal 400. When a physical key or vendor Logo is provided on the terminal 400, the fingerprint sensor 414 may be integrated with the physical key or vendor Logo.
The optical sensor 415 is used to collect the ambient light intensity. In one embodiment, the processor 401 may control the display brightness of the touch display screen 405 based on the ambient light intensity collected by the optical sensor 415. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 405 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 405 is turned down. In another embodiment, the processor 401 may also dynamically adjust the shooting parameters of the camera assembly 406 according to the ambient light intensity collected by the optical sensor 415.
A proximity sensor 416, also known as a distance sensor, is typically disposed on the front panel of the terminal 400. The proximity sensor 416 is used to collect the distance between the user and the front surface of the terminal 400. In one embodiment, when the proximity sensor 416 detects that the distance between the user and the front surface of the terminal 400 gradually decreases, the processor 401 controls the touch display screen 405 to switch from the bright screen state to the dark screen state; when the proximity sensor 416 detects that the distance between the user and the front surface of the terminal 400 gradually becomes larger, the processor 401 controls the touch display screen 405 to switch from the breath screen state to the bright screen state.
Those skilled in the art will appreciate that the configuration shown in fig. 4 is not intended to be limiting of terminal 400 and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be used.
In an exemplary embodiment, a computer-readable storage medium, such as a memory, including instructions executable by a processor in a terminal to perform the method of controlling a headset in the above embodiments is also provided. The computer readable storage medium may be non-transitory. For example, the computer-readable storage medium may be a ROM (Read-Only Memory), a RAM (Random Access Memory), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (6)

1. A method of controlling a headset, the method comprising:
the method comprises the steps that when a terminal plays music through a music playing application program, an earphone of the terminal is in a connected state and the terminal is in an outdoor environment, the current speed and step frequency of the terminal are monitored, and when the speed is detected to be larger than a preset speed threshold value and the step frequency is detected to be larger than a preset step frequency threshold value, whether the earphone comprises an audio acquisition component or not is detected; if the earphone comprises an audio acquisition component, starting the audio acquisition component of the earphone, and if the earphone does not comprise the audio acquisition component, starting the audio acquisition component of the terminal to acquire the environmental audio through the audio acquisition component;
when the decibel value of the acquired environmental audio exceeds a preset decibel value, acquiring the current playing volume of the terminal and the current movement speed of the terminal;
determining a target adjusting proportion coefficient corresponding to the current movement speed based on a corresponding relation between the movement speed and the adjusting proportion coefficient, wherein in the corresponding relation, the larger the movement speed is, the larger the corresponding adjusting proportion coefficient is, and the adjusting proportion coefficient is in a set adjusting range;
determining a target playing volume based on the playing volume and a target adjusting proportion coefficient;
playing the collected environmental audio at the target playing volume through the earphone;
inputting the environment audio played by the earphone into an audio type identification model to obtain an audio type corresponding to the environment audio played by the earphone;
if the audio type is the audio type to be prompted and the amplitude of the environmental audio is greater than the amplitude threshold value, an alarm audio is played through the earphone;
and when the earphone plays the alarm audio, the earphone stops playing the environmental audio.
2. The method of claim 1, wherein determining a target playback volume based on the playback volume and a target scaling factor comprises:
and multiplying the playing volume by a target adjusting proportion coefficient to obtain the target playing volume.
3. An apparatus for controlling a headset, the apparatus comprising:
the starting module is configured to monitor the current speed and the step frequency of the terminal when the terminal plays music through a music playing application program, an earphone of the terminal is in a connected state and the terminal is in an outdoor environment; when the speed is detected to be larger than a preset speed threshold value and the step frequency is detected to be larger than a preset step frequency threshold value, whether the earphone comprises an audio acquisition component is detected; if the earphone comprises an audio acquisition component, starting the audio acquisition component of the earphone, and if the earphone does not comprise the audio acquisition component, starting the audio acquisition component of the terminal;
a capture module configured to capture ambient audio by the audio capture component;
the playing module is configured to acquire the current playing volume of the terminal when the decibel value of the acquired environmental audio exceeds a preset decibel value;
the determining module is configured to acquire the current movement speed of the terminal; determining a target adjusting proportion coefficient corresponding to the current movement speed based on a corresponding relation between the movement speed and the adjusting proportion coefficient, wherein in the corresponding relation, the larger the movement speed is, the larger the corresponding adjusting proportion coefficient is, and the adjusting proportion coefficient is in a set adjusting range;
a play module configured to determine a target play volume based on the play volume and a target adjustment scaling factor; playing the collected environmental audio at the target playing volume through the earphone;
an alert module configured to: inputting the environment audio played by the earphone into an audio type identification model to obtain an audio type corresponding to the environment audio played by the earphone; if the audio type is the audio type to be prompted and the amplitude of the environmental audio is greater than the amplitude threshold value, an alarm audio is played through the earphone; and when the earphone plays the alarm audio, the earphone stops playing the environmental audio.
4. The apparatus of claim 3, wherein the playback module is configured to:
and multiplying the playing volume by a target adjusting proportion coefficient to obtain the target playing volume.
5. A computer device comprising a processor and a memory, the memory having stored therein at least one instruction, the at least one instruction being loaded and executed by the processor to perform operations performed by the method of controlling a headset of any of claims 1-2.
6. A computer-readable storage medium having stored therein at least one instruction, which is loaded and executed by a processor to perform operations performed by the method of controlling a headset of any one of claims 1 to 2.
CN201911102045.9A 2019-11-12 2019-11-12 Method, device and equipment for controlling earphone and storage medium Active CN110708630B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911102045.9A CN110708630B (en) 2019-11-12 2019-11-12 Method, device and equipment for controlling earphone and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911102045.9A CN110708630B (en) 2019-11-12 2019-11-12 Method, device and equipment for controlling earphone and storage medium

Publications (2)

Publication Number Publication Date
CN110708630A CN110708630A (en) 2020-01-17
CN110708630B true CN110708630B (en) 2021-09-14

Family

ID=69205099

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911102045.9A Active CN110708630B (en) 2019-11-12 2019-11-12 Method, device and equipment for controlling earphone and storage medium

Country Status (1)

Country Link
CN (1) CN110708630B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021159369A1 (en) * 2020-02-13 2021-08-19 深圳市汇顶科技股份有限公司 Hearing aid method and apparatus for noise reduction, chip, earphone and storage medium
CN111432305A (en) * 2020-03-27 2020-07-17 歌尔科技有限公司 Earphone alarm method and device and wireless earphone
CN112218201B (en) * 2020-09-30 2022-02-11 珠海格力电器股份有限公司 Monitoring method, device, equipment and storage medium
WO2023283965A1 (en) * 2021-07-16 2023-01-19 华为技术有限公司 Method and apparatus for listening to speech by using device instead of ears, method and apparatus for generating speech recognition model, electronic device, and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101420486A (en) * 2008-10-13 2009-04-29 闻泰集团有限公司 Mobile phone capable of automatically regulating earpiece volume based on movement velocity and method thereof
CN103825993A (en) * 2014-03-11 2014-05-28 宇龙计算机通信科技(深圳)有限公司 Method and device for treating environment sound during conversation
CN105025417A (en) * 2015-07-28 2015-11-04 Tcl集团股份有限公司 Method and system for automatically adjusting earphone volume according to positioning information
CN106055304A (en) * 2016-06-08 2016-10-26 乐视控股(北京)有限公司 Volume regulating method and device for earphone

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7903826B2 (en) * 2006-03-08 2011-03-08 Sony Ericsson Mobile Communications Ab Headset with ambient sound
CN204377107U (en) * 2015-02-09 2015-06-03 东莞市瀛通电线有限公司 A kind of sports earphones according to motion state automatic regulating volume
CN106126058A (en) * 2016-06-17 2016-11-16 北京小米移动软件有限公司 Based reminding method and device
CN106791109A (en) * 2016-12-23 2017-05-31 维沃移动通信有限公司 A kind of sound prompting method and mobile terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101420486A (en) * 2008-10-13 2009-04-29 闻泰集团有限公司 Mobile phone capable of automatically regulating earpiece volume based on movement velocity and method thereof
CN103825993A (en) * 2014-03-11 2014-05-28 宇龙计算机通信科技(深圳)有限公司 Method and device for treating environment sound during conversation
CN105025417A (en) * 2015-07-28 2015-11-04 Tcl集团股份有限公司 Method and system for automatically adjusting earphone volume according to positioning information
CN106055304A (en) * 2016-06-08 2016-10-26 乐视控股(北京)有限公司 Volume regulating method and device for earphone

Also Published As

Publication number Publication date
CN110708630A (en) 2020-01-17

Similar Documents

Publication Publication Date Title
CN110971930B (en) Live virtual image broadcasting method, device, terminal and storage medium
CN108401124B (en) Video recording method and device
CN110764730B (en) Method and device for playing audio data
CN110708630B (en) Method, device and equipment for controlling earphone and storage medium
CN111050250B (en) Noise reduction method, device, equipment and storage medium
CN110618805B (en) Method and device for adjusting electric quantity of equipment, electronic equipment and medium
CN111107389B (en) Method, device and system for determining live broadcast watching time length
CN112965683A (en) Volume adjusting method and device, electronic equipment and medium
CN109635133B (en) Visual audio playing method and device, electronic equipment and storage medium
CN111105769B (en) Method, device, equipment and storage medium for detecting intermediate frequency rhythm point of audio
CN111031170A (en) Method, apparatus, electronic device and medium for selecting communication mode
CN110688082A (en) Method, device, equipment and storage medium for determining adjustment proportion information of volume
CN110856152A (en) Method, device, electronic equipment and medium for playing audio data
CN111092991B (en) Lyric display method and device and computer storage medium
CN110956580A (en) Image face changing method and device, computer equipment and storage medium
CN109353297B (en) Volume adjustment method, device and computer readable storage medium
CN108401194B (en) Time stamp determination method, apparatus and computer-readable storage medium
CN110933454B (en) Method, device, equipment and storage medium for processing live broadcast budding gift
CN110136752B (en) Audio processing method, device, terminal and computer readable storage medium
CN109005359B (en) Video recording method, apparatus and storage medium
CN108966026B (en) Method and device for making video file
CN108196813B (en) Method and device for adding sound effect
CN110808021A (en) Audio playing method, device, terminal and storage medium
CN110708582B (en) Synchronous playing method, device, electronic equipment and medium
CN113706807B (en) Method, device, equipment and storage medium for sending alarm information

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