CN114327040A - Vibration signal generation method, device, electronic device and storage medium - Google Patents

Vibration signal generation method, device, electronic device and storage medium Download PDF

Info

Publication number
CN114327040A
CN114327040A CN202111417788.2A CN202111417788A CN114327040A CN 114327040 A CN114327040 A CN 114327040A CN 202111417788 A CN202111417788 A CN 202111417788A CN 114327040 A CN114327040 A CN 114327040A
Authority
CN
China
Prior art keywords
audio
time period
energy
average energy
vibration signal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111417788.2A
Other languages
Chinese (zh)
Inventor
刘兵
刘钰佳
杨鑫峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Goertek Inc
Original Assignee
Goertek Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Goertek Inc filed Critical Goertek Inc
Priority to CN202111417788.2A priority Critical patent/CN114327040A/en
Publication of CN114327040A publication Critical patent/CN114327040A/en
Priority to PCT/CN2022/124491 priority patent/WO2023093333A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Measurement Of Mechanical Vibrations Or Ultrasonic Waves (AREA)

Abstract

The application provides a vibration signal generation method, a device, an electronic device and a storage medium, wherein the vibration signal generation method comprises the following steps: acquiring audio data; detecting a first audio average energy in a first time period before the current time and a second audio average energy in a second time period; the first time period is less than the second time period; determining a relative increment of audio energy of the first time period relative to the second time period according to the first audio average energy and the second audio average energy; and if the relative increment of the audio energy is greater than or equal to a preset threshold value, generating a preset vibration signal according to a preset rule. The method and the device can detect the rhythm in real time and synchronously generate the vibration signals.

Description

