CN111432305A - Earphone alarm method and device and wireless earphone - Google Patents

Earphone alarm method and device and wireless earphone Download PDF

Info

Publication number
CN111432305A
CN111432305A CN202010229644.3A CN202010229644A CN111432305A CN 111432305 A CN111432305 A CN 111432305A CN 202010229644 A CN202010229644 A CN 202010229644A CN 111432305 A CN111432305 A CN 111432305A
Authority
CN
China
Prior art keywords
earphone
audio data
sound
preset
microphone
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.)
Pending
Application number
CN202010229644.3A
Other languages
Chinese (zh)
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.)
Goertek Techology Co Ltd
Original Assignee
Goertek Techology 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 Goertek Techology Co Ltd filed Critical Goertek Techology Co Ltd
Priority to CN202010229644.3A priority Critical patent/CN111432305A/en
Publication of CN111432305A publication Critical patent/CN111432305A/en
Pending legal-status Critical Current

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
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS OR SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING; SPEECH OR AUDIO CODING OR DECODING
    • G10L25/00Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00
    • G10L25/03Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the type of extracted parameters
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS OR SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING; SPEECH OR AUDIO CODING OR DECODING
    • G10L25/00Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00
    • G10L25/48Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 specially adapted for particular use
    • G10L25/51Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 specially adapted for particular use for comparison or discrimination
    • 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/1083Reduction of ambient noise
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R3/00Circuits for transducers, loudspeakers or microphones

Abstract

The invention discloses an earphone warning method, which comprises the following steps: acquiring audio data collected by a preset microphone on the earphone; the preset microphone is used for collecting external environment sound; judging whether the audio data contains preset dangerous case sounds or not; the preset dangerous case sound comprises a horn sound of a vehicle; if yes, playing an alarm warning tone by using a microphone on the earphone; according to the invention, the external environment sound collected by the microphone in the earphone is utilized, and when the external environment sound contains dangerous case sound such as vehicle horn sound, the microphone on the earphone is utilized to play the warning sound to prompt that the environment where the user is located has potential safety hazard, so that the potential safety hazard generated by the user using the earphone due to the fact that the user cannot hear the dangerous case sound is reduced or even avoided, and the use safety of the earphone is improved. In addition, the invention also discloses an earphone alarm device and a wireless earphone, and the earphone alarm device and the wireless earphone also have the beneficial effects.

Description

