CN111813368A - System, method, equipment and storage medium for simulating sounding of sounding device - Google Patents
System, method, equipment and storage medium for simulating sounding of sounding device Download PDFInfo
- Publication number
- CN111813368A CN111813368A CN202010731170.2A CN202010731170A CN111813368A CN 111813368 A CN111813368 A CN 111813368A CN 202010731170 A CN202010731170 A CN 202010731170A CN 111813368 A CN111813368 A CN 111813368A
- Authority
- CN
- China
- Prior art keywords
- sounding
- simulating
- audio file
- cpu
- trigger instruction
- 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
Links
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/16—Sound input; Sound output
- G06F3/165—Management of the audio stream, e.g. setting of volume, audio stream path
-
- 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/16—Sound input; Sound output
-
- G—PHYSICS
- G08—SIGNALLING
- G08B—SIGNALLING OR CALLING SYSTEMS; ORDER TELEGRAPHS; ALARM SYSTEMS
- G08B3/00—Audible signalling systems; Audible personal calling systems
- G08B3/10—Audible signalling systems; Audible personal calling systems using electric transmission; using electromagnetic transmission
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- General Health & Medical Sciences (AREA)
- Human Computer Interaction (AREA)
- General Engineering & Computer Science (AREA)
- Electromagnetism (AREA)
- Multimedia (AREA)
- Telephone Function (AREA)
Abstract
The invention discloses a system, a method, equipment and a storage medium for simulating sounding of a sounding device, wherein the system comprises an MCU, a CPU and a loudspeaker which are connected in sequence; the MCU is used for sending a GPIO signal to the CPU when receiving a trigger instruction, wherein the trigger instruction is generated when the trigger element meets a preset condition; and after receiving the GPIO signal, the CPU controls the loudspeaker to play a target audio file, wherein the target audio file is an imported audio file used for simulating the sounding of a sounding device. According to the system, the method, the equipment and the storage medium for simulating the sounding of the sounding device, provided by the invention, the sounding of the sounding device such as a buzzer can be simulated by controlling the loudspeaker to play the specific audio file, and the sounding device such as the buzzer is directly replaced, so that the investment of hardware is reduced, the manufacturing cost is saved, and the size design difficulty of the equipment is reduced due to the fact that the occupied space is reduced.
Description
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a system, a method, equipment and a storage medium for simulating sounding of a sounding device.
Background
With the development of electronic technology and mobile internet technology, electronic devices (such as mobile phones, tablet computers, Pos machines, security devices, and the like) with Android (Android) intelligent operating systems are becoming more and more popular, and are widely used in various fields of work and life.
Most of the existing electronic devices are provided with alarm schemes so as to achieve the purpose of protecting the personal safety or privacy safety of users when the users need the alarm schemes. For example, when a user encounters an emergency such as robbery by a bady or file signing under duress, or when a bady wants to disassemble or crack a mobile phone to steal user information after the user's electronic equipment is robbed, or when other emergency occurs, the user's electronic equipment may spontaneously ring to the outside under the control of the user or when a certain trigger condition is met.
At present, the conventional alarm scheme is implemented by using an MCU (micro controller Unit, micro control Unit, or referred to as a single chip microcomputer) to control a buzzer through an electric signal, as shown in fig. 1, warning sound emitted by the buzzer can remind surrounding people. However, for the electronic device, since the conventional alarm scheme needs to be implemented by additionally configuring a buzzer, not only the manufacturing cost is increased, but also the problem that the sound size cannot be changed at will exists. In addition, the size of the buzzer is generally large, and when the buzzer is applied to electronic equipment, the design of the equipment needs to reserve an installation space for the buzzer, so that the size of the equipment is increased, which is contrary to the current trend of light and thin, and great design difficulty is brought to manufacturers.
Disclosure of Invention
The invention provides a system, a method, equipment and a storage medium for simulating sounding of a sounding device, which aim to overcome the defects in the prior art.
In order to achieve the above purpose, the present invention provides the following technical solutions:
in a first aspect, an embodiment of the present invention provides a system for simulating sounding of a sounding device, where the system includes an MCU, a CPU, and a speaker, which are connected in sequence;
the MCU is used for sending a GPIO signal to the CPU when receiving a trigger instruction, wherein the trigger instruction is generated when the trigger element meets a preset condition;
and after receiving the GPIO signal, the CPU controls the loudspeaker to play a target audio file, wherein the target audio file is an imported audio file used for simulating the sounding of a sounding device.
Further, the system for simulating the sounding device to sound also comprises an importing module, wherein the importing module is used for:
and when the MCU is used for receiving a trigger instruction and before sending a GPIO signal to the CPU, importing the target audio file.
Further, in the system for simulating sounding of a sounding device, the CPU is configured to:
after receiving the GPIO signal, creating an audio manager;
and calling an audio static library and a sound card driver through the audio manager to control a loudspeaker to play the target audio file.
Furthermore, in the system for simulating the sounding of the sounding device, the trigger element is a sensor and/or a key;
the sensor is used for generating the trigger instruction and sending the trigger instruction to the MCU when detecting that the electronic equipment is illegally cracked or illegally disassembled;
and the key is used for generating the trigger instruction and sending the trigger instruction to the MCU when being pressed.
In a second aspect, an embodiment of the present invention provides a method for simulating a sounding device to sound, which is performed by using the system for simulating a sounding device to sound according to any embodiment of the present invention, and the method includes:
the MCU sends a GPIO signal to the CPU when receiving a trigger instruction, wherein the trigger instruction is generated when a trigger element meets a preset condition;
and after receiving the GPIO signal, the CPU controls the loudspeaker to play a target audio file, wherein the target audio file is an imported audio file used for simulating the sounding of a sounding device.
Further, in the method for simulating the sounding of the sounding device, the system for simulating the sounding of the sounding device further includes an importing module, and before the step of sending a GPIO signal to the CPU when the MCU receives a trigger instruction, the method further includes:
the importing module imports the target audio file;
and generating the target audio file through a Python script.
Further, in the method for simulating the sound production of the sound production device, after receiving the GPIO signal, the step of controlling the speaker to play the target audio file by the CPU includes:
after receiving the GPIO signal, the CPU creates an audio manager;
and the CPU calls an audio static library and a sound card driver through the audio manager to control a loudspeaker to play the target audio file.
Further, if the triggering element is a sensor and/or a key, the method further includes:
when the sensor detects that the electronic equipment is illegally cracked or illegally disassembled, the sensor generates the trigger instruction and sends the trigger instruction to the MCU;
and/or the presence of a gas in the gas,
and when the key is pressed down, the triggering instruction is generated and sent to the MCU.
In a third aspect, an embodiment of the present invention provides an electronic device, including a device body, where a speaker is disposed on the device body, and a memory and a processor composed of an MCU and a CPU are disposed in the device body;
the memory stores a computer program, and the processor implements the method for simulating the sounding device according to any one of the embodiments of the present invention when executing the computer program.
In a fourth aspect, embodiments of the present invention provide a storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the method for simulating the sounding of a sounding device according to any of the embodiments of the present invention.
According to the system, the method, the equipment and the storage medium for simulating the sounding of the sounding device, provided by the embodiment of the invention, the sounding of the sounding device such as a buzzer can be simulated by controlling the loudspeaker to play the specific audio file, and the sounding device such as the buzzer is directly replaced, so that the investment of hardware is reduced, the manufacturing cost is saved, and the size design difficulty of the equipment is reduced due to the fact that the occupied space is reduced.
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, and 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 these drawings without inventive exercise.
Fig. 1 is a block diagram of a buzzer sound system in the prior art;
fig. 2 is a schematic structural diagram of a system for simulating sounding of a sounding device according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an audio playing process according to the present invention;
FIG. 4 is a schematic flow chart illustrating a method for simulating the sounding of a sounding device according to an embodiment of the present invention;
FIG. 5 is a schematic flow chart illustrating a method for simulating the sounding of a sounding device according to an embodiment of the present invention;
FIG. 6 is a schematic flow chart illustrating a method for simulating the sounding of a sounding device according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Referring to fig. 2, a schematic structural diagram of a system for simulating sound production of a sound production device according to an embodiment of the present invention is shown. The system comprises an MCU41, a CPU42 and a loudspeaker 43 which are connected in sequence;
the MCU41 is used for sending GPIO signals to the CPU42 when receiving a trigger instruction, wherein the trigger instruction is generated when a trigger element meets a preset condition;
after receiving the GPIO signal, the CPU42 controls the speaker 43 to play a target audio file, where the target audio file is an audio file that has been imported and is used to simulate a sound production device to produce sound.
It should be noted that the MCU41 refers to a single chip microcomputer, which properly reduces the frequency and specification of the cpu, and integrates the memory, the counter, the USB, the peripheral interface, and even the LCD driver circuit on a single chip to form a chip-level computer, which is a common component of the Android device and is used for different applications. In this embodiment, the MCU41 will send corresponding signals to other hardware units, such as a buzzer in a conventional alarm scheme and the CPU42 in this embodiment.
The CPU42(Central processing unit) refers to a Central processing unit and is also a common component of the Android device. The CPU42 may send a work instruction to the speaker 43 after receiving the GPIO signal sent by the MCU41, so as to control the speaker 43 to play the audio file of the analog sound device according to the work instruction, thereby achieving the same alarm effect as the conventional alarm scheme.
In this embodiment, the target audio file is generated by a Python script. Specifically, the tool is generated by a tool which is written in Python language and can generate an audio file similar to a buzzer for calling, and various frequency bands, tones and the like of sounding sound can be modified through the tool, so that the effect of customer customization is achieved.
Preferably, the system further comprises an import module, the import module being configured to:
when the MCU41 is used for receiving a trigger instruction, before sending a GPIO signal to the CPU42, the target audio file is imported.
In this embodiment, the CPU42 is specifically configured to perform the following operations:
after receiving the GPIO signal, creating an audio manager;
an audio static library and a sound card driver are invoked by the audio manager to control the speaker 43 to play the target audio file.
It should be noted that, in the design process, it is found that some problems may exist if the simulated sound is played according to a conventional audio playing process in the Android system.
Specifically, a conventional audio playing process in the Android system plays an audio file through an Android playing application. In the whole process, as shown in fig. 3, in the software framework, the Audio manager (AudioManager) is used to distribute tasks, start the service (Audio flag) of the Audio system, and is responsible for the management of the input and output stream devices and the processing and transmission of Audio stream data, and directly use the Audio hardware abstraction layer (ALSA HAL) to call the Audio static library (ALSA lib) and the sound card driver (Codec driver) that are strongly related to the Audio, so that the Speaker (Speaker) can sound.
However, in the conventional audio playing process, the Android device may have different audio playing applications, and if the device has only one speaker, and different audio is played simultaneously, the Android system mechanism only allows one audio to be played because of being limited to only one audio channel. If the audio file for simulating the buzzer is played in the conventional audio flow, the interference of other audio playing applications may be received, and the real-time alarm effect cannot be completely achieved. In addition, in the conventional audio playing process, a certain playing delay, which may be only a delay within 1-2 seconds, exists due to the fact that many upper-layer developments and task allocations are performed, but for the alarm, no matter how small the delay is, a certain influence is caused, and the user may miss the optimal distress time, so that the audio playing scheme is optimized in the embodiment.
Specifically, as shown in fig. 3, the flow of the improved scheme is that after the CPU42 receives a GPIO signal from the MCU41, a code file developed through the language c of beeper.c is built into the entire Android code, and in this code file, an audio manager and an audio system service similar to a conventional playing flow are created or defined, and in this way, an audio static library and a sound card driver that are strongly related to audio can be directly called, so that the speaker 43 can sound, delay of upper layer command time can be saved, and an alarm can be quickly responded; meanwhile, the method is carried out on a code level, so that the method is not influenced by an Android system, and the Android command and abnormal influence cannot influence the implementation of an alarm scheme, so that the safety is greatly improved.
Preferably, in the system for simulating the sounding of the sounding device, the triggering element is a sensor and/or a key;
the sensor is used for generating the trigger instruction and sending the trigger instruction to the MCU41 when detecting that the electronic equipment is illegally cracked or illegally disassembled;
the key is used for generating the trigger instruction when being pressed down and sending the trigger instruction to the MCU 41.
In this embodiment, the condition that the triggering element satisfies the predetermined condition means that the sensor detects that the electronic device is illegally cracked or illegally disassembled, or the key is pressed.
It should be noted that the trigger instruction can notify the MCU41 that GPIO signal output is required. Specifically, in this embodiment, the sensor is arranged in such a way that when the electronic device is cracked by a password or the housing is illegally disassembled, the sensor can timely detect and send a trigger instruction, and once the MCU41 receives the trigger instruction, it determines that a GPIO signal needs to be sent, so that the CPU42 starts to control the speaker 43 to perform analog sound emission, or a special single key or combination key is arranged in such a way that when the special single key or combination key is pressed, a trigger instruction can be generated and sent to the MCU41, and at this time, the MCU41 also sends a GPIO signal, so that the CPU42 controls the speaker 43 to perform analog sound emission.
According to the system for simulating the sounding of the sounding device, provided by the embodiment of the invention, the sounding of the sounding device such as a buzzer can be simulated by controlling the loudspeaker to play the specific audio file, and the sounding device such as the buzzer is directly replaced, so that the investment of hardware is reduced, the manufacturing cost is saved, and the size design difficulty of equipment is reduced due to the fact that the occupied space is reduced.
Example two
Referring to fig. 4, a flow chart of a method for simulating sound production of a sound production device according to a second embodiment of the present invention is shown, where the method is suitable for a scenario where an electronic device with a speaker simulates sound production of a sound production device, such as a buzzer, and the method is executed by the system for simulating sound production of a sound production device according to the second embodiment of the present invention. The method specifically comprises the following steps:
s101, when receiving a trigger instruction, the MCU sends a GPIO signal to the CPU, wherein the trigger instruction is generated when a trigger element meets a preset condition.
The GPIO signal is transmitted through a GPIO port, and the GPIO (General Purpose Input Output) is called an IO port for short, can be used as an Input port and an Output port, and is controlled by software.
Preferably, the triggering element is a sensor and/or a key, and before the step S101, the method further includes the steps of:
when the sensor detects that the electronic equipment is illegally cracked or illegally disassembled, the sensor generates the trigger instruction and sends the trigger instruction to the MCU;
and/or the presence of a gas in the gas,
and when the key is pressed down, the triggering instruction is generated and sent to the MCU.
S102, after receiving the GPIO signal, the CPU controls the loudspeaker to play a target audio file, wherein the target audio file is an imported audio file used for simulating a sound production device to produce sound.
According to the method for simulating the sounding device to sound provided by the embodiment of the invention, the sounding device such as a buzzer can be simulated to sound by controlling the loudspeaker to play the specific audio file, and the sounding device such as the buzzer is directly replaced, so that the investment of hardware is reduced, the manufacturing cost is saved, and the size design difficulty of the equipment is reduced due to the fact that the occupied space is reduced.
EXAMPLE III
As shown in fig. 5, the method for simulating a sound production of a sound production device according to the third embodiment of the present invention is based on the technical solution provided in the first embodiment, and further optimizes step S102 "after the CPU receives the GPIO signal, the CPU controls the speaker to play a target audio file, where the target audio file is an audio file that has been imported and is used for simulating a sound production of a sound production device. Explanations of the same or corresponding terms as those of the above embodiments are omitted. Namely:
based on the above optimization, as shown in fig. 5, the method for simulating the sounding device provided in this embodiment may include the following steps:
s201, when receiving a trigger instruction, the MCU sends a GPIO signal to the CPU, wherein the trigger instruction is generated when a trigger element meets a preset condition.
S202, after receiving the GPIO signal, the CPU creates an audio manager.
S203, the CPU calls an audio static library and a sound card driver through the audio manager to control a loudspeaker to play the target audio file, wherein the target audio file is an imported audio file used for simulating the sounding of a sounding device.
In the embodiment, the playing control of the loudspeaker is performed on a code level, and the loudspeaker does not need to be subjected to upper-layer development and task allocation, so that the influence of an Android system is avoided, no matter the Android music is played or the Android system is broken down, the influence is avoided, and the safety is greatly improved.
According to the method for simulating the sounding device to sound provided by the embodiment of the invention, the sounding device such as a buzzer can be simulated to sound by controlling the loudspeaker to play the specific audio file, and the sounding device such as the buzzer is directly replaced, so that the investment of hardware is reduced, the manufacturing cost is saved, and the size design difficulty of the equipment is reduced due to the fact that the occupied space is reduced.
Example four
Fig. 6 is a schematic flow chart of a method for simulating sounding of a sounding device according to a fourth embodiment of the present invention, which is optimized before step S101 based on the first embodiment. The system for simulating the sounding of the sounding device further comprises an importing module. The same or corresponding terms as those in the above embodiments are not repeated herein, and specifically, referring to fig. 6, the method includes:
s301, the importing module imports the target audio file.
Since the audio file is created by the Python development tool and then imported into the device, when it is necessary to modify customized effects such as a frequency band and a tone, another audio file needs to be created and then imported.
S302, when receiving a trigger instruction, the MCU sends a GPIO signal to the CPU, wherein the trigger instruction is generated when the trigger element meets a preset condition.
And S303, after receiving the GPIO signal, the CPU controls the loudspeaker to play a target audio file, wherein the target audio file is an imported audio file used for simulating a sound production device to produce sound.
According to the method for simulating the sounding device to sound provided by the embodiment of the invention, the sounding device such as a buzzer can be simulated to sound by controlling the loudspeaker to play the specific audio file, and the sounding device such as the buzzer is directly replaced, so that the investment of hardware is reduced, the manufacturing cost is saved, and the size design difficulty of the equipment is reduced due to the fact that the occupied space is reduced.
EXAMPLE five
Fig. 7 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention. FIG. 7 illustrates a block diagram of an exemplary electronic device 512 that is suitable for use in implementing embodiments of the present invention. The electronic device 512 shown in fig. 7 is only an example and should not bring any limitations to the function and the scope of use of the embodiments of the present invention.
As shown in fig. 7, the electronic device 512 is in the form of a general purpose computing device. Components of the electronic device 512 may include, but are not limited to: a device body, a speaker disposed on the device body, one or more processors or processing units 516 (comprised of MCU and CPU) disposed within the device body, a system memory 528, and a bus 518 connecting the various system components (including the system memory 528 and the processing unit 516).
The system memory 528 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)530 and/or cache memory 532. The electronic device 512 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 534 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 7, and commonly referred to as a "hard drive"). Although not shown in FIG. 7, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 518 through one or more data media interfaces. Memory 528 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 540 having a set (at least one) of program modules 542, including but not limited to an operating system, one or more application programs, other program modules, and program data, may be stored in, for example, the memory 528, each of which examples or some combination may include an implementation of a network environment. The program modules 542 generally perform the functions and/or methods of the described embodiments of the invention.
The electronic device 512 may also communicate with one or more external devices 514 (e.g., keyboard, pointing device, display 524, etc.), with one or more devices that enable a user to interact with the electronic device 512, and/or with any devices (e.g., network card, modem, etc.) that enable the electronic device 512 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 522. Also, the electronic device 512 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 520. As shown, the network adapter 520 communicates with the other modules of the electronic device 512 via the bus 518. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 512, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 516 executes programs stored in the system memory 528 to execute various functional applications and data processing, such as implementing the method for simulating the sounding device provided by the embodiment of the present invention. The electronic device is typically an intelligent terminal, such as a mobile phone, a computer, etc.
EXAMPLE six
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform the method for simulating the sounding of a sounding device according to any of the embodiments of the present invention.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The above embodiments are merely to illustrate the technical solutions of the present invention, and not to limit the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (10)
1. A system for simulating sounding of a sounding device is characterized by comprising an MCU, a CPU and a loudspeaker which are sequentially connected;
the MCU is used for sending a GPIO signal to the CPU when receiving a trigger instruction, wherein the trigger instruction is generated when the trigger element meets a preset condition;
and after receiving the GPIO signal, the CPU controls the loudspeaker to play a target audio file, wherein the target audio file is an imported audio file used for simulating the sounding of a sounding device.
2. The system for simulating sounding of a device according to claim 1, further comprising an import module for:
and when the MCU is used for receiving a trigger instruction and before sending a GPIO signal to the CPU, importing the target audio file.
3. The system for simulating sounding device sounding as claimed in claim 1, wherein the CPU is configured to:
after receiving the GPIO signal, creating an audio manager;
and calling an audio static library and a sound card driver through the audio manager to control a loudspeaker to play the target audio file.
4. The system for simulating sounding of a sound producing device according to claim 1, wherein the triggering element is a sensor and/or a key;
the sensor is used for generating the trigger instruction and sending the trigger instruction to the MCU when detecting that the electronic equipment is illegally cracked or illegally disassembled;
and the key is used for generating the trigger instruction and sending the trigger instruction to the MCU when being pressed.
5. A method for simulating sounding of a sounding device, which is performed by the system for simulating sounding of a sounding device according to any one of claims 1-4, the method comprising:
the MCU sends a GPIO signal to the CPU when receiving a trigger instruction, wherein the trigger instruction is generated when a trigger element meets a preset condition;
and after receiving the GPIO signal, the CPU controls the loudspeaker to play a target audio file, wherein the target audio file is an imported audio file used for simulating the sounding of a sounding device.
6. The method for simulating the sounding of a sounding device according to claim 5, wherein the system for simulating the sounding of a sounding device further comprises a lead-in module, and before the step of sending a GPIO signal to the CPU when the MCU is used for receiving a trigger instruction, the method further comprises:
the importing module imports the target audio file;
and generating the target audio file through a Python script.
7. The method for simulating the sounding of a sound generating device according to claim 5, wherein the step of controlling the speaker to play the target audio file after the CPU receives the GPIO signal comprises:
after receiving the GPIO signal, the CPU creates an audio manager;
and the CPU calls an audio static library and a sound card driver through the audio manager to control a loudspeaker to play the target audio file.
8. The method of simulating sound production from a sound producing device of claim 5, wherein the triggering element is a sensor and/or a key, the method further comprising:
when the sensor detects that the electronic equipment is illegally cracked or illegally disassembled, the sensor generates the trigger instruction and sends the trigger instruction to the MCU;
and/or the presence of a gas in the gas,
and when the key is pressed down, the triggering instruction is generated and sent to the MCU.
9. An electronic device comprises a device body and is characterized in that a loudspeaker is arranged on the device body, and a memory and a processor composed of an MCU and a CPU are arranged in the device body;
the memory stores a computer program, and the processor implements the method for simulating the sounding device according to any one of claims 5-8 when executing the computer program.
10. A storage medium having stored thereon a computer program which, when executed by a processor, implements a method of simulating the sounding of a device according to any one of claims 5-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010731170.2A CN111813368A (en) | 2020-07-27 | 2020-07-27 | System, method, equipment and storage medium for simulating sounding of sounding device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010731170.2A CN111813368A (en) | 2020-07-27 | 2020-07-27 | System, method, equipment and storage medium for simulating sounding of sounding device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111813368A true CN111813368A (en) | 2020-10-23 |
Family
ID=72861322
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010731170.2A Pending CN111813368A (en) | 2020-07-27 | 2020-07-27 | System, method, equipment and storage medium for simulating sounding of sounding device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111813368A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6400804B1 (en) * | 1998-12-10 | 2002-06-04 | At&T Corp. | On-hold activity selection apparatus and method |
CN1832025A (en) * | 2006-04-11 | 2006-09-13 | 北京金山软件有限公司 | Audio playing method and system in game of mobile phone |
CN107415690A (en) * | 2017-04-25 | 2017-12-01 | 黑龙江连特科技有限公司 | Automobile, automobile instrument and its control method |
CN109144464A (en) * | 2018-08-27 | 2019-01-04 | 歌尔科技有限公司 | A kind of method, apparatus and Android device of audio output |
CN110816399A (en) * | 2018-08-14 | 2020-02-21 | 深圳市路畅科技股份有限公司 | Method, device and system for simulating automobile engine to sound |
-
2020
- 2020-07-27 CN CN202010731170.2A patent/CN111813368A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6400804B1 (en) * | 1998-12-10 | 2002-06-04 | At&T Corp. | On-hold activity selection apparatus and method |
CN1832025A (en) * | 2006-04-11 | 2006-09-13 | 北京金山软件有限公司 | Audio playing method and system in game of mobile phone |
CN107415690A (en) * | 2017-04-25 | 2017-12-01 | 黑龙江连特科技有限公司 | Automobile, automobile instrument and its control method |
CN110816399A (en) * | 2018-08-14 | 2020-02-21 | 深圳市路畅科技股份有限公司 | Method, device and system for simulating automobile engine to sound |
CN109144464A (en) * | 2018-08-27 | 2019-01-04 | 歌尔科技有限公司 | A kind of method, apparatus and Android device of audio output |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108133707B (en) | Content sharing method and system | |
US20220053068A1 (en) | Methods, apparatuses and computer storage media for applet state synchronization | |
CN101930789A (en) | The environment for use audio analysis comes the control audio player | |
JP6906584B2 (en) | Methods and equipment for waking up devices | |
CN108984234B (en) | Calling prompt method for mobile terminal and camera device | |
WO2020125134A1 (en) | Customized model tamper-proof method and apparatus, terminal device and storage medium | |
US9766852B2 (en) | Non-audio notification of audible events | |
US10302763B2 (en) | Method for detecting proximity of object and electronic device using the same | |
WO2019179068A1 (en) | Risk detection method and device, and mobile terminal and storage medium | |
CN113127050A (en) | Application resource packaging process monitoring method, device, equipment and medium | |
CN111768759A (en) | Method and apparatus for generating information | |
WO2022068694A1 (en) | Electronic device and wake-up method thereof | |
CN104115413A (en) | Method and apparatus for outputting content in portable terminal supporting secure execution environment | |
CN113220262A (en) | Multi-application audio data distribution method and terminal equipment | |
CN111813368A (en) | System, method, equipment and storage medium for simulating sounding of sounding device | |
WO2018156364A1 (en) | Validating human input devices when connected to a computer | |
CN111273967A (en) | Remote hook setting method and device suitable for Android system and electronic equipment | |
CN102098607A (en) | Apparatus and method for increasing volumn in portable terminal | |
CN109246281B (en) | Incoming call answering method, system, server and storage medium | |
CN112783569A (en) | Cloud computer system based on cloud computing | |
CN110750408B (en) | Method, device and apparatus for controlling USB debug mode switch, and storage medium | |
CN111443983B (en) | Application program virtualization method and device, electronic equipment and storage medium | |
CN109241787B (en) | Call detection method and device for image input device and computer readable storage medium | |
CN110197660A (en) | A kind of the voice confirmation method and system of system authorization | |
CN113972989A (en) | Data verification method and device, storage medium and electronic equipment |
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 |