Audio recognition method, device, electronic device and storage medium
By combining audio frames and obtaining feature values, we ensure that a complete wake-up word is recognized in the audio clip, which solves the problem of misidentifying wake-up words in the prior art and improves the accuracy of audio recognition.
Patent Information
- Application Number
- CN202111384781.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-19
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2041-11-19
AI Technical Summary
Existing audio recognition technology is prone to misrecognition when users do not fully speak the wake-up word, resulting in low recognition accuracy.
By combining a plurality of consecutive audio frames into an audio clip, and obtaining the first and second eigenvalues of each audio clip, the positive correlation between the second eigenvalue and the first eigenvalue and the third eigenvalue are utilized and the positive correlation between the second eigenvalue and the first eigenvalue and the third eigenvalue are used. The negative correlation of the second eigenvalue ensures that the change of the first eigenvalue is smaller than the threshold when the second eigenvalue appears, so as to determine that the complete wake-up word is recognized.
Improves the accuracy of audio recognition, ensures that complete wake-up words have been identified, and reduces misidentification.
Smart Images

Figure CN113889084B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an audio recognition method, device, electronic device and storage medium. Background Art
[0002] With the rapid development of audio recognition technology, in people's daily lives, users can control electronic devices to perform corresponding operations, such as waking up the screen, waking up to unlock, waking up voice conversation functions, etc., by inputting audio data including wake-up words.
[0003] In the related art, usually after the electronic device collects the audio data sent by the user, it identifies whether the audio data contains the wake-up word. However, it often happens that the electronic device recognizes a wake-up word based on the audio data before the user has finished saying the wake-up word, but the recognized wake-up word is not necessarily the wake-up word that the user actually wants to say, so the accuracy of audio recognition is low. Summary of the invention
[0004] The embodiments of the present application provide an audio recognition method, device, electronic device, and storage medium, which can improve the accuracy of audio recognition. The technical solution is as follows:
[0005] According to one aspect of an embodiment of the present application, there is provided an audio recognition method, the method comprising:
[0006] When an audio frame is collected, the currently collected audio frame and the previously collected audio frame are combined into an audio segment, and a first feature value and a second feature value of the audio segment are obtained;
[0007] When a maximum value appears in the second characteristic values of the plurality of audio segments and the variation amplitude of the first characteristic value is less than a first threshold, determining that the wake-up word is recognized;
[0008] In which, the audio clip includes N audio frames, two adjacent audio clips include at least one identical audio frame, N is a positive integer, and N is equal to the number of phonemes contained in the wake-up word; the first eigenvalue represents the probability that the audio clip belongs to the wake-up word, the second eigenvalue is positively correlated with the first eigenvalue, and negatively correlated with the third eigenvalue of the audio clip, and the third eigenvalue represents the maximum probability among the probabilities that the audio clip belongs to each word.
[0009] In a possible implementation, when a maximum value appears in the second feature values of the plurality of audio segments and a variation amplitude of the first feature value is less than a first threshold, determining that a wake-up word is recognized includes:
[0010] When the second eigenvalue of the first audio segment is greater than the second eigenvalue of the second audio segment, and the second eigenvalue of the first audio segment is greater than the second eigenvalue of the third audio segment, determining that the second eigenvalue of the first audio segment is a maximum value; wherein the first audio segment is an audio segment before the third audio segment, and the second audio segment is an audio segment before the first audio segment;
[0011] When a difference between the first feature value of the third audio segment and the first feature value of the first audio segment is less than the first threshold, determining that the wake-up word is recognized;
[0012] When the difference between the first feature value of the third audio segment and the first feature value of the second audio segment is not less than the first threshold, continue to collect audio frames until the difference between the first feature value of the audio segment constructed this time and the first feature value of the audio segment constructed last time is less than the first threshold, and determine that the wake-up word is recognized.
[0013] In a possible implementation manner, obtaining the first feature value and the second feature value of the audio segment includes:
[0014] Obtaining the first feature value and the third feature value of the audio clip;
[0015] Based on the first eigenvalue and the third eigenvalue, the second eigenvalue is determined.
[0016] In a possible implementation manner, the obtaining the first feature value and the third feature value of the audio segment includes:
[0017] Obtain a first feature component and a second feature component of each audio frame in the audio clip, wherein the first feature component of the Kth audio frame represents the probability that the Kth audio frame belongs to the Kth phoneme in the wake-up word, and the second feature component of the Kth audio frame represents the maximum probability among the probabilities that the Kth audio frame belongs to multiple phonemes, and K is a positive integer not greater than N;
[0018] Adding the first characteristic component of each of the audio frames to obtain the first characteristic value of the audio segment;
[0019] The second feature component of each of the audio frames is added to obtain the third feature value of the audio segment.
[0020] In a possible implementation, the method further includes:
[0021] Each time an audio frame is collected, audio recognition is performed on the audio frame to obtain feature components of the plurality of phonemes, wherein the feature components of the phonemes represent the probability that the audio frame is the phoneme;
[0022] The obtaining of the first characteristic component and the second characteristic component of each audio frame in the audio segment comprises:
[0023] For the Kth audio frame in the audio segment, among the multiple feature components of the Kth audio frame, the feature component of the Kth phoneme in the wake-up word is determined as the first feature component of the Kth audio frame, and the largest feature component is determined as the second feature component of the audio frame.
[0024] In a possible implementation, when a maximum value appears in the second feature values of the plurality of audio segments and a variation amplitude of the first feature value is less than a first threshold, determining that a wake-up word is recognized includes:
[0025] When a maximum value appears in the second characteristic values of the plurality of audio segments, the maximum value is greater than a second threshold, and the variation amplitude of the first characteristic value is less than the first threshold, it is determined that the wake-up word is recognized.
[0026] In a possible implementation, when a maximum value appears in the second feature values of the plurality of audio segments and the variation amplitude of the first feature value is less than a first threshold, after determining that the wake-up word is recognized, the method further includes:
[0027] A voice control instruction is recognized based on at least one audio frame collected after the wake-up word is recognized, and a control operation corresponding to the voice control instruction is executed.
[0028] According to another aspect of an embodiment of the present application, there is provided an audio recognition device, the device comprising:
[0029] A combination module, used for combining the currently collected audio frame and the previously collected audio frame into an audio segment when collecting audio frames;
[0030] An acquisition module, used to acquire a first feature value and a second feature value of the audio segment;
[0031] a determination module, configured to determine that a wake-up word is recognized when a maximum value appears in the second characteristic values of the plurality of audio segments and the variation amplitude of the first characteristic value is less than a first threshold;
[0032] In which, the audio clip includes N audio frames, two adjacent audio clips include at least one identical audio frame, N is a positive integer, and N is equal to the number of phonemes contained in the wake-up word; the first eigenvalue represents the probability that the audio clip belongs to the wake-up word, the second eigenvalue is positively correlated with the first eigenvalue, and negatively correlated with the third eigenvalue of the audio clip, and the third eigenvalue represents the maximum probability among the probabilities that the audio clip belongs to each word.
[0033] In a possible implementation, the determining module includes:
[0034] a first determining unit, configured to determine that the second eigenvalue of the first audio segment is a maximum value if the second eigenvalue of the first audio segment is greater than the second eigenvalue of the second audio segment and the second eigenvalue of the first audio segment is greater than the second eigenvalue of the third audio segment; wherein the first audio segment is an audio segment preceding the third audio segment and the second audio segment is an audio segment preceding the first audio segment;
[0035] a second determining unit, configured to determine that the wake-up word is recognized when a difference between the first feature value of the third audio segment and the first feature value of the first audio segment is less than the first threshold;
[0036] The second determination unit is also used to continue collecting audio frames when the difference between the first feature value of the third audio segment and the first feature value of the first audio segment is not less than the first threshold, until the difference between the first feature value of the audio segment constructed this time and the first feature value of the audio segment constructed last time is less than the first threshold, thereby determining that the wake-up word is recognized.
[0037] In a possible implementation, the acquisition module includes:
[0038] an acquiring unit, configured to acquire the first feature value and the third feature value of the audio segment;
[0039] The third determining unit is used to determine the second eigenvalue based on the first eigenvalue and the third eigenvalue.
[0040] In a possible implementation, the acquiring unit is used to:
[0041] Obtain a first feature component and a second feature component of each audio frame in the audio clip, wherein the first feature component of the Kth audio frame represents the probability that the Kth audio frame belongs to the Kth phoneme in the wake-up word, and the second feature component of the Kth audio frame represents the maximum probability among the probabilities that the Kth audio frame belongs to multiple phonemes, and K is a positive integer not greater than N;
[0042] Adding the first characteristic component of each of the audio frames to obtain the first characteristic value of the audio segment;
[0043] The second feature component of each of the audio frames is added to obtain the third feature value of the audio segment.
[0044] In a possible implementation manner, the device further includes:
[0045] A recognition module, configured to perform audio recognition on an audio frame each time an audio frame is collected, to obtain characteristic components of the plurality of phonemes, wherein the characteristic components of the phonemes represent the probability that the audio frame is the phoneme;
[0046] The acquisition unit is used to:
[0047] For the Kth audio frame in the audio segment, among the multiple feature components of the Kth audio frame, the feature component of the Kth phoneme in the wake-up word is determined as the first feature component of the Kth audio frame, and the largest feature component is determined as the second feature component of the audio frame.
[0048] In a possible implementation, the determining module includes:
[0049] The fourth determination unit is used to determine that the wake-up word is recognized when a local maximum value appears in the second characteristic values of the plurality of audio segments, the local maximum value is greater than a second threshold, and the amplitude of change of the first characteristic value is less than the first threshold.
[0050] In a possible implementation manner, the device further includes:
[0051] An execution module is used to recognize a voice control instruction based on at least one audio frame collected after the wake-up word is recognized, and execute a control operation corresponding to the voice control instruction.
[0052] According to another aspect of an embodiment of the present application, an electronic device is provided, comprising a processor and a memory, wherein the memory stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the audio recognition method described in any one of the possible implementation methods described above.
[0053] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which at least one program code is stored. The at least one program code is loaded and executed by a processor to implement the audio recognition method described in any possible implementation manner described above.
[0054] According to another aspect of an embodiment of the present application, a computer program product is provided, the computer program product comprising at least one program code, the at least one program code being executed by a processor to implement the audio recognition method described in any one of the possible implementations described above.
[0055] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0056] The technical solution provided in the embodiment of the present application combines multiple continuous audio frames to form an audio segment, and obtains the first eigenvalue and the second eigenvalue of each audio segment. Since the second eigenvalue is positively correlated with the first eigenvalue and negatively correlated with the third eigenvalue of the audio segment, when the second eigenvalue reaches a maximum value, it is also necessary to ensure that the change amplitude of the first eigenvalue is less than the first threshold value, so as to indicate that the probability that the audio segment belongs to the wake-up word is no longer increasing or the increase is small, and it is determined that the complete wake-up word is recognized in the audio segment. Using this audio recognition method, it can ensure that the complete wake-up word has been recognized, thereby improving the accuracy of audio recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0058] Figure 1 It is a schematic diagram of an implementation environment provided by an embodiment of the present application;
[0059] Figure 2 is a flow chart of an audio recognition method provided by an embodiment of the present application;
[0060] Figure 3 is a flow chart of another audio recognition method provided by an embodiment of the present application;
[0061] Figure 4 is a structural schematic diagram of an audio recognition device provided in an embodiment of the present application;
[0062] Figure 5 is a schematic diagram of the structure of another audio recognition device provided in an embodiment of the present application;
[0063] Figure 6 is a schematic diagram of the structure of a terminal provided in an embodiment of the present application;
[0064] Figure 7 It is a structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0065] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0066] It is understood that the terms "first", "second", etc. used in this application can be used in this article to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of this application, a first characteristic value can be referred to as a second characteristic value, and a second characteristic value can be referred to as a first characteristic value.
[0067] The terms "at least one", "multiple", "each", "any", etc. used in this application include one, two or more than two, multiple include two or more than two, each refers to each of the corresponding multiple, and any refers to any one of the multiple. For example, multiple audio frames include 3 audio frames, and each audio frame refers to each of the 3 audio frames, and any refers to any one of the 3 audio frames, which can be the first, the second, or the third.
[0068] Figure 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application, see Figure 1 , the implementation environment includes: a terminal 101 and a server 102. The terminal 101 and the server 102 are connected via a wireless or wired network.
[0069] Optionally, the terminal 101 is any type of terminal such as a smart phone, a tablet computer, a smart wearable device or a smart home device, and the smart home device is a smart speaker, a smart TV, a smart refrigerator, a smart air conditioner, a smart robot, a smart lamp, a smart lock, etc. The server 102 is a server, or a server cluster composed of several servers, or a cloud computing service center.
[0070] Optionally, the terminal 101 is installed with an application provided by the server 102, and the terminal 101 can implement functions such as data transmission and message interaction through the application. Optionally, the application is an application in the operating system of the terminal 101, or an application provided by a third party. For example, the application is a voice assistant, and the voice assistant application has an audio recognition function. Of course, the application can also have other functions, such as a function of executing voice commands, a caching function, etc.
[0071] In the scenario where the user wakes up the terminal 101 through voice, the terminal 101 recognizes the collected audio clips. When the terminal 101 determines that the complete wake-up word is recognized, it continues to collect audio frames, thereby sending at least one collected audio frame to the server 102. The server 102 receives the at least one audio frame and determines the voice control instruction corresponding to the at least one audio frame. Thereafter, the recognized voice control instruction is sent to the terminal 101, so that the terminal 101 executes the control operation corresponding to the voice control instruction.
[0072] It should be noted that the above Figure 1 The embodiment of the present invention only takes the example of the terminal 101 sending the collected audio clip to the server 102. In another embodiment, the terminal 101 does not need to send the collected audio clip to the server 102, but the terminal 101 recognizes the wake-up word in the audio clip, and directly executes the control operation corresponding to the wake-up word when the terminal 101 determines that the complete wake-up word is recognized.
[0073] The method provided in the embodiments of the present application can be applied in a variety of scenarios.
[0074] For example, the method provided in the embodiment of the present application is applied to the scenario of waking up the mobile phone by voice. It is inconvenient for the user to operate the mobile phone while driving, but the user wants to use the mobile phone for navigation, so the user can say the wake-up word corresponding to the mobile phone. When the mobile phone recognizes the wake-up word, it is awakened from the standby state, thereby starting the recognition service, wherein the recognition service is used to recognize voice control instructions. After that, the user says to open the navigation application and how to navigate, etc., and the mobile phone can recognize the instruction to open the navigation application based on the collected audio frames, thereby opening the navigation application for navigation.
[0075] For another example, the method provided in the embodiment of the present application can also be applied to the scenario of controlling a smart TV by voice. The user can say the wake-up word corresponding to the smart TV, and when the smart TV recognizes the wake-up word, it starts the recognition service, and when it recognizes the voice control command to change the TV channel, it controls the smart TV to execute the operation of changing the TV channel.
[0076] It should be noted that the embodiments of the present application are only described by taking a mobile phone or a smart TV recognizing a wake-up word as an example, and do not limit the scenarios of the audio recognition method of the present application.
[0077] Figure 2 is a flow chart of an audio recognition method provided by an embodiment of the present application. The execution subject of the embodiment of the present application is an electronic device. Figure 2 , the method comprises the following steps:
[0078] 201. When an audio frame is collected, the currently collected audio frame and the previously collected audio frame are combined into an audio segment, and a first eigenvalue and a second eigenvalue of the audio segment are obtained.
[0079] Among them, the audio clip includes N audio frames, two adjacent audio clips include at least one identical audio frame, N is a positive integer, and N is equal to the number of phonemes contained in the wake-up word. The wake-up word is used to wake up the electronic device to perform corresponding control operations, such as controlling the mobile phone to answer the call, controlling the navigation system to navigate, or controlling the smart TV to adjust the volume. Optionally, the wake-up word is pre-set by the electronic device. Among them, the wake-up word is composed of multiple phonemes. Phonemes are the smallest audio units divided according to the natural properties of audio. They are analyzed based on the pronunciation actions in the syllables, and one pronunciation action constitutes a phoneme.
[0080] When the electronic device collects audio frames, it combines the currently collected audio frames with the previously collected audio frames to form an audio segment containing N audio frames, where N is a positive integer and the wake-up word contains N phonemes, that is, the number of audio frames contained in the audio segment is equal to the number of phonemes contained in the wake-up word. After that, it continues to collect audio frames and combines the currently collected audio frames with the previously collected audio frames to form another audio segment.
[0081] For example, the number of currently collected audio frames is M, and M is a positive integer less than N. The electronic device arranges the collected audio frames in the order of collection time. In order to form an audio segment containing N audio frames, it is necessary to obtain NM audio frames before the currently collected M audio frames, so as to combine the currently collected M audio frames with the NM audio frames to obtain an audio segment containing N audio frames, and the N audio frames in the audio segment are continuous. After that, the audio frames continue to be collected. When M audio frames are collected again, the NM audio frames before the newly collected M audio frames are re-acquired to form another audio segment containing N audio frames. The electronic device repeats the above steps to form multiple audio segments.
[0082] It should be noted that, since M is a positive integer less than N, the N audio frames contained in each audio clip are continuous. Therefore, for two adjacent audio clips, the latter NM audio frames in the previous audio clip are the same as the former NM audio frames in the latter audio clip, that is, there is an overlapping part between the two adjacent audio clips, and there is at least one identical audio frame between the two adjacent audio clips.
[0083] For each audio clip, the corresponding first eigenvalue and second eigenvalue are obtained respectively, wherein the first eigenvalue indicates the probability that the audio clip belongs to the wake-up word, that is, the probability that the content in the audio clip is the wake-up word, the second eigenvalue is positively correlated with the first eigenvalue, and negatively correlated with the third eigenvalue of the audio clip, and the third eigenvalue indicates the maximum probability of the audio clip belonging to each word. Each word is composed of at least two phonemes out of a plurality of phonemes. Based on the combination of the plurality of phonemes, a plurality of words can be obtained, and the plurality of words include wake-up words and non-wake-up words. Optionally, the plurality of phonemes are a plurality of pre-set phonemes. The probability of each word indicates the probability that the audio clip belongs to the word, and the third eigenvalue is the maximum probability among the probabilities of a plurality of words. Therefore, the word corresponding to the maximum probability is the word to which the audio clip belongs.
[0084] 202. When a maximum value appears in the second eigenvalues of the plurality of audio segments and the variation amplitude of the first eigenvalue is less than the first threshold, it is determined that the wake-up word is recognized.
[0085] The electronic device caches the first eigenvalue and the second eigenvalue of the acquired audio clip, and determines the change of the second eigenvalue according to the second eigenvalues corresponding to the multiple audio clips. Since the second eigenvalue is positively correlated with the first eigenvalue, it can be considered that when the second eigenvalue reaches a maximum value, the probability that the audio clip includes the wake-up word is relatively high. However, the second eigenvalue is also negatively correlated with the maximum probability of the audio clip belonging to each word. The second eigenvalue reaches a maximum value because the third eigenvalue of the audio clip increases significantly, while the first eigenvalue has not actually stopped rising. That is, when the audio clip only includes part of the wake-up word, the second eigenvalue may also reach a maximum value. Therefore, in order to ensure that the audio clip contains a complete wake-up word, it is also necessary to determine the amplitude of the change of the first eigenvalue.
[0086] To this end, the electronic device determines the change amplitude between the current first eigenvalue and the previous first eigenvalue. If the change amplitude of the first eigenvalue is less than the first threshold, it means that the first eigenvalue is no longer increasing or the increase is small. Then, it is considered that the probability that the current audio clip belongs to the wake-up word is no longer increasing or the increase is small, and it can be determined that the complete wake-up word has been recognized.
[0087] The method provided in the embodiment of the present application combines multiple continuous audio frames to form an audio segment, and obtains the first eigenvalue and the second eigenvalue of each audio segment. Since the second eigenvalue is positively correlated with the first eigenvalue and negatively correlated with the third eigenvalue of the audio segment, when the second eigenvalue reaches a maximum value, it is also necessary to ensure that the change amplitude of the first eigenvalue is less than the first threshold value, so as to indicate that the probability that the audio segment belongs to the wake-up word is no longer increasing or the increase is small, and it is determined that the complete wake-up word is recognized in the audio segment. By adopting this audio recognition method, it can be ensured that the complete wake-up word has been recognized, thereby improving the accuracy of audio recognition.
[0088] Figure 3 is a flow chart of another audio recognition method provided by an embodiment of the present application. The execution subject of the embodiment of the present application is an electronic device. Figure 3 , the method comprises the following steps:
[0089] 301. Each time an audio frame is collected, the currently collected audio frame and N-1 previously collected audio frames are combined into an audio segment.
[0090] In an embodiment of the present application, the electronic device collects audio frames in real time, and collects multiple audio frames in sequence, so as to identify the wake-up word from the collected multiple audio frames. Optionally, while the user is speaking, the electronic device collects multiple audio frames in sequence, and the electronic device identifies whether the user has said the wake-up word by identifying the collected audio frames.
[0091] Among them, the audio clip includes N audio frames, and two adjacent audio clips include N-1 identical audio frames, N is a positive integer, and N is equal to the number of phonemes contained in the wake-up word. Among them, one audio frame corresponds to one phoneme, or each audio frame represents a phoneme. Since the wake-up word contains N phonemes, in order to identify whether the continuously collected audio frames belong to the wake-up word, it is necessary to identify whether the N consecutive audio frames belong to the N phonemes in the wake-up word. Therefore, each audio clip constructed needs to contain N audio frames to identify whether the audio clip is a wake-up word.
[0092] Each time the electronic device captures an audio frame, it combines the currently captured audio frame with the N-1 audio frames captured previously to form an audio segment containing N audio frames, so that the number of audio frames contained in the audio segment is equal to the number of phonemes contained in the wake-up word. Afterwards, when an audio frame is captured again, the above steps are repeated, that is, the currently captured audio frame is combined with the N-1 audio frames before the audio frame to form the next audio segment. Among them, there is an overlapping part between two adjacent audio segments, containing N-1 identical audio frames, that is, the latter N-1 audio frames in the previous audio segment are the same as the former N-1 audio frames in the latter audio segment, that is, only one audio frame is different.
[0093] It should be noted that each time an audio frame is collected in the above step 301, an audio segment will be formed, so as to identify in real time whether the audio segment formed by the collected audio frames contains the wake-up word, so that the complete wake-up word can be recognized in the audio segment in time. In another embodiment, when an audio frame is collected, the currently collected audio frame and the previously collected audio frame constitute an audio segment. For example, every time M audio frames are collected, and M is a positive integer less than N, the electronic device obtains the NM audio frames collected previously, so as to combine the N audio frames obtained to form the audio segment containing N audio frames. Afterwards, every time M audio frames are collected, the operation of forming an audio segment is performed once, and each audio segment formed includes N audio frames, then there is an overlapping part between two adjacent audio segments, and the two adjacent audio segments include at least one identical audio frame.
[0094] 302. Obtain a first eigenvalue and a third eigenvalue of the audio segment.
[0095] The first eigenvalue represents the probability that the audio clip belongs to the wake-up word, and the third eigenvalue represents the maximum probability among the probabilities that the audio clip belongs to each word.
[0096] In one possible implementation, the electronic device obtains the first characteristic component and the second characteristic component of each audio frame in the audio segment, adds the first characteristic component of each audio frame to obtain the first characteristic value of the audio segment, and adds the second characteristic component of each audio frame to obtain the third characteristic value of the audio segment.
[0097] Among them, the first feature component of the Kth audio frame in the audio clip represents the probability that the Kth audio frame belongs to the Kth phoneme in the wake-up word, the second feature component of the Kth audio frame represents the maximum probability among the probabilities that the Kth audio frame belongs to multiple phonemes, and K is a positive integer not greater than N.
[0098] The audio clip contains N audio frames, each of which corresponds to a first feature component and a second feature component, so N first feature components and N second feature components are obtained. Since the audio frames in the audio clip correspond to the phonemes in the wake-up word one by one, if the audio frames at each position in the audio clip are the phonemes at the same position in the wake-up word, it means that the audio clip belongs to the wake-up word. Since the first feature component of the audio frame at each position represents the probability that the audio frame is the phoneme at the same position in the wake-up word, the sum of the first feature components of the audio frames at each position can represent the probability that the audio clip belongs to the wake-up word. Since the second feature component of the audio frame at each position represents the maximum probability of the audio frame being multiple phonemes, the sum of the second feature components of the audio frames at each position can represent the maximum probability of the audio clip belonging to each word. Therefore, the electronic device adds the obtained N first feature components to obtain the first feature value of the audio clip, and adds the obtained N second feature components to obtain the third feature value of the audio clip.
[0099] In one possible implementation, the electronic device determines, for the Kth audio frame in the audio segment, among multiple feature components of the audio frame, the feature component of the Kth phoneme in the wake-up word as the first feature component of the audio frame, and determines the largest feature component as the second feature component of the audio frame.
[0100] The characteristic component of each phoneme represents the probability that the audio frame is the phoneme, and optionally, the multiple phonemes are a plurality of pre-set phonemes. Since the first characteristic component of the Kth audio frame represents the probability that the audio frame belongs to the Kth phoneme in the wake-up word, the characteristic component of the Kth phoneme can be directly determined as the first characteristic component of the Kth audio frame among the multiple characteristic components. Since the second characteristic component of the Kth audio frame represents the maximum probability among the probabilities that the Kth audio frame belongs to multiple phonemes, and the number of other phonemes except the Kth phoneme is at least one, among all the characteristic components, the maximum characteristic component can better represent the probability of the phoneme to which the Kth audio frame belongs, and therefore the maximum characteristic component is determined as the second characteristic component of the Kth audio frame, so that the second characteristic component is more accurate.
[0101] Each time an audio frame is collected, audio recognition is performed on the audio frame to obtain feature components of multiple phonemes. The feature component of each phoneme represents the probability that the audio frame is the phoneme. After audio recognition is performed on the collected audio frame, the probability that the audio frame is each of the multiple phonemes can be obtained.
[0102] Optionally, each time the electronic device collects an audio frame, the audio recognition model is called to perform audio recognition on the audio frame to obtain feature components of multiple phonemes.
[0103] The audio recognition model is used to identify any audio frame and obtain the probabilities of multiple phonemes corresponding to the audio frame. Optionally, the audio recognition model is stored in the electronic device, and the audio recognition model is a trained model. When the electronic device collects a new audio frame, the audio frame is input into the audio recognition model, and the audio recognition model performs audio recognition on the audio frame, and outputs multiple feature components of the audio frame, which are the probabilities that the audio frame is each of the multiple phonemes.
[0104] 303. Determine a second eigenvalue of the audio segment based on the first eigenvalue and the third eigenvalue of the audio segment.
[0105] The second eigenvalue is positively correlated with the first eigenvalue and negatively correlated with the third eigenvalue.
[0106] In a possible implementation, the electronic device uses the following formula to determine the second eigenvalue based on the first eigenvalue and the third eigenvalue.
[0107]
[0108] Among them, G is the second eigenvalue, x is the first eigenvalue, y is the third eigenvalue, and A, a, b and c are coefficients.
[0109] 304. When a maximum value appears in the second eigenvalues of the plurality of audio segments and the variation amplitude of the first eigenvalue is less than the first threshold, it is determined that the wake-up word is recognized.
[0110] Before or after the user says the wake-up word, and during the process of the user saying the wake-up word, the electronic device will obtain one or more audio clips, and when the number of phonemes in the wake-up word contained in the audio clip increases, the first eigenvalue of the audio clip will increase, and the probability that the audio clip belongs to a non-wake-up word is relatively large. At this time, the second eigenvalue of the audio clip is greatly affected by the first eigenvalue and will also increase. Therefore, when the second eigenvalue has a maximum value, it means that the second eigenvalue has begun to decrease. Since the second eigenvalue is positively correlated with the first eigenvalue and negatively correlated with the third eigenvalue, the decrease in the second eigenvalue may be caused by the small increase in the first eigenvalue. At this time, the number of phonemes containing the wake-up word in the audio clip corresponding to the maximum value is large, and the probability that the audio clip belongs to the wake-up word is large. However, the decrease in the second eigenvalue may also be caused by the increase in the third eigenvalue. At this time, the first eigenvalue is still rising, that is, the audio clip corresponding to the maximum value only contains a part of the wake-up word, and the number of phonemes containing the wake-up word in the audio clip will continue to grow. Therefore, if the wake-up word is determined to be recognized only when the second eigenvalue has a maximum value, there will be a misjudgment.
[0111] In order to avoid the situation where the second eigenvalue reaches a maximum value due to the increase of the third eigenvalue, and is mistakenly judged as the wake-up word, it is necessary to determine the change amplitude of the first eigenvalue. If a maximum value appears in the second eigenvalue and the change amplitude of the first eigenvalue is less than the first threshold, it can be considered that the decrease in the second eigenvalue is caused by the first eigenvalue no longer rising or the increase is small, that is, the number of phonemes containing the wake-up word in the audio clip no longer continues to increase, and the audio clip already contains every phoneme in the wake-up word. It can be determined that the wake-up word has been recognized, thereby improving the accuracy of audio recognition.
[0112] In a possible implementation, the electronic device determines that the second eigenvalue of the first audio segment is a maximum value when the second eigenvalue of the first audio segment is greater than the second eigenvalue of the second audio segment, and the second eigenvalue of the first audio segment is greater than the second eigenvalue of the third audio segment. When the difference between the first eigenvalue of the third audio segment and the first eigenvalue of the first audio segment is less than a first threshold, it is determined that the wake-up word is recognized.
[0113] That is, the second eigenvalues of two adjacent audio segments are compared until the second eigenvalue of any audio segment is greater than both the second eigenvalue of the previous audio segment and the second eigenvalue of the next audio segment. At this time, the second eigenvalue of the audio segment is determined to be a maximum value. After that, the first eigenvalue of the next audio segment of the audio segment needs to be compared with the first eigenvalue of the audio segment, and the difference between the two is determined. If the difference is less than the first threshold, it can be determined that the probability that the collected audio segment belongs to the wake-up word is no longer increasing or the increase is small, and it is considered that the complete wake-up word is contained in the collected audio segment.
[0114] When the difference between the first eigenvalue of the third audio segment and the first eigenvalue of the first audio segment is not less than the first threshold, continue to collect audio frames until the difference between the first eigenvalue of the audio segment constructed this time and the first eigenvalue of the audio segment constructed last time is less than the first threshold, and it is determined that the wake-up word is recognized.
[0115] In one possible implementation, the electronic device determines that the wake-up word is recognized when a maximum value appears in the second eigenvalues of the multiple audio clips, the maximum value is greater than the second threshold, and the variation amplitude of the first eigenvalue is less than the first threshold.
[0116] Since the second eigenvalue is not only positively correlated with the first eigenvalue, but also negatively correlated with the third eigenvalue, the maximum value of the second eigenvalue only means that the second eigenvalue has begun to decrease, that is, the first eigenvalue has decreased or the third eigenvalue has increased. In order to ensure that the wake-up word is indeed recognized, it is necessary to ensure that the probability that the audio clip belongs to the wake-up word is high, and the probability that the audio clip belongs to the non-wake-up word is low, that is, the second eigenvalue is large. Therefore, it is also necessary to determine the size of the maximum value. When the maximum value is greater than the second threshold, it is considered that the probability that the audio clip belongs to the wake-up word is high.
[0117] For example, the wake-up word is "hello", and the phoneme contained in the wake-up word is "nihao", that is, the five phonemes contained in the wake-up word are "n", "i", "h", "a" and "o", and the five phonemes are arranged in order. When the user says "nihao", the electronic device collects the voice in real time. Each time an audio frame is collected, it is combined with the four audio frames collected before to form an audio segment containing five audio frames. After that, continue to collect audio frames and repeat the above operation of forming audio segments to obtain multiple audio segments.
[0118] When the user says "nihao", the audio clip contains more and more phonemes of the wake-up word, then the first eigenvalue becomes larger and larger, and the second eigenvalue also becomes larger and larger, until the audio clip contains the complete wake-up word, that is, the 5 audio frames contained in the audio clip are the phonemes "nihao" in the wake-up word. After that, when the next audio frame is collected, the third eigenvalue of the next audio clip continues to rise, and the first eigenvalue no longer rises or the increase is small, then the second eigenvalue will have a maximum value, and the change amplitude of the first eigenvalue is less than the first threshold value, so it is determined that all the phonemes "nihao" in the wake-up word have been recognized, that is, the wake-up word "hello" is recognized, thereby waking up the electronic device to perform the corresponding control operation.
[0119] 305. Recognize the voice control instruction based on the audio frame collected after the wake-up word is recognized, and execute the control operation corresponding to the voice control instruction.
[0120] The wake-up word is used to wake up the electronic device, and the electronic device can be awakened after it determines that the wake-up word is recognized. After that, the electronic device continues to collect audio frames and starts the recognition service to recognize the audio frames collected after the wake-up word is recognized to determine the voice control instruction and the control operation corresponding to the voice control instruction, so as to execute the control operation corresponding to the voice control instruction.
[0121] The above process of controlling electronic devices by voice is divided into two stages: a wake-up stage and a control stage.
[0122] Among them, in the wake-up stage, every time the electronic device collects an audio frame, it constitutes an audio segment together with the previously collected audio frame, thereby identifying the audio segment and obtaining the first eigenvalue and second eigenvalue of multiple audio segments. When the second eigenvalue reaches a maximum value and the change amplitude of the first eigenvalue is less than the first threshold, it is determined that the complete wake-up word has been recognized. At this time, the electronic device is awakened from the standby state.
[0123] After the electronic device is awakened, it will continue to collect new audio frames, and recognize the voice control instructions issued by the user based on the collected audio frames, so as to execute the control operation corresponding to the voice control instruction. In the related art, there may be a situation where the user has not finished saying the wake-up word, but the electronic device determines that it has recognized the wake-up word and is awakened, causing the remaining audio frames corresponding to the wake-up word to be mistaken for the audio frames corresponding to the voice control instruction, resulting in low recognition accuracy of the voice control instruction. However, in an embodiment of the present application, the electronic device will not be awakened until the complete wake-up word is recognized, which can ensure that the audio frames collected after being awakened belong to the voice control instruction, and do not include the audio frames corresponding to the wake-up word, thereby improving the accuracy of audio recognition.
[0124] It should be noted that the embodiment of the present application is only described by waking up the electronic device according to the wake-up word and executing the control operation corresponding to the voice control instruction. In another embodiment, the wake-up word is also used to wake up the electronic device to perform the corresponding control operation. Therefore, after the electronic device determines that the wake-up word is recognized, the corresponding control operation can be directly executed. Optionally, the electronic device stores a correspondence between any wake-up word and the control operation. After the electronic device recognizes the wake-up word, it queries the control operation corresponding to the wake-up word and executes the control operation.
[0125] For example, when a user is using a mobile phone, if it is inconvenient to operate the phone with both hands, human-computer interaction can be achieved by saying the wake-up word. For example, the wake-up word is "answer the call", and when a call comes in, the user says "answer the call", and the mobile phone recognizes "answer the call" and executes the operation of connecting the call. Or, the wake-up word is "hang up the call", the user says "hang up the call", and the mobile phone recognizes "hang up the call" and executes the operation of hanging up the call.
[0126] The method provided in the embodiment of the present application combines multiple continuous audio frames to form an audio segment, and obtains the first eigenvalue and the second eigenvalue of each audio segment. Since the second eigenvalue is positively correlated with the first eigenvalue and negatively correlated with the third eigenvalue of the audio segment, when the second eigenvalue reaches a maximum value, it is also necessary to ensure that the change amplitude of the first eigenvalue is less than the first threshold value, so as to indicate that the probability that the audio segment belongs to the wake-up word is no longer increasing or the increase is small, and it is determined that the complete wake-up word is recognized in the audio segment. By adopting this audio recognition method, it can be ensured that the complete wake-up word has been recognized, thereby improving the accuracy of audio recognition.
[0127] Furthermore, each time an audio frame is collected, an operation of forming an audio segment is performed, thereby identifying in real time whether the audio segment formed by the collected audio frame contains a wake-up word, ensuring that the complete wake-up word can be recognized in the audio segment in a timely manner.
[0128] Moreover, when the second eigenvalue reaches a maximum value and the variation amplitude of the first eigenvalue is less than the first threshold, it is also necessary to ensure that the maximum value is greater than the second threshold to determine that the wake-up word is recognized. This can ensure that the probability that the audio clip belongs to the wake-up word is large enough, thereby improving the accuracy of audio recognition.
[0129] Figure 4 is a schematic diagram of the structure of an audio recognition device provided in an embodiment of the present application. Figure 4 , the device comprises:
[0130] A combining module 401 is used to combine the currently collected audio frame and the previously collected audio frame into an audio segment when collecting audio frames;
[0131] An acquisition module 402 is used to acquire a first feature value and a second feature value of the audio segment;
[0132] A determination module 403 is used to determine that a wake-up word is recognized when a maximum value appears in the second feature values of the plurality of audio clips and the variation amplitude of the first feature value is less than a first threshold;
[0133] Among them, the audio clip includes N audio frames, two adjacent audio clips include at least one identical audio frame, N is a positive integer, and N is equal to the number of phonemes contained in the wake-up word; the first eigenvalue represents the probability that the audio clip belongs to the wake-up word, the second eigenvalue is positively correlated with the first eigenvalue, and negatively correlated with the third eigenvalue of the audio clip, and the third eigenvalue represents the maximum probability among the probabilities that the audio clip belongs to each word.
[0134] The device provided in the embodiment of the present application combines multiple continuous audio frames to form an audio segment, and obtains the first eigenvalue and the second eigenvalue of each audio segment. Since the second eigenvalue is positively correlated with the first eigenvalue and negatively correlated with the third eigenvalue of the audio segment, when the second eigenvalue reaches a maximum value, it is also necessary to ensure that the change amplitude of the first eigenvalue is less than the first threshold value, so as to indicate that the probability that the audio segment belongs to the wake-up word is no longer increasing or the increase is small, and it is determined that the complete wake-up word is recognized in the audio segment. Using this audio recognition method, it can ensure that the complete wake-up word has been recognized, thereby improving the accuracy of audio recognition.
[0135] In one possible implementation, Figure 5 is a schematic diagram of the structure of another audio recognition device provided in an embodiment of the present application, see Figure 5 , determining module 403, including:
[0136] A first determining unit 4031 is configured to determine that the second eigenvalue of the first audio segment is a maximum value when the second eigenvalue of the first audio segment is greater than the second eigenvalue of the second audio segment and the second eigenvalue of the first audio segment is greater than the second eigenvalue of the third audio segment;
[0137] A second determining unit 4032 is configured to determine that a wake-up word is recognized when a difference between the first feature value of the third audio segment and the first feature value of the first audio segment is less than a first threshold;
[0138] The second determination unit 4032 is also used to continue collecting audio frames when the difference between the first eigenvalue of the third audio segment and the first eigenvalue of the first audio segment is not less than the first threshold, until the difference between the first eigenvalue of the audio segment constructed this time and the first eigenvalue of the audio segment constructed last time is less than the first threshold, thereby determining that the wake-up word is recognized.
[0139] In one possible implementation, see Figure 5 , the acquisition module 402 includes:
[0140] An acquiring unit 4021, configured to acquire a first feature value and a third feature value of the audio segment;
[0141] The third determining unit 4022 is configured to determine a second eigenvalue based on the first eigenvalue and the third eigenvalue.
[0142] In one possible implementation, see Figure 5 , obtaining unit 4021, for:
[0143] Obtain a first feature component and a second feature component of each audio frame in the audio clip, wherein the first feature component of the Kth audio frame represents the probability that the Kth audio frame belongs to the Kth phoneme in the wake-up word, and the second feature component of the Kth audio frame represents the maximum probability among the probabilities that the Kth audio frame belongs to multiple phonemes, and K is a positive integer not greater than N;
[0144] Adding the first characteristic component of each audio frame to obtain the first characteristic value of the audio segment;
[0145] The second feature components of each audio frame are added together to obtain a third feature value of the audio segment.
[0146] In one possible implementation, see Figure 5 , the device further comprises:
[0147] The recognition module 404 is used to perform audio recognition on the audio frame each time an audio frame is collected to obtain characteristic components of multiple phonemes, wherein the characteristic components of the phonemes represent the probability that the audio frame is the phoneme;
[0148] The acquisition unit 4021 is used for:
[0149] For the Kth audio frame in the audio clip, among multiple feature components of the Kth audio frame, the feature component of the Kth phoneme in the wake-up word is determined as the first feature component of the Kth audio frame, and the largest feature component is determined as the second feature component of the audio frame.
[0150] In one possible implementation, see Figure 5 , determining module 403, including:
[0151] The fourth determination unit 4033 is used to determine that the wake-up word is recognized when a maximum value appears in the second characteristic values of the multiple audio clips, the maximum value is greater than the second threshold, and the variation amplitude of the first characteristic value is less than the first threshold.
[0152] In one possible implementation, see Figure 5 , the device further comprises:
[0153] The execution module 405 is used to recognize the voice control instruction based on the audio frame collected after the wake-up word is recognized, and execute the control operation corresponding to the voice control instruction.
[0154] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.
[0155] It should be noted that: the audio recognition device provided in the above embodiment only uses the division of the above functional modules as an example when performing audio recognition. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the detection device is divided into different functional modules to complete all or part of the functions described above. In addition, the state detection device provided in the above embodiment belongs to the same concept as the state detection method embodiment. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0156] An embodiment of the present application also provides an electronic device, which includes a processor and a memory, wherein the memory stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the operations performed by the audio recognition method of the above embodiment.
[0157] Optionally, the electronic device is provided as a terminal. Figure 6 6 is a schematic diagram of the structure of a terminal 600 provided in an embodiment of the present application. The terminal 600 may be a portable mobile terminal, such as a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a laptop computer or a desktop computer. The terminal 600 may also be referred to as a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.
[0158] The terminal 600 includes a processor 601 and a memory 602 .
[0159] The processor 601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 601 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 601 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 601 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 601 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0160] The memory 602 may include one or more computer-readable storage media, which may be non-transitory. The memory 602 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 602 is used to store at least one program code, which is used to be executed by the processor 601 to implement the audio recognition method provided in the method embodiment of the present application.
[0161] In some embodiments, the terminal 600 may further optionally include: a peripheral device interface 603 and at least one peripheral device. The processor 601, the memory 602 and the peripheral device interface 603 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 603 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 604, an audio circuit 605 and a power supply 606.
[0162] The peripheral device interface 603 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 601 and the memory 602. In some embodiments, the processor 601, the memory 602, and the peripheral device interface 603 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 601, the memory 602, and the peripheral device interface 603 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0163] The radio frequency circuit 604 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 604 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 604 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 604 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The radio frequency circuit 604 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 604 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.
[0164] The audio circuit 605 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 601 for processing, or input them into the radio frequency circuit 604 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 600. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 601 or the radio frequency circuit 604 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 605 may also include a headphone jack.
[0165] The power supply 606 is used to power various components in the terminal 600. The power supply 606 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 606 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0166] Those skilled in the art will understand that Figure 6 The structure shown in the figure does not constitute a limitation on the terminal 600, and the terminal 600 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.
[0167] Optionally, the electronic device is provided as a server. Figure 7 This is a schematic diagram of the structure of a server provided in an embodiment of the present application. The server 700 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 701 and one or more memories 702, wherein the memory 702 stores at least one program code, which is loaded and executed by the processor 701 to implement the methods provided in the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output, and the server may also include other components for implementing device functions, which will not be described in detail here.
[0168] In an exemplary embodiment, a computer-readable storage medium is also provided, in which at least one program code is stored, and the at least one program code is loaded and executed by a processor in an electronic device to implement the audio recognition method in the above embodiment. The computer-readable storage medium can be a memory. For example, the computer-readable storage medium can be a ROM (Read-Only Memory), a RAM (Random Access Memory), a CD-ROM (Compact Disc Read-Only Memory), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0169] In an exemplary embodiment, a computer program product is further provided. The computer program product includes at least one program code. The at least one program code can be executed by a processor of an electronic device to implement the audio recognition method of the above embodiment.
[0170] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0171] The above are only optional embodiments of the embodiments of the present application and are not intended to limit the embodiments of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the protection scope of the present application.
Claims
1. An audio recognition method, characterized in that: The method comprises: When an audio frame is collected, the currently collected audio frame and the previously collected audio frame are combined into an audio segment, and the first eigenvalue and the second eigenvalue of the audio segment are obtained; wherein, obtaining the first eigenvalue and the second eigenvalue of the audio segment includes: obtaining the first characteristic component and the second characteristic component of each audio frame in the audio segment, wherein the first characteristic component of the Kth audio frame represents the probability that the Kth audio frame belongs to the Kth phoneme in the wake-up word, and the second characteristic component of the Kth audio frame represents the maximum probability among the probabilities that the Kth audio frame belongs to multiple phonemes, and K is a positive integer not greater than N; adding the first characteristic component of each of the audio frames to obtain the first eigenvalue of the audio segment; adding the second characteristic component of each of the audio frames to obtain the third eigenvalue of the audio segment; using the following formula to determine the second eigenvalue based on the first eigenvalue and the third eigenvalue; Where G is the second eigenvalue, x is the first eigenvalue, y is the third eigenvalue, and A, a, b, and c are coefficients; When a maximum value appears in the second characteristic values of the plurality of audio segments and the variation amplitude of the first characteristic value is less than a first threshold, determining that the wake-up word is recognized; In which, the audio clip includes N audio frames, two adjacent audio clips include at least one identical audio frame, N is a positive integer, and N is equal to the number of phonemes contained in the wake-up word; the first eigenvalue represents the probability that the audio clip belongs to the wake-up word, the second eigenvalue is positively correlated with the first eigenvalue, and negatively correlated with the third eigenvalue of the audio clip, and the third eigenvalue represents the maximum probability of the audio clip belonging to each word, wherein each word is composed of at least two phonemes out of a plurality of phonemes, and a plurality of words are obtained by combining the plurality of phonemes, the plurality of words include wake-up words and non-wake-up words, and the plurality of phonemes are pre-set plurality of phonemes.
2. The method according to claim 1, characterized in that The step of determining that the wake-up word is recognized when a maximum value appears in the second feature values of the plurality of audio segments and the variation amplitude of the first feature value is less than a first threshold value includes: When the second eigenvalue of the first audio segment is greater than the second eigenvalue of the second audio segment, and the second eigenvalue of the first audio segment is greater than the second eigenvalue of the third audio segment, determining that the second eigenvalue of the first audio segment is a maximum value; wherein the first audio segment is an audio segment before the third audio segment, and the second audio segment is an audio segment before the first audio segment; When a difference between the first feature value of the third audio segment and the first feature value of the first audio segment is less than the first threshold, determining that the wake-up word is recognized; When the difference between the first feature value of the third audio segment and the first feature value of the first audio segment is not less than the first threshold, continue to collect audio frames until the difference between the first feature value of the audio segment constructed this time and the first feature value of the audio segment constructed last time is less than the first threshold, and determine that the wake-up word is recognized.
3. The method according to claim 1, characterized in that: The method further comprises: Each time an audio frame is collected, audio recognition is performed on the audio frame to obtain feature components of the plurality of phonemes, wherein the feature components of the phonemes represent the probability that the audio frame is the phoneme; The obtaining of the first characteristic component and the second characteristic component of each audio frame in the audio segment comprises: For the Kth audio frame in the audio segment, among the multiple feature components of the Kth audio frame, the feature component of the Kth phoneme in the wake-up word is determined as the first feature component of the Kth audio frame, and the largest feature component is determined as the second feature component of the audio frame.
4. The method according to any one of claims 1 to 3, characterized in that: The step of determining that the wake-up word is recognized when a maximum value appears in the second feature values of the plurality of audio segments and the variation amplitude of the first feature value is less than a first threshold value includes: When a maximum value appears in the second feature values of the plurality of audio segments, the maximum value is greater than a second threshold, and the amplitude of change of the first feature value is less than the first threshold, it is determined that the wake-up word is recognized.
5. The method according to any one of claims 1 to 3, characterized in that: When a maximum value appears in the second characteristic values of the plurality of audio segments and the variation amplitude of the first characteristic value is less than the first threshold, after determining that the wake-up word is recognized, the method further includes: A voice control instruction is recognized based on at least one audio frame collected after the wake-up word is recognized, and a control operation corresponding to the voice control instruction is executed.
6. An audio recognition device, characterized in that: The device comprises: A combination module, used for combining the currently collected audio frame and the previously collected audio frame into an audio segment when collecting audio frames; An acquisition module is used to acquire the first characteristic value and the second characteristic value of the audio segment; the acquisition module includes: An acquisition unit, used to: acquire a first feature component and a second feature component of each audio frame in the audio segment, wherein the first feature component of the Kth audio frame represents the probability that the Kth audio frame belongs to the Kth phoneme in the wake-up word, and the second feature component of the Kth audio frame represents the maximum probability among the probabilities that the Kth audio frame belongs to multiple phonemes, and K is a positive integer not greater than N; add the first feature component of each of the audio frames to obtain the first feature value of the audio segment; add the second feature component of each of the audio frames to obtain the third feature value of the audio segment; A third determining unit, configured to determine the second eigenvalue based on the first eigenvalue and the third eigenvalue by using the following formula; Where G is the second eigenvalue, x is the first eigenvalue, y is the third eigenvalue, and A, a, b, and c are coefficients; a determination module, configured to determine that a wake-up word is recognized when a maximum value appears in the second characteristic values of the plurality of audio segments and the variation amplitude of the first characteristic value is less than a first threshold; In which, the audio clip includes N audio frames, two adjacent audio clips include at least one identical audio frame, N is a positive integer, and N is equal to the number of phonemes contained in the wake-up word; the first eigenvalue represents the probability that the audio clip belongs to the wake-up word, the second eigenvalue is positively correlated with the first eigenvalue, and negatively correlated with the third eigenvalue of the audio clip, and the third eigenvalue represents the maximum probability of the audio clip belonging to each word, wherein each word is composed of at least two phonemes out of a plurality of phonemes, and a plurality of words are obtained by combining the plurality of phonemes, the plurality of words include wake-up words and non-wake-up words, and the plurality of phonemes are pre-set plurality of phonemes.
7. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the audio recognition method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one program code, and the at least one program code is loaded and executed by a processor to implement the audio recognition method according to any one of claims 1 to 5.