Summary of the invention
It is an object of the invention to provide a kind of method and apparatus for switching headset mode, it is possible to realize automatically being switched to by earphone as the case may be figure pattern or simulation model。
To achieve these goals, the present invention provides a kind of equipment for switching headset mode, and this equipment includes: receive device, for receiving the data bandwidth of the source of sound that audio-frequence player device sends;Whether judgment means, be used for the data bandwidth judging described source of sound more than a predetermined value;And switching device, it is used for: when the data bandwidth of described source of sound is less than or equal to described predetermined value, described earphone is switched to simulation model;And when the data bandwidth of described source of sound is more than described predetermined value, described earphone is switched to figure pattern。
Preferably, described predetermined value is 192KB/s。
Preferably, the described equipment for switching headset mode is included in described earphone。
Correspondingly, the present invention also provides for a kind of method for switching headset mode, and described method includes: receive the data bandwidth of the source of sound that audio-frequence player device sends;Judge that whether the data bandwidth of described source of sound is more than a predetermined value;When the data bandwidth of described source of sound is less than or equal to described predetermined value, described earphone is switched to simulation model;And when the data bandwidth of described source of sound is more than described predetermined value, described earphone is switched to figure pattern。
Preferably, described predetermined value is 192KB/s。
Correspondingly, the present invention also provides for a kind of audio-frequence player device, and this audio-frequence player device includes: acquisition device, for obtaining the sample rate of sound source data, bit depth and channel quantity;Calculation element, for calculating the data bandwidth of source of sound according to described sample rate, institute's bit depth and described channel quantity;And dispensing device, for the data bandwidth of described source of sound is sent to being used for switching the equipment of headset mode。
Preferably, described audio-frequence player device also includes: decoding device, is used for: decode described sample rate, institute's bit depth and described channel quantity according to described sound source data;And by described sample rate, institute's bit depth and described channel quantity transmission to audio frequency ccf layer。
Preferably, the described equipment for switching headset mode is included in earphone。
Preferably, described audio-frequence player device also includes: judgment means, for judging whether described audio-frequence player device is currently connected to described earphone, when described audio-frequence player device is connected to described earphone, the data bandwidth of described source of sound is sent to described earphone by described dispensing device。
Correspondingly, the present invention also provides for a kind of method for audio-frequence player device, and described method includes: obtain the sample rate of sound source data, bit depth and channel quantity;The data bandwidth of source of sound is calculated according to described sample rate, institute's bit depth and described channel quantity;And the data bandwidth of described source of sound is sent to being used for switching the equipment of headset mode。
Preferably, described method also includes: decode described sample rate, institute's bit depth and described channel quantity according to described sound source data;And by described sample rate, institute's bit depth and described channel quantity transmission to audio frequency ccf layer。
Preferably, the described equipment for switching headset mode is included in earphone。
Preferably, described method also includes: judge whether described audio-frequence player device is currently connected to described earphone;And when described audio-frequence player device is connected to described earphone, the data bandwidth of described source of sound is sent to described earphone。
Pass through technique scheme, the data bandwidth of source of sound and a predetermined value are compared, when the data bandwidth of source of sound is more than this predetermined value, earphone is switched to figure pattern automatically, and the acoustics promoting user is experienced, and presents high quality audio effect for user, when the data bandwidth of source of sound is less than or equal to this predetermined value, automatically earphone being switched to simulation model, it under the premise not affecting Consumer's Experience, can effectively reduce the power consumption of earphone。
Other features and advantages of the present invention will be described in detail in detailed description of the invention part subsequently。
Detailed description of the invention
Below in conjunction with accompanying drawing, the specific embodiment of the present invention is described in detail。It should be appreciated that detailed description of the invention described herein is merely to illustrate and explains the present invention, it is not limited to the present invention。
Fig. 1 illustrates the structured flowchart of the equipment for switching headset mode provided by the present invention。As it is shown in figure 1, the present invention provides a kind of equipment for switching headset mode, this equipment includes: receive device 220, for receiving the data bandwidth of the source of sound that audio-frequence player device sends;Whether judgment means 230, be used for the data bandwidth judging described source of sound more than a predetermined value;And switching device 210, it is used for: when the data bandwidth of described source of sound is less than or equal to described predetermined value, described earphone is switched to simulation model;And when the data bandwidth of described source of sound is more than described predetermined value, described earphone is switched to figure pattern。This equipment being used for switching headset mode can realize the automatic switchover of headset mode, when not affecting user's acoustics and experiencing, the pattern according to practical situation automatic switchover earphone, effectively reduces earphone power consumption。
This equipment being used for switching headset mode both may be embodied in earphone or audio-frequence player device。
Fig. 2 illustrates the structured flowchart of audio-frequence player device and the earphone provided in one embodiment of the invention。As in figure 2 it is shown, the equipment for switching headset mode both may be embodied in earphone 200 in an embodiment of the present invention, this earphone 200 is the earphone that simulation model can either be supported can to support again figure pattern。
With further reference to Fig. 2, the present invention also provides for a kind of audio-frequence player device 100, this audio-frequence player device 100 can be that any one can play the terminal of audio frequency, such as mobile phone, PAD etc., audio-frequence player device 100 may include that acquisition device 110, for obtaining the sample rate of sound source data, bit depth and channel quantity;Calculation element 120, for calculating the data bandwidth of source of sound according to described sample rate, institute's bit depth and described channel quantity;And dispensing device 130, for the data bandwidth of described source of sound is sent to being used for switching the equipment (being earphone 200) of headset mode。
As described above, earphone 200 can include receiving device 220, judgment means 230 and switching device 210, receive device 220 and receive the data bandwidth of the described source of sound that audio-frequence player device 100 sends, whether judgment means 230 is used for the data bandwidth judging described source of sound more than a predetermined value, when the data bandwidth of source of sound is less than or equal to above-mentioned predetermined value, earphone 200 is automatically switched to simulation model by switching device 210, when the data bandwidth of source of sound is more than above-mentioned predetermined value, earphone 200 is automatically switched to figure pattern by switching device 210。
In audio-frequence player device, the process of the broadcasting of any audio frequency is all be first PCM (PulseCodeModulation by various different compressed formats decompressions, pulse code modulation) data form, the bandwidth of PCM data form is to determine this quality factor of music tonequality, when PCM bandwidth is determined, if the quality of audio frequency it has been determined that therefore the bandwidth of hardware be not less than the bandwidth of PCM, it is possible to ensure the quality of audio frequency play。
The calculating formula of the bandwidth of PCM data form is the product of the sample rate of voice data, bit depth and channel quantity。In the present invention, the bandwidth of PCM data form refers to identical data with the data bandwidth of the source of sound being mentioned above。
As described in the background art, the simulation model of earphone is generally possible to support fixing sample rate (e.g., 48kHz/44.1kHz) and fixing sampling depth (e.g., 16bit), and the bandwidth that sample rate is the PCM data form of 44.1kHz is:
44.1K × 16bit × 2channel=1411.2Kbps=176.4KB/s
The bandwidth that sample rate is the PCM data form of 48kHz is:
48K × 16bit × 2channel=1536Kbps=192KB/s。
In summary, the maximum of the bandwidth of the PCM data form that the simulation model of earphone can be supported is 192KB/s。And the sample rate that the figure pattern of earphone can be supported is generally 96KHz, bit depth is 24, the bandwidth of its supported PCM data form more than 192KB/s, when PCM data form bandwidth more than 192KB/s, if being continuing with simulation model, by that damage audio frequency and quality, the predetermined value in therefore above-mentioned can be 192KB/s。When the data bandwidth (or being properly termed as the bandwidth of PCM data form) receiving the source of sound that device 220 receives of earphone 200 is less than or equal to 192KB/s, earphone 200 is switched to simulation model by switching device 210 automatically, to reduce power consumption, it is to be understood that, here first switching device 210 can determine the present mode of operation of earphone 200, if present mode of operation simulation model, then switching device 210 will not action。When the data bandwidth (or being properly termed as the bandwidth of PCM data form) receiving the source of sound that device 220 receives of earphone 200 is more than 192KB/s, earphone 200 is switched to figure pattern by switching device 210 automatically, acoustics to promote user is experienced, and presents high quality audio effect for user。Equally, if the present mode of operation of earphone 200 is figure pattern, then switching device 210 is failure to actuate。
Fig. 3 illustrates an embodiment sound intermediate frequency playback equipment structured flowchart。As it is shown on figure 3, in one embodiment of this invention, audio-frequence player device 100 can also include decoding device 140, decodes described sample rate, institute's bit depth and described channel quantity according to described sound source data。
First decoding device 140 decodes the sample rate of PCM data and PCM data from the voice data being in compressed format, bit depth, and channel quantity, then decoding device 140 can by the sample rate of the PCM data decoded and PCM data, bit depth, and channel quantity transmits to audio frequency framework (AudioFramework) layer, acquisition device 110 can obtain the sample rate of this PCM data and PCM data from audio frequency ccf layer, bit depth, and channel quantity, calculation element 120 calculates sample rate, bit depth, and the product of channel quantity, namely can determine that the bandwidth of PCM data。Wherein PCM data is audio frequency played data。
Fig. 4 illustrates an embodiment sound intermediate frequency playback equipment structured flowchart。As shown in Figure 4, in one embodiment of this invention, audio-frequence player device 100 can also include: judgment means 150, may be used for judging whether audio-frequence player device 100 is currently connected to earphone, when current device is connected to earphone, the bandwidth of PCM data is sent to earphone 200 by dispensing device 130。
Preferably, it is judged that whether device 150 can be got by audioHal layer currently has earphone to be inserted into audio-frequence player device 100。
Fig. 5 illustrates the flow chart of the method for switching headset mode provided by the present invention。As it is shown in figure 5, correspondingly, the present invention also provides for a kind of method for switching headset mode, and the method includes: receive the data bandwidth of the source of sound that audio-frequence player device sends;Judge that whether the data bandwidth of described source of sound is more than a predetermined value;When the data bandwidth of described source of sound is less than or equal to described predetermined value, described earphone is switched to simulation model;And when the data bandwidth of described source of sound is more than described predetermined value, described earphone is switched to figure pattern。
It is appreciated that in the above-mentioned methods, when the data bandwidth of source of sound is less than or equal to above-mentioned predetermined value, if the present mode of operation of earphone is simulation model, then need not perform the operation of switch mode, otherwise, automatically perform the operation of switch mode。Same, when the data bandwidth of source of sound is more than described predetermined value, if the present mode of operation of earphone is figure pattern, then need not perform the operation of switch mode, otherwise, automatically perform the operation of switch mode。
Preferably, above-mentioned predetermined value is 192KB/s。
The specific works principle of the method for switching headset mode provided by the present invention and benefit are similar to the specific works principle of above earphone provided by the present invention and benefit, will not be described in great detail here。
Fig. 5 illustrates the flow chart of the method for audio-frequence player device provided by the present invention。As shown in Figure 5, correspondingly, the present invention also provides for a kind of method for audio-frequence player device, the method may include that step S10, obtain the sample rate of sound source data, bit depth and channel quantity, the decoded sample rate of decoding device transmission of audio-frequence player device, bit depth and channel quantity can be obtained here from audio frequency ccf layer;Step S20, calculates the data bandwidth of source of sound according to described sample rate, institute's bit depth and described channel quantity;And step S30, the data bandwidth of described source of sound is sent to being used for switching the equipment of headset mode。
Preferably, the above-mentioned equipment for switching headset mode may be embodied in earphone, further, in the above-mentioned methods, before by the data bandwidth transmission of source of sound to earphone, can first determine whether whether audio-frequence player device is currently connected to earphone, when audio-frequence player device is connected to earphone, the data bandwidth of described source of sound be sent to earphone。
The specific works principle of the method for audio-frequence player device provided by the present invention and benefit are similar to the specific works principle of above audio-frequence player device provided by the present invention and benefit, will not be described in great detail here。
Pass through embodiments of the present invention, the data bandwidth of source of sound and a predetermined value are compared, automatically earphone is switched to figure pattern when more than this predetermined value, the acoustics promoting user is experienced, present high quality audio effect for user, when the data bandwidth of source of sound is less than or equal to above-mentioned predetermined value, automatically earphone is switched to simulation model, under the premise not affecting Consumer's Experience, effectively reduce the power consumption of earphone。
The preferred embodiment of the present invention is described in detail above in association with accompanying drawing; but; the present invention is not limited to the detail in above-mentioned embodiment; in the technology concept of the present invention; technical scheme can being carried out multiple simple variant, these simple variant belong to protection scope of the present invention。
It is further to note that, each concrete technical characteristic described in above-mentioned detailed description of the invention, in reconcilable situation, it is possible to be combined by any suitable mode, in order to avoid unnecessary repetition, various possible compound modes are no longer illustrated by the present invention separately。
Additionally, can also carry out combination in any between the various different embodiment of the present invention, as long as it is without prejudice to the thought of the present invention, it should be considered as content disclosed in this invention equally。