CN111158470A - Method and apparatus for controlling output vibration signal, computer device and storage medium - Google Patents
Method and apparatus for controlling output vibration signal, computer device and storage medium Download PDFInfo
- Publication number
- CN111158470A CN111158470A CN201911302000.6A CN201911302000A CN111158470A CN 111158470 A CN111158470 A CN 111158470A CN 201911302000 A CN201911302000 A CN 201911302000A CN 111158470 A CN111158470 A CN 111158470A
- Authority
- CN
- China
- Prior art keywords
- vibration
- time
- target
- media
- service
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 44
- 238000004590 computer program Methods 0.000 claims description 9
- 230000001360 synchronised effect Effects 0.000 abstract description 18
- 238000010586 diagram Methods 0.000 description 7
- 230000005540 biological transmission Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000006854 communication Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000002349 favourable effect Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/016—Input arrangements with force or tactile feedback as computer generated output to the user
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11B—INFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
- G11B27/00—Editing; Indexing; Addressing; Timing or synchronising; Monitoring; Measuring tape travel
- G11B27/10—Indexing; Addressing; Timing or synchronising; Measuring tape travel
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
- Indexing, Searching, Synchronizing, And The Amount Of Synchronization Travel Of Record Carriers (AREA)
Abstract
The invention provides a method and a device for controlling an output vibration signal, computer equipment and a storage medium. The method for controlling the output vibration signal comprises the following steps: the media service acquires a vibration information table; the media service with the timer sends a playing instruction to the media driving service, and the timer starts timing; the media service obtains the current playing time of the target media file through a timer, and determines a target vibration signal identifier according to the current playing time and the vibration information table; the media service sends the target vibration signal identification to the motor drive service. Because the playing of the media file and the driving of the motor are controlled by the same timer, the running procedure is simple, the problem that the playing of the media file and the motor is not synchronous or vibration leakage occurs due to time errors caused by setting different timers can be avoided, and the synchronous playing of the media file and the motor vibration can be effectively realized.
Description
Technical Field
The present invention relates to the field of electronic devices, and in particular, to a method and an apparatus for controlling an output vibration signal, a computer device, and a storage medium.
Background
With the increasing progress of science and technology, consumer electronic products are more and more diversified, consumers can not meet the interaction with the electronic products only with vision and hearing, and the touch interaction fills up the demands of the consumers. When media are used for transmitting information in most interactive scenes, the tactile feedback with high matching degree with media files is added, so that novel and profound experience effects can be brought to users.
In the current electronic device, the media file and the motor vibration output are processed by different service programs, which causes the phenomenon that the media file and the motor vibration are not played synchronously. Two different service programs are synchronously processed, and because additional timers are needed for timing, the recorded time between the timers has certain time difference due to different reading time sequences, and the condition that the vibration leakage is caused because the difference value of time points is not in the range of a threshold value can be caused. In addition, setting an additional timer requires querying the time of the media timer and the time of the additional timer for multiple times, and the running procedure is relatively complicated.
Disclosure of Invention
The invention aims to provide a method, a device, computer equipment and a storage medium for controlling output vibration signals, which can realize synchronous playing of media files and motor vibration.
The embodiment of the invention provides a method for controlling an output vibration signal, which comprises the following steps:
the media service acquires a vibration information table, wherein the vibration information table records a plurality of vibration point information, and each vibration point information comprises vibration starting time and a vibration signal identifier;
the media service comprises a timer, the media service sends a playing instruction to a media driving service so that the media driving service can play a target media file conveniently, and the timer starts to time;
the media service obtains the current playing time of the target media file through the timer, and determines a target vibration signal identifier according to the current playing time and the vibration information table;
the media service sends the target vibration signal identification to a motor driving service so that the motor driving service drives a motor according to the target vibration signal identification.
An apparatus for controlling an output vibration signal, comprising:
the media service module is used for acquiring a vibration information table, wherein the vibration information table records a plurality of vibration point information, and each vibration point information comprises vibration starting time and a vibration signal identifier;
the media service module comprises a timing module, and is also used for sending a playing instruction to a media driving service so that the media driving service can play a target media file, and the timing module starts timing;
the media service module is further configured to obtain a current playing time of the target media file through the timing module, and determine a target vibration signal identifier according to the current playing time and the vibration information table;
the media service module is further configured to send the target vibration signal identifier to a motor driving service, so that the motor driving service drives a motor according to the target vibration signal identifier.
A computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of:
the media service acquires a vibration information table, wherein the vibration information table records a plurality of vibration point information, and each vibration point information comprises vibration starting time and a vibration signal identifier;
the media service comprises a timer, the media service sends a playing instruction to a media driving service so that the media driving service can play a target media file conveniently, and the timer starts to time;
the media service obtains the current playing time of the target media file through the timer, and determines a target vibration signal identifier according to the current playing time and the vibration information table;
the media service sends the target vibration signal identification to a motor driving service so that the motor driving service drives a motor according to the target vibration signal identification.
A computer-readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform the steps of:
the media service acquires a vibration information table, wherein the vibration information table records a plurality of vibration point information, and each vibration point information comprises vibration starting time and a vibration signal identifier;
the media service comprises a timer, the media service sends a playing instruction to a media driving service so that the media driving service can play a target media file conveniently, and the timer starts to time;
the media service obtains the current playing time of the target media file through the timer, and determines a target vibration signal identifier according to the current playing time and the vibration information table;
the media service sends the target vibration signal identification to a motor driving service so that the motor driving service drives a motor according to the target vibration signal identification.
The embodiment of the invention has the following beneficial effects:
according to the method, the device, the computer equipment and the storage device for controlling the output of the vibration signal, the vibration information table is obtained through the media service, the current playing time of the target media file is obtained according to the timer in the media service, the target vibration signal identification is determined according to the current playing time of the target file and the vibration information table, and the motor driving service drives the motor according to the target vibration signal identification. Because the playing of the media file and the driving of the motor are controlled based on the same timer, the media file and the motor can be synchronously played in a vibrating way according to the time of the timer read every time, the running procedure is simple, and the time error caused by setting two different timers can not occur, so that the problem that the playing of the media file and the motor is not synchronous or vibration leakage occurs due to the time error can be avoided, and the synchronous playing of the media file and the motor vibration can be effectively realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Wherein:
FIG. 1 is a diagram illustrating an exemplary embodiment of a method for controlling an output vibration signal;
FIG. 2 is a flow diagram of a method of controlling an output vibration signal in one embodiment;
FIG. 3 is a block diagram illustrating a process of determining a target vibration signal identifier according to the current playing time and the vibration information table in one embodiment;
FIG. 4 is a block diagram of a computer device in one embodiment.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
FIG. 1 is a diagram illustrating an exemplary embodiment of a method for controlling an output vibration signal. As shown in fig. 1, the method of controlling an output vibration signal is applied to a system for controlling an output vibration signal. The system for controlling the output of the vibration signal comprises a terminal 1, wherein the terminal 1 can be a desktop terminal or a mobile terminal, and the mobile terminal can be at least one of a mobile phone, a tablet computer, a notebook computer and the like. The terminal comprises a media service module 11, a media driving service module 12, a motor driving service module 13, a media playing terminal 14 and a motor playing terminal 15. The media service module 11 is used to control the synchronous playing of the media file and the motor vibration. The media driving service module 12 obtains the media playing instruction sent by the media service module 11, and drives the media file to be played at the media playing terminal 14 according to the media playing instruction. The motor driving service module 13 obtains the target vibration signal identifier sent by the media service module 11, and drives the motor playing terminal 15 to vibrate according to the target vibration signal identifier.
In one embodiment, as shown in FIG. 2, a method of controlling an output vibration signal is provided. The method can be applied to a terminal, a server and other devices for controlling and outputting the vibration signals. The present embodiment is exemplified by an apparatus applied to control an output vibration signal. And the media service module in the device for controlling the output of the vibration signal determines a target vibration signal identifier through the current playing time of the target media file and the vibration information table based on the same timer, and sends the target vibration signal identifier to the motor driving service, so that the motor driving service drives the motor according to the target vibration signal identifier, and the synchronous playing of the target media file and the motor vibration is realized. The method for controlling the output vibration signal specifically comprises the following steps:
step 102: the media service acquires a vibration information table, wherein the vibration information table records a plurality of vibration point information, and each vibration point information comprises a vibration starting time and a vibration signal identification.
The media service refers to a control module capable of playing media files and motor vibration synchronously, wherein the media files include but are not limited to audio files and video files.
Wherein the vibration information table refers to a vibration information configuration table including a plurality of vibration point information stored in advance in the media service. The vibration point information corresponds to the vibration information of each vibration of the motor one by one, and the vibration point information comprises vibration starting time and vibration signal identification.
The vibration signal identification is used for uniquely identifying one vibration signal. The vibration signal identifier may be the storage location information of the vibration signal, or a number corresponding to the storage location information of the vibration signal one to one, and may also be determined according to other unique characteristics of the vibration signal.
Step 104: the media service comprises a timer, the media service sends a playing instruction to the media driving service so that the media driving service can play the target media file conveniently, and the timer starts to time.
The media driving service is used for receiving the playing instruction sent by the media service and driving the corresponding media file to play according to the playing instruction.
The target media file refers to a media file which is required to be played by an operator in synchronization with the vibration of the motor.
The timer is a tool for recording the playing time of the medium.
And when the media service sends a playing instruction to the media driving service, starting timing by a timer, wherein the time recorded in the timer is the playing time of the target media file.
Step 106: and the media service obtains the current playing time of the target media file through the timer, and determines a target vibration signal identifier according to the current playing time and the vibration information table.
The current playing time of the target media file refers to the time of the target media file in the current playing progress, and can be obtained according to the time data recorded by the timer.
The target vibration signal identification is determined according to the current playing time and the vibration starting time of a plurality of vibration points in the vibration information table. And if the current playing time is not the same as or not similar to the vibration starting time of any vibration point in the vibration information table, the target vibration signal is marked to be empty, namely the target vibration signal does not contain any content. And if the target vibration signal identification is empty, the motor driving service does not drive the motor to vibrate after acquiring the target vibration signal identification, and waits for the media service to acquire the current playing time of the target media file again.
Step 108: the media service sends the target vibration signal identification to a motor driving service so that the motor driving service drives a motor according to the target vibration signal identification.
The motor driving service refers to a module for driving the motor to vibrate. The motor driving service receives a target vibration signal identifier sent by the media service, acquires a target vibration signal according to the target vibration signal identifier, and drives the motor to vibrate according to the target vibration signal.
The method for controlling the output of the vibration signal obtains the vibration information table through the media service, obtains the current playing time of the target media file according to a timer in the media service, determines the target vibration signal identification according to the current playing time of the target file and the vibration information table, and drives the motor according to the target vibration signal identification by the motor driving service. Because the playing of the media file and the driving of the motor are controlled based on the same timer, the media file and the motor can be synchronously played in a vibrating way according to the time of the timer read every time, the running procedure is simple, and the time error caused by setting two different timers can not occur, so that the problem that the playing of the media file and the motor is not synchronous or vibration leakage occurs due to the time error can be avoided, and the synchronous playing of the media file and the motor vibration can be effectively realized.
In one embodiment, the step 106 of obtaining the current playing time of the target media file through the timer includes:
step 106A: and acquiring a time reading instruction sent by the media drive service.
The time reading instruction is used for reading the timing time of the timer.
The media driving service communicates with the media service according to preset conditions, and in the communication process, the media driving service sends a time reading instruction to the media service to acquire the current playing time of the target media file. The preset condition may be a preset time period, for example, the media drive service 1s communicates with the media service once, and the media service 1s receives a time reading instruction sent by the media drive service once.
Step 106B: and acquiring the timing time of the timer according to the time reading instruction.
And the media service reads the current recording time of the timer according to the received time reading instruction, so that the timing time of the timer can be acquired.
Step 106C: and taking the timing time as the current playing time of the target media file.
And the media service reads the timing time of the timer at the moment according to the time reading instruction sent by the media drive service. Since the timer records the playing time of the target media file, the read timed time can be used as the playing time of the target media file.
In one embodiment, the obtaining the time reading instruction sent by the media drive service in step 106A includes: and acquiring a time reading instruction sent by the media drive service every preset time.
The media drive service sends a time reading instruction every other preset time, and correspondingly, the media drive service obtains the timing time of the timer according to the obtained time reading instruction every other preset time, so that the current playing time of the target media file can be obtained for the preset time according to the period.
In one embodiment, the step 106 of determining the target vibration signal identifier according to the current playing time and the vibration information table includes:
step 106 a: and comparing the current playing time with the vibration starting time of the plurality of vibration point information in the vibration information table to obtain target vibration point information.
The target vibration point information is determined according to the current playing time and the vibration starting time of the vibration point information in the vibration information table, if the current playing time is the same as or close to the vibration starting time of a certain vibration point information in the vibration information table, the vibration point information is the target vibration point information, and if the vibration starting time of any vibration point information in the vibration information table is different from or not close to the current playing time, the target vibration point information is a null point which does not contain the vibration information.
In one embodiment, step 106a includes:
step 106a 1: a time error range is obtained.
The time error range refers to a range within which the playing of the target media file and the playing of the motor vibration can be considered to be synchronously played.
The following factors are mainly considered for determining the time error range: and the distribution rule of the vibration starting time of the information of the plurality of vibration points in the vibration information table, the frequency of the current playing time and the time loss caused by information transmission between the media service and the media driving service and the motor driving service are obtained. If the vibration starting time distribution of the plurality of vibration point information in the vibration information table is dense, and the frequency of obtaining the current playing time is faster, the time error range is smaller, and the vibration signal identifier for obtaining the same vibration point information for multiple times is avoided being used as a target vibration identifier; if the vibration starting time distribution of the information of the plurality of vibration points in the vibration information table is dispersed and the frequency of the current playing time is acquired slowly, the time error range is set to be larger, and the phenomenon of vibration leakage is avoided. If the time loss caused by information transmission between the media service and the media drive service and the motor drive service is large, the time loss is considered when determining the time error range, and the method is favorable for improving the synchronism of the target media file and the motor vibration playing.
Step 106a 2: and obtaining a confidence interval corresponding to the current playing time according to the current playing time of the target media file and the time error range.
The confidence interval corresponding to the current playing time is that the time falling into the confidence interval can be considered to be the same as or similar to the current playing time. Illustratively, the current playing time is T, the time error range is ± T, and the confidence interval corresponding to the current playing time is (T-T, T + T).
Step 106a 3: and obtaining target vibration point information according to the confidence interval corresponding to the current playing time and the vibration starting time of the vibration point information in the vibration information table.
If the vibration starting time of certain vibration point information in the vibration information table falls into the confidence interval corresponding to the current playing time, the vibration point information is target vibration point information; and if the vibration starting time of any vibration point information in the vibration information table does not fall into the confidence interval corresponding to the current playing time, the target vibration point information is a null point which does not contain the vibration information.
Step 106 b: and taking the vibration signal identification of the target vibration point information as a target vibration signal identification.
If the target vibration point information is certain vibration point information, a vibration signal identifier contained in the vibration point information is used as a target vibration signal identifier; and if the target vibration point information is a null point which does not contain vibration information, marking the target vibration signal as null.
As shown in fig. 3, in an embodiment, the step 106 of determining the target vibration signal identifier according to the current playing time and the vibration information table includes:
the step of arranging according to the time sequence means that the plurality of vibration point information in the vibration information table are arranged according to the sequence of the vibration starting time in the vibration point information. Illustratively, the vibration information table includes three pieces of vibration point information, which are sequentially a (t1, SignalID1), B (t2, SignalID2), and C (t3, SignalID3), where SignalID refers to a vibration signal identifier, t1< t2< t3, and a plurality of pieces of vibration point information in the vibration information table are arranged in chronological order, that is, a (t1, SignalID1), B (t2, SignalID2), and C (t3, SignalID 3).
Step 1061: and comparing the current playing time with the vibration starting time of the first vibration point information in the vibration information table.
The vibration start time of the first vibration point information in the vibration information table is the earliest, and if the current playing time is less than the vibration start time of the vibration point, the current playing time is certainly less than the vibration start time of other vibration point information in the vibration information table. Comparing the current playing time with the vibration starting time of the first vibration point information in the vibration information table every time, namely comparing the current playing time with the vibration starting time of the vibration point information of which the first vibration signal identification in the vibration information table is not acquired by the motor driving service every time until the vibration signal identifications of all the vibration point information in the vibration information table are acquired by the motor driving service.
Step 1062: and if the comparison result is that the absolute value of the difference value between the current playing time and the vibration starting time of the first vibration point information is smaller than a preset value, taking the vibration signal identifier of the first vibration point information as the target vibration signal identifier.
Wherein the predetermined value is the same as the above-mentioned determining factor of the time error range.
An absolute value of a difference △ T between the current playing time T1 and the vibration starting time T2 of the first vibration point is smaller than a preset value, and then an error value between T1 and T2 is smaller than the preset value, T1 and T2 can be regarded as the same time, the vibration signal identifier of the first vibration point information is taken as the target vibration signal identifier, and the motor driving service drives the motor to vibrate according to the target vibration signal identifier and plays the target media file synchronously.
Step 1063: and deleting the first vibration point information in the vibration information table.
And when the vibration signal identification of the first vibration point information in the vibration information table is used as the target vibration signal identification, the motor driving service deletes the first vibration point information from the vibration information table and updates the vibration information table after driving the motor to vibrate according to the target vibration signal identification. In the updated vibration information table, the second-bit vibration point information originally arranged in the vibration information table before updating is arranged at the first bit, and when the media service acquires the current playing time of the target media file again, the media service determines the target vibration signal identifier according to the current playing time of the target media file and the first vibration point information in the updated vibration information table. Therefore, each media service can accurately determine the target vibration signal identifier according to the current playing time of the target media file and the first vibration point information in the current vibration information table, the current playing time is prevented from being compared with the vibration starting time of a plurality of vibration point information in the vibration information table, the running speed is improved, meanwhile, the time error caused by the internal reason of the system can be reduced, and the consistency of synchronous playing of the media file and motor vibration is improved.
In one embodiment, the method further comprises:
step 1064: and if the comparison result is that the absolute value of the difference value between the current playing time and the vibration starting time of the first vibration point information is greater than or equal to a preset value, entering a read waiting state to acquire the timing time of the timer when receiving a time reading instruction sent by the media driving service.
When the absolute value of the difference △ T between the current playing time T1 and the vibration starting time T2 of the first vibration point is greater than or equal to a preset value, the error value between T1 and T2 is greater than or equal to the preset value, and T1 and T2 cannot be regarded as the same time, at this time, the target vibration point information is an empty point which does not include a vibration signal identifier, the target vibration signal identifier is empty, and the motor driving service does not drive the motor to vibrate.
In one embodiment, there is provided an apparatus for controlling an output vibration signal, the apparatus including:
the media service module is used for acquiring a vibration information table, wherein the vibration information table records a plurality of vibration point information, and each vibration point information comprises vibration starting time and a vibration signal identifier;
the media service module comprises a timing module, and is also used for sending a playing instruction to a media driving service so that the media driving service can play a target media file, and the timing module starts timing;
the media service module is further configured to obtain a current playing time of the target media file through the timing module, and determine a target vibration signal identifier according to the current playing time and the vibration information table;
the media service module is further configured to send the target vibration signal identifier to a motor driving service, so that the motor driving service drives a motor according to the target vibration signal identifier.
The device for controlling the output of the vibration signal obtains the vibration information table through the media service, obtains the current playing time of the target media file according to the timer in the media service, determines the target vibration signal identification according to the current playing time of the target file and the vibration information table, and drives the motor according to the target vibration signal identification by the motor driving service. Because the playing of the media file and the driving of the motor are controlled based on the same timer, the media file and the motor can be synchronously played in a vibrating way according to the time of the timer read every time, the running procedure is simple, and the time error caused by setting two different timers can not occur, so that the problem that the playing of the media file and the motor is not synchronous or vibration leakage occurs due to the time error can be avoided, and the synchronous playing of the media file and the motor vibration can be effectively realized.
In one embodiment, the media service module is configured to obtain the current playing time of the target media file through the timing module, and includes: acquiring a time reading instruction sent by the media drive service; acquiring the timing time of a timer according to the time reading instruction; and taking the timing time as the current playing time of the target media file.
In one embodiment, the media service module is configured to obtain a time reading instruction sent by the media drive service, and includes: and acquiring a time reading instruction sent by the media drive service every preset time.
In one embodiment, the media service module is further configured to determine a target vibration signal identifier according to the current playing time and the vibration information table, including: comparing the current playing time with the vibration starting time of the plurality of vibration point information in the vibration information table to obtain target vibration point information; and taking the vibration signal identification of the target vibration point information as a target vibration signal identification.
In one embodiment, the media service module is configured to compare the current playing time with vibration starting times of a plurality of pieces of vibration point information in the vibration information table to obtain target vibration point information, and the method includes: acquiring a time error range; obtaining a confidence interval corresponding to the current playing time according to the current playing time of the target media file and the time error range; and obtaining target vibration point information according to the confidence interval corresponding to the current playing time and the vibration starting time of the vibration point information in the vibration information table.
In one embodiment, the plurality of vibration point information in the vibration information table are arranged according to a time sequence; the media service module is used for determining a target vibration signal identifier according to the current playing time and the vibration information table, and comprises: comparing the current playing time with the vibration starting time of the first vibration point information in the vibration information table; if the comparison result is that the absolute value of the difference value between the current playing time and the vibration starting time of the first vibration point information is smaller than a preset value, taking the vibration signal identifier of the first vibration point information as the target vibration signal identifier; and deleting the first vibration point information in the vibration information table.
In one embodiment, the media service module is configured to determine a target vibration signal identifier according to the current playing time and the vibration information table, and further includes: and if the comparison result is that the absolute value of the difference value between the current playing time and the vibration starting time of the first vibration point information is greater than or equal to a preset value, entering a read waiting state to acquire the timing time of the timer when receiving a time reading instruction sent by the media driving service.
FIG. 4 is a diagram illustrating an internal structure of a computer device in one embodiment. The computer device may be a terminal, a server, or a device for controlling output of the vibration signal. As shown in fig. 4, the computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program which, when executed by the processor, causes the processor to implement a method of controlling the output vibration signal. The internal memory may also have stored therein a computer program that, when executed by the processor, causes the processor to perform a method of controlling the output vibration signal. Those skilled in the art will appreciate that the architecture shown in fig. 4 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is proposed, comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of:
the media service acquires a vibration information table, wherein the vibration information table records a plurality of vibration point information, and each vibration point information comprises vibration starting time and a vibration signal identifier;
the media service comprises a timer, the media service sends a playing instruction to a media driving service so that the media driving service can play a target media file conveniently, and the timer starts to time;
the media service obtains the current playing time of the target media file through the timer, and determines a target vibration signal identifier according to the current playing time and the vibration information table;
the media service sends the target vibration signal identification to a motor driving service so that the motor driving service drives a motor according to the target vibration signal identification.
The computer equipment acquires the vibration information table through the media service, acquires the current playing time of the target media file according to a timer in the media service, determines a target vibration signal identifier according to the current playing time of the target file and the vibration information table, and drives the motor according to the target vibration signal identifier by the motor driving service. Because the playing of the media file and the driving of the motor are controlled based on the same timer, the media file and the motor can be synchronously played in a vibrating way according to the time of the timer read every time, the running procedure is simple, and the time error caused by setting two different timers can not occur, so that the problem that the playing of the media file and the motor is not synchronous or vibration leakage occurs due to the time error can be avoided, and the synchronous playing of the media file and the motor vibration can be effectively realized.
In one embodiment, the obtaining, by the timer, the current playing time of the target media file includes: acquiring a time reading instruction sent by the media drive service; acquiring the timing time of a timer according to the time reading instruction; and taking the timing time as the current playing time of the target media file.
In one embodiment, the obtaining the time reading instruction sent by the media drive service includes: and acquiring a time reading instruction sent by the media drive service every preset time.
In one embodiment, the determining a target vibration signal identifier according to the current playing time and the vibration information table includes: comparing the current playing time with the vibration starting time of the plurality of vibration point information in the vibration information table to obtain target vibration point information; and taking the vibration signal identification of the target vibration point information as a target vibration signal identification.
In an embodiment, the comparing the current playing time with the vibration starting time of the vibration point information in the vibration information table to obtain the target vibration point information includes: acquiring a time error range; obtaining a confidence interval corresponding to the current playing time according to the current playing time of the target media file and the time error range; and obtaining target vibration point information according to the confidence interval corresponding to the current playing time and the vibration starting time of the vibration point information in the vibration information table.
In one embodiment, the plurality of vibration point information in the vibration information table are arranged according to a time sequence; the determining a target vibration signal identifier according to the current playing time and the vibration information table includes: comparing the current playing time with the vibration starting time of the first vibration point information in the vibration information table; if the comparison result is that the absolute value of the difference value between the current playing time and the vibration starting time of the first vibration point information is smaller than a preset value, taking the vibration signal identifier of the first vibration point information as the target vibration signal identifier; and deleting the first vibration point information in the vibration information table.
In an embodiment, if the comparison result is that the absolute value of the difference between the current playing time and the vibration starting time of the first vibration point information is greater than or equal to a preset value, the apparatus enters a read waiting state to obtain the timing time of the timer when receiving a time reading instruction sent by the media drive service.
In one embodiment, a computer-readable storage medium is proposed, in which a computer program is stored which, when executed by a processor, causes the processor to carry out the steps of:
the media service acquires a vibration information table, wherein the vibration information table records a plurality of vibration point information, and each vibration point information comprises vibration starting time and a vibration signal identifier;
the media service comprises a timer, the media service sends a playing instruction to a media driving service so that the media driving service can play a target media file conveniently, and the timer starts to time;
the media service obtains the current playing time of the target media file through the timer, and determines a target vibration signal identifier according to the current playing time and the vibration information table;
the media service sends the target vibration signal identification to a motor driving service so that the motor driving service drives a motor according to the target vibration signal identification.
The computer readable storage device obtains the vibration information table through the media service, obtains the current playing time of the target media file according to a timer in the media service, determines the target vibration signal identifier according to the current playing time of the target file and the vibration information table, and drives the motor according to the target vibration signal identifier by the motor driving service. Because the playing of the media file and the driving of the motor are controlled based on the same timer, the media file and the motor can be synchronously played in a vibrating way according to the time of the timer read every time, the running procedure is simple, and the time error caused by setting two different timers can not occur, so that the problem that the playing of the media file and the motor is not synchronous or vibration leakage occurs due to the time error can be avoided, and the synchronous playing of the media file and the motor vibration can be effectively realized.
In one embodiment, the obtaining, by the timer, the current playing time of the target media file includes: acquiring a time reading instruction sent by the media drive service; acquiring the timing time of a timer according to the time reading instruction; and taking the timing time as the current playing time of the target media file.
In one embodiment, the obtaining the time reading instruction sent by the media drive service includes: and acquiring a time reading instruction sent by the media drive service every preset time.
In one embodiment, the determining a target vibration signal identifier according to the current playing time and the vibration information table includes: comparing the current playing time with the vibration starting time of the plurality of vibration point information in the vibration information table to obtain target vibration point information; and taking the vibration signal identification of the target vibration point information as a target vibration signal identification.
In an embodiment, the comparing the current playing time with the vibration starting time of the vibration point information in the vibration information table to obtain the target vibration point information includes: acquiring a time error range; obtaining a confidence interval corresponding to the current playing time according to the current playing time of the target media file and the time error range; and obtaining target vibration point information according to the confidence interval corresponding to the current playing time and the vibration starting time of the vibration point information in the vibration information table.
In one embodiment, the plurality of vibration point information in the vibration information table are arranged according to a time sequence; the determining a target vibration signal identifier according to the current playing time and the vibration information table includes: comparing the current playing time with the vibration starting time of the first vibration point information in the vibration information table; if the comparison result is that the absolute value of the difference value between the current playing time and the vibration starting time of the first vibration point information is smaller than a preset value, taking the vibration signal identifier of the first vibration point information as the target vibration signal identifier; and deleting the first vibration point information in the vibration information table.
In an embodiment, if the comparison result is that the absolute value of the difference between the current playing time and the vibration starting time of the first vibration point information is greater than or equal to a preset value, the apparatus enters a read waiting state to obtain the timing time of the timer when receiving a time reading instruction sent by the media drive service.
It should be noted that the method for controlling output of a vibration signal, the apparatus for controlling output of a vibration signal, the computer device and the computer readable storage medium described above belong to a general inventive concept, and the contents of the embodiments of the method for controlling output of a vibration signal, the apparatus for controlling output of a vibration signal, the computer device and the computer readable storage medium may be mutually applicable.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (10)
1. A method of controlling an output vibration signal, comprising:
the media service acquires a vibration information table, wherein the vibration information table records a plurality of vibration point information, and each vibration point information comprises vibration starting time and a vibration signal identifier;
the media service comprises a timer, the media service sends a playing instruction to a media driving service so that the media driving service can play a target media file conveniently, and the timer starts to time;
the media service obtains the current playing time of the target media file through the timer, and determines a target vibration signal identifier according to the current playing time and the vibration information table;
the media service sends the target vibration signal identification to a motor driving service so that the motor driving service drives a motor according to the target vibration signal identification.
2. The method of claim 1, wherein obtaining, by the timer, a current playing time of the target media file comprises:
acquiring a time reading instruction sent by the media drive service;
acquiring the timing time of a timer according to the time reading instruction;
and taking the timing time as the current playing time of the target media file.
3. The method of claim 2, wherein the obtaining the time reading instruction sent by the media drive service comprises:
and acquiring a time reading instruction sent by the media drive service every preset time.
4. The method of claim 1, wherein determining a target vibration signal identifier according to the current playing time and the vibration information table comprises:
comparing the current playing time with the vibration starting time of the plurality of vibration point information in the vibration information table to obtain target vibration point information;
and taking the vibration signal identification of the target vibration point information as a target vibration signal identification.
5. The method according to claim 4, wherein the comparing the current playing time with the vibration starting time of the plurality of vibration point information in the vibration information table to obtain the target vibration point information comprises:
acquiring a time error range;
obtaining a confidence interval corresponding to the current playing time according to the current playing time of the target media file and the time error range;
and obtaining target vibration point information according to the confidence interval corresponding to the current playing time and the vibration starting time of the vibration point information in the vibration information table.
6. The method according to claim 1, wherein the plurality of vibration point information in the vibration information table are arranged in chronological order; the determining a target vibration signal identifier according to the current playing time and the vibration information table includes:
comparing the current playing time with the vibration starting time of the first vibration point information in the vibration information table;
if the comparison result is that the absolute value of the difference value between the current playing time and the vibration starting time of the first vibration point information is smaller than a preset value, taking the vibration signal identifier of the first vibration point information as the target vibration signal identifier;
and deleting the first vibration point information in the vibration information table.
7. The method of claim 6, further comprising:
and if the comparison result is that the absolute value of the difference value between the current playing time and the vibration starting time of the first vibration point information is greater than or equal to a preset value, entering a read waiting state to acquire the timing time of the timer when receiving a time reading instruction sent by the media driving service.
8. An apparatus for controlling an output vibration signal, comprising:
the media service module is used for acquiring a vibration information table, wherein the vibration information table records a plurality of vibration point information, and each vibration point information comprises vibration starting time and a vibration signal identifier;
the media service module comprises a timing module, and is also used for sending a playing instruction to a media driving service so that the media driving service can play a target media file, and the timing module starts timing;
the media service module is further configured to obtain a current playing time of the target media file through the timing module, and determine a target vibration signal identifier according to the current playing time and the vibration information table;
the media service module is further configured to send the target vibration signal identifier to a motor driving service, so that the motor driving service drives a motor according to the target vibration signal identifier.
9. A computer-readable storage medium, storing a computer program which, when executed by a processor, causes the processor to carry out the steps of the method of controlling an output vibration signal according to any one of claims 1 to 7.
10. A computer device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to carry out the steps of the method of controlling an output vibration signal according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911302000.6A CN111158470B (en) | 2019-12-17 | 2019-12-17 | Method, apparatus, computer device and storage medium for controlling output vibration signal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911302000.6A CN111158470B (en) | 2019-12-17 | 2019-12-17 | Method, apparatus, computer device and storage medium for controlling output vibration signal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111158470A true CN111158470A (en) | 2020-05-15 |
CN111158470B CN111158470B (en) | 2024-02-23 |
Family
ID=70557564
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911302000.6A Active CN111158470B (en) | 2019-12-17 | 2019-12-17 | Method, apparatus, computer device and storage medium for controlling output vibration signal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111158470B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114339353A (en) * | 2021-12-31 | 2022-04-12 | 晶晨半导体科技(北京)有限公司 | Audio and video synchronization method and device, electronic equipment and computer readable storage medium |
CN115703007A (en) * | 2021-08-12 | 2023-02-17 | 荣耀终端有限公司 | Vibration output method and related device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017101523A1 (en) * | 2015-12-15 | 2017-06-22 | 乐视控股(北京)有限公司 | Method and apparatus for controlling wearable device |
CN107613356A (en) * | 2017-08-30 | 2018-01-19 | 瑞声科技(新加坡)有限公司 | Media and vibrations synchronous broadcast method and device, electronic equipment and storage medium |
US20190222886A1 (en) * | 2018-01-12 | 2019-07-18 | AAC Technologies Pte. Ltd. | Method and apparatus for synchronously playing media and vibration |
-
2019
- 2019-12-17 CN CN201911302000.6A patent/CN111158470B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017101523A1 (en) * | 2015-12-15 | 2017-06-22 | 乐视控股(北京)有限公司 | Method and apparatus for controlling wearable device |
CN107613356A (en) * | 2017-08-30 | 2018-01-19 | 瑞声科技(新加坡)有限公司 | Media and vibrations synchronous broadcast method and device, electronic equipment and storage medium |
US20190222886A1 (en) * | 2018-01-12 | 2019-07-18 | AAC Technologies Pte. Ltd. | Method and apparatus for synchronously playing media and vibration |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115703007A (en) * | 2021-08-12 | 2023-02-17 | 荣耀终端有限公司 | Vibration output method and related device |
CN115703007B (en) * | 2021-08-12 | 2024-04-12 | 荣耀终端有限公司 | Vibration output method and related device |
CN114339353A (en) * | 2021-12-31 | 2022-04-12 | 晶晨半导体科技(北京)有限公司 | Audio and video synchronization method and device, electronic equipment and computer readable storage medium |
CN114339353B (en) * | 2021-12-31 | 2023-09-29 | 晶晨半导体科技(北京)有限公司 | Audio/video synchronization method and device, electronic equipment and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111158470B (en) | 2024-02-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9055193B2 (en) | System and method of a remote conference | |
CN110149518B (en) | Method, system, device, equipment and storage medium for processing media data | |
CN111158470A (en) | Method and apparatus for controlling output vibration signal, computer device and storage medium | |
CN110113655B (en) | Video playing method and device and user terminal | |
CN107527186B (en) | Electronic reading management method and device and terminal equipment | |
CN101873355A (en) | Method, device and system for downloading file | |
EP3300355B1 (en) | Program recording method and device, and set top box | |
CN110830823A (en) | Play progress correction method and device, electronic equipment and readable storage medium | |
CN105208318A (en) | Video conference content processing method and device | |
CN108449607B (en) | File compliance checking method and system | |
CN110290396B (en) | Video processing method, device, system, equipment and storage medium | |
CN108174227B (en) | Virtual article display method and device and storage medium | |
CN110830832A (en) | Audio playing parameter configuration method of mobile terminal and related equipment | |
CN113672748A (en) | Multimedia information playing method and device | |
CN110418158B (en) | Live broadcast room service configuration method and device, electronic equipment and storage medium | |
CN110784524A (en) | Cloud mobile phone file uploading keep-alive method, device and system | |
CN108108294B (en) | Method and system for acquiring customized operation data according to reference time | |
CN111147226B (en) | Data storage method, device and storage medium | |
CN109587517B (en) | Multimedia file playing method and device, server and storage medium | |
CN110502574B (en) | Cross-system information synchronization method, user equipment, storage medium and device | |
CN111698281A (en) | Resource downloading method and device, electronic equipment and storage medium | |
CN108174245B (en) | Method and system for presenting dynamic content based on video data | |
CN112533007B (en) | Network live broadcast method, system, terminal device and storage medium | |
US11004472B2 (en) | Method and device of playing video, and computing device | |
WO2021119993A1 (en) | Method and apparatus for controlling output of vibration signal, computer device, and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |