Audio scene recognition, motor driving method and system, and electronic device
Through audio scene recognition methods and motor drive technology, the limitations of existing game products when providing users with perceived signals are solved, precise recognition of specific game scenes and matching vibration effects, and user experience is improved.
Patent Information
- Application Number
- CN202111173519.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-08
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2041-10-08
AI Technical Summary
Existing racing game products have limitations when providing user-perceived signals, making it difficult to provide comprehensive user perception for specific game scenarios such as acceleration, collision, acceleration band and drift.
Through an audio scene recognition method, the audio data to be processed is obtained, divided into continuous multi-frame audio units in timing, filtering is performed to obtain target audio, calculate the frame count and energy average, and compare it with the characteristic threshold to judge the audio scene. The corresponding vibration rules are obtained according to the identified audio scene, and the motor is driven to vibrate to achieve a vibration effect matching the audio scene.
It realizes accurate identification of specific game scenes, can provide more comprehensive user perception signals for different scenarios, and enhances users' sense of participation and experience in the game.
Smart Images

Figure CN113975809B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to an audio scene recognition, a motor driving method and system, and an electronic device. Background Art
[0002] Various types of racing games occupy an important position in game products with their simple operation, cheerfulness and excitement. Such game products are widely used in smart terminals that people use daily, such as mobile phones, and are also widely used in professional electronic equipment such as game consoles, and are deeply loved by game players.
[0003] In racing games, game users participate in the game by controlling the racing car through the game interface in various game scenes such as racing car acceleration, eating props, collision, etc. During the game process, the game product has corresponding competition pictures and scene sound effects for each game scene, which can provide game users with visual and auditory experience, but this game experience is often limited to the visual and auditory levels, and still does not identify specific game scenes such as acceleration, collision, acceleration belt and / or drift, so it is difficult to provide other user perception signals for these specific game scenes, so that the corresponding game products cannot fully reflect other perception characteristics such as the excitement of real racing, so the user perception signals provided by such game products are limited. Summary of the invention
[0004] In view of this, the present application provides an audio scene recognition, motor driving method and system, and electronic device to solve the problem that existing racing game products have limitations in providing user perception signals.
[0005] The first aspect of the present application provides a method for identifying an audio scene, comprising:
[0006] Get the audio data to be processed;
[0007] Dividing the audio data to be processed into multiple audio frames that are continuous in time sequence;
[0008] Filter each frame audio unit according to the band characteristics corresponding to the audio scene to obtain the target audio;
[0009] Obtaining a frame count and an energy mean of each frame audio unit in the target audio; the frame count is used to characterize the characteristics of a specific scene;
[0010] The frame count or energy mean is compared with feature thresholds corresponding to different audio scenes to determine the audio scene corresponding to each frame audio unit.
[0011] In one embodiment, the target audio includes a first target audio and a second target audio; the frame count of each frame audio unit in the first target audio is a first frame count, and the energy mean value is a first average value; the frame count of each frame audio unit in the second target audio is a second frame count; the feature threshold includes a first trigger threshold and a minimum frame count value;
[0012] The comparing the frame count or the energy mean value with the feature thresholds corresponding to different audio scenarios to determine the audio scenario corresponding to each frame audio unit includes:
[0013] Setting the first trigger threshold for each frame according to the value characteristics of the first frame count of each frame in the first target audio; determining that the audio unit with the first average value greater than the first trigger threshold is generated in a first audio scenario; the first audio scenario is the scenario where the speed of the control target changes in a first direction;
[0014] Determining that the audio unit with the second frame count greater than or equal to the minimum frame count value is generated in a second audio scenario; the second audio scenario is the scenario where the speed of the control target changes in a second direction.
[0015] In one embodiment, the first trigger threshold includes an increasing primary trigger threshold, an intermediate trigger threshold, and a high - level trigger threshold;
[0016] The setting the first trigger threshold for each frame according to the value characteristics of the first frame count of each frame in the first target audio includes:
[0017] If GAIN_CNT(n) < a * GAIN_CNT_STEP, then set the first trigger threshold as the primary trigger threshold; where GAIN_CNT(n) represents the first frame count of the current frame, GAIN_CNT_STEP represents the interval threshold, a is a positive number, and the symbol * represents multiplication; the interval threshold is used to describe the interval between the thresholds at all levels in the first trigger threshold;
[0018] If a * GAIN_CNT_STEP ≤ GAIN_CNT(n) < 2a * GAIN_CNT_STEP, then set the first trigger threshold as the intermediate trigger threshold;
[0019] If 2a * GAIN_CNT_STEP ≤ GAIN_CNT(n) < 3a * GAIN_CNT_STEP, then set the first trigger threshold as the high - level trigger threshold.
[0020] In one embodiment, before comparing the frame count or the energy mean value with the feature thresholds corresponding to different audio scenarios to determine the audio scenario corresponding to each frame audio unit, it further includes:
[0021] Determine the first frame number count of the current frame based on the first frame number count of the previous frame, the first average value of the current frame, and the interval threshold; wherein, the previous frame is the frame immediately preceding the current frame.
[0022] And / or,
[0023] Determine the second frame number count of the current frame based on the second frame number count of the previous frame, the second average value of the current frame, and the second trigger threshold; wherein, the second average value is the energy average value of the corresponding audio unit in the second target audio.
[0024] Specifically, the determining the first frame number count of the current frame based on the first frame number count of the previous frame, the first average value of the current frame, and the interval threshold includes:
[0025] If GAIN_CNT(n - 1) < a * GAIN_CNT_STEP, when AVE_L(n) > b2, update GAIN_CNT(n) using the first update formula; when AVE_L(n) < b1 and GAIN_CNT(n - 1) > 0, update GAIN_CNT(n) using the second update formula; wherein, GAIN_CNT(n - 1) represents the first frame number count of the previous frame, GAIN_CNT(n) represents the first frame number count of the current frame, GAIN_CNT_STEP represents the interval threshold, a is a positive number, the symbol * represents multiplication, AVE_L(n) represents the first average value of the current frame, b1 represents the first mean evaluation parameter, b2 represents the second mean evaluation parameter, b3 represents the third mean evaluation parameter, b4 represents the fourth mean evaluation parameter; the first update formula is used to increase the first frame number count; the second update formula is used to decrease the first frame number count;
[0026] If a * GAIN_CNT_STEP ≤ GAIN_CNT(n - 1) < 2a * GAIN_CNT_STEP, when AVE_L(n) > b3, update GAIN_CNT(n) using the first update formula; when AVE_L(n) < b2, update GAIN_CNT(n) using the second update formula;
[0027] If 2a * GAIN_CNT_STEP ≤ GAIN_CNT(n - 1) < 3a * GAIN_CNT_STEP, when AVE_L(n) > b4, update GAIN_CNT(n) using the first update formula; when AVE_L(n) < b3, update GAIN_CNT(n) using the second update formula; if GAIN_CNT(n) is equal to 3a * GAIN_CNT_STEP, then set GAIN_CNT(n) to GAIN_CNT(n) - c1; wherein, c1 represents the first step value.
[0028] Specifically, the first update formula is: GAIN_CNT(n)=GAIN_CNT(n-1)+c2; the second update formula is: GAIN_CNT(n)=GAIN_CNT(n-1)-c3; wherein c2 represents the second step value, and c3 represents the third step value.
[0029] Specifically, determining the second frame count of the current frame according to the second frame count of the previous frame, the second average value of the current frame and the second trigger threshold comprises:
[0030] If AVE_R(n)>BP_ATT, BP_CNT(n) is updated using a third updating formula, and when BP_CNT(n) is greater than the maximum frame count value, BP_CNT(n) is set to the maximum frame count value; wherein AVE_R(n) represents the second average value of the current frame, BP_ATT represents the second trigger threshold, and BP_CNT(n) represents the second frame count of the current frame; the third updating formula is used to increase the second frame count;
[0031] If AVE_R(n)≤BP_ATT, when BP_CNT(n-1) is a positive number, the fourth update formula is used to update BP_CNT(n); wherein BP_CNT(n-1) represents the second frame number count of the previous frame; and the fourth update formula is used to reduce the second frame number count.
[0032] Specifically, the third update formula is: BP_CNT(n)=BP_CNT(n-1)+c4; the fourth update formula is: BP_CNT(n)=BP_CNT(n-1)-c5, wherein c4 represents the fourth step value and c5 represents the fifth step value.
[0033] In one embodiment, filtering each frame audio unit according to the band characteristics corresponding to the audio scene to obtain the target audio includes:
[0034] Acquire the first channel data and the second channel data of each frame audio unit;
[0035] The first channel data is low-pass filtered to obtain a first target audio; and the second channel data is band-pass filtered to obtain a second target audio.
[0036] A second aspect of the present application provides a motor driving method, comprising:
[0037] According to any of the above audio scene recognition methods, identify the audio scene corresponding to the currently played audio unit;
[0038] According to the audio scene, obtaining a corresponding vibration rule;
[0039] Drive the motor to vibrate according to the vibration rule, so as to achieve the vibration effect corresponding to the currently played audio unit.
[0040] In one embodiment, the vibration rule includes a first vibration rule and a second vibration rule;
[0041] The obtaining of the corresponding vibration rule according to the audio scene includes: if the audio unit of the current frame is generated in the first audio scene, determining the first vibration rule according to the first average value and the first trigger threshold of the current frame; if the audio unit of the current frame is generated in the second audio scene, determining the second vibration rule according to the second frame number count of the current frame.
[0042] Specifically, the determining of the first vibration rule according to the first average value and the first trigger threshold of the current frame includes: if AVE_L(n)>MAX_THR, setting the amplitude of the current frame to the second amplitude value and setting the maximum vibration feeling flag bit to the first flag; if MOVING_THR<AVE_L(n)≤MAX_THR, when the maximum vibration feeling flag bit is the second flag and GAIN(n - 1)<GAIN_MAX, controlling the amplitude of the current frame according to the vibration feeling climbing rule, and when the maximum vibration feeling flag bit is the first flag and GAIN(n - 1)>GAIN_MAX, setting the amplitude of the current frame to the maximum amplitude of the motor; where AVE_L(n) represents the first average value of the current frame, MAX_THR represents the maximum trigger threshold; the maximum vibration feeling flag bit is used to mark the degree of vibration feeling, MOVING_THR represents the first trigger threshold, GAIN(n - 1) represents the amplitude of the previous frame, GAIN_MAX represents the maximum amplitude of the motor; the vibration feeling climbing rule is the rule of setting the vibration amplitudes of each time according to the amplitudes recorded in the climbing control matrix in sequence; the climbing control matrix records multiple amplitude values;
[0043] and / or,
[0044] The determining of the second vibration rule according to the second frame number count of the current frame includes: if BP_CNT(n)≥m, setting the amplitude of the current frame to the first amplitude value; where BP_CNT(n) represents the second frame number count of the current frame, and m represents the count threshold of the second audio scene.
[0045] Specifically, the first vibration rule further includes:
[0046] If AVE_L(n)>MOVING_THR, the maximum vibration feeling flag bit is the first flag, and GAIN(n - 1) is greater than the third amplitude value, then set the amplitude of the current frame to the first amplitude value.
[0047] Specifically, the controlling of the amplitude of the current frame according to the vibration feeling climbing rule includes:
[0048] Get the climbing frame count, search for the amplitude value sorted as the climbing frame count in the climbing control matrix, and determine the amplitude of the current frame based on the sum of the amplitude value found and GAIN(n-1).
[0049] Specifically, after the amplitude of the current frame is controlled to increase according to the vibration climbing rule, the method further includes:
[0050] When GAIN(n)>GAIN_MAX, the amplitude of the current frame is set to the maximum amplitude of the motor, and the maximum vibration flag is set to the first flag, and the climbing frame count is incremented by one; wherein GAIN(n) represents the amplitude of the current frame.
[0051] Specifically, the motor driving method further includes:
[0052] If the climbing frame count is greater than the climbing times threshold, the climbing frame count is set as the climbing times threshold.
[0053] A third aspect of the present application provides an audio scene recognition system, comprising:
[0054] A first acquisition module, used to acquire audio data to be processed;
[0055] A segmentation module, used for segmenting the audio data to be processed into multiple audio frames that are continuous in time sequence;
[0056] A filtering module is used to filter each frame audio unit according to the band characteristics corresponding to the audio scene to obtain the target audio;
[0057] A second acquisition module is used to obtain the frame count and energy mean of each frame audio unit in the target audio; the frame count is used to characterize the characteristics of a specific scene;
[0058] The judgment module is used to compare the frame count or energy mean with the characteristic thresholds corresponding to different audio scenes to judge the audio scene corresponding to each frame audio unit.
[0059] A fourth aspect of the present application provides a motor drive system, comprising:
[0060] An identification module, used to identify the audio scene corresponding to the currently played audio unit according to any of the above audio scene identification systems;
[0061] A third acquisition module is used to acquire a corresponding vibration rule according to the audio scene;
[0062] The driving module is used to drive the motor to vibrate according to the vibration rule to achieve a vibration effect corresponding to the currently played audio unit.
[0063] A fifth aspect of the present application provides an electronic device, including a processor and a storage medium; the storage medium stores program code; the processor is used to call the program code stored in the storage medium to execute any of the above-mentioned audio scene recognition methods.
[0064] In one of the embodiments, the electronic device further includes a motor; and the processor is further configured to execute any one of the motor driving methods described above.
[0065] In the audio scene recognition, motor driving method and system, and electronic device provided by the present application, by acquiring the audio data to be processed, the audio data to be processed is divided into multiple frames of audio units that are continuous in time sequence, so that the audio scene recognition process is performed in frames, and the scene corresponding to each frame of audio unit can be accurately identified; each frame of audio unit is filtered according to the band characteristics corresponding to the audio scene to obtain the target audio, so that the target audio includes data that effectively characterizes the characteristics of the control target state, which can improve the accuracy of audio scene recognition based on the target audio; the frame count and energy mean of each frame of audio unit in the target audio are obtained, and the frame count or energy mean is compared with the feature threshold corresponding to different audio scenes to determine the audio scene corresponding to each frame of audio unit, so as to set the corresponding vibration signal and other user perception signals for the specific audio scene, so that the corresponding game product can provide more comprehensive user perception signals, which can enhance the user's sense of participation in the game process, thereby achieving the purpose of improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] 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 those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0067] Figure 1 is a flowchart of a method for identifying an audio scene in an embodiment of the present application;
[0068] Figure 2 This is a flow chart of a motor driving method in one embodiment of the present application;
[0069] Figure 3 is a schematic diagram of the structure of an audio scene recognition system in an embodiment of the present application;
[0070] Figure 4 is a schematic diagram of the structure of a motor drive system in one embodiment of the present application;
[0071] Figure 5 is a schematic diagram of the structure of an electronic device according to an embodiment of the present application;
[0072] Figure 6 It is a schematic diagram of the working process of an electronic device in one embodiment of the present application. DETAILED DESCRIPTION
[0073] The technical solutions in the embodiments of the present application are clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application. In the absence of conflict, the following embodiments and their technical features can be combined with each other.
[0074] The first aspect of the present application provides a method for identifying an audio scene, referring to Figure 1 As shown, the above audio scene recognition method includes:
[0075] S100, obtaining audio data to be processed.
[0076] The above-mentioned audio data to be processed may come from the audio signal of the racing game client running on a smart terminal such as a mobile phone, or from the audio signal of the racing game provided by a game terminal such as a racing game console. The audio signal may be an audio data stream outputted after decoding an audio file of various formats.
[0077] S200, dividing the audio data to be processed into multiple audio frame units that are continuous in time sequence.
[0078] Specifically, the above steps can sample the audio signal of the racing game by setting the sampling frequency and setting the sampling bit number to obtain the required audio data to be processed, and then divide the audio data stream into frames with N audio sampling points as the step size, and fill the audio units with less than N audio sampling points with 0 to obtain multiple frames of audio units that are continuous in time sequence. In this way, the audio data to be processed includes multiple frames of audio units, and each frame of audio unit includes N audio sampling points.
[0079] Optionally, the above-mentioned set sampling frequency and set sampling bit number can be set according to the recognition accuracy of the subsequent game scene, for example, the set sampling frequency is set to 48kHz, and the set sampling bit number is set to 16bit. At this time, if the game client QQ Speed is running on the mobile phone, the audio signal of QQ Speed can be obtained from the corresponding mobile phone system, and the original audio signal is sampled at a sampling rate of 48kHz and a sampling depth of 16bit to obtain the audio data to be processed. The value of N can be an integer power of 2 such as 1024.
[0080] S300, filtering each frame audio unit according to the band characteristics corresponding to the audio scene to obtain the target audio.
[0081] The above steps can set the filtering mode and filtering parameters according to the band characteristics of the audio in the audio scene to be identified, so as to reduce the noise data in the target audio, so that the target audio obtained includes as much as possible the state change characteristics that effectively represent the control target in the corresponding scene, so as to improve the recognition accuracy of subsequent audio scenes. For example, if the audio frequency corresponding to a certain audio scene is usually below a certain frequency value, each frame of audio unit can be low-pass filtered so that the obtained target audio can completely include the audio characteristics corresponding to the audio scene; if a certain type of noise feature of an audio scene is mainly below a certain frequency value, and the frequency band hardly includes the effective audio features of the audio scene, each frame of audio unit can be high-pass filtered so that the obtained target audio includes as little of this type of noise data as possible.
[0082] S400, obtaining a frame count and an energy mean of each frame audio unit in the target audio; the frame count is used to characterize a feature of a specific scene.
[0083] The above-mentioned specific scene may be a scene that needs to provide other perceptual signals in addition to the existing perceptual signals such as hearing and / or vision, such as a collision scene that needs to provide a sense of collision, an acceleration scene that needs to provide a sense of acceleration, etc. The characteristics of the specific scene may include the background music characteristics of the specific scene and the state change characteristics of the operation target in the specific scene. The above-mentioned background music characteristics may include characteristics such as music type and / or music intensity; the above-mentioned state change characteristics may include the change characteristics of the state of the control target in the corresponding game scene, such as speed change characteristics and / or position change characteristics, etc. In racing games, the state change of the control target in most scenes is often manifested as speed change, so in these scenes, the state change characteristics may be speed change characteristics; the above-mentioned speed change characteristics may include characteristics such as speed change direction and speed change size that characterize the speed change of the control target in the specific scene. The above-mentioned target audio includes a continuous multi-frame audio unit, each frame audio unit includes N audio sampling points, each sampling point has a corresponding energy value, and the energy value can be determined according to the amplitude of the corresponding sampling point. Specifically, the absolute values of the energy values of the various sampling points may be summed, and the summed value may be divided by the number N of audio sampling points to obtain an average energy value, which is the energy mean of the audio unit of the frame.
[0084] The above-mentioned frame count is a parameter that characterizes the background music characteristics and the state change characteristics of the control target in the target audio. Different frame count determination rules can be set for different game scenes; in most game scenes, the frame count of a certain frame audio unit can be determined based on the various state parameters of the control target in the frame audio unit and / or in the previous several frames of audio units. Specifically, in some game scenes, the initial value of the frame count can be pre-set as the previous frame count of the first frame audio unit, and then the state parameters such as the energy mean of each frame audio unit are identified, and the frame count of each frame audio unit is determined in combination with the characteristics of the previous frame or the previous few frames of audio units. For example, in one example, for each frame audio unit generated in certain scenes, the frame count of the previous frame audio unit can be increased, decreased or maintained based on the energy mean of each frame audio unit to determine the frame count of the current frame. For example, when the energy mean of a certain frame is greater than the first energy threshold, the frame count of the frame is increased by one or more counting units based on the frame count of the previous frame; when the energy mean of the frame is less than the second energy threshold, the frame count of the frame is reduced by one or more counting units based on the frame count of the previous frame; when the energy mean of the frame is greater than or equal to the second energy threshold, and less than or equal to the first energy threshold, the frame count of the frame is set to the frame count of the previous frame; wherein the first energy threshold is greater than the second energy threshold. In another example, for each frame audio unit generated in other scenes, the frame count of the previous frame or previous frames of audio units can be first identified, and after the frame count of the previous frame or previous frames of audio units meets certain conditions, the frame count of the current frame is determined according to the energy mean by increasing, decreasing or maintaining the frame count of the previous frame. Optionally, if the frame count of the current frame is determined by reducing the counting unit based on the frame count of the previous frame, the minimum value of the frame count in the corresponding game scene (such as 0, etc.) can also be set. When the frame count of the previous frame reaches the minimum value, or is less than the minimum value after reducing the corresponding counting unit, the frame count of the current frame is determined by keeping the frame count of the previous frame.
[0085] S500, comparing the frame count or energy mean with characteristic thresholds corresponding to different audio scenes, and determining the audio scene corresponding to each frame audio unit.
[0086] The above-mentioned feature threshold can be set according to the audio change characteristics in the corresponding audio scene. In some scenarios, it can be expressed as one or more fixed values. In other scenarios, it can also be adjusted in real time based on state parameters such as the frame count and / or energy mean of the relevant audio unit to accurately judge the audio scene or game scene in which the corresponding audio unit is located.
[0087] The above-mentioned audio scene recognition method obtains the audio data to be processed, divides the audio data to be processed into multiple frames of audio units that are continuous in time sequence, and performs the recognition of the audio scene in frames, so as to accurately identify the scene corresponding to each frame of audio unit; filters each frame of audio unit according to the band characteristics corresponding to the audio scene, obtains the target audio, and makes the target audio include data that effectively characterizes the characteristics of the control target state, which can improve the accuracy of audio scene recognition based on the target audio; obtains the frame count and energy mean of each frame of audio unit in the target audio, compares the frame count or energy mean with the feature thresholds corresponding to different audio scenes, and determines the audio scene corresponding to each frame of audio unit, so as to set corresponding vibration signals and / or shaking signals and other user perception signals for specific audio scenes, so that the corresponding game products can provide more comprehensive user perception signals, which can enhance the user's sense of participation in the game process, thereby achieving the purpose of improving user experience.
[0088] In one embodiment, the target audio includes a first target audio and a second target audio; the frame count of each frame audio unit in the first target audio is a first frame count, and the energy mean is a first average value; the frame count of each frame audio unit in the second target audio is a second frame count; the feature threshold includes a first trigger threshold and a minimum frame count value;
[0089] The comparing the frame count or energy mean with the feature thresholds corresponding to different audio scenes to determine the audio scene corresponding to each frame audio unit includes:
[0090] A first trigger threshold for each frame is set according to a value characteristic of a first frame number count of each frame in the first target audio; an audio unit whose first average value is greater than the first trigger threshold is determined to be generated in a first audio scene; the first audio scene is a scene in which the speed of the manipulated target changes in a first direction;
[0091] It is determined that the audio unit in which the second frame count is greater than or equal to the minimum frame count value is generated in a second audio scene; the second audio scene is a scene in which the speed of the controlled target changes in the second direction.
[0092] In racing games, the specific scenes that need to provide other perceptual signals besides vision and hearing are often the scenes where the speed of the control target of the racing car changes, such as small nitrogen acceleration, large nitrogen acceleration, collision, passing through the acceleration belt and drifting. The speed changes in these specific scenes are mainly manifested in two directions, one is the direction parallel to the driving direction of the control target, such as the speed change direction in the scenes of small nitrogen acceleration, large nitrogen acceleration, collision or passing through the acceleration belt, and the application sets this direction as the first direction, and this type of scene is called the first audio scene, and the target audio corresponding to the first audio scene is called the first target audio; the other is the direction at a certain angle to the driving direction of the control target (such as the direction perpendicular to the driving direction of the control target), such as the speed change direction in the scenes of drifting or scratching, and the application sets this direction as the second direction, and this type of scene is called the second audio scene, and the target audio corresponding to the second audio scene is called the second target audio. The first target audio and the second target audio can be obtained by filtering the audio data to be processed according to the band characteristics of the corresponding audio scene; consistent with the audio data to be processed, the first target audio and the second target audio both include multiple frames of audio units that are continuous in time sequence, and each frame of audio unit includes N audio sampling points. In a certain frame of audio unit of the first target audio, the absolute values of the energy values of each sampling point are summed, and the sum is divided by the number of audio sampling points N to obtain an average energy value, which is the energy mean of the frame of audio unit, that is, the first average value; for the first average value of each frame of audio unit, the first frame count of the previous frame or the previous frames is identified, and according to the identification result, the first frame count of each frame of audio unit can be determined by increasing, decreasing or maintaining the frame count of the previous frame. In a certain frame audio unit of the second target audio, the absolute values of the energy values of the various sampling points are summed, and the summed value is divided by the number of audio sampling points N to obtain an average energy value, which is the energy mean of the frame audio unit, that is, the second average value; for the second average value of each frame audio unit, the second frame number count of the previous frame or the previous frames is identified, and based on the identification result, the second frame number count of each frame audio unit can be determined by increasing, decreasing or keeping the frame number count of the previous frame.
[0093] If a certain frame audio unit is generated in the first audio scene, it indicates that the corresponding game scene includes a first game scene in which the speed changes in the first direction, such as small nitrogen acceleration, large nitrogen acceleration, collision, and passing through an acceleration belt. At this time, a specific user perception signal can be set according to the first frame count, the first average value, the first frame count of adjacent frame audio units in the frame audio unit and other parameters and the characteristics of the corresponding terminal device; for example, for a smart mobile device, a corresponding vibration signal can be set according to the first frame count, the first average value, the first frame count of adjacent frame audio units in a certain frame audio unit, so that the smart mobile device vibrates accordingly when playing the frame audio unit. For another example, for a game console with a racing car model, a model shaking signal representing the acceleration and / or collision of the racing car model can be set according to the first frame count, the first average value, the first frame count of adjacent frame audio units in a certain frame audio unit, so that the racing car model shakes accordingly when the game console plays the frame audio unit; this can provide users with a more comprehensive game perception, so that users can feel the state changes of the control target in the first direction from multiple aspects during the game. If a frame audio unit is generated in the second audio scene, it indicates that the corresponding game scene includes a second game scene in which the speed in the second direction changes, such as drifting. At this time, other user perception signals can be set according to the second frame number count in the frame audio unit and the characteristics of the corresponding terminal device. For example, for a smart mobile device, a corresponding vibration signal can be set according to parameters such as the second frame number count in a frame audio unit, so that the smart mobile device vibrates accordingly when playing the frame audio unit data of the game. For another example, for a game console with a racing car model, a model shaking signal representing the drifting and other actions of the racing car model can be set according to the second frame number count in a frame audio unit, so that the racing car model shakes accordingly when the game console plays the frame audio unit. This can further provide users with a more comprehensive game perception, allowing users to feel the state changes of the controlled target in the second direction from more aspects during the game.
[0094] This embodiment sets the first trigger threshold of each frame based on the first frame count and its value characteristics, so that the value of the first trigger threshold can be determined according to the background music characteristics and the control target speed change characteristics represented by the corresponding audio unit, which can improve the accuracy of identifying the first audio scene. In the second audio scene, the minimum frame count value can be set according to the speed change characteristics of the specific action of the control target in the racing game in the second direction; for example, for the speed change characteristics of the drifting action in the second direction, the minimum frame count value can be set to 6. If the second frame count of a frame audio unit is greater than or equal to the minimum frame count value, it indicates that the frame audio unit is generated in the second audio scene.
[0095] Specifically, the first trigger threshold includes an increasing primary trigger threshold, an intermediate trigger threshold and an advanced trigger threshold;
[0096] Setting the first trigger threshold for each frame according to the value characteristics of the first frame count of each frame in the first target audio includes:
[0097] If GAIN_CNT(n) < a * GAIN_CNT_STEP, set the first trigger threshold to the primary trigger threshold; where GAIN_CNT(n) represents the first frame count of the current frame, GAIN_CNT_STEP represents the interval threshold, a is a positive number, and the symbol * represents multiplication; the interval threshold is used to describe the interval between each level of threshold in the first trigger threshold;
[0098] If a * GAIN_CNT_STEP ≤ GAIN_CNT(n) < 2a * GAIN_CNT_STEP, set the first trigger threshold to the intermediate trigger threshold;
[0099] If 2a * GAIN_CNT_STEP ≤ GAIN_CNT(n) < 3a * GAIN_CNT_STEP, set the first trigger threshold to the high - level trigger threshold.
[0100] The above - mentioned primary trigger threshold, intermediate trigger threshold, and high - level trigger threshold can be set according to the background music characteristics adopted in the specific game scenario and the action characteristics of the control target's speed change in the first direction respectively. Specifically, the primary trigger threshold, intermediate trigger threshold, and high - level trigger threshold show an increasing trend, and the high - level trigger threshold is less than the maximum trigger threshold. For example, the primary trigger threshold is 3500, the intermediate trigger threshold is 4000, the high - level trigger threshold is 4500, and the maximum trigger threshold is 7000. The above - mentioned interval threshold GAIN_CNT_STEP is the interval of frame count set for each level of threshold (such as the primary trigger threshold, intermediate trigger threshold, and high - level trigger threshold) in the first trigger threshold, and can be determined according to the update rule of the first frame count. For example, it can be set to a positive value such as 20. The value of a can be determined according to the value characteristics of the interval threshold GAIN_CNT_STEP. For example, in a certain example, when the interval threshold GAIN_CNT_STEP is 20, a can be 1; at this time, if the primary trigger threshold is 3500, the intermediate trigger threshold is 4000, the high - level trigger threshold is 4500, and the maximum trigger threshold is 7000, then:
[0101] If GAIN_CNT(n) < 20, then MOVING_THR = 3500; where MOVING_THR represents the first trigger threshold;
[0102] If 20 ≤ GAIN_CNT(n) < 40, then MOVING_THR = 4000;
[0103] If 40 ≤ GAIN_CNT(n) < 60, then MOVING_THR = 4500.
[0104] In one embodiment, before comparing the frame count or energy mean with the feature thresholds corresponding to different audio scenarios to determine the audio scenario corresponding to each frame of audio unit, it further includes:
[0105] Determine the first frame count of the current frame according to the first frame count of the previous frame, the first average value of the current frame, and the interval threshold; wherein, the previous frame is the frame immediately preceding the current frame;
[0106] And / or,
[0107] Determine the second frame count of the current frame according to the second frame count of the previous frame, the second average value of the current frame, and the second trigger threshold; wherein, the second average value is the energy mean of the corresponding audio unit in the second target audio.
[0108] In this embodiment, determining the first frame count of the current frame according to the first frame count of the previous frame, the first average value of the current frame, and the interval threshold can make the determined first frame count more accurately represent the background music feature in the corresponding audio unit and the speed change feature of the control target in the first direction; determining the second frame count of the current frame according to the second frame count of the previous frame, the second average value of the current frame, and the second trigger threshold makes the determined second frame count more accurately represent the speed change feature of the control target in the second direction in the corresponding audio unit.
[0109] In one example, the determining the first frame count of the current frame according to the first frame count of the previous frame, the first average value of the current frame, and the interval threshold includes:
[0110] If GAIN_CNT(n - 1) < a * GAIN_CNT_STEP, when AVE_L(n) > b2, update GAIN_CNT(n) using the first update formula; when AVE_L(n) < b1 and GAIN_CNT(n - 1) > 0, update GAIN_CNT(n) using the second update formula; wherein, GAIN_CNT(n - 1) represents the first frame count of the previous frame, GAIN_CNT(n) represents the first frame count of the current frame, GAIN_CNT_STEP represents the interval threshold, a is a positive number, the symbol * represents multiplication, AVE_L(n) represents the first average value of the current frame, b1 represents the first mean evaluation parameter, b2 represents the second mean evaluation parameter, b3 represents the third mean evaluation parameter, b4 represents the fourth mean evaluation parameter; the first update formula is used to increase the first frame count; the second update formula is used to decrease the first frame count;
[0111] If a * GAIN_CNT_STEP ≤ GAIN_CNT(n - 1) < 2a * GAIN_CNT_STEP, when AVE_L(n) > b3, update GAIN_CNT(n) using the first update formula, and when AVE_L(n) < b2, update GAIN_CNT(n) using the second update formula;
[0112] If 2a * GAIN_CNT_STEP ≤ GAIN_CNT(n - 1) < 3a * GAIN_CNT_STEP, when AVE_L(n) > b4, update GAIN_CNT(n) using the first update formula, and when AVE_L(n) < b3, update GAIN_CNT(n) using the second update formula. If GAIN_CNT(n) is equal to 3a * GAIN_CNT_STEP, then set GAIN_CNT(n) to GAIN_CNT(n) - c1; where c1 represents the first step value.
[0113] Specifically, the first update formula is: GAIN_CNT(n) = GAIN_CNT(n - 1) + c2; the second update formula is: GAIN_CNT(n) = GAIN_CNT(n - 1) - c3; where c2 represents the second step value and c3 represents the third step value.
[0114] The first step value c1, the second step value c2, and the third step value c3 can respectively take conventional counting unit values (such as 1), or integer multiples of the counting unit value (such as 2, etc.). The above first mean evaluation parameter b1, second mean evaluation parameter b2, third mean evaluation parameter b3, and fourth mean evaluation parameter b4 can be set respectively according to the background music type adopted by the corresponding game and the audio energy characteristics corresponding to various actions when the control target changes in the first direction speed. Specifically, the first mean evaluation parameter b1, second mean evaluation parameter b2, third mean evaluation parameter b3, and fourth mean evaluation parameter b4 increase. For example, the first mean evaluation parameter b1 takes 2800, the second mean evaluation parameter b2 takes 3200, the third mean evaluation parameter b3 takes 4000, and the fourth mean evaluation parameter b4 takes 5000. At this time, if c1 = c2 = c3 = 1 and a = 1, then there is:
[0115] If GAIN_CNT(n - 1) < GAIN_CNT_STEP, when AVE_L(n) > 3200, GAIN_CNT(n) = GAIN_CNT(n - 1) + 1, and when AVE_L(n) < 2800 and GAIN_CNT(n - 1) > 0, GAIN_CNT(n) = GAIN_CNT(n - 1) - 1;
[0116] If GAIN_CNT_STEP≤GAIN_CNT(n-1)<2*GAIN_CNT_STEP, when AVE_L(n)>4000, GAIN_CNT(n)=GAIN_CNT(n-1)+1, when AVE_L(n)<3200, GAIN_CNT(n)=GAIN_CNT(n-1)-1;
[0117] If 2*GAIN_CNT_STEP≤GAIN_CNT(n-1)<3*GAIN_CNT_STEP, when AVE_L(n)>5000, GAIN_CNT(n)=GAIN_CNT(n-1)+1, when AVE_L(n)<4000, GAIN_CNT(n)=GAIN_CNT(n-1)-1;
[0118] If GAIN_CNT(n)==3*GAIN_CNT_STEP, then GAIN_CNT(n) is set to GAIN_CNT(n)-1, that is, GAIN_CNT(n)-GAIN_CNT(n)-1.
[0119] In one example, determining the second frame count of the current frame according to the second frame count of the previous frame, the second average value of the current frame, and the second trigger threshold comprises:
[0120] If AVE_R(n)>BP_ATT, BP_CNT(n) is updated using a third updating formula, and when BP_CNT(n) is greater than the maximum frame count value, BP_CNT(n) is set to the maximum frame count value; wherein AVE_R(n) represents the second average value of the current frame, BP_ATT represents the second trigger threshold, and BP_CNT(n) represents the second frame count of the current frame; the third updating formula is used to increase the second frame count;
[0121] If AVE_R(n)≤BP_ATT, when BP_CNT(n-1) is a positive number, the fourth update formula is used to update BP_CNT(n); wherein BP_CNT(n-1) represents the second frame number count of the previous frame; and the fourth update formula is used to reduce the second frame number count.
[0122] Specifically, the third update formula is: BP_CNT(n)=BP_CNT(n-1)+c4; the fourth update formula is: BP_CNT(n)=BP_CNT(n-1)-c5, wherein c4 represents the fourth step value and c5 represents the fifth step value.
[0123] The fourth step value c4 and the fifth step value c5 can be respectively set to conventional counting unit values (such as 1), or to integer multiples of the counting unit values (such as 2, etc.). The second trigger threshold BP_ATT can be set according to the action characteristics of the control target in the second direction speed change in the racing game; for example, for the drift action, the second trigger threshold can be set to 1400. The maximum frame count value is the maximum value of the frame count in the second audio scene, which can be set according to the relevant characteristics of the specific action in the second game scene, for example, for the drift action, the maximum frame count value is set to 10.
[0124] In one embodiment, filtering each frame audio unit according to the band characteristics corresponding to the audio scene to obtain the target audio includes:
[0125] Acquire the first channel data and the second channel data of each frame audio unit;
[0126] The first channel data is low-pass filtered to obtain a first target audio; and the second channel data is band-pass filtered to obtain a second target audio.
[0127] The above-mentioned first channel data and second channel data can usually be the audio data corresponding to the two channels in the audio playback module of the corresponding terminal device (such as a smart terminal or a game console), for example, the first channel data is the left channel data, and the second channel data is the right channel data. In some examples, the first channel data can have the first part of the characteristics of the audio data to be processed, for example, the left channel can be the characteristics after compressing the low-frequency range signal; the second channel data can have the second part of the characteristics of the audio data to be processed, such as the right channel can be the characteristics after compressing the mid- and high-frequency range signals; the above-mentioned first part of the characteristics is not completely consistent with the second part of the characteristics. In another example, the first channel data and the second channel data can both be audio data to be processed. For example, when the audio data to be processed is monophonic data, the first channel data and the second channel data are both copied from the audio data to be processed.
[0128] Specifically, the audio frequency of the above-mentioned first audio scene is mainly in the frequency range of 100Hz-2000Hz, and low-pass filtering of the first channel data can filter out interfering audio such as human voices in the game, reduce the noise data in the first target audio, so that it can effectively represent the background music and / or control target speed and other characteristics of a specific scene. During the game, when the control target drifts in the second direction, the audio generated is mainly concentrated in the frequency range of 1100Hz-1300Hz, etc. Band-pass filtering of the second channel data can extract the audio in the second channel data that represents the action of the control target in the second direction, so that the second target audio can represent the state change characteristics such as the speed of the control target in the second direction.
[0129] Specifically, in this embodiment, the cutoff frequency of the low-pass filter can be set according to the frequency bands where the effective audio and the interference audio are respectively located in the first audio scene, and is usually set to a parameter that can pass the effective audio and filter out the interference audio as much as possible; for example, if the interference audio of the human voice in the first audio scene is mainly in the high-frequency part of the range of 100Hz-2000Hz, the cutoff frequency of the low-pass filter can be set to 225Hz at this time to filter out the human voice in the first audio scene as much as possible. The pass frequency band of the bandpass filter can be set according to the frequency band where the audio that characterizes the action characteristics of the second direction of the control target is located in the specific game product, and can often be set to the frequency band where the audio that characterizes the action characteristics of the second direction of the control target is located, such as the frequency band of 1100Hz-1300Hz.
[0130] The second aspect of the present application provides a motor driving method, referring to Figure 2 As shown, the motor driving method includes:
[0131] S700: Identify the audio scene corresponding to the currently played audio unit according to the audio scene recognition method provided by any of the above embodiments.
[0132] S800: Acquire a corresponding vibration rule according to the audio scene.
[0133] The above vibration rules record the vibration characteristics of the driving motor vibration. The above vibration characteristics may include characteristics such as vibration amplitude (amplitude) and / or vibration change trend. When setting the vibration rules corresponding to each frame audio unit in the above steps, the maximum vibration flag TRIG_FLAG may also be set to mark the vibration degree of the corresponding vibration signal. The maximum vibration flag TRIG_FLAG may have two flag symbols, a first flag and a second flag. The maximum vibration flag TRIG_FLAG is the first flag to indicate that the corresponding vibration degree is high, and the maximum vibration flag TRIG_FLAG is the second flag to indicate that the corresponding vibration degree is low. The initial value of the maximum vibration flag TRIG_FLAG may be set to the second flag to indicate the low vibration degree. In an example, the first flag may be recorded as 1, and the second flag may be recorded as 0.
[0134] S900: driving the motor to vibrate according to the vibration rule to achieve a vibration effect corresponding to the currently played audio unit.
[0135] The above-mentioned motor driving method, by identifying the audio scene corresponding to the currently played audio unit, obtains the corresponding vibration rule, drives the motor to vibrate with the vibration rule, and achieves the vibration effect corresponding to the currently played audio unit, thereby effectively enriching the perception signals of racing game products. In this way, users can more comprehensively perceive the various state changes of the control target in these scenes during the game, and have a higher sense of participation.
[0136] In one embodiment, the vibration rules include a first vibration rule and a second vibration rule; obtaining the corresponding vibration rule according to the audio scene includes: if the audio unit of the current frame is generated in the first audio scene, determining the first vibration rule according to the first average value and the first trigger threshold of the current frame; if the audio unit of the current frame is generated in the second audio scene, determining the second vibration rule according to the second frame count of the current frame.
[0137] In this embodiment, the first vibration rule for the first audio scene and the second vibration rule for the second audio scene can be determined respectively. When playing the audio unit of each frame, the motor is driven to vibrate according to the corresponding vibration rule, so that the corresponding racing game product can provide vibration signals for specific game scenes such as the first audio scene and / or the second audio scene, which is beneficial to further improving the vibration effect of the corresponding game product.
[0138] Specifically, determining the first vibration rule according to the first average value and the first trigger threshold of the current frame includes: if AVE_L(n)>MAX_THR, setting the amplitude of the current frame to the second amplitude value and setting the maximum vibration feeling flag bit to the first flag; if MOVING_THR<AVE_L(n)≤MAX_THR, when the maximum vibration feeling flag bit is the second flag and GAIN(n - 1)<GAIN_MAX, controlling the amplitude of the current frame according to the vibration feeling climbing rule, and when the maximum vibration feeling flag bit is the first flag and GAIN(n - 1)>GAIN_MAX, setting the amplitude of the current frame to the maximum amplitude of the motor; where AVE_L(n) represents the first average value of the current frame, MAX_THR represents the maximum trigger threshold; the maximum vibration feeling flag bit is used to mark the degree of vibration feeling, MOVING_THR represents the first trigger threshold, GAIN(n - 1) represents the amplitude of the previous frame, GAIN_MAX represents the maximum amplitude of the motor; the vibration feeling climbing rule is the rule of setting the vibration amplitudes each time according to the amplitudes recorded in the climbing control matrix; the climbing control matrix records multiple amplitude values, and specifically can record multiple non - decreasing amplitude values so that the vibration is maintained or increased.
[0139] and / or,
[0140] Determining the second vibration rule according to the second frame count of the current frame includes: if BP_CNT(n)≥m, setting the amplitude of the current frame to the first amplitude value; where BP_CNT(n) represents the second frame count of the current frame, m represents the count threshold of the second audio scene, which can be set according to the corresponding control target action characteristics in the second game scene. For example, for the action of drifting, it can be set to 6.
[0141] The number of amplitude values recorded by the ramp control matrix can be set according to the corresponding vibration effect. In an example, the ramp control matrix records 8 amplitude values, which can be recorded as GAIN_STEP[8], and its specific value characteristics can be as follows:
[0142] Specifically, the first vibration rule also includes:
[0143] If AVE_L(n)>MOVING_THR, the maximum vibration flag is the first flag, and GAIN(n-1) is greater than the third amplitude value, the amplitude of the current frame is set to the first amplitude value.
[0144] The first amplitude value, the second amplitude value and the third amplitude value can be set according to the vibration sense required to be configured according to the corresponding action characteristics. For example, the first amplitude value can be set to Set the second amplitude value to Set the third amplitude value to To enhance the vibration effect.
[0145] Further, controlling the amplitude of the current frame according to the vibration climbing rule includes:
[0146] Get the climbing frame count, search for the amplitude value sorted as the climbing frame count in the climbing control matrix, and determine the amplitude of the current frame based on the sum of the amplitude value found and GAIN(n-1).
[0147] In this embodiment, a climbing frame count is set, so that the amplitude value sorted as the climbing frame count can be searched in the climbing control matrix to determine the amplitude of the current frame according to the amplitude value found, thereby ensuring the orderliness of the vibration climbing rule.
[0148] Optionally, after controlling the amplitude of the current frame to increase according to the vibration climbing rule, the method further includes:
[0149] When GAIN(n)>GAIN_MAX, the amplitude of the current frame is set to the maximum amplitude of the motor, and the maximum vibration flag is set to the first flag, and the climbing frame count is incremented by one; wherein GAIN(n) represents the amplitude of the current frame.
[0150] Optionally, the motor driving method further includes:
[0151] If the climbing frame count is greater than the climbing times threshold, the climbing frame count is set as the climbing times threshold.
[0152] The above-mentioned climbing times threshold can be set according to the number of amplitude values of the climbing control matrix, and is usually set to a value slightly smaller than the number of amplitude values. For example, when the climbing control matrix includes 8 amplitude values, the climbing times threshold can be set to 5, so that each time the vibration climbing frame count is taken, the corresponding amplitude value can be found in the corresponding climbing control matrix for vibration control.
[0153] In a third aspect, the present application provides an audio scene recognition system, such as Figure 3 As shown, the audio scene recognition system includes:
[0154] A first acquisition module 100 is used to acquire audio data to be processed;
[0155] The segmentation module 200 is used to segment the audio data to be processed into multiple audio frames that are continuous in time sequence;
[0156] The filtering module 300 is used to filter each frame audio unit according to the band characteristics corresponding to the audio scene to obtain the target audio;
[0157] The second acquisition module 400 is used to obtain the frame count and energy mean of each frame audio unit in the target audio; the frame count is used to characterize the characteristics of a specific scene;
[0158] The determination module 500 is configured to compare the frame count or energy mean with characteristic thresholds corresponding to different audio scenes to determine the audio scene corresponding to each frame audio unit.
[0159] For the specific definition of the audio scene recognition system, please refer to the definition of the audio scene recognition method above, which will not be repeated here. Each module in the above audio scene recognition system can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0160] In a fourth aspect, the present application provides a motor drive system, such as Figure 4 As shown, the motor drive system includes:
[0161] An identification module 700, configured to identify an audio scene corresponding to a currently played audio unit according to the audio scene identification system provided by any of the above embodiments;
[0162] A third acquisition module 800 is used to acquire a corresponding vibration rule according to the audio scene;
[0163] The driving module 900 is used to drive the motor to vibrate according to the vibration rule to achieve a vibration effect corresponding to the currently played audio unit.
[0164] For the specific definition of the motor drive system, please refer to the definition of the motor drive method above, which will not be repeated here. Each module in the above motor drive system can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0165] In a fifth aspect, the present application provides an electronic device, including a processor and a storage medium; the storage medium stores program code; the processor is used to call the program code stored in the storage medium to execute the audio scene recognition method described in any of the above embodiments.
[0166] In one embodiment, the electronic device further includes a motor; and the processor is further configured to execute the motor driving method provided in any one of the above embodiments.
[0167] Specifically, refer to Figure 5 As shown, the electronic device further includes a motor driving chip. When the electronic device plays each frame of audio units, the processor can control the motor driving chip to drive the motor to vibrate according to the vibration rules corresponding to each frame of audio units.
[0168] Furthermore, the electronic device may further include components such as an audio amplifier and a speaker to play each frame of the audio unit. Figure 6 As shown, firstly, the audio data of the racing game is obtained, and after determining that the audio data to be processed is generated in the first audio scene and / or the second audio scene, the vibration rules corresponding to each frame audio unit are obtained, and each frame audio unit is played through the audio power amplifier and the speaker, and at the same time, the motor driving chip is controlled to drive the motor to vibrate according to the vibration rules corresponding to each frame audio unit.
[0169] The above-mentioned electronic device can also be called a terminal device, which can provide vibration signals for specific scenes such as the first audio scene and / or the second audio scene of racing games, effectively enriching the user perception signals of such game products, so that users can more comprehensively perceive the various state changes of the control target in these scenes during the game, and the user experience is effectively improved.
[0170] Although the present application has been shown and described with respect to one or more implementations, equivalent variations and modifications will occur to those skilled in the art based on reading and understanding of this specification and the accompanying drawings. The present application includes all such modifications and variations and is limited only by the scope of the appended claims. In particular, with respect to the various functions performed by the above-mentioned components, the terms used to describe such components are intended to correspond to any component (unless otherwise indicated) that performs the specified function of the component (e.g., it is functionally equivalent), even if it is not structurally equivalent to the disclosed structure that performs the functions in the exemplary implementation of this specification shown herein.
[0171] That is, the above description is only an embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the specification and drawings of the present application, such as the mutual combination of technical features between the embodiments, or direct or indirect application in other related technical fields, are also included in the patent protection scope of the present application.
[0172] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0173] In order to enable any technician in the field to implement and use the application, the application provides the above description. In the above description, various details are listed for the purpose of explanation. It should be understood that those of ordinary skill in the art can recognize that the application can also be implemented without using these specific details. In other embodiments, the well-known process will not be elaborated in detail to avoid unnecessary details that make the description of the application obscure. Therefore, the application is not intended to be limited to the embodiments shown, but is consistent with the widest range of principles and features disclosed in the application.
Claims
1. A method for identifying an audio scene, characterized in that: include: Get the audio data to be processed; Dividing the audio data to be processed into multiple audio frames that are continuous in time sequence; Filter each frame audio unit according to the band characteristics corresponding to the audio scene to obtain the target audio; Obtaining a frame count and an energy mean of each frame audio unit in the target audio; the frame count is used to characterize the characteristics of a specific scene; Compare the frame count or energy mean with feature thresholds corresponding to different audio scenes to determine the audio scene corresponding to each frame audio unit; The target audio includes a first target audio and a second target audio; the frame count of each frame audio unit in the first target audio is a first frame count, and the energy mean is a first average value; the frame count of each frame audio unit in the second target audio is a second frame count; the feature threshold includes a first trigger threshold and a minimum frame count value; the frame count or energy mean is compared with the feature threshold corresponding to different audio scenes to determine the audio scene corresponding to each frame audio unit, including: setting the first trigger threshold of each frame according to the value characteristics of the first frame count of each frame in the first target audio; determining that the audio unit whose first average value is greater than the first trigger threshold is generated in the first audio scene; the first audio scene is a scene in which the speed of the manipulated target changes in the first direction; determining that the audio unit whose second frame count is greater than or equal to the minimum frame count value is generated in the second audio scene; the second audio scene is a scene in which the speed of the manipulated target changes in the second direction; The first trigger threshold includes an increasing primary trigger threshold, an intermediate trigger threshold and an advanced trigger threshold; the first trigger threshold of each frame is set according to the value characteristics of the first frame number count of each frame in the first target audio. , then the first trigger threshold is set as the primary trigger threshold; wherein, Indicates the first frame count of the current frame. represents the interval threshold, is a positive number, with a sign represents multiplication; the interval threshold is used to describe the interval between the thresholds at each level in the first trigger threshold; if , then the first trigger threshold is set to the intermediate trigger threshold; if , then the first trigger threshold is set to the advanced trigger threshold.
2. The method for identifying an audio scene according to claim 1, characterized in that: Before comparing the frame count or energy mean with the feature thresholds corresponding to different audio scenes to determine the audio scene corresponding to each frame audio unit, the method further includes: Determine the first frame count of the current frame according to the first frame count of the previous frame, the first average value of the current frame and the interval threshold; wherein the previous frame is a frame before the current frame; and / or, The second frame count of the current frame is determined according to the second frame count of the previous frame, the second average value of the current frame and the second trigger threshold; wherein the second average value is the energy average of the corresponding audio unit in the second target audio.
3. The method for identifying an audio scene according to claim 2, characterized in that: Determining the first frame count of the current frame according to the first frame count of the previous frame, the first average value of the current frame and the interval threshold comprises: like ,exist When the first update is used ,exist ,and When the second update method is used ;in, Indicates the first frame number count of the previous frame. Indicates the first frame count of the current frame. represents the interval threshold, is a positive number, with a sign represents multiplication, represents the first average value of the current frame, represents the first mean evaluation parameter, represents the second mean evaluation parameter, represents the third mean evaluation parameter, represents a fourth mean value evaluation parameter; the first updating formula is used to increase the first frame count; the second updating formula is used to decrease the first frame count; like ,exist When the first update is used ,exist When the second update method is used ; like ,exist When the first update is used ,exist When the second update method is used ,like equal , then Set as ;in, Indicates the first step value.
4. The method for identifying an audio scene according to claim 3, characterized in that: The first update formula is: ; The second update formula is: ;in, Indicates the second step value, Indicates the third step value.
5. The method for identifying an audio scene according to claim 2, characterized in that: Determining the second frame count of the current frame according to the second frame count of the previous frame, the second average value of the current frame and the second trigger threshold comprises: like , using the third update method , and in When it is greater than the maximum frame count value, Set to the maximum frame count value; where, represents the second average value of the current frame, represents the second trigger threshold, represents a second frame number count of the current frame; the third updating formula is used to increase the second frame number count; like ,exist When it is a positive number, the fourth update method is used to update ;in, Represents a second frame number count of a previous frame; the fourth updating formula is used to reduce the second frame number count.
6. The method for identifying an audio scene according to claim 5, characterized in that: The third update formula is: ; The fourth update formula is: ,in, Indicates the fourth step value, Indicates the fifth step value.
7. The method for identifying an audio scene according to claim 1, characterized in that: The filtering process of each frame audio unit according to the band characteristics corresponding to the audio scene to obtain the target audio includes: Acquire the first channel data and the second channel data of each frame audio unit; The first channel data is low-pass filtered to obtain a first target audio; and the second channel data is band-pass filtered to obtain a second target audio.
8. A motor driving method, characterized in that: include: The method for identifying an audio scene according to any one of claims 1 to 7, identifying an audio scene corresponding to an audio unit currently being played; According to the audio scene, obtaining a corresponding vibration rule; The motor is driven to vibrate according to the vibration rule to achieve a vibration effect corresponding to the currently played audio unit.
9. The motor driving method according to claim 8, characterized in that: The vibration rule includes a first vibration rule and a second vibration rule; The obtaining of the corresponding vibration rule according to the audio scene includes: if the audio unit of the current frame is generated in the first audio scene, determining the first vibration rule according to the first average value and the first trigger threshold of the current frame; if the audio unit of the current frame is generated in the second audio scene, determining the second vibration rule according to the second frame number count of the current frame.
10. The motor driving method according to claim 9, characterized in that: Determining the first vibration rule according to the first average value and the first trigger threshold of the current frame includes: , then the amplitude of the current frame is set to the second amplitude value, and the maximum vibration flag is set to the first flag; if , when the maximum vibration sense flag is the second flag and When the maximum vibration flag is the first flag and , the amplitude of the current frame is set to the maximum amplitude of the motor; where, represents the first average value of the current frame, Indicates the maximum trigger threshold; the maximum vibration flag is used to mark the vibration level. represents the first trigger threshold, represents the amplitude of the previous frame, Indicates the maximum amplitude of the motor; the vibration climbing rule is a rule for setting the amplitude of each vibration in sequence according to the amplitude recorded in the climbing control matrix; the climbing control matrix records multiple amplitude values; and / or, Determining the second vibration rule according to the second frame number count of the current frame includes: if , then the amplitude of the current frame is set to the first amplitude value; wherein, Indicates the second frame count of the current frame. Indicates the count threshold of the second audio scene.
11. The motor driving method according to claim 10, characterized in that: The first vibration rule also includes: like , the maximum vibration sense flag is the first flag, and If the amplitude of the current frame is greater than the third amplitude value, the amplitude of the current frame is set to the first amplitude value.
12. The motor driving method according to claim 10, characterized in that: The step of controlling the amplitude of the current frame according to the vibration climbing rule includes: Get the climbing frame count, search for the amplitude value sorted as the climbing frame count in the climbing control matrix, and compare the amplitude value obtained with the climbing frame count. The sum determines the amplitude of the current frame.
13. The motor driving method according to claim 12, characterized in that: After the amplitude of the current frame is controlled to increase according to the vibration climbing rule, it also includes: exist , the amplitude of the current frame is set to the maximum amplitude of the motor, and the maximum vibration flag is set to the first flag, and the climbing frame count is incremented by one; wherein, Indicates the amplitude of the current frame.
14. The motor driving method according to claim 13, characterized in that: Also includes: If the climbing frame count is greater than the climbing times threshold, the climbing frame count is set as the climbing times threshold.
15. An audio scene recognition system, characterized in that: include: A first acquisition module, used to acquire audio data to be processed; A segmentation module, used for segmenting the audio data to be processed into multiple audio frames that are continuous in time sequence; A filtering module is used to filter each frame audio unit according to the band characteristics corresponding to the audio scene to obtain the target audio; A second acquisition module is used to obtain the frame count and energy mean of each frame audio unit in the target audio; the frame count is used to characterize the characteristics of a specific scene; A determination module, configured to compare the frame count or energy mean with characteristic thresholds corresponding to different audio scenes, and determine the audio scene corresponding to each frame audio unit; The target audio includes a first target audio and a second target audio; the frame count of each frame audio unit in the first target audio is a first frame count, and the energy mean is a first average value; the frame count of each frame audio unit in the second target audio is a second frame count; the feature threshold includes a first trigger threshold and a minimum frame count value; comparing the frame count or energy mean with the feature threshold corresponding to different audio scenes to determine the audio scene corresponding to each frame audio unit includes: setting the first trigger threshold of each frame according to the value characteristics of the first frame count of each frame in the first target audio; determining that the audio unit with the first average value greater than the first trigger threshold is generated in the first audio scene; the first audio scene is a scene in which the speed of the manipulated target changes in the first direction; determining that the audio unit with the second frame count greater than or equal to the minimum frame count value is generated in the second audio scene; the second audio scene is a scene in which the speed of the manipulated target changes in the second direction; The first trigger threshold includes an increasing primary trigger threshold, an intermediate trigger threshold and an advanced trigger threshold; the first trigger threshold of each frame is set according to the value characteristics of the first frame number count of each frame in the first target audio. , then the first trigger threshold is set as the primary trigger threshold; wherein, Indicates the first frame count of the current frame. represents the interval threshold, is a positive number, with a sign represents multiplication; the interval threshold is used to describe the interval between the thresholds at each level in the first trigger threshold; if , then the first trigger threshold is set to the intermediate trigger threshold; if , then the first trigger threshold is set to the advanced trigger threshold.
16. A motor drive system, characterized in that: include: an identification module, configured to identify the audio scene corresponding to the currently played audio unit according to the audio scene identification system of claim 15; A third acquisition module is used to acquire a corresponding vibration rule according to the audio scene; The driving module is used to drive the motor to vibrate according to the vibration rule to achieve a vibration effect corresponding to the currently played audio unit.
17. An electronic device, characterized in that: It comprises a processor and a storage medium; the storage medium stores program code; the processor is used to call the program code stored in the storage medium to execute the audio scene recognition method according to any one of claims 1 to 7.
18. The electronic device according to claim 17, characterized in that: It also includes a motor; and the processor is further used to execute the motor driving method as described in any one of claims 8 to 14.
Citation Information
Patent Citations
Method for identifying gunshot in audio data, method for driving motor and related device
CN111603776A