CN113163298A - Method and device for adjusting earphone audio equalizer - Google Patents

Method and device for adjusting earphone audio equalizer Download PDF

Info

Publication number
CN113163298A
CN113163298A CN202010008500.5A CN202010008500A CN113163298A CN 113163298 A CN113163298 A CN 113163298A CN 202010008500 A CN202010008500 A CN 202010008500A CN 113163298 A CN113163298 A CN 113163298A
Authority
CN
China
Prior art keywords
audio
equalizer
adjusting
earphone
amplitude component
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.)
Granted
Application number
CN202010008500.5A
Other languages
Chinese (zh)
Other versions
CN113163298B (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.)
Shenzhen 3Nod Digital Technology Co Ltd
Original Assignee
Shenzhen 3Nod Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen 3Nod Digital Technology Co Ltd filed Critical Shenzhen 3Nod Digital Technology Co Ltd
Priority to CN202010008500.5A priority Critical patent/CN113163298B/en
Publication of CN113163298A publication Critical patent/CN113163298A/en
Application granted granted Critical
Publication of CN113163298B publication Critical patent/CN113163298B/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
    • H04R3/00Circuits for transducers, loudspeakers or microphones
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R2430/00Signal processing covered by H04R, not provided for in its groups

Landscapes

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

Abstract

The application discloses a method and a device for adjusting an audio equalizer of an earphone, belonging to the technical field of audio processing, wherein the method comprises the steps of obtaining PCM audio data played in the earphone within a preset time period; dividing PCM audio data into a plurality of audio frames according to a preset frame dividing mode; analyzing each audio frame to obtain frequency spectrum information, and acquiring amplitude components of the audio frames from the frequency spectrum information; normalizing the amplitude component of each audio frame to obtain the amplitude component weights of different frequency bands; and counting the weight of the amplitude component of all the audio frames, and adjusting an audio equalizer of the earphone according to the counting result. According to the method and the device, the amplitude component weights of different frequency bands in all the audio frames are obtained, the amplitude component weights of all the audio frames are counted, and the audio equalizer matched with the preference of the audio equalizer is automatically adjusted according to the counting result.

Description