Earphone alarm method and device and wireless earphone
Technical Field
The invention relates to the technical field of portable listening equipment, in particular to an earphone alarming method and device and a wireless earphone.
Background
As a noise reduction earphone is an earphone which achieves noise reduction by using a certain method, the noise reduction earphone can be classified into an active noise reduction earphone and a passive noise reduction earphone according to the product type at present. The traditional earphone can not inhibit the noise of the environment such as subway, engine room and the like, so that the user can hear the ambient noise while listening to music, thereby greatly reducing the experience of relaxing by using music; the noise reduction earphone effectively solves the problem, and a user can keep away from noisy noise by using the noise reduction earphone, so that the user can enjoy music in a 'quiet' environment, and can adjust mood and expand thinking.
In the prior art, due to the good experience of the noise reduction earphone, a user abuses the noise reduction earphone to a certain extent, so that safety hidden dangers can be brought invisibly, for example, a driver presses a horn of a vehicle on a city street, the user receives very small dangerous sound, even cannot hear the dangerous sound, and personal safety accidents are caused. Therefore, how to reduce or even avoid the potential safety hazard caused by the fact that a user using the earphone cannot hear dangerous sounds is an urgent problem to be solved nowadays.
Disclosure of Invention
The invention aims to provide an earphone warning method, an earphone warning device and a wireless earphone, so that potential safety hazards caused by the fact that a user using the earphone cannot hear dangerous sounds are reduced or even avoided, and the use safety of the earphone is improved.
In order to solve the above technical problem, the present invention provides an earphone warning method, including:
acquiring audio data collected by a preset microphone on the earphone; the preset microphone is used for collecting external environment sound;
judging whether the audio data contains preset dangerous case sounds or not; wherein the preset dangerous case sound comprises a horn sound of a vehicle;
and if so, playing an alarm prompt tone by using a microphone on the earphone.
Optionally, the determining whether the audio data includes a preset dangerous case sound includes:
preprocessing the audio data to obtain data to be detected;
judging whether the audio data contains preset dangerous case sounds or not by using a machine learning model according to the data to be detected;
and if so, executing the step of playing an alarm prompt tone by using a microphone on the earphone.
Optionally, the preprocessing the audio data to obtain data to be detected includes:
performing audio frequency spectrum processing on the audio data to obtain a spectrogram;
carrying out gray level transformation processing on the spectrogram to obtain a spectrogram gray level image;
and segmenting and slicing the voice spectrum gray level image to obtain the data to be detected.
Optionally, the audio spectrum processing on the audio data to obtain a spectrogram includes:
and carrying out short-time Fourier transform processing on the audio data to obtain the spectrogram.
Optionally, the generating process of the machine learning model includes:
acquiring an original audio data set of the sound of a vehicle horn; the original audio data set comprises original audio data corresponding to horn sounds of the vehicle collected in the running process of the vehicle relative to an audio collection point;
preprocessing each original audio data in the original audio data set to obtain a data set to be processed;
splitting the data set to be processed according to a preset proportion to obtain a training set and a test set;
and training the established original machine learning model by using the data to be processed in the training set, and testing the original machine learning model by using the data to be processed in the testing set to obtain the machine learning model.
Optionally, before determining whether the audio data includes a preset dangerous case sound, the method further includes:
judging whether the earphone is in an outdoor use scene or not according to the audio data;
and if so, executing the step of judging whether the audio data contains preset dangerous case sound.
Optionally, before acquiring the audio data collected by the preset microphone on the earphone, the method further includes:
judging whether to start an active noise reduction function of the earphone;
and if so, executing the step of acquiring the audio data acquired by the preset microphone on the earphone.
The invention also provides an earphone warning device, which comprises:
the acquisition module is used for acquiring audio data acquired by a preset microphone on the earphone; the preset microphone is used for collecting external environment sound;
the judging module is used for judging whether the audio data contains preset dangerous case sound;
and the prompting module is used for playing a warning prompt tone by using a microphone on the earphone if the preset dangerous case sound is contained.
Optionally, the determining module includes:
the preprocessing submodule is used for preprocessing the audio data to obtain data to be detected;
the model judgment submodule is used for judging whether the audio data contain preset dangerous case sounds or not by utilizing a machine learning model according to the data to be detected; and if so, sending a starting signal to the prompting module.
The present invention also provides a wireless headset, comprising: a speaker, a microphone, a memory, and a processor; wherein the memory is used for storing a computer program, and the processor is used for implementing the steps of the earphone warning method when executing the computer program.
The invention provides an earphone warning method, which comprises the following steps: acquiring audio data collected by a preset microphone on the earphone; the preset microphone is used for collecting external environment sound; judging whether the audio data contains preset dangerous case sounds or not; the preset dangerous case sound comprises a horn sound of a vehicle; if yes, playing an alarm warning tone by using a microphone on the earphone;
therefore, the invention utilizes the external environment sound collected by the microphone in the earphone, and when the external environment sound contains dangerous case sound such as vehicle horn sound, the microphone on the earphone is utilized to play the alarm warning sound to prompt the user that the environment has potential safety hazard, thereby reducing or even avoiding the potential safety hazard generated by the user using the earphone because the user cannot hear the dangerous case sound, and improving the use safety of the earphone. In addition, the invention also provides an earphone warning device and a wireless earphone, and the earphone warning device and the wireless earphone also have the beneficial effects.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of an earphone alerting method according to an embodiment of the present invention;
fig. 2 is a flowchart of another earphone alerting method according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating a generation process of a machine learning model of an earphone warning method according to an embodiment of the present invention;
FIG. 4 is a waveform of audio data of a horn sound of a vehicle according to an embodiment of the present invention;
FIG. 5 is a spectrogram of audio data of the horn sound of the vehicle shown in FIG. 4;
FIG. 6 is a speech spectral gray scale of audio data for the horn sound of the vehicle shown in FIG. 4;
FIG. 7 is a speech spectral gray scale of 0-0.5s audio data for the vehicle horn sound shown in FIG. 4;
FIG. 8 is a speech spectral gray scale of 0.5-1s audio data for the vehicle horn sound shown in FIG. 4;
FIG. 9 is a speech spectral gray scale of 1-1.5s audio data for the vehicle horn sound shown in FIG. 4;
FIG. 10 is a speech spectral gray scale of 1.5-2s audio data for the vehicle horn sound shown in FIG. 4;
FIG. 11 is a speech spectral gray scale of 2-2.5s audio data of the vehicle horn sound shown in FIG. 4;
fig. 12 is a schematic diagram of a machine learning model of an earphone alerting method according to an embodiment of the present invention;
FIG. 13 is a schematic diagram of a prior art SVM model;
fig. 14 is a block diagram of an earphone alarm device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart of an earphone warning method according to an embodiment of the present invention.
The method can comprise the following steps:
step 101: acquiring audio data collected by a preset microphone on the earphone; the preset microphone is used for collecting external environment sounds.
It can be understood that the preset microphone in this step may be a microphone that is arranged on the earphone and can collect external environment sound, that is, the audio data collected by the preset microphone in this embodiment may be audio data corresponding to the external environment sound.
Specifically, the specific setting position and type of the preset microphone are not limited in this embodiment, and when the earphone in this embodiment is an active noise reduction earphone, the preset microphone may be a microphone originally set in the active noise reduction earphone and used for collecting external environment sounds, such as a feedforward noise reduction microphone in a hybrid noise reduction earphone or a feedforward noise reduction earphone, so as to avoid setting an additional microphone and reduce the hardware cost of the earphone; the preset microphone may also be a microphone additionally arranged in the active noise reduction earphone or the passive noise reduction earphone and used for collecting external environment sound, as long as the preset microphone arranged on the earphone can collect audio data corresponding to the external environment condition, and this embodiment does not limit this.
It should be noted that the earphone warning method provided in this embodiment may be a method for a processor in an earphone, such as a single chip microcomputer, to utilize audio data collected by a preset microphone, and when the audio data includes a preset dangerous case sound, control the microphone to play a warning alert tone to warn a user; or, a processor in a terminal (such as a smart phone) connected to the headset may utilize audio data collected by a preset microphone in the headset, and control the microphone in the headset to play an alarm sound when the audio data includes a preset dangerous sound, so as to perform an alarm for a user. The present embodiment does not set any limit to this.
Correspondingly, the specific process of acquiring the audio data acquired by the preset microphone on the earphone by the processor in the step can be set by a designer according to a practical scene and user requirements, for example, the processor in the earphone can directly receive the audio data acquired by the preset microphone; the processor in the terminal may receive the audio data collected by the preset microphone in the earphone through connection with the earphone, for example, the processor in the mobile phone connected in pair with the wireless earphone may receive the audio data collected by the preset microphone sent by the wireless earphone.
Specifically, the embodiment does not limit the specific manner in which the processor acquires the audio data collected by the preset microphone on the earphone, for example, the processor may directly acquire the audio data collected by the preset microphone on the earphone at preset time intervals. Because when the active noise reduction function of the active noise reduction earphone is not started, the user can also hear certain external environment sound even if wearing the active noise reduction earphone, so as to reduce the power consumption of the earphone, when the earphone in the embodiment is the active noise reduction earphone, the processor can also acquire the audio data collected by the preset microphone on the earphone according to the preset time interval only when the active noise reduction function of the earphone is started. That is, the step may further include a step of determining whether to start an active noise reduction function of the earphone; if the active noise reduction function of the earphone is started, the step can be carried out to obtain audio data collected by a preset microphone on the earphone; if the active noise reduction function of the earphone is not started, the method can be directly finished, and the electric quantity loss of the earphone is reduced.
Because the user often listens to dangerous sounds such as vehicle horn sounds when the user is outdoors, in order to reduce power consumption caused by detection of preset dangerous sounds in the audio data, the processor can judge whether the earphone is in an outdoor use scene according to the audio data after the step, for example, when the volume in the audio data is greater than a preset value, the user is determined to wear the earphone outdoors; if the audio data is in the outdoor use scene, the step 102 is entered to judge whether the audio data contains the preset dangerous case sound; if the earphone is not in an outdoor use scene, the operation can be finished directly, and the electric quantity loss of the earphone is reduced. For example, the processor may acquire audio data acquired by a preset microphone on the earphone at a first preset time interval, and then determine whether the earphone is in an outdoor use scene by using the audio data acquired at the first preset time interval; if the earphone is in an outdoor use scene, acquiring audio data acquired by a preset microphone on the earphone according to a second preset time interval, and judging whether the audio data contains preset dangerous case sound or not by using the audio data acquired according to the second preset time interval; if the mobile terminal is not in the outdoor use scene, the operation can be directly finished, and audio data acquired at the next preset time interval are waited; the second preset time interval is smaller than the first preset time interval so as to reduce the power consumption.
Specifically, the specific content of the audio data obtained in this step may be set by a designer according to a use scene and a user requirement, for example, the audio data may be 2.5s of data collected by a preset sensor at a sampling rate of 48000Hz, as long as the processor can determine whether the audio data includes a preset dangerous sound by using the obtained audio data, which is not limited in this embodiment.
Step 102: judging whether the audio data contains preset dangerous case sounds or not; if yes, go to step 103; if not, go to step 101.
The preset dangerous case sound in the step can be a preset environment sound corresponding to a scene with potential safety hazard when a user wears and uses the earphone; that is, when the preset dangerous sound appears in the external environment, the user may not hear the preset dangerous sound and thus may generate a potential safety hazard. The specific content of the preset dangerous case sound can be set by a designer according to a practical scene and user requirements, for example, the preset dangerous case sound can only comprise a vehicle horn sound, and can also comprise other sounds such as an alarm bell sound and a buzzer sound.
Specifically, the specific manner in which the processor determines whether the audio data includes the preset dangerous sound in the step may be set by a designer, for example, the processor may directly use the audio data collected by the preset microphone to determine whether the audio data includes the preset dangerous sound; for example, because the volume of the preset dangerous case sound such as the horn sound of the vehicle is often large, the processor may directly include the volume in the audio data that is larger than the safety value, and determine that the preset dangerous case sound is included in the audio data. In order to reduce the amount of computation on the basis of ensuring the accuracy of the preset dangerous case sound, the processor may also perform preprocessing on the audio data acquired by the preset microphone to obtain the data to be detected corresponding to the audio data, and then determine whether the audio data contains the preset dangerous case sound by using the data to be detected; for example, the processor preprocesses the audio data to obtain data to be detected; and judging whether the audio data contains preset dangerous case sounds or not by using a machine learning model according to the data to be detected. As long as the processor can determine whether the audio data includes the preset dangerous case sound by using the audio data collected by the preset microphone, the embodiment does not limit this.
It should be noted that, when the processor determines that the audio data does not include the preset dangerous case sound in this step, the process may directly return to step 101 to wait for receiving the audio data at the next moment again.
Step 103: and playing an alarm prompt tone by using a microphone on the earphone.
It can be understood that, the purpose of this step may be to play an alarm sound by using a microphone on the earphone when the processor determines that the audio data includes the preset dangerous case sound, so as to prompt that the current environment where the user wearing the earphone is located has a potential safety hazard, thereby reducing or even avoiding the potential safety hazard generated by the user using the earphone due to the fact that the user cannot hear the dangerous case sound, and improving the safety of the earphone.
Specifically, the specific content of the alarm alert tone played by the microphone on the earphone in this step may be set by a designer or a user, and if the preset dangerous case sound includes a plurality of dangerous case sounds such as a vehicle horn sound and an alarm bell sound, the processor may play the alarm alert tone corresponding to the preset dangerous case sound by using the microphone on the earphone according to the preset dangerous case sound included in the audio data, that is, each preset dangerous case sound may correspond to one alarm alert tone, so as to prompt the user of a specific potential safety hazard in the current environment; the processor can also directly use the microphone on the earphone to play a preset alarm prompt tone, such as a voice text prompt tone or an alarm prompt tone.
It should be noted that, in this embodiment, when determining that the audio data includes the preset dangerous situation sound, the processor may not only play the warning sound by using the microphone on the earphone, but also directly turn off or temporarily turn off the active noise reduction function of the earphone, so that the user can hear external sound better when there is a potential safety hazard in the environment where the user is located.
In the embodiment of the invention, the external environment sound collected by the microphone in the earphone is utilized, and when the external environment sound contains dangerous case sound such as vehicle horn sound, the microphone on the earphone is utilized to play the warning sound to prompt that the environment where the user is located has potential safety hazard, so that the potential safety hazard generated by the user using the earphone due to the fact that the user cannot hear the dangerous case sound is reduced or even avoided, and the use safety of the earphone is improved.
Referring to fig. 2, fig. 2 is a flowchart of another earphone alerting method according to an embodiment of the present invention.
The method can comprise the following steps:
step 201: acquiring audio data collected by a preset microphone on the earphone; the preset microphone is used for collecting external environment sounds.
The step is similar to step 101, and is not described herein again.
Step 202: and preprocessing the audio data to obtain data to be detected.
It can be understood that the purpose of this step may be to obtain the data to be detected corresponding to the audio data, which may be used as the input of the machine learning model, by preprocessing the audio data collected by the preset microphone.
Correspondingly, the specific preprocessing mode of the processor for the audio data in the step, namely the specific content of the data to be detected, can be set by a designer according to the use scene and the user requirements, for example, the preprocessing mode can include audio spectrum processing and segmentation slicing; that is, the processor may first perform audio spectrum processing on the audio data to obtain a spectrogram corresponding to the audio data; then, segmenting and slicing the spectrogram to obtain data to be detected corresponding to the spectrogram; namely, the data to be detected can be segmentation block data of a spectrogram. Because the spectrogram is colorful, the included data amount is large, and in order to reduce the data amount of the operation of the machine learning model, the preprocessing mode can also comprise audio frequency spectrogram processing, gray level transformation processing and slice segmentation; that is, the processor may first perform audio spectrum processing on the audio data to obtain a spectrogram corresponding to the audio data; then carrying out gray level transformation processing on the spectrogram to obtain a spectrogram gray level image corresponding to the spectrogram; then, segmenting and slicing the spectrum gray-scale image to obtain data to be detected corresponding to the spectrum gray-scale image; namely, the data to be detected can be segmentation block data of a speech spectrum gray scale image. As long as the processor can obtain the to-be-detected data that can be used by the machine learning model corresponding to the audio data by preprocessing the audio data, this embodiment does not limit this.
Specifically, the embodiment does not limit the specific preprocessing process performed on the audio data by the processor, for example, the processor may first use short-time fourier transform to perform audio spectrum processing on the audio data, that is, perform short-time fourier transform processing on the audio data to obtain a spectrogram corresponding to the audio data; then carrying out gray level transformation processing on the spectrogram to obtain a spectrogram gray level image corresponding to the spectrogram; then, the obtained speech spectrum gray scale map is segmented and sliced according to the segmentation modes such as pixel segmentation or time segmentation, and the speech spectrum gray scale map is segmented into segmentation block data with the size of the input data amount of the machine learning model, that is, data to be detected, for example, the speech spectrum gray scale map corresponding to 2.5s of audio data can be segmented into 5 data to be detected according to the time segmentation of 500ms, that is, the speech spectrum gray scale map of 0-0.5s, the speech spectrum gray scale map of 0.5s-1.0s, the speech spectrum gray scale map of 1.0s-1.5s, the speech spectrum gray scale map of 1.5s-2.0s, and the speech spectrum gray scale map of 2.0s-2.5 s.
Step 203: judging whether the audio data contains preset dangerous case sounds or not by using a machine learning model according to the data to be detected; if yes, go to step 204; if not, go to step 204.
It can be understood that the purpose of this step may be that the processor determines whether the audio data includes the preset dangerous case sound by inputting the obtained data to be detected into the machine learning model and using the machine learning model, that is, the processor may determine whether the audio data includes the preset dangerous case sound according to the output result of the machine learning model, so as to determine whether to alarm the user by using the microphone on the earphone.
Specifically, the method provided by this embodiment may further include a generation process of the machine learning model, that is, an establishment and training process before the machine learning model is applied. If the predetermined dangerous situation sounds include a horn sound of a vehicle, the steps shown in fig. 3 may be employed to generate a machine learning model, including:
step 301: acquiring an original audio data set of the sound of a vehicle horn; the original audio data set comprises original audio data corresponding to horn sounds of the vehicle collected in the running process of the vehicle relative to the audio collection points.
It is understood that in this step, horn sound data (original audio data) of different vehicles can be obtained as much as possible to constitute an original audio data set. Because different vehicles can be driven on the city streets, such as cars, SUVs, delivery trucks, emergency vehicles, electric vehicles, bicycles and other types, the tone and volume parameters of the horns of different types and brands of vehicles are inconsistent, even because the distance between an observer and the vehicle is changed due to the influence of Doppler effect, the received tone is also changed. Therefore, when the original audio data in the original audio data set is acquired in this step, the speaker sounds of different vehicles are acquired not only statically, but also dynamically acquired in the driving process of the vehicle relative to the audio acquisition point.
Step 302: and preprocessing each original audio data in the original audio data set to obtain a data set to be processed.
In this step, the same or similar preprocessing process as that in step 202 may be adopted to preprocess each original audio data in the original audio data set, so as to obtain a set of to-be-processed data corresponding to all the original audio data, that is, a to-be-processed data set.
Specifically, since the audio data (original audio data) of the vehicle horn sound obtained by the general acquisition is binaural, and the difference between two sets of data of the binaural is not great, taking the preprocessing of one set of original audio data as an example, the original audio data can be read, the sampling rate is 48000Hz, the total time of the sound source is about 2.5s, and the waveform is shown in fig. 4; performing short-time fourier transform processing on the original audio data to obtain a spectrogram corresponding to the original audio data, as shown in fig. 5; performing gray level transformation processing on the obtained spectrogram to obtain a spectrogram gray level image, as shown in fig. 6; the obtained speech spectrum gray scale map is segmented and sliced to obtain data to be processed, for example, the speech spectrum gray scale map corresponding to 2.5s of original audio data is segmented into 5 data to be processed according to the time segmentation of 500ms, which are respectively a speech spectrum gray scale map of 0-0.5s, a speech spectrum gray scale map of 0.5s-1.0s, a speech spectrum gray scale map of 1.0s-1.5s, a speech spectrum gray scale map of 1.5s-2.0s and a speech spectrum gray scale map of 2.0s-2.5s, as shown in fig. 7, 8, 9, 10 and 11.
Step 303: and splitting the data set to be processed according to a preset proportion to obtain a training set and a test set.
In this step, all the data to be processed in the data set to be processed corresponding to the original audio data set may be split into a training set and a test set according to a certain ratio (according to a preset ratio). If the preset proportion can be two thirds to one third, namely two thirds of the data to be processed are divided into a training set, and one third of the data to be processed is divided into a testing set; the predetermined ratio may also be four fifths to one fifth, or other ratios.
Step 304: and training the established original machine learning model by using the data to be processed in the training set, and testing the original machine learning model by using the data to be processed in the testing set to obtain the machine learning model.
Specifically, in this step, original machine learning may be established, as shown in fig. 12, a machine learning model may determine, according to segmented block data (i.e., data to be detected or data to be processed) of an Input (Input) speech spectrum grayscale map, whether audio data includes a preset dangerous case sound by using a State model (State Mode) obtained by machine learning, Output a signal (Alarm On or Off) corresponding to a determination result, and Output an Alarm signal (Alarm On) if the determination result is that the audio data includes the preset dangerous case sound; if the judgment result is that the preset dangerous case sound is not contained, an Alarm-free signal (Alarm Off) can be output.
Correspondingly, there are many methods for Machine learning, and in this embodiment, as shown in fig. 13, a model of a Support Vector Machine (SVM) is taken as an example, but the method is not limited to the implementation of the support vector Machine model, and may also include the implementation of other models.
It can be understood that, in this step, the machine learning model is trained by using the to-be-processed data in the training set, and the to-be-processed data in the test set is used for testing, so as to improve the accuracy of the training, and finally the machine learning model required in step 203 is obtained, thereby completing the generation process of the machine learning model.
It should be noted that, as shown in fig. 12, after the processor inputs the data to be detected into the machine learning model in step 203, it may determine whether the audio data includes the preset dangerous case sound according to the signal (Alarm On or Off) output by the machine learning model, and when the machine learning model outputs the Alarm signal (Alarm On), the processor may determine that the audio data includes the preset dangerous case sound, so as to enter step 204, and Alarm the user; when the machine learning model outputs the Alarm Off signal, the processor may determine that the audio data does not include the preset dangerous case sound, and return to step 201 again to wait for receiving the audio data at the next moment again.
Step 204: and playing an alarm prompt tone by using a microphone on the earphone.
Here, this step is similar to step 103, and is not described herein again.
In the embodiment of the invention, the machine learning model is utilized to process the data to be detected corresponding to the audio data, whether the audio data contain the preset dangerous case sound is judged, the operation amount is reduced on the basis of ensuring the accuracy of the preset dangerous case sound, and the accuracy and timeliness of the earphone warning are improved.
Referring to fig. 14, fig. 14 is a block diagram of an earphone alarm device according to an embodiment of the present invention. The apparatus may include:
the acquisition module 10 is used for acquiring audio data acquired by a preset microphone on the earphone; the preset microphone is used for collecting external environment sound;
the judging module 20 is configured to judge whether the audio data includes a preset dangerous case sound;
and the prompting module 30 is used for playing a warning prompt sound by using a microphone on the earphone if the preset dangerous case sound is contained.
Optionally, the determining module 20 may include:
the preprocessing submodule is used for preprocessing the audio data to obtain data to be detected;
the model judgment submodule is used for judging whether the audio data contain preset dangerous case sound or not by utilizing the machine learning model according to the data to be detected; and if so, sending a starting signal to the prompting module.
Optionally, the preprocessing submodule may include:
the voice spectrum processing unit is used for carrying out audio voice spectrum processing on the audio data to obtain a voice spectrum;
the grayscale conversion unit is used for performing grayscale conversion processing on the spectrogram to obtain a spectrogram grayscale image;
and the segmentation and slicing unit is used for segmenting and slicing the spectrum gray level image to obtain the data to be detected.
Optionally, the speech spectrum processing unit may be specifically configured to perform short-time fourier transform processing on the audio data to obtain a speech spectrum.
Optionally, the apparatus may further include:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring an original audio data set of the sound of a vehicle horn; the original audio data set comprises original audio data corresponding to horn sounds of the vehicle collected in the running process of the vehicle relative to the audio collection points;
the preprocessing module is used for preprocessing each original audio data in the original audio data set to obtain a data set to be processed;
the splitting module is used for splitting the data set to be processed according to a preset proportion to obtain a training set and a test set;
and the training module is used for training the established original machine learning model by using the data to be processed in the training set and testing the original machine learning model by using the data to be processed in the testing set to obtain the machine learning model.
Optionally, the apparatus may further include:
the scene judging module is used for judging whether the earphone is in an outdoor use scene or not according to the audio data; if yes, a start signal is sent to the determination module 20.
Optionally, the apparatus may further include:
the noise reduction judging module is used for judging whether to start the active noise reduction function of the earphone; if yes, a start signal is sent to the determination module 20.
In the embodiment of the invention, the external environment sound collected by the microphone in the earphone is utilized, and when the external environment sound contains dangerous case sound such as vehicle horn sound, the microphone on the earphone is utilized to play the warning sound to prompt that the environment where the user is located has potential safety hazard, so that the potential safety hazard generated by the user using the earphone due to the fact that the user cannot hear the dangerous case sound is reduced or even avoided, and the use safety of the earphone is improved.
An embodiment of the present invention further provides a wireless headset, including: a speaker, a microphone, a memory, and a processor; wherein, the memory is used for storing computer programs, and the processor is used for implementing the steps of the earphone warning method provided by any one of the above embodiments when executing the computer programs.
Wherein, the microphone in the wireless headset of this embodiment may be the preset microphone in the above-mentioned embodiment,
in addition, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the earphone alert method provided in the foregoing embodiment.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device, the wireless headset and the computer-readable storage medium disclosed by the embodiment correspond to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the description of the method part.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The earphone warning method, the earphone warning device and the wireless earphone provided by the invention are described in detail above. The principles and embodiments of the present invention are explained herein using specific examples, which are presented only to assist in understanding the method and its core concepts. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.

