Summary of the invention
The invention mainly solves the technical problem of providing a kind of control method of speech application and clients, can
Extremely facilitate user to carry out voice-enabled chat, improves the Experience Degree of user.
In order to solve the above technical problems, one technical scheme adopted by the invention is that: a kind of speech application is provided
Control method, comprising: speech application and earphone establish connection;Connection is established in the speech application and the earphone
Afterwards, the speech application receives the control instruction that user is issued by the earphone;Institute is controlled according to the control instruction
State the state of the speech voice input function of speech application.
Wherein, the speech voice input function corresponds to Mike's wind map shown by the display page of the speech application
Mark, and the speech application by the operation to the microphone icon control the speech voice input function unlatching and
It closes.
Wherein, the step of state of the speech voice input function of the speech application is controlled according to control instruction packet
It includes: judging the current state of the speech voice input function of the speech application;When the voice of the speech application inputs
Function is currently in off state, then the clicking operation of the microphone icon is realized according to the control instruction, and then open
The speech voice input function of the speech application;When the speech voice input function of the speech application is currently opening state
State then realizes the clicking operation of the microphone icon according to the control instruction, and then closes the speech application
Speech voice input function.
Wherein, the step of speech application and the earphone establish connection include: detect the earphone and
After terminal device establishes connection, the speech application and the earphone establish connection;Or it is built in earphone and terminal device
After vertical connection, after detecting the terminal device unlatching speech application, the speech application and the ear
Machine establishes connection;Or after the earphone and terminal device establish connection, controlled when receiving user to the first of the earphone
After the operational order of key processed, the speech application and the earphone establish connection.
Wherein, after the step of speech application and the earphone establish connection, comprising: monitoring earphone media
Event;When earphone media event occurs, obtains the speech message of earphone media event and pass through the speech message described
Earphone output.
Wherein, the step of control instruction that the speech application reception user is issued by earphone includes: institute's predicate
Sound application program receives user to the operational order of the second control key of earphone to receive the control instruction;Or the voice
Application program identifies user by the phonetic order of earphone input to receive the control instruction.
In order to solve the above technical problems, another technical solution used in the present invention is: providing a kind of client, comprising:
Link block, for establishing connection with earphone;Receiving module, for after the link block and the earphone establish connection,
Receive the control instruction that user is issued by the earphone;Control module, for controlling client according to the control instruction
The state of speech voice input function.
Wherein, the speech voice input function corresponds to microphone icon shown by the display page of the client, and
The client controls the opening and closing of the speech voice input function by the operation to the microphone icon.
Wherein, the control module includes: judging unit, the current shape of the speech voice input function for judging client
State;Control unit is currently in off state, the reality according to the control instruction for the speech voice input function when the client
The clicking operation of the existing microphone icon, and then open the speech voice input function of the client;When the language of the client
Sound input function is currently open state, the clicking operation of the microphone icon is realized according to the control instruction, in turn
Close the speech voice input function of the client.
Wherein, the link block is used for after detecting that the earphone and terminal device establish connection, with the earphone
Establish connection;Or after earphone and terminal device establish connection, the voice application is opened when detecting the terminal device
After program, connection is established with the earphone;Or after the earphone and terminal device establish connection, when receiving user to institute
After the operational order of the first control key for stating earphone, connection is established with the earphone.
Wherein, further includes: monitoring modular, for monitoring earphone media event;Output module, for when generation earphone media
When event, obtains the speech message of earphone media event and export the speech message by the earphone.
Wherein, the receiving module is for receiving user to the operational order of the second control key of earphone to receive the control
System instruction;Or user passes through the phonetic order of earphone input to receive the control instruction for identification.
The beneficial effects of the present invention are: being in contrast to the prior art, speech application of the invention and earphone are built
Vertical connection receives the control instruction that user is issued by earphone by speech application, and controls voice according to control instruction
The state of the speech voice input function of application program, thus speech voice input function can be realized by carrying out operation to earphone in user
State control, without open speech application chat interface by way of clicking microphone icon manually come
The state of speech voice input function is controlled, therefore does not need frequently to take out the end for running speech application during voice-enabled chat
Only voice input need to can be realized by carrying out operation to earphone in end equipment, and pole is convenient for the user to use, and is conducive to improve user
Experience Degree.
Specific embodiment
Below in conjunction with drawings and embodiments, the present invention is described in detail.
Refering to fig. 1, in one embodiment of control method of speech application of the present invention, speech application is with language
The client of sound input function, online voice client e.g. Internet-based.The terminal of operation speech application is set
Standby is mobile terminal with touch function, such as mobile phone, tablet computer, smartwatch etc..Certainly, terminal device is also possible to
PC machine or the mobile terminal etc. for not having touch function.In following each embodiments, each main body for executing step is client
End namely speech application.Described method includes following steps:
Step S101: speech application and earphone establish connection.
Wherein, earphone is the line control earphone or wireless headset that connection is established with mobile terminal.Line control earphone or wireless ear
Usually there is machine the broadcast sound volume of the music player of control mobile terminal, pause to play, open broadcasting, next playback of songs
And the functions such as upper head playback of songs.Correspondingly, on line control earphone equipped with volume increasing key+, volume down key-, pause/
Open the function buttons such as broadcasting button, next key.
Before being realized using earphone to the control of speech application, establishes speech application and earphone and connect
It connects.
Wherein, speech application and earphone establish connection mode can there are many.For example, being opened in speech application
Qi Hou, after speech application detects earphone and mobile terminal establishes wired or wireless connection, speech application i.e. with
Earphone establishes connection.Alternatively, once detecting the earpiece holes of earphone insertion mobile terminal, speech application is established with earphone
Connection.Alternatively, after detecting that mobile terminal opens speech application, voice is answered after earphone and mobile terminal establish connection
Connection is established with program and earphone.Alternatively, after earphone and mobile terminal establish connection, when receiving user to the first of earphone
After the operational order of control key, speech application and earphone establish connection.As shown in Fig. 2, the first control key of earphone 20 can
To be the central control key 21 between volume increasing key+and volume down key-, the center control key 21 is in music player
In for pause/unlatching play case, and in the present embodiment, user can be by pressing central control key 21 to trigger voice
Application program and earphone establish connection.It is of course also possible to by receive user to volume increasing key+or volume down key-or under
The operational order of one first key is so that speech application and earphone establish connection.
Step S102: after speech application and earphone establish connection, speech application receives user and passes through earphone
The control instruction of sending.
Wherein, user can be instructed by operating the second control key input control of earphone, such as press the second control key
It is instructed with input control.Wherein, the first control key and the second control key can be the same control key, such as be on earphone
Central control key.At this point, user can press for the first time central control key so that speech application and earphone establish connection, so
Press central control key again afterwards to issue control instruction.
Step S103: the state of the speech voice input function of speech application is controlled according to control instruction.
The state of speech voice input function includes open state and closed state.It is used in the open state of speech voice input function
Family can carry out voice input, and under the closed state of speech voice input function, user can not input voice.
Therefore, in present embodiment, by using line control earphone realize to the speech voice input function of speech application into
Row control, thus user only need to by earphone operation come control speech application speech voice input function state, and
The chat interface for not needing to open speech application controls voice input work by way of clicking microphone icon manually
Can state, therefore do not need during voice-enabled chat frequently to take out mobile terminal and voice input can be realized, extremely facilitate use
The use at family improves the Experience Degree of user.
In another embodiment of speech application of the present invention, after speech application and earphone establish connection,
Export the speech message of earphone media event by earphone.Earphone media event includes the voice that other side sends in voice-enabled chat
Message, the voice broadcast service of system, media play sound of mobile terminal etc..Specifically, it is established in speech application and earphone
After the step of connection, comprising: speech application monitors earphone media event.Such as one can be registered
MediaButtonRecevie becomes unique receiver (i.e. output end) of MEDIA_BUTTON earphone media event.When
When having monitored that earphone media event occurs, the speech message of acquisition earphone media event is simultaneously defeated by earphone by the speech message
Out.
Certainly, in other embodiments, can also select to pass through speech message into shifting according to the difference of speech message
The earpiece of dynamic terminal or loudspeaker output, also can choose and export speech message by earphone.
In another embodiment of the control method of speech application of the present invention, speech voice input function corresponds to voice
Microphone icon shown by the display page of application program, and speech application is controlled by the operation to microphone icon
The opening and closing of speech voice input function processed.I.e. in the present embodiment, speech application is by identification user to microphone
The operation of icon and open and close speech voice input function, therefore in present embodiment, by user to the operation of earphone come mould
Quasi- user clicks the operation of microphone icon manually, and then realizes the control to the state of speech voice input function.
Wherein, the step of state of the speech voice input function of speech application is controlled according to control instruction includes: judgement
The current state of the speech voice input function of speech application;When the speech voice input function of speech application is currently to close shape
State then realizes the clicking operation to microphone icon according to control instruction, and then opens the voice input of speech application
Function;When the speech voice input function of speech application is currently open state, then realized according to control instruction to microphone
The clicking operation of icon, and then close the speech voice input function of speech application.
For example, as shown in figure 3, by taking one of speech application with speech voice input function as an example, the language
Sound application program has game on line application, and user can carry out voice in the game on line of speech application application and chat
It.After user starts the game on line application in speech application, mobile terminal shows interface, shows in interface
It is shown with microphone voice ball (i.e. microphone icon) 30.User can be opened by clicking microphone voice ball 30 manually under normal conditions
The speech voice input function of game on line application is opened, to carry out voice-enabled chat with player in game process, voice is defeated completing
The speech voice input function of game on line application is closed after entering by again tapping on microphone voice ball 30 manually.In this embodiment party
In formula, do not need user click manually microphone voice ball 30 can close and open game on line application voice input work
It can, wherein after speech application and earphone establish connection, when the game on line application in the speech application receives
After the control instruction that user is issued and pressing the central control key of earphone, the speech voice input function of detection game on line application
Current state.The state of its speech voice input function can be wherein obtained by the AudioManager audio service of system.When
The speech voice input function of line game application is currently in off state, and receives the control instruction that user is issued by earphone at this time
Then illustrate that user need to open speech voice input function, therefore the clicking operation to microphone voice ball 30 realized according to control instruction,
That is, detecting that user clicks the operation of microphone voice ball 30, to open the voice input work of game on line application
Can, the display state of microphone voice ball 30 is open state at this time, and user can carry out voice input.It ought detect again later
After user presses the central control key of earphone, it is equivalent to the clicking operation for detecting that user again taps on microphone voice ball 30,
Close the speech voice input function of game on line application depending on the user's operation at this time, at this time the display state of microphone voice ball 30
It is in off state, shows that user completes voice input.
Therefore, user need to only operate the speech voice input function that can open and close speech application to earphone,
The microphone voice ball 30 for taking out mobile terminal frequently with the interface to speech application is not needed in chat process
Manual clicking operation is carried out, it is extremely user-friendly.
In another citing, as shown in figure 4, being with one of speech application with speech voice input function
Example, the speech application operate on mobile phone, have mobile phone speech channel, and user can pass through the mobile phone language of speech application
Audio road carries out online voice-enabled chat.When user carries out voice-enabled chat using mobile phone speech channel, it can be operated and be opened by earphone
Open the speech voice input function with closing hand phone speech channel.Specifically, after speech application and earphone establish connection, and
And user opens mobile phone speech channel, the display interface of mobile phone speech channel is as shown in Figure 4.When receiving user by pressing ear
The central control key of machine and after the control instruction that issues, first determine whether the current shape of the speech voice input function of mobile phone speech channel
State.When the speech voice input function of mobile phone speech channel is currently in off state, the control that user is issued by earphone is received at this time
System instruction then illustrates that user need to open speech voice input function, therefore is realized on mobile phone speech channel display interface according to control instruction
The clicking operation of shown microphone icon 40 is equivalent to the operation for detecting that user clicks microphone icon 40, to open
The speech voice input function of mobile phone speech channel;When the speech voice input function of mobile phone speech channel is currently open state, connect at this time
It receives the control instruction that user is issued by earphone and then illustrates that user need to close speech voice input function, therefore according to control instruction reality
The clicking operation of existing microphone icon 40, is equivalent to the operation for detecting that user clicks microphone icon 40, with closing hand phone language
The speech voice input function in audio road.
Wherein, in other embodiments of the invention, control instruction can also be received by way of speech recognition.Tool
For body, after earphone and speech application establish connection, when user needs to open or close the voice of speech application
When input function, it can be identified and be used by speech recognition technology by the microphone input phonetic order of earphone, speech application
Then the phonetic order of family input opens or closes speech voice input function according to control instruction to obtain control instruction.For example, with
It family can be by the phonetic order of the microphone input " opening voice input " of earphone, after speech application identifies the phonetic order
The speech voice input function of speech application is opened, and after receiving the phonetic order of " closing voice input " of user's input
Close the speech voice input function of speech application.
Refering to Fig. 5, in one embodiment of client of the present invention, client is used for the control according to any of the above-described embodiment
Method processed realizes the control to client.Client refers to the speech application with speech voice input function.Client operation
On the mobile terminals such as mobile phone, tablet computer, or it is also possible to run on the terminal devices such as PC machine.
Client includes link block 51, receiving module 52 and control module 53.
Wherein, link block 51 is used to establish connection with earphone.Wherein, earphone is line control earphone or wireless headset.Into one
Step ground, link block 51 establish connection, example with earphone after detecting that earphone and mobile terminal establish wired or wireless connection
Such as in the case where client has been switched on, link block 51 once detects the earpiece holes of earphone insertion mobile terminal i.e. and ear
Machine establishes connection.Or link block 51 is used for after earphone and terminal device establish connection, when detecting that mobile terminal opens
Client establishes connection with earphone.Or after earphone and mobile terminal establish connection, link block 51 is for receiving user
To the operational order of the first control key of earphone, the operation of the first control key of earphone is established with earphone and be connected according to user
It connects.By the above-mentioned means, to realize that client and earphone establish connection.
Wherein, receiving module 52 is used for after link block 51 and earphone establish connection, is received user and is issued by earphone
Control instruction.Wherein, receiving module 52 is specifically used for receiving the control instruction that user is issued by the second control key of earphone,
I.e. user can be by pressing the second control key of earphone to issue control instruction.The first control key and the second control key of earphone can
To be the same control key, such as it is the central control key of earphone, is also possible to different keys.
Certainly, in other embodiments, to be more convenient user's operation, voice can also be controlled by way of voice and answered
With the speech voice input function of program, i.e. receiving module 52 can be used for identification user by the phonetic order of earphone input to connect
Receive control instruction.Therefore user can issue control instruction by earphone input phonetic order.
Control module 53 is used to control the state of the speech voice input function of client according to control instruction.Wherein, voice is defeated
Enter microphone icon shown by the display page of the function corresponding to client, and client passes through the operation to microphone icon
And control the opening and closing of speech voice input function.By taking the game on line of one of speech application application as an example, at this
In game on line application, user can pass through microphone shown on the interface of the online game application of click under normal conditions
Voice ball opens the speech voice input function of game application, after completing voice input can be by again tapping on microphone voice ball
To close speech voice input function.And by the client of present embodiment, then it does not need user and clicks microphone voice ball manually
To open and close speech voice input function.
In the present embodiment, further, control module 53 includes judging unit 531 and control unit 532.Wherein,
After receiving control instruction, judging unit 531 is used to judge the current state of the speech voice input function of client.Control unit
532 for realizing microphone icon according to control instruction when the speech voice input function of client is currently in off state
Clicking operation, that is, detect that user clicks the operation of microphone icon manually, to open client speech voice input function,
The display state of microphone icon is open state at this time, and user can carry out voice input.When judging unit 531 judges client
Speech voice input function when being currently open state, control unit 532 is for realizing microphone icon according to control instruction
Clicking operation, that is, detecting that user clicks the operation of microphone icon manually, to close the voice input work of client
Can, the display state of microphone icon is in off state at this time.
Wherein, in the embodiment of client of the present invention, further comprise monitoring modular 54 and output module 55.Monitoring
Module 54 is used for after link block 51 and earphone establish connection, monitors earphone media event, output module 55 is for monitoring
To when earphone media event occurs, obtains the speech message of earphone media event and export speech message to use by earphone
Family.
The client of embodiment through the invention, user only need to be by operating earphone during voice-enabled chat
The opening and closing of the speech voice input function of i.e. controllable client, without frequently taking out mobile terminal and opening client
Display interface come click microphone icon manually to open and close the speech voice input function of client, extremely user is facilitated to grasp
Make, improves user experience.
Mode the above is only the implementation of the present invention is not intended to limit the scope of the invention, all to utilize this
Equivalent structure or equivalent flow shift made by description of the invention and accompanying drawing content, it is relevant to be applied directly or indirectly in other
Technical field is included within the scope of the present invention.