Method and device for adjusting earphone audio equalizer
Technical Field
The application belongs to the technical field of audio processing, and particularly relates to an adjusting method and device for an earphone audio equalizer.
Background
With the development of communication technology, users can not only perform operations such as conversation and sending short messages through mobile terminals such as mobile phones, but also play music through mobile terminals such as mobile phones. In the prior art, in order to provide better sound effect experience for users, manufacturers of mobile devices may set an audio Equalizer (EQ) in the following two modes separately or simultaneously in a music player of a mobile terminal, so that the users can adjust the sound effect of the player:
the audio equalizer is in a fixed frequency band gain mode, such as a classical mode, a popular mode, a dance mode, a rock mode, and the like, which are common, the gain value of the audio equalizer in the fixed frequency band gain mode is a preset fixed value in each frequency band, and a user generally cannot adjust the gain value of the audio equalizer at will.
The other is an audio frequency equalizer with a self-defined frequency band gain mode, the existing equalizers provide the self-defined frequency band gain mode in a wide frequency band of-15 dB to +15dB for users to adjust, and the users can adjust the audio frequency equalizer suitable for the users on the mobile terminal under the self-defined frequency band gain mode according to the preferences of the users, so that the gain value of each frequency band of the audio frequency equalizer is adapted to the preferences of the users.
However, the audio equalizer in the fixed frequency band gain mode has a large limitation, and is difficult to meet the requirements of all users; the audio equalizer of the user-defined frequency band gain mode is relatively complex to adjust, and even if an ordinary user knows the preference of the user, the user can hardly adjust the audio equalizer matched with the preference of the user.
Content of application
The utility model aims to solve the problem that the equalizer of the existing earphone has large limitation, is difficult to adjust and is difficult to meet the requirement of the user.
To this end, according to a first aspect, an embodiment of the present application discloses an adjusting method for an audio equalizer of a headphone, including:
acquiring PCM audio data played in the earphone within a preset time period;
dividing PCM audio data into a plurality of audio frames according to a preset frame dividing mode;
analyzing each audio frame to obtain frequency spectrum information, and acquiring amplitude components of the audio frames from the frequency spectrum information, wherein each audio frame corresponds to one frequency spectrum information and comprises a plurality of amplitude components;
normalizing the amplitude component of each audio frame to obtain the amplitude component weights of different frequency bands;
and counting the weight of the amplitude component of all the audio frames, and adjusting an audio equalizer of the earphone according to the counting result.
Further, analyzing each audio frame to obtain spectrum information, and obtaining the amplitude component of the audio frame in the spectrum information specifically includes:
sampling each audio frame according to a preset number of sampling points;
analyzing the sampling result, and generating frequency spectrum information of each audio frame according to the analysis result;
and acquiring the amplitude component corresponding to each sampling point according to the frequency spectrum information.
Further, analyzing the sampling result, and generating the spectrum information of each audio frame according to the analysis result specifically includes:
and respectively carrying out fast Fourier transform operation on the sampling results, and generating the frequency spectrum information of each audio frame according to the result of the fast Fourier transform operation.
Further, normalizing the amplitude component of each audio frame to obtain the weights of the amplitude components of different frequency bands specifically includes:
dividing the amplitude component of each audio frame according to a preset frequency division mode;
calculating the total number of the amplitude components in each audio frame and the number of the amplitude components in different frequency bands;
and calculating the weight of the amplitude components of different frequency bands in each audio frame according to the total number of the amplitude components in each audio frame and the number of the amplitude components in different frequency bands.
Further, the step of counting the weight of the amplitude component of all the audio frames and adjusting the audio equalizer of the headphone according to the statistical result specifically includes:
accumulating the amplitude component weights of all audio frames;
and adjusting the audio equalizer of the earphone according to the accumulation result of the amplitude component weights of all the audio frames.
Further, after the amplitude component of each audio frame is normalized to obtain the weights of the amplitude components of different frequency bands, the method further includes:
judging whether a user performs manual operation on the earphone audio equalizer within a preset time period;
if the parameters exist, the equalizer parameters of the user in the manual operation of the earphone audio equalizer within the preset time period are obtained, and the audio equalizer of the earphone is adjusted according to the equalizer parameters and the statistical result.
Further, if the parameter exists, acquiring an equalizer parameter when the user manually operates the audio equalizer of the earphone within a predetermined time period, and according to the equalizer parameter and the statistical result, adjusting the audio equalizer of the earphone specifically includes:
identifying an operation mode of a user for manually operating the earphone audio equalizer within a preset time period, wherein the operation mode comprises a fixed operation mode and a user-defined operation mode;
if the operation mode of the user for manually operating the earphone audio equalizer within the preset time period is a fixed operation mode, acquiring a first equalizer parameter corresponding to the fixed operation mode, adjusting the statistical result according to the first equalizer parameter to obtain a first adjustment parameter, and adjusting the earphone audio equalizer by adopting the first adjustment parameter;
if the operation mode of the user for manually operating the earphone audio equalizer within the preset time period is the user-defined operation mode, obtaining a second equalizer parameter corresponding to the user-defined operation mode, adjusting the statistical result according to the second equalizer parameter to obtain a second adjustment parameter, and adjusting the earphone audio equalizer by adopting the second adjustment parameter.
According to a second aspect, an embodiment of the present application provides an adjusting apparatus for a headphone audio equalizer, including:
the acquisition module is used for acquiring PCM audio data played in the earphone within a preset time period;
the frame dividing module is used for dividing the PCM audio data into a plurality of audio frames according to a preset frame dividing mode;
the analysis module is used for analyzing each audio frame to obtain frequency spectrum information and acquiring amplitude components of the audio frames from the frequency spectrum information, wherein each audio frame corresponds to one frequency spectrum information and comprises a plurality of amplitude components;
the normalization module is used for performing normalization processing on the amplitude component of each audio frame to obtain the amplitude component weights of different frequency bands;
and the statistic module is used for counting the weight of the amplitude component of all the audio frames and adjusting the audio equalizer of the earphone according to the statistic result.
According to a third aspect, the present application provides a computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the steps of the method for adjusting a headphone audio equalizer of the first aspect when executing the computer program.
According to a fourth aspect, the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method for adjusting an audio equalizer of a headphone according to any of the first aspects.
The beneficial effect of this application lies in:
the application discloses a method and a device for adjusting an audio equalizer of an earphone, belonging to the technical field of audio processing, wherein the method comprises the steps of obtaining PCM audio data played in the earphone within a preset time period; dividing PCM audio data into a plurality of audio frames according to a preset frame dividing mode; analyzing each audio frame to obtain frequency spectrum information, and acquiring amplitude components of the audio frames from the frequency spectrum information, wherein each audio frame corresponds to one frequency spectrum information and comprises a plurality of amplitude components; normalizing the amplitude component of each audio frame to obtain the amplitude component weights of different frequency bands; and counting the weight of the amplitude component of all the audio frames, and adjusting an audio equalizer of the earphone according to the counting result. After the amplitude components of the audio frames are obtained, the amplitude components of the audio frames are normalized to obtain the amplitude component weights of different frequency bands in the audio frames, the amplitude component weights of all the audio frames are counted, and the audio equalizer matched with the preference of the audio equalizer is automatically adjusted according to the counting result.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart illustrating an implementation of an adjusting method of an audio equalizer of a headphone according to the present embodiment;
FIG. 2 is a flowchart illustrating an implementation of step S103 shown in FIG. 1;
FIG. 3 is a flowchart illustrating an implementation of the method of the present invention for determining whether a user has manually operated an audio equalizer;
FIG. 4 is a flowchart illustrating an implementation of step S302 shown in FIG. 3;
FIG. 5 is a schematic diagram of an adjusting device of the headphone audio equalizer;
fig. 6 is a block diagram of the basic structure of the computer device according to the present embodiment.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof, in the description and claims of this application and the description of the above figures are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and claims of this application or in the above-described drawings are used for distinguishing between different objects and not for describing a particular order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
The application discloses an adjusting method of an audio equalizer of a headset, which comprises the steps of obtaining PCM audio data played in the headset within a preset time period, dividing the PCM audio data into a plurality of audio frames according to a preset framing mode, analyzing each audio frame to obtain frequency spectrum information, obtaining amplitude components of the audio frames in the frequency spectrum information, normalizing the amplitude components of the audio frames after obtaining the amplitude components of the audio frames to obtain the amplitude component weights of different frequency bands in the audio frames, counting the amplitude component weights of all the audio frames, and automatically adjusting the audio equalizer matched with the preference of the audio equalizer according to the counting result. Examples of the present application are further described below:
example one
Referring to fig. 1, fig. 1 is a flowchart illustrating an implementation of a method for adjusting an audio equalizer of a headphone disclosed in this embodiment, where the method for adjusting an audio equalizer of a headphone includes:
s101, obtaining PCM audio data played in the earphone within a preset time period;
the PCM (Pulse Code Modulation) audio data is a bare stream of uncompressed audio sample data, which is standard digital audio data obtained by sampling, quantizing, and encoding an analog signal. The predetermined time period may be set according to the user's requirement, and in a specific embodiment of the present application, the predetermined time period may be set to 7 days. In the embodiment of the present application, the earphone may be a wired earphone or a bluetooth earphone, wherein the earphone is connected to a music playing device, the earphone is used for playing music in the music playing device, and a music player such as a mobile phone or MP3, etc.
Specifically, PCM audio data of music played in a user's headphones within a predetermined time period is acquired.
S102, dividing PCM audio data into a plurality of audio frames according to a preset frame dividing mode;
the framing mode may be set according to the length of the PCM audio data, and in a specific embodiment of the present application, the PCM audio data may be framed every 20 ms.
Specifically, the PCM audio data obtained in step S101 is divided into a plurality of audio frames according to a preset frame dividing manner.
S103, analyzing each audio frame to obtain frequency spectrum information, and acquiring amplitude components of the audio frames in the frequency spectrum information, wherein each audio frame corresponds to one frequency spectrum information and comprises a plurality of amplitude components;
specifically, each audio frame is analyzed, time domain information corresponding to each audio frame is converted into frequency domain information, spectrum information corresponding to each audio frame is obtained, and a corresponding amplitude component is obtained in each spectrum information, wherein each audio frame corresponds to one spectrum information, and each audio frame comprises a plurality of amplitude components.
S104, carrying out normalization processing on the amplitude component of each audio frame to obtain the amplitude component weights of different frequency bands;
specifically, all the amplitude components obtained in step S103 are divided into different frequency band intervals, and the amplitude components of each audio frame in the different frequency band intervals are normalized to obtain the amplitude component weights of different frequency bands.
And S105, counting the weight of the amplitude component of all the audio frames, and adjusting the audio equalizer of the earphone according to the counting result.
Specifically, the amplitude component weights of all audio frames in different frequency bands are counted, and the compensation proportion of the audio equalizer of the earphone in different frequency bands is adjusted according to the counting result. In the specific embodiment of the present application, the compensation ratio of the equalizer is increased for the frequency band with the heavy amplitude component according to the statistical result, and the compensation ratio of the equalizer is decreased for the frequency band with the light amplitude component.
In the above embodiment, the audio equalizer that matches with the preference of the user is automatically adjusted according to the statistical result by obtaining the PCM audio data played in the earphone within the predetermined time period, dividing the PCM audio data into a plurality of audio frames in a preset framing manner, analyzing each audio frame to obtain frequency spectrum information, obtaining the amplitude component of the audio frame in the frequency spectrum information, normalizing the amplitude component of the audio frame after obtaining the amplitude component of the audio frame to obtain the amplitude component weights of different frequency bands in the audio frame, counting the amplitude component weights of all the audio frames, and adjusting the audio equalizer that matches with the preference of the user according to the statistical result.
Further, referring to fig. 2, fig. 2 is a flowchart illustrating an implementation of step S103 in fig. 1, where step S103 analyzes each audio frame to obtain spectrum information, and acquiring an amplitude component of the audio frame from the spectrum information specifically includes:
s201, sampling each audio frame according to a preset number of sampling points;
s202, analyzing the sampling result, and generating frequency spectrum information of each audio frame according to the analysis result;
and S203, acquiring the amplitude component corresponding to each sampling point according to the frequency spectrum information.
In the above embodiment, each audio frame is sampled by a preset number of sampling points, where the preset sampling points may be one or more; analyzing the sampling result, and generating the frequency spectrum information of each audio frame according to the analysis result; and acquiring an amplitude component corresponding to each sampling point according to the frequency spectrum information, wherein one amplitude component corresponding to each sampling point.
Further, the step S202 analyzes the sampling result, and generating the spectrum information of each audio frame according to the analysis result specifically includes:
and respectively carrying out fast Fourier transform operation on the sampling results, and generating the frequency spectrum information of each audio frame according to the result of the fast Fourier transform operation.
Among them, fast Fourier transform (fft) is an efficient algorithm based on dft (discrete Fourier transform), which operates faster than the conventional dft, and is called fast Fourier transform. The FFT is one of the most basic methods in time-domain to frequency-domain transform analysis, and the discrete fourier transform applied in the field of digital processing is the basis of many digital signal processing methods.
In the above embodiment, the frequency spectrum information of each audio frame is generated based on the result of the fast fourier transform operation by performing the fast fourier transform operation on the sampling results, respectively.
Further, step S104 normalizes the amplitude component of each audio frame to obtain the weights of the amplitude components of different frequency bands specifically includes:
dividing the amplitude component of each audio frame according to a preset frequency division mode;
the frequency division mode can be set in advance, and in a specific example of the application, the frequency division mode can be set to 6 frequency intervals which are respectively 20Hz-200Hz, 200Hz-600Hz, 600Hz-2000Hz, 2000Hz-6000Hz and 6000Hz-12000 Hz.
Specifically, the amplitude component of each audio frame is divided according to a preset frequency division manner to obtain different frequency band intervals, and all the amplitude components obtained in step S103 are divided into different frequency band intervals.
Calculating the total number of the amplitude components in each audio frame and the number of the amplitude components in different frequency bands;
specifically, the total number of amplitude components in each audio frame and the number of amplitude components in different frequency bands of each audio frame are calculated.
And calculating the weight of the amplitude components of different frequency bands in each audio frame according to the total number of the amplitude components in each audio frame and the number of the amplitude components in different frequency bands.
Specifically, according to the total number of the amplitude components in each audio frame and the number of the amplitude components of each audio frame in different frequency bands, the total number of the amplitude components of each audio frame in different frequency bands is divided by the total number of the amplitude components of each audio frame, and the weight of the amplitude components of each audio frame in different frequency bands is calculated.
In the above embodiment, the amplitude component of each audio frame is divided by a preset frequency division manner; calculating the total number of the amplitude components in each audio frame and the number of the amplitude components in different frequency bands; and calculating the weight of the amplitude components of different frequency bands in each audio frame according to the total number of the amplitude components in each audio frame and the number of the amplitude components in different frequency bands.
Further, step S105 counts the amplitude component weights of all audio frames, and adjusting the audio equalizer of the headphone according to the statistical result specifically includes:
accumulating the amplitude component weights of all audio frames;
and adjusting the audio equalizer of the earphone according to the accumulation result of the amplitude component weights of all the audio frames.
In the above embodiment, the weights of the amplitude components of all audio frames are accumulated; and adjusting an audio equalizer of the earphone according to the accumulation result of the amplitude component weights of all audio frames, increasing the compensation proportion of the equalizer for the frequency band with the large amplitude component weight, and reducing the compensation proportion of the equalizer for the frequency band with the small amplitude component weight.
Further, referring to fig. 3, fig. 3 is a flowchart illustrating a specific implementation of determining whether a user manually operates an audio equalizer in the method according to the embodiment of the present application, where step S104 normalizes an amplitude component of each audio frame to obtain weights of the amplitude components in different frequency bands, and the method further includes:
s301, judging whether a user performs manual operation on the earphone audio equalizer within a preset time period;
the manufacturers of the mobile devices can set the manual operation mode of the earphone audio equalizer, so that the user can adjust the earphone audio equalizer according to the preference of the user.
Specifically, it is determined whether a user manually operates the headphone audio equalizer through the music player within a predetermined time period, and in a specific embodiment of the present application, the headphone audio equalizer may be manually adjusted through a mobile phone.
S302, if the parameters exist, the parameters of the equalizer when the user manually operates the earphone audio equalizer within a preset time period are obtained, and the audio equalizer of the earphone is adjusted according to the parameters of the equalizer and the statistical result.
Specifically, if the user performs manual operation on the headphone audio equalizer within a predetermined time period, the equalizer parameters of the user during the manual operation on the headphone audio equalizer within the predetermined time period are obtained, and the audio equalizer of the headphone is adjusted according to the equalizer parameters and the statistical result of the amplitude component weights of all audio frames counted within the predetermined time period. And if the user does not manually operate the audio equalizer of the earphone within the preset time period, adjusting the audio equalizer of the earphone according to the statistical result of the amplitude component weights of all the audio frames counted within the preset time period.
In the above embodiment, the manual operation of the earphone audio equalizer is determined by determining whether the user has performed within a predetermined time period; if the parameters exist, acquiring equalizer parameters when a user manually operates the earphone audio equalizer within a preset time period, and adjusting the earphone audio equalizer according to the equalizer parameters and the statistical result; if not, the audio equalizer of the earphone is adjusted according to the statistical result, so that the adjustment efficiency of the audio equalizer of the earphone is improved, and meanwhile, the audio equalizer matched with the preference of the user is automatically adjusted.
Further, referring to fig. 4, fig. 4 is a flowchart illustrating an implementation of step S302 in fig. 3, where if step S302 exists, the step S302 obtains an equalizer parameter when the user manually operates the audio equalizer of the earphone within a predetermined time period, and according to the equalizer parameter and the statistical result, adjusting the audio equalizer of the earphone specifically includes:
s401, identifying an operation mode of a user for manually operating the earphone audio equalizer within a preset time period, wherein the operation mode comprises a fixed operation mode and a user-defined operation mode;
the fixed operation mode is common, such as a classical mode, a popular mode, a dance mode, a rock mode, and the like, and the gain value of the audio equalizer in each frequency band in the fixed operation mode is a fixed value preset by a manufacturer of each mobile device, and a user generally cannot adjust the gain value of the audio equalizer at will. The user-defined operation mode provides a user-defined frequency band gain mode in a wide frequency band of-15 dB to +15dB for the user to adjust, and the user can adjust the audio frequency equalizer suitable for the user on the mobile terminal according to the preference of the user in the user-defined frequency band gain mode, so that the gain value of each frequency band of the audio frequency equalizer is adapted to the preference of the user.
Specifically, an operation mode of manually operating the earphone audio equalizer by a user in a preset time period is identified, wherein the operation mode comprises a fixed operation mode and a user-defined operation mode
S402, if the operation mode of the user for manually operating the earphone audio equalizer in a preset time period is a fixed operation mode, acquiring a first equalizer parameter corresponding to the fixed operation mode, adjusting the statistical result according to the first equalizer parameter to obtain a first adjustment parameter, and adjusting the earphone audio equalizer by adopting the first adjustment parameter;
specifically, equalizer parameters corresponding to the statistical result are obtained, an average value of the first equalizer parameter and the equalizer parameter corresponding to the statistical result is calculated, the average value is a first adjustment parameter, and the audio equalizer of the earphone is adjusted by using the first adjustment parameter. In a specific embodiment of the present application, the equalizer parameters corresponding to the primary statistical result are "31 Hz: +3db, 62 Hz: +1db, 125 Hz: -3db, 250 Hz: -2db, 500 Hz: -4db, 1 kHz: -3db, 2 kHz: -1db, 4 kHz: 2db, 8 kHz: +1db ", and in the statistical process, the headphone audio equalizer is manually operated, and the manual operation mode is a subwoofer mode in a fixed operation mode, and one standard equalizer parameter in the subwoofer mode is" 31 Hz: +5db, 62 Hz: +1db, 125 Hz: -1db, 250 Hz: -2db, 500 Hz: -2db, 1 kHz: -3db, 2 kHz: -1db, 4 kHz: 0db, 8 kHz: +1db ", the first adjustment parameter obtained by calculating the average value of the standard equalizer parameter in the subwoofer mode and the equalizer parameter corresponding to the statistical result is" 31 Hz: +4db, 62 Hz: +1db, 125 Hz: -2db, 250 Hz: -2db, 500 Hz: -3db, 1 kHz: -3db, 2 kHz: -1db, 4 kHz: 1db, 8 kHz: +1db ", the user headphone audio equalizer is adjusted by the first adjustment parameter.
And S403, if the operation mode of the user for manually operating the audio equalizer of the earphone in the preset time period is the user-defined operation mode, obtaining a second equalizer parameter corresponding to the user-defined operation mode, adjusting the statistical result according to the second equalizer parameter to obtain a second adjustment parameter, and adjusting the audio equalizer of the earphone by adopting the second adjustment parameter.
Specifically, the equalizer parameters corresponding to the statistical result are obtained, the second equalizer parameters and the average value of the equalizer parameters corresponding to the statistical result are calculated, the average value is the second adjustment parameter, and the second adjustment parameter is adopted to adjust the audio equalizer of the earphone. In a specific embodiment of the present application, the equalizer parameters corresponding to the primary statistical result are "31 Hz: +3db, 62 Hz: +1db, 125 Hz: -3db, 250 Hz: -2db, 500 Hz: -4db, 1 kHz: -3db, 2 kHz: -1db, 4 kHz: 2db, 8 kHz: +1db ", and in the statistical process, the earphone audio equalizer is manually operated, and the manual operation mode is the user-defined operation mode, and the equalizer parameters are" 31 Hz: +3db, 62 Hz: +3db, 125 Hz: -3db, 250 Hz: 0db, 500 Hz: 0db, 1 kHz: -1db, 2 kHz: -3db, 4 kHz: -2db, 8 kHz: +3db ", the second adjustment parameter obtained by calculating the average value of the equalizer parameter in the custom operation mode and the equalizer parameter corresponding to the statistical result is" 31 Hz: +3db, 62 Hz: +2db, 125 Hz: -3db, 250 Hz: -1db, 500 Hz: -2db, 1 kHz: -2db, 2 kHz: -2db, 4 kHz: 0db, 8 kHz: +2db ", the user headphone audio equalizer is adjusted by the first adjustment parameter.
The application discloses a method for adjusting an audio equalizer of an earphone, which belongs to the technical field of audio processing and comprises the steps of obtaining PCM audio data played in the earphone within a preset time period; dividing PCM audio data into a plurality of audio frames according to a preset frame dividing mode; analyzing each audio frame to obtain frequency spectrum information, and acquiring amplitude components of the audio frames from the frequency spectrum information, wherein each audio frame corresponds to one frequency spectrum information and comprises a plurality of amplitude components; normalizing the amplitude component of each audio frame to obtain the amplitude component weights of different frequency bands; and counting the weight of the amplitude component of all the audio frames, and adjusting an audio equalizer of the earphone according to the counting result. After the amplitude components of the audio frames are obtained, the amplitude components of the audio frames are normalized to obtain the amplitude component weights of different frequency bands in the audio frames, the amplitude component weights of all the audio frames are counted, and the audio equalizer matched with the preference of the audio equalizer is automatically adjusted according to the counting result.
Example two
Referring to fig. 5, fig. 5 is a schematic structural diagram of an adjusting apparatus of an audio equalizer of a headphone, where the adjusting apparatus of the audio equalizer of the headphone includes:
an obtaining module 501, configured to obtain PCM audio data played in an earphone within a predetermined time period;
a framing module 501, configured to divide PCM audio data into a plurality of audio frames according to a preset framing manner;
the analysis module 501 analyzes each audio frame to obtain frequency spectrum information, and obtains amplitude components of the audio frame from the frequency spectrum information, wherein each audio frame corresponds to one frequency spectrum information, and each audio frame comprises a plurality of amplitude components;
the normalization module 501 is configured to perform normalization processing on the amplitude component of each audio frame to obtain the amplitude component weights of different frequency bands;
and a statistic module 501, configured to count the amplitude component weights of all audio frames, and adjust an audio equalizer of the earphone according to a statistical result.
Further, the parsing module 501 specifically includes:
the sampling unit is used for sampling each audio frame according to a preset number of sampling points;
the analysis unit is used for analyzing the sampling result and generating the frequency spectrum information of each audio frame according to the analysis result;
and the amplitude component acquisition unit is used for acquiring the amplitude component corresponding to each sampling point according to the frequency spectrum information.
Further, the parsing unit specifically includes:
and the fast Fourier transform subunit is used for respectively carrying out fast Fourier transform operation on the sampling results and generating the frequency spectrum information of each audio frame according to the result of the fast Fourier transform operation.
Further, the normalization module 501 specifically includes:
the frequency division unit is used for dividing the amplitude component of each audio frame according to a preset frequency division mode;
the amplitude component counting unit is used for calculating the total number of the amplitude components in each audio frame and the number of the amplitude components in different frequency bands;
and the amplitude component weight calculation unit is used for calculating the amplitude component weights of different frequency bands in each audio frame according to the total number of the amplitude components in each audio frame and the number of the amplitude components in different frequency bands.
Further, the statistics module 501 specifically includes:
the accumulation unit is used for accumulating the weight of the amplitude component of all the audio frames;
and the adjusting unit is used for adjusting the audio equalizer of the earphone according to the accumulation result of the amplitude component weights of all the audio frames.
Further, the adjusting apparatus of the headphone audio equalizer further includes:
the judging module is used for judging whether the user performs manual operation on the earphone audio equalizer within a preset time period;
and the judgment result module is used for acquiring equalizer parameters when the user manually operates the earphone audio equalizer within the preset time period, and adjusting the earphone audio equalizer according to the equalizer parameters and the statistical result.
Further, the result judgment module specifically includes:
the identification unit is used for identifying an operation mode of manually operating the earphone audio equalizer by a user within a preset time period, wherein the operation mode comprises a fixed operation mode and a self-defined operation mode;
the first identification result unit is used for acquiring a first equalizer parameter corresponding to a fixed operation mode when the operation mode of a user for manually operating the earphone audio equalizer within a preset time period is the fixed operation mode, adjusting the statistical result according to the first equalizer parameter to obtain a first adjustment parameter, and adjusting the audio equalizer of the earphone by adopting the first adjustment parameter;
and the second identification result unit is used for acquiring a second equalizer parameter corresponding to the user-defined operation mode when the operation mode of the user for manually operating the earphone audio equalizer within the preset time period is the user-defined operation mode, adjusting the statistical result according to the second equalizer parameter to obtain a second adjustment parameter, and adjusting the audio equalizer of the earphone by adopting the second adjustment parameter.
The application discloses an adjusting device obtaining module 501 of an earphone audio equalizer, which is used for obtaining PCM audio data played in an earphone within a preset time period; a framing module 501, configured to divide PCM audio data into a plurality of audio frames according to a preset framing manner; the analysis module 501 analyzes each audio frame to obtain frequency spectrum information, and obtains amplitude components of the audio frame from the frequency spectrum information, wherein each audio frame corresponds to one frequency spectrum information, and each audio frame comprises a plurality of amplitude components; the normalization module 501 is configured to perform normalization processing on the amplitude component of each audio frame to obtain the amplitude component weights of different frequency bands; and a statistic module 501, configured to count the amplitude component weights of all audio frames, and adjust an audio equalizer of the earphone according to a statistical result. After the amplitude components of the audio frames are obtained, the amplitude components of the audio frames are normalized to obtain the amplitude component weights of different frequency bands in the audio frames, the amplitude component weights of all the audio frames are counted, and the audio equalizer matched with the preference of the audio equalizer is automatically adjusted according to the counting result.
EXAMPLE III
In order to solve the technical problem, an embodiment of the present application further provides a computer device. Referring to fig. 6, fig. 6 is a block diagram of a basic structure of a computer device according to the present embodiment.
The computer device 6 comprises a memory 61, a processor 62, a network interface 63 communicatively connected to each other via a system bus. It is noted that only a computer device 6 having components 61-63 is shown, but it is understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead. As will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer equipment can carry out man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
The memory 61 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 61 may be an internal storage unit of the computer device 6, such as a hard disk or a memory of the computer device 6. In other embodiments, the memory 61 may also be an external storage device of the computer device 6, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the computer device 6. Of course, the memory 61 may also comprise both an internal storage unit of the computer device 6 and an external storage device thereof. In this embodiment, the memory 61 is generally used for storing an operating system installed in the computer device 6 and various types of application software, such as a program code of an adjusting method of a headphone audio equalizer. Further, the memory 61 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 62 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 62 is typically used to control the overall operation of the computer device 6. In this embodiment, the processor 62 is configured to execute the program code stored in the memory 61 or process data, for example, execute the program code of the adjusting method of the headphone audio equalizer.
The network interface 63 may comprise a wireless network interface or a wired network interface, and the network interface 63 is typically used for establishing a communication connection between the computer device 6 and other electronic devices.
The present application further provides another embodiment, which is to provide a computer readable storage medium storing a program of an adjusting method of a headphone audio equalizer, where the program of the adjusting method of the headphone audio equalizer is executable by at least one processor to cause the at least one processor to execute the steps of the adjusting method of the headphone audio equalizer as described above.
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 application 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 application.
It is to be understood that the above-described embodiments are merely illustrative of some, but not restrictive, of the broad invention, and that the appended drawings illustrate preferred embodiments of the invention and do not limit the scope of the invention. This application is capable of embodiments in many different forms and is provided for the purpose of enabling a thorough understanding of the disclosure of the application. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to one skilled in the art that the present application may be practiced without modification or with equivalents of some of the features described in the foregoing embodiments. All equivalent structures made by using the contents of the specification and the drawings of the present application are directly or indirectly applied to other related technical fields and are within the protection scope of the present application.