Claims (10)

1. An earphone warning method, comprising:
acquiring audio data collected by a preset microphone on the earphone; the preset microphone is used for collecting external environment sound;
judging whether the audio data contains preset dangerous case sounds or not; wherein the preset dangerous case sound comprises a horn sound of a vehicle;
and if so, playing an alarm prompt tone by using a microphone on the earphone.
2. The method of claim 1, wherein the determining whether the audio data includes a preset dangerous sound comprises:
preprocessing the audio data to obtain data to be detected;
judging whether the audio data contains preset dangerous case sounds or not by using a machine learning model according to the data to be detected;
and if so, executing the step of playing an alarm prompt tone by using a microphone on the earphone.
3. The method for earphone alerting according to claim 2, wherein the preprocessing the audio data to obtain the data to be detected comprises:
performing audio frequency spectrum processing on the audio data to obtain a spectrogram;
carrying out gray level transformation processing on the spectrogram to obtain a spectrogram gray level image;
and segmenting and slicing the voice spectrum gray level image to obtain the data to be detected.
4. The method of claim 3, wherein the audio processing the audio data to obtain a spectrogram comprises:
and carrying out short-time Fourier transform processing on the audio data to obtain the spectrogram.
5. The headset alert method of claim 2, wherein the generation process of the machine learning model comprises:
acquiring an original audio data set of the sound of a vehicle horn; the original audio data set comprises original audio data corresponding to horn sounds of the vehicle collected in the running process of the vehicle relative to an audio collection point;
preprocessing each original audio data in the original audio data set to obtain a data set to be processed;
splitting the data set to be processed according to a preset proportion to obtain a training set and a test set;
and training the established original machine learning model by using the data to be processed in the training set, and testing the original machine learning model by using the data to be processed in the testing set to obtain the machine learning model.
6. The earphone warning method according to any one of claims 1 to 5, wherein before the determining whether the audio data contains a preset dangerous situation sound, further comprising:
judging whether the earphone is in an outdoor use scene or not according to the audio data;
and if so, executing the step of judging whether the audio data contains preset dangerous case sound.
7. The method for alarming of an earphone according to any one of claims 1 to 5, wherein before the acquiring the audio data collected by a preset microphone on the earphone, the method further comprises:
judging whether to start an active noise reduction function of the earphone;
and if so, executing the step of acquiring the audio data acquired by the preset microphone on the earphone.
8. An earphone alerting device, comprising:
the acquisition module is used for acquiring audio data acquired by a preset microphone on the earphone; the preset microphone is used for collecting external environment sound;
the judging module is used for judging whether the audio data contains preset dangerous case sound;
and the prompting module is used for playing a warning prompt tone by using a microphone on the earphone if the preset dangerous case sound is contained.
9. The earphone warning device of claim 8, wherein the determining module comprises:
the preprocessing submodule is used for preprocessing the audio data to obtain data to be detected;
the model judgment submodule is used for judging whether the audio data contain preset dangerous case sounds or not by utilizing a machine learning model according to the data to be detected; and if so, sending a starting signal to the prompting module.
10. A wireless headset, comprising: a speaker, a microphone, a memory, and a processor; wherein the memory is adapted to store a computer program, and the processor is adapted to implement the steps of the headset alert method according to any of claims 1 to 7 when executing the computer program.
CN202010229644.3A 2020-03-27 2020-03-27 Earphone alarm method and device and wireless earphone Pending CN111432305A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010229644.3A CN111432305A (en) 2020-03-27 2020-03-27 Earphone alarm method and device and wireless earphone

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010229644.3A CN111432305A (en) 2020-03-27 2020-03-27 Earphone alarm method and device and wireless earphone

