Audio playing method, audio playing device and terminal equipment

文档序号:1448962 发布日期:2020-02-18 浏览:35次 中文

阅读说明:本技术 音频播放方法、音频播放装置及终端设备 (Audio playing method, audio playing device and terminal equipment ) 是由 林贻鸿 于 2019-11-21 设计创作,主要内容包括:本申请提供的一种音频播放方法,包括:获取待播放音频;在播放所述待播放音频时,根据播放时的第一音频参数,实时检测是否存在第一谐波失真情况符合预设条件的目标频率分量;若存在第一谐波失真情况符合预设条件的目标频率分量,则检测所述目标频率分量的目标谐波频率所对应的第一响度与第二响度的比值是否大于第一预设值,其中,所述第二响度为所述待播放音频中频率为所述目标谐波频率的音频部分的响度;若所述目标频率分量的目标谐波频率所对应的第一响度与第二响度的比值大于第一预设值,则调整所述第一音频参数,以使得调整后的第一响度与调整后的第二响度的比值不大于第一预设值。通过上述方法,能够减小音频的播放失真,提升用户体验。(The application provides an audio playing method, which comprises the following steps: acquiring audio to be played; when the audio to be played is played, detecting whether a target frequency component with a first harmonic distortion condition meeting a preset condition exists in real time according to a first audio parameter during playing; if a target frequency component with a first harmonic distortion condition meeting a preset condition exists, detecting whether the ratio of a first loudness to a second loudness corresponding to a target harmonic frequency of the target frequency component is greater than a first preset value, wherein the second loudness is the loudness of an audio part with the target harmonic frequency in the audio to be played; and if the ratio of the first loudness to the second loudness corresponding to the target harmonic frequency of the target frequency component is greater than a first preset value, adjusting the first audio parameter so that the ratio of the adjusted first loudness to the adjusted second loudness is not greater than the first preset value. By the method, the playing distortion of the audio can be reduced, and the user experience is improved.)

1. An audio playing method, comprising:

acquiring audio to be played;

when the audio to be played is played, detecting whether a target frequency component with a first harmonic distortion condition meeting a preset condition exists in real time according to a first audio parameter during playing;

if a target frequency component with a first harmonic distortion condition meeting a preset condition exists, detecting whether the ratio of a first loudness to a second loudness corresponding to a target harmonic frequency of the target frequency component is greater than a first preset value, wherein the second loudness is the loudness of an audio part with the target harmonic frequency in the audio to be played;

and if the ratio of the first loudness to the second loudness corresponding to the target harmonic frequency of the target frequency component is greater than a first preset value, adjusting the first audio parameter so that the ratio of the adjusted first loudness to the adjusted second loudness is not greater than the first preset value.

2. The audio playing method according to claim 1, wherein the audio to be played is played through smart glasses.

3. The audio playing method according to claim 1, wherein before playing the audio to be played, further comprising:

obtaining a distortion estimation result of at least one pre-detected pre-set single-frequency sound source, wherein the distortion estimation result comprises distortion estimation sub-results corresponding to the pre-set single-frequency sound sources respectively, and any distortion estimation sub-result comprises a second harmonic distortion condition corresponding to the pre-set single-frequency sound source when the corresponding pre-set single-frequency sound source is played according to each pre-set audio parameter in a pre-set audio parameter set respectively;

when the audio to be played is played, whether a target frequency component with a first harmonic distortion condition meeting a preset condition exists or not is detected in real time according to a first audio parameter during playing, and the method comprises the following steps:

when the audio to be played is played, detecting the third harmonic distortion condition of the corresponding playing frequency band in real time when the audio to be played is played according to the first audio parameter according to the distortion estimation result;

and judging whether a target frequency component with the first harmonic distortion condition meeting the preset condition exists according to the third harmonic distortion condition of the playing frequency band.

4. The audio playback method as claimed in claim 3, wherein the second harmonic distortion condition comprises a component distortion condition and/or a total harmonic distortion condition of all or part of harmonics of the corresponding predetermined single-frequency source.