Claims (10)

1. A method for adjusting an audio equalizer of a headphone, comprising:
acquiring PCM audio data played in the earphone within a preset time period;
dividing the PCM audio data into a plurality of audio frames according to a preset frame dividing mode;
analyzing each audio frame to obtain frequency spectrum information, and acquiring amplitude components of the audio frames from the frequency spectrum information, wherein each audio frame corresponds to one frequency spectrum information and comprises a plurality of amplitude components;
normalizing the amplitude component of each audio frame to obtain the amplitude component weights of different frequency bands;
and counting the weight of the amplitude component of all the audio frames, and adjusting the audio equalizer of the earphone according to the counting result.
2. The method for adjusting an audio equalizer of a headphone according to claim 1, wherein the parsing each audio frame to obtain spectral information, and obtaining the amplitude component of the audio frame from the spectral information specifically includes:
sampling each audio frame according to a preset number of sampling points;
analyzing the sampling result, and generating the frequency spectrum information of each audio frame according to the analysis result;
and acquiring the amplitude component corresponding to each sampling point according to the frequency spectrum information.
3. The method for adjusting an audio equalizer of a headphone according to claim 2, wherein the parsing the sampling result and generating the spectrum information of each audio frame according to the parsing result specifically includes:
and respectively carrying out fast Fourier transform operation on the sampling results, and generating the frequency spectrum information of each audio frame according to the result of the fast Fourier transform operation.
4. The method for adjusting an audio equalizer of a headphone according to claim 1, wherein the normalizing the amplitude component of each audio frame to obtain the weights of the amplitude components of different frequency bands specifically comprises:
dividing the amplitude component of each audio frame according to a preset frequency division mode;
calculating the total number of the amplitude components in each audio frame and the number of the amplitude components in the different frequency bands;
and calculating the weight of the amplitude component of the different frequency bands in each audio frame according to the total number of the amplitude components in each audio frame and the number of the amplitude components in the different frequency bands.
5. The method for adjusting an audio equalizer of a headphone according to claim 1, wherein the step of counting the weights of the amplitude components of all the audio frames and the step of adjusting the audio equalizer of the headphone according to the statistical result specifically comprises:
accumulating the amplitude component weights of all the audio frames;
and adjusting the audio equalizer of the earphone according to the accumulation result of the amplitude component weights of all the audio frames.
6. The method for adjusting an audio equalizer of a headphone according to any one of claims 1 to 5, wherein after the normalizing the amplitude component of each audio frame to obtain the weights of the amplitude components of different frequency bands, the method further comprises:
judging whether a user performs manual operation on the earphone audio equalizer within a preset time period;
if the parameters exist, the equalizer parameters of the user in the manual operation of the earphone audio equalizer within the preset time period are obtained, and the audio equalizer of the earphone is adjusted according to the equalizer parameters and the statistical result.
7. The method for adjusting an audio equalizer of a headphone according to claim 6, wherein if the audio equalizer exists, the obtaining the equalizer parameters when the user manually operates the audio equalizer of the headphone within a predetermined time period, and the adjusting the audio equalizer of the headphone according to the equalizer parameters and the statistical result specifically includes:
identifying an operation mode of the manual operation of the earphone audio equalizer by a user in a preset time period, wherein the operation mode comprises a fixed operation mode and a custom operation mode;
if the operation mode of the user for manually operating the earphone audio equalizer within the preset time period is a fixed operation mode, acquiring a first equalizer parameter corresponding to the fixed operation mode, adjusting the statistical result according to the first equalizer parameter to obtain a first adjustment parameter, and adjusting the earphone audio equalizer by adopting the first adjustment parameter;
if the operation mode of the user for manually operating the earphone audio frequency equalizer in the preset time period is the user-defined operation mode, obtaining a second equalizer parameter corresponding to the user-defined operation mode, adjusting the statistical result according to the second equalizer parameter to obtain a second adjustment parameter, and adjusting the earphone audio frequency equalizer by adopting the second adjustment parameter.
8. An adjustment apparatus for a headphone audio equalizer, comprising:
the acquisition module is used for acquiring PCM audio data played in the earphone within a preset time period;
the framing module is used for dividing the PCM audio data into a plurality of audio frames according to a preset framing mode;
the analysis module is used for analyzing each audio frame to obtain frequency spectrum information and acquiring amplitude components of the audio frames from the frequency spectrum information, wherein each audio frame corresponds to one frequency spectrum information and comprises a plurality of amplitude components;
the normalization module is used for performing normalization processing on the amplitude component of each audio frame to obtain the amplitude component weights of different frequency bands;
and the statistic module is used for counting the weight of the amplitude component of all the audio frames and adjusting the audio equalizer of the earphone according to the statistic result.
9. A computer device comprising a memory and a processor, characterized in that the memory has stored therein a computer program which, when being executed by the processor, carries out the steps of the method of adjusting an audio equalizer of a headphone according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the method of adjusting an audio equalizer of a headphone according to one of the claims 1 to 7.
CN202010008500.5A 2020-01-07 2020-01-07 Method and device for adjusting earphone audio equalizer Active CN113163298B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010008500.5A CN113163298B (en) 2020-01-07 2020-01-07 Method and device for adjusting earphone audio equalizer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010008500.5A CN113163298B (en) 2020-01-07 2020-01-07 Method and device for adjusting earphone audio equalizer

