Summary of the invention
The technical problem to be solved in the present invention is, provides a kind of multi-medium play method and system of intelligent terminal, and being intended to solve existing intelligent terminal cannot can not play the problem of different sources of sound by left and right acoustic channels.
The technical scheme that technical solution problem of the present invention adopts is as follows:
A multi-medium play method for intelligent terminal, wherein, comprises the following steps:
Whether A, detection intelligent terminal are connected with earphone, after described earphone is connected with intelligent terminal, detect user's body temperature corresponding to headphone unit place, left and right according to the temperature detecting unit be arranged on described earphone;
B, calculate the temperature difference of user's body temperature corresponding to the headphone unit place, left and right of described earphone, when the described temperature difference is greater than default temperature threshold, then intelligent terminal enters double play mode, and the multimedia application of intelligent terminal sends different voice datas respectively and plays to left and right headphone unit is also corresponding.
The multi-medium play method of described intelligent terminal, wherein, also comprised before described steps A:
A0, temperature detecting unit for detecting user's body temperature is set on the left headphone unit and right earphone unit of described earphone respectively in advance.
The multi-medium play method of described intelligent terminal, wherein, described steps A specifically comprises:
Detect intelligent terminal whether to be connected with earphone, after described earphone is connected with intelligent terminal, detect the ear skin surface temperature of user corresponding to headphone unit place, left and right according to the temperature detecting unit be arranged on described earphone.
The multi-medium play method of described intelligent terminal, wherein, described step B specifically comprises:
Calculate the temperature difference of user's body temperature corresponding to the headphone unit place, left and right of described earphone, when the described temperature difference is greater than default temperature threshold, then intelligent terminal enters double play mode; When the described temperature difference is not more than default temperature threshold, then intelligent terminal enters single play mode.
The multi-medium play method of described intelligent terminal, wherein, when intelligent terminal enters double play mode, the multimedia application of intelligent terminal sends different audio signals respectively and plays to left and right headphone unit is also corresponding, specifically comprises:
B1, intelligent terminal run multimedia application, show two broadcast interfaces of this multimedia application, these two broadcast interfaces corresponding left and right headphone unit respectively;
B2, according to user to the corresponding voice data that sends of the selection of two broadcast interfaces operation to left and right headphone unit, and the volume of left and right acoustic channels is set;
B3, when playing voice data corresponding to left headphone unit, by the voice data zero setting that right earphone unit is play; When the voice data that broadcasting right earphone unit is corresponding, by voice data zero setting corresponding for left headphone unit; Different voice datas is play to realize left and right headphone unit.
A multimedia play system for intelligent terminal, wherein, comprising:
Connecting and temperature detecting module, whether being connected with earphone for detecting intelligent terminal, after described earphone is connected with intelligent terminal, detect user's body temperature corresponding to headphone unit place, left and right according to the temperature detecting unit be arranged on described earphone;
Audio playing module, for the temperature difference of user's body temperature corresponding to the headphone unit place, left and right calculating described earphone, when the described temperature difference is greater than default temperature threshold, then intelligent terminal enters double play mode, and the multimedia application of intelligent terminal sends different voice datas respectively and plays to left and right headphone unit is also corresponding.
The multimedia play system of described intelligent terminal, wherein, also comprises:
Module is set, for arranging the temperature detecting unit for detecting user's body temperature in advance on the left headphone unit and right earphone unit of described earphone respectively.
The multimedia play system of described intelligent terminal, wherein, described connection and temperature detecting module, also whether be connected with earphone for detecting intelligent terminal, after described earphone is connected with intelligent terminal, detect the ear skin surface temperature of user corresponding to headphone unit place, left and right according to the temperature detecting unit be arranged on described earphone.
The multimedia play system of described intelligent terminal, wherein, described audio playing module, also for the temperature difference of user's body temperature corresponding to the headphone unit place, left and right calculating described earphone, when the described temperature difference is greater than default temperature threshold, then intelligent terminal enters double play mode; When the described temperature difference is not more than default temperature threshold, then intelligent terminal enters single play mode.
The multimedia play system of described intelligent terminal, wherein, described audio playing module comprises:
Application display unit, for running multimedia application, shows two broadcast interfaces of this multimedia application, these two broadcast interfaces corresponding left and right headphone unit respectively;
Audio selection unit, for sending voice data to left and right headphone unit according to the selection operation correspondence of user to two broadcast interfaces, and arranges the volume of left and right acoustic channels;
Audio playing unit, during for the voice data corresponding when the left headphone unit of broadcasting, by the voice data zero setting that right earphone unit is play; When the voice data that broadcasting right earphone unit is corresponding, by voice data zero setting corresponding for left headphone unit; Different voice datas is play to realize left and right headphone unit.
The multi-medium play method of a kind of intelligent terminal provided by the present invention and system, the earphone efficiently solving existing intelligent terminal cannot can not play the problem of different sources of sound by left and right acoustic channels, whether be connected with earphone by detecting intelligent terminal, after described earphone is connected with intelligent terminal, detect user's body temperature corresponding to headphone unit place, left and right according to the temperature detecting unit be arranged on described earphone; Calculate the temperature difference of user's body temperature corresponding to the headphone unit place, left and right of described earphone, when the described temperature difference is greater than default temperature threshold, then intelligent terminal enters double play mode, and the multimedia application of intelligent terminal sends different voice datas respectively and plays to left and right headphone unit is also corresponding; Thus two headphone units achieving the earphone of intelligent terminal play different voice datas respectively, be applicable to two people and listen different voice datas by same intelligent terminal, bring to user and facilitate greatly.
Embodiment
The invention provides a kind of multi-medium play method and system of intelligent terminal, for making object of the present invention, technical scheme and advantage clearly, clearly, developing simultaneously referring to accompanying drawing, the present invention is described in more detail for embodiment.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
Refer to Fig. 1, Fig. 1 is the flow chart of the multi-medium play method preferred embodiment of intelligent terminal provided by the invention, as shown in the figure, said method comprising the steps of:
Whether step S100, detection intelligent terminal are connected with earphone, after described earphone is connected with intelligent terminal, detect user's body temperature corresponding to headphone unit place, left and right according to the temperature detecting unit be arranged on described earphone;
Step S200, calculate the temperature difference of user's body temperature corresponding to the headphone unit place, left and right of described earphone, when the described temperature difference is greater than default temperature threshold, then intelligent terminal enters double play mode, and the multimedia application of intelligent terminal sends different voice datas respectively and plays to left and right headphone unit is also corresponding.
Below in conjunction with specific embodiment, above-mentioned steps is described in detail.
In the step s 100, detect intelligent terminal and whether be connected with earphone, after described earphone is connected with intelligent terminal, detect user's body temperature corresponding to headphone unit place, left and right according to the temperature detecting unit be arranged on described earphone.Specifically, first will on earphone set temperature detecting unit.Temperature detecting unit for detecting user's body temperature is namely set respectively in advance on the left headphone unit and right earphone unit of described earphone.When practical application, an infrared measurement of temperature circuit can be designed respectively on the left and right headphone unit (left and right acoustic channels) of earphone, be used for detecting the body temperature of user, because two different human temperature can not be identical, thus can according to two headset detection to body temperature judge that current earphone is a people use or two people in use.
About infrared measurement of temperature circuit, infrared measurement of temperature can adopt the mode of point-to-point analysis, namely the thermal radiation of the object ear of user (herein a for) regional area is focused on single detector, and by the emissivity of known object, radiant power is converted into temperature.Basic structure mainly comprises optical system, photodetector, signal amplifier and the part such as signal transacting, display translation composition.The infrared radiation that radiant body (ear of user) sends, enters optical system, through modulator, infrared radiation is modulated into alternation radiation, be transformed into the corresponding signal of telecommunication by detector.This signal, through amplifier and signal processing circuit, sends the input pin of mobile phone (intelligent terminal of the present invention is described for mobile phone) to, and changes the temperature value of measured target according to the algorithm on mobile phone into the form of digital signal.Wherein signal processing circuit and compensating circuit are all the technology of comparative maturity, even can use this two parts circuit of single chip solution implementer, therefore not set forth concrete circuit design herein.
Along with the rising of temperature, the emittance of object is stronger.This is the starting point of theory of infrared radiation, is also the design considerations of single band infrared radiation thermometer; Along with temperature raises, radiation peak moves (left) to shortwave direction, and meets Wien shifting theorem T* λ m=2897.8 μm of * K, and wavelength X m and the absolute temperature Τ at peak value place are inversely proportional to, and dotted line is λ m place peak value line.Spoke out-degree Pb (Τ) according to this special fence-Boltzmann theorem black matrix is directly proportional to the biquadratic of temperature Τ, the theoretical foundation of thermal radiation law infrared temperature-test technology just.
Then detect intelligent terminal whether to be connected with earphone, after described earphone is connected with intelligent terminal, detect the ear skin surface temperature of user corresponding to headphone unit place, left and right according to the temperature detecting unit be arranged on described earphone.When that is earphone just can be checked to be worn by the user by infrared measurement of temperature circuit, the temperature at ear place.When practical application, by above infrared measurement of temperature principle, when user is at wear headphones, the temperature detecting unit on earphone accurately can detect the ear skin surface temperature of user.
In step s 200, calculate the temperature difference of user's body temperature corresponding to the headphone unit place, left and right of described earphone, when the described temperature difference is greater than default temperature threshold, then intelligent terminal enters double play mode, and the multimedia application of intelligent terminal sends different voice datas respectively and plays to left and right headphone unit is also corresponding.Specifically, calculate the temperature difference of user's body temperature corresponding to the headphone unit place, left and right of described earphone, when the described temperature difference is greater than default temperature threshold, then intelligent terminal enters double play mode; When the described temperature difference is not more than default temperature threshold, then intelligent terminal enters single play mode.
Take intelligent terminal as mobile phone be example, design temperature threshold value is 0.5 degree Celsius (0.5 is preferred values, specifically can set as required).When practical application, the temperature that same person two ear detections arrive under normal circumstances should be equal, and mobile phone can enter single player mode automatically when play multimedia; If two headset detection to temperature difference be greater than 0.5 degree Celsius, then that think now wear headphones is two users, and mobile phone then enters two-player mode automatically when play multimedia.So-called single player mode, the i.e. Common usage of mobile phone frames connecting with headphone, two headphone units play same voice data.
About two-player mode, the multimedia application of intelligent terminal sends different voice datas respectively and plays to left and right headphone unit is also corresponding, specifically comprise: S201, intelligent terminal run multimedia application, show two broadcast interfaces of this multimedia application, these two broadcast interfaces corresponding left and right headphone unit respectively; S202, according to user to the corresponding voice data that sends of the selection of two broadcast interfaces operation to left and right headphone unit, and the volume of left and right acoustic channels is set; S203, when playing voice data corresponding to left headphone unit, by the voice data zero setting that right earphone unit is play; When the voice data that broadcasting right earphone unit is corresponding, by voice data zero setting corresponding for left headphone unit; Different voice datas is play to realize left and right headphone unit.
When practical application, described multimedia application is the application that music application, broadcast receiver etc. have audio frequency output.Described intelligent terminal is the intelligent terminals such as mobile phone, panel computer, handheld device, PC.Be mobile phone below with intelligent terminal, multimedia application is that music is applied as example and is described in detail as follows.
Mobile phone is the same with the multimedia pattern of current smart mobile phone under single player mode, under normal circumstances, playing music is first obtain audio-source file, then audio file is converted to the coded file of PCM-16 form, finally by establishment AudioTrack, audio file is delivered to underlying audio equipment, realizes music.
Android is to the explanation of AudioTrack class: TheAudioTrackclassmanagesandplaysasingleaudioresourcefor Javaapplications.ItallowstostreamPCMaudiobufferstotheaud iohardwareforplayback.Thisisachievedby " pushing " thedatatotheAudioTrackobjectusingoneofthewrite (byte [], int, int) andwrite (short [], int, int) methods
When using AudioTrack, first creating an example, then to example initialization, and writing data in buffer, finally call start method and realize music.Audiotrack using method as follows.
AudioTracktrackplayer=newudioTrack(AudioManager.STREAM_MUSIC,8000,AudioFormat.CHANNEL_CONFIGURATION_STEREO,AudioFormat.ENCODING_PCM_16BIT,buffersizeAudioTrack.MODE_STREAM);
// create example and initialization
Trackplayer.play (); // start
Trackplayer.write (bytes_pkg, 0, bytes_pkg.length); // in track, write data
Trackplayer.stop (); // stop playing
Trackplayer.release (); // release underlying resource
About Android being explained as follows setStereoVolume:
publicintsetStereoVolume(floatleftVolume,floatrightVolume)
Setsthespecifiedleft/rightoutputvolumevaluesontheAudioTrack.Valuesareclampedtothe(getMinVolume(),getMaxVolume())intervalifoutsidethisrange.
Parameter
leftVolumeoutputattenuationfortheleftchannel.Avalueof0.0fissilence,avalueof1.0fisnoattenuation.
rightVolumeoutputattenuationfortherightchannel
Return value
errorcodeorsuccess,seeSUCCESS,ERROR_INVALID_OPERATION
If mobile phone enters two-player mode, to play music, on broadcast interface, user can see two broadcast interfaces, and point out the corresponding left side, which interface headphone unit, headphone unit on the right of which interface correspondence, creates two audiotrack in code, respectively the operation of corresponding broadcast interface left and right earphone.Call method setStereoVolume (floatleftVolume in audiotrack, floatrightVolume) volume of left and right acoustic channels is set, when playing the source of sound of left earphone, the volume parameters on upper strata is delivered to L channel, and R channel zero setting; When playing the source of sound of the right earphone, the volume parameters on upper strata is delivered to R channel, and L channel zero setting, thus achieves left and right acoustic channels and play different sources of sound.
The multi-medium play method of intelligent terminal provided by the invention, two headphone units achieving the earphone of intelligent terminal play different voice datas respectively, are applicable to two people and listen different voice datas by same intelligent terminal.
When practical application, can on earphone set temperature transducer, thus correspondence informs that two headphone units of the earphone of intelligent terminal play different voice datas respectively, by the transducer on earphone, that judge current enjoyment music is a people or two people, and the play mode that automatically switches, bring to user and facilitate greatly.
Based on the multi-medium play method of above-mentioned intelligent terminal, the embodiment of the present invention additionally provides a kind of multimedia play system of intelligent terminal, as shown in Figure 2, comprising:
Connecting and temperature detecting module 10, whether being connected with earphone for detecting intelligent terminal, after described earphone is connected with intelligent terminal, detect user's body temperature corresponding to headphone unit place, left and right according to the temperature detecting unit be arranged on described earphone; Specifically as described in step S100;
Audio playing module 20, for the temperature difference of user's body temperature corresponding to the headphone unit place, left and right calculating described earphone, when the described temperature difference is greater than default temperature threshold, then intelligent terminal enters double play mode, and the multimedia application of intelligent terminal sends different voice datas respectively and plays to left and right headphone unit is also corresponding; Specifically as described in step S200.
Wherein, described system comprises: earphone and intelligent terminal; Described earphone comprises left headphone unit and right earphone unit, and two headphone units are respectively arranged with the temperature detecting unit for detecting user's body temperature.
Further, the multimedia play system of described intelligent terminal, also comprises:
Module is set, for arranging the temperature detecting unit for detecting user's body temperature in advance on the left headphone unit and right earphone unit of described earphone respectively.
Further, described connection and temperature detecting module 10, also whether being connected with earphone for detecting intelligent terminal, after described earphone is connected with intelligent terminal, detecting the ear skin surface temperature of user corresponding to headphone unit place, left and right according to the temperature detecting unit be arranged on described earphone.
Further, described audio playing module 20, also for the temperature difference of user's body temperature corresponding to the headphone unit place, left and right calculating described earphone, when the described temperature difference is greater than default temperature threshold, then intelligent terminal enters double play mode; When the described temperature difference is not more than default temperature threshold, then intelligent terminal enters single play mode.
Further, described audio playing module 20 comprises:
Application display unit, for running multimedia application, shows two broadcast interfaces of this multimedia application, these two broadcast interfaces corresponding left and right headphone unit respectively;
Audio selection unit, for sending voice data to left and right headphone unit according to the selection operation correspondence of user to two broadcast interfaces, and arranges the volume of left and right acoustic channels;
Audio playing unit, during for the voice data corresponding when the left headphone unit of broadcasting, by the voice data zero setting that right earphone unit is play; When the voice data that broadcasting right earphone unit is corresponding, by voice data zero setting corresponding for left headphone unit; Different voice datas is play to realize left and right headphone unit.
Further, described intelligent terminal is mobile phone or computer etc.
In sum, the multi-medium play method of a kind of intelligent terminal provided by the invention and system, whether be connected with earphone by detecting intelligent terminal, after described earphone is connected with intelligent terminal, detect user's body temperature corresponding to headphone unit place, left and right according to the temperature detecting unit be arranged on described earphone; Calculate the temperature difference of user's body temperature corresponding to the headphone unit place, left and right of described earphone, when the described temperature difference is greater than default temperature threshold, then intelligent terminal enters double play mode, and the multimedia application of intelligent terminal sends different voice datas respectively and plays to left and right headphone unit is also corresponding; Thus two headphone units achieving the earphone of intelligent terminal play different voice datas respectively, be applicable to two people and listen different voice datas by same intelligent terminal, bring to user and facilitate greatly.
Should be understood that, application of the present invention is not limited to above-mentioned citing, for those of ordinary skills, can be improved according to the above description or convert, and all these improve and convert the protection range that all should belong to claims of the present invention.