Vibration signal generation method, device, electronic device and storage medium
Technical Field
The application relates to the technical field of vibration driving, in particular to a vibration signal generation method and device, electronic equipment and a storage medium.
Background
A Linear motor (LRA) is a transmission device that directly converts electric energy into mechanical energy for Linear motion without any intermediate conversion mechanism, and is generally driven by an ac power, and an energized coil is subjected to an ampere force in a magnetic field, thereby driving the motor to vibrate. In recent years, linear motors have been widely used in various vibration situations of consumer electronics, especially games and AR/VR products, due to their advantages of strong, rich, crisp, and low energy consumption.
In order to enhance the user experience of products such as games and AR/VR, developers usually convert input audio signals to generate vibration driving signals of the linear motor and drive the linear motor to generate vibration, so that vibration feedback matched with the input audio is realized, that is, sound-vibration synchronous output is realized, thus double experiences of auditory sense and tactile sense interweaving are brought to users, and richness and playability of game interaction are improved.
In the existing sound-vibration conversion processing, the rhythm information of the sound is usually required to be detected, and then a preset vibration waveform is generated at the rhythm generation time by combining the actual game scene, so that the vibration output synchronous with the audio rhythm is realized. If the rhythm of the sound is not accurately detected, for example, the detection signal is delayed, the user will be given a sense of incongruity between the sound and the vibration, which results in a poor experience.
Disclosure of Invention
The application provides a vibration signal generation method, a vibration signal generation device, electronic equipment and a storage medium, which can perform rhythm detection in real time and synchronously generate vibration signals.
An embodiment of a first aspect of the present application provides a vibration signal generation method, including:
acquiring audio data;
detecting a first audio average energy in a first time period before the current time and a second audio average energy in a second time period; the first time period is less than the second time period;
determining a relative increase in audio energy for the first time period relative to the second time period based on the first audio average energy and the second audio average energy;
and if the relative increment of the audio energy is greater than or equal to a preset threshold value, generating a preset vibration signal according to a preset rule.
In some embodiments of the present application, the end times of the first and second time periods are the same.
In some embodiments of the present application, detecting a first average energy of audio in a first time period before a current time comprises:
calculating a first quantity of first audio data in the first time period according to a preset sampling period;
calculating a first audio average energy over the first time period based on the first audio data and the first quantity;
detecting a second average energy of audio over a second time period prior to the current time, comprising:
calculating a second quantity of second audio data in the second time period according to a preset sampling period;
calculating a second audio average energy over the second time period based on the second audio data and the second quantity.
In some embodiments of the present application, determining a relative increase in audio energy for the first time period relative to the second time period based on the first audio average energy and the second audio average energy comprises:
calculating a ratio of the first audio average energy and the second audio average energy and determining whether the ratio is greater than 1;
if so, determining the relative increment of the audio energy of the first time period relative to the second time period as the ratio minus 1;
if not, determining the relative increment of the audio energy of the first time period relative to the second time period as 0.
In some embodiments of the present application, generating the preset vibration signal according to a preset rule includes:
generating vibration signals of different shapes according to the amplification of the relative increment of the audio energy;
and generating vibration signals with different amplitudes according to the relative increment of the audio energy.
In some embodiments of the present application, the preset threshold is greater than or equal to 1.
In some embodiments of the present application, the duration of the first time period is two to three times the duration of the second time period.
An embodiment of a second aspect of the present application provides a vibration signal generation apparatus, including:
the acquisition module is used for acquiring audio data;
the detection module is used for detecting first audio average energy in a first time period before the current moment and second audio average energy in a second time period; the first time period is less than the second time period;
a determining module, configured to determine a relative increase in audio energy of the first time period with respect to the second time period according to the first audio average energy and the second audio average energy;
and the generating module is used for generating a preset vibration signal according to a preset rule if the relative increment of the audio energy is greater than or equal to a preset threshold value.
Embodiments of a third aspect of the present application provide an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor executing the computer program to implement the method according to the first aspect. .
An embodiment of a fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, the program being executable by a processor to implement the method according to the first aspect.
The technical scheme provided in the embodiment of the application at least has the following technical effects or advantages:
the vibration signal generation method provided by the embodiment of the application utilizes the characteristic that the average energy of the audio changes slowly in a longer time period than in a shorter time period, by detecting the average energy of the audio in the first time segment and the second time segment with different lengths, two audio frequency average energies with different amplitude change speeds can be obtained, whether the ratio of the average energy in a short time period to the average energy in a longer time period has approximate step change or not is detected by calculating the relative increment of the audio frequency energy of a first time period and a second time period, and through the detection of the step pulse, the method can realize the detection of the audio rhythm under the condition of random input of the audio amplitude, generate a preset vibration waveform when the rhythm is generated, realize the real-time conversion from the audio signal to the vibration signal and output the vibration feedback consistent with the audio rhythm. The method does not need any pretreatment, and the audio-vibration conversion process is carried out in real time, so that the online vibration waveform generation can be realized, and the method is suitable for games or working scenes needing audio-vibration real-time conversion.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a schematic flow chart illustrating a vibration signal generation method provided by an embodiment of the present application;
FIG. 2 is a logic diagram illustrating a vibration signal generation method provided by an embodiment of the present application;
FIG. 3 is a schematic diagram illustrating a flow of calculating the average audio energy in the embodiment of the present application;
FIG. 4 is a schematic diagram illustrating the shot audio data with large 6 sound amplitude differences in a certain game collected in the embodiment of the present application;
fig. 5 is a diagram illustrating average audio energy in a first time period obtained by using the vibration signal generation method provided by the present embodiment;
fig. 6 is a diagram showing the average energy of the audio in the second time period obtained by the vibration signal generation method provided by the present embodiment;
fig. 7 is a schematic diagram showing the relative increase of the audio average energy in the first time period relative to the audio average energy in the second time period, which is obtained by adopting the vibration signal generation method provided by the present embodiment (the upper limit of the diagram is 10);
fig. 8 is a schematic diagram illustrating a vibration signal obtained by performing real-time transformation processing on the audio data in fig. 4 by using the vibration signal generation method provided in this embodiment;
fig. 9 is a schematic structural diagram illustrating a vibration signal generating apparatus according to an embodiment of the present application;
fig. 10 is a schematic diagram of an electronic device provided by an embodiment of the present application;
fig. 11 shows a schematic diagram of a computer-readable storage medium provided in an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
It is to be noted that, unless otherwise specified, technical or scientific terms used herein shall have the ordinary meaning as understood by those skilled in the art to which this application belongs.
A vibration signal generation method, a vibration signal generation apparatus, an electronic device, and a storage medium according to embodiments of the present application are described below with reference to the accompanying drawings.
In this embodiment, the existing sound-vibration conversion technology is analyzed, and it is found that: 1) the method can realize real-time sound-vibration conversion processing, for example, the energy of the input audio is detected, the detected energy is compared with a set threshold value, and a preset vibration waveform is inserted if the detected energy is larger than the set threshold value. 2) Many patent application documents (CN112466267A) with application number 202011326608.5, entitled "vibration signal generation method, vibration control method, and related devices", for example, propose a method for obtaining a haptic waveform from an audio signal, in which audio is first preprocessed to identify beats in the audio, then the beats are obtained by the beats to obtain energies of a plurality of notes, and normalized preprocessing is performed, and then the relationship between the normalized energy and a set threshold is compared to determine whether to insert a corresponding haptic waveform. The method is an off-line processing scheme, namely, the whole audio information is input firstly in the realization process, then the processing is carried out, the whole touch sensation vibration file corresponding to the audio information is generated, then the audio file and the touch sensation vibration file can be played synchronously, and the matched sound-vibration synchronous experience is generated. However, in a game scene, the audio signal is generated in real time along with the operation of the player, and the audio signal cannot be predicted in advance to be complete information and converted into a vibration file in advance, so that the offline processing method cannot be applied to a game and other scenes which need real-time audio-vibration conversion.
In view of the foregoing problems, an embodiment of the present invention provides a method for generating a vibration signal, which can be implemented by a vibration signal generating apparatus, and can be specifically formed on an electronic device (e.g., a game or work device such as VR/AR) that needs to perform real-time audio-vibration conversion, and can detect audio energy in two time periods with different durations before a current time according to audio data collected at and before the current time, determine whether there is a rhythm generation according to a relative increment of the audio energy in the two time periods, and insert a preset vibration signal when there is a rhythm generation, so as to implement real-time online conversion from an audio signal to a vibration signal, generate a vibration signal matched with an audio, and control a sampling period to control a real-time conversion sensitivity of audio-vibration.
As shown in fig. 1, a vibration signal generation method provided in an embodiment of the present application may include the following steps:
in step S1, audio data is acquired.
The audio data is generated in real time along with the operation of the user (such as a game player) of the device, and is closely related to the actual operation of the user and the game or working scene, and the whole audio data cannot be predicted in advance under normal conditions. The audio data can be collected by a radio device, converted into audio data capable of being digitally transmitted and processed by a digital conversion technology, and then transmitted to the vibration signal generation device of the embodiment. That is, the audio data is generally digital information that can be calculated and processed, and the audio data can be acquired in real time in the process of realizing real-time conversion of audio-vibration. The acquisition can be actively acquired from the radio equipment or passively received from the radio equipment.
It should be noted that, after the audio data is acquired, in order to improve the real-time performance and reduce the delay as much as possible, the audio data does not need to be processed, and the subsequent steps can be directly performed. However, in order to obtain more accurate real-time data and facilitate subsequent calculation, the obtained audio data may be subjected to smoothing filtering first. In the specific implementation, a person skilled in the art may operate according to the actual situation, and this embodiment is not particularly limited thereto.
In step S2, a first average audio energy in a first time period before the current time and a second average audio energy in a second time period are detected.
The first time period is smaller than the second time period, and specifically, the duration of the second time period can be set to be 2-3 times of the duration of the first time period, so that the average energies of the audios in the two time periods are different enough to facilitate the detection of the rhythm. The values of the first time period and the second time period may be several milliseconds to several tens of milliseconds, and may be specifically set according to actual conditions, which is not specifically limited in this embodiment.
In a specific implementation manner of this embodiment, the first time period t may be setmAnd a second time period tnA first time period tmCan be set to 10 ms; a second time period tnCan be set to 20 ms. The sampling period T of the audio data can be setsEvery interval TsA first time period t preceding the time of the time-to-sample point (i.e. the current time in the text)mAnd a second time period tnAudio data within the audio data collection. Normal sampling period TsMay be less than the first time period tmPreventing only during the longer second time period tnWith rhythmic audio acquisitionData, and the average audio energy and the first time period t are shorter due to the time buffering of the long time periodmThe average energy of the inner audio frequency is not very different, thereby causing the condition of missing detection. In particular, the sampling period TsThe value can be specifically set according to actual conditions, for example, a short period T with short time can be setsTo improve the sensitivity of audio-vibration conversion; the period T with longer time can also be setsTo improve the accuracy and processing speed of audio data detection.
In an embodiment, detecting the first average audio energy in the first time period before the current time may specifically include the following processing: calculating a first quantity of first audio data in a first time period according to a preset sampling period; a first audio average energy over a first time period is calculated based on the first audio data and the first quantity. Similarly, detecting the second average audio energy in the second time period before the current time may specifically include the following processing: calculating a second quantity of second audio data in a second time period according to a preset sampling period; a second audio average energy over a second time period is calculated based on the second audio data and the second quantity.
The embodiment defines the value representing the audio signal as the audio energy, so as to facilitate the calculation. The average audio energy may be an average of absolute values of the audio data, or an average of squares of the audio data, which is not specifically limited in this embodiment. In addition, the audio energy may also be energy of an audio signal wave (the actual audio signal wave may be determined according to the audio data, and then the energy of the audio signal wave is calculated), which is not particularly limited in this embodiment.
First time period tmThe average energy of the inner audio frequency can be recorded as PmAccording to the audio sampling period TsCalculating a first time period tmNumber of audio data in
Figure BDA0003375788970000071
. Then recording a first time period t before the current sampling time tmEach audio data x iniAnd i is 1 to m. The time period t may be calculated by the following formula (1) or formula (2)mInner audio mean energy Pm
Figure BDA0003375788970000072
Figure BDA0003375788970000073
Similarly, the second time period tnThe average energy of the inner audio frequency can be recorded as PnAccording to the audio sampling period TsCalculating the second time period tnNumber of audio data in
Figure BDA0003375788970000074
. Then recording a second time period t before the current sampling time tnEach audio data x injAnd i is 1 to n. The time period t may be calculated by the following formula (3) or formula (4)nInner audio mean energy Pn
Figure BDA0003375788970000075
Figure BDA0003375788970000076
Therefore, the average energy of the audio is obtained by means of accumulative summation and averaging of the audio data in a period of time, the detection process is simple, the calculated amount is small, the calculation time is short, and the real-time performance is higher.
In another embodiment, the first time period tmAnd a second time period tnThe end time of the sampling is the same and is the current sampling time. That is, when the audio data is recorded, the first time period t with the current sampling time t as the end point may be recorded separatelymEach audio data x ofiAnd a second time period tnEach of themAudio data xj. Thus, the first time period t is setmAnd a second time period tnThe finishing time of the method is sampling time, the latest audio data can be ensured to be collected, the rhythm can be detected as early as possible, and after the rhythm is generated, the vibration signal is inserted as soon as possible, so that the real-time performance of audio-vibration conversion is further enhanced.
In addition, if the current time t is less than the time period tmThen only each audio data x, x within the 0-t time period is recordediAnd a first time period tmEach audio data x ofiAnd a second time period tnEach audio data x injAre all x, and the first time period tmAnd a second time period tnThe number of the audio data in the audio data is updated to
Figure BDA0003375788970000081
If the current time t is less than the second time period tnAnd is greater than the first time period tmRespectively recording the first time period tmEach audio data x ofiAnd each audio data x in the 0-t time periodjAnd a second time period tnThe number n of audio data in the audio data is updated to
Figure BDA0003375788970000082
Therefore, the method can reduce some ineffective calculations in the previous stage, further improve the calculation speed and enhance the real-time performance of audio-vibration conversion.
In step S3, a relative increment of the audio energy of the first time period relative to the second time period is determined according to the first audio average energy and the second audio average energy.
The embodiment is realized by the first time periods t with different lengthsmAnd a second time period tnThe audio frequency average energy detection in the audio frequency average energy detection device can obtain two audio frequency average energies with different amplitude change speeds, and under the normal condition, due to long-time buffering, the second time period t is longernThe average energy of the audio frequency in the audio frequency is changed in a first time period t shorter than the timemThe average energy of the audio within varies more slowly and more slowly. Therefore, when the audio frequency energy isWhen the mutation occurs, the time is shorter for the first time period tmThe average energy of the audio within the time interval t is faster in response to the average energy of the audio within the time interval tnThe average energy response of the inner audio is slow, so that the ratio of the two changes in an approximate step, and whether the change in the approximate step occurs can be used as a standard for detecting whether the rhythm is generated.
Specifically, the first audio average energy P may be calculated firstmAnd a second audio mean energy PnIs equal to Pm/PnAnd determining whether the ratio k is greater than 1; if so, indicating that the above approximate step change may exist, and that there may be a rhythm generation, the relative increment of the audio energy of the first time period relative to the second time period may be determined as the value of the ratio k minus 1, i.e. k-1; if not, the change of the approximate steps is not shown, basically no rhythm is generated, and in order to reduce the calculation amount, the relative increment of the audio energy of the first time period relative to the second time period can be directly determined as 0.
In step S4, if the relative increment of the audio energy is greater than or equal to the preset threshold, a preset vibration signal is generated according to a preset rule.
According to the analysis, the variation of the approximate step is relative to the variation of the approximate step, and only corresponds to the first time period tmAverage energy of audio within a time period tnThe abrupt change ratio k of the average energy of the inner audio is related to the amplitude of the audio itself. Therefore, by detecting the step pulse, the detection of the audio rhythm under the condition of random input of the audio amplitude can be realized. Whether the approximate step change is generated or not can be judged through a preset threshold value of the relative increment of the average audio energy, so that the problem that the rhythm judgment cannot be carried out by using a fixed threshold value due to random audio amplitude caused by setting the threshold value according to the absolute audio energy is solved.
When the relative increment of the audio energy is larger than or equal to the preset threshold value, the vibration signal generating device can determine that the rhythm is generated, generate a preset vibration signal (namely vibration wave) according to a preset rule, realize the real-time conversion from the audio signal to the vibration signal and output the vibration feedback consistent with the detected audio rhythm. And when the relative increment of the audio energy is smaller than a preset threshold value, determining that no rhythm is generated, not performing audio-vibration conversion by the vibration signal generation device, then continuously acquiring audio data at the next sampling moment, continuously performing rhythm judgment, and generating a corresponding vibration signal when the rhythm is generated. The operation is repeated until the audio data is not received any more (such as the game is ended) in the starting.
Specifically, the generating the preset vibration signal according to the preset rule may include the following steps: generating vibration signals of different shapes according to the amplification of the relative increment of the audio energy; and generating vibration signals with different amplitudes according to the relative increment of the audio energy.
The present embodiment may preset a vibration signal according to a specific scene of a game or a work, compare the relative increment of audio energy with historical data, and set vibration signals of different shapes and amplitudes according to a comparison result, for example, if the relative increment of audio energy at this time is different from the relative increment of audio energy calculated at the last time by a large amount, a preset waveform different from the last time may be generated. The amplitude of the vibration signal can be set according to the specific numerical value of the relative increment of the audio energy, namely, if the relative increment of the audio energy is larger, the vibration signal with larger amplitude can be set; if the relative increment of the audio energy is small, a vibration signal with a small amplitude may be set.
In order to facilitate understanding of the methods provided by the embodiments of the present application, reference is made to the following description taken in conjunction with the accompanying drawings. As shown in fig. 2, the vibration signal generating apparatus receives input audio data, sets a first time period and a second time period, where the second time period is greater than the first time period, then detects average energies of audio within the first time period and the second time period, respectively, calculates relative increments of audio energies of the first time period and the second time period, detects whether a rhythm is generated according to the relative increments of audio energies, and generates a vibration signal when the rhythm is generated. The calculation process of the average audio energy is shown in fig. 3, and the vibration signal generation device calculates the audio data in the time period according to the received specific time period, records the audio data in the time period, and then calculates and obtains the average audio energy according to the above formula (1) -formula (4).
In order to verify the effectiveness of the vibration signal generation method provided by this embodiment in performing audio-vibration conversion, in this embodiment, a gunshot with a large difference in 6 sound amplitudes in a certain game is selected as audio data, and an audio-vibration conversion test is performed by using the vibration signal generation method provided by this embodiment. As shown in fig. 4, a shot with a large difference in 6 sound amplitudes in a certain game is collected as an audio data diagram. As shown in fig. 5, it is a schematic diagram of the average energy of the audio in the first time period obtained by using the vibration signal generation method provided in this embodiment. As shown in fig. 6, it is a schematic diagram of the average energy of the audio in the second time period obtained by using the vibration signal generation method provided in the present embodiment. As shown in fig. 7, the audio energy relative increment is shown as the audio average energy in the first time period relative to the audio average energy in the second time period (the upper limit of the figure is 10). As shown in fig. 8, a schematic diagram of a vibration signal obtained by performing real-time conversion processing on the audio data by using the vibration signal generation method provided in this embodiment is shown.
As can be seen from comparing fig. 4 and fig. 5, if it is difficult to find a suitable threshold to determine the generating time of the rhythm only according to the absolute amplitude of the average audio energy, in view of this, the generating time of the rhythm is accurately detected by the relative increment of the average audio energy in two time periods with different durations, so that a corresponding vibration signal can be generated in time.
Comparing fig. 4 and fig. 7, it can be known that the relationship between the relative increment of the audio energy and the amplitude of the audio itself is not large, and only when the energy changes significantly, a pulse waveform similar to a step is generated, thereby solving the problem of detecting the rhythm when the amplitude of the input audio is random.
Comparing fig. 4 and fig. 8, it can be known that the generated vibration signal corresponds to the rhythm of the audio data, which illustrates that the method provided by the embodiment realizes real-time and accurate audio rhythm detection.
The vibration signal generation method provided by the present embodiment utilizes the characteristic that the average energy of the audio changes slowly in a longer time period than in a shorter time period, by detecting the average energy of the audio in the first time segment and the second time segment with different lengths, two audio frequency average energies with different amplitude change speeds can be obtained, whether the ratio of the average energy in a short time period to the average energy in a longer time period has approximate step change or not is detected by calculating the relative increment of the audio frequency energy of a first time period and a second time period, and through the detection of the step pulse, the method can realize the detection of the audio rhythm under the condition of random input of the audio amplitude, generate a preset vibration waveform when the rhythm is generated, realize the real-time conversion from the audio signal to the vibration signal and output the vibration feedback consistent with the audio rhythm. The method does not need any pretreatment, and the audio-vibration conversion process is carried out in real time, so that the online vibration waveform generation can be realized, and the method is suitable for games or working scenes needing audio-vibration real-time conversion.
Based on the same concept of the vibration signal generation method, the present embodiment further provides a vibration signal generation apparatus, as shown in fig. 9, including:
the acquisition module is used for acquiring audio data;
the detection module is used for detecting first audio average energy in a first time period before the current moment and second audio average energy in a second time period; the first time period is less than the second time period;
a determining module, configured to determine a relative increment of audio energy for the first time period relative to the second time period according to the first audio average energy and the second audio average energy;
and the generating module is used for generating a preset vibration signal according to a preset rule if the relative increment of the audio energy is greater than or equal to a preset threshold value.
The vibration signal generation apparatus provided in this embodiment can at least achieve the beneficial effects that can be achieved by the vibration signal generation method based on the same concept of the vibration signal generation method, and will not be described herein again.
The embodiment of the application also provides electronic equipment for executing the vibration signal generation method. Referring to fig. 10, a schematic diagram of an electronic device provided in some embodiments of the present application is shown. As shown in fig. 10, the electronic apparatus 8 includes: a processor 800, a memory 801, a bus 802 and a communication interface 803, the processor 800, the communication interface 803 and the memory 801 being connected by the bus 802; the memory 801 stores a computer program operable on the processor 800, and the processor 800 executes the vibration signal generation method provided in any one of the foregoing embodiments when executing the computer program.
The Memory 801 may include a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the apparatus and at least one other network element is realized through at least one communication interface 803 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, etc. may be used.
Bus 802 can be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The memory 801 is used for storing a program, and the processor 800 executes the program after receiving an execution instruction, and the vibration signal generation method disclosed in any of the foregoing embodiments of the present application may be applied to the processor 800, or implemented by the processor 800.
The processor 800 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 800. The Processor 800 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 801, and the processor 800 reads the information in the memory 801 and completes the steps of the method in combination with the hardware thereof.
The electronic device provided by the embodiment of the application and the vibration signal generation method provided by the embodiment of the application have the same inventive concept and have the same beneficial effects as the method adopted, operated or realized by the electronic device.
The electronic device may further include a power converter and a Linear motor (Linear resistive Actuator) device body, the power amplifier may be an amplifier for power matching of a vibration signal, such as a common class a, B, AB, or D driver, and the vibration signal may be an analog signal or a digital signal of a certain system. The linear motor device body is used to generate haptic vibratory feedback.
Referring to fig. 11, the computer readable storage medium is an optical disc 30, and a computer program (i.e., a program product) is stored thereon, and when being executed by a processor, the computer program executes the vibration signal generating method according to any of the foregoing embodiments.
It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory, or other optical and magnetic storage media, which are not described in detail herein.
The computer-readable storage medium provided by the above-mentioned embodiments of the present application and the vibration signal generation method provided by the embodiments of the present application have the same beneficial effects as the method adopted, operated or implemented by the application program stored in the computer-readable storage medium.
It should be noted that the above-mentioned embodiments illustrate rather than limit the application, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The application may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
The above description is only for the preferred embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present application should be covered within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A vibration signal generation method, comprising:
acquiring audio data;
detecting a first audio average energy in a first time period before the current time and a second audio average energy in a second time period; the first time period is less than the second time period;
determining a relative increase in audio energy for the first time period relative to the second time period based on the first audio average energy and the second audio average energy;
and if the relative increment of the audio energy is greater than or equal to a preset threshold value, generating a preset vibration signal according to a preset rule.
2. The method of claim 1, wherein the end times of the first and second time periods are the same.
3. The method of claim 1 or 2, wherein detecting the first average energy of the audio over the first time period before the current time comprises:
calculating a first quantity of first audio data in the first time period according to a preset sampling period;
calculating a first audio average energy over the first time period based on the first audio data and the first quantity;
detecting a second average energy of audio over a second time period prior to the current time, comprising:
calculating a second quantity of second audio data in the second time period according to a preset sampling period;
calculating a second audio average energy over the second time period based on the second audio data and the second quantity.
4. The method of claim 3, wherein determining a relative increase in audio energy for the first time period relative to the second time period based on the first audio average energy and the second audio average energy comprises:
calculating a ratio of the first audio average energy and the second audio average energy and determining whether the ratio is greater than 1;
if so, determining the relative increment of the audio energy of the first time period relative to the second time period as the ratio minus 1;
if not, determining the relative increment of the audio energy of the first time period relative to the second time period as 0.
5. The method according to claim 1 or 2, wherein generating a preset vibration signal according to a preset rule comprises:
generating vibration signals of different shapes according to the amplification of the relative increment of the audio energy;
and generating vibration signals with different amplitudes according to the relative increment of the audio energy.
6. Method according to claim 1 or 2, characterized in that said preset threshold is greater than or equal to 1.
7. The method of claim 1 or 2, wherein the duration of the first time period is two to three times the duration of the second time period.
8. A vibration signal generation apparatus, comprising:
the acquisition module is used for acquiring audio data;
the detection module is used for detecting first audio average energy in a first time period before the current moment and second audio average energy in a second time period; the first time period is less than the second time period;
a determining module, configured to determine a relative increase in audio energy of the first time period with respect to the second time period according to the first audio average energy and the second audio average energy;
and the generating module is used for generating a preset vibration signal according to a preset rule if the relative increment of the audio energy is greater than or equal to a preset threshold value.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the method of any one of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, characterized in that the program is executed by a processor to implement the method according to any of claims 1-7.
CN202111417788.2A 2021-11-25 2021-11-25 Vibration signal generation method, device, electronic device and storage medium Pending CN114327040A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202111417788.2A CN114327040A (en) 2021-11-25 2021-11-25 Vibration signal generation method, device, electronic device and storage medium
PCT/CN2022/124491 WO2023093333A1 (en) 2021-11-25 2022-10-11 Vibration signal generation method and apparatus, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111417788.2A CN114327040A (en) 2021-11-25 2021-11-25 Vibration signal generation method, device, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN114327040A true CN114327040A (en) 2022-04-12

