CN103345403A - Method and terminal device for deeply controlling sound playing through earphones - Google Patents

Method and terminal device for deeply controlling sound playing through earphones Download PDF

Info

Publication number
CN103345403A
CN103345403A CN201310228341XA CN201310228341A CN103345403A CN 103345403 A CN103345403 A CN 103345403A CN 201310228341X A CN201310228341X A CN 201310228341XA CN 201310228341 A CN201310228341 A CN 201310228341A CN 103345403 A CN103345403 A CN 103345403A
Authority
CN
China
Prior art keywords
sound signal
application program
earphone
terminal device
hook
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
Application number
CN201310228341XA
Other languages
Chinese (zh)
Other versions
CN103345403B (en
Inventor
张强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201310228341.XA priority Critical patent/CN103345403B/en
Publication of CN103345403A publication Critical patent/CN103345403A/en
Application granted granted Critical
Publication of CN103345403B publication Critical patent/CN103345403B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Telephone Function (AREA)
  • Reverberation, Karaoke And Other Acoustics (AREA)
  • Circuit For Audible Band Transducer (AREA)

Abstract

The invention discloses a method and terminal device for deeply controlling sound playing through earphones. The method comprises the following steps: detecting whether a hook key of the earphones is pressed or not, sending a hook_key event to the terminal device by the earphones when the hook key is pressed, receiving the hook_key event by the terminal device, detecting whether a sound signal is transmitted or not currently, tracking the sound signal and obtaining a PID of an application program corresponding to the sound signal when the fact that the sound signal is transmitted is detected, positioning the application program in which the sound signal is transmitted currently according to the PID of the application program, and controlling the sound output of the application program. By means of the method, the sound output can be controlled deeply through the hook key regardless of the priority of the earphones key event of the application program or the situation whether the current application program can obtain the hook_key event or not, and the overall usability of the terminal device is improved.

Description

A kind of method and terminal device of playing by the profound control of earphone sound
Technical field
The present invention relates to communication technical field, more particularly, relate to a kind of method and terminal device of playing by the profound control of earphone sound.
Background technology
At present; the control flow of earphone hook button is as follows: earphone hook button is pressed; send the hook_key event to the upper strata; the upper strata receives the hook_key event; if third party's player application is arranged this time, and (such as 1,000 hark; perhaps MPC); because the earphone keystroke Event Priority very high (being higher than the built-in player of system) of these application programs; they will preferentially receive this earphone keystroke event, so just can control the music of third party's player, time-out or the broadcast of picture.
In addition; if there is not third party's player application; this application program generally is not that (such as new concept english or lazyboot's player application listen to storytelling in other words; the earphone keystroke Event Priority of these application programs is very low; even priority is not set all); this time, (such as we are also listening new concept english) pressed the hook button so; will start the built-in player of system of terminal device; that is to say when we are being with earphone to listen new concept english; press the hook button; not only can't suspend or play English, on the contrary can the built-in player of start-up system, influence user's operation.
Summary of the invention
The objective of the invention is to overcome above-mentioned defective of the prior art, a kind of method and terminal device of playing by the profound control of earphone sound is provided, to realize by following the tracks of sound signal, obtain the process number PID of the application program corresponding with this sound signal, PID directly controls this application program by this process number.
For achieving the above object, technical scheme provided by the invention is as follows:
A kind of method of playing by the profound control of earphone sound, this method may further comprise the steps:
Whether the hook button that detects earphone is pressed, and when the hook button was pressed, earphone sent the hook_key key-press event to terminal device, and terminal device receives described hook_key key-press event;
Whether current have sound signal in transmission, when having detected sound signal in when transmission, follow the tracks of described sound signal and obtain the process number PID of the application program corresponding with described sound signal if detecting;
Process number PID according to the application program corresponding with described sound signal navigates to the current voice output of carrying out the application program of audio signal transmission and controlling described application program.
Furthermore, whether described detection is current has sound signal in transmission, and when having detected sound signal in transmission, the step of following the tracks of described sound signal and obtaining the process number PID of the application program corresponding with described sound signal specifically comprises:
Whether have data transmission, when having detected data transmission, follow the tracks of audio data stream and obtain the process number PID of the application program corresponding with described audio data stream if detecting current audio stream.
Furthermore, whether described detection is current has sound signal after the step of transmission, and this method also comprises:
When detecting less than sound signal being arranged when transmitting, start the built-in music player of system of terminal device.
Furthermore, described application program comprises that earphone hook_key key-press event priority is higher than the application program that the player application of the built-in music player of system and earphone hook_key key-press event priority are lower than the application program of the built-in music player of system and earphone hook_key key-press event priority is not set.
The present invention also provides a kind of terminal device, comprises one or more application programs, and this terminal device also comprises:
Whether first detection module is pressed for detection of the hook button of earphone;
Receiver module is used for receiving the hook_key key-press event that earphone sends;
Whether second detection module has sound signal in transmission for detection of current;
Acquisition module is used for having detected sound signal when transmitting when described second detection module, follows the tracks of described sound signal and obtains the process number PID of the application program corresponding with described sound signal;
Locating module, the process number PID that is used for the application program corresponding with described sound signal get access to according to described acquisition module navigates to current application program of carrying out audio signal transmission;
Control module is used for the voice output of the application program that the described locating module of control navigates to.
Furthermore, this terminal device also comprises:
Start module, be used for detecting less than sound signal being arranged when transmitting when described second detection module, start the built-in music player of system of terminal device.
Compared with prior art, beneficial effect of the present invention is:
The present invention by detect current whether have sound signal the transmission, when having detected sound signal in transmission, follow the tracks of sound signal and obtain the process number PID of the application program corresponding with sound signal, process number PID according to the application program corresponding with sound signal navigates to current application program of carrying out audio signal transmission, thereby reach the earphone keystroke Event Priority that to take notice of application program and current application program and whether can get access to the hook_key key-press event, can control the broadcast of sound or the purpose that stops by the hook button in profound ground, improve the whole ease for use of terminal device.
Description of drawings
Fig. 1 is the method flow diagram that the profound control of earphone sound is play that passes through of the embodiment of the invention.
Fig. 2 is the structured flowchart of the terminal device of the embodiment of the invention.
Embodiment
For the purpose, technical scheme and the advantage that make the embodiment of the invention clearer, below in conjunction with the accompanying drawing in the embodiment of the invention, technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that obtains under the creative work prerequisite.
Embodiment one
Embodiments of the invention provide a kind of method of playing by the profound control of earphone sound, below in conjunction with accompanying drawing present embodiment are elaborated.
Fig. 1 is the method flow diagram that the profound control of earphone sound is play that passes through of the embodiment of the invention, with reference to figure 1, specifically may further comprise the steps:
Step S101, whether the hook button that detects earphone is pressed.
Terminal device when needs are play with the sound of earphone controlling application program, inserts earphone in place behind opening initialization, whether the hook button that detects earphone is pressed, if the hook button is not pressed, and execution in step S102 then, otherwise execution in step S103, and later step.
Step S102, whether the hook button that continues the detection earphone is pressed.
Step S103, earphone send the hook_key key-press event to terminal device, and terminal device receives described hook_key key-press event.
Step S104, detect current whether have sound signal the transmission.
Whether in the present embodiment, step S104 specifically refers to detect current audio stream data transmission.Wherein, audio stream is the output quality of control synchronization of data streams type audio frequency.
Step S105 when having detected sound signal in when transmission, follows the tracks of described sound signal and obtains the process number PID of the application program corresponding with described sound signal.
In the present embodiment, step S105 refers to specifically that when detecting current audio stream data transmission is arranged illustrating has some application program at output sound this moment, follows the tracks of audio data stream and obtains the process number PID of the application program corresponding with described audio data stream.Each application program has unique process number PID, it is that the application program runtime system distributes, process number PID can not change identifier when operation, for example: " 1,000 hark---PID:11 ", " new concept english---PID:201 ", " lazyboot listens to storytelling---PID:221 " etc.
Step S106 navigates to current application program of carrying out audio signal transmission according to the process number PID of the application program corresponding with described sound signal.Specifically, since got access to this process number PID, so just can navigate to this moment specifically is which application program is in the operating audio data stream.
Step S107 controls the voice output of described application program, namely controls sound and plays or stop.
Step S108 when detecting less than sound signal being arranged when transmitting, starts the built-in music player of system of terminal device.
Wherein, application program comprises that earphone hook_key key-press event priority is higher than the application program that the player application of the built-in music player of system and earphone hook_key key-press event priority are lower than the application program of the built-in music player of system and earphone hook_key key-press event priority is not set.
The present invention need not take notice of whether the earphone hook_key key-press event priority of application program and current application program can get access to the hook_key key-press event, can profoundly control the broadcast of sound by the hook button or stop, having improved the whole ease for use of terminal device.
Embodiment two
The invention provides a kind of terminal device, Fig. 2 is the structured flowchart of the terminal device of the embodiment of the invention, and with reference to figure 2, it comprises one or more application programs, and this terminal device also comprises:
Whether first detection module 201 is pressed for detection of the hook button of earphone;
Receiver module 202 is used for receiving the hook_key key-press event that earphone sends;
Whether second detection module 203 has sound signal in transmission for detection of current;
Acquisition module 204 is used for having detected sound signal when transmitting when described second detection module 203, follows the tracks of described sound signal and obtains the process number PID of the application program corresponding with described sound signal;
Locating module 205 is used for navigating to current application program of carrying out audio signal transmission according to the process number PID of the corresponding application program of described acquisition module 204 sound signals that get access to and described;
Control module 206 is used for the voice output of the application program that the described locating module 205 of control navigates to.
As preferred implementation, in the present embodiment, this terminal device also comprises:
Start module 207, be used for detecting less than sound signal being arranged when transmitting when described second detection module 203, start the built-in music player 208 of system of terminal device.
The present invention follows the tracks of sound signal by second detection module 203, acquisition module 204, locating module 205 and control module 206, obtain the process number PID of the application program corresponding with this sound signal, PID directly controls this application program by this process number, use the profound controlling application program of earphone to carry out the operating efficiency that sound is play thereby improved the terminal user greatly, improved the whole ease for use of terminal device.
One of ordinary skill in the art will appreciate that all or part of step that realizes in above-described embodiment method is to instruct relevant hardware to finish by program, described program can be in being stored in a computer read/write memory medium, described storage medium is as ROM/RAM, disk, CD etc.
Above-described embodiment is preferred implementation of the present invention; but embodiments of the present invention are not restricted to the described embodiments; other any do not deviate from change, the modification done under spiritual essence of the present invention and the principle, substitutes, combination, simplify; all should be the substitute mode of equivalence, be included within protection scope of the present invention.