5. The audio playback method of claim 1, wherein the first audio parameters comprise at least one of equalization effector parameters, automatic gain control parameters, and dynamic range control parameters.

6. The audio playing method according to any one of claims 1 to 5, wherein when the audio to be played is played, detecting whether there is a target frequency component whose first harmonic distortion condition meets a preset condition in real time according to a first audio parameter during playing, includes:

and when the audio to be played is played, detecting whether a target frequency component with total harmonic distortion meeting a preset distortion condition exists in real time according to a first audio parameter during playing.

7. The audio playing method according to any one of claims 1 to 5, wherein when the audio to be played is played, detecting whether there is a target frequency component whose first harmonic distortion condition meets a preset condition in real time according to a first audio parameter during playing, includes:

when the audio to be played is played, detecting the playing loudness of the audio to be played in real time according to a first audio parameter during playing;

and if the playing loudness is higher than a preset loudness threshold value, detecting whether a target frequency component with a first harmonic distortion condition meeting a preset condition exists.

8. An audio playback apparatus, comprising:

the acquisition module is used for acquiring audio to be played;

the first detection module is used for detecting whether a target frequency component with a first harmonic distortion condition meeting a preset condition exists in real time according to a first audio parameter during playing when the audio to be played is played;

the second detection module is configured to detect whether a ratio of a first loudness to a second loudness, which is a loudness of an audio portion of the audio to be played, where the frequency of the audio portion is the target harmonic frequency, corresponding to the target harmonic frequency of the target frequency component is greater than a first preset value, if a target frequency component exists, where a first harmonic distortion condition of the target frequency component meets a preset condition;

and the adjusting module is used for adjusting the first audio parameter if the ratio of the first loudness to the second loudness corresponding to the target harmonic frequency of the target frequency component is greater than a first preset value, so that the ratio of the adjusted first loudness to the adjusted second loudness is not greater than the first preset value.

9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the audio playback method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, implements the audio playback method according to any one of claims 1 to 7.

Technical Field

The present application belongs to the technical field of audio processing, and in particular, relates to an audio playing method, an audio playing apparatus, a terminal device, and a computer-readable storage medium.

Background

With the development of terminal devices such as various virtual reality devices, augmented display devices, mixed reality devices, mobile terminals, wearable devices and the like, users can conveniently play audio through speakers, earphones and the like of various terminal devices. When the audio is played, due to the characteristics of the amplifier, the loudspeaker and the like, the audio is often distorted to a certain extent, and in some cases, the corresponding loudspeaker and the like are often close to the ear of the user, so that poor hearing experience can be caused by small playing distortion.

Disclosure of Invention

The embodiment of the application provides an audio playing method, an audio playing device, a terminal device and a computer readable storage medium, which can reduce audio playing distortion and improve user experience.

In a first aspect, an embodiment of the present application provides an audio playing method, including:

acquiring audio to be played;

when the audio to be played is played, detecting whether a target frequency component with a first harmonic distortion condition meeting a preset condition exists in real time according to a first audio parameter during playing;

if a target frequency component with a first harmonic distortion condition meeting a preset condition exists, detecting whether the ratio of a first loudness to a second loudness corresponding to a target harmonic frequency of the target frequency component is greater than a first preset value, wherein the second loudness is the loudness of an audio part with the target harmonic frequency in the audio to be played;

and if the ratio of the first loudness to the second loudness corresponding to the target harmonic frequency of the target frequency component is greater than a first preset value, adjusting the first audio parameter so that the ratio of the adjusted first loudness to the adjusted second loudness is not greater than the first preset value.

In a second aspect, an embodiment of the present application provides an audio playing apparatus, including:

the acquisition module is used for acquiring audio to be played;

the first detection module is used for detecting whether a target frequency component with a first harmonic distortion condition meeting a preset condition exists in real time according to a first audio parameter during playing when the audio to be played is played;

the second detection module is configured to detect whether a ratio of a first loudness to a second loudness, which is a loudness of an audio portion of the audio to be played, where the frequency of the audio portion is the target harmonic frequency, corresponding to the target harmonic frequency of the target frequency component is greater than a first preset value, if a target frequency component exists, where a first harmonic distortion condition of the target frequency component meets a preset condition;