Publications (2)

Publication Number Publication Date
CN113163298A true CN113163298A (en) 2021-07-23
CN113163298B CN113163298B (en) 2022-09-20

Family

ID=76881305

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010008500.5A Active CN113163298B (en) 2020-01-07 2020-01-07 Method and device for adjusting earphone audio equalizer

Country Status (1)

Country Link
CN (1) CN113163298B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090103752A1 (en) * 2007-10-19 2009-04-23 Realtek Semiconductor Corp. Device and method for automatically adjusting gain
US20120051558A1 (en) * 2010-09-01 2012-03-01 Samsung Electronics Co., Ltd. Method and apparatus for reproducing audio signal by adaptively controlling filter coefficient
CN103780214A (en) * 2012-10-24 2014-05-07 华为终端有限公司 Method and device for adjusting audio equalizer
CN106713794A (en) * 2016-11-29 2017-05-24 青岛海信电器股份有限公司 Method for adjusting audio equalizing and audio system for providing equalizing adjustment
CN107181996A (en) * 2017-05-08 2017-09-19 深圳市创锐实业有限公司 The method and apparatus that a kind of audio amplitude for audio amplifier is limited
CN108369494A (en) * 2015-10-28 2018-08-03 Dts(英属维尔京群岛)有限公司 The Spectrum Correction of audio signal
WO2019033440A1 (en) * 2017-08-18 2019-02-21 广东欧珀移动通信有限公司 Volume adjustment method and apparatus, terminal device, and storage medium
CN109686347A (en) * 2018-11-30 2019-04-26 北京达佳互联信息技术有限公司 Sound effect treatment method, sound-effect processing equipment, electronic equipment and readable medium
CN110335623A (en) * 2019-07-09 2019-10-15 上海艾为电子技术股份有限公司 Audio data processing method and device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090103752A1 (en) * 2007-10-19 2009-04-23 Realtek Semiconductor Corp. Device and method for automatically adjusting gain
US20120051558A1 (en) * 2010-09-01 2012-03-01 Samsung Electronics Co., Ltd. Method and apparatus for reproducing audio signal by adaptively controlling filter coefficient
CN103780214A (en) * 2012-10-24 2014-05-07 华为终端有限公司 Method and device for adjusting audio equalizer
CN108369494A (en) * 2015-10-28 2018-08-03 Dts(英属维尔京群岛)有限公司 The Spectrum Correction of audio signal
CN106713794A (en) * 2016-11-29 2017-05-24 青岛海信电器股份有限公司 Method for adjusting audio equalizing and audio system for providing equalizing adjustment
CN107181996A (en) * 2017-05-08 2017-09-19 深圳市创锐实业有限公司 The method and apparatus that a kind of audio amplitude for audio amplifier is limited
WO2019033440A1 (en) * 2017-08-18 2019-02-21 广东欧珀移动通信有限公司 Volume adjustment method and apparatus, terminal device, and storage medium
CN109686347A (en) * 2018-11-30 2019-04-26 北京达佳互联信息技术有限公司 Sound effect treatment method, sound-effect processing equipment, electronic equipment and readable medium
CN110335623A (en) * 2019-07-09 2019-10-15 上海艾为电子技术股份有限公司 Audio data processing method and device