Claims (6)

1. one kind is passed through the method that the profound control of earphone sound is play, and it is characterized in that this method may further comprise the steps:
Whether the hook button that detects earphone is pressed, and when the hook button was pressed, earphone sent the hook_key key-press event to terminal device, and terminal device receives described hook_key key-press event;
Whether current have sound signal in transmission, when having detected sound signal in when transmission, follow the tracks of described sound signal and obtain the process number PID of the application program corresponding with described sound signal if detecting;
Process number PID according to the application program corresponding with described sound signal navigates to the current voice output of carrying out the application program of audio signal transmission and controlling described application program.
2. according to claim 1 by the profound method of controlling the sound broadcast of earphone, it is characterized in that, whether described detection is current has sound signal in transmission, when having detected sound signal in when transmission, the step of following the tracks of described sound signal and obtaining the process number PID of the application program corresponding with described sound signal specifically comprises:
Whether have data transmission, when having detected data transmission, follow the tracks of audio data stream and obtain the process number PID of the application program corresponding with described audio data stream if detecting current audio stream.
3. the method for playing by the profound control of earphone sound according to claim 1 is characterized in that, whether described detection is current has sound signal after the step of transmission, and this method also comprises:
When detecting less than sound signal being arranged when transmitting, start the built-in music player of system of terminal device.
4. according to claim 3 by the profound method of controlling the sound broadcast of earphone, it is characterized in that described application program comprises that earphone hook_key key-press event priority is higher than the application program that the player application of the built-in music player of system, earphone hook_key key-press event priority are lower than the application program of the built-in music player of system and earphone hook_key key-press event priority is not set.
5. a terminal device comprises one or more application programs, it is characterized in that, this terminal device comprises:
Whether first detection module is pressed for detection of the hook button of earphone;
Receiver module is used for receiving the hook_key key-press event that earphone sends;
Whether second detection module has sound signal in transmission for detection of current;
Acquisition module is used for having detected sound signal when transmitting when described second detection module, follows the tracks of described sound signal and obtains the process number PID of the application program corresponding with described sound signal;
Locating module, the process number PID that is used for the application program corresponding with described sound signal get access to according to described acquisition module navigates to current application program of carrying out audio signal transmission;
Control module is used for the voice output of the application program that the described locating module of control navigates to.
6. terminal device according to claim 1 is characterized in that, this terminal device also comprises:
Start module, be used for detecting less than sound signal being arranged when transmitting when described second detection module, start the built-in music player of system of terminal device.
CN201310228341.XA 2013-06-08 2013-06-08 A kind of method played by earphone deep layer secondary control sound and terminal device Active CN103345403B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310228341.XA CN103345403B (en) 2013-06-08 2013-06-08 A kind of method played by earphone deep layer secondary control sound and terminal device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310228341.XA CN103345403B (en) 2013-06-08 2013-06-08 A kind of method played by earphone deep layer secondary control sound and terminal device

