CN110139181B - Audio processing method and device, earphone, terminal equipment and storage medium - Google Patents

Audio processing method and device, earphone, terminal equipment and storage medium Download PDF

Info

Publication number
CN110139181B
CN110139181B CN201910362786.4A CN201910362786A CN110139181B CN 110139181 B CN110139181 B CN 110139181B CN 201910362786 A CN201910362786 A CN 201910362786A CN 110139181 B CN110139181 B CN 110139181B
Authority
CN
China
Prior art keywords
sub
band
frequency
audio
energy
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
CN201910362786.4A
Other languages
Chinese (zh)
Other versions
CN110139181A (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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication 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 Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN201910362786.4A priority Critical patent/CN110139181B/en
Publication of CN110139181A publication Critical patent/CN110139181A/en
Application granted granted Critical
Publication of CN110139181B publication Critical patent/CN110139181B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R1/00Details of transducers, loudspeakers or microphones
    • H04R1/10Earpieces; Attachments therefor ; Earphones; Monophonic headphones
    • H04R1/1025Accumulators or arrangements for charging
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R2201/00Details of transducers, loudspeakers or microphones covered by H04R1/00 but not provided for in any of its subgroups
    • H04R2201/10Details of earpieces, attachments therefor, earphones or monophonic headphones covered by H04R1/10 but not provided for in any of its subgroups

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Acoustics & Sound (AREA)
  • Signal Processing (AREA)
  • Circuit For Audible Band Transducer (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the invention discloses an audio processing method, an audio processing device, an earphone, terminal equipment and a medium, wherein the audio processing method comprises the following steps: under the condition of playing audio, acquiring an audio frame to be played, wherein the audio frame comprises a plurality of sub-frequency bands; determining the energy value of each sub-frequency band, wherein the energy values of the sub-frequency bands correspond to the hearing threshold values one to one; and performing attenuation and/or pressure limiting processing on at least one sub-frequency band under the condition that the energy value of at least one sub-frequency band is larger than the corresponding hearing threshold. The embodiment of the invention can realize the hearing protection processing of frequency bands on the audio frames played by the audio system.

Description

Audio processing method and device, earphone, terminal equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of audio, in particular to an audio processing method and device, an earphone, terminal equipment and a storage medium.
Background
More and more consumers listen to music by using earphones, if the music is played with larger volume for a long time, the damage to the ears of the users is easy to cause, and the damage to hearing organs is generally irreversible at the current human technology level, so the hearing protection is very important.
The damage of medium-high frequency to human ears under the same volume is far more than that of low frequency; at present, when the energy corresponding to the full frequency band of the audio output by the audio system is greater than the human hearing safety threshold, the high frequency damage to the human ear can be solved by adjusting the energy corresponding to the full frequency band to be less than or equal to the human hearing safety threshold. However, when the audio output by the system tends to medium-high frequency single tone (i.e. single frequency point, or single frequency point and its higher harmonics), the total energy of the full frequency band of the audio output by the system is often smaller than the safety threshold, but still causes hearing damage to the hot human ear, and at this time, the above method cannot solve the problem of damage to the human ear caused by high frequency. In addition, in the prior art, a method of attenuating or limiting the full frequency band is usually adopted to adjust the energy corresponding to the full frequency band to be less than or equal to the human ear hearing safety threshold, so that the user cannot hear complete details, the user is easily prompted to turn on the volume, and the hearing protection is not facilitated.
Disclosure of Invention
The embodiment of the invention provides an audio processing method, an audio processing device, an earphone, terminal equipment and a storage medium, so as to protect the hearing of a user in audio playing.
In a first aspect, an example of the present invention provides an audio processing method, where the audio processing method includes: under the condition of playing audio, acquiring an audio frame to be played, wherein the audio frame comprises a plurality of sub-frequency bands; determining the energy value of each sub-frequency band, wherein the energy values of the sub-frequency bands correspond to the hearing threshold values one to one; and performing attenuation and/or pressure limiting processing on at least one sub-frequency band under the condition that the energy value of at least one sub-frequency band is larger than the corresponding hearing threshold.
In a second aspect, an embodiment of the present invention provides an audio processing apparatus, where the audio processing apparatus includes: the device comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring an audio frame to be played under the condition of playing audio, and the audio frame comprises a plurality of sub-frequency bands; the determining module is used for determining the energy value of each sub-frequency band, and the energy values of the sub-frequency bands correspond to the hearing threshold values one by one; and the processing module is used for carrying out attenuation and/or pressure limit processing on at least one sub-frequency band under the condition that the energy value of at least one sub-frequency band is greater than the corresponding hearing threshold.
In a third aspect, an embodiment of the present invention provides a headset, including a speaker, a processor, a memory, and a computer program stored on the memory and executable on the processor, where the computer program, when executed by the processor, implements the method according to the first aspect of the foregoing embodiments.
In a fourth aspect, an embodiment of the present invention provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor, and when executed by the processor, the computer program implements the method according to the first aspect in the foregoing embodiments.
In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored in a terminal device, where the terminal device computer program, when executed by a processor, implements the method according to the first aspect in the foregoing embodiments.
In the embodiment of the invention, based on the acquisition of an audio frame to be played, the audio frame comprises a plurality of sub-frequency bands, the energy value of each sub-frequency band is determined, the energy values of the sub-frequency bands correspond to the hearing threshold values one by one, the energy of the sub-frequency bands is judged according to the hearing threshold values obtained by the hearing characteristic analysis of a user, and the energy value of at least one sub-frequency band is attenuated and/or subjected to pressure limit treatment under the condition that the energy value of at least one sub-frequency band is greater than the corresponding hearing threshold value; and then the audio frame is subjected to hearing protection processing of frequency division.
Drawings
The present invention will be better understood from the following description of specific embodiments thereof taken in conjunction with the accompanying drawings, in which like or similar reference characters designate like or similar features.
FIG. 1 is a schematic diagram of an implementation scenario of an embodiment of the present invention;
FIG. 2 is a flowchart of an audio processing method according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating an embodiment of calculating energy values of sub-bands;
FIG. 4 is a flow chart of another audio processing method according to an embodiment of the invention;
FIG. 5 is a diagram of an audio processing apparatus according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
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, 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.
Fig. 1 is a schematic view of an implementation scenario of the embodiment of the present invention. As shown in fig. 1, the application environment includes a terminal device 10 and a headset 20 communicating with the terminal device 10.
Wherein audio data including but not limited to songs, video tones, spoken voice, etc. is played on the terminal device 10, and the terminal device 10 is communicatively connected to the headset 20. The type of the earphone 20 may be an in-ear earphone, an earplug earphone, a headphone or the like, and the terminal device 10 and the earphone 20 may communicate in a wired or wireless manner to realize transmission of audio data.
According to the embodiment of the invention, based on the acquisition of an audio frame to be played, the audio frame comprises a plurality of sub-frequency bands, the energy value of each sub-frequency band is determined, the energy values of the sub-frequency bands correspond to the hearing threshold values one by one, the energy of the sub-frequency bands is judged according to the hearing threshold values obtained by the hearing characteristic analysis of a user, and the attenuation and/or pressure limit treatment is carried out on the sub-frequency band corresponding to the energy value of at least one sub-frequency band under the condition that the energy value of at least one sub-frequency band is greater than the hearing threshold value corresponding to the energy value of at least; and then the audio frame is subjected to hearing protection processing of frequency division.
Fig. 2 is a flowchart of an audio processing method according to an embodiment of the present invention. As shown in fig. 2, the audio processing method may include:
step 201: under the condition of playing audio, acquiring an audio frame to be played, wherein the audio frame comprises a plurality of sub-frequency bands;
specifically, an audio frame of audio data played by an audio system is obtained, and the audio frame is divided into a plurality of sub-frequency bands according to a preset rule; the audio frames may be stored locally or may be obtained from the outside.
In the embodiment of the present invention, the preset rule is to partition other test frequency points (as other central points) according to a main test frequency point (as a central point) of the human ear hearing test. Wherein the normal human ear is distributed exponentially.
It should be noted that: the daily sound comprises a combination of a plurality of frequencies, so when an ear hearing test is performed, the capture capacity of the human ear to the sound of each frequency point is tested. Each frequency point comprises a main test frequency point and other test frequency points, and the capturing capability of the human ear at the main test frequency point is stronger than that of the other test frequency points, and the sensitivity is higher.
Step 202: determining the energy value of each sub-frequency band, wherein the energy values of the sub-frequency bands correspond to the hearing threshold values one to one;
in this embodiment of the present invention, the determining the energy value of each sub-band in step 202 includes the following steps:
step 2021: windowing the audio frame; the window function in the windowing process can be selected according to the computing capacity and the processing precision of the audio system;
step 2022: performing Fast Fourier Transform (FFT) on the result after the windowing processing to obtain the phase and the amplitude of the audio frame; wherein, the FFT can be selected according to the computing power and the processing precision of the audio system;
step 2023: and squaring the result after the FFT processing to obtain an energy spectrum, and obtaining the energy of the sub-frequency band according to the unit frequency point in the sub-frequency band.
Step 203: comparing the energy value of each sub-frequency band with the corresponding hearing threshold value;
in the embodiment of the present invention, the hearing thresholds corresponding to the multiple sub-bands of the audio frame may be the same or different.
According to the embodiment of the invention, different hearing thresholds are set for each sub-frequency band, and the sub-frequency bands are adjusted in a targeted manner, so that the energy value of the sub-frequency band is smaller than the corresponding hearing threshold, and the effect of protecting hearing is achieved.
Step 204: and under the condition that the energy value of at least one sub-frequency band is larger than the corresponding hearing threshold, carrying out attenuation and/or pressure limit treatment on the sub-frequency band corresponding to the energy value of at least one sub-frequency band.
According to the embodiment of the invention, based on the acquisition of an audio frame to be played, the audio frame comprises a plurality of sub-frequency bands, the energy value of each sub-frequency band is determined, the energy values of the sub-frequency bands correspond to the hearing threshold values one by one, the energy of the sub-frequency bands is judged according to the hearing threshold values obtained by the hearing characteristic analysis of a user, and the attenuation and/or pressure limit treatment is carried out on the sub-frequency band corresponding to the energy value of at least one sub-frequency band under the condition that the energy value of at least one sub-frequency band is greater than the hearing threshold value corresponding to the energy value of at least; and then the audio frame is subjected to hearing protection processing of frequency division.
According to the embodiment of the invention, the sub-band with smaller energy can be reserved by performing sub-band attenuation processing and/or voltage limit processing on the audio frame, the sub-band with large energy does not damage the hearing of human ears, and further, the audio details can be reserved while the hearing of a user is protected.
Since both the attenuation processing and the threshold processing are processes for adjusting the energy of the audio frame, the threshold processing may be obtained based on the processes of the attenuation processing, and therefore, for convenience of description, only the processes of the attenuation processing are exemplified below.
In this embodiment of the present invention, in the case that the energy value of at least one sub-band is greater than the hearing threshold corresponding to the at least one sub-band, the step 204 of performing attenuation processing on the sub-band corresponding to the energy value of at least one sub-band includes: and when the energy value of at least one sub-frequency band is larger than the corresponding hearing threshold, setting a first adjusting factor, and based on the first adjusting factor, carrying out attenuation processing on the sub-frequency band corresponding to the energy value of at least one sub-frequency band.
In the embodiment of the present invention, the number of the first adjustment factors may be one or more. The first adjustment factors can be gradually increased from the low frequency band to the high frequency band, and then the sub-frequency bands are attenuated in a targeted manner.
In this embodiment of the present invention, after step 204, the audio processing method further includes:
the first step is as follows: calculating the total energy of the audio frame;
the second step is that: comparing the total energy with a preset threshold; and if the total energy is greater than the preset threshold value, performing attenuation processing on at least one high-frequency sub-frequency band in the plurality of sub-frequency bands so as to enable the total energy to be less than or equal to the preset threshold value.
In the embodiment of the invention, the energy threshold is judged by the preset threshold obtained by analyzing the hearing characteristics of the user, and under the condition that the total energy is greater than the preset threshold in the second step, attenuation processing is carried out on at least one high-frequency sub-band, so that hearing protection processing of sub-bands is carried out on the audio frame.
In this embodiment of the present invention, if the total energy is greater than the preset threshold, the second step of performing an attenuation process on at least one high-frequency sub-band of the multiple sub-bands includes: if the total energy is larger than the preset threshold value, setting a plurality of second adjusting factors, and carrying out second attenuation processing on at least one high-frequency sub-band based on the plurality of second adjusting factors; wherein each sub-band of the at least one high frequency sub-band corresponds to a second adjustment factor.
It should be noted that each of the plurality of second adjustment factors may be the same or different.
In the embodiment of the invention, the size of the plurality of second adjustment factors can be increased along with the increase of the energy of the high-frequency sub-band, so that the targeted attenuation of the sub-band is realized.
In the embodiment of the present invention, there may be a plurality of attenuations in the process of performing the second attenuation processing. Once the attenuation times are too many, the user can have a pause feeling in the sense of hearing, and the user experience is further reduced; the embodiment of the present invention may set a preset threshold value for limiting the excessive attenuation times, and further includes:
after each second attenuation, a count is made; and when the implementation times reach a preset threshold value, setting a third adjusting factor, and implementing attenuation processing on the at least one high-frequency sub-band based on the third adjusting factor.
The third adjustment factor may be a product of the first adjustment factor and the second adjustment factor.
The third adjustment factor may also be a product of a plurality of second adjustment factors used for performing the second attenuation processing a plurality of times.
It should be noted that the first adjustment factor is constant, and the plurality of second adjustment factors used in each embodiment of the second attenuation process increase from low frequency to high frequency. In addition, the plurality of second adjustment factors used for performing the second attenuation processing a plurality of times may also decrease with the increase of the number of times, and generally, the plurality of second adjustment factors currently used are often smaller than the second adjustment factor used last time. Since the difference between the total energy and the predetermined threshold in the second step is smaller and smaller as the number of times of the attenuation increases, it is necessary to reduce the second adjustment factors used for each second attenuation implementation as the number of times of the attenuation increases, so that the total energy in the second step can be accurately smaller than or equal to the predetermined threshold.
The purpose of the third adjustment factor setting is: on the one hand, to accelerate attenuation; on the other hand, the adjustment factor is more suitable for the energy of the sub-band as much as possible, so that the audio details can be accurately reserved. Therefore, the scope of the embodiments of the present invention can be encompassed as long as the above-described object is achieved.
According to the embodiment of the invention, the second adjustment factor and the third adjustment factor are set, so that the details can be more comprehensively retained, and the attenuation of the details can be more completely retained while the attenuation is fast.
In an embodiment of the present invention, in a case that energy values of a plurality of sub-bands are all less than or equal to an auditory threshold corresponding thereto, the audio processing method further includes:
step 1: calculating the total energy of the audio frame;
step 2: and comparing the total energy with a preset threshold, and if the total energy is greater than the preset threshold, performing attenuation processing on at least one high-frequency sub-band in the plurality of sub-bands to enable the total energy to be less than or equal to the preset threshold.
In the embodiment of the present invention, the step 2 of comparing the total energy with a preset threshold, and if the total energy is greater than the preset threshold, performing attenuation processing on at least one high frequency sub-band of the plurality of sub-bands until the total energy is less than or equal to the preset threshold includes:
at least one high-frequency sub-band is selected from a plurality of sub-bands of the audio frame, and attenuation processing is carried out on the at least one high-frequency sub-band, so that the total energy is smaller than or equal to a preset threshold value. And selecting the number of at least one high-frequency sub-frequency band according to the difference between the total energy and the preset threshold value in the step 2. Wherein, the total energy in the step 2 is the sum of the energies of all the sub-frequency bands.
Wherein, the attenuation treatment in the step 2 comprises: and performing fourth attenuation processing on the sub-frequency band corresponding to the energy value of at least one sub-frequency band based on a fourth adjusting factor. The number of the fourth adjustment factors may be one or more.
In the embodiment of the present invention, there may be a plurality of attenuations in the process of performing the fourth attenuation processing. Once the attenuation times are too many, the user can have a pause feeling in the sense of hearing, and the user experience is further reduced; the embodiment of the present invention may set a preset threshold value for limiting the excessive attenuation times, and further includes: after each fourth attenuation treatment, a count is performed; and when the implementation times reach a preset threshold value, setting a fifth adjusting factor, and implementing attenuation processing on the at least one high-frequency sub-band based on the fifth adjusting factor.
The fifth adjustment factor may also be a product of a plurality of fourth adjustment factors used for performing the fourth attenuation processing a plurality of times.
It should be noted that, when the number of the fourth adjustment factors is plural, the plural fourth adjustment factors increase with the low frequency to the high frequency. In addition, the plurality of fourth adjustment factors used for performing the fourth attenuation processing a plurality of times may also decrease with the increase of the number of times, and generally, the plurality of fourth adjustment factors currently used may be smaller than the fourth adjustment factor used last time. Since the difference between the total energy in step 2 and the preset threshold is smaller and smaller as the number of times of attenuation increases, it is necessary to reduce the fourth adjustment factors used in each second attenuation implementation as the number of times of attenuation increases, so as to accurately make the total energy in step 2 smaller than or equal to the preset threshold.
The purpose of the fifth adjustment factor setting is: on the one hand, to accelerate attenuation; on the other hand, the adjustment factor is more suitable for the energy of the sub-band as much as possible, so that the audio details can be accurately reserved. Therefore, the scope of the embodiments of the present invention can be encompassed as long as the above-described object is achieved.
In the embodiment of the invention, the hearing threshold and the preset threshold are user hearing characteristic analysis data stored in an audio system, the preset threshold is an energy threshold of a normal human ear, the hearing threshold is a threshold corresponding to one sub-frequency band in the energy threshold, and the energy threshold is a hearing energy threshold of a terminal device user. The division of the energy threshold of the sub-frequency band is consistent with the division of the sub-frequency band; i.e. each sub-band corresponds to an energy threshold for the sub-band.
In addition, the embodiment of the invention firstly judges based on the hearing threshold value and then judges based on the preset threshold value; under the condition that the energy value of the sub-band meets the corresponding hearing threshold, further judging whether the hearing range of the ears of the terminal equipment user is in a normal range, if not, namely the total energy of the sub-band does not accord with the preset threshold, adjusting the total energy of the sub-band to be less than or equal to the preset threshold, and further realizing hearing protection of the terminal equipment user; if within the normal range, it is further explained that the energy threshold is the same as the preset threshold (i.e. the hearing safety threshold).
According to the embodiment of the invention, after the sub-frequency band is attenuated, inverse FFT conversion is carried out to obtain the attenuated audio frequency, and then the hearing protection processing of the sub-frequency band is carried out on the audio frequency frame.
In the embodiment of the present invention, the terminal device 10 in fig. 1 may implement the above steps, and after the terminal device 10 implements the above steps, the attenuated audio is delivered to the earphone 20. In addition, the earphone in fig. 1 may also implement the above steps, and the earphone 20 acquires the played audio frame from the terminal device 10, and after the above steps are implemented, delivers the attenuated audio to the human ear.
Fig. 4 is a flowchart of another audio processing method according to an embodiment of the invention. As shown in fig. 4, the audio processing method includes:
step 401: respectively judging whether the energy of each sub-frequency band of the current audio frame is greater than a corresponding hearing threshold value; if so, go to step 402; if less than or equal to, go to step 403;
step 402: setting an adjusting factor for the sub-frequency band larger than the corresponding hearing threshold value, and calculating the total energy of the audio;
step 403: judging whether the total energy of the current audio is larger than a preset threshold value or not; if so, go to step 404; if the value is less than or equal to the preset value, ending;
it should be noted that, after step 402 is executed, the preset threshold of step 403 is the human ear hearing threshold of the terminal device user; if it is after step 401, the preset threshold of step 403 is the normal ear hearing threshold.
Step 404: setting a plurality of adjustment factors for at least one high-frequency sub-band until the total energy of the current audio is less than or equal to a preset threshold, wherein each high-frequency sub-band corresponds to one adjustment factor, and the adjustment factor is in direct proportion to the energy corresponding to the high-frequency sub-band, namely, the higher the energy corresponding to the high-frequency sub-band is, the higher the corresponding adjustment factor is.
Fig. 5 is a schematic diagram of an audio processing apparatus according to an embodiment of the invention. As shown in fig. 5, the audio processing apparatus includes:
an obtaining module 501, configured to obtain an audio frame to be played under a condition that an audio is played, where the audio frame includes multiple sub-bands;
a determining module 502, configured to determine an energy value of each sub-band, where the energy values of the sub-bands correspond to a plurality of hearing thresholds one to one;
a comparing module 503, configured to compare the energy value of the sub-band with a corresponding hearing threshold;
a processing module 504, configured to perform attenuation and/or voltage limiting processing on at least one sub-band if an energy value of the at least one sub-band is greater than a corresponding hearing threshold.
Optionally, after performing attenuation and/or threshold processing on at least one sub-band, the determining module 502 is further configured to: calculating the total energy of the audio frame;
the comparing module 503 is further configured to compare the total energy with a preset threshold;
the processing module 504 is further configured to perform attenuation and/or voltage limiting processing on at least one high-frequency sub-band of the multiple sub-bands if the total energy is greater than the preset threshold, so that the total energy of the audio frame is less than or equal to the preset threshold.
Optionally, in the case that the energy values of the multiple sub-bands are all less than or equal to the corresponding hearing threshold,
a determining module 502, further configured to: calculating the total energy of the audio frame;
the comparing module 503 is further configured to compare the total energy with a preset threshold;
the processing module 504 is further configured to, if the total energy is greater than the preset threshold, perform attenuation and/or pressure limit processing on at least one high-frequency sub-band of the multiple sub-bands until the total energy is less than or equal to the preset threshold.
Based on the first adjusting factor, carrying out attenuation and/or pressure limit processing on the sub-frequency band corresponding to the energy of at least one sub-frequency band; based on the second adjustment factor, attenuation and/or voltage limiting processing is performed on at least one high frequency sub-band of the plurality of sub-bands.
Optionally, the audio processing apparatus further includes: a counting module for counting the number of times of performing attenuation and/or voltage limit processing on at least one high-frequency sub-band based on the second adjustment factor;
the processing module 504 is further configured to, if the number of times reaches a preset threshold value, perform attenuation and/or pressure limit processing on at least one high-frequency sub-band based on a third adjustment factor; wherein the third adjustment factor is the product of the first adjustment factor and the second adjustment factor.
Wherein, the hearing threshold corresponding to each sub-frequency band in the plurality of sub-frequency bands is different.
According to the embodiment of the invention, different hearing thresholds are set for each sub-frequency band, and the sub-frequency bands are adjusted in a targeted manner, so that the energy value of the sub-frequency band is smaller than the corresponding hearing threshold, and the effect of protecting hearing is achieved.
The terminal device provided in the embodiment of the present invention can implement each process implemented by the terminal device in the method embodiments of fig. 2 and fig. 4, and is not described herein again to avoid repetition.
According to the embodiment of the invention, based on the acquisition of the audio frame to be played, the audio frame comprises a plurality of sub-frequency bands, the energy value of each sub-frequency band is determined, the energy values of the sub-frequency bands correspond to the hearing threshold values one by one, the energy of the sub-frequency bands is judged according to the hearing threshold values obtained by the hearing characteristic analysis of the user, and under the condition that the energy value of at least one sub-frequency band is greater than the corresponding hearing threshold value, attenuation and/or pressure limit processing is carried out on the sub-frequency band corresponding to the energy value of at least one sub-frequency band, so that hearing protection processing of the sub-frequency bands is carried out on the audio frame.
The embodiment of the invention provides an earphone which comprises a loudspeaker, a processor and a memory; the memory is used for storing a computer program which can run on the processor, and the computer program realizes the audio processing method when being executed by the processor; and the loudspeaker is used for transmitting the audio subjected to the attenuation processing and/or the pressure limiting processing to human ears.
According to the embodiment of the invention, the audio frame to be played comprises a plurality of sub-frequency bands; and determining the energy value of each sub-frequency band, wherein the energy values of the sub-frequency bands correspond to the hearing threshold values one to one, performing threshold value judgment on the energy of the sub-frequency bands according to the hearing threshold values obtained by analyzing the hearing characteristics of the user, and performing attenuation and/or pressure limit processing on the sub-frequency bands under the condition that the energy value of at least one sub-frequency band is greater than the corresponding hearing threshold value, so that the hearing protection of the sub-frequency bands on the audio frames played by the audio system can be realized.
Fig. 6 is a schematic diagram of a hardware structure of a terminal device for implementing various embodiments of the present invention.
The terminal device 10 includes but is not limited to: radio frequency unit 101, network module 102, audio output unit 103, input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, and power supply 111. Those skilled in the art will appreciate that the terminal device configuration shown in fig. 6 does not constitute a limitation of the terminal device, and that the terminal device may include more or fewer components than shown, or combine certain components, or a different arrangement of components. In the embodiment of the present invention, the terminal device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal device, a wearable device, a pedometer, and the like.
According to the embodiment of the invention, based on the acquisition of the audio frame to be played, the audio frame comprises a plurality of sub-frequency bands, the energy value of each sub-frequency band is determined, the energy values of the sub-frequency bands correspond to the hearing threshold values one by one, the energy of the sub-frequency bands is judged according to the hearing threshold values obtained by the hearing characteristic analysis of the user, and under the condition that the energy value of at least one sub-frequency band is greater than the corresponding hearing threshold value, attenuation and/or pressure limit processing is carried out on the sub-frequency band corresponding to the energy value of at least one sub-frequency band, so that hearing protection processing of the sub-frequency bands is carried out on the audio frame.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 101 may be used for receiving and sending signals during a message transmission or call process, and specifically, after receiving downlink data from a base station, the downlink data is processed by the processor 110; in addition, the uplink data is transmitted to the base station. Typically, radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 can also communicate with a network and other devices through a wireless communication system.
The terminal device provides wireless broadband internet access to the user through the network module 102, such as helping the user send and receive e-mails, browse webpages, access streaming media, and the like.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the network module 102 or stored in the memory 109 into an audio signal and output as sound. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the terminal device 10 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 includes a speaker, a buzzer, a receiver, and the like.
The input unit 104 is used to receive an audio or video signal. The input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, and the Graphics processor 1041 processes image data of a still picture or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphic processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the network module 102. The microphone 1042 may receive sound and may be capable of processing such sound into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of a phone call mode.
The terminal device 10 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1061 and/or the backlight when the terminal device 10 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the terminal device posture (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration identification related functions (such as pedometer, tapping), and the like; the sensors 105 may also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which are not described in detail herein.
The display unit 106 is used to display information input by a user or information provided to the user. The Display unit 106 may include a Display panel 1061, and the Display panel 1061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the terminal device. Specifically, the user input unit 107 includes a touch panel 1071 and other input devices 1072. Touch panel 1071, also referred to as a touch screen, may collect touch operations by a user on or near the touch panel 1071 (e.g., operations by a user on or near touch panel 1071 using a finger, stylus, or any suitable object or attachment). The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 110, and receives and executes commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may include other input devices 1072. Specifically, other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
Further, the touch panel 1071 may be overlaid on the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or nearby, the touch panel 1071 transmits the touch operation to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although in fig. 6, the touch panel 1071 and the display panel 1061 are two independent components to implement the input and output functions of the terminal device, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the terminal device, and is not limited herein.
The interface unit 108 is an interface for connecting an external device to the terminal apparatus 10. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the terminal apparatus 10 or may be used to transmit data between the terminal apparatus 10 and external devices.
The memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 109 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 110 is a control center of the terminal device, connects various parts of the entire terminal device by using various interfaces and lines, and performs various functions of the terminal device and processes data by running or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the terminal device. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The terminal device 10 may further include a power supply 111 (such as a battery) for supplying power to various components, and preferably, the power supply 111 may be logically connected to the processor 110 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system.
In addition, the terminal device 10 includes some functional modules that are not shown, and will not be described in detail here.
Preferably, an embodiment of the present invention further provides a terminal device, which includes a processor 110, a memory 109, and a computer program stored in the memory 109 and capable of running on the processor 110, where the computer program is executed by the processor 110 to implement each process of the foregoing audio processing method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not described here again.
The embodiment of the present invention further provides a storage medium, where a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the above-mentioned embodiment of the audio processing method, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (10)

1. An audio processing method, comprising:
under the condition of playing audio, acquiring an audio frame to be played, wherein the audio frame comprises a plurality of sub-frequency bands;
determining an energy value of each sub-frequency band, wherein the energy values of the sub-frequency bands correspond to hearing thresholds one by one;
performing attenuation and/or pressure limiting processing on at least one sub-band if the energy value of the at least one sub-band is greater than the corresponding hearing threshold;
in the case where the energy values of the plurality of sub-bands are less than or equal to the corresponding hearing thresholds, the method further comprises:
calculating a total energy of the audio frame;
and under the condition that the total energy is greater than a preset threshold value, performing attenuation and/or pressure limiting processing on at least one high-frequency sub-band in the plurality of sub-bands so as to enable the total energy of the audio frame to be less than or equal to the preset threshold value.
2. The method of claim 1, wherein after performing attenuation and/or limiting processing on the at least one sub-band, the method further comprises:
calculating a total energy of the audio frame;
and under the condition that the total energy is greater than the preset threshold, performing attenuation and/or pressure limiting processing on at least one high-frequency sub-band in the plurality of sub-bands so as to enable the total energy of the audio frame to be less than or equal to the preset threshold.
3. The method of claim 2, wherein the performing attenuation and/or limiting processing on the at least one sub-band comprises:
and performing attenuation and/or pressure limit processing on the at least one sub-frequency band based on the first adjusting factor.
4. The method of claim 3, wherein performing attenuation and/or limiting processing on at least one high frequency sub-band of the plurality of sub-bands comprises:
and performing attenuation and/or voltage limiting processing on the at least one high-frequency sub-band based on the second adjusting factor.
5. The method of claim 4, further comprising, after performing attenuation and/or limiting processing on the at least one high frequency sub-band:
recording the number of times of performing attenuation and/or voltage limiting processing on the at least one high-frequency sub-band;
if the times reach a preset threshold value, based on a third adjusting factor, carrying out attenuation and/or pressure limit processing on the at least one high-frequency sub-band;
wherein the third adjustment factor is a product of the first adjustment factor and the second adjustment factor.
6. The method of claim 1, wherein the hearing threshold for each of the plurality of sub-bands is different.
7. An audio processing apparatus, characterized in that the apparatus comprises:
the device comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring an audio frame to be played under the condition of playing audio, and the audio frame comprises a plurality of sub-frequency bands;
the determining module is used for determining the energy value of each sub-frequency band, and the energy values of the sub-frequency bands correspond to the hearing threshold values one by one;
the processing module is used for carrying out attenuation and/or pressure limit processing on at least one sub-frequency band under the condition that the energy value of the at least one sub-frequency band is larger than the corresponding hearing threshold; calculating a total energy of the audio frame in the case that energy values of the plurality of sub-bands are less than or equal to corresponding hearing thresholds; and under the condition that the total energy is greater than a preset threshold value, performing attenuation and/or pressure limiting processing on at least one high-frequency sub-band in the plurality of sub-bands so as to enable the total energy of the audio frame to be less than or equal to the preset threshold value.
8. A headset, characterized by a speaker, a processor, a memory and a computer program stored on the memory and executable on the processor, which computer program, when executed by the processor, carries out the steps of the audio processing method as claimed in any one of claims 1 to 6.
9. A terminal device, characterized in that it comprises a processor, a memory and a computer program stored on the memory and executable on the processor, which computer program, when executed by the processor, carries out the steps of the audio processing method according to any one of claims 1 to 6.
10. Computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the audio processing method according to any one of claims 1 to 6.
CN201910362786.4A 2019-04-30 2019-04-30 Audio processing method and device, earphone, terminal equipment and storage medium Active CN110139181B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910362786.4A CN110139181B (en) 2019-04-30 2019-04-30 Audio processing method and device, earphone, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910362786.4A CN110139181B (en) 2019-04-30 2019-04-30 Audio processing method and device, earphone, terminal equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110139181A CN110139181A (en) 2019-08-16
CN110139181B true CN110139181B (en) 2020-11-06

Family

ID=67575963

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910362786.4A Active CN110139181B (en) 2019-04-30 2019-04-30 Audio processing method and device, earphone, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110139181B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111800692B (en) * 2020-06-05 2023-03-14 全景声科技南京有限公司 Hearing protection device and method based on human ear auditory characteristics

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107135665A (en) * 2014-09-24 2017-09-05 泰克宣技术有限公司 Produce the system and method for activating plane motion for the damping electromagnetic of audio frequency vibration

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101026362B (en) * 2006-02-18 2011-09-28 鸿富锦精密工业(深圳)有限公司 Hearing protection system, method and sound output device
KR101356206B1 (en) * 2007-02-01 2014-01-28 삼성전자주식회사 Method and apparatus for reproducing audio having auto volume controlling function
US9877107B2 (en) * 2015-10-20 2018-01-23 Marvell World Trade Ltd. Processing audio signals
CN106714033A (en) * 2016-11-25 2017-05-24 深圳市金立通信设备有限公司 Method for preventing cracking voice of audio device, and terminal
CN108804072A (en) * 2018-06-13 2018-11-13 广州酷狗计算机科技有限公司 Audio-frequency processing method, device, storage medium and terminal
CN108834020A (en) * 2018-07-17 2018-11-16 苏州科技大学 A kind of volume adjusting method and system for protecting ear auditory

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107135665A (en) * 2014-09-24 2017-09-05 泰克宣技术有限公司 Produce the system and method for activating plane motion for the damping electromagnetic of audio frequency vibration

Also Published As

Publication number Publication date
CN110139181A (en) 2019-08-16

Similar Documents

Publication Publication Date Title
US10924614B2 (en) Speech signal processing method and apparatus
CN109511037B (en) Earphone volume adjusting method and device and computer readable storage medium
CN107562406B (en) Volume adjusting method, mobile terminal and computer readable storage medium
CN109918039B (en) Volume adjusting method and mobile terminal
CN110012143B (en) Telephone receiver control method and terminal
CN107785027B (en) Audio processing method and electronic equipment
CN111343540B (en) Piano audio processing method and electronic equipment
CN110602696A (en) Conversation privacy protection method and electronic equipment
CN111182118B (en) Volume adjusting method and electronic equipment
CN108848267B (en) Audio playing method and mobile terminal
CN111093137B (en) Volume control method, volume control equipment and computer readable storage medium
CN107749306B (en) Vibration optimization method and mobile terminal
CN111477243A (en) Audio signal processing method and electronic equipment
CN114125639A (en) Audio signal processing method and device and electronic equipment
CN109873894B (en) Volume adjusting method and mobile terminal
CN109889214B (en) Method for reducing SAR value and mobile terminal
CN110995921A (en) Call processing method, electronic device and computer readable storage medium
CN108319440B (en) Audio output method and mobile terminal
CN110058837B (en) Audio output method and terminal
CN110139181B (en) Audio processing method and device, earphone, terminal equipment and storage medium
CN110636530B (en) Method for processing adjacent channel interference and terminal equipment
CN110730013B (en) Method for improving transmission stray and mobile terminal
CN111459447A (en) Volume adjustment display method and electronic equipment
CN109348366B (en) Method for adjusting volume by using electrical parameters and mobile terminal
CN107743174B (en) Clipping judgment method of sound signal and mobile terminal

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