Family

ID=81047279

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111417788.2A Pending CN114327040A (en) 2021-11-25 2021-11-25 Vibration signal generation method, device, electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN114327040A (en)
WO (1) WO2023093333A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023093333A1 (en) * 2021-11-25 2023-06-01 歌尔股份有限公司 Vibration signal generation method and apparatus, electronic device, and storage medium
CN116827205A (en) * 2023-08-31 2023-09-29 荣耀终端有限公司 Control method of motor vibration, electronic device and readable storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2090531A1 (en) * 1993-02-26 1994-08-27 Stephen W. Armstrong Dual time constant audio compression system
CN1672464A (en) * 2002-08-07 2005-09-21 杜比实验室特许公司 Audio channel spatial translation
CN103247175A (en) * 2013-04-27 2013-08-14 西安交通大学 Road congestion monitoring method based on idling sound frequency spectrums of automobiles
US9749733B1 (en) * 2016-04-07 2017-08-29 Harman Intenational Industries, Incorporated Approach for detecting alert signals in changing environments
CN109817241A (en) * 2019-02-18 2019-05-28 腾讯音乐娱乐科技(深圳)有限公司 Audio-frequency processing method, device and storage medium
CN110350935A (en) * 2019-05-27 2019-10-18 努比亚技术有限公司 Audio signal output control method, wearable device and readable storage medium storing program for executing
CN111477243A (en) * 2020-04-16 2020-07-31 维沃移动通信有限公司 Audio signal processing method and electronic equipment
CN112466267A (en) * 2020-11-24 2021-03-09 瑞声新能源发展(常州)有限公司科教城分公司 Vibration generation method, vibration control method and related equipment
CN113438364A (en) * 2021-06-01 2021-09-24 荣耀终端有限公司 Vibration adjustment method, electronic device, storage medium, and computer program product

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2016027366A1 (en) * 2014-08-22 2017-05-25 パイオニア株式会社 Vibration signal generating apparatus and vibration signal generating method
CN107103917B (en) * 2017-03-17 2020-05-05 福建星网视易信息系统有限公司 Music rhythm detection method and system
CN111081271B (en) * 2019-11-29 2022-09-06 福建星网视易信息系统有限公司 Music rhythm detection method based on frequency domain and time domain and storage medium
CN114327040A (en) * 2021-11-25 2022-04-12 歌尔股份有限公司 Vibration signal generation method, device, electronic device and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2090531A1 (en) * 1993-02-26 1994-08-27 Stephen W. Armstrong Dual time constant audio compression system
CN1672464A (en) * 2002-08-07 2005-09-21 杜比实验室特许公司 Audio channel spatial translation
CN103247175A (en) * 2013-04-27 2013-08-14 西安交通大学 Road congestion monitoring method based on idling sound frequency spectrums of automobiles
US9749733B1 (en) * 2016-04-07 2017-08-29 Harman Intenational Industries, Incorporated Approach for detecting alert signals in changing environments
CN109817241A (en) * 2019-02-18 2019-05-28 腾讯音乐娱乐科技(深圳)有限公司 Audio-frequency processing method, device and storage medium
CN110350935A (en) * 2019-05-27 2019-10-18 努比亚技术有限公司 Audio signal output control method, wearable device and readable storage medium storing program for executing
CN111477243A (en) * 2020-04-16 2020-07-31 维沃移动通信有限公司 Audio signal processing method and electronic equipment
CN112466267A (en) * 2020-11-24 2021-03-09 瑞声新能源发展(常州)有限公司科教城分公司 Vibration generation method, vibration control method and related equipment
CN113438364A (en) * 2021-06-01 2021-09-24 荣耀终端有限公司 Vibration adjustment method, electronic device, storage medium, and computer program product

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023093333A1 (en) * 2021-11-25 2023-06-01 歌尔股份有限公司 Vibration signal generation method and apparatus, electronic device, and storage medium
CN116827205A (en) * 2023-08-31 2023-09-29 荣耀终端有限公司 Control method of motor vibration, electronic device and readable storage medium
CN116827205B (en) * 2023-08-31 2023-12-15 荣耀终端有限公司 Control method of motor vibration, electronic device and readable storage medium