Publications (2)

Publication Number Publication Date
CN103345403A true CN103345403A (en) 2013-10-09
CN103345403B CN103345403B (en) 2017-10-03

Family

ID=49280201

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310228341.XA Active CN103345403B (en) 2013-06-08 2013-06-08 A kind of method played by earphone deep layer secondary control sound and terminal device

Country Status (1)

Country Link
CN (1) CN103345403B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103841495A (en) * 2014-03-03 2014-06-04 联想(北京)有限公司 Method and device for adjusting voice frequency parameters
CN104102540A (en) * 2014-06-30 2014-10-15 上海卓悠网络科技有限公司 Operation process management method and mobile terminal
WO2016161877A1 (en) * 2015-04-07 2016-10-13 北京锤子数码科技有限公司 Method and system for determining application program currently playing audio content

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202004847U (en) * 2011-04-22 2011-10-05 深圳市隆宇世纪科技有限公司 Mobile phone capable of controlling music playing and pausing through earphone key
US20120207337A1 (en) * 2008-09-05 2012-08-16 Apple Inc. Vented in-the-ear headphone
CN103118191A (en) * 2013-01-28 2013-05-22 Tcl通讯(宁波)有限公司 Using control method and mobile terminal for iPhone wire control earphone

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120207337A1 (en) * 2008-09-05 2012-08-16 Apple Inc. Vented in-the-ear headphone
CN202004847U (en) * 2011-04-22 2011-10-05 深圳市隆宇世纪科技有限公司 Mobile phone capable of controlling music playing and pausing through earphone key
CN103118191A (en) * 2013-01-28 2013-05-22 Tcl通讯(宁波)有限公司 Using control method and mobile terminal for iPhone wire control earphone

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
BRAIN: "《http://blog.sina.com.cn/s/blog_68028f880100u8te.html》", 27 October 2011 *
DARTAGNAN: "《http://blog.csdn.net/dadoneo/article/details/7718902》", 5 July 2012 *
杨青平: "《深入理解 Android Telephony原理剖析与最佳实践》", 31 January 2013 *
直觉: "《新浪博客:http://blog.sina.com.cn/s/blog-6602ffbc010130iv.html》", 6 January 2012 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103841495A (en) * 2014-03-03 2014-06-04 联想(北京)有限公司 Method and device for adjusting voice frequency parameters
CN103841495B (en) * 2014-03-03 2019-11-26 联想(北京)有限公司 A kind of audio frequency parameter method of adjustment and device
CN104102540A (en) * 2014-06-30 2014-10-15 上海卓悠网络科技有限公司 Operation process management method and mobile terminal
CN104102540B (en) * 2014-06-30 2017-08-25 上海卓悠网络科技有限公司 The management method and mobile terminal of a kind of operation process
WO2016161877A1 (en) * 2015-04-07 2016-10-13 北京锤子数码科技有限公司 Method and system for determining application program currently playing audio content