and the adjusting module is used for adjusting the first audio parameter if the ratio of the first loudness to the second loudness corresponding to the target harmonic frequency of the target frequency component is greater than a first preset value, so that the ratio of the adjusted first loudness to the adjusted second loudness is not greater than the first preset value.

In a third aspect, an embodiment of the present application provides a terminal device, which includes a memory, a processor, a display, and a computer program stored in the memory and executable on the processor, where the processor implements the audio playing method according to the first aspect when executing the computer program.

In a fourth aspect, the present application provides a computer-readable storage medium, where a computer program is stored, and when executed by a processor, the computer program implements the audio playing method according to the first aspect.

In a fifth aspect, an embodiment of the present application provides a computer program product, which, when running on a terminal device, causes the terminal device to execute the audio playing method described in the first aspect.

Compared with the prior art, the embodiment of the application has the advantages that: in the embodiment of the application, when the audio to be played is played, whether the target frequency component with the first harmonic distortion condition meeting the preset condition exists or not is detected in real time according to the first audio parameter during playing, so that the target frequency component with the serious harmonic distortion condition in the audio to be played can be screened out, and then the target frequency component is subjected to subsequent detection and processing, so that the data volume of subsequent data processing is reduced, and the accuracy of distortion processing is improved; further, if there is a target frequency component whose first harmonic distortion condition meets a preset condition, detecting whether a ratio of a first loudness corresponding to a target harmonic frequency of the target frequency component to a second loudness is greater than a first preset value, and further detecting whether a harmonic of the target frequency component affects the playing of the audio to be played; if the ratio of the first loudness to the second loudness corresponding to the target harmonic frequency of the target frequency component is greater than a first preset value, the first audio parameter is adjusted so that the ratio of the adjusted first loudness to the adjusted second loudness is not greater than the first preset value, and therefore the influence of the harmonic of the target frequency component on the normally played audio can be reduced. By the embodiment of the application, the playing distortion of the audio can be reduced and the user experience can be improved under the condition that the hardware cost and the circuit complexity are not increased.

Drawings

In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.

Fig. 1 is a schematic flowchart illustrating an audio playing method according to an embodiment of the present application;

fig. 2 is a schematic flowchart of another audio playing method according to an embodiment of the present application;

fig. 3 is a schematic structural diagram of an audio playing apparatus according to an embodiment of the present application;

fig. 4 is a schematic structural diagram of a terminal device according to an embodiment of the present application.

Detailed Description

In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.

It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.

It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".

Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.

Specifically, fig. 1 shows a flowchart of a first audio playing method provided in an embodiment of the present application, where the audio playing method is applied to a terminal device.

The audio playing method provided by the embodiment of the present application may be applied to terminal devices such as smart glasses, mobile phones, tablet computers, wearable devices, vehicle-mounted devices, Augmented Reality (AR)/Virtual Reality (VR) devices, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, Personal Digital Assistants (PDAs), and the like, and the embodiment of the present application does not set any limit on the specific type of the terminal device.

The audio playing method comprises the following steps:

step S101, obtaining the audio to be played.

In the embodiment of the application, the audio to be played can be acquired in various ways. For example, the audio to be played may be acquired by the terminal device according to the embodiment of the present application through an internal or external audio acquisition device such as a microphone, or may be acquired by the terminal device from another terminal through a specific information transmission manner (e.g., a wired transmission manner or a wireless transmission manner). The type of the audio to be played may be various, and is not limited herein.

And S102, when the audio to be played is played, detecting whether a target frequency component with a first harmonic distortion condition meeting a preset condition exists in real time according to a first audio parameter during playing.

In the embodiment of the application, the audio to be played can be played through a preset audio playing application in the terminal equipment. The first audio parameter may be predetermined, or may be obtained by dynamically adjusting, by an application playing the audio to be played, according to the type of the audio to be played, the audio condition included in the audio, and the like. The target frequency component may be a single frequency, multiple frequencies, or one or more frequency bands.