Also Published As

Publication number Publication date
WO2023093333A1 (en) 2023-06-01

Similar Documents

Publication Publication Date Title
CN114327040A (en) Vibration signal generation method, device, electronic device and storage medium
CN114299991A (en) Vibration generation method, device and equipment based on audio signal and storage medium
CN105511514A (en) Tactile vibration control system and method for intelligent terminal
US10748391B2 (en) Haptic signal conversion system
CN110086403B (en) Motor driving signal setting method, electronic device and storage medium
CN100549638C (en) Measure the frequency characteristic of impulse response and the method and the sound field correcting apparatus of rising edge
KR100749570B1 (en) Pet no-barking device and method thereof
CN112466267B (en) Vibration generation method, vibration control method and related equipment
Vieira Automatic estimation of reverberation time
WO2019017242A1 (en) Musical composition analysis method, musical composition analysis device and program
CN109410972B (en) Method, device and storage medium for generating sound effect parameters
CN111327247A (en) Motor control method and system
CN1493071A (en) Voice command identifier for voie recognition system
JP4656443B2 (en) Waveform generator and waveform generation processing program
JP6300371B2 (en) Motor drive control device and motor drive control method
CN111175810A (en) Microseismic signal arrival time picking method, device, equipment and storage medium
CN111161745A (en) Awakening method, device, equipment and medium for intelligent equipment
CN106054756B (en) The control method and device of robot
CN111539089A (en) Motor nonlinear model judgment method and system
JP6286933B2 (en) Apparatus, method, and program for estimating measure interval and extracting feature amount for the estimation
CN112365568A (en) Audio processing method and device, electronic equipment and storage medium
JP4827595B2 (en) Impulse response detection device and impulse response detection program
CN113516965B (en) Voice test method, computer equipment and readable storage medium
WO2017145800A1 (en) Voice analysis apparatus, voice analysis method, and program
JP2021148503A (en) Noise evaluation device and acoustic characteristic measuring device

Legal Events

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