CN108089837A - Microphone switching method, device, equipment and storage medium - Google Patents
Microphone switching method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN108089837A CN108089837A CN201810008992.0A CN201810008992A CN108089837A CN 108089837 A CN108089837 A CN 108089837A CN 201810008992 A CN201810008992 A CN 201810008992A CN 108089837 A CN108089837 A CN 108089837A
- Authority
- CN
- China
- Prior art keywords
- key
- button
- press event
- microphone
- event
- 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 26
- 238000012544 monitoring process Methods 0.000 claims abstract description 6
- 239000003550 marker Substances 0.000 claims description 43
- 238000004590 computer program Methods 0.000 claims description 4
- 238000011084 recovery Methods 0.000 claims description 3
- 238000004364 calculation method Methods 0.000 claims 1
- 238000004891 communication Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 238000012545 processing Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 4
- 230000005291 magnetic effect Effects 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 241000209140 Triticum Species 0.000 description 2
- 235000021307 Triticum Nutrition 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
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/162—Interface to dedicated audio devices, e.g. audio drivers, interface to CODECs
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11B—INFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
- G11B20/00—Signal processing not specific to the method of recording or reproducing; Circuits therefor
- G11B20/10—Digital recording or reproducing
- G11B20/10527—Audio or video recording; Data buffering arrangements
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11B—INFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
- G11B20/00—Signal processing not specific to the method of recording or reproducing; Circuits therefor
- G11B20/10—Digital recording or reproducing
- G11B20/10527—Audio or video recording; Data buffering arrangements
- G11B2020/10537—Audio or video recording
- G11B2020/10546—Audio or video recording specifically adapted for audio data
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Audiology, Speech & Language Pathology (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Signal Processing (AREA)
- Telephone Function (AREA)
- Details Of Audible-Bandwidth Transducers (AREA)
Abstract
The invention discloses a microphone switching method, a microphone switching device, microphone switching equipment and a storage medium. The method comprises the following steps: monitoring the callback of a key event for controlling a target key of a microphone through a pre-registered event monitor; when a callback of a key event of a target key is received, analyzing key code information in the callback; judging whether a target key corresponding to the key event is a voice key or not according to the key code information; if the target key corresponding to the key event is a voice key, switching of the microphones is controlled according to the type of the key event.
Description
Technical field
The present invention relates to a kind of terminal technology more particularly to a kind of switching method of microphone, device, equipment and storage to be situated between
Matter.
Background technology
How further strengthen for terminal device intelligent requirements with the quick popularization and user of terminal device
Make terminal device more intelligent, and more close to the use habit of real-life, oneself is through becoming our task of top priority institutes
It solves the problems, such as, producers many at this stage is also paying more effort to promote user experience.
Terminal device all generally uses the microphone of 2 or 2 or more at present, thus how to realize multiple microphones it
Between switch to for current urgent problem to be solved.
The content of the invention
The embodiment of the present invention provides a kind of switching method of microphone, device, equipment and storage medium, can realize multiple
Switching between microphone promotes user experience.
In a first aspect, an embodiment of the present invention provides a kind of switching method of microphone, including:
By pre-registered event sniffer monitor for control microphone target button key-press event readjustment;
When receiving the readjustment of key-press event of target button, the key code information in the readjustment is parsed;
Judge whether the corresponding target button of the key-press event is voice button according to the key code information;
If the corresponding target button of the key-press event is voice button, according to the Type Control wheat of the key-press event
The switching of gram wind.
Further, the type of the key-press event is press event or return event;
If correspondingly, the corresponding target button of the key-press event is voice button, according to the class of the key-press event
The switching of type control microphone includes:
If the corresponding target button of the key-press event is voice button, when the type of the key-press event is pressing thing
During part, the connective marker of the target button is write in configuration file;
When the type of the key-press event is return event, recover initial connective marker in the configuration file;
The corresponding target microphone of the key-press event is initialized according to the connective marker.
Further, after the corresponding target microphone according to the connective marker initialization key-press event,
It further includes:
Recording is carried out by the microphone of the initialization and obtains voice data.
Further, judge whether the corresponding target button of the key-press event is voice button according to the key code information
Before, further include:
Establish the data list on target button and the correspondence of key code information;
Correspondingly, judge whether the corresponding target button of the key-press event is voice button bag according to the key code information
It includes:
The button class of the corresponding target button of the key-press event is determined according to the key code information and the data list
Type;
If the key code information is identical with the corresponding key code information of voice button in the data list, it is determined that described to press
The push-button type of the corresponding target button of key events is voice button.
Second aspect, the embodiment of the present invention additionally provide a kind of switching device of microphone, which includes:
Module is monitored, for controlling pressing for the target button of microphone by the monitoring of pre-registered event sniffer
The readjustment of key events;
Parsing module, for when receiving the readjustment of key-press event of target button, parsing the key code in the readjustment
Information;
Judgment module, for judging whether the corresponding target button of the key-press event is voice according to the key code information
Button;
Handover module, if being voice button for the corresponding target button of the key-press event, according to the button thing
The switching of the Type Control microphone of part.
Further, the type of the key-press event is press event or return event;
Correspondingly, the handover module includes:
Writing unit is marked, if being voice button for the corresponding target button of the key-press event, when the button
When the type of event is press event, the connective marker of the target button is write in configuration file;
Mark recovery unit, for when the type of the key-press event be return event when, it is extensive in the configuration file
Multiple initial connective marker;
Initialization unit, for initializing the corresponding target microphone of the key-press event according to the connective marker.
Further, further include:
Recording module, for initializing the corresponding target microphone of the key-press event according to the connective marker described
Afterwards, recording is carried out by the microphone of the initialization and obtains voice data.
Further, further include:
Module is established in list, for whether judging the corresponding target button of the key-press event according to the key code information
Before voice button, the data list of the correspondence on target button and key code information is established;
Correspondingly, the judgment module is specifically used for:
The button class of the corresponding target button of the key-press event is determined according to the key code information and the data list
Type;
If the key code information is identical with the corresponding key code information of voice button in the data list, it is determined that described to press
The push-button type of the corresponding target button of key events is voice button.
The third aspect, the embodiment of the present invention additionally provide a kind of computer equipment, including memory, processor and are stored in
On memory and the computer program that can run on a processor, the processor are realized when performing described program as the present invention is real
Apply the switching method of any microphone in example.
Fourth aspect, the embodiment of the present invention additionally provide a kind of computer readable storage medium, are stored thereon with computer
Program realizes the switching method of the microphone as described in any in the embodiment of the present invention when program is executed by processor.
The embodiment of the present invention is monitored to control pressing for the target button of microphone by pre-registered event sniffer
The readjustment of key events;When receiving the readjustment of key-press event of target button, the key code information in parsing readjustment;According to key code
Information judges whether the corresponding target button of key-press event is voice button;If the corresponding target button of key-press event is pressed for voice
Key then according to the switching of the Type Control microphone of key-press event, can realize the switching between multiple microphones, promote user
Experience.
Description of the drawings
Fig. 1 is a kind of flow chart of the switching method of microphone in the embodiment of the present invention one;
Fig. 2 is a kind of flow chart of the switching method of microphone in the embodiment of the present invention two;
Fig. 3 is a kind of structure diagram of the switching device of microphone in the embodiment of the present invention three;
Fig. 4 is a kind of structure diagram of computer equipment in the embodiment of the present invention four.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining the present invention rather than limitation of the invention.It also should be noted that in order to just
Part related to the present invention rather than entire infrastructure are illustrated only in description, attached drawing.
Embodiment one
Fig. 1 is a kind of flow chart of the switching method of microphone in the embodiment of the present invention one, and the present embodiment is applicable to
The situation of the switching of microphone, this method can be performed by the switching device of the microphone in the embodiment of the present invention, the device
The mode that software and/or hardware can be used is realized, as shown in Figure 1, this method specifically comprises the following steps:
S110 monitors to control the key-press event of the target button of microphone by pre-registered event sniffer
Readjustment.
Wherein, the microphone is the external microphone wind of terminal device, such as can be the Mike on blue Tooth remote controller
Wind.
Wherein, the target button is for controlling the button of microphone, such as can be the control on blue Tooth remote controller
The button of microphone.
Specifically, it is noted by AIDL (Android Interface Definition Language, Interface Definition Language)
Volume monitor, for controlling the target button application of microphone, when there is key-press event generation, is adjusted back for monitoring.
S120, when receiving the readjustment of key-press event of target button, the key code information in parsing readjustment.
Wherein, the readjustment of key-press event includes KeyEvent, and KeyEvent is the object of key-press event, wherein containing tactile
The details of hair event, such as time of the state of event, the type of event, event generation etc..When user pushes button,
Event can be packaged into KeyEvent objects automatically and be used for application program by system.
Wherein, key code information keyCode, keyCode are the key assignments being pressed i.e. key code, each button in cell phone keyboard
Have its individual key code, application program is all which key just to know that user presses by key code is.
Specifically, when receiving KeyEvent readjustments, the keyCode in KeyEvent is parsed.
S130 judges whether the corresponding target button of key-press event is voice button according to key code information, if so, performing
S140。
Wherein, the voice button is for controlling the button of microphone location, such as can be, if user presses voice
Button is then recorded by the corresponding microphone of the voice button.
Specifically, determine whether the corresponding button of key code in readjustment is that the mode of voice button can be with according to key code information
For corresponding with the voice button in the database pre-established the key code of the key code of the target button in key code information is carried out
Match somebody with somebody, if there is the key code identical with the key code of target button in database, it is determined that target button is voice button.
Optionally, according to the key code information judge the corresponding target button of the key-press event whether be voice button it
Before, it further includes:
Establish the data list on target button and the correspondence of key code information;
Wherein, the target button includes at least voice button, can also include other buttons.Such as can include, stop
Only button, mute button etc..
Specifically, establishing the data list on target button and the correspondence of key code, such as can stop key
Corresponding key code is 179, the corresponding key code of mute button is 173, the corresponding key code of voice button is 174 etc..
Correspondingly, judge whether the corresponding target button of the key-press event is voice button bag according to the key code information
It includes:
The button class of the corresponding target button of the key-press event is determined according to the key code information and the data list
Type;
Specifically, the key code of target button is matched with the key code in data list, the button of target button is determined
Type.
If the key code information is identical with the corresponding key code information of voice button in the data list, it is determined that described to press
The push-button type of the corresponding target button of key events is voice button.
Specifically, if the key code of target button is identical with the corresponding key code of voice button in data list, it is determined that mesh
Mark button is voice button.
S140, according to the switching of the Type Control microphone of key-press event.
Wherein, the type of the key-press event includes:Press event and return event.
Wherein, if the mode of the switching of microphone is the readjustment for the key-press event for receiving target button, and mesh is parsed
Mark button is voice button, and the type of key-press event is press event, then is recorded by the corresponding microphone of target button.
Specifically, if target button is voice button, illustrate that user's needs start recording, then pressing voice in user presses
The microphone for pressing key control during key by voice starts to record, and terminates to record when user stops pressing operation.
The technical solution of the present embodiment monitors that the target of microphone is controlled to press by pre-registered event sniffer
The readjustment of the key-press event of key;When receiving the readjustment of key-press event of target button, the key code information in parsing readjustment;Root
Judge whether the corresponding target button of key-press event is voice button according to key code information;If the corresponding target button of key-press event is
Voice button then according to the switching of the Type Control microphone of key-press event, can realize the switching between multiple microphones, carry
Rise user experience.
Embodiment two
Fig. 2 is a kind of flow chart of the switching method of microphone in the embodiment of the present invention two, and the present embodiment is with above-mentioned reality
It applies and optimizes based on example one, in the present embodiment, the type of the key-press event is press event or return event;Phase
It answers, if the corresponding target button of the key-press event is voice button, according to the Type Control Mike of the key-press event
The switching of wind includes:If the corresponding target button of the key-press event is voice button, when the type of the key-press event is
During press event, the connective marker of the target button is write in configuration file;When the type of the key-press event is return
During event, recover initial connective marker in the configuration file;The key-press event is initialized according to the connective marker
Corresponding target microphone.
As shown in Fig. 2, the method for the present embodiment specifically comprises the following steps:
S210 monitors to control the key-press event of the target button of microphone by pre-registered event sniffer
Readjustment.
S220, when receiving the readjustment of key-press event of target button, the key code information in parsing readjustment.
S230 judges whether the corresponding target button of key-press event is voice button according to key code information, if so, performing
S240。
S240 when the type of key-press event is press event, writes the connective marker of target button in configuration file.
Wherein, after definite target button is voice button, judge the type of key-press event, judge the mode of push-button type
To determine the type of key-press event according to the readjustment of key-press event.
Wherein, the connective marker of the target button can be that key-press event is recorded in configuration file, or
A certain mark is stored in configuration file, represents the type of key-press event as press event, the present embodiment is not limited this.
Specifically, when being press event according to the type of the definite key-press event of readjustment of key-press event, in configuration file
The connective marker of target button is write, such as can be, when the type for determining key-press event is press event, in configuration file
The connective marker 1 of middle write-in target button, to replace initial connective marker 0.
S250 when the type of key-press event is return event, recovers initial connective marker in configuration file.
Wherein, the return event lifts the event of generation for user after pressing keys.
Wherein, the mode for recovering initial connective marker is that initial connective marker is replaced to current connective marker.
Specifically, when the type of key-press event is return event, recover initial connective marker, example in configuration file
Such as can be that, when the type of key-press event is return event, the current connective marker 1 in configuration file reverts to initial
Connective marker 0.
S260 initializes the corresponding target microphone of key-press event according to connective marker.
Specifically, if connective marker is not initial connective marker, the corresponding target microphone of key-press event is initialized.
In a specific example, terminal device is there are two microphone, and a microphone is built-in microphone, a wheat
Gram wind is the microphone on blue Tooth remote controller, and the corresponding microphone of target button is the microphone on blue Tooth remote controller, and is configured
Initial connective marker in file is 0, and when the type for determining key-press event is press event, mesh is write in configuration file
The connective marker 1 of button is marked, if connective marker is 1, it is determined that the corresponding microphone of initialized target button;If connective marker is
0, it is determined that initialization built-in microphone.
Optionally, after the corresponding target microphone according to the connective marker initialization key-press event, also
Including:
Recording is carried out by the microphone of the initialization and obtains voice data.
Wherein, the voice data is the voice that microphone obtains.
Specifically, obtain voice data from the microphone of recording.
In a specific example, the mode for first passing through AIDL registers monitor, the key-press event readjustment of monitoring system.
When receiving KeyEvent readjustments, keyCode is parsed, judges whether to press the code of voice button.When pressing voice
Button and when be Down events, passes through the set methods of SystemProperties, writes a system property.It is receiving
When to Up events, recover the value of the system property again by the set methods of SystemProperties.Upper layer application opens
When dynamic recording/recognizer, it will create AudioRecord and initialized.System bottom at this time
Which microphone attribute according to setting is determined to initialize and recorded by AudioManager.Finally data are returned to
Upper layer application.For the application programs of all calling microphones, the switch logic of microphone need not be all paid close attention to, it is only necessary to normal
Go to record by AudioRecord, you can take data from correct microphone.
In another specific example, current household digital interaction platform has 2 microphones, a built-in Mike
Wind, one is the microphone on blue Tooth remote controller.When the microphone button of blue Tooth remote controller is pressed, bottom is cut by this programme
Microphone is changed, starts Audio, when obtaining the voice data recorded or carrying out speech recognition to voice data, then may be used
Voice data is obtained from correct equipment.
The technical solution of the present embodiment monitors that the target of microphone is controlled to press by pre-registered event sniffer
The readjustment of the key-press event of key;When receiving the readjustment of key-press event of target button, the key code information in parsing readjustment;Root
Judge whether the corresponding target button of key-press event is voice button according to key code information;If the corresponding target button of key-press event is
Voice button then according to the switching of the Type Control microphone of key-press event, can realize the switching between multiple microphones, carry
Rise user experience.
Embodiment three
Fig. 3 is a kind of structure diagram of the switching device of microphone in the embodiment of the present invention three.The present embodiment can fit
For the situation of the switching of microphone, which can be used software and/or the mode of hardware is realized, which can be integrated in any
In the equipment for providing the handoff functionality of microphone, as shown in figure 3, the switching device of the microphone specifically includes:Monitor module
310th, parsing module 320, judgment module 330 and handover module 340.
Wherein, module 310 is monitored, for monitoring to control the target of microphone by pre-registered event sniffer
The readjustment of the key-press event of button;
Parsing module 320, for when receiving the readjustment of key-press event of target button, parsing the key in the readjustment
Code information;
Judgment module 330, for according to the key code information judge the corresponding target button of the key-press event whether be
Voice button;
Handover module 340, if being voice button for the corresponding target button of the key-press event, according to the button
The switching of the Type Control microphone of event.
Optionally, the type of the key-press event is press event or return event;
Correspondingly, the handover module includes:
Writing unit is marked, if being voice button for the corresponding target button of the key-press event, when the button
When the type of event is press event, the connective marker of the target button is write in configuration file;
Mark recovery unit, for when the type of the key-press event be return event when, it is extensive in the configuration file
Multiple initial connective marker;
Initialization unit, for initializing the corresponding target microphone of the key-press event according to the connective marker.
Optionally, further include:
Recording module, for initializing the corresponding target microphone of the key-press event according to the connective marker described
Afterwards, recording is carried out by the microphone of the initialization and obtains voice data.
Optionally, further include:
Module is established in list, for whether judging the corresponding target button of the key-press event according to the key code information
Before voice button, the data list of the correspondence on target button and key code information is established;
Correspondingly, the judgment module is specifically used for:
The button class of the corresponding target button of the key-press event is determined according to the key code information and the data list
Type;
If the key code information is identical with the corresponding key code information of voice button in the data list, it is determined that described to press
The push-button type of the corresponding target button of key events is voice button.
The technical solution of the present embodiment monitors that the target of microphone is controlled to press by pre-registered event sniffer
The readjustment of the key-press event of key;When receiving the readjustment of key-press event of target button, the key code information in parsing readjustment;Root
Judge whether the corresponding target button of key-press event is voice button according to key code information;If the corresponding target button of key-press event is
Voice button then according to the switching of the Type Control microphone of key-press event, can realize the switching between multiple microphones, carry
Rise user experience.
Example IV
Fig. 4 is a kind of structure diagram of computer equipment in the embodiment of the present invention four.Fig. 4 shows to be used for real
The block diagram of the exemplary computer device 12 of existing embodiment of the present invention.The computer equipment 12 that Fig. 4 is shown is only one and shows
Example, should not bring any restrictions to the function and use scope of the embodiment of the present invention.
As shown in figure 4, computer equipment 12 is showed in the form of universal computing device.The component of computer equipment 12 can be with
Including but not limited to:One or more processor or processing unit 16, system storage 28 connect different system component
The bus 18 of (including system storage 28 and processing unit 16).
Bus 18 represents the one or more in a few class bus structures, including memory bus or Memory Controller,
Peripheral bus, graphics acceleration port, processor or the local bus using the arbitrary bus structures in a variety of bus structures.It lifts
For example, these architectures include but not limited to industry standard architecture (ISA) bus, microchannel architecture (MAC)
Bus, enhanced isa bus, Video Electronics Standards Association (VESA) local bus and peripheral component interconnection (PCI) bus.
Computer equipment 12 typically comprises various computing systems readable medium.These media can be it is any can be by
The usable medium that computer equipment 12 accesses, including volatile and non-volatile medium, moveable and immovable medium.
System storage 28 can include the computer system readable media of form of volatile memory, such as arbitrary access
Memory (RAM) 30 and/or cache memory 32.Computer equipment 12 may further include it is other it is removable/can not
Mobile, volatile/non-volatile computer system storage medium.Only as an example, storage system 34 can be used for read-write not
Movably, non-volatile magnetic media (Fig. 4 is not shown, is commonly referred to as " hard disk drive ").Although not shown in Fig. 4, can with
It provides for moving the disc driver of non-volatile magnetic disk (such as " floppy disk ") read-write and to removable non-volatile
The CD drive of CD (such as CD-ROM, DVD-ROM or other optical mediums) read-write.In these cases, each driving
Device can be connected by one or more data media interfaces with bus 18.Memory 28 can include at least one program and produce
Product, the program product have one group of (for example, at least one) program module, these program modules are configured to perform of the invention each
The function of embodiment.
Program/utility 40 with one group of (at least one) program module 42 can be stored in such as memory 28
In, such program module 42 includes --- but being not limited to --- operating system, one or more application program, other programs
Module and program data may include the realization of network environment in each or certain combination in these examples.Program mould
Block 42 usually performs function and/or method in embodiment described in the invention.
Computer equipment 12 can also be with one or more external equipments 14 (such as keyboard, sensing equipment, display 24
Deng) communication, the equipment interacted with the computer equipment 12 communication can be also enabled a user to one or more and/or with making
Obtain any equipment that the computer equipment 12 can communicate with one or more of the other computing device (such as network interface card, modulatedemodulate
Adjust device etc.) communication.This communication can be carried out by input/output (I/O) interface 22.In addition, the calculating in the present embodiment
Machine equipment 12, display 24 exist not as independent individual, but in embedded minute surface, it is not aobvious in the display surface of display 24
When showing, the display surface of display 24 visually combines together with minute surface.Also, computer equipment 12 can also be fitted by network
Orchestration 20 and one or more network (such as LAN (LAN), wide area network (WAN) and/or public network, such as internet)
Communication.As shown in the figure, network adapter 20 is communicated by bus 18 with other modules of computer equipment 12.It should be understood that the greatest extent
Pipe is not shown in figure, and can be combined computer equipment 12 and be used other hardware and/or software module, include but not limited to:Micro- generation
Code, device driver, redundant processing unit, external disk drive array, RAID system, tape drive and data backup are deposited
Storage system etc..
Processing unit 16 is stored in program in system storage 28 by operation, so as to perform various functions application and
Data processing, such as realize the switching method for the microphone that the embodiment of the present invention is provided:Pass through pre-registered action listener
Device is monitored to control the readjustment of the key-press event of the target button of microphone;When returning for the key-press event for receiving target button
Timing parses the key code information in the readjustment;The corresponding target button of the key-press event is judged according to the key code information
Whether it is voice button;If the corresponding target button of the key-press event is voice button, according to the class of the key-press event
Type controls the switching of microphone.
Embodiment five
The embodiment of the present invention five provides a kind of computer readable storage medium, is stored thereon with computer program, the journey
The switching method of the microphone provided such as all inventive embodiments of the application is provided when sequence is executed by processor:By registered in advance
Event sniffer monitor for control microphone target button key-press event readjustment;When receive target button by
During the readjustment of key events, the key code information in the readjustment is parsed;Judge that the key-press event corresponds to according to the key code information
Target button whether be voice button;If the corresponding target button of the key-press event is voice button, pressed according to
The switching of the Type Control microphone of key events.
Any combination of one or more computer-readable media may be employed.Computer-readable medium can be calculated
Machine readable signal medium or computer readable storage medium.Computer readable storage medium for example can be --- but it is unlimited
In --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device or it is arbitrary more than combination.It calculates
The more specific example (non exhaustive list) of machine readable storage medium storing program for executing includes:Electrical connection with one or more conducting wires, just
It takes formula computer disk, hard disk, random access memory (RAM), read-only memory (ROM), erasable type and may be programmed read-only storage
Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device,
Or above-mentioned any appropriate combination.In this document, computer readable storage medium can any include or store journey
The tangible medium of sequence, the program can be commanded the either device use or in connection of execution system, device.
Computer-readable signal media can include in a base band or as carrier wave a part propagation data-signal,
Wherein carry computer-readable program code.Diversified forms may be employed in the data-signal of this propagation, including --- but
It is not limited to --- electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be
Any computer-readable medium beyond computer readable storage medium, which can send, propagate or
Transmission for by instruction execution system, device either device use or program in connection.
The program code included on computer-readable medium can be transmitted with any appropriate medium, including --- but it is unlimited
In --- wireless, electric wire, optical cable, RF etc. or above-mentioned any appropriate combination.
It can write to perform the computer that operates of the present invention with one or more programming languages or its combination
Program code, described program design language include object oriented program language-such as Java, Smalltalk, C++,
Further include conventional procedural programming language-such as " C " language or similar programming language.Program code can be with
It fully performs, partly perform on the user computer on the user computer, the software package independent as one performs, portion
Divide and partly perform or perform on a remote computer or server completely on the remote computer on the user computer.
Be related in the situation of remote computer, remote computer can pass through the network of any kind --- including LAN (LAN) or
Wide area network (WAN)-be connected to subscriber computer or, it may be connected to outer computer (such as is carried using Internet service
Pass through Internet connection for business).
Note that it above are only presently preferred embodiments of the present invention and institute's application technology principle.It will be appreciated by those skilled in the art that
The invention is not restricted to specific embodiment described here, can carry out for a person skilled in the art various apparent variations,
It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out by above example to the present invention
It is described in further detail, but the present invention is not limited only to above example, without departing from the inventive concept, also
It can include other more equivalent embodiments, and the scope of the present invention is determined by scope of the appended claims.
Claims (10)
1. a kind of switching method of microphone, which is characterized in that including:
By pre-registered event sniffer monitor for control microphone target button key-press event readjustment;
When receiving the readjustment of key-press event of target button, the key code information in the readjustment is parsed;
Judge whether the corresponding target button of the key-press event is voice button according to the key code information;
If the corresponding target button of the key-press event is voice button, according to the Type Control microphone of the key-press event
Switching.
2. switching method according to claim 1, which is characterized in that the type of the key-press event for press event or
Return event;
If correspondingly, the corresponding target button of the key-press event is voice button, according to the type control of the key-press event
The switching of microphone processed includes:
If the corresponding target button of the key-press event is voice button, when the type of the key-press event is press event
When, the connective marker of the target button is write in configuration file;
When the type of the key-press event is return event, recover initial connective marker in the configuration file;
The corresponding target microphone of the key-press event is initialized according to the connective marker.
3. switching method according to claim 2, which is characterized in that described to be pressed according to connective marker initialization
After the corresponding target microphone of key events, further include:
Recording is carried out by the microphone of the initialization and obtains voice data.
4. switching method according to claim 1, which is characterized in that the key-press event is judged according to the key code information
Before whether corresponding target button is voice button, further include:
Establish the data list on target button and the correspondence of key code information;
Correspondingly, judge whether the corresponding target button of the key-press event is that voice button includes according to the key code information:
The push-button type of the corresponding target button of the key-press event is determined according to the key code information and the data list;
If the key code information is identical with the corresponding key code information of voice button in the data list, it is determined that the button thing
The push-button type of the corresponding target button of part is voice button.
5. a kind of switching device of microphone, which is characterized in that including:
Module is monitored, for monitoring to control the button thing of the target button of microphone by pre-registered event sniffer
The readjustment of part;
Parsing module, for when receiving the readjustment of key-press event of target button, parsing the key code information in the readjustment;
Judgment module, for according to the key code information judge the corresponding target button of the key-press event whether be voice by
Key;
Handover module, if being voice button for the corresponding target button of the key-press event, according to the key-press event
The switching of Type Control microphone.
6. switching device according to claim 5, which is characterized in that the type of the key-press event for press event or
Return event;
Correspondingly, the handover module includes:
Writing unit is marked, if being voice button for the corresponding target button of the key-press event, when the key-press event
Type when being press event, the connective marker of the target button is write in configuration file;
Recovery unit is marked, for when the type of the key-press event is return event, recovering just in the configuration file
The connective marker of beginning;
Initialization unit, for initializing the corresponding target microphone of the key-press event according to the connective marker.
7. switching device according to claim 6, which is characterized in that further include:
Recording module, for it is described according to the connective marker initialize the corresponding target microphone of the key-press event it
Afterwards, recording is carried out by the microphone of the initialization and obtains voice data.
8. switching device according to claim 5, which is characterized in that further include:
Module is established in list, for judging whether the corresponding target button of the key-press event is language according to the key code information
Before tone keys, the data list of the correspondence on target button and key code information is established;
Correspondingly, the judgment module is specifically used for:
The push-button type of the corresponding target button of the key-press event is determined according to the key code information and the data list;
If the key code information is identical with the corresponding key code information of voice button in the data list, it is determined that the button thing
The push-button type of the corresponding target button of part is voice button.
9. a kind of computer equipment including memory, processor and stores the meter that can be run on a memory and on a processor
Calculation machine program, which is characterized in that the processor realizes the side as described in any in claim 1-4 when performing described program
Method.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is by processor
The method as described in any in claim 1-4 is realized during execution.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810008992.0A CN108089837B (en) | 2018-01-04 | 2018-01-04 | Microphone switching method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810008992.0A CN108089837B (en) | 2018-01-04 | 2018-01-04 | Microphone switching method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108089837A true CN108089837A (en) | 2018-05-29 |
CN108089837B CN108089837B (en) | 2021-05-11 |
Family
ID=62181536
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810008992.0A Active CN108089837B (en) | 2018-01-04 | 2018-01-04 | Microphone switching method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108089837B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112667488A (en) * | 2020-12-29 | 2021-04-16 | 深圳市慧为智能科技股份有限公司 | Key processing method, device, equipment and computer readable storage medium |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101021747A (en) * | 2007-03-07 | 2007-08-22 | 赵俊峰 | Keyboard with mouse function |
CN101159939A (en) * | 2007-11-08 | 2008-04-09 | 中兴通讯股份有限公司 | Method of performing input mode selection on mobile terminal |
CN102510468A (en) * | 2011-11-23 | 2012-06-20 | 中兴通讯股份有限公司 | Method for activating preset positions of camera and video conference terminal system |
CN202976055U (en) * | 2012-12-28 | 2013-06-05 | 吴玉胜 | Voice input device |
US20130191749A1 (en) * | 2004-06-05 | 2013-07-25 | Sonos, Inc. | Method and apparatus for managing a playlist by metadata |
CN104333815A (en) * | 2014-10-28 | 2015-02-04 | 深圳市同洲电子股份有限公司 | Television shopping method, terminal and system |
CN105306674A (en) * | 2015-09-11 | 2016-02-03 | 深圳市冠旭电子有限公司 | Method and system for self-defining earphone key functions |
CN105898028A (en) * | 2015-12-30 | 2016-08-24 | 乐视致新电子科技(天津)有限公司 | Smart mobile phone recording source switching system and method |
CN107329660A (en) * | 2017-07-03 | 2017-11-07 | 武汉理工大学 | A kind of piano class network virtual musical instrument |
-
2018
- 2018-01-04 CN CN201810008992.0A patent/CN108089837B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130191749A1 (en) * | 2004-06-05 | 2013-07-25 | Sonos, Inc. | Method and apparatus for managing a playlist by metadata |
CN101021747A (en) * | 2007-03-07 | 2007-08-22 | 赵俊峰 | Keyboard with mouse function |
CN101159939A (en) * | 2007-11-08 | 2008-04-09 | 中兴通讯股份有限公司 | Method of performing input mode selection on mobile terminal |
CN102510468A (en) * | 2011-11-23 | 2012-06-20 | 中兴通讯股份有限公司 | Method for activating preset positions of camera and video conference terminal system |
CN202976055U (en) * | 2012-12-28 | 2013-06-05 | 吴玉胜 | Voice input device |
CN104333815A (en) * | 2014-10-28 | 2015-02-04 | 深圳市同洲电子股份有限公司 | Television shopping method, terminal and system |
CN105306674A (en) * | 2015-09-11 | 2016-02-03 | 深圳市冠旭电子有限公司 | Method and system for self-defining earphone key functions |
CN105898028A (en) * | 2015-12-30 | 2016-08-24 | 乐视致新电子科技(天津)有限公司 | Smart mobile phone recording source switching system and method |
CN107329660A (en) * | 2017-07-03 | 2017-11-07 | 武汉理工大学 | A kind of piano class network virtual musical instrument |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112667488A (en) * | 2020-12-29 | 2021-04-16 | 深圳市慧为智能科技股份有限公司 | Key processing method, device, equipment and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN108089837B (en) | 2021-05-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108470034B (en) | A kind of smart machine service providing method and system | |
US10785541B2 (en) | Screencast recording method, screencast playing method, screen recording terminal, and playing terminal | |
CN108600796B (en) | Control mode switch method, equipment and the computer-readable medium of smart television | |
CN107436748B (en) | Method and device for processing third-party application message, terminal equipment and readable medium | |
CN108133707A (en) | A kind of content share method and system | |
WO2021135604A1 (en) | Voice control method and apparatus, server, terminal device, and storage medium | |
US11762629B2 (en) | System and method for providing a response to a user query using a visual assistant | |
CN109274831A (en) | A kind of audio communication method, device, equipment and readable storage medium storing program for executing | |
CN111359209B (en) | Video playing method and device and terminal | |
WO2019071808A1 (en) | Video image display method, apparatus and system, terminal device, and storage medium | |
CN103973542B (en) | A kind of voice information processing method and device | |
CN109361994A (en) | Speaker control method, mobile terminal and computer readable storage medium | |
CN107957908A (en) | A kind of microphone sharing method, device, computer equipment and storage medium | |
CN113986186A (en) | Audio switching system, method, electronic equipment and storage medium | |
WO2020215704A1 (en) | Instant messaging method capable of implementing desktop sharing and related devices | |
CN108089837A (en) | Microphone switching method, device, equipment and storage medium | |
CN108881766A (en) | Method for processing video frequency, device, terminal and storage medium | |
CN108418979B (en) | Telephone traffic continuation prompting method and device, computer equipment and storage medium | |
CN115118820A (en) | Call processing method and device, computer equipment and storage medium | |
CN108803925A (en) | Implementation method, device, terminal and the medium of touch screen effect | |
CN112015538A (en) | Audio and video system based on software definition and working method thereof | |
CN106028221B (en) | A kind of method and intelligent sound box controlling time synchronization | |
CN110197660A (en) | A kind of the voice confirmation method and system of system authorization | |
CN106992971A (en) | A kind of interactive terminal switching method, device and a kind of interactive recording and broadcasting system | |
WO2024001462A1 (en) | Song playback method and apparatus, and computer device and computer-readable 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 |