In the embodiment of the present application, harmonic distortion may refer to distortion caused by all or part of harmonic components of an output signal that are more than an input signal. The total harmonic distortion is the sum of all harmonic distortions. The first harmonic distortion case may include a distortion case of all or part of the corresponding harmonics and/or a total harmonic distortion case. Further, in some embodiments, the first harmonic distortion case may include a distortion case and/or a total harmonic distortion case for all or a portion of the corresponding harmonics at different loudness. The preset condition may be determined according to an actual scene. For example, the preset condition may refer to that the sum of magnitudes of the harmonics within the preset frequency range is greater than a first specified proportion (e.g., 5%) of the magnitude of the amplitude of the corresponding fundamental wave (i.e., the target frequency component); alternatively, a second specified proportion of the total harmonic distortion having a magnitude greater than the magnitude of the amplitude of the corresponding fundamental wave, and so on.

In some embodiments, the first audio parameter may comprise at least one of an equalization effector parameter, an automatic gain control parameter, and a dynamic range control parameter.

Wherein the equalization Effector (EQ) parameter may include at least one of a Q value, a frequency parameter, an amplitude parameter, and the like, and the Automatic Gain Control (AGC) parameter may include at least one of a loudness Gain factor, a Gain weight for each frequency, and the like. The Dynamic Range Control (DRC) parameter may include at least one of a compression parameter, a zoom parameter, and the like.

Step S103, if there is a target frequency component whose first harmonic distortion condition meets a preset condition, detecting whether a ratio of a first loudness corresponding to a target harmonic frequency of the target frequency component to a second loudness is greater than a first preset value, where the second loudness is a loudness of an audio portion of the audio to be played whose frequency is the target harmonic frequency.

In the embodiment of the present application, the target harmonic frequency may be selected according to an actual scene. For example, the harmonic frequency of the target frequency component in the hearing frequency range of the person may be determined to be the target harmonic frequency. Furthermore, since the hazards caused by odd harmonics may be greater than even harmonics, the target harmonic frequency may be some or all of the odd harmonics of the target frequency component.

Step S104, if the ratio of the first loudness to the second loudness corresponding to the target harmonic frequency of the target frequency component is greater than a first preset value, adjusting the first audio parameter so that the ratio of the adjusted first loudness to the adjusted second loudness is not greater than the first preset value.

In the embodiment of the application, the first audio parameter is adjusted, so that the ratio of the adjusted first loudness to the adjusted second loudness is not greater than a first preset value, and the influence of the harmonic of the target frequency component on the normally played audio can be reduced.

In the embodiment of the application, after the first audio parameter is adjusted, the audio to be played can be played through the adjusted first audio parameter.

It should be noted that, in the embodiment of the present application, when detecting whether there is a target frequency component whose first harmonic distortion condition meets a preset condition in real time, it may be to detect an audio portion to be played in the audio to be played, where the target frequency component is a frequency component in the audio portion to be played. The size of the audio portion to be played can be determined according to the actual application scenario. Further, after the first audio parameter is adjusted, the corresponding audio part to be played in the audio to be played may be played through the adjusted first audio parameter.

In some embodiments, the audio to be played is played through smart glasses.

At this moment, when the user wears the smart glasses and plays the audio to be played, the positions of the ears and the speakers in the smart glasses are relatively fixed, so that the audio playing effect of the smart glasses can be pre-estimated according to the relative positions of the ears and the speakers in the smart glasses when the user wears the smart glasses, and the audio parameters enabling the playing effect to be better can be determined according to the pre-estimated result. Illustratively, through the estimation, a distortion estimation result of at least one preset single-frequency sound source can be obtained, and in a subsequent application process, the distortion estimation result can be referred to for playing.

In some embodiments, when the audio to be played is played, detecting whether there is a target frequency component whose first harmonic distortion condition meets a preset condition in real time according to a first audio parameter during playing includes:

and when the audio to be played is played, detecting whether a target frequency component with total harmonic distortion meeting a preset distortion condition exists in real time according to a first audio parameter during playing.