Also Published As

Publication number Publication date
CN113163298B (en) 2022-09-20

Similar Documents

Publication Publication Date Title
CN104954555B (en) A kind of volume adjusting method and system
CN102549659A (en) Suppressing noise in an audio signal
CN107465824A (en) volume adjusting method, device, mobile terminal and storage medium
CN112309414B (en) Active noise reduction method based on audio encoding and decoding, earphone and electronic equipment
US11822854B2 (en) Automatic volume adjustment method and apparatus, medium, and device
CN107566618A (en) volume adjusting method, device, terminal device and storage medium
CN107436751A (en) volume adjusting method, device, terminal device and storage medium
CN107526570A (en) volume adjusting method, device, terminal device and storage medium
CN103282960A (en) Voice control device, voice control method and voice control program
JP2019176477A (en) Arrangement method of wireless loudspeaker, wireless loudspeaker, and terminal device
CN105897666A (en) Real time voice receiving device and delay reduction method for real time voice conversations
CN108829370B (en) Audio resource playing method and device, computer equipment and storage medium
CN113163298B (en) Method and device for adjusting earphone audio equalizer
CN101600132B (en) Method and device for adjusting audio file play effect on portable handheld device
CN113362839A (en) Audio data processing method and device, computer equipment and storage medium
CN112188342A (en) Equalization parameter determination method and device, electronic equipment and storage medium
CN107506168A (en) volume adjusting method, device, terminal device and storage medium
WO2020186695A1 (en) Voice information batch processing method and apparatus, computer device, and storage medium
CN107750038B (en) Volume adjusting method, device, equipment and storage medium
CN106293607B (en) Method and system for automatically switching audio output modes
CN111477246A (en) Voice processing method and device and intelligent terminal
CN111370017B (en) Voice enhancement method, device and system
WO2021179470A1 (en) Method, device and system for recognizing sampling rate of pure voice data
WO2021103262A1 (en) Earphone control method, earphone and readable storage medium
CN110517708B (en) Audio processing method and device and computer storage medium

Legal Events

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