Publications (1)

Publication Number Publication Date
CN111432305A true CN111432305A (en) 2020-07-17

Family

ID=71548965

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010229644.3A Pending CN111432305A (en) 2020-03-27 2020-03-27 Earphone alarm method and device and wireless earphone

Country Status (1)

Country Link
CN (1) CN111432305A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111988472A (en) * 2020-08-28 2020-11-24 上海博泰悦臻网络技术服务有限公司 Method, system, medium and intelligent terminal for improving attention of user wearing earphone
CN112102829A (en) * 2020-09-04 2020-12-18 刘耀 Player control system and method based on voice recognition
CN112118506A (en) * 2020-09-29 2020-12-22 英华达(上海)科技有限公司 Earphone noise reduction mode control method, system, equipment and storage medium
CN112437372A (en) * 2020-10-28 2021-03-02 海菲曼(天津)科技有限公司 Danger alarm system chip for closed earphone
CN113286246A (en) * 2021-05-19 2021-08-20 刘智矫 Sound signal detection system and method based on earphone transmission
CN114189790A (en) * 2021-10-26 2022-03-15 荣耀终端有限公司 Audio information processing method, electronic device, system, product and medium
CN114745623A (en) * 2022-02-28 2022-07-12 歌尔股份有限公司 Danger early warning method based on earphone, earphone device and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104819846A (en) * 2015-04-10 2015-08-05 北京航空航天大学 Rolling bearing sound signal fault diagnosis method based on short-time Fourier transform and sparse laminated automatic encoder
US20170188129A1 (en) * 2015-12-24 2017-06-29 Intel Corporation Proximity sensing headphones
CN108540661A (en) * 2018-03-30 2018-09-14 广东欧珀移动通信有限公司 Signal processing method, device, terminal, earphone and readable storage medium storing program for executing
CN108564941A (en) * 2018-03-22 2018-09-21 腾讯科技(深圳)有限公司 Audio recognition method, device, equipment and storage medium
CN110602582A (en) * 2019-08-09 2019-12-20 无锡中感微电子股份有限公司 Earphone device with full-natural user interface and control method thereof
CN110634506A (en) * 2019-09-20 2019-12-31 北京小狗智能机器人技术有限公司 Voice data processing method and device
CN110708630A (en) * 2019-11-12 2020-01-17 广州酷狗计算机科技有限公司 Method, device and equipment for controlling earphone and storage medium
CN110827805A (en) * 2019-12-09 2020-02-21 苏州思必驰信息科技有限公司 Speech recognition model training method, speech recognition method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104819846A (en) * 2015-04-10 2015-08-05 北京航空航天大学 Rolling bearing sound signal fault diagnosis method based on short-time Fourier transform and sparse laminated automatic encoder
US20170188129A1 (en) * 2015-12-24 2017-06-29 Intel Corporation Proximity sensing headphones
CN108564941A (en) * 2018-03-22 2018-09-21 腾讯科技(深圳)有限公司 Audio recognition method, device, equipment and storage medium
CN108540661A (en) * 2018-03-30 2018-09-14 广东欧珀移动通信有限公司 Signal processing method, device, terminal, earphone and readable storage medium storing program for executing
CN110602582A (en) * 2019-08-09 2019-12-20 无锡中感微电子股份有限公司 Earphone device with full-natural user interface and control method thereof
CN110634506A (en) * 2019-09-20 2019-12-31 北京小狗智能机器人技术有限公司 Voice data processing method and device
CN110708630A (en) * 2019-11-12 2020-01-17 广州酷狗计算机科技有限公司 Method, device and equipment for controlling earphone and storage medium
CN110827805A (en) * 2019-12-09 2020-02-21 苏州思必驰信息科技有限公司 Speech recognition model training method, speech recognition method and device

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111988472A (en) * 2020-08-28 2020-11-24 上海博泰悦臻网络技术服务有限公司 Method, system, medium and intelligent terminal for improving attention of user wearing earphone
CN112102829A (en) * 2020-09-04 2020-12-18 刘耀 Player control system and method based on voice recognition
CN112118506A (en) * 2020-09-29 2020-12-22 英华达(上海)科技有限公司 Earphone noise reduction mode control method, system, equipment and storage medium
CN112437372A (en) * 2020-10-28 2021-03-02 海菲曼(天津)科技有限公司 Danger alarm system chip for closed earphone
CN112437372B (en) * 2020-10-28 2022-03-11 头领科技(昆山)有限公司 Danger alarm system chip for closed earphone
CN113286246A (en) * 2021-05-19 2021-08-20 刘智矫 Sound signal detection system and method based on earphone transmission
CN114189790A (en) * 2021-10-26 2022-03-15 荣耀终端有限公司 Audio information processing method, electronic device, system, product and medium
CN114189790B (en) * 2021-10-26 2022-11-29 北京荣耀终端有限公司 Audio information processing method, electronic device, system, product and medium
CN114745623A (en) * 2022-02-28 2022-07-12 歌尔股份有限公司 Danger early warning method based on earphone, earphone device and storage medium