The target frequency component with the total harmonic distortion larger than the second preset value can be screened out, and the target frequency component tends to bring larger distortion during playing. By screening out the target frequency component with the total harmonic distortion larger than the second preset value, the target frequency component can be detected in a targeted manner subsequently, the data volume of subsequent detection is reduced, and the detection precision is ensured.

In some embodiments, when the audio to be played is played, detecting whether there is a target frequency component whose first harmonic distortion condition meets a preset condition in real time according to a first audio parameter during playing includes:

when the audio to be played is played, detecting the playing loudness of the audio to be played in real time according to a first audio parameter during playing;

and if the playing loudness is higher than a preset loudness threshold value, detecting whether a target frequency component with a first harmonic distortion condition meeting a preset condition exists.

In the embodiment of the application, when the playing loudness is higher than the preset loudness threshold, the playing distortion is often more obvious, and the influence on the hearing experience of a user is larger. Therefore, when the playing loudness is higher than the preset loudness threshold, whether the target frequency component with the first harmonic distortion condition meeting the preset condition exists is detected, and further processing may be performed on the playing condition to reduce the playing distortion when the loudness is higher.

A specific implementation of the embodiments of the present application is specifically described below with a specific example.

Illustratively, the audio to be played is music a. It is predetermined that the total harmonic distortion at the frequency of 200Hz is greater than 5% (i.e. the first harmonic distortion condition can be considered to meet the preset condition) when the playback volume is greater than the preset loudness threshold. When music A is played, a target frequency component of 200Hz in the music A is detected in real time, the loudness of a harmonic component of the target frequency component of 200Hz at 600Hz in the music A is detected to be X, the loudness of the audio to be played at 600Hz is detected to be Y, when X is larger than 50% of Y (namely the ratio of the first loudness corresponding to the target harmonic frequency of the target frequency component to the second loudness is larger than a first preset value), at least one of the EQ parameter, the AGC parameter and the DRC parameter at 200Hz (namely the first audio parameter) is adjusted, for example, the volume of the music A at 200Hz can be reduced by adjusting at least one of the EQ parameter, the AGC parameter and the DRC parameter, so that the harmonic distortion at 600Hz is reduced, X is not larger than 50% of Y, the distortion condition at 600Hz can be reduced, and the play timbre and the like are less influenced, the user experience is better.

In the embodiment of the application, when the audio to be played is played, whether the target frequency component with the first harmonic distortion condition meeting the preset condition exists or not is detected in real time according to the first audio parameter during playing, so that the target frequency component with the serious harmonic distortion condition in the audio to be played can be screened out, and then the target frequency component is subjected to subsequent detection and processing, so that the data volume of subsequent data processing is reduced, and the accuracy of distortion processing is improved; further, if there is a target frequency component whose first harmonic distortion condition meets a preset condition, detecting whether a ratio of a first loudness corresponding to a target harmonic frequency of the target frequency component to a second loudness is greater than a first preset value, and further detecting whether a harmonic of the target frequency component affects the playing of the audio to be played; if the ratio of the first loudness to the second loudness corresponding to the target harmonic frequency of the target frequency component is greater than a first preset value, the first audio parameter is adjusted so that the ratio of the adjusted first loudness to the adjusted second loudness is not greater than the first preset value, and therefore the influence of the harmonic of the target frequency component on the normally played audio can be reduced. By the embodiment of the application, the playing distortion of the audio can be reduced and the user experience can be improved under the condition that the hardware cost and the circuit complexity are not increased.

Fig. 2 shows a flowchart of another audio playing method provided in the embodiment of the present application.

The audio playing method comprises the following steps:

step S201, obtaining a distortion estimation result of at least one pre-detected pre-set single-frequency sound source, where the distortion estimation result includes distortion estimation sub-results corresponding to the pre-set single-frequency sound sources, and any distortion estimation sub-result includes a second harmonic distortion condition corresponding to the pre-set single-frequency sound source when the pre-set single-frequency sound source is played according to each pre-set audio parameter in the pre-set audio parameter set.

