CN118233808A - Speaker control method and electronic device - Google Patents
Speaker control method and electronic device Download PDFInfo
- Publication number
- CN118233808A CN118233808A CN202211644169.1A CN202211644169A CN118233808A CN 118233808 A CN118233808 A CN 118233808A CN 202211644169 A CN202211644169 A CN 202211644169A CN 118233808 A CN118233808 A CN 118233808A
- Authority
- CN
- China
- Prior art keywords
- audio
- speaker
- play
- electronic device
- sound
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 69
- 238000004590 computer program Methods 0.000 claims description 11
- 238000005516 engineering process Methods 0.000 abstract description 5
- 230000000694 effects Effects 0.000 description 258
- 238000010586 diagram Methods 0.000 description 20
- 238000012545 processing Methods 0.000 description 12
- 230000006870 function Effects 0.000 description 8
- 238000013507 mapping Methods 0.000 description 8
- 239000000306 component Substances 0.000 description 5
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 4
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 4
- 230000000903 blocking effect Effects 0.000 description 4
- 229920001621 AMOLED Polymers 0.000 description 3
- 238000013528 artificial neural network Methods 0.000 description 3
- 238000013500 data storage Methods 0.000 description 3
- 230000010363 phase shift Effects 0.000 description 3
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 2
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 2
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 2
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 238000013529 biological neural network Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 210000000988 bone and bone Anatomy 0.000 description 1
- 210000004556 brain Anatomy 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000019771 cognition Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 239000008358 core component Substances 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 210000002569 neuron Anatomy 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000001681 protective effect Effects 0.000 description 1
- 239000002096 quantum dot Substances 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R3/00—Circuits for transducers, loudspeakers or microphones
- H04R3/12—Circuits for transducers, loudspeakers or microphones for distributing signals to two or more loudspeakers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R2430/00—Signal processing covered by H04R, not provided for in its groups
Landscapes
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Otolaryngology (AREA)
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Acoustics & Sound (AREA)
- Signal Processing (AREA)
- Circuit For Audible Band Transducer (AREA)
Abstract
本申请提供一种扬声器控制方法和电子设备,涉及智能终端技术领域。解决扬声器出声孔被遮挡时,对于所需播放的音频的影响。具体方案为:在确定播放第一音频和第二音频的情况下,控制所述第一扬声器播放第一音频,控制所述第二扬声器播放第二音频;在所述第一扬声器的出声孔被遮挡的情况下,控制所述第一扬声器播放经过调整的所述第一音频;或者,控制所述第二扬声器播放所述第一音频。
The present application provides a speaker control method and electronic device, which relate to the field of smart terminal technology. The invention solves the problem of the influence on the audio to be played when the sound outlet of the speaker is blocked. The specific scheme is: when it is determined to play the first audio and the second audio, the first speaker is controlled to play the first audio, and the second speaker is controlled to play the second audio; when the sound outlet of the first speaker is blocked, the first speaker is controlled to play the adjusted first audio; or, the second speaker is controlled to play the first audio.
Description
技术领域Technical Field
本申请涉及智能终端技术领域,尤其涉及一种扬声器控制方法和电子设备。The present application relates to the technical field of intelligent terminals, and in particular to a speaker control method and electronic device.
背景技术Background technique
随着设备硬件的迭代更新,各类电子设备能够给用户提供更多高质量的服务。例如,随着电子设备接入的扬声器数量增加,电子设备的声场也随之扩展,这样,电子设备可以向用户提供更加优质的音频输出服务。With the iterative update of device hardware, various electronic devices can provide users with more high-quality services. For example, as the number of speakers connected to electronic devices increases, the sound field of the electronic devices also expands, so that electronic devices can provide users with better audio output services.
在一些场景下,电子设备中扬声器的出声孔可能被遮挡,如,用户使用电子设备时,手部遮挡扬声器的出声孔,或者,异物堵塞扬声器的出声孔。在扬声器的出声孔被遮挡时,会直接影响到电子设备的音频输出服务所对应的服务质量,如,影响到用户实际听到的音量和用户听觉上感知到的声源位置等,这样,也会影响到用户使用电子设备的体验。In some scenarios, the sound outlet of the speaker in the electronic device may be blocked, for example, when the user uses the electronic device, the hand blocks the sound outlet of the speaker, or the foreign object blocks the sound outlet of the speaker. When the sound outlet of the speaker is blocked, it will directly affect the service quality corresponding to the audio output service of the electronic device, such as affecting the actual volume heard by the user and the location of the sound source perceived by the user, which will also affect the user's experience of using the electronic device.
发明内容Summary of the invention
本申请提供一种扬声器控制方法和电子设备,用于改善扬声器的出声孔被遮挡时,电子设备播放音频的声效。The present application provides a speaker control method and an electronic device, which are used to improve the sound effect of audio played by the electronic device when the sound outlet of the speaker is blocked.
为达到上述目的,本申请的实施例采用如下技术方案:To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
第一方面,本申请实施例提供的一种扬声器控制方法,应用于电子设备,电子设备包括第一扬声器和第二扬声器,所述方法包括:在确定播放第一音频和第二音频的情况下,控制第一扬声器播放第一音频,控制第二扬声器播放第二音频;在第一扬声器的出声孔被遮挡的情况下,控制第一扬声器播放经过调整的所述第一音频;或者,控制第二扬声器播放第一音频。In a first aspect, a speaker control method provided by an embodiment of the present application is applied to an electronic device, wherein the electronic device includes a first speaker and a second speaker, and the method includes: when it is determined that a first audio and a second audio are to be played, controlling the first speaker to play the first audio and controlling the second speaker to play the second audio; when a sound outlet of the first speaker is blocked, controlling the first speaker to play an adjusted first audio; or controlling the second speaker to play the first audio.
在上述实施例中,通过改变需由第一扬声器播放的第一音频的方式,或者,通过控制第二扬声器播放第一音频的方式。这样,即使第一扬声器受遮挡,也不会影响第一音频的播放效果,保障电子设备的音频输出的质量,也提升用户的使用体验。In the above embodiment, by changing the way the first audio needs to be played by the first speaker, or by controlling the way the second speaker plays the first audio, even if the first speaker is blocked, it will not affect the playing effect of the first audio, thereby ensuring the quality of the audio output of the electronic device and improving the user experience.
在一些实施例中,在控制所述第一扬声器播放经过调整的所述第一音频之前,所述方法包括:调整所述第一音频对应的声波相位和振动幅度。In some embodiments, before controlling the first speaker to play the adjusted first audio, the method includes: adjusting a sound wave phase and a vibration amplitude corresponding to the first audio.
在上述实施例中,通过对须由第一扬声器播放的第一音频的声波相位和振动幅度进行调整,弥补第一扬声器受遮挡后,实际播出的声波信号所出现的相移和振动幅度衰减,这样,第一扬声器遮挡后,用户听觉上也感受不出差异。In the above embodiment, the sound wave phase and vibration amplitude of the first audio to be played by the first speaker are adjusted to compensate for the phase shift and vibration amplitude attenuation of the sound wave signal actually broadcast after the first speaker is blocked. In this way, the user cannot hear any difference after the first speaker is blocked.
在一些实施例中,在调整所述第一音频对应的声波相位和振动幅度之前,所述方法还包括:确定所述第一扬声器的出声孔对应的第一遮挡占比;确定所述第一遮挡占比小于第一阈值。In some embodiments, before adjusting the sound wave phase and vibration amplitude corresponding to the first audio, the method further includes: determining a first occlusion ratio corresponding to the sound outlet of the first speaker; and determining that the first occlusion ratio is less than a first threshold.
在上述实施例中,通过在第一遮挡占比小于第一阈值的情况下,采用调整第一音频对应的声波相位和振动幅度的方式,改善扬声器被遮挡带来的影响,同时,减少切换扬声器播放第一音频的开销。In the above embodiment, when the first occlusion ratio is less than the first threshold, the sound wave phase and vibration amplitude corresponding to the first audio are adjusted to improve the impact of the speaker being blocked, while reducing the overhead of switching the speaker to play the first audio.
在一些实施例中,在调整所述第一音频对应的声波相位和振动幅度之前,所述方法还包括:确定所述第二音频的预设优先级高于所述第一音频。In some embodiments, before adjusting the sound wave phase and vibration amplitude corresponding to the first audio, the method further includes: determining that a preset priority of the second audio is higher than that of the first audio.
在上述实施例中,通过在第二音频的预设优先级高于所述第一音频的情况下,采用调整第一音频对应的声波相位和振动幅度的方式,改善扬声器被遮挡带来的影响,同时,避免对第二音频播放产生影响。In the above embodiment, when the preset priority of the second audio is higher than that of the first audio, the sound wave phase and vibration amplitude corresponding to the first audio are adjusted to improve the impact of the speaker being blocked, while avoiding affecting the playback of the second audio.
在一些实施例中,在控制所述第二扬声器播放所述第一音频之前,所述方法包括:控制所述第一扬声器停止播放所述第一音频。In some embodiments, before controlling the second speaker to play the first audio, the method includes: controlling the first speaker to stop playing the first audio.
在上述实施例中,如果采用第二扬声器播放第一音频,那么还可以控制所述第一扬声器停止播放所述第一音频。这样,不仅能够保障第一音频正常播放,又可以避免影响第一扬声器的使用寿命。In the above embodiment, if the second speaker is used to play the first audio, the first speaker can also be controlled to stop playing the first audio, so that the normal playback of the first audio can be ensured and the service life of the first speaker can be avoided.
在一些实施例中,在控制第二扬声器播放所述第一音频的情况下,所述方法还包括:控制所述第二扬声器停止播放所述第二音频;控制第一扬声器播放所述第二音频。In some embodiments, in the case of controlling the second speaker to play the first audio, the method further includes: controlling the second speaker to stop playing the second audio; and controlling the first speaker to play the second audio.
在上述实施例中,通过互换播放第一音频和第二音频的扬声器,避免第一音频受影响。在其他可能的实施例中,可以是在第一音频的预设优先级高于第二音频的情况下,采用互换扬声器的方式,确保更重要的第一音频不受影响。In the above embodiment, the first audio is prevented from being affected by swapping the speakers playing the first audio and the second audio. In other possible embodiments, when the preset priority of the first audio is higher than that of the second audio, the speakers are swapped to ensure that the more important first audio is not affected.
在一些实施例中,在控制所述第一扬声器停止播放所述第一音频之前,所述方法还包括:确定所述第一扬声器的出声孔对应的第一遮挡占比;确定所述第一遮挡占比不小于第一阈值。In some embodiments, before controlling the first speaker to stop playing the first audio, the method further includes: determining a first occlusion ratio corresponding to a sound outlet of the first speaker; and determining that the first occlusion ratio is not less than a first threshold.
在一些实施例中,在控制所述第二扬声器播放所述第一音频的情况下,所述第二扬声器继续播放所述第二音频。In some embodiments, when the second speaker is controlled to play the first audio, the second speaker continues to play the second audio.
在上述实施例中,能够同时确保第一音频和第二音频的播放不受影响。In the above embodiment, it is possible to ensure that the playing of the first audio and the second audio are not affected at the same time.
在一些实施例中,所述第一扬声器和第二扬声器的出声孔的朝向相同。In some embodiments, the sound outlets of the first speaker and the second speaker are oriented in the same direction.
在一些实施例中,所述电子设备包括第三扬声器和第四扬声器,所述方法包括:在所述第三扬声器和所述第四扬声器都播放第三音频的情况下,检测到所述第三扬声器的出声孔被遮挡;控制所述第三扬声器停止播放所述第三音频;控制所述第四扬声器播放第四音频,所述第四音频是经过声波相位和振动幅度调整后的所述第三音频。In some embodiments, the electronic device includes a third speaker and a fourth speaker, and the method includes: when the third speaker and the fourth speaker are both playing a third audio, detecting that a sound outlet of the third speaker is blocked; controlling the third speaker to stop playing the third audio; and controlling the fourth speaker to play a fourth audio, wherein the fourth audio is the third audio after adjusting the sound wave phase and vibration amplitude.
在一些实施例中,第三扬声器和第四扬声器的出声孔的朝向相同。In some embodiments, the sound outlets of the third speaker and the fourth speaker face the same direction.
在一些实施例中,所述电子设备包括第三扬声器和第四扬声器,所述方法包括:在所述第三扬声器和所述第四扬声器都播放第五音频和第六音频的情况下,检测到所述第三扬声器的出声孔被遮挡;在所述第五音频是标记为第一类型的音频,且所述第六音频不是所述第一类型的音频情况下,控制所述第三扬声器仅播放所述第六音频;控制所述第四扬声器播放第七音频和所述第六音频,所述第七音频是经过声波相位和振动幅度调整后的所述第五音频。In some embodiments, the electronic device includes a third speaker and a fourth speaker, and the method includes: when the third speaker and the fourth speaker both play the fifth audio and the sixth audio, detecting that the sound outlet of the third speaker is blocked; when the fifth audio is marked as the first type of audio and the sixth audio is not the first type of audio, controlling the third speaker to only play the sixth audio; controlling the fourth speaker to play the seventh audio and the sixth audio, wherein the seventh audio is the fifth audio after the sound wave phase and vibration amplitude are adjusted.
在一些实施例中,电子设备中包括第一集合,所述第一集合包括多个音频类型标识,与所述第一集合中音频类型标识匹配的音频为所述第一类型的音频。In some embodiments, the electronic device includes a first set, the first set includes multiple audio type identifiers, and the audio matching the audio type identifier in the first set is the first type of audio.
第二方面,本申请实施例提供的一种电子设备,电子设备包括一个或多个处理器和存储器;所述存储器与处理器耦合,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当一个或多个处理器执行计算机指令时,所述一个或多个处理器,用于:在确定播放第一音频和第二音频的情况下,控制所述第一扬声器播放第一音频,控制所述第二扬声器播放第二音频;在所述第一扬声器的出声孔被遮挡的情况下,控制所述第一扬声器播放经过调整的所述第一音频;或者,控制所述第二扬声器播放所述第一音频。In a second aspect, an electronic device provided by an embodiment of the present application includes one or more processors and a memory; the memory is coupled to the processor, and the memory is used to store computer program code, the computer program code includes computer instructions, and when the one or more processors execute the computer instructions, the one or more processors are used to: when determining to play the first audio and the second audio, control the first speaker to play the first audio, and control the second speaker to play the second audio; when the sound outlet of the first speaker is blocked, control the first speaker to play the adjusted first audio; or control the second speaker to play the first audio.
在一些实施例中,在控制所述第一扬声器播放经过调整的所述第一音频之前,所述一个或多个处理器,还用于:调整所述第一音频对应的声波相位和振动幅度。In some embodiments, before controlling the first speaker to play the adjusted first audio, the one or more processors are further used to: adjust the sound wave phase and vibration amplitude corresponding to the first audio.
在一些实施例中,在调整所述第一音频对应的声波相位和振动幅度之前,所述一个或多个处理器,还用于:确定所述第一扬声器的出声孔对应的第一遮挡占比;确定所述第一遮挡占比小于第一阈值。In some embodiments, before adjusting the sound wave phase and vibration amplitude corresponding to the first audio, the one or more processors are further used to: determine a first occlusion ratio corresponding to the sound outlet of the first speaker; and determine that the first occlusion ratio is less than a first threshold.
在一些实施例中,在调整所述第一音频对应的声波相位和振动幅度之前,所述一个或多个处理器,还用于:确定所述第二音频的预设优先级高于所述第一音频。In some embodiments, before adjusting the sound wave phase and vibration amplitude corresponding to the first audio, the one or more processors are further used to: determine that a preset priority of the second audio is higher than that of the first audio.
在一些实施例中,在控制所述第二扬声器播放所述第一音频之前,所述一个或多个处理器,还用于:控制所述第一扬声器停止播放所述第一音频。In some embodiments, before controlling the second speaker to play the first audio, the one or more processors are further used to: control the first speaker to stop playing the first audio.
在一些实施例中,在控制所述第二扬声器播放所述第一音频的情况下,所述一个或多个处理器,还用于:控制所述第二扬声器停止播放所述第二音频;控制所述第一扬声器播放所述第二音频。In some embodiments, when controlling the second speaker to play the first audio, the one or more processors are further used to: control the second speaker to stop playing the second audio; and control the first speaker to play the second audio.
在一些实施例中,在控制所述第一扬声器停止播放所述第一音频之前,所述一个或多个处理器,还用于:确定所述第一扬声器的出声孔对应的第一遮挡占比;确定所述第一遮挡占比不小于第一阈值。In some embodiments, before controlling the first speaker to stop playing the first audio, the one or more processors are further used to: determine a first occlusion ratio corresponding to the sound outlet of the first speaker; and determine that the first occlusion ratio is not less than a first threshold.
在一些实施例中,在控制所述第二扬声器播放所述第一音频的情况下,所述第二扬声器继续播放所述第二音频。In some embodiments, when the second speaker is controlled to play the first audio, the second speaker continues to play the second audio.
在一些实施例中,所述第一扬声器和第二扬声器的出声孔的朝向相同。In some embodiments, the sound outlets of the first speaker and the second speaker are oriented in the same direction.
在一些实施例中,所述电子设备包括第三扬声器和第四扬声器,所述一个或多个处理器,还用于:在所述第三扬声器和所述第四扬声器都播放第三音频的情况下,检测到所述第三扬声器的出声孔被遮挡;控制所述第三扬声器停止播放所述第三音频;控制所述第四扬声器播放第四音频,所述第四音频是经过声波相位和振动幅度调整后的所述第三音频。In some embodiments, the electronic device includes a third speaker and a fourth speaker, and the one or more processors are further used to: when the third speaker and the fourth speaker are both playing the third audio, detect that the sound outlet of the third speaker is blocked; control the third speaker to stop playing the third audio; and control the fourth speaker to play the fourth audio, wherein the fourth audio is the third audio after the sound wave phase and vibration amplitude are adjusted.
在一些实施例中,所述第三扬声器和第四扬声器的出声孔的朝向相同。In some embodiments, the sound outlets of the third speaker and the fourth speaker are oriented in the same direction.
在一些实施例中,所述电子设备包括第三扬声器和第四扬声器,所述一个或多个处理器,还用于:在所述第三扬声器和所述第四扬声器都播放第五音频和第六音频的情况下,检测到所述第三扬声器的出声孔被遮挡;在所述第五音频是标记为第一类型的音频,且所述第六音频不是所述第一类型的音频情况下,控制所述第三扬声器仅播放所述第六音频;控制所述第四扬声器播放第七音频和所述第六音频,所述第七音频是经过声波相位和振动幅度调整后的所述第五音频。In some embodiments, the electronic device includes a third speaker and a fourth speaker, and the one or more processors are further used to: when the third speaker and the fourth speaker both play the fifth audio and the sixth audio, detect that the sound outlet of the third speaker is blocked; when the fifth audio is marked as the first type of audio and the sixth audio is not the first type of audio, control the third speaker to only play the sixth audio; control the fourth speaker to play the seventh audio and the sixth audio, and the seventh audio is the fifth audio after the sound wave phase and vibration amplitude are adjusted.
在一些实施例中,所述电子设备中包括第一集合,所述第一集合包括多个音频类型标识,与所述第一集合中音频类型标识匹配的音频为所述第一类型的音频。In some embodiments, the electronic device includes a first set, the first set includes multiple audio type identifiers, and the audio matching the audio type identifier in the first set is the first type of audio.
第三方面,本申请实施例提供的一种计算机存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行上述第一方面及其可能的实施例中的方法。In a third aspect, an embodiment of the present application provides a computer storage medium, including computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method in the above-mentioned first aspect and possible embodiments thereof.
第四方面,本申请提供一种计算机程序产品,当计算机程序产品在上述电子设备上运行时,使得电子设备执行上述第一方面及其可能的实施例中的方法。In a fourth aspect, the present application provides a computer program product. When the computer program product is run on the above-mentioned electronic device, the electronic device executes the method in the above-mentioned first aspect and possible embodiments thereof.
可以理解地,上述各个方面所提供的电子设备、计算机存储介质以及计算机程序产品均应用于上文所提供的对应方法,因此,其所能达到的有益效果可参考上文所提供的对应方法中的有益效果,此处不再赘述。It can be understood that the electronic devices, computer storage media and computer program products provided in the above-mentioned aspects are all applied to the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为本申请实施例提供的平板电脑的示意图之一;FIG1 is a schematic diagram of a tablet computer provided in an embodiment of the present application;
图2为本申请实施例提供的平板电脑的示意图之二;FIG2 is a second schematic diagram of a tablet computer provided in an embodiment of the present application;
图3为本申请实施例提供的手机的示意图;FIG3 is a schematic diagram of a mobile phone provided in an embodiment of the present application;
图4为本申请实施例提供的用户使用电子设备的场景示例图之一;FIG4 is one of the example diagrams of a scenario in which a user uses an electronic device provided in an embodiment of the present application;
图5为本申请实施例提供的用户使用电子设备的场景示例图之二;FIG5 is a second example diagram of a scenario in which a user uses an electronic device according to an embodiment of the present application;
图6为本申请实施例提供的用户使用电子设备的场景示例图之三;FIG6 is a third example diagram of a scenario in which a user uses an electronic device according to an embodiment of the present application;
图7为本申请实施例提供的电子设备的结构示例图之一;FIG. 7 is one of the structural example diagrams of an electronic device provided in an embodiment of the present application;
图8为本申请实施例提供的电子设备的结构示例图之二;FIG8 is a second structural diagram of an electronic device provided in an embodiment of the present application;
图9为本申请实施例提供的电子设备控制扬声器通道播放音频的示例图之一;FIG9 is one of the example diagrams of an electronic device controlling a speaker channel to play audio provided by an embodiment of the present application;
图10为本申请实施例提供的电子设备控制扬声器通道播放音频的示例图之二;FIG10 is a second example diagram of an electronic device controlling a speaker channel to play audio provided by an embodiment of the present application;
图11为本申请实施例提供的声波信号相移前后,与其他声波叠加得到的声波信号的示例图;FIG11 is an example diagram of a sound wave signal obtained by superimposing the sound wave signal with other sound waves before and after the sound wave signal is phase shifted according to an embodiment of the present application;
图12为本申请实施例提供的电子设备控制扬声器通道播放音频的示例图之三;FIG12 is a third example diagram of an electronic device controlling a speaker channel to play audio provided by an embodiment of the present application;
图13为本申请实施例提供的电子设备控制扬声器通道播放音频的示例图之四;FIG13 is a fourth example diagram of an electronic device controlling a speaker channel to play audio provided by an embodiment of the present application;
图14为本申请实施例提供的电子设备控制扬声器通道播放音频的示例图之五;FIG14 is a fifth example diagram of an electronic device controlling a speaker channel to play audio provided by an embodiment of the present application;
图15为本申请实施例提供的电子设备控制扬声器通道播放音频的示例图之六;FIG15 is a sixth example diagram of an electronic device controlling a speaker channel to play audio provided by an embodiment of the present application;
图16为本申请实施例提供的电子设备控制扬声器通道播放音频的示例图之七;FIG16 is a seventh example diagram of an electronic device controlling a speaker channel to play audio provided by an embodiment of the present application;
图17为本申请实施例提供的电子设备控制扬声器通道播放音频的示例图之八;FIG17 is an eighth example diagram of an electronic device controlling a speaker channel to play audio provided by an embodiment of the present application;
图18为本申请实施例提供的电子设备控制扬声器通道播放音频的示例图之九;FIG18 is a ninth example diagram of an electronic device controlling a speaker channel to play audio provided by an embodiment of the present application;
图19为本申请实施例提供的扬声器控制方法的步骤流程图;FIG19 is a flowchart of the steps of the speaker control method provided in an embodiment of the present application;
图20为本申请实施例提供的芯片系统的示例图。FIG. 20 is an example diagram of a chip system provided in an embodiment of the present application.
具体实施方式Detailed ways
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.
随着技术的发展,各类电子设备中配置的硬件资源(如,存储资源、计算资源、输入输出资源等)也不断迭代、升级,旨在为用户提供更高质量的服务。With the development of technology, the hardware resources (such as storage resources, computing resources, input and output resources, etc.) configured in various electronic devices are constantly iterating and upgrading, aiming to provide users with higher quality services.
以电子设备的音频输出模块(如,扬声器)为例,随着音频输出模块不断迭代、升级,电子设备提供的音频输出类服务质量也随之提高。Taking the audio output module (eg, speaker) of an electronic device as an example, as the audio output module is continuously iterated and upgraded, the quality of audio output services provided by the electronic device is also improved accordingly.
示例性地,电子设备中音频输出模块的升级可以包括扬声器类型的增加,比如,配置有高频扬声器和低配扬声器,这样,可以由不同的扬声器播放不同频率的音频,提高音频的播放质量。Exemplarily, upgrading the audio output module in the electronic device may include adding speaker types, such as configuring a high-frequency speaker and a low-profile speaker, so that different speakers can play audio of different frequencies, thereby improving the audio playback quality.
又示例性地,电子设备中音频输出模块的升级可以包括扬声器数量的增加,比如,由配置两个扬声器迭代升级到配置四个扬声器,或者,升级到配置八个扬声器。这样,更多的扬声器,可以有效扩展电子设备的声场,并增加电子设备音效的立体感。比如,用户使用电子设备玩游戏时,电子设备可以通过多个扬声器,模拟更加立体的游戏音效,使用户能够沉浸式地体验虚拟游戏世界。As another example, the upgrade of the audio output module in the electronic device may include an increase in the number of speakers, for example, iteratively upgrading from configuring two speakers to configuring four speakers, or upgrading to configuring eight speakers. In this way, more speakers can effectively expand the sound field of the electronic device and increase the stereoscopic sense of the sound effects of the electronic device. For example, when a user uses an electronic device to play a game, the electronic device can simulate a more stereoscopic game sound effect through multiple speakers, allowing the user to immersively experience the virtual game world.
在一些实施例中,电子设备的每一个扬声器,都对应有一个出声孔。不同扬声器所对应的出声孔,在电子设备外壳上的位置不同。In some embodiments, each speaker of the electronic device corresponds to a sound outlet, and the sound outlets corresponding to different speakers are located at different positions on the housing of the electronic device.
另外,不同类型的电子设备,扬声器的出声孔的排布方式也可能存在差异,也可能存在相似之处。In addition, the arrangement of speaker holes may be different or similar for different types of electronic devices.
在一些实施例中,上述电子设备可以是手机,平板电脑,手持计算机,PC,蜂窝电话,个人数字助理(personal digital assistant,PDA),可穿戴式设备(如智能手表),智慧大屏,游戏机,以及增强现实(augmented reality,AR)\虚拟现实(virtual reality,VR)设备等智能化的电子设备。In some embodiments, the electronic device may be a mobile phone, a tablet computer, a handheld computer, a PC, a cellular phone, a personal digital assistant (PDA), a wearable device (such as a smart watch), a smart screen, a game console, and an augmented reality (AR) or virtual reality (VR) device or other intelligent electronic device.
以电子设备为平板电脑为例,扬声器的出声孔可以部署在平板电脑的左右两侧。Taking a tablet computer as an example, the speaker holes may be arranged on the left and right sides of the tablet computer.
示例性地,平板电脑中配置有8个扬声器的情况,平板电脑外壳的左侧边缘可以设置4个扬声器的出声孔,平板电脑外壳的右侧边缘也可以部署4个扬声器的出声孔。每个出声孔对应一个扬声器,可以理解,扬声器播放音频时产生的声波信号,需从对应的出声孔向外发出,这样,出声孔在外壳上的位置也可以称为是扬声器的配置位置。For example, if a tablet computer is equipped with 8 speakers, 4 speaker sound holes can be set on the left edge of the tablet computer housing, and 4 speaker sound holes can also be deployed on the right edge of the tablet computer housing. Each sound hole corresponds to a speaker. It can be understood that the sound wave signal generated by the speaker when playing audio needs to be emitted outward from the corresponding sound hole. In this way, the position of the sound hole on the housing can also be called the configuration position of the speaker.
也就是说,如果扬声器所对应的出声孔位于电子设备的左侧边缘,那么可以称该扬声器部署于电子设备的左侧边缘。同样,如果扬声器所对应的出声孔位于电子设备的右侧边缘,那么可以称该扬声器部署于电子设备的右侧边缘。That is to say, if the sound outlet corresponding to the speaker is located at the left edge of the electronic device, then the speaker can be said to be deployed at the left edge of the electronic device. Similarly, if the sound outlet corresponding to the speaker is located at the right edge of the electronic device, then the speaker can be said to be deployed at the right edge of the electronic device.
另外,在上述示例中,通过在电子设备外壳的左右两侧对称的开设出声孔,使扬声器可以对称地部署在电子设备的左右两侧,以形成左右声道,扩展电子设备的声场。In addition, in the above example, by symmetrically opening sound outlet holes on the left and right sides of the electronic device housing, the speakers can be symmetrically deployed on the left and right sides of the electronic device to form left and right channels and expand the sound field of the electronic device.
例如,开设在电子设备左侧边缘的4个出声孔中,2个出声孔开设在左侧边缘的上侧,2个出声孔开设在左侧边缘的下侧。For example, among the four sound outlet holes opened on the left edge of the electronic device, two sound outlet holes are opened on the upper side of the left edge, and two sound outlet holes are opened on the lower side of the left edge.
如图1所示,平板电脑的左侧边缘上侧有2个扬声器的出声孔,平板电脑的左侧边缘下侧也有2个扬声器的出声孔。As shown in FIG. 1 , there are two speaker holes on the upper side of the left edge of the tablet computer, and there are also two speaker holes on the lower side of the left edge of the tablet computer.
同样,开设于右侧边缘的4个出声孔中,2个出声孔开设在右侧边缘的上侧,2个出声孔开设在右侧边缘的下侧。如图1所示,平板电脑的右侧边缘上侧有2个扬声器的出声孔,平板电脑的右侧边缘下侧也有2个扬声器的出声孔。Similarly, among the four sound holes opened on the right edge, two sound holes are opened on the upper side of the right edge, and two sound holes are opened on the lower side of the right edge. As shown in FIG1 , there are two speaker sound holes on the upper side of the right edge of the tablet computer, and there are also two speaker sound holes on the lower side of the right edge of the tablet computer.
另外,位于左侧边缘的上侧的出声孔与位于右侧边缘上侧的出声孔对称。位于左侧边缘的下侧的出声孔与位于右侧边缘下侧的出声孔对称。In addition, the sound outlet holes located on the upper side of the left edge are symmetrical with the sound outlet holes located on the upper side of the right edge, and the sound outlet holes located on the lower side of the left edge are symmetrical with the sound outlet holes located on the lower side of the right edge.
需要说明的是,上述上、下、左、右可以是以平板电脑的外壳为参照物所确定的方向。示例性地,在平板电脑为长方形的情况下,平板电脑外壳上相对短的两条边缘分别为左侧边缘和右侧边缘,相对长的两条边缘分别为上侧边缘和下侧边缘。It should be noted that the above-mentioned up, down, left, and right may be directions determined with the tablet computer housing as a reference. For example, when the tablet computer is rectangular, the two relatively short edges of the tablet computer housing are the left edge and the right edge, and the two relatively long edges are the upper edge and the lower edge.
在左侧边缘靠近上侧边缘的部分可称为左侧边缘的上侧,靠近下侧边缘的部分可称为左侧边缘的下侧。同样,在右侧边缘靠近上侧边缘的部分可称为右侧边缘的上侧,靠近下侧边缘的部分可称为右侧边缘的下侧。The portion near the upper edge on the left side edge can be called the upper side of the left side edge, and the portion near the lower edge can be called the lower side of the left side edge. Similarly, the portion near the upper edge on the right side edge can be called the upper side of the right side edge, and the portion near the lower edge can be called the lower side of the right side edge.
再例如,电子设备左侧边缘的4个出声孔均开设在左侧边缘的下侧(或者上侧),4个出声孔相邻排布。同样,电子设备右侧边缘的4个出声孔均开设在右侧边缘的下侧(或者上侧),4个出声孔相邻排布。例如,如图2所示,平板电脑的左侧边缘下侧有4个扬声器的出声孔,平板电脑的右侧边缘下侧有4个扬声器的出声孔。For another example, the four sound holes on the left edge of the electronic device are all opened on the lower side (or upper side) of the left edge, and the four sound holes are arranged adjacent to each other. Similarly, the four sound holes on the right edge of the electronic device are all opened on the lower side (or upper side) of the right edge, and the four sound holes are arranged adjacent to each other. For example, as shown in FIG2 , there are four speaker sound holes on the lower side of the left edge of the tablet computer, and there are four speaker sound holes on the lower side of the right edge of the tablet computer.
再以电子设备为手机为例,扬声器的出声孔可以部署在手机的上下两侧。Taking a mobile phone as an example, the speaker holes can be arranged on the upper and lower sides of the mobile phone.
示例性地,手机中配置有8个扬声器的情况,手机外壳的上侧边缘可以开设4个出声孔,下侧边缘可以开设4个出声孔。这样,可以使4个扬声器部署在手机的上侧边缘,4个扬声器部署在手机的下侧边缘。对称地部署在上下侧边缘的扬声器,也可以形成左右声道,扩展电子设备的声场。部署在上侧边缘左侧的扬声器与部署在下侧边缘左侧的扬声器对称。部署在上侧边缘右侧的扬声器与部署在下侧边缘右侧的扬声器也对称。For example, in the case where a mobile phone is equipped with 8 speakers, 4 sound holes can be opened on the upper edge of the mobile phone shell, and 4 sound holes can be opened on the lower edge. In this way, 4 speakers can be deployed on the upper edge of the mobile phone, and 4 speakers can be deployed on the lower edge of the mobile phone. The speakers deployed symmetrically on the upper and lower edges can also form left and right channels to expand the sound field of the electronic device. The speaker deployed on the left side of the upper edge is symmetrical with the speaker deployed on the left side of the lower edge. The speaker deployed on the right side of the upper edge is also symmetrical with the speaker deployed on the right side of the lower edge.
例如,部署于上侧边缘的4个扬声器中,2个扬声器部署在上侧边缘的左侧,2个扬声器部署在上侧边缘的右侧。同样,部署于下侧边缘的4个扬声器中,2个扬声器部署在下侧边缘的左侧,2个扬声器部署在下侧边缘的右侧。For example, among the four speakers deployed on the upper edge, two speakers are deployed on the left side of the upper edge and two speakers are deployed on the right side of the upper edge. Similarly, among the four speakers deployed on the lower edge, two speakers are deployed on the left side of the lower edge and two speakers are deployed on the right side of the lower edge.
如图3所示,手机的上侧边缘左侧有2个扬声器的出声孔,上侧边缘右侧有2个扬声器的出声孔。手机的下侧边缘左侧有2个扬声器的出声孔,下侧边缘右侧有2个扬声器的出声孔。As shown in FIG3 , there are two speaker holes on the left side of the upper edge of the mobile phone, and two speaker holes on the right side of the upper edge. There are two speaker holes on the left side of the lower edge of the mobile phone, and two speaker holes on the right side of the lower edge.
需要说明的是,上述上、下、左、右可以是以手机的外壳为参照物所确定的方向。示例性地,手机外壳上相对短的两条边缘分别为上侧边缘和下侧边缘,相对长的两条边缘分别为左侧边缘和右侧边缘。It should be noted that the above-mentioned up, down, left and right can be directions determined by taking the housing of the mobile phone as a reference. For example, the two relatively short edges of the mobile phone housing are the upper edge and the lower edge, and the two relatively long edges are the left edge and the right edge.
在手机的外壳上,上侧边缘靠近左侧边缘的部分可称为上侧边缘的左侧,靠近右侧边缘的部分可称为上侧边缘的右侧。同样,在下侧边缘靠近左侧边缘的部分可称为下侧边缘的左侧,靠近右侧边缘的部分可称为下侧边缘的右侧。On the housing of the mobile phone, the portion of the upper edge close to the left edge can be called the left side of the upper edge, and the portion close to the right edge can be called the right side of the upper edge. Similarly, the portion of the lower edge close to the left edge can be called the left side of the lower edge, and the portion close to the right edge can be called the right side of the lower edge.
在其他可能的实施例中,平板电脑的扬声器也可以部署在上侧边缘和下侧边缘。同样,手机的扬声器也可以部署在左侧边缘和右侧边缘,本申请实施例对此不作具体限定。In other possible embodiments, the speaker of the tablet computer may also be disposed on the upper edge and the lower edge. Similarly, the speaker of the mobile phone may also be disposed on the left edge and the right edge, which is not specifically limited in the embodiments of the present application.
在一些实施例中,将扬声器的出声孔部署在电子设备外壳的侧边缘(如,上侧边缘、下侧边缘、左侧边缘和右侧边缘),可以扩增电子设备的声场,也可以增强播出音频的立体感。然而,用户在使用电子设备的过程中,通常手会握住电子设备的侧边缘,这样,往往就会导致扬声器的出声孔被遮挡。In some embodiments, the sound outlet of the speaker is arranged at the side edge (e.g., the upper side edge, the lower side edge, the left side edge, and the right side edge) of the electronic device housing, which can amplify the sound field of the electronic device and enhance the stereoscopic sense of the broadcast audio. However, when a user uses an electronic device, he or she usually holds the side edge of the electronic device, which often causes the sound outlet of the speaker to be blocked.
可以理解,在扬声器播放音频期间,如果扬声器的出声孔被遮挡,会导致扬声器实际发出的音频受影响,比如,音量变小、音频对应的声波相位(可简称为音频相位)改变等。It is understandable that if the sound outlet of the speaker is blocked while the speaker is playing audio, the audio actually emitted by the speaker will be affected, for example, the volume will become smaller, the sound wave phase corresponding to the audio (which can be simply referred to as audio phase) will change, etc.
以电子设备为平板电脑为例,图4所示,用户使用平板电脑时,左手握住平板电脑的左侧边缘的下侧,右手握住右侧边缘的下侧。这样,不仅可以固定平板电脑的空间位置,还可以方便用户操作平板电脑。Taking a tablet computer as an example, as shown in FIG4 , when a user uses a tablet computer, the user holds the lower side of the left edge of the tablet computer with the left hand and holds the lower side of the right edge with the right hand. In this way, the spatial position of the tablet computer can be fixed and the user can operate the tablet computer conveniently.
在平板电脑中扬声器的部署位置如图1所示的场景下,用户的手部将不可避免的挡住部署在左侧边缘下侧和右侧边缘下侧的扬声器。在左侧边缘下侧和右侧边缘下侧的扬声器被遮挡时,会影响到平板电脑播放音频的效果。In the scenario where the speakers in the tablet computer are deployed at the positions shown in FIG1 , the user's hands will inevitably block the speakers deployed at the lower side of the left edge and the lower side of the right edge. When the speakers at the lower side of the left edge and the lower side of the right edge are blocked, the audio playback effect of the tablet computer will be affected.
示例性地,图5所示,平板电脑在播放同样的音频时,如果平板电脑左侧边缘下侧和右侧边缘下侧的扬声器被遮挡,那么用户在听觉上会感受到左侧边缘下侧和右侧边缘下侧的扬声器对应的播放音量下降。For example, as shown in FIG5 , when the tablet computer is playing the same audio, if the speakers at the lower left and right edges of the tablet computer are blocked, the user will hear a decrease in the playback volume corresponding to the speakers at the lower left and right edges.
又示例性地,平板电脑在播放音频时,如果平板电脑左侧边缘下侧和右侧边缘下侧的扬声器被遮挡,那么被遮挡的扬声器播出的音频相位会改变,这样,与平板电脑中其他扬声器播放音频叠加之后,由于音频在部分频段抵消,致使整体的音频相位也会发生改变。As another example, when the tablet computer is playing audio, if the speakers on the lower left and right edges of the tablet computer are blocked, the phase of the audio broadcast by the blocked speakers will change. In this way, after being superimposed with the audio played by other speakers in the tablet computer, the overall audio phase will also change due to the cancellation of the audio in some frequency bands.
这样,如图6所示,在扬声器被遮挡前、后,随着整体音频相位的改变,用户直观感受到的是声源位置发生改变。In this way, as shown in FIG6 , before and after the speaker is blocked, as the overall audio phase changes, the user intuitively feels that the position of the sound source changes.
比如,用户使用平板电脑玩射击类游戏时,平板电脑播放来自游戏世界中正左侧的脚步声。如果用户手部未遮挡扬声器,那么用户听到的脚步声源位于用户的正左侧。如果用户手部遮挡扬声器,那么用户听到的脚步声源会偏移到用户的左前侧。显然,平板电脑此时不能够准确展示游戏音效,影响到用户的使用体验。For example, when a user uses a tablet to play a shooting game, the tablet plays footsteps from the left side of the game world. If the user's hand does not block the speaker, the source of the footsteps heard by the user is located to the left of the user. If the user's hand blocks the speaker, the source of the footsteps heard by the user will shift to the left front of the user. Obviously, the tablet cannot accurately display the game sound effects at this time, affecting the user's experience.
另外,除了用户使用电子设备时,手部会遮挡扬声器出声孔之外,在扬声器的出声孔内堵塞异物、电子设备配置不合适的保护壳导致出声孔被遮挡等情况下,同样,也会出现扬声器实际发出的音频受影响的问题。In addition, in addition to the user's hands blocking the speaker sound holes when using an electronic device, the audio actually emitted by the speaker may also be affected if foreign objects are blocked in the speaker sound holes or the electronic device is equipped with an inappropriate protective case that causes the sound holes to be blocked.
为了改善上述问题,本申请实施例提供了一种扬声器控制方法。其中,该扬声器控制方法应用于配置有多个扬声器的电子设备。这样,该电子设备可以根据扬声器出声孔的遮挡情况(如,有、无遮挡,再如,有无堵塞,再如,遮挡程度,再如,堵塞情况),调整电子设备中至少一个扬声器所播放的音频,如,调整扬声器所播放的音频内容,再比如,调整扬声器所播放的音频相位、音频能量等。其中,调整音频相位之后,该音频对应的声波信号的相位会改变。调整音频能量之后,该音频对应的声波的振动幅度也会改变。In order to improve the above-mentioned problems, an embodiment of the present application provides a speaker control method. Among them, the speaker control method is applied to an electronic device equipped with multiple speakers. In this way, the electronic device can adjust the audio played by at least one speaker in the electronic device according to the obstruction of the speaker sound outlet (such as, whether it is obstructed or not, whether it is blocked or not, the degree of obstruction, and the blockage situation), such as adjusting the audio content played by the speaker, and for example, adjusting the audio phase and audio energy played by the speaker. Among them, after adjusting the audio phase, the phase of the sound wave signal corresponding to the audio will change. After adjusting the audio energy, the vibration amplitude of the sound wave corresponding to the audio will also change.
可以理解,电子设备通过调整扬声器所播放的音频,可以弥补扬声器受遮挡,对音频播放效果的影响,弥补原理可参考后续实施例中的描述,在此暂不详述。这样,不仅提升电子设备在音频播放方面的智能化程度,还能提高用户的使用体验。It can be understood that the electronic device can compensate for the impact of the speaker being blocked on the audio playback effect by adjusting the audio played by the speaker. The compensation principle can be referred to the description in the subsequent embodiments and will not be described in detail here. In this way, not only the intelligence level of the electronic device in audio playback is improved, but also the user experience is improved.
请参考图7,为本申请实施例提供的一种电子设备100的结构示意图。Please refer to FIG. 7 , which is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present application.
如图7所示,电子设备100可以包括:处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。As shown in Figure 7, the electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
其中,上述传感器模块180可以包括压力传感器,陀螺仪传感器,气压传感器,磁传感器,加速度传感器,距离传感器,接近光传感器,指纹传感器,温度传感器,触摸传感器,环境光传感器和骨传导传感器等传感器。Among them, the above-mentioned sensor module 180 may include sensors such as pressure sensor, gyroscope sensor, air pressure sensor, magnetic sensor, acceleration sensor, distance sensor, proximity light sensor, fingerprint sensor, temperature sensor, touch sensor, ambient light sensor and bone conduction sensor.
可以理解的是,本实施例示意的结构并不构成对电子设备100的具体限定。在另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and/or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuitsound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purposeinput/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (SIM) interface, and/or a universal serial bus (USB) interface, etc.
可以理解的是,本实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It is understandable that the interface connection relationship between the modules illustrated in this embodiment is only for illustrative purposes and does not constitute a structural limitation on the electronic device 100. In other embodiments, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
内部存储器121可以用于存储计算机可执行程序代码,可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行电子设备100的各种功能应用以及数据处理。The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121, and/or instructions stored in a memory provided in the processor.
显示屏194用于显示图像,视频等。该显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emittingdiode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrixorganic light emitting diode,AMOLED),柔性发光二极管(flex light-emittingdiode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot lightemitting diodes,QLED)等。The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc.
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括N个摄像头193,N为大于1的正整数。The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include N cameras 193, where N is a positive integer greater than 1.
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
在一些实施例中,电子设备中的大量核心部件,比如,处理器(中央处理器、图像处理器等)、内存以及多类主机控制器(host control)等,可以集成于主芯片中。主芯片的高集成度有助于缩小电子设备的物理空间,满足当前用户对电子设备追求轻量化、便携化的需求。In some embodiments, a large number of core components in electronic devices, such as processors (central processing units, image processors, etc.), memory, and various types of host controllers, can be integrated into the main chip. The high integration of the main chip helps to reduce the physical space of electronic devices and meet the current user demand for lightweight and portable electronic devices.
在一些实施例中,上述主芯片中集成有用于管理扬声器的主机控制器,简称扬声器控制器。另外,该主芯片还可以对应有多个音频数字接口,如,时分复用(time divisionmultiplexing,TDM)数字接口。每一个音频数字接口对应一个扬声器。换句话说,配置于电子设备中的扬声器可以通过音频数字接口接入扬声器控制器,并接收扬声器控制器发送的控制指令。这样,扬声器控制器可以控制各个扬声器所播放的音频。In some embodiments, the main chip is integrated with a host controller for managing the speaker, referred to as the speaker controller. In addition, the main chip can also correspond to multiple audio digital interfaces, such as a time division multiplexing (TDM) digital interface. Each audio digital interface corresponds to a speaker. In other words, the speaker configured in the electronic device can be connected to the speaker controller through the audio digital interface and receive the control instructions sent by the speaker controller. In this way, the speaker controller can control the audio played by each speaker.
例如,图8所示的电子设备中配置有8个扬声器,那么该电子设备的主芯片可以提供至少8个音频数字接口,如,主芯片提供了音频数字接口1、音频数字接口2、音频数字接口3、音频数字接口4、音频数字接口5、音频数字接口6、音频数字接口7、音频数字接口8。上述8个音频数字接口分别接有一个扬声器。每一个音频数字接口与接入该接口的扬声器可以组成一个扬声器通道。For example, the electronic device shown in FIG8 is equipped with 8 speakers, so the main chip of the electronic device can provide at least 8 audio digital interfaces, such as the main chip provides audio digital interface 1, audio digital interface 2, audio digital interface 3, audio digital interface 4, audio digital interface 5, audio digital interface 6, audio digital interface 7, and audio digital interface 8. The above 8 audio digital interfaces are respectively connected to a speaker. Each audio digital interface and the speaker connected to the interface can form a speaker channel.
在一些实施例中,电子设备可以对多个扬声器所对应的扬声通道进行编组,比如,将至少两个扬声器所对应的扬声通道编为一组。这样,属于同一组的扬声器用于播放同一音频数据。In some embodiments, the electronic device may group the speaker channels corresponding to the multiple speakers, for example, grouping the speaker channels corresponding to at least two speakers into one group, so that the speakers in the same group are used to play the same audio data.
示例性地,如图8所示,电子设备的8个扬声器中,包含4个高频扬声器和4个低频扬声器的情况下,可以将一个高频扬声器和一个低频扬声器所对应的扬声器通道编为一组。Exemplarily, as shown in FIG8 , when the eight speakers of the electronic device include four high-frequency speakers and four low-frequency speakers, the speaker channels corresponding to one high-frequency speaker and one low-frequency speaker may be grouped together.
比如,音频数字接口1和一个低频扬声器组成一个扬声器通道、音频数字接口2和一个高频扬声器组成一个扬声器通道,将音频数据接口1和音频数字接口2所对应的扬声器通道编为一组。同理,音频数字接口3和音频数字接口4所对应的扬声器通道可以编为一组,音频数字接口5和音频数字接口6所对应的扬声器通道可以编为一组,音频数字接口7和音频数字接口8所对应的扬声器通道可以编为一组。For example, audio digital interface 1 and a low-frequency speaker form a speaker channel, audio digital interface 2 and a high-frequency speaker form a speaker channel, and the speaker channels corresponding to audio data interface 1 and audio digital interface 2 are grouped together. Similarly, the speaker channels corresponding to audio digital interface 3 and audio digital interface 4 can be grouped together, the speaker channels corresponding to audio digital interface 5 and audio digital interface 6 can be grouped together, and the speaker channels corresponding to audio digital interface 7 and audio digital interface 8 can be grouped together.
这样,在音频数据中包括高频部分和低频部分的情况下,由同组中的高频扬声器播放(播放)音频数据中的高频部分,同组中的低频扬声器播放音频数据中的低频部分。In this way, when the audio data includes a high-frequency part and a low-frequency part, the high-frequency part of the audio data is played (played) by the high-frequency speakers in the same group, and the low-frequency part of the audio data is played by the low-frequency speakers in the same group.
在一些实施例中,扬声器通道的编组可以预先配置,同组扬声器通道所对应的扬声器出声孔在电子设备上相邻排布。In some embodiments, the grouping of speaker channels can be pre-configured, and the speaker sound holes corresponding to the same group of speaker channels are arranged adjacent to each other on the electronic device.
比如,电子设备是图1所示的平板电脑时,平板电脑左侧边缘下侧的扬声器可以编为一组,平板电脑左侧边缘上侧的扬声器可以编为一组,平板电脑右侧边缘下侧的扬声器可以编为一组,平板电脑右侧边缘上侧的扬声器可以编为一组。For example, when the electronic device is a tablet computer as shown in FIG1 , the speakers on the lower left side of the tablet computer can be grouped into a group, the speakers on the upper left side of the tablet computer can be grouped into a group, the speakers on the lower right side of the tablet computer can be grouped into a group, and the speakers on the upper right side of the tablet computer can be grouped into a group.
在一些实施例中,电子设备可以通过主芯片控制各组扬声器通道所需播放的音频,也可以控制各扬声器所需播放的音频的能量、相位等。In some embodiments, the electronic device can control the audio to be played by each group of speaker channels through the main chip, and can also control the energy, phase, etc. of the audio to be played by each speaker.
可以理解,在检测到特定的业务需求时,电子设备可以依据业务需求,播放对应的音频数据。其中,上述特定的业务需求可以是指示播放音频的业务需求。It is understandable that when a specific service requirement is detected, the electronic device can play the corresponding audio data according to the service requirement, wherein the specific service requirement can be a service requirement for instructing to play audio.
示例性地,上述特定的业务需求可以是电子设备运行应用程序期间,由用户操作或者应用业务逻辑触发生成的业务需求。Exemplarily, the above-mentioned specific business demand may be a business demand generated by user operation or application business logic triggering during the running of an application program on the electronic device.
比如,视频应用是可以播放视频数据a的应用程序,视频数据a包含音频数据a。这样,在运行视频应用期间,用户作出指示播放视频数据a的操作,电子设备可以确定当前具有播放音频数据a的业务需求,该业务需求可以指示电子设备播放音频数据a。For example, a video application is an application that can play video data a, and video data a includes audio data a. Thus, during the operation of the video application, if a user makes an operation to instruct to play video data a, the electronic device can determine that there is currently a business demand to play audio data a, and the business demand can instruct the electronic device to play audio data a.
再比如,在启动具有游戏音效的游戏应用之后,电子设备可以确定当前具有播放游戏音频数据的业务需求,该业务需求可以指示电子设备播放对应的游戏音频数据。For another example, after starting a game application with game sound effects, the electronic device may determine that there is currently a business demand for playing game audio data, and the business demand may instruct the electronic device to play the corresponding game audio data.
再比如,社交应用的业务逻辑包括对社交信息进行响铃提醒。这样,运行社交应用时,接收到社交信息时,电子设备可以确定当前具有播放响铃音频的业务需求,该业务需求可以指示电子设备播放响铃音频。For another example, the business logic of a social application includes ringing a reminder for social information. Thus, when the social application is running and social information is received, the electronic device can determine that there is a business demand for playing a ringing audio, and the business demand can instruct the electronic device to play the ringing audio.
在一些场景下,电子设备所需播放的音频数据可以是单个音频,比如,响铃音频。In some scenarios, the audio data that the electronic device needs to play may be a single audio, such as a ringing audio.
在电子设备所播放的音频数据是单个音频的场景下,电子设备可以通过主芯片控制所有扬声器通道都播放该音频,也即,所有的扬声器通道播放的音频内容相同。另外,电子设备还可以通过主芯片控制各个扬声器播出的音频数据的音频相位和音频能量等,使电子设备在播放该音频数据时可达到理想的音效。具体实现方式,可参考相关技术,在此不再赘述。In the scenario where the audio data played by the electronic device is a single audio, the electronic device can control all speaker channels to play the audio through the main chip, that is, all speaker channels play the same audio content. In addition, the electronic device can also control the audio phase and audio energy of the audio data broadcast by each speaker through the main chip, so that the electronic device can achieve the ideal sound effect when playing the audio data. For the specific implementation method, please refer to the relevant technology, which will not be repeated here.
在另一些场景下,电子设备所需播放的音频数据也可以是多类音频组合的数据,不同类音频所对应的音频内容可以不同。比如,由背景音、脚步声音效、枪声音效中一项或多项组成的游戏音频数据。再比如,由背景音、台词音效中一项或多项组成的音频数据a。In other scenarios, the audio data that the electronic device needs to play may also be a combination of multiple types of audio data, and the audio content corresponding to different types of audio may be different. For example, game audio data composed of one or more of background sound, footstep sound effects, and gunshot sound effects. Another example is audio data a composed of one or more of background sound and dialogue sound effects.
在电子设备所播放的音频数据是多类音频组合的数据的场景下,电子设备可以从音频数据中确定出各组扬声器通道需要播放的音频,并通过主芯片控制各组扬声器通道播放对应的音频。其中,在各组扬声器通道中,可能存在多组扬声器通道对应的音频相同,也可能存在不同组的扬声器通道对应的音频不同。In the scenario where the audio data played by the electronic device is a combination of multiple types of audio data, the electronic device can determine the audio that each group of speaker channels needs to play from the audio data, and control each group of speaker channels to play the corresponding audio through the main chip. Among them, in each group of speaker channels, there may be multiple groups of speaker channels corresponding to the same audio, or there may be different groups of speaker channels corresponding to different audio.
在一些实施例中,配置在电子设备同侧边缘的扬声器通道播放的音频相同,配置在电子设备不同侧边缘的扬声器通道播放的音频不同。In some embodiments, speaker channels configured on the same side edge of the electronic device play the same audio, and speaker channels configured on different side edges of the electronic device play different audio.
以电子设备为平板电脑为例。如图9所示,平板电脑播放的音频数据包括常规音效、特定音效1和特定音效2。Take the electronic device as a tablet computer as an example. As shown in FIG9 , the audio data played by the tablet computer includes a regular sound effect, a specific sound effect 1 and a specific sound effect 2.
其中,上述特定音效1和特定音效2均属于特定音效。该特定音效可以是预先选定类型的音效。可以理解,该特定音效是音频数据中较为重要的音频,也可以是用户不希望播放效果受影响的音频。Among them, the above-mentioned specific sound effect 1 and specific sound effect 2 are both specific sound effects. The specific sound effect can be a pre-selected type of sound effect. It can be understood that the specific sound effect is a relatively important audio in the audio data, or it can be an audio that the user does not want the playback effect to be affected.
比如,音频数据为射击类游戏的游戏音频数据,该游戏音频数据包括背景音、脚步音效、枪声音效等。如果预先选定类型的音效包括脚步音效、枪声音效,那么可以确定游戏音频数据中出现的脚步音效、枪声音效均为特定音效。其中,来自游戏世界左侧的脚步音效、枪声音效确定为特定音效1。来自游戏世界右侧的脚步音效、枪声音效确定为特定音效2。For example, the audio data is the game audio data of a shooting game, and the game audio data includes background sound, footstep sound effects, gunshot sound effects, etc. If the pre-selected types of sound effects include footstep sound effects and gunshot sound effects, then it can be determined that the footstep sound effects and gunshot sound effects appearing in the game audio data are all specific sound effects. Among them, the footstep sound effects and gunshot sound effects from the left side of the game world are determined as specific sound effect 1. The footstep sound effects and gunshot sound effects from the right side of the game world are determined as specific sound effect 2.
另外,上述常规音效可以是指特定音效之外的其他音频,接上例,游戏音频数据中的常规音效可以是背景音。In addition, the above-mentioned regular sound effects may refer to other audios other than specific sound effects. Continuing with the above example, the regular sound effects in the game audio data may be background sounds.
在一些示例中,电子设备中可以配置有第一集合,该第一集合由多种音频类型组成。比如,第一集合包含脚步音效、枪声音效、对话音效等音频类型。In some examples, the electronic device may be configured with a first set, which is composed of multiple audio types. For example, the first set includes audio types such as footstep sound effects, gunshot sound effects, and dialogue sound effects.
示例性地,该第一集合可以是应用程序中的用于记录特定音效的配置文件,该配置文件中包括至少一类音效的类型标识。这样,在解析应用程序的配置文件时,可以获得该应用程序对应的第一集合。比如,射击类游戏的配置文件中,解析出的第一集合中,可以包含脚步音效和枪声音效。再比如,视频应用的配置文件中,解析出的第一集合中,包含对话音效等。Exemplarily, the first set may be a configuration file in an application for recording specific sound effects, and the configuration file includes a type identifier of at least one type of sound effect. In this way, when parsing the configuration file of an application, the first set corresponding to the application may be obtained. For example, in a configuration file of a shooting game, the parsed first set may include footstep sound effects and gunshot sound effects. For another example, in a configuration file of a video application, the parsed first set may include dialogue sound effects, etc.
又示例性地,该第一集合还可以是系统文件中的用于记录特定音效的配置文件。As another example, the first set may also be a configuration file in a system file for recording specific sound effects.
在一些实施例中,与第一集合中类型标识匹配的音效也即特定音效。电子设备默认属于特定音效的音频所对应的预设优先级高于不属于特定音效的音频。当然,在其他可能的实施例中,电子设备内还可以预配置一个列表,该列表中包含多类音频及对应的优先级,这样,通过查表的方式,可以确定出各类音频所对应的优先级。In some embodiments, the sound effects that match the type identifier in the first set are also specific sound effects. The electronic device defaults that the preset priority corresponding to the audio belonging to the specific sound effect is higher than the audio not belonging to the specific sound effect. Of course, in other possible embodiments, a list can also be preconfigured in the electronic device, and the list contains multiple types of audio and corresponding priorities. In this way, the priorities corresponding to various types of audio can be determined by looking up the table.
上述音频所对应的优先级,在判断是否交换音频所对应的扬声器时,具有较高的参考价值,一定程度上,保障优先级更高的音频所对应的播放效果。The priority corresponding to the above audio has a high reference value when determining whether to exchange the speakers corresponding to the audio, and to a certain extent, guarantees the playback effect corresponding to the audio with a higher priority.
在上述举例中,平板电脑左侧边缘的扬声器通道,可以用于播放常规音效和特定音效1。比如,在常规音效需要播放时,主芯片控制左侧边缘的扬声器通道播放该常规音效。此时,该扬声器通道实际播出的声波信号,是常规音频对应的声波信号。同样,在特定音效1需要播放时,主芯片控制左侧边缘的扬声器通道播放该特定音效1。此时,该扬声器通道实际播出的声波信号,是特定音效1对应的声波信号。在常规音效和特定音效1需要同时播放时,主芯片可以将常规音效和特定音效1进行混音之后,控制左侧边缘的扬声器通道进行播放。此时,该扬声器通道实际播出的声波信号,是上述混音所对应的声波信号。In the above example, the speaker channel on the left edge of the tablet computer can be used to play regular sound effects and specific sound effect 1. For example, when a regular sound effect needs to be played, the main chip controls the speaker channel on the left edge to play the regular sound effect. At this time, the sound wave signal actually broadcast by the speaker channel is the sound wave signal corresponding to the regular audio. Similarly, when specific sound effect 1 needs to be played, the main chip controls the speaker channel on the left edge to play the specific sound effect 1. At this time, the sound wave signal actually broadcast by the speaker channel is the sound wave signal corresponding to specific sound effect 1. When regular sound effects and specific sound effect 1 need to be played at the same time, the main chip can mix the regular sound effects and specific sound effect 1, and then control the speaker channel on the left edge to play. At this time, the sound wave signal actually broadcast by the speaker channel is the sound wave signal corresponding to the above-mentioned mixing.
另外,平板电脑右侧边缘的扬声器通道,可以用于播放常规音效和特定音效2。比如,在常规音效需要播放时,主芯片控制右侧边缘的扬声器通道播放该常规音效。此时,该扬声器通道实际播出的声波信号,是常规音频对应的声波信号。同样,在特定音效1需要播放时,主芯片控制右侧边缘的扬声器通道播放该特定音效1。此时,该扬声器通道实际播出的声波信号,是特定音效1对应的声波信号。在常规音效和特定音效1需要同时播放时,主芯片可以将常规音效和特定音效1进行混音之后,控制右侧边缘的扬声器通道进行播放。此时,该扬声器通道实际播出的声波信号,是上述混音所对应的声波信号。In addition, the speaker channel on the right edge of the tablet computer can be used to play regular sound effects and specific sound effect 2. For example, when a regular sound effect needs to be played, the main chip controls the speaker channel on the right edge to play the regular sound effect. At this time, the sound wave signal actually broadcast by the speaker channel is the sound wave signal corresponding to the regular audio. Similarly, when a specific sound effect 1 needs to be played, the main chip controls the speaker channel on the right edge to play the specific sound effect 1. At this time, the sound wave signal actually broadcast by the speaker channel is the sound wave signal corresponding to the specific sound effect 1. When regular sound effects and specific sound effect 1 need to be played at the same time, the main chip can mix the regular sound effects and specific sound effect 1, and then control the speaker channel on the right edge to play. At this time, the sound wave signal actually broadcast by the speaker channel is the sound wave signal corresponding to the above-mentioned mixing.
如图9所示,平板电脑中扬声器通道已进行编组,图9中相对每组扬声器通道显示的“常规音效+特定音效1”或“常规音效+特定音效2”,指示需由该组扬声器通道协同播放的音频。As shown in FIG. 9 , the speaker channels in the tablet computer have been grouped. The “normal sound effect + specific sound effect 1” or “normal sound effect + specific sound effect 2” displayed relative to each group of speaker channels in FIG. 9 indicates the audio that needs to be played collaboratively by the group of speaker channels.
另外,在特定场景下,左侧边缘的扬声器通道和右侧边缘的扬声器通道所播放的音频可以互换。比如,特定场景可以是平板电脑旋转至原左侧边缘的扬声器朝向用户的右侧,原右侧边缘的扬声器朝向用户的左侧。比如,图9所示的平板电脑,在检测到平板电脑旋转180度,也即,原左侧边缘的扬声器朝向用户的右侧,原右侧边缘的扬声器朝向用户的左侧的情况下,由原左侧边缘的扬声器通道播放常规音效和特定音效2,由原右侧边缘的扬声器通道播放常规音效和特定音效1。In addition, in a specific scenario, the audio played by the speaker channel on the left edge and the speaker channel on the right edge can be interchanged. For example, a specific scenario may be that the tablet computer is rotated so that the speaker on the original left edge faces the right side of the user, and the speaker on the original right edge faces the left side of the user. For example, the tablet computer shown in FIG9 detects that the tablet computer is rotated 180 degrees, that is, the speaker on the original left edge faces the right side of the user, and the speaker on the original right edge faces the left side of the user, then the normal sound effect and the specific sound effect 2 are played by the speaker channel on the original left edge, and the normal sound effect and the specific sound effect 1 are played by the speaker channel on the original right edge.
在另一些实施例中,电子设备中配置于同侧边缘的扬声器通道所播放的音频也可以不同。In other embodiments, the audio played by the speaker channels arranged on the same side edge of the electronic device may also be different.
继续以电子设备为平板电脑为例。如图10所示,在平板电脑播放的音频数据包括背景音、特定音效1和特定音效2的情况下,可以由平板电脑左侧边缘下侧的扬声器通道播放特定音效1,由平板电脑左侧边缘上侧的扬声器通道播放背景音。另外,还可以由平板电脑右侧边缘下侧的扬声器通道播放特定音效2,由平板电脑右侧边缘上侧的扬声器通道播放背景音。Continuing to take the electronic device as a tablet computer as an example. As shown in FIG10 , when the audio data played by the tablet computer includes background sound, specific sound effect 1 and specific sound effect 2, specific sound effect 1 can be played by the speaker channel on the lower side of the left edge of the tablet computer, and the background sound can be played by the speaker channel on the upper side of the left edge of the tablet computer. In addition, specific sound effect 2 can also be played by the speaker channel on the lower side of the right edge of the tablet computer, and the background sound can be played by the speaker channel on the upper side of the right edge of the tablet computer.
总之,在本申请实施例中,电子设备在需要播放音频数据的情况下,可以从该音频数据中,识别各类特定音效。然后,控制特定的扬声器通道播放特定音效。在一些示例中,单个特定的扬声器通道可用于播放至少一类特定音效,当然,该扬声器通道也可以用于播放常规音效。也就是,类似于如图9所示,扬声器通道不仅可以播放特定音效,还可以播放常规音效。在另外一些示例中,单个特定的扬声器通道仅用于播放特定音效,由其他扬声器通道播放常规音效,也就是,类似于如图10所示,特定的扬声器通道只用于播放特定音效,其他扬声器通道用于播放常规音效。In summary, in an embodiment of the present application, when the electronic device needs to play audio data, it can identify various types of specific sound effects from the audio data. Then, a specific speaker channel is controlled to play the specific sound effect. In some examples, a single specific speaker channel can be used to play at least one type of specific sound effect. Of course, the speaker channel can also be used to play regular sound effects. That is, similar to what is shown in Figure 9, the speaker channel can not only play specific sound effects, but also regular sound effects. In some other examples, a single specific speaker channel is only used to play specific sound effects, and other speaker channels play regular sound effects. That is, similar to what is shown in Figure 10, a specific speaker channel is only used to play specific sound effects, and other speaker channels are used to play regular sound effects.
另外,上述特定的扬声器通道可以是电子设备中符合预设规则的扬声器通道。示例性地,满足预设规则的扬声器通道可以是以下任意一种:In addition, the above-mentioned specific speaker channel may be a speaker channel in the electronic device that meets a preset rule. Exemplarily, the speaker channel that meets the preset rule may be any of the following:
(1)同侧边缘的扬声器通道中,扬声器位于同侧边缘下侧的扬声器通道。(1) Among the speaker channels on the same side edge, the speakers are located in the speaker channels on the lower side of the same side edge.
(2)同侧边缘的扬声器通道中,扬声器位于同侧边缘上侧的扬声器通道。(2) Among the speaker channels on the same side edge, the speaker is located on the upper side of the same side edge.
(3)电子设备中的所有扬声器通道。(3) All speaker channels in an electronic device.
(4)标记有特定标识的音频数字接口所属的扬声器通道。其中,上述音频数字接口的特定标识可以预先配置。例如,可以由电子设备的开发者进行配置,再如,也可以由电子设备的使用者进行配置,本申请实施例对此不作具体限定。(4) The speaker channel to which the audio digital interface marked with a specific identifier belongs. The specific identifier of the audio digital interface can be pre-configured. For example, it can be configured by the developer of the electronic device, or by the user of the electronic device, and the embodiments of the present application do not specifically limit this.
另外,上述特定标识还可以包括多类特定标识,比如,左声道特定标识和右声道特定标识。In addition, the above-mentioned specific identifier may also include multiple types of specific identifiers, such as a left channel specific identifier and a right channel specific identifier.
作为一种实现方式,电子设备中配置音频数字接口与特定标识之间的映射关系表,电子设备可以根据预先配置的映射关系表通过特定的扬声器通道播放特定音效,通过其他扬声器通道播放常规音效。例如,映射关系如表1所示:As an implementation method, a mapping relationship table between an audio digital interface and a specific identifier is configured in the electronic device, and the electronic device can play a specific sound effect through a specific speaker channel and play a regular sound effect through other speaker channels according to the pre-configured mapping relationship table. For example, the mapping relationship is shown in Table 1:
表1Table 1
如表1所示,该映射关系表中包括电子设备中的所有音频数据接口,如,音频数据接口1至音频数据接口8。另外,映射关系表中还包含标记有特定标识的音频数据接口,如,音频数据接口1、音频数据接口2、音频数据接口7和音频数据接口8。上述映射关系表中还包含各个音频数据接口对应的特定标识类型,比如,音频数据接口1、音频数据接口2对应有左声道特定标识,音频数据接口7、音频数据接口8对应有右声道特定标识。As shown in Table 1, the mapping relationship table includes all audio data interfaces in the electronic device, such as audio data interface 1 to audio data interface 8. In addition, the mapping relationship table also includes audio data interfaces marked with specific identifiers, such as audio data interface 1, audio data interface 2, audio data interface 7, and audio data interface 8. The above mapping relationship table also includes specific identification types corresponding to each audio data interface, for example, audio data interface 1 and audio data interface 2 correspond to left channel specific identifiers, and audio data interface 7 and audio data interface 8 correspond to right channel specific identifiers.
在上述实现方式中,电子设备还可以响应开发者或者使用者的操作,调整映射关系表中音频数据接口与各类特定标识之间的对应关系,实现配置音频数据接口对应的特定标识。In the above implementation, the electronic device can also respond to the operation of the developer or user to adjust the correspondence between the audio data interface and various specific identifiers in the mapping table to configure the specific identifier corresponding to the audio data interface.
另外,在特定标识包括多种类型的情况下,电子设备还可以根据特定标识的类别,确定用于播放各类特定音效的扬声器通道。比如,电子设备播放游戏音频数据期间,确定采用具有左声道特定标识的扬声器通道,播放游戏世界中来自游戏角色左侧的特定音效,如,左侧的脚步声。再比如,电子设备播放游戏音频数据期间,确定采用具有右声道特定标识的扬声器通道,播放游戏世界中来自游戏角色右侧的特定音效,如,来自右侧的脚步声。In addition, when the specific identifier includes multiple types, the electronic device can also determine the speaker channel used to play various specific sound effects according to the category of the specific identifier. For example, when the electronic device plays game audio data, it is determined to use the speaker channel with the specific identifier of the left channel to play specific sound effects from the left side of the game character in the game world, such as footsteps on the left side. For another example, when the electronic device plays game audio data, it is determined to use the speaker channel with the specific identifier of the right channel to play specific sound effects from the right side of the game character in the game world, such as footsteps from the right side.
作为一种实现方式,电子设备中还可以预配置不同类的特定音效与各类特定标识之间的对应关系1。这样,电子设备确定需要播放任意一类特定音效,如称为特定音效a之后,电子设备可以根据上述对应关系1,确定与特定音效a对应的特定标识,如称为特定标识a。之后,结合映射关系表,确定与特定标识a对应的音频数据接口a。这样,可以控制音频数据接口a所对应的扬声器通道播放该特定音效a。As an implementation method, the electronic device may also pre-configure a correspondence 1 between different types of specific sound effects and various types of specific identifiers. In this way, after the electronic device determines that any type of specific sound effect, such as specific sound effect a, needs to be played, the electronic device may determine the specific identifier corresponding to the specific sound effect a, such as specific identifier a, according to the above correspondence 1. Then, in combination with the mapping relationship table, the audio data interface a corresponding to the specific identifier a is determined. In this way, the speaker channel corresponding to the audio data interface a may be controlled to play the specific sound effect a.
在一些实施例中,电子设备播放音频数据期间,如果检测到扬声器受到遮挡,可以调整一组或多组扬声器通道播放的音频。In some embodiments, when the electronic device is playing audio data, if it is detected that a speaker is blocked, the audio played by one or more groups of speaker channels can be adjusted.
示例性的场景,用户手部遮挡扬声器在电子设备外壳上的出声孔时,电子设备能够检测到该扬声器通道受到遮挡。可以理解,电子设备检测该扬声器通道是否受到遮挡的实现方式,可参考相关技术,比如,通过检测扬声器对应的阻抗值的方式,判断扬声器通道是否受到遮挡,以及受到遮挡的程度,具体实现细节,在此不再赘述。In an exemplary scenario, when a user covers the sound outlet of a speaker on the housing of an electronic device with his hand, the electronic device can detect that the speaker channel is blocked. It can be understood that the electronic device can detect whether the speaker channel is blocked by referring to related technologies, for example, by detecting the impedance value corresponding to the speaker, to determine whether the speaker channel is blocked and the degree of the blockage. The specific implementation details will not be repeated here.
示例性的场景,扬声器的出声孔被异物堵塞时,电子设备也可以识别到该扬声器通道受到遮挡。In an exemplary scenario, when the sound outlet of a speaker is blocked by a foreign object, the electronic device can also recognize that the speaker channel is blocked.
在一些实施例中,电子设备调整一组或多组扬声器通道所播放的音频的方式,包括以下多种:In some embodiments, the electronic device adjusts the audio played by one or more speaker channels in the following ways:
第一种方式,电子设备可以仅调整存在遮挡的扬声器通道(也即,扬声器被遮挡的扬声器通道,后续可称为扬声器通道a)所播放的音频。比如,调整该组扬声器通道a所播放音频的音频能量和音频相位等。In the first way, the electronic device can adjust only the audio played by the speaker channel with occlusion (that is, the speaker channel with the speaker blocked, which may be referred to as speaker channel a later). For example, the audio energy and audio phase of the audio played by the speaker channel a group are adjusted.
可以理解的,扬声器通道被遮挡或堵塞时,即使播放相同的音频,对应扬声器通道实际播出的声波信号会发生改变,比如,相位会改变,振动幅度也会改变。这些改变,对于用户而言,听到的音量会减少,感知到的声源位置也会改变。It is understandable that when a speaker channel is blocked or clogged, even if the same audio is played, the actual sound wave signal broadcast by the corresponding speaker channel will change, for example, the phase will change, and the vibration amplitude will change. For users, these changes will reduce the volume they hear and change the perceived sound source location.
如图11所示,扬声器通道a未遮挡或堵塞的情况下,扬声器通道a播放对应的音频时,实际播出的声波信号a与其他扬声器通道播出的声波信号b,叠加之后得到声波信号c。在扬声器通道a遮挡或堵塞的情况下,扬声器通道a播放的音频会出现相移,也即,扬声器通道a实际播出的声波信号a的相位会发生改变。另外,相移后的声波信号a和声波信号b,叠加之后得到声波信号d。As shown in Figure 11, when speaker channel a is not blocked or blocked, when speaker channel a plays the corresponding audio, the actual broadcast sound wave signal a and the sound wave signal b broadcast by other speaker channels are superimposed to obtain sound wave signal c. When speaker channel a is blocked or blocked, the audio played by speaker channel a will be phase shifted, that is, the phase of the sound wave signal a actually broadcast by speaker channel a will change. In addition, the sound wave signal a and the sound wave signal b after the phase shift are superimposed to obtain the sound wave signal d.
如图11所示,声波信号d与原声波信号c之间的相位也发生变化,同时,在声波信号a的相位变化之后,声波信号a与声波信号b的部分频段的声波会发生抵消现象,叠加后得到的声波信号d的振动幅度也会相较于声波信号c更小。As shown in Figure 11, the phase between the sound wave signal d and the original sound wave signal c also changes. At the same time, after the phase of the sound wave signal a changes, the sound waves in some frequency bands of the sound wave signal a and the sound wave signal b will cancel each other out, and the vibration amplitude of the sound wave signal d obtained after superposition will also be smaller than that of the sound wave signal c.
此时,电子设备在调制须由扬声器通道a播放的音频时,可以调整该音频的相位,从而,补偿扬声器通道a受遮挡造成的相移。比如,扬声器通道a被遮挡之后,实际播出的音频移动二分之π的相位,那么调制须由扬声器通道a播放的音频时,需补偿二分之π的相位。At this time, when the electronic device modulates the audio to be played by speaker channel a, it can adjust the phase of the audio, thereby compensating for the phase shift caused by the occlusion of speaker channel a. For example, after speaker channel a is blocked, the actual broadcast audio shifts the phase by half of π, so when modulating the audio to be played by speaker channel a, it is necessary to compensate for the phase by half of π.
另外,如图11所示,扬声器通道a遮挡或堵塞时,扬声器通道a播放对应的音频时,实际播出的声波信号a的振动幅度也衰减。In addition, as shown in FIG11 , when the speaker channel a is blocked or clogged, the vibration amplitude of the sound wave signal a actually broadcasted also attenuates when the speaker channel a plays the corresponding audio.
此时,电子设备在调制须由扬声器通道a播放的音频时,可以调整该音频的音频能量,从而,补偿扬声器通道a受遮挡造成的振动幅度衰减。At this time, when the electronic device modulates the audio to be played by the speaker channel a, it can adjust the audio energy of the audio, thereby compensating for the attenuation of the vibration amplitude caused by the occlusion of the speaker channel a.
也就是,在本申请实施例中,电子设备可以通过调整音频相位和音频能量等方式,将扬声器通道a实际播出的声波信号调整至未遮挡扬声器通道a之前的状态。另外,在其他实施例中,还可以通过相关技术中调整音频的方式,将扬声器通道a实际播出的声波信号调整至未遮挡扬声器通道a之前的状态,本申请实施例中,对此不作具体限定。这样,对于用户而言,扬声器通道是否受遮挡,都不会影响用户听到的声音。That is, in the embodiment of the present application, the electronic device can adjust the sound wave signal actually broadcasted by the speaker channel a to the state before the speaker channel a is not blocked by adjusting the audio phase and audio energy. In addition, in other embodiments, the sound wave signal actually broadcasted by the speaker channel a can be adjusted to the state before the speaker channel a is not blocked by adjusting the audio in the relevant technology, and this is not specifically limited in the embodiment of the present application. In this way, for the user, whether the speaker channel is blocked or not will not affect the sound heard by the user.
以电子设备是图9所示的平板电脑为例。Take the electronic device as a tablet computer as shown in FIG9 as an example.
如图12所示,在没有扬声器通道受到遮挡或堵塞的情况下,平板电脑左侧边缘上侧配置的一组扬声器通道,用于播放常规音效和/或特定音效1。平板电脑左侧边缘下侧配置的一组扬声器通道,也用于播放常规音效和/或特定音效1。平板电脑右侧边缘上侧配置的一组扬声器通道,用于播放常规音效和/或特定音效2。平板电脑右侧边缘下侧配置的一组扬声器通道,也用于播放常规音效和/或特定音效2。As shown in FIG12 , when no speaker channel is blocked or clogged, a group of speaker channels configured on the upper side of the left edge of the tablet computer is used to play regular sound effects and/or specific sound effect 1. A group of speaker channels configured on the lower side of the left edge of the tablet computer is also used to play regular sound effects and/or specific sound effect 1. A group of speaker channels configured on the upper side of the right edge of the tablet computer is used to play regular sound effects and/or specific sound effect 2. A group of speaker channels configured on the lower side of the right edge of the tablet computer is also used to play regular sound effects and/or specific sound effect 2.
如图12所示,在左侧边缘下侧的一组扬声器通道存在遮挡或堵塞的情况下,也即,配置于左侧边缘下侧的一组扬声器通道是扬声器通道a的情况下,调整左侧边缘下侧的一组扬声器通道所播放的音频,也即,控制该扬声器通道播放调整后的常规音效和/或特定音效1。As shown in Figure 12, when a group of speaker channels on the lower side of the left edge are blocked or clogged, that is, when a group of speaker channels configured on the lower side of the left edge is speaker channel a, adjust the audio played by a group of speaker channels on the lower side of the left edge, that is, control the speaker channel to play the adjusted regular sound effects and/or specific sound effects 1.
如图12所示,在右侧边缘下侧的一组扬声器通道存在扬声器被遮挡或堵塞的情况下,也即,配置于右侧边缘下侧的一组扬声器通道是扬声器通道a的情况下,调整右侧边缘下侧的一组扬声器通道所播放的音频,也即,控制该扬声器通道播放调整后的常规音效和/或特定音效2。As shown in Figure 12, when a group of speaker channels on the lower side of the right edge have their speakers blocked or clogged, that is, when a group of speaker channels arranged on the lower side of the right edge are speaker channels a, adjust the audio played by a group of speaker channels on the lower side of the right edge, that is, control the speaker channels to play the adjusted regular sound effects and/or specific sound effects 2.
可以理解,上述调整可以包括对音频相位、音频能量等进行的调整。通过对音频相位、音频能量,使扬声器通道遮挡前、后实际播出的声波信号相似(如,对应的相位和振动幅度均接近相等),也可以使用户实际听到的音量不变化。It is understood that the above adjustment may include adjustment of audio phase, audio energy, etc. By adjusting the audio phase and audio energy, the sound wave signals actually broadcast before and after the speaker channel is blocked are made similar (for example, the corresponding phase and vibration amplitude are nearly equal), and the volume actually heard by the user can also remain unchanged.
当然,图12示例性地展示了左侧边缘下侧和右侧边缘下侧的扬声器通道属于扬声器通道a的场景。可以理解,其他组的扬声器通道存在扬声器被遮挡或堵塞的场景下,处理方式同理,在此不再赘述。Of course, Figure 12 exemplarily shows the scenario where the speaker channels at the lower side of the left edge and the lower side of the right edge belong to speaker channel a. It can be understood that the speaker channels of other groups are handled in the same way when the speakers are blocked or blocked, which will not be repeated here.
第二种方式,电子设备可以暂停使用该组扬声器通道a,同时,调整同侧且未被遮挡的扬声器通道(如称为扬声器通道b)所播放的音频。In the second way, the electronic device can pause the use of the group of speaker channels a, and at the same time, adjust the audio played by the speaker channel on the same side and not blocked (such as speaker channel b).
其中,调整扬声器通道b所播放的音频可以包括调整所播放音频的音频相位和音频能量。另外,调整扬声器通道b所播放的音频还可以包括调整所播放的音频内容。Wherein, adjusting the audio played by the speaker channel b may include adjusting the audio phase and audio energy of the played audio. In addition, adjusting the audio played by the speaker channel b may also include adjusting the played audio content.
示例1:以电子设备是图9所示的平板电脑为例。如图13所示,在没有扬声器受到遮挡或堵塞的情况下,平板电脑左侧边缘上侧配置的一组扬声器通道,用于播放常规音效和/或特定音效1。平板电脑左侧边缘下侧配置的一组扬声器通道,也用于播放常规音效和/或特定音效1。平板电脑右侧边缘上侧配置的一组扬声器通道,用于播放常规音效和/或特定音效2。平板电脑右侧边缘下侧配置的一组扬声器通道,也用于播放常规音效和/或特定音效2。Example 1: Take the electronic device as the tablet computer shown in FIG9 as an example. As shown in FIG13, when no speaker is blocked or blocked, a group of speaker channels configured on the upper side of the left edge of the tablet computer is used to play regular sound effects and/or specific sound effect 1. A group of speaker channels configured on the lower side of the left edge of the tablet computer is also used to play regular sound effects and/or specific sound effect 1. A group of speaker channels configured on the upper side of the right edge of the tablet computer is used to play regular sound effects and/or specific sound effect 2. A group of speaker channels configured on the lower side of the right edge of the tablet computer is also used to play regular sound effects and/or specific sound effect 2.
如图13所示,在左侧边缘下侧的一组扬声器通道存在扬声器被遮挡或堵塞的情况下,也即,配置于左侧边缘下侧的一组扬声器通道是扬声器通道a的情况下,左侧边缘下侧的一组扬声器通道暂停播放音频。另外,配置于左侧边缘上侧的一组扬声器通道,也即,扬声器通道b播放调整后的常规音效和/或特定音效1。As shown in FIG13 , when a speaker of a group of speaker channels at the lower side of the left edge is blocked or clogged, that is, when a group of speaker channels arranged at the lower side of the left edge is speaker channel a, the group of speaker channels at the lower side of the left edge pauses playing audio. In addition, a group of speaker channels arranged at the upper side of the left edge, that is, speaker channel b, plays the adjusted regular sound effects and/or specific sound effect 1.
如图13所示,在右侧边缘下侧的一组扬声器通道存在扬声器被遮挡或堵塞的情况下,也即,配置于右侧边缘下侧的一组扬声器通道是扬声器通道a的情况下,右侧边缘下侧的一组扬声器通道暂停播放音频。另外,配置于右侧边缘上侧的一组扬声器通道,也即,扬声器通道b播放调整后的常规音效和/或特定音效2。As shown in FIG13 , when a speaker in a group of speaker channels at the lower side of the right edge is blocked or clogged, that is, when a group of speaker channels arranged at the lower side of the right edge is speaker channel a, the group of speaker channels at the lower side of the right edge pauses playing audio. In addition, a group of speaker channels arranged at the upper side of the right edge, that is, speaker channel b, plays the adjusted regular sound effects and/or specific sound effects 2.
在上述示例1中提到的调整可以包括针对音频相位、音频能量等进行调整。The adjustments mentioned in the above Example 1 may include adjustments to audio phase, audio energy, etc.
可以理解,在扬声器通道a被遮挡或堵塞前,扬声器通道a和对应的扬声器通道b实际播出的声波信号叠加得到声波信号e。在扬声器通道a被遮挡或堵塞后,扬声器通道a和对应的扬声器通道b实际播出的声波信号叠加得到声波信号f。经过对扬声器通道b所需播出的音频进行音频相位、音频能量的调整,可以使声波信号e与声波信号f之间的相位差和振动幅度之差都变小。另外,也可以使用户实际听到的音量不变化。It can be understood that before the speaker channel a is blocked or blocked, the sound wave signals actually broadcast by the speaker channel a and the corresponding speaker channel b are superimposed to obtain the sound wave signal e. After the speaker channel a is blocked or blocked, the sound wave signals actually broadcast by the speaker channel a and the corresponding speaker channel b are superimposed to obtain the sound wave signal f. By adjusting the audio phase and audio energy of the audio required to be broadcast by the speaker channel b, the phase difference and vibration amplitude difference between the sound wave signal e and the sound wave signal f can be reduced. In addition, the volume actually heard by the user can also remain unchanged.
示例2:以电子设备是图10所示的平板电脑为例。如图14所示,在没有扬声器通道受到遮挡或堵塞的情况下,平板电脑左侧边缘上侧配置的一组扬声器通道,用于播放常规音效。平板电脑左侧边缘下侧配置的一组扬声器通道,用于播放特定音效1。平板电脑右侧边缘上侧配置的一组扬声器通道,用于播放常规音效。平板电脑右侧边缘下侧配置的一组扬声器通道,也用于播放特定音效2。Example 2: Take the electronic device as a tablet computer as shown in FIG10 as an example. As shown in FIG14, when no speaker channel is blocked or blocked, a group of speaker channels configured on the upper side of the left edge of the tablet computer is used to play general sound effects. A group of speaker channels configured on the lower side of the left edge of the tablet computer is used to play specific sound effect 1. A group of speaker channels configured on the upper side of the right edge of the tablet computer is used to play general sound effects. A group of speaker channels configured on the lower side of the right edge of the tablet computer is also used to play specific sound effect 2.
如图14所示,在左侧边缘下侧的一组扬声器通道存在遮挡或堵塞的情况下,也即,配置于左侧边缘下侧的一组扬声器通道是扬声器通道a的情况下,左侧边缘下侧的一组扬声器通道暂停播放音频。另外,配置于左侧边缘上侧的一组扬声器通道,也即,扬声器通道b播放调整后的常规音效和/或特定音效1。也即,原本不用播放特定音效1的扬声器通道b,在左侧边缘下侧的扬声器通道被遮挡或堵塞时,除了播放常规音效之外,还需要播放特定音效1。这样,电子设备实现调整对应的扬声器通道b所播放的音频内容。As shown in FIG14 , when a group of speaker channels on the lower side of the left edge are blocked or clogged, that is, when a group of speaker channels arranged on the lower side of the left edge are speaker channels a, the group of speaker channels on the lower side of the left edge pause playing audio. In addition, a group of speaker channels arranged on the upper side of the left edge, that is, speaker channels b, play the adjusted regular sound effects and/or specific sound effect 1. That is, speaker channel b, which originally does not need to play specific sound effect 1, needs to play specific sound effect 1 in addition to playing regular sound effects when the speaker channel on the lower side of the left edge is blocked or clogged. In this way, the electronic device adjusts the audio content played by the corresponding speaker channel b.
如图14所示,在右侧边缘下侧的一组扬声器通道存在扬声器被遮挡或堵塞的情况下,也即,配置于右侧边缘下侧的一组扬声器通道是扬声器通道a的情况下,右侧边缘下侧的一组扬声器通道暂停播放音频。另外,配置于右侧边缘上侧的一组扬声器通道,也即,扬声器通道b播放调整后的常规音效和/或特定音效2。也即,原本不用播放特定音效2的扬声器通道b,在右侧边缘下侧的扬声器通道被遮挡时,除了播放常规音效之外,还需要播放特定音效2。这样,电子设备实现调整对应的扬声器通道b所播放的音频内容。As shown in FIG14 , when a speaker in a group of speaker channels on the lower side of the right edge is blocked or clogged, that is, when a group of speaker channels configured on the lower side of the right edge is speaker channel a, the group of speaker channels on the lower side of the right edge pause playing audio. In addition, a group of speaker channels configured on the upper side of the right edge, that is, speaker channel b, plays the adjusted regular sound effects and/or specific sound effect 2. That is, speaker channel b, which originally does not need to play specific sound effect 2, needs to play specific sound effect 2 in addition to regular sound effects when the speaker channel on the lower side of the right edge is blocked. In this way, the electronic device adjusts the audio content played by the corresponding speaker channel b.
第三种方式,在该组扬声器通道a所播放的音频中包含特定音效时,电子设备不仅可以调整扬声器通道a所播放的音频,还可以调整与扬声器通道a同侧且未被遮挡的扬声器通道(如称为扬声器通道b)所播放的音频。如果不存在与扬声器通道a同侧且未遮挡的扬声器通道,还可以调整任意一个未遮挡的扬声器通道所播放的音频。In a third manner, when the audio played by the group of speaker channels a includes a specific sound effect, the electronic device can adjust not only the audio played by speaker channel a, but also the audio played by a speaker channel (such as speaker channel b) on the same side as speaker channel a and not blocked. If there is no speaker channel on the same side as speaker channel a and not blocked, the audio played by any unblocked speaker channel can also be adjusted.
以电子设备是图9所示的平板电脑为例。如图15所示,在没有扬声器通道受到遮挡或堵塞的情况下,平板电脑左侧边缘上侧配置的一组扬声器通道,用于播放常规音效和/或特定音效1。平板电脑左侧边缘下侧配置的一组扬声器通道,也用于播放常规音效和/或特定音效1。平板电脑右侧边缘上侧配置的一组扬声器通道,用于播放常规音效和/或特定音效2。平板电脑右侧边缘下侧配置的一组扬声器通道,也用于播放常规音效和/或特定音效2。Take the electronic device as a tablet computer as shown in FIG9 as an example. As shown in FIG15, when no speaker channel is blocked or blocked, a group of speaker channels configured on the upper side of the left edge of the tablet computer is used to play regular sound effects and/or specific sound effect 1. A group of speaker channels configured on the lower side of the left edge of the tablet computer is also used to play regular sound effects and/or specific sound effect 1. A group of speaker channels configured on the upper side of the right edge of the tablet computer is used to play regular sound effects and/or specific sound effect 2. A group of speaker channels configured on the lower side of the right edge of the tablet computer is also used to play regular sound effects and/or specific sound effect 2.
如图15所示,在左侧边缘下侧的一组扬声器通道存在遮挡或堵塞的情况下,也即,配置于左侧边缘下侧的一组扬声器通道是扬声器通道a的情况下,左侧边缘下侧的一组扬声器通道不再播放特定音效1,但是,该扬声器通道还可以继续播放常规音效。另外,配置于左侧边缘上侧的一组扬声器通道,也即,对应的扬声器通道b播放调整后的常规音效和/或特定音效1。As shown in FIG15 , when a group of speaker channels on the lower side of the left edge are blocked or clogged, that is, when the group of speaker channels configured on the lower side of the left edge is speaker channel a, the group of speaker channels on the lower side of the left edge no longer play the specific sound effect 1, but the speaker channel can continue to play the regular sound effect. In addition, the group of speaker channels configured on the upper side of the left edge, that is, the corresponding speaker channel b, plays the adjusted regular sound effect and/or the specific sound effect 1.
比如,在仅播放常规音频时,不做任何处理;在仅播放特定音效1时,调整特定音效1所对应的声波相位和振动幅度,并进行播放;在同时需要播放特定音效1和常规音频时,对常规音频和特定音效1进行混音之后,调整混音所对应的声波相位和振动幅度,并进行播放。这样,电子设备实现调整扬声器通道a和对应的扬声器通道b所需播放的音频。For example, when only regular audio is played, no processing is performed; when only specific sound effect 1 is played, the sound wave phase and vibration amplitude corresponding to specific sound effect 1 are adjusted and played; when specific sound effect 1 and regular audio need to be played at the same time, the regular audio and specific sound effect 1 are mixed, and the sound wave phase and vibration amplitude corresponding to the mixing are adjusted and played. In this way, the electronic device adjusts the audio to be played by speaker channel a and the corresponding speaker channel b.
如图15所示,在右侧边缘下侧的一组扬声器通道存在遮挡或堵塞的情况下,也即,配置于右侧边缘下侧的一组扬声器通道是扬声器通道a的情况下,右侧边缘下侧的一组扬声器通道不再播放特定音效2,但是,该扬声器通道可以继续播放常规音效。另外,配置于右侧边缘上侧的一组扬声器通道,也即,扬声器通道b播放调整后的常规音效和/或特定音效2。As shown in FIG15 , when a group of speaker channels on the lower side of the right edge is blocked or clogged, that is, when the group of speaker channels configured on the lower side of the right edge is speaker channel a, the group of speaker channels on the lower side of the right edge no longer plays the specific sound effect 2, but the speaker channel can continue to play the regular sound effect. In addition, the group of speaker channels configured on the upper side of the right edge, that is, speaker channel b, plays the adjusted regular sound effect and/or specific sound effect 2.
比如,在仅播放常规音频时,不做任何处理;在仅播放特定音效2时,调整特定音效2所对应的声波相位和振动幅度,并进行播放;在同时需要播放特定音效2和常规音频时,对常规音频和特定音效2进行混音之后,调整混音所对应的声波相位和振动幅度,并进行播放。这样,电子设备实现调整扬声器通道a和对应的扬声器通道b所需播放的音频。For example, when only regular audio is played, no processing is performed; when only specific sound effect 2 is played, the sound wave phase and vibration amplitude corresponding to specific sound effect 2 are adjusted and played; when specific sound effect 2 and regular audio need to be played at the same time, the regular audio and specific sound effect 2 are mixed, and the sound wave phase and vibration amplitude corresponding to the mixing are adjusted and played. In this way, the electronic device adjusts the audio to be played by speaker channel a and the corresponding speaker channel b.
以电子设备是图10所示的平板电脑为例。如图16所示,在没有扬声器通道受到遮挡或堵塞的情况下,平板电脑左侧边缘上侧配置的一组扬声器通道,用于播放常规音效。平板电脑左侧边缘下侧配置的一组扬声器通道,用于播放特定音效1。平板电脑右侧边缘上侧配置的一组扬声器通道,用于播放常规音效。平板电脑右侧边缘下侧配置的一组扬声器通道,也用于播放特定音效2。Take the electronic device as a tablet computer shown in FIG10 as an example. As shown in FIG16, when no speaker channel is blocked or blocked, a group of speaker channels configured on the upper side of the left edge of the tablet computer is used to play regular sound effects. A group of speaker channels configured on the lower side of the left edge of the tablet computer is used to play specific sound effect 1. A group of speaker channels configured on the upper side of the right edge of the tablet computer is used to play regular sound effects. A group of speaker channels configured on the lower side of the right edge of the tablet computer is also used to play specific sound effect 2.
如图16所示,在左侧边缘下侧的一组扬声器通道存在遮挡或堵塞的情况下,也即,配置于左侧边缘下侧的一组扬声器通道是扬声器通道a的情况下,电子设备可以控制左侧边缘下侧的一组扬声器通道仅播放常规音效,控制左侧边缘上侧的一组扬声器通道仅播放特定音效1。也即,原本不用播放特定音效1的扬声器通道b,在左侧边缘下侧的扬声器通道被遮挡或堵塞时,不再播放常规音效,而是播放特定音效1。确保更为重要的特定音效不受扬声器遮挡的影响。As shown in FIG16 , when a group of speaker channels on the lower side of the left edge are blocked or clogged, that is, when a group of speaker channels configured on the lower side of the left edge is speaker channel a, the electronic device can control a group of speaker channels on the lower side of the left edge to play only regular sound effects, and control a group of speaker channels on the upper side of the left edge to play only specific sound effect 1. That is, speaker channel b, which originally does not need to play specific sound effect 1, will no longer play regular sound effects, but will play specific sound effect 1 when the speaker channel on the lower side of the left edge is blocked or clogged. This ensures that more important specific sound effects are not affected by speaker blocking.
如图16所示,在右侧边缘下侧的一组扬声器通道存在遮挡或堵塞的情况下,也即,配置于右侧边缘下侧的一组扬声器通道是扬声器通道a的情况下,电子设备可以控制右侧边缘下侧的一组扬声器通道仅播放常规音效,控制右侧边缘上侧的一组扬声器通道仅播放特定音效2。也即,原本播放常规音效的扬声器通道b,在右侧边缘下侧的扬声器通道被遮挡或堵塞时,不再播放常规音效,而是播放特定音效2。确保更为重要的特定音效不受扬声器遮挡的影响。As shown in FIG16 , when a group of speaker channels on the lower side of the right edge is blocked or clogged, that is, when a group of speaker channels configured on the lower side of the right edge is speaker channel a, the electronic device can control a group of speaker channels on the lower side of the right edge to play only regular sound effects, and control a group of speaker channels on the upper side of the right edge to play only specific sound effect 2. That is, speaker channel b, which originally plays regular sound effects, no longer plays regular sound effects, but plays specific sound effect 2 when the speaker channel on the lower side of the right edge is blocked or clogged. This ensures that the more important specific sound effects are not affected by speaker blocking.
在其他可能的实施例中,对于不同特定场景,还可以采用不同的处理方式。In other possible embodiments, different processing methods may be used for different specific scenarios.
比如,在一组扬声器通道a所播放的音频中不包含特定音效的情况下,电子设备也可以不对各扬声器通道播放的音频作调整。For example, when the audio played by a group of speaker channels a does not include a specific sound effect, the electronic device may not adjust the audio played by each speaker channel.
再比如,电子设备中一侧边缘的扬声器通道均受到遮挡或堵塞的情况,可以由另一侧边缘的扬声器通道播放所有的音频数据。或者说,可以通过调整被遮挡或堵塞的扬声器通道的所需播放的音频,弥补扬声器通道遮挡带来的影响。For another example, if the speaker channels on one edge of the electronic device are blocked or clogged, all audio data can be played by the speaker channels on the other edge. In other words, the impact of the speaker channel blockage can be compensated by adjusting the audio to be played by the blocked or clogged speaker channel.
再比如,一组扬声器通道a中低频扬声器所对应通道受遮挡,但是高频扬声器未受遮挡的情况下,在需要由扬声器通道a播放音频中的高频部分时,视扬声器通道a未遮挡,也就是,可以正常进行音频的播放,无需做额外的处理。在需要由扬声器通道a播放音频中的低频部分时,视扬声器通道a受遮挡,可以按照前述方式调整一组或多组扬声器通道所需播放的音频。For another example, if the channel corresponding to the low-frequency speaker in a group of speaker channels a is blocked, but the high-frequency speaker is not blocked, when the high-frequency part of the audio needs to be played by speaker channel a, it is regarded as speaker channel a is not blocked, that is, the audio can be played normally without additional processing. When the low-frequency part of the audio needs to be played by speaker channel a, it is regarded as speaker channel a is blocked, and the audio to be played by one or more groups of speaker channels can be adjusted in the above manner.
在一些实施例中,电子设备还可以根据扬声器通道的遮挡程度(或堵塞程度),调整一组或多组扬声器通道所播放的音频。其中,上述遮挡程度(或堵塞程度)可以是电子设备根据扬声器的阻抗值,量化得到比值。In some embodiments, the electronic device may also adjust the audio played by one or more speaker channels according to the degree of obstruction (or blockage) of the speaker channels. The degree of obstruction (or blockage) may be a ratio quantified by the electronic device according to the impedance value of the speaker.
示例性地,电子设备可以获取每一个扬声器未遮挡时对应的阻抗值a,以及完全遮挡时的阻抗值b,然后,将阻抗值a与0%对应,将阻抗值b与100%对应。最后,可以将阻抗值a和阻抗值b之间的阻抗值量化为0%至100%之间的比值。For example, the electronic device can obtain the impedance value a corresponding to each speaker when it is not blocked, and the impedance value b when it is completely blocked, and then correspond the impedance value a to 0% and the impedance value b to 100%. Finally, the impedance value between the impedance value a and the impedance value b can be quantified as a ratio between 0% and 100%.
这样,电子设备可以根据各个扬声器实时的阻抗值,确定对应扬声器通道的遮挡程度(或堵塞程度)。In this way, the electronic device can determine the degree of shielding (or blocking) of the corresponding speaker channel according to the real-time impedance value of each speaker.
在确定各个扬声器通道对应的遮挡程度(或堵塞程度)之后,电子设备可以判断该遮挡程度(或堵塞程度)是否超过预设阈值。其中,该预设阈值可以是系统默认值,也可以是用户配置的值,比如,该预设阈值可以是50%。After determining the degree of occlusion (or blockage) corresponding to each speaker channel, the electronic device may determine whether the degree of occlusion (or blockage) exceeds a preset threshold value, wherein the preset threshold value may be a system default value or a user-configured value, for example, the preset threshold value may be 50%.
在超过预设阈值的情况下,采用前述实施例中的第二种方式,实现调整一组或多组扬声器通道所播放的音频。在未超过预设阈值且不为0的情况下,采用前述实施例中的第一种方式或第三种方式,实现调整一组或多组扬声器通道所播放的音频。When the preset threshold is exceeded, the second method in the above embodiment is adopted to adjust the audio played by one or more speaker channels. When the preset threshold is not exceeded and is not 0, the first method or the third method in the above embodiment is adopted to adjust the audio played by one or more speaker channels.
以电子设备是图9所示的平板电脑为例。如图17所示,在左侧边缘下侧的一组扬声器通道存在遮挡(或堵塞),且遮挡程度(或堵塞程度)未超过的预设阈值情况下,由左侧边缘下侧的一组扬声器通道播放调整后的常规音效和/或特定音效1。Take the electronic device as the tablet computer shown in FIG9 as an example. As shown in FIG17 , when a group of speaker channels at the lower side of the left edge are blocked (or blocked) and the degree of blockage (or blockage) does not exceed the preset threshold, the group of speaker channels at the lower side of the left edge plays the adjusted regular sound effect and/or specific sound effect 1.
如图17所示,在右侧边缘下侧的一组扬声器通道的遮挡程度(或堵塞程度)超过的预设阈值情况下,可以控制右侧边缘上侧的一组扬声器通道暂停播放音频。同时,控制右侧边缘上侧的一组扬声器通道播放调整后的常规音效和/或特定音效2。As shown in FIG17 , when the degree of occlusion (or blockage) of a group of speaker channels on the lower side of the right edge exceeds a preset threshold, a group of speaker channels on the upper side of the right edge can be controlled to pause playing audio. At the same time, a group of speaker channels on the upper side of the right edge can be controlled to play the adjusted regular sound effects and/or specific sound effects 2.
以电子设备是图10所示的平板电脑为例。如图18所示,在左侧边缘下侧的一组扬声器通道存在遮挡(或堵塞),且遮挡程度(或堵塞程度)未超过的预设阈值情况下,由左侧边缘下侧的一组扬声器通道播放常规音效,由左侧边缘上侧的一组扬声器通道播放特定音效1。Take the electronic device as a tablet computer as shown in FIG10 as an example. As shown in FIG18 , when a group of speaker channels at the lower side of the left edge are blocked (or blocked) and the degree of blockage (or blockage) does not exceed the preset threshold, a group of speaker channels at the lower side of the left edge plays regular sound effects, and a group of speaker channels at the upper side of the left edge plays specific sound effects 1.
如图18所示,在右侧边缘下侧的一组扬声器通道的遮挡程度(或堵塞程度)超过的预设阈值情况下,由右侧边缘上侧的一组扬声器通道播放调整后的常规音效和/或特定音效2,右侧边缘下侧的一组扬声器通道暂停播放音频。As shown in Figure 18, when the degree of occlusion (or blockage) of a group of speaker channels on the lower side of the right edge exceeds a preset threshold, a group of speaker channels on the upper side of the right edge play the adjusted regular sound effects and/or specific sound effects 2, and a group of speaker channels on the lower side of the right edge pause playing audio.
总之,在一些实施例中,如图19所示,上述扬声器控制方法可以包括以下步骤:In summary, in some embodiments, as shown in FIG19 , the above speaker control method may include the following steps:
S101,确定待播放的音频数据,音频数据包括第一音频和第二音频。S101, determining audio data to be played, where the audio data includes a first audio and a second audio.
在一些实施例中,电子设备可以根据检测到的特定的业务需求,确定所需播放的音频数据。为了方面介绍上述方法,在此,以需要播放的音频数据包含第一音频和第二音频进行举例。In some embodiments, the electronic device may determine the audio data to be played according to the detected specific service requirements. In order to facilitate the introduction of the above method, an example is given herein where the audio data to be played includes the first audio and the second audio.
另外,上述第一音频和第二音频可以是不同的音频。比如,第一音频可以是前述实施例中的特定音效1,第二音频可以是前述实施例中的常规音效。再比如,第一音频可以是前述实施例中的常规音效,第二音频可以是前述实施例中的特定音效1。再比如,第一音频可以是前述实施例中的常规音效和特定音效1,第二音频可以是前述实施例中的常规音效和特定音效2。In addition, the first audio and the second audio may be different audios. For example, the first audio may be the specific sound effect 1 in the aforementioned embodiment, and the second audio may be the regular sound effect in the aforementioned embodiment. For another example, the first audio may be the regular sound effect in the aforementioned embodiment, and the second audio may be the specific sound effect 1 in the aforementioned embodiment. For another example, the first audio may be the regular sound effect and the specific sound effect 1 in the aforementioned embodiment, and the second audio may be the regular sound effect and the specific sound effect 2 in the aforementioned embodiment.
S102,控制第一扬声器播放第一音频,以及控制第二扬声器播放第二音频。S102, controlling the first speaker to play the first audio, and controlling the second speaker to play the second audio.
在一些实施例中,上述第一扬声器和第二扬声器可以是电子设备中两个配置于同侧的扬声器的示例。比如,第一扬声器和第二扬声器都配置于电子设备的同侧边缘,也即,对应的出声孔的朝向相同。In some embodiments, the first speaker and the second speaker may be examples of two speakers disposed on the same side of the electronic device. For example, the first speaker and the second speaker are both disposed on the same side edge of the electronic device, that is, the corresponding sound outlets face the same direction.
在一些实施例中,确定出需要播放的音频数据之后,还需要确定各个扬声器所需播放的部分。其中,确定各个扬声器所需播放的音频的方式可参考前述实施例中的描述,比如,根据音效类型与扬声器通道之间的对应关系,确定各个扬声器需要播放的音效。在此,直接以第一扬声器播放第一音频,第二扬声器播放第二音频进行举例。In some embodiments, after determining the audio data to be played, it is also necessary to determine the part that each speaker needs to play. The method of determining the audio to be played by each speaker can refer to the description in the above embodiments, for example, according to the correspondence between the sound effect type and the speaker channel, the sound effect to be played by each speaker is determined. Here, the first speaker plays the first audio and the second speaker plays the second audio for example.
S103,在第一扬声器的出声孔被遮挡的情况下,调整第一扬声器和/或第二扬声器所播放的音频。S103: When the sound outlet of the first speaker is blocked, adjust the audio played by the first speaker and/or the second speaker.
示例性地,在第一扬声器的出声孔被遮挡的情况下,可以控制第一扬声器播放经过调整的第一音频。其中,上述调整第一音频的方式可以是:在调制须由第一扬声器播放的第一音频时,改变第一音频的声波相位和音频能量,从而,也可以改变第一扬声器实际播出的声波信号的相位和振动幅度。Exemplarily, when the sound outlet of the first speaker is blocked, the first speaker can be controlled to play the adjusted first audio. The first audio can be adjusted by changing the sound wave phase and audio energy of the first audio when modulating the first audio to be played by the first speaker, thereby also changing the phase and vibration amplitude of the sound wave signal actually broadcast by the first speaker.
在一些实施例中,在条件1下,控制第一扬声器播放经过调整的第一音频。其中,上述条件1可以包括以下任意一项:In some embodiments, under condition 1, the first speaker is controlled to play the adjusted first audio. The condition 1 may include any one of the following:
(1)获取第一扬声器的出声孔对应的第一遮挡占比(也即,第一扬声器的遮挡程度),确定第一遮挡占比小于第一阈值(预设阈值)。(1) Obtain a first occlusion ratio corresponding to a sound outlet of a first speaker (that is, an occlusion degree of the first speaker), and determine that the first occlusion ratio is less than a first threshold (preset threshold).
(2)确定第二音频的预设优先级高于第一音频。比如,第二音频属于特定音频,第一音频属于常规音频。(2) Determine that the preset priority of the second audio is higher than that of the first audio. For example, the second audio is a specific audio and the first audio is a regular audio.
示例性地,在第一扬声器的出声孔被遮挡的情况下,控制第二扬声器播放第一音频。Exemplarily, when the sound outlet of the first speaker is blocked, the second speaker is controlled to play the first audio.
在一些示例中,在控制第二扬声器播放第一音频之前,控制第一扬声器可以停止播放第一音频,也可以不停止播放第一音频,本申请实施例对此不作限定。In some examples, before controlling the second speaker to play the first audio, controlling the first speaker may stop playing the first audio or may not stop playing the first audio, which is not limited in the embodiments of the present application.
在另一些实施例中,在第一音频的预设优先级高于第二音频的情况下,例如,第一音频属于特定音频,第二音频属于常规音频时,还可以在控制第二扬声器播放第一音频的同时,控制第二扬声器停止播放第二音频,以及控制第一扬声器播放第二音频。通过互换第一音频和第二音频所用的扬声器的方式,保障优先级更高的第一音频能够更好的被播出。In other embodiments, when the preset priority of the first audio is higher than that of the second audio, for example, when the first audio is a specific audio and the second audio is a regular audio, the second speaker can be controlled to stop playing the second audio while the second speaker is controlled to play the first audio, and the first speaker can be controlled to play the second audio. By exchanging the speakers used for the first audio and the second audio, it is ensured that the first audio with a higher priority can be better broadcasted.
在一些实施例中,在条件2下,电子设备选择控制第二扬声器播放第一音频控制的方式,保障音频输出质量。其中,条件2包括:获取第一扬声器的出声孔对应的第一遮挡占比;确定所述第一遮挡占比不小于第一阈值。In some embodiments, under condition 2, the electronic device selects a method of controlling the second speaker to play the first audio control to ensure the audio output quality. Wherein, condition 2 includes: obtaining a first occlusion ratio corresponding to the sound outlet of the first speaker; and determining that the first occlusion ratio is not less than a first threshold.
在其他实施例中,在控制第二扬声器播放第一音频的情况下,第二扬声器继续播放所述第二音频,类似于图14所示。In other embodiments, when the second speaker is controlled to play the first audio, the second speaker continues to play the second audio, similar to that shown in FIG. 14 .
在其他实施例中,电子设备还可以包括第三扬声器和第四扬声器。其中,第三扬声器和第四扬声器也可以配置在电子设备的同侧边缘,也即,二者的出声孔朝向也可以相同。In other embodiments, the electronic device may further include a third speaker and a fourth speaker, wherein the third speaker and the fourth speaker may also be arranged on the same side edge of the electronic device, that is, the sound outlets of the two speakers may also face the same direction.
在第三扬声器和第四扬声器都播放第三音频的情况下,检测到第三扬声器的出声孔被遮挡,可以控制第三扬声器停止播放第三音频。控制第四扬声器播放第四音频,第四音频是经过声波相位和振动幅度调整后的第三音频。When the third speaker and the fourth speaker are both playing the third audio, if it is detected that the sound outlet of the third speaker is blocked, the third speaker can be controlled to stop playing the third audio, and the fourth speaker can be controlled to play the fourth audio, which is the third audio after the sound wave phase and vibration amplitude are adjusted.
在另一些实施例中,在第三扬声器和第四扬声器都播放第五音频和第六音频的情况下,检测到第三扬声器的出声孔被遮挡;在第五音频是第一类型的音频,也即,属于特定音效,且第六音频不是第一类型的音频情况下,控制第三扬声器仅播放第六音频;控制第四扬声器播放第七音频和第六音频,第七音频是经过声波相位和振动幅度调整后的第五音频,类似于图15所示。In other embodiments, when the third speaker and the fourth speaker both play the fifth audio and the sixth audio, it is detected that the sound outlet of the third speaker is blocked; when the fifth audio is the first type of audio, that is, belongs to a specific sound effect, and the sixth audio is not the first type of audio, the third speaker is controlled to only play the sixth audio; the fourth speaker is controlled to play the seventh audio and the sixth audio, and the seventh audio is the fifth audio after the sound wave phase and vibration amplitude are adjusted, similar to that shown in Figure 15.
另外,电子设备中包括第一集合,所述第一集合包括多个音频类型标识,与所述第一集合中音频类型标识匹配的音频为所述第一类型的音频。In addition, the electronic device includes a first set, the first set includes multiple audio type identifiers, and the audio matching the audio type identifier in the first set is the first type of audio.
下面结合几个常见的应用场景,如,用户使用电子设备玩游戏的场景以及用户使用电子设备看视频的场景,介绍本申请实施例提供的扬声器控制方法的实现效果。The following introduces the implementation effect of the speaker control method provided in the embodiment of the present application in combination with several common application scenarios, such as a scenario in which a user uses an electronic device to play games and a scenario in which a user uses an electronic device to watch videos.
为了方便描述,以电子设备包含扬声器通道1和扬声器通道2为例,该扬声器通道1和扬声器通道2所对应的扬声器出声孔可以配置于电子设备外壳的同一侧。For the convenience of description, taking an electronic device including a speaker channel 1 and a speaker channel 2 as an example, the speaker sound holes corresponding to the speaker channel 1 and the speaker channel 2 can be arranged on the same side of the electronic device housing.
在用户使用电子设备玩枪击类游戏的场景下,该枪击类游戏对应的游戏音频数据包含背景音、枪声音效、脚步声音效和游戏角色音效。在一些示例中,在枪击类游戏对应的配置文件中,指定枪声音效、脚步声音效为特定音效的情况下,电子设备可以确定枪声音效和脚步声音效为特定音效,而背景音、游戏角色音效为常规音效。在另一些示例中,电子设备中的系统配置文件中,指定枪声音效、脚步声音效为特定音效的情况下,电子设备也可以确定枪声音效和脚步声音效为特定音效,而背景音、游戏角色音效为常规音效。In the scenario where a user uses an electronic device to play a shooting game, the game audio data corresponding to the shooting game includes background sound, gunshot sound effects, footstep sound effects, and game character sound effects. In some examples, in the configuration file corresponding to the shooting game, when gunshot sound effects and footstep sound effects are specified as specific sound effects, the electronic device can determine that the gunshot sound effects and footstep sound effects are specific sound effects, while the background sound and game character sound effects are regular sound effects. In other examples, in the system configuration file in the electronic device, when gunshot sound effects and footstep sound effects are specified as specific sound effects, the electronic device can also determine that the gunshot sound effects and footstep sound effects are specific sound effects, while the background sound and game character sound effects are regular sound effects.
示例性地,在电子设备运行枪击类游戏时,扬声器通道1和扬声器通道2均用于播放背景音、枪声音效、脚步声音效和游戏角色音效。也即,如果实时需要播放的音频数据中包含背景音,那么扬声器通道1和扬声器通道2均播放背景音。如果实时需要播放的音频数据中包含背景音和脚步声音效时,扬声器通道1和扬声器通道2均播放混音后的背景音和脚步声音效,以此类推。For example, when the electronic device runs a shooting game, speaker channel 1 and speaker channel 2 are both used to play background sound, gunshot sound effects, footstep sound effects, and game character sound effects. That is, if the audio data that needs to be played in real time contains background sound, then speaker channel 1 and speaker channel 2 both play the background sound. If the audio data that needs to be played in real time contains background sound and footstep sound effects, speaker channel 1 and speaker channel 2 both play the mixed background sound and footstep sound effects, and so on.
在电子设备检测到扬声器通道1被遮挡时,可以调整须由扬声器通道1播放的音频(如,背景音、枪声音效、脚步声音效和游戏角色音效)的相位和音频强度。When the electronic device detects that speaker channel 1 is blocked, the phase and audio intensity of the audio to be played by speaker channel 1 (such as background sound, gunshot sound effects, footsteps sound effects, and game character sound effects) can be adjusted.
或者,在电子设备检测到扬声器通道1被遮挡时,控制扬声器通道1停止播放音频,并调整须由扬声器通道2播放的音频(如,背景音、枪声音效、脚步声音效和游戏角色音效)的相位和强度。Alternatively, when the electronic device detects that speaker channel 1 is blocked, it controls speaker channel 1 to stop playing audio and adjusts the phase and intensity of the audio that must be played by speaker channel 2 (such as background sound, gunshot sound effects, footsteps sound effects, and game character sound effects).
又示例性地,在电子设备运行枪击类游戏时,扬声器通道1用于播放枪声音效和脚步声音效,扬声器通道2用于背景音和游戏角色音效。As another example, when the electronic device runs a shooting game, speaker channel 1 is used to play gunshot sound effects and footstep sound effects, and speaker channel 2 is used for background sounds and game character sound effects.
在电子设备检测到扬声器通道1被遮挡时,控制扬声器通道1播放背景音和游戏角色音效。控制扬声器通道2播放枪声音效和脚步声音效。也即,互换扬声器通道1和扬声器通道2所需播放的音频。When the electronic device detects that speaker channel 1 is blocked, speaker channel 1 is controlled to play background sound and game character sound effects. Speaker channel 2 is controlled to play gunshot sound effects and footstep sound effects. In other words, the audio to be played by speaker channel 1 and speaker channel 2 are swapped.
这样,即使存在个别扬声器被遮挡,用户依然能够清晰的听到游戏中的脚步声和枪声,也可以准确地判断所听到的脚步声和枪声在游戏世界中的声源位置。In this way, even if some speakers are blocked, users can still clearly hear the footsteps and gunshots in the game, and can also accurately determine the sound source locations of the footsteps and gunshots in the game world.
另外,在用户使用电子设备看视频的场景下,该视频对应的音频数据包含背景音和台词音效。在一些示例中,在视频应用对应的配置文件中,指定台词音效为特定音效的情况下,电子设备可以确定台词音效为特定音效,而背景音为常规音效。在另一些示例中,电子设备中的系统配置文件中,指定台词音效为特定音效的情况下,电子设备也可以确定台词音效为特定音效,而背景音为常规音效。In addition, in the scenario where the user uses an electronic device to watch a video, the audio data corresponding to the video includes background sound and speech sound effects. In some examples, in the configuration file corresponding to the video application, when the speech sound effect is specified as a specific sound effect, the electronic device can determine that the speech sound effect is a specific sound effect, and the background sound is a regular sound effect. In other examples, in the system configuration file in the electronic device, when the speech sound effect is specified as a specific sound effect, the electronic device can also determine that the speech sound effect is a specific sound effect, and the background sound is a regular sound effect.
另外,在电子设备播放视频时,扬声器通道1用于播放台词音效,扬声器通道2用于播放背景音。In addition, when the electronic device plays a video, speaker channel 1 is used to play the dialogue sound effects, and speaker channel 2 is used to play the background sound.
在电子设备检测到扬声器通道1的扬声器被遮挡时,可以调整须由扬声器通道1播放的音频(也即,台词音效)的相位和强度。When the electronic device detects that the speaker of speaker channel 1 is blocked, the phase and intensity of the audio (ie, the dialogue sound effect) to be played by speaker channel 1 can be adjusted.
或者,在电子设备检测到扬声器通道1的扬声器被遮挡时,控制扬声器通道1停止播放音频,并控制扬声器通道2播放背景音和台词音效。Alternatively, when the electronic device detects that the speaker of speaker channel 1 is blocked, speaker channel 1 is controlled to stop playing audio, and speaker channel 2 is controlled to play background sound and dialogue sound effects.
再或者,在电子设备检测到扬声器通道1的扬声器被遮挡时,控制扬声器通道1播放背景音,并控制扬声器通道2播放台词音效。Alternatively, when the electronic device detects that the speaker of speaker channel 1 is blocked, speaker channel 1 is controlled to play background sound, and speaker channel 2 is controlled to play dialogue sound effects.
这样,即使存在个别扬声器被遮挡,用户依然能够清晰的听到视频中演员的台词对话,不会影响到用户的观影体验。In this way, even if some speakers are blocked, users can still clearly hear the actors' lines and dialogues in the video, without affecting the user's viewing experience.
本申请实施例还提供一种电子设备,该电子设备可以包括:存储器和一个或多个处理器。该存储器和处理器耦合。该存储器用于存储计算机程序代码,该计算机程序代码包括计算机指令。当处理器执行计算机指令时,可使得电子设备执行上述实施例中的各个步骤。当然,该电子设备包括但不限于上述存储器和一个或多个处理器。The embodiment of the present application also provides an electronic device, which may include: a memory and one or more processors. The memory and the processor are coupled. The memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device can perform each step in the above embodiment. Of course, the electronic device includes but is not limited to the above memory and one or more processors.
本申请实施例还提供一种芯片系统,该芯片系统可以应用于前述实施例中的终端设备。如图20所示,该芯片系统包括至少一个处理器2201和至少一个接口电路2202。该处理器2201可以是上述电子设备中的处理器。处理器2201和接口电路2202可通过线路互联。该处理器2201可以通过接口电路2202从上述电子设备的存储器接收并执行计算机指令。当计算机指令被处理器2201执行时,可使得电子设备执行上述实施例中的各个步骤。当然,该芯片系统还可以包含其他分立器件,本申请实施例对此不作具体限定。The embodiment of the present application also provides a chip system, which can be applied to the terminal device in the aforementioned embodiment. As shown in Figure 20, the chip system includes at least one processor 2201 and at least one interface circuit 2202. The processor 2201 can be the processor in the above-mentioned electronic device. The processor 2201 and the interface circuit 2202 can be interconnected by lines. The processor 2201 can receive and execute computer instructions from the memory of the above-mentioned electronic device through the interface circuit 2202. When the computer instructions are executed by the processor 2201, the electronic device can execute the various steps in the above-mentioned embodiment. Of course, the chip system can also include other discrete devices, which is not specifically limited in the embodiment of the present application.
在一些实施例中,通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。In some embodiments, through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
在本申请实施例各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。Each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as flash memory, mobile hard disk, read-only memory, random access memory, disk or optical disk.
以上所述,仅为本申请实施例的具体实施方式,但本申请实施例的保护范围并不局限于此,任何在本申请实施例揭露的技术范围内的变化或替换,都应涵盖在本申请实施例的保护范围之内。因此,本申请实施例的保护范围应以所述权利要求的保护范围为准。The above is only a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the embodiment of the present application should be included in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiment of the present application should be based on the protection scope of the claims.
Claims (16)
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211644169.1A CN118233808A (en) | 2022-12-20 | 2022-12-20 | Speaker control method and electronic device |
PCT/CN2023/117869 WO2024131153A1 (en) | 2022-12-20 | 2023-09-08 | Loudspeaker control method and electronic device |
CN202380071544.4A CN119999233A (en) | 2022-12-20 | 2023-09-08 | Loudspeaker control method and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211644169.1A CN118233808A (en) | 2022-12-20 | 2022-12-20 | Speaker control method and electronic device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118233808A true CN118233808A (en) | 2024-06-21 |
Family
ID=91498472
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211644169.1A Pending CN118233808A (en) | 2022-12-20 | 2022-12-20 | Speaker control method and electronic device |
CN202380071544.4A Pending CN119999233A (en) | 2022-12-20 | 2023-09-08 | Loudspeaker control method and electronic equipment |
Family Applications After (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202380071544.4A Pending CN119999233A (en) | 2022-12-20 | 2023-09-08 | Loudspeaker control method and electronic equipment |
Country Status (2)
Country | Link |
---|---|
CN (2) | CN118233808A (en) |
WO (1) | WO2024131153A1 (en) |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100466304B1 (en) * | 2002-10-04 | 2005-01-15 | 마이크로닉 시스템주식회사 | A control system for plural audio signal and speaker group |
CN106033676B (en) * | 2015-03-13 | 2018-12-11 | 北京智谷睿拓技术服务有限公司 | Audio play control method and device, electronic equipment |
WO2017185351A1 (en) * | 2016-04-29 | 2017-11-02 | 华为技术有限公司 | Method for playing audio and mobile terminal |
CN107483735A (en) * | 2017-08-18 | 2017-12-15 | 广东欧珀移动通信有限公司 | Volume control method, device and storage medium of mobile terminal and mobile terminal |
CN112911354B (en) * | 2019-12-03 | 2022-11-15 | 海信视像科技股份有限公司 | Display apparatus and sound control method |
CN111294438B (en) * | 2020-01-22 | 2021-06-01 | 华为技术有限公司 | Method and terminal for realizing stereo output |
CN114253503B (en) * | 2021-12-22 | 2024-10-22 | 维沃移动通信有限公司 | Audio data processing method and electronic equipment |
-
2022
- 2022-12-20 CN CN202211644169.1A patent/CN118233808A/en active Pending
-
2023
- 2023-09-08 CN CN202380071544.4A patent/CN119999233A/en active Pending
- 2023-09-08 WO PCT/CN2023/117869 patent/WO2024131153A1/en active Application Filing
Also Published As
Publication number | Publication date |
---|---|
WO2024131153A1 (en) | 2024-06-27 |
CN119999233A (en) | 2025-05-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113676804B (en) | Active noise reduction method and device | |
JP7470808B2 (en) | Audio processing method and apparatus | |
CN111132234B (en) | Data transmission method and corresponding terminal | |
WO2021147415A1 (en) | Method for implementing stereo output and terminal | |
CN110989961A (en) | Sound processing method and device | |
EP4156660A1 (en) | Mobile terminal that prevents sound leakage and sound output method for mobile terminal | |
CN113330761B (en) | Method for occupying equipment and electronic equipment | |
CN109107158B (en) | Sound effect processing method and device, electronic equipment and computer readable storage medium | |
CN114157945B (en) | Data processing method and related device | |
US20240126224A1 (en) | Switch Switching Method and Related Apparatus | |
CN112269554B (en) | Display system and display method | |
CN118233808A (en) | Speaker control method and electronic device | |
CN113950037B (en) | A kind of audio playback method and terminal device | |
CN114390406B (en) | Method and device for controlling displacement of loudspeaker diaphragm | |
CN113099734B (en) | Antenna switching method and device | |
US10966016B2 (en) | Electronic device including a plurality of speakers | |
CN117376608A (en) | An audio synchronized playback method and related devices | |
CN116112600B (en) | Call volume adjustment method, electronic device and storage medium | |
CN117998006B (en) | Audio and vibration cooperative control method and device | |
CN116701288B (en) | Streaming media characteristic architecture, processing method, electronic device and readable storage medium | |
CN118158598A (en) | Audio playing method, audio playing device and storage medium | |
HK40068794A (en) | Sound-leakage-preventing mobile terminal and sound output method for mobile terminal | |
CN118708147A (en) | Audio playback method, electronic device and storage medium | |
WO2024021712A9 (en) | Audio playback method and electronic device | |
CN118900381A (en) | Audio playback method, electronic device and chip system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Country or region after: China Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Applicant after: Honor Terminal Co.,Ltd. Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong Applicant before: Honor Device Co.,Ltd. Country or region before: China |
|
CB02 | Change of applicant information |