Similar Documents

Publication Publication Date Title
CN111432305A (en) Earphone alarm method and device and wireless earphone
CN109166593B (en) Audio data processing method, device and storage medium
CN110758235B (en) Pedestrian warning device system and pedestrian warning method
JP2005292785A (en) Onboard audio system and signal processing method therefor
US9744809B2 (en) Enhanced sound generation for quiet vehicles
CN105939415A (en) Security alert method and system in external auditory masking state
CN112562742B (en) Voice processing method and device
CN111081275B (en) Terminal processing method and device based on sound analysis, storage medium and terminal
JP4483450B2 (en) Voice guidance device, voice guidance method and navigation device
KR20120078120A (en) Virtual engine sound device for an electric motor based vehicle and method for controlling the device
JP2005049773A (en) Music reproducing device
CN110503991B (en) Voice broadcasting method and device, electronic equipment and storage medium
CN112259076A (en) Voice interaction method and device, electronic equipment and computer readable storage medium
CN107343160B (en) Night motorcycle caution system
JP4977066B2 (en) Voice guidance device for vehicles
CN110704204A (en) Navigation reminding method and device based on user perception
CN110782887A (en) Voice signal processing method, system, device, equipment and computer storage medium
CN212809770U (en) Vehicle-mounted audio system
CN114078487B (en) Music playing method, device, electronic equipment and computer readable storage medium
CN115295011A (en) Sound signal processing method, device, equipment and storage medium
US11498576B2 (en) Onboard device, traveling state estimation method, server device, information processing method, and traveling state estimation system
JP2019124976A (en) Recommendation apparatus, recommendation method and recommendation program
JP2007163336A (en) Vehicle noise sound detector and method for detecting vehicle noise sound
CN116980804B (en) Volume adjustment method, device, equipment and readable storage medium
CN111739493B (en) Audio processing method, device and 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200717

RJ01 Rejection of invention patent application after publication