In the embodiment of the present application, the selection manner of the at least one preset single-frequency sound source may be determined according to a requirement. For example, the frequency difference between the at least one preset single-frequency source may be a preset frequency difference. For example, the at least one preset single-frequency sound source may include 200Hz, 300Hz, 400Hz, 500Hz, 600Hz, 700Hz, 800Hz, 900Hz, and the like. In addition, the preset single-frequency sound source can also comprise sound sources of other frequencies. For example, for a specific scene, for example, a playing scene with a high frequency, the proportion of the single-frequency sound source with a frequency in the high frequency range in the at least one preset single-frequency sound source may be increased.

In the embodiment of the present application, the preset audio parameter may include at least one of an equalization effecter parameter, an automatic gain control parameter, and a dynamic range control parameter.

In some embodiments, the second harmonic distortion case may include a component distortion case and/or a total harmonic distortion case of all or part of harmonics of the corresponding preset single-frequency source. For example, in some embodiments, the second harmonic distortion condition may include a distortion condition of all or a portion of harmonics of the corresponding preset single-frequency source at different loudness and/or a total harmonic distortion condition.

In some embodiments, the audio to be played is played through smart glasses. At this time, the distortion estimation result of the at least one preset single-frequency sound source can be detected according to the relative position of the ear and the loudspeaker in the smart glasses when the user wears the smart glasses. At this time, the audio playing effect of the smart glasses can be estimated in advance when the user wears the smart glasses according to the distortion estimation result.

In the embodiment of the application, after the distortion estimation result of at least one pre-detected pre-set single-frequency sound source is obtained, the audio parameter recommendation value corresponding to each pre-set single-frequency sound source can be respectively determined according to the distortion estimation result. When the corresponding single-frequency sound source is played according to the audio parameter recommendation value, the corresponding audio playing performance meets the preset performance condition. The preset performance condition may be, for example, that the corresponding frequency response curve meets a preset curve requirement, that the distortion condition meets a preset distortion requirement, and the like.

Step S202, obtaining the audio to be played.

Step S203, when the audio to be played is played, detecting the third harmonic distortion condition of the corresponding playing frequency band in real time when the audio to be played is played according to the first audio parameter according to the distortion estimation result.

In the embodiment of the application, the preset single-frequency sound source corresponding to the playing frequency band can be determined, the third harmonic distortion condition of the playing frequency band is determined according to the distortion pre-estimated sub-result of the preset single-frequency sound source corresponding to the playing frequency band, and the harmonic distortion of the audio to be played is detected without adding extra circuits or hardware, so that the complexity and the cost of the terminal equipment can be reduced.

Step S204, according to the third harmonic distortion condition of the playing frequency band, judging whether a target frequency component with the first harmonic distortion condition meeting a preset condition exists.

The third harmonic distortion condition may indicate a distortion condition of all or part of harmonics of part or all of the frequencies and/or a total harmonic distortion condition in the playing frequency band, so as to determine whether a target frequency component whose first harmonic distortion condition meets a preset condition exists according to the third harmonic distortion condition of the playing frequency band.

Step S205, if there is a target frequency component whose first harmonic distortion condition meets a preset condition, detecting whether a ratio of a first loudness corresponding to a target harmonic frequency of the target frequency component to a second loudness is greater than a first preset value, where the second loudness is a loudness of an audio portion of the audio to be played whose frequency is the target harmonic frequency.

Step S206, if the ratio of the first loudness to the second loudness corresponding to the target harmonic frequency of the target frequency component is greater than a first preset value, adjusting the first audio parameter so that the ratio of the adjusted first loudness to the adjusted second loudness is not greater than the first preset value.

Step S202, step S205, and step S206 of this embodiment are the same as step S101, step S103, and step S104 described above, respectively, and are not described again here.

In the embodiment of the application, through the distortion estimation result of at least one preset single-frequency sound source detected in advance, the audio playing effect when terminal equipment such as intelligent glasses plays audio can be estimated in a software mode, and then according to the distortion estimation result, real-time detection is carried out according to the first audio parameter is right when the audio to be played is played, the third harmonic distortion condition of the corresponding playing frequency band is judged, whether the first harmonic distortion condition accords with the target frequency component of the preset condition is judged according to the third harmonic distortion condition of the playing frequency band, and extra circuits or hardware is not required to be added to detect the harmonic distortion of the audio to be played and corresponding adjustment is carried out, so that the playing distortion of the playing audio can be reduced under the condition that the hardware cost and the circuit complexity are not increased.