Also Published As

Publication number Publication date
CN103345403B (en) 2017-10-03

Similar Documents

Publication Publication Date Title
CN103295610B (en) A kind of method of audio plays and device
CN105630586B (en) Information processing method and electronic equipment
US10051368B2 (en) Mobile apparatus and control method thereof
WO2018064879A1 (en) Method and device for speaker fault processing
CN106254981A (en) Use multiplexing microphone signal to enable the earphone that active noise eliminates
CN104090766A (en) Sound effect switching method and system for mobile terminal
KR102127622B1 (en) Method and apparatus for controlling an input of sound
US9491547B2 (en) Audio playing system and audio playing method
KR101120019B1 (en) Apparatus and method for receiving and reproducing broadcasting data through wireless communication
CN105679345A (en) Audio processing method and electronic equipment
CN105760154A (en) Method and device for controlling audio frequency
CN103680546A (en) Audio playing method, terminal and system
CN103327021A (en) Method, devices and system of multi-device interaction
CN103345403A (en) Method and terminal device for deeply controlling sound playing through earphones
WO2012087314A1 (en) Audio control system
CN103366779A (en) Method and device for automatic setting of sound-effect parameters
CN105679350A (en) Audio playing method and device
CN101458942B (en) Audio video device and controlling method
CN103377674B (en) Audio playing apparatus and its control method
CN105373371A (en) Method and system for controlling volume of windows equipment through browser
CN101093719B (en) Method for protecting hearing ability, and audio playing system with function of protecting hearing ability
CN104080026A (en) Method of information processing and line control earphone
CN102469386B (en) Vehicle-mounted audio playback and vehicle-mounted audio reproduction method
KR20130125112A (en) Vehicle multimedia apparatus capable of managing audio output and method of managing audio output
CN104464763A (en) Method and device for processing information

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP., Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP., Ltd.