It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.

Fig. 3 shows a block diagram of an audio playing apparatus provided in the embodiment of the present application, which corresponds to the audio playing method described in the foregoing embodiment, and only shows portions related to the embodiment of the present application for convenience of description.

Referring to fig. 3, the audio playback apparatus 3 includes:

an obtaining module 301, configured to obtain an audio to be played;

a first detection module 302, configured to detect, in real time, whether a target frequency component exists, where a first harmonic distortion condition meets a preset condition, according to a first audio parameter during playing when the audio to be played is played;

a second detecting module 303, configured to detect, if there is a target frequency component whose first harmonic distortion condition meets a preset condition, whether a ratio of a first loudness to a second loudness corresponding to a target harmonic frequency of the target frequency component is greater than a first preset value, where the second loudness is a loudness of an audio portion of the audio to be played, where a frequency of the audio portion is the target harmonic frequency;

an adjusting module 304, configured to adjust the first audio parameter if a ratio of a first loudness to a second loudness corresponding to the target harmonic frequency of the target frequency component is greater than a first preset value, so that the ratio of the adjusted first loudness to the adjusted second loudness is not greater than the first preset value.

Optionally, the audio to be played is played through smart glasses.

Optionally, the audio playing apparatus 3 further includes:

the second acquisition module is used for acquiring a distortion pre-estimation result of at least one pre-detected pre-set single-frequency sound source, wherein the distortion pre-estimation result comprises distortion pre-estimation sub-results respectively corresponding to the pre-set single-frequency sound sources, and any distortion pre-estimation sub-result comprises a second harmonic distortion condition corresponding to the pre-set single-frequency sound source when the corresponding pre-set single-frequency sound source is played according to each pre-set audio parameter in a pre-set audio parameter set;

the first detection module 302 specifically includes:

the detection unit is used for detecting the third harmonic distortion condition of the corresponding playing frequency band when the audio to be played is played according to the first audio parameter in real time according to the distortion estimation result when the audio to be played is played;

and the judging unit is used for judging whether a target frequency component with the first harmonic distortion condition meeting the preset condition exists according to the third harmonic distortion condition of the playing frequency band.

Optionally, the second harmonic distortion condition includes a component distortion condition and/or a total harmonic distortion condition of all or part of harmonics of the corresponding preset single-frequency sound source.

Optionally, the first audio parameter includes at least one of an equalization effector parameter, an automatic gain control parameter, and a dynamic range control parameter.

Optionally, the first detecting module 302 is specifically configured to:

and when the audio to be played is played, detecting whether a target frequency component with total harmonic distortion meeting a preset distortion condition exists in real time according to a first audio parameter during playing.

Optionally, the first detecting module 302 is specifically configured to:

when the audio to be played is played, detecting the playing loudness of the audio to be played in real time according to a first audio parameter during playing;

and if the playing loudness is higher than a preset loudness threshold value, detecting whether a target frequency component with a first harmonic distortion condition meeting a preset condition exists.

In the embodiment of the application, when the audio to be played is played, whether the target frequency component with the first harmonic distortion condition meeting the preset condition exists or not is detected in real time according to the first audio parameter during playing, so that the target frequency component with the serious harmonic distortion condition in the audio to be played can be screened out, and then the target frequency component is subjected to subsequent detection and processing, so that the data volume of subsequent data processing is reduced, and the accuracy of distortion processing is improved; further, if there is a target frequency component whose first harmonic distortion condition meets a preset condition, detecting whether a ratio of a first loudness corresponding to a target harmonic frequency of the target frequency component to a second loudness is greater than a first preset value, and further detecting whether a harmonic of the target frequency component affects the playing of the audio to be played; if the ratio of the first loudness to the second loudness corresponding to the target harmonic frequency of the target frequency component is greater than a first preset value, the first audio parameter is adjusted so that the ratio of the adjusted first loudness to the adjusted second loudness is not greater than the first preset value, and therefore the influence of the harmonic of the target frequency component on the normally played audio can be reduced. By the embodiment of the application, the playing distortion of the audio can be reduced and the user experience can be improved under the condition that the hardware cost and the circuit complexity are not increased.

It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.

It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.

Fig. 4 is a schematic structural diagram of a terminal device according to an embodiment of the present application. As shown in fig. 4, the terminal device 4 of this embodiment includes: at least one processor 40 (only one is shown in fig. 4), a memory 41, and a computer program 42 stored in the memory 41 and executable on the at least one processor 40, wherein the steps of any of the various audio playback method embodiments described above are implemented when the computer program 42 is executed by the processor 40.

The terminal device 4 may be a computing device such as a smart glasses, a wearable device, an Augmented Reality (AR)/Virtual Reality (VR) device, a desktop computer, a notebook, a palm computer, and a cloud server. The terminal device may include, but is not limited to, a processor 40, a memory 41. Those skilled in the art will appreciate that fig. 4 is merely an example of the terminal device 4, and does not constitute a limitation of the terminal device 4, and may include more or less components than those shown, or combine some of the components, or different components, such as may also include input devices, output devices, network access devices, etc. The input device may include a keyboard, a touch pad, a fingerprint sensor (for collecting fingerprint information of a user and direction information of a fingerprint), a microphone, a camera, and the like, and the output device may include a display, a speaker, and the like.

The Processor 40 may be a Central Processing Unit (CPU), and the Processor 40 may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.

The storage 41 may be an internal storage unit of the terminal device 4, such as a hard disk or a memory of the terminal device 4. In other embodiments, the memory 41 may also be an external storage device of the terminal device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like provided on the terminal device 4. Further, the memory 41 may include both an internal storage unit and an external storage device of the terminal device 4. The memory 41 is used for storing an operating system, an application program, a BootLoader (BootLoader), data, other programs, and the like, such as program codes of the computer programs. The above-mentioned memory 41 may also be used to temporarily store data that has been output or is to be output.

In addition, although not shown, the terminal device 4 may further include a network connection module, such as a bluetooth module Wi-Fi module, a cellular network module, and the like, which is not described herein again.

In this embodiment, when the processor 40 executes the computer program 42 to implement the steps in any of the audio playing method embodiments, by detecting whether a target frequency component whose first harmonic distortion condition meets a preset condition exists in real time according to a first audio parameter during playing when the audio to be played is played, a target frequency component whose harmonic distortion condition is severe in the audio to be played can be screened out, so that subsequent detection and processing are performed on the target frequency component, so as to reduce the data amount of subsequent data processing and improve the accuracy of distortion processing; further, if there is a target frequency component whose first harmonic distortion condition meets a preset condition, detecting whether a ratio of a first loudness corresponding to a target harmonic frequency of the target frequency component to a second loudness is greater than a first preset value, and further detecting whether a harmonic of the target frequency component affects the playing of the audio to be played; if the ratio of the first loudness to the second loudness corresponding to the target harmonic frequency of the target frequency component is greater than a first preset value, the first audio parameter is adjusted so that the ratio of the adjusted first loudness to the adjusted second loudness is not greater than the first preset value, and therefore the influence of the harmonic of the target frequency component on the normally played audio can be reduced. By the embodiment of the application, the playing distortion of the audio can be reduced and the user experience can be improved under the condition that the hardware cost and the circuit complexity are not increased.

The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the above method embodiments.

The embodiments of the present application provide a computer program product, which when running on a mobile terminal, enables the mobile terminal to implement the steps in the above method embodiments when executed.

The integrated unit may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. The computer program includes computer program code, and the computer program code may be in a source code form, an object code form, an executable file or some intermediate form. The computer-readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/terminal apparatus, a recording medium, computer Memory, Read-Only Memory (ROM), random-access Memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.

In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.

Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.

In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other ways. For example, the above-described apparatus/network device embodiments are merely illustrative, and for example, the division of the above modules or units is only one logical function division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.

The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.

The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种用于会议系统的扬声器信号馈给方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类