[go: up one dir, main page]

CN111654800A - Speaker control method, device, electronic device and medium - Google Patents

Speaker control method, device, electronic device and medium Download PDF

Info

Publication number
CN111654800A
CN111654800A CN202010469439.4A CN202010469439A CN111654800A CN 111654800 A CN111654800 A CN 111654800A CN 202010469439 A CN202010469439 A CN 202010469439A CN 111654800 A CN111654800 A CN 111654800A
Authority
CN
China
Prior art keywords
comparison result
preset
loudness
volume
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010469439.4A
Other languages
Chinese (zh)
Other versions
CN111654800B (en
Inventor
陈曦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202010469439.4A priority Critical patent/CN111654800B/en
Publication of CN111654800A publication Critical patent/CN111654800A/en
Application granted granted Critical
Publication of CN111654800B publication Critical patent/CN111654800B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R29/00Monitoring arrangements; Testing arrangements
    • H04R29/001Monitoring arrangements; Testing arrangements for loudspeakers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R2430/00Signal processing covered by H04R, not provided for in its groups
    • H04R2430/01Aspects of volume control, not necessarily automatic, in sound systems

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

本申请实施例公开了一种扬声器控制方法、装置、电子设备及介质。该方法包括:获取当前音量档位以及麦克风接收到的第一声音响度,第一声音响度与目标扬声器相对应;比较第一声音响度与当前音量档位下的预设声音响度,得到比较结果,其中,预设声音响度与目标扬声器相对应;在比较结果不满足预设条件的情况下,根据比较结果调节目标扬声器的音量,以使比较结果满足预设条件。利用本申请实施例能够解决扬声器的输出端口受到遮挡后导致声音的外放效果差的问题。

Figure 202010469439

Embodiments of the present application disclose a speaker control method, device, electronic device, and medium. The method includes: acquiring a current volume level and a first sound loudness received by a microphone, where the first sound loudness corresponds to a target speaker; and comparing the first sound loudness with a preset sound loudness under the current volume level to obtain The comparison result, wherein the preset sound loudness corresponds to the target speaker; if the comparison result does not meet the preset condition, adjust the volume of the target speaker according to the comparison result, so that the comparison result satisfies the preset condition. The embodiments of the present application can solve the problem that the output port of the loudspeaker is blocked, resulting in a poor external sound effect.

Figure 202010469439

Description

扬声器控制方法、装置、电子设备及介质Speaker control method, device, electronic device and medium

技术领域technical field

本申请实施例涉及电子设备领域,尤其涉及一种扬声器控制方法、装置、电子设备及介质。Embodiments of the present application relate to the field of electronic devices, and in particular, to a method, device, electronic device, and medium for controlling a speaker.

背景技术Background technique

随着电子设备的发展,越来越多的具有声音播放的功能转移到电子设备上运行,例如音频播放软件、视频播放软件、录音软件等。为了实现声音播放的功能,电子设备上都会设置扬声器来进行声音的播放。With the development of electronic equipment, more and more functions with sound playback are transferred to the electronic equipment to run, such as audio playback software, video playback software, recording software and so on. In order to realize the function of sound playback, a speaker is set on the electronic device for sound playback.

这种情况下,由于扬声器的输出端口设置于电子设备的边缘表面,导致扬声器的输出端口容易受到遮挡。例如:用户双手握住电子设备的两端玩游戏时,则可能遮挡设置于电子设备两端的扬声器的输出端口。In this case, since the output port of the speaker is disposed on the edge surface of the electronic device, the output port of the speaker is easily blocked. For example, when the user holds the two ends of the electronic device with both hands to play a game, the output ports of the speakers disposed at both ends of the electronic device may be blocked.

而扬声器的输出端口受到遮挡后,就会影响扬声器的外放效果,导致电子设备出现声音的外放效果差的问题。However, when the output port of the speaker is blocked, it will affect the external effect of the speaker, resulting in the problem of poor external sound effect of the electronic device.

发明内容SUMMARY OF THE INVENTION

本申请实施例提供一种扬声器控制方法、装置、电子设备及介质,能够解决扬声器的输出端口受到遮挡后导致声音的外放效果差的问题。Embodiments of the present application provide a speaker control method, device, electronic device, and medium, which can solve the problem of poor sound output effect after the output port of the speaker is blocked.

第一方面,本申请实施例提供了一种扬声器控制方法,应用于电子设备,电子设备包括N个扬声器,N为正整数;方法包括:In a first aspect, an embodiment of the present application provides a speaker control method, which is applied to an electronic device, where the electronic device includes N speakers, where N is a positive integer; the method includes:

获取当前音量档位以及麦克风接收到的第一声音响度,所述第一声音响度与目标扬声器相对应;Obtain the current volume level and the loudness of the first sound received by the microphone, where the loudness of the first sound corresponds to the target speaker;

比较所述第一声音响度与所述当前音量档位下的预设声音响度,得到比较结果,其中,所述预设声音响度与所述目标扬声器相对应;Comparing the first sound loudness with the preset sound loudness under the current volume level, a comparison result is obtained, wherein the preset sound loudness corresponds to the target speaker;

在所述比较结果不满足预设条件的情况下,根据所述比较结果调节所述目标扬声器的音量,以使所述比较结果满足所述预设条件。If the comparison result does not satisfy the preset condition, the volume of the target speaker is adjusted according to the comparison result, so that the comparison result satisfies the preset condition.

第二方面,本申请实施例还提供了一种扬声器控制装置,应用于电子设备,电子设备包括N个扬声器,N为正整数;该装置包括:In a second aspect, an embodiment of the present application also provides a speaker control device, which is applied to an electronic device, where the electronic device includes N speakers, where N is a positive integer; the device includes:

第一获取模块,用于获取当前音量档位以及麦克风接收到的第一声音响度,所述第一声音响度与目标扬声器相对应;a first acquisition module, configured to acquire the current volume level and the first sound loudness received by the microphone, where the first sound loudness corresponds to the target speaker;

比较模块,用于比较所述第一声音响度与所述当前音量档位下的预设声音响度,得到比较结果,其中,所述预设声音响度与所述目标扬声器相对应;a comparison module, configured to compare the first sound loudness with the preset sound loudness under the current volume level, and obtain a comparison result, wherein the preset sound loudness corresponds to the target speaker;

音量调整模块,用于在所述比较结果不满足预设条件的情况下,根据所述比较结果调节所述目标扬声器的音量,以使所述比较结果满足所述预设条件。A volume adjustment module, configured to adjust the volume of the target speaker according to the comparison result when the comparison result does not satisfy the preset condition, so that the comparison result satisfies the preset condition.

第三方面,本申请实施例提供了一种电子设备,包括处理器、存储器及存储在存储器上并可在处理器上运行的程序或指令,程序或指令被处理器执行时实现如第一方面的扬声器控制方法的步骤。In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a memory, and a program or instruction stored in the memory and executable on the processor. When the program or instruction is executed by the processor, the first aspect is implemented The steps of the speaker control method.

第四方面,本申请实施例提供了一种可读存储介质,可读存储介质上存储程序或指令,程序或指令被处理器执行时实现如第一方面的扬声器控制方法的步骤。In a fourth aspect, an embodiment of the present application provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or instruction is executed by a processor, the steps of the speaker control method according to the first aspect are implemented.

第五方面,本申请实施例提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如第一方面所述的方法。In a fifth aspect, an embodiment of the present application provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction, and implement the first aspect the method described.

在本申请实施例中,在扬声器外放过程中,麦克风实际收到的第一声音响度反映的是目标扬声器的实际外放效果,电子设备内预先设置的当前音量档位下的预设声音响度为目标扬声器的理论外放效果,通过将第一声音响度与预设声音响度进行比较,能够确定当前目标扬声器的实际外放效果与理论外放效果的差距,当比较结果不满足预设条件时,表明目标扬声器的实际外放效果不理想,目标扬声器的输出端口受到了遮挡,因此本实施例根据比较结果对受到遮挡的目标扬声器的音量进行调整,从而使得即使在遮挡状态下,目标扬声器也能够达到满足要求的外放效果,从而提高声音的外放效果。In the embodiment of the present application, during the loudspeaker playback process, the loudness of the first sound actually received by the microphone reflects the actual playback effect of the target speaker, and the preset sound at the current volume level preset in the electronic device The loudness is the theoretical loudness effect of the target speaker. By comparing the first sound loudness with the preset sound loudness, the gap between the actual loudness effect of the current target loudspeaker and the theoretical loudness can be determined. When the comparison result does not meet the preset loudness condition, it indicates that the actual external effect of the target speaker is not ideal, and the output port of the target speaker is blocked. Therefore, this embodiment adjusts the volume of the blocked target speaker according to the comparison result, so that even in the blocked state, the target The loudspeaker can also achieve the desired external effect, thereby improving the external effect of the sound.

附图说明Description of drawings

从下面结合附图对本申请的具体实施方式的描述中可以更好地理解本申请其中,相同或相似的附图标记表示相同或相似的特征。The present application can be better understood from the following description of specific embodiments of the present application in conjunction with the accompanying drawings, wherein the same or similar reference numerals denote the same or similar features.

图1为本申请实施例提供的一种扬声器控制方法的流程示意图;FIG. 1 is a schematic flowchart of a method for controlling a loudspeaker according to an embodiment of the present application;

图2为本申请实施例提供的第二种扬声器控制方法的流程示意图;2 is a schematic flowchart of a second speaker control method provided by an embodiment of the present application;

图3为本申请实施例提供的第三种扬声器控制方法的流程示意图;3 is a schematic flowchart of a third speaker control method according to an embodiment of the present application;

图4为本申请实施例提供的第四种扬声器控制方法的流程示意图;FIG. 4 is a schematic flowchart of a fourth speaker control method provided by an embodiment of the present application;

图5为本申请实施例提供的第五种扬声器控制方法的流程示意图;5 is a schematic flowchart of a fifth speaker control method according to an embodiment of the present application;

图6为本申请实施例提供的一种扬声器控制装置的结构示意图;FIG. 6 is a schematic structural diagram of a speaker control device provided by an embodiment of the present application;

图7为本申请实施例提供的一种电子设备的硬件结构示意图。FIG. 7 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.

如背景技术部分,相关技术中的扬声器控制方法存在受到遮挡后外放效果差的缺陷,为了解决该缺陷,本申请实施例提供了一种扬声器控制方法,参见图1,图1示出了本申请实施例提供的一种扬声器控制方法的流程示意图;该电子设备包括N个扬声器,N为正整数;该方法包括:As shown in the background art section, the speaker control method in the related art has the defect that the external effect is poor after being blocked. In order to solve this defect, an embodiment of the present application provides a speaker control method. Referring to FIG. A schematic flowchart of a speaker control method provided by an embodiment of the application; the electronic device includes N speakers, and N is a positive integer; the method includes:

S100、获取当前音量档位以及麦克风接收到的第一声音响度;S100, obtaining the current volume level and the loudness of the first sound received by the microphone;

其中,第一声音响度与目标扬声器相对应;在目标扬声器处于外放音频的情况下执行上述获取操作。Wherein, the first sound loudness corresponds to the target speaker; the above-mentioned acquisition operation is performed when the target speaker is playing external audio.

电子设备中扬声器外放的声音响度划分了不同的音量档位,每个音量档位对应不同声音响度,即不同的音量档位对应不同的音量大小。用户对音量大小的调整操作就是对音量档位的选择操作,例如,用户将音量调大一格,则音量档位也变化一档。可选的,可以直接根据扬声器的功放的放大倍数来确定第一声音档位,或者若电子设备内的扬声器控制组件内记录有音量档位信息的话,则可以直接读取所记录的音量档位信息来获取当前音量档位,本申请不限定获取当前音量档位的具体方式。The loudness of the sound released by the speakers in the electronic device is divided into different volume levels, and each volume level corresponds to a different sound loudness, that is, different volume levels correspond to different volume levels. The user's adjustment operation on the volume level is the selection operation on the volume level. For example, if the user increases the volume by one level, the volume level also changes by one level. Optionally, the first sound level can be determined directly according to the amplification factor of the power amplifier of the speaker, or if the volume level information is recorded in the speaker control component in the electronic device, the recorded volume level can be directly read. information to obtain the current volume level, and this application does not limit the specific method of acquiring the current volume level.

此外,扬声器与麦克风是对应设置的,这里的麦克风指的是扬声器对应的麦克风,例如降噪麦克风,麦克风收到的第一声音响度为目标扬声器外放的实际声音响度。电子设备上通常会设置多个麦克风。这些麦克风通常分布于电子设备的顶部和底部,例如,顶部和底部分别设置一个麦克风,本申请不限定麦克风的个数和设置位置。In addition, the speaker and the microphone are set correspondingly, and the microphone here refers to the microphone corresponding to the speaker, such as a noise reduction microphone, and the first sound loudness received by the microphone is the actual sound loudness of the target speaker. Multiple microphones are often provided on electronic devices. These microphones are usually distributed on the top and bottom of the electronic device. For example, one microphone is provided on the top and the bottom respectively, and the application does not limit the number and placement positions of the microphones.

S200、比较第一声音响度与当前音量档位下的预设声音响度,得到比较结果;S200, comparing the loudness of the first sound with the preset sound loudness under the current volume level, and obtaining a comparison result;

其中,预设声音响度与目标扬声器相对应;该步骤的具体实现方式将在下文中进行详细描述。本实施例中,预先设置有各个音量档位下的预设声音响度,当前音量档位下的预设声音响度指的是:当前音量档位下,扬声器理论上应该输出的声音响度。The preset sound loudness corresponds to the target speaker; the specific implementation of this step will be described in detail below. In this embodiment, the preset sound loudness under each volume level is preset, and the preset sound loudness under the current volume level refers to the sound loudness that the speaker should theoretically output under the current volume level.

S300、在比较结果不满足预设条件的情况下,根据比较结果调节目标扬声器的音量,以使比较结果满足预设条件。S300. If the comparison result does not satisfy the preset condition, adjust the volume of the target speaker according to the comparison result, so that the comparison result satisfies the preset condition.

根据比较结果,能够确定目标扬声器实际输出的声音响度是否小于理论输出的声音响度,进而确定该目标扬声器的输出端口是否受到了遮挡。在受到遮挡的情况下,可以增大目标扬声器的音量,使目标扬声器的实际外放声音响度在遮挡状态下也能够达到理论声音响度。并且,上述调节操作可以分多次进行,每次调节目标扬声器的音量后,可以将重复上述S100~S300的操作,直至得到的比较结果满足预设条件。或者,也可以根据比较结果,按照特定的规则进行单次音量调整,即能够保证调整后的比较结果满足预设条件,例如根据目标扬声器的第一声音响度与预设声音响度的差值,将目标扬声器的音量上调至预设档位等。具体如何调节目标扬声器的音量,本申请不作限定。According to the comparison result, it can be determined whether the sound loudness actually output by the target speaker is smaller than the theoretical output sound loudness, and then it can be determined whether the output port of the target speaker is blocked. In the case of being blocked, the volume of the target speaker can be increased, so that the actual loudness of the external sound of the target speaker can reach the theoretical sound loudness even in the blocked state. Moreover, the above-mentioned adjustment operation may be performed in multiple times, and after each adjustment of the volume of the target speaker, the above-mentioned operations of S100 to S300 may be repeated until the obtained comparison result satisfies the preset condition. Alternatively, it is also possible to perform a single volume adjustment according to a specific rule according to the comparison result, that is, it can be ensured that the adjusted comparison result satisfies the preset condition, for example, according to the difference between the loudness of the first sound of the target speaker and the loudness of the preset sound, Turn up the volume of the target speaker to the preset level, etc. How to specifically adjust the volume of the target speaker is not limited in this application.

在本申请实施例中,在扬声器外放过程中,麦克风实际收到的第一声音响度反映的是目标扬声器的实际外放效果,电子设备内预先设置的当前音量档位下的预设声音响度为目标扬声器的理论外放效果,通过将第一声音响度与预设声音响度进行比较,能够确定当前目标扬声器的实际外放效果与理论外放效果的差距,当比较结果不满足预设条件时,表明目标扬声器的实际外放效果不理想,目标扬声器的输出端口受到了遮挡,因此本实施例根据比较结果对受到遮挡的目标扬声器的音量进行调整,从而使得即使在遮挡状态下,目标扬声器也能够达到满足要求的外放效果,从而提高声音的外放效果。In the embodiment of the present application, during the loudspeaker playback process, the loudness of the first sound actually received by the microphone reflects the actual playback effect of the target speaker, and the preset sound at the current volume level preset in the electronic device The loudness is the theoretical loudness effect of the target speaker. By comparing the first sound loudness with the preset sound loudness, the gap between the actual loudness effect of the current target loudspeaker and the theoretical loudness can be determined. When the comparison result does not meet the preset loudness condition, it indicates that the actual external effect of the target speaker is not ideal, and the output port of the target speaker is blocked. Therefore, this embodiment adjusts the volume of the blocked target speaker according to the comparison result, so that even in the blocked state, the target The loudspeaker can also achieve the desired external effect, thereby improving the external effect of the sound.

在本申请的一些实施例中,上述N可以为大于1的正整数。例如,N可以为2,即电子设备包括双扬声器。双扬声器能够提升音频的播放效果,使得电子设备在外放音频时具有更强的立体感。本实施例能够在双扬声器中任意一个扬声器的输出端口受到遮挡后,调整受到遮挡的目标扬声器的音量,从而避免影响双扬声器的立体声效果。In some embodiments of the present application, the above N may be a positive integer greater than 1. For example, N may be 2, ie the electronic device includes dual speakers. The dual speakers can improve the audio playback effect, making the electronic device have a stronger three-dimensional sense when the audio is played externally. In this embodiment, after the output port of any one of the dual speakers is blocked, the volume of the blocked target speaker can be adjusted, so as to avoid affecting the stereo effect of the dual speakers.

在本申请的一些实施例中,参见图2所示,图2为本申请实施例提供的第二种扬声器控制方法的流程示意图。上述S200可以包括:In some embodiments of the present application, referring to FIG. 2 , FIG. 2 is a schematic flowchart of a second speaker control method provided by an embodiment of the present application. The above S200 may include:

S211、计算第一声音响度与当前音量档位下的预设声音响度的差值,得到目标差值;S211, calculating the difference between the first sound loudness and the preset sound loudness under the current volume level, to obtain the target difference;

S212、将目标差值与当前音量档位下的目标响度差值进行比较,得到比较结果;S212, compare the target difference value with the target loudness difference value under the current volume level to obtain a comparison result;

相应的,S300调整为S310,S310包括:在目标差值大于或等于目标响度差值的情况下,根据比较结果调节目标扬声器的音量。Correspondingly, S300 is adjusted to S310, and S310 includes: when the target difference value is greater than or equal to the target loudness difference value, adjusting the volume of the target speaker according to the comparison result.

本实施例中,直接将第一声音响度与预设声音响度的目标差值与目标响度差值进行比较,如果目标差值大于目标响度差值,则表明目标扬声器的实际外放的声音响度过低,需要提高音量。这种利用绝对响度值进行比较的方式,能够方便确认每个扬声器的是否被遮挡,进而保证使每个扬声器的实际外放效果均达到对应的理想状态。In this embodiment, the target difference between the first sound loudness and the preset sound loudness is directly compared with the target loudness difference, and if the target difference is greater than the target loudness difference, it indicates the actual loudness of the target speaker. Too low, you need to increase the volume. This method of using the absolute loudness value for comparison can easily confirm whether each speaker is blocked, thereby ensuring that the actual external effect of each speaker reaches the corresponding ideal state.

为方便理解本实施例的方案,通过以下两个示例进行解释。To facilitate understanding of the solution of this embodiment, the following two examples are used for explanation.

示例一以单扬声器为例:电子设备需要预先在无遮挡状态下进行外放测试,该外放测试可以在电子设备出厂前进行,测试过程中电子设备需要采集并记录不同音量档位下麦克风收到的绝对声音响度,该绝对声音响度作为对应音量档位下的预设音量响度,例如第一音量档位下的预设音量响度为a1,第二音量档位下的预设音量响度a2,…第n音量档位下的预设音量响度为an。之后设置各个音量档位下的目标响度差值x。在电子设备实际外放过程中,麦克风采集实际的第一声音响度c并确定当前的当前音量档位,假设为第n音量档位,则计算cn与当前音量档位下的预设音量响度an之间的差值j=an-cn。将j与当前音量档位下的目标响度差值xn进行比较,若j大于xn,表明目标扬声器受到了遮挡,需要调高音量。Example 1 Take a single speaker as an example: the electronic device needs to be tested in an unobstructed state in advance. The external test can be performed before the electronic device leaves the factory. During the test, the electronic device needs to collect and record the microphone output at different volume levels. The absolute sound loudness obtained, the absolute sound loudness is used as the preset volume loudness under the corresponding volume level, for example, the preset volume loudness under the first volume level is a1, and the preset volume loudness under the second volume level is a2, ...the preset volume loudness at the nth volume level is an. Then set the target loudness difference x under each volume level. During the actual playback process of the electronic device, the microphone collects the actual first sound loudness c and determines the current current volume level. Assuming it is the nth volume level, calculate cn and the preset volume loudness under the current volume level. The difference between an is j=an-cn. Compare j with the target loudness difference xn at the current volume level. If j is greater than xn, it indicates that the target speaker is blocked and the volume needs to be increased.

示例二以双扬声器为例:在外放测试阶段,电子设备预先采集并记录不同音量档位下麦克风收到的绝对声音响度,该绝对声音响度作为对应音量档位下的预设音量响度,例如第一音量档位下的预设音量响度为a1、b1,第二音量档位下的预设音量响度a2、b2,…第n音量档位下的预设音量响度为an、bn。之后设置各个音量档位下的目标响度差值,顶部扬声器对应的目标响度差值为x,底部扬声器对应的目标响度差值为y。在电子设备实际外放过程中,由于顶部麦克风靠近顶部扬声器,底部麦克风靠近底部扬声器,因此底部麦克风采集的声音响度主要反映底部扬声器的音量大小,顶部同理。顶部麦克风采集的实际的第一声音响度记为c、底部麦克风采集的实际的第一声音响度记为d。并确定当前的当前音量档位,假设为第n音量档位。则计算cn、dn与当前音量档位下的预设音量响度an、bn之间的差值:顶部差值为j=an-cn,底部差值为k=bn-dn。将j、k分别与当前音量档位下的目标响度差值xn、yn进行比较,若j大于xn,表明顶部扬声器受到了遮挡,若k大于yn,表明底部扬声器受到了遮挡。Example 2 takes dual speakers as an example: in the external test stage, the electronic device pre-collects and records the absolute sound loudness received by the microphone at different volume levels, and the absolute sound loudness is used as the preset volume loudness under the corresponding volume level, such as the first volume. The preset volume loudnesses under the first volume level are a1, b1, the preset volume loudnesses a2, b2 under the second volume level, . . . the preset volume loudnesses under the nth volume level are an, bn. Then set the target loudness difference under each volume level, the target loudness difference corresponding to the top speaker is x, and the target loudness difference corresponding to the bottom speaker is y. During the actual playback of electronic devices, since the top microphone is close to the top speaker and the bottom microphone is close to the bottom speaker, the loudness of the sound collected by the bottom microphone mainly reflects the volume of the bottom speaker, and the same is true for the top. The actual loudness of the first sound collected by the top microphone is denoted as c, and the actual loudness of the first sound collected by the bottom microphone is denoted as d. And determine the current current volume level, assuming the nth volume level. Then calculate the difference between cn, dn and the preset volume loudness an, bn under the current volume level: the top difference is j=an-cn, and the bottom difference is k=bn-dn. Compare j and k with the target loudness difference xn and yn under the current volume level respectively. If j is greater than xn, it means that the top speaker is blocked; if k is greater than yn, it means that the bottom speaker is blocked.

可选的,上述目标响度差值可以为:占预设声音响度的预设百分比的响度。例如,占预设声音响度的10%的响度。Optionally, the above target loudness difference may be: a loudness that accounts for a preset percentage of the preset sound loudness. For example, a loudness that is 10% of the preset sound loudness.

由于目标响度差值表明的是目标扬声器实际外放时的第一声音响度与理论上的预设声音响度之间能够允许的最大差值,因此,本实施例在预设声音响度的基础上设置目标响度差值,能够使目标响度差值随着音量档位的变化而变化,这种自适应变动的设置方式,提高了目标响度差值的合理性,在基于所设置的目标响度差值调整后,扬声器的外放效果更好。Since the target loudness difference indicates the maximum allowable difference between the first sound loudness when the target speaker is actually released and the theoretical preset sound loudness, this embodiment is based on the preset sound loudness. Setting the target loudness difference can make the target loudness difference change with the change of the volume level. This adaptive change setting method improves the rationality of the target loudness difference. Based on the set target loudness difference After adjustment, the loudspeaker's external effect is better.

在本申请的另一些实施例中,N个扬声器包括第一扬声器和第二扬声器;参见图3所示,图3为本申请实施例提供的第三种扬声器控制方法的流程示意图。上述S100可以包括:In other embodiments of the present application, the N loudspeakers include a first loudspeaker and a second loudspeaker; referring to FIG. 3 , FIG. 3 is a schematic flowchart of a third loudspeaker control method provided by an embodiment of the present application. The above S100 may include:

S120,获取当前音量档位以及麦克风接收到的第二声音响度和第三声音响度,第二声音响度与第一扬声器相关联,第三声音响度与第二扬声器相关联;S120, obtaining the current volume level and the second sound loudness and the third sound loudness received by the microphone, where the second sound loudness is associated with the first speaker, and the third sound loudness is associated with the second speaker;

上述200可以包括:The above 200 may include:

S221、计算第二声音响度和第三声音响度之间的第一比值;S221, calculating the first ratio between the loudness of the second sound and the loudness of the third sound;

S222、比较第一比值与预设比值,得到比较结果;S222, comparing the first ratio with the preset ratio to obtain a comparison result;

其中,预设比值为当前音量档位下第一预设声音响度与第二预设声音响度之间的比值,第一预设声音响度与第一扬声器相对应,第二预设声音响度与第二扬声器相对应;The preset ratio is the ratio between the first preset sound loudness and the second preset sound loudness at the current volume level, the first preset sound loudness corresponds to the first speaker, and the second preset sound loudness corresponds to the second preset sound loudness. Two speakers correspond;

上述S300可以包括:The above S300 may include:

S321、在比较结果不满足第一预设条件的情况下,根据比较结果调节第一扬声器的音量;S321, in the case that the comparison result does not meet the first preset condition, adjust the volume of the first speaker according to the comparison result;

其中,这里的第一预设条件可以包括第一比值大于或等于预设比值,或者,第一比值与预设比值之间的第二比值大于或等于目标比值等。本申请在后续实施例中对第一预设条件的具体内容进行了详细描述。The first preset condition here may include that the first ratio is greater than or equal to the preset ratio, or the second ratio between the first ratio and the preset ratio is greater than or equal to the target ratio, and the like. The specific content of the first preset condition is described in detail in subsequent embodiments of the present application.

S322、在比较结果不满足第二预设条件的情况下,根据比较结果调节第二扬声器的音量。S322. In the case that the comparison result does not satisfy the second preset condition, adjust the volume of the second speaker according to the comparison result.

其中,这里的第二预设条件可以包括第一比值小于预设比值,或者,第一比值与预设比值之间的第二比值小于目标比值等。本申请在后续实施例中对第二预设条件的具体内容进行了详细描述。The second preset condition here may include that the first ratio is smaller than the preset ratio, or the second ratio between the first ratio and the preset ratio is smaller than the target ratio, or the like. The specific content of the second preset condition is described in detail in subsequent embodiments of the present application.

本实施例针对电子设备设置有多个扬声器的情况,电子设备中设置多个扬声器,是为了起到立体声效果,这种情况下,通常需要各个扬声器的外放声音响度相同,才能使用户在各个位置均感受到相同的声音效果。因此,本实施例利用两个扬声器的第一声音响度的比值与这两个扬声器的预设声音响度的比值进行比较,从而使得后续音量调整后,能够保证这两个扬声器的实际音量达到平衡状态,使电子设备具有较好的立体声效果。此时,这两个扬声器的实际声音响度可以并不等于预设声音响度。This embodiment is aimed at the situation where the electronic device is provided with multiple speakers. The purpose of setting multiple speakers in the electronic device is to achieve a stereo effect. The same sound effects are felt in all positions. Therefore, in this embodiment, the ratio of the loudness of the first sound of the two speakers is compared with the ratio of the loudness of the preset sound of the two speakers, so that after the subsequent volume adjustment, the actual volume of the two speakers can be guaranteed to reach a balance state, so that the electronic device has a better stereo effect. At this time, the actual sound loudness of the two speakers may not be equal to the preset sound loudness.

为方便理解本实施例的方案,通过以下示例进行解释。In order to facilitate understanding of the solution of this embodiment, the following examples are used for explanation.

以双扬声器为例:在外放测试阶段,电子设备预先采集并记录不同音量档位下麦克风收到的绝对声音响度,该绝对声音响度作为对应音量档位下的预设音量响度,例如第一音量档位下的预设音量响度为a1、b1,第二音量档位下的预设音量响度a2、b2,…第n音量档位下的预设音量响度为an、bn。之后基于预设音量响度计算不同音量档位下的预设比值en=an/bn。在电子设备实际外放过程中,顶部麦克风采集的实际的第一声音响度为c、底部麦克风采集的实际的第一声音响度为d。第一比值为m=c/d。Take dual speakers as an example: in the external test stage, the electronic device pre-collects and records the absolute sound loudness received by the microphone at different volume levels, and the absolute sound loudness is used as the preset volume loudness under the corresponding volume level, such as the first volume The preset volume loudness under the gear level is a1, b1, the preset volume loudness a2, b2 under the second volume level, ... the preset volume loudness under the nth volume level are an, bn. Then, the preset ratio en=an/bn under different volume levels is calculated based on the preset volume loudness. During the actual playback process of the electronic device, the actual loudness of the first sound collected by the top microphone is c, and the actual loudness of the first sound collected by the bottom microphone is d. The first ratio is m=c/d.

在本申请的再一些实施例中,参见图4所示,图4为本申请实施例提供的第四种扬声器控制方法的流程示意图。上述S200可以包括:In still other embodiments of the present application, referring to FIG. 4 , FIG. 4 is a schematic flowchart of a fourth speaker control method provided by an embodiment of the present application. The above S200 may include:

S231、计算第二声音响度和第三声音响度之间的第一比值;S231, calculating the first ratio between the loudness of the second sound and the loudness of the third sound;

S232、计算第一比值与预设比值之间的第二比值;S232, calculating the second ratio between the first ratio and the preset ratio;

S233、比较第二比值与当前音量档位下的目标比值,得到比较结果;S233, compare the second ratio with the target ratio under the current volume gear, and obtain a comparison result;

相应的,S300具体包括:Correspondingly, the S300 specifically includes:

S331、在第二比值大于或等于目标比值的情况下,根据比较结果调节第二扬声器的音量;S331, when the second ratio is greater than or equal to the target ratio, adjust the volume of the second speaker according to the comparison result;

S332、在第二比值小于目标比值的情况下,根据比较结果调节第一扬声器的音量。S332. In the case that the second ratio is smaller than the target ratio, adjust the volume of the first speaker according to the comparison result.

本实施例中,将第一比值与预设比值之间的第二比值来与目标比值比较,根据第二比值是否符合要求,能够确定每组中的两个扬声器的外放音量的相对大小关系,进而确定待调整的扬声器及其调整策略,从而保证每组中两个扬声器的外放音量之间的平衡性,这种方式,保证了调整后扬声器外放过程中声音的立体效果。并且这种比较方式,使得用户能够根据实际情况来调整目标比值,进而能够达到根据实际情况选择不同的音量调整效果的目的。In this embodiment, the second ratio between the first ratio and the preset ratio is compared with the target ratio, and according to whether the second ratio meets the requirements, the relative magnitude relationship of the external volume of the two speakers in each group can be determined , and then determine the speaker to be adjusted and its adjustment strategy, so as to ensure the balance between the external volume of the two speakers in each group. And this comparison method enables the user to adjust the target ratio according to the actual situation, thereby achieving the purpose of selecting different volume adjustment effects according to the actual situation.

为方便理解本实施例的方案,通过以下示例进行解释。In order to facilitate understanding of the solution of this embodiment, the following examples are used for explanation.

以双扬声器为例:设置各个音量档位下的目标比值z。当前音量档位假设为第n音量档位。计算第一比值m与当前音量档位下的预设音量响度en之间的比值,得到第二比值m/en,将m/en与当前音量档位下的目标比值z进行比较,若m/en大于或等于z,表明m较大,可以增大底部扬声器(即第二扬声器)的音量。Take dual speakers as an example: set the target ratio z under each volume level. The current volume level is assumed to be the nth volume level. Calculate the ratio between the first ratio m and the preset volume loudness en under the current volume level, obtain the second ratio m/en, and compare m/en with the target ratio z under the current volume level, if m/en en is greater than or equal to z, indicating that m is larger and can increase the volume of the bottom speaker (ie, the second speaker).

在本申请的又一些实施例中,参见图5所示,图5为本申请实施例提供的第五种扬声器控制方法的流程示意图。基于图3对应的实施例,对S300进行调整,上述S300可以包括:In still other embodiments of the present application, referring to FIG. 5 , FIG. 5 is a schematic flowchart of a fifth speaker control method provided by an embodiment of the present application. Based on the embodiment corresponding to FIG. 3 , S300 is adjusted, and the above-mentioned S300 may include:

S341、在第一比值大于或等于预设比值的情况下,根据比较结果调节第二扬声器的音量;S341, when the first ratio is greater than or equal to the preset ratio, adjust the volume of the second speaker according to the comparison result;

S342、在第一比值小于预设比值的情况下,根据比较结果调节第一扬声器的音量。S342. In the case that the first ratio is smaller than the preset ratio, adjust the volume of the first speaker according to the comparison result.

在第一比值大于或等于预设比值时,表明第一比值较大,由于第一比值为第一扬声器与第二扬声器的声音响度的比值,因此,表明第一扬声器的声音响度大于第二扬声器的声音响度,因此需要增大第二扬声器的音量。反之,在第一比值小于预设比值时,表明第一扬声器的声音响度小于第二扬声器的声音响度,因此需要增大第一扬声器的音量。When the first ratio is greater than or equal to the preset ratio, it indicates that the first ratio is larger. Since the first ratio is the ratio of the sound loudness of the first speaker and the second speaker, it indicates that the sound loudness of the first speaker is greater than that of the second speaker. the loudness of the sound, so you need to increase the volume of the second speaker. Conversely, when the first ratio is smaller than the preset ratio, it indicates that the loudness of the sound of the first speaker is smaller than that of the second speaker, so the volume of the first speaker needs to be increased.

本实施例中,直接比对了第一比值和预设比值的大小,由于预设比值作为标准值,因此基于第一比值与预设比值的大小关系,能够确定第一比值是否过大或者过小,进而能够直观的确定待调整的扬声器以及对扬声器进行调整时的音量调整方案。这种方式,保证了电子设备的扬声器能够具有立体声外放效果。当然,具体的音量调整方案可以由工作人员根据实际需求进行设置,本申请对此不做限定。In this embodiment, the magnitudes of the first ratio and the preset ratio are directly compared. Since the preset ratio is used as the standard value, it can be determined whether the first ratio is too large or too large based on the relationship between the first ratio and the preset ratio. Small, so that the speaker to be adjusted and the volume adjustment scheme when adjusting the speaker can be intuitively determined. In this way, it is ensured that the speaker of the electronic device can have a stereo sound effect. Of course, the specific volume adjustment scheme can be set by the staff according to actual needs, which is not limited in this application.

为方便理解本实施例的方案,通过以下示例进行解释。In order to facilitate understanding of the solution of this embodiment, the following examples are used for explanation.

以双扬声器为例:设置各个音量档位下的目标比值z。当前音量档位假设为第n音量档位。比较第一比值m与当前音量档位下的预设音量响度en之间的大小,若m>en,则说明当前底部麦克风的第一声音响度d低于当前音量档位下的预设声音响度,可以增大底部麦克风的音量。Take dual speakers as an example: set the target ratio z under each volume level. The current volume level is assumed to be the nth volume level. Compare the magnitude between the first ratio m and the preset volume loudness en under the current volume level, if m>en, it means that the current loudness d of the first sound of the bottom microphone is lower than the preset sound under the current volume level Loudness, which increases the volume of the bottom microphone.

基于上述实施例提供的扬声器控制方法实施例,相应地,本申请实施例还提供了一种扬声器控制装置,应用于电子设备,电子设备包括N个扬声器,N为正整数;参见图6所示,图6为本申请实施例提供的一种扬声器控制装置的结构示意图。该装置包括:Based on the embodiments of the speaker control method provided by the above embodiments, correspondingly, the embodiments of the present application also provide a speaker control device, which is applied to electronic equipment. The electronic equipment includes N speakers, and N is a positive integer; see FIG. 6 . 6 is a schematic structural diagram of a speaker control device provided by an embodiment of the present application. The device includes:

第一获取模块410,用于第一获取模块,用于获取当前音量档位以及麦克风接收到的第一声音响度,第一声音响度与目标扬声器相对应;The first acquisition module 410 is used for the first acquisition module, and is used for acquiring the current volume level and the first sound loudness received by the microphone, and the first sound loudness corresponds to the target speaker;

比较模块420,用于第一获取模块,用于比较第一声音响度与当前音量档位下的预设声音响度,得到比较结果,其中,预设声音响度与目标扬声器相对应;The comparison module 420 is used for the first acquisition module, and is used to compare the first sound loudness with the preset sound loudness under the current volume level, and obtain a comparison result, wherein the preset sound loudness corresponds to the target speaker;

音量调整模块430,用于在比较结果不满足预设条件的情况下,根据比较结果调节目标扬声器的音量,以使比较结果满足预设条件。The volume adjustment module 430 is configured to adjust the volume of the target speaker according to the comparison result when the comparison result does not satisfy the preset condition, so that the comparison result satisfies the preset condition.

在本申请实施例中,在扬声器外放过程中,麦克风实际收到的第一声音响度反映的是目标扬声器的实际外放效果,电子设备内预先设置的当前音量档位下的预设声音响度为目标扬声器的理论外放效果,通过将第一声音响度与预设声音响度进行比较,能够确定当前目标扬声器的实际外放效果与理论外放效果的差距,当比较结果不满足预设条件时,表明目标扬声器的实际外放效果不理想,目标扬声器的输出端口受到了遮挡,因此本实施例根据比较结果对受到遮挡的目标扬声器的音量进行调整,从而使得即使在遮挡状态下,目标扬声器也能够达到满足要求的外放效果,从而提高声音的外放效果。In the embodiment of the present application, during the loudspeaker playback process, the loudness of the first sound actually received by the microphone reflects the actual playback effect of the target speaker, and the preset sound at the current volume level preset in the electronic device The loudness is the theoretical loudness effect of the target speaker. By comparing the first sound loudness with the preset sound loudness, the gap between the actual loudness effect of the current target loudspeaker and the theoretical loudness can be determined. When the comparison result does not meet the preset loudness condition, it indicates that the actual external effect of the target speaker is not ideal, and the output port of the target speaker is blocked. Therefore, this embodiment adjusts the volume of the blocked target speaker according to the comparison result, so that even in the blocked state, the target The loudspeaker can also achieve the desired external effect, thereby improving the external effect of the sound.

可选的,第一获取模块410可以用于:根据扬声器的功放的放大倍数来确定第一声音档位,或者若电子设备内的扬声器控制组件内记录有音量档位信息的话,则可以直接读取所记录的音量档位信息来获取当前音量档位,本申请不限定获取当前音量档位的具体方式。Optionally, the first acquisition module 410 can be used to: determine the first sound gear according to the amplification factor of the power amplifier of the speaker, or if the volume gear information is recorded in the speaker control component in the electronic device, it can directly read the sound gear. The recorded volume level information is obtained to obtain the current volume level, and the present application does not limit the specific method of obtaining the current volume level.

在本申请的一些实施例中,上述N可以为大于1的正整数。例如,N可以为2,即电子设备包括双扬声器。双扬声器能够提升音频的播放效果,使得电子设备在外放音频时具有更强的立体感。本实施例能够在双扬声器中任意一个扬声器的输出端口受到遮挡后,调整受到遮挡的目标扬声器的音量,从而避免影响双扬声器的立体声效果。In some embodiments of the present application, the above N may be a positive integer greater than 1. For example, N may be 2, ie the electronic device includes dual speakers. The dual speakers can improve the audio playback effect, making the electronic device have a stronger three-dimensional sense when the audio is played externally. In this embodiment, after the output port of any one of the dual speakers is blocked, the volume of the blocked target speaker can be adjusted, so as to avoid affecting the stereo effect of the dual speakers.

在本申请的一些实施例中,上述比较模块420可以包括:In some embodiments of the present application, the above-mentioned comparison module 420 may include:

差值计算单元,用于计算第一声音响度与当前音量档位下的预设声音响度的差值,得到目标差值;a difference calculation unit, used for calculating the difference between the first sound loudness and the preset sound loudness under the current volume gear, to obtain the target difference;

第一比较单元,用于将目标差值与当前音量档位下的目标响度差值进行比较,得到比较结果;The first comparison unit is used to compare the target difference with the target loudness difference under the current volume level to obtain a comparison result;

相应的,上述音量调整模块430具体用于:在目标差值大于或等于目标响度差值的情况下,根据比较结果调节目标扬声器的音量。Correspondingly, the volume adjustment module 430 is specifically configured to adjust the volume of the target speaker according to the comparison result when the target difference is greater than or equal to the target loudness difference.

本实施例中,直接将第一声音响度与预设声音响度的目标差值与目标响度差值进行比较,如果目标差值大于目标响度差值,则表明该扬声器的实际外放的声音响度过低,需要提高音量。这种利用绝对响度值进行比较的方式,能够方便确认每个扬声器的是否被遮挡,进而保证使每个扬声器的实际外放效果均达到对应的理想状态。In this embodiment, the target difference between the first sound loudness and the preset sound loudness is directly compared with the target loudness difference, and if the target difference is greater than the target loudness difference, it indicates the actual loudness of the loudspeaker. Too low, you need to increase the volume. This method of using the absolute loudness value for comparison can easily confirm whether each speaker is blocked, thereby ensuring that the actual external effect of each speaker reaches the corresponding ideal state.

可选的,上述目标响度差值可以为:占预设声音响度的预设百分比的响度。例如,占预设声音响度的10%的响度。Optionally, the above target loudness difference may be: a loudness that accounts for a preset percentage of the preset sound loudness. For example, a loudness that is 10% of the preset sound loudness.

由于目标响度差值表明的是扬声器实际外放时的第一声音响度与理论上的预设声音响度之间能够允许的最大差值,因此,本实施例在预设声音响度的基础上设置目标响度差值,能够使目标响度差值随着音量档位的变化而变化,这种自适应变动的设置方式,提高了目标响度差值的合理性,在基于所设置的目标响度差值调整后,扬声器的外放效果更好。Since the target loudness difference indicates the maximum allowable difference between the actual loudness of the first sound and the theoretical preset sound loudness, this embodiment sets the preset sound loudness on the basis of The target loudness difference can make the target loudness difference change with the change of the volume level. This adaptive change setting method improves the rationality of the target loudness difference. Adjustment based on the set target loudness difference After that, the loudspeaker's external effect is better.

在本申请的另一些实施例中,N个扬声器包括第一扬声器和第二扬声器;上述第一获取模块410可以用于:In other embodiments of the present application, the N speakers include a first speaker and a second speaker; the above-mentioned first acquisition module 410 may be used for:

获取当前音量档位以及麦克风接收到的第二声音响度和第三声音响度,第二声音响度与第一扬声器相关联,第三声音响度与第二扬声器相关联;Obtain the current volume level and the second sound loudness and the third sound loudness received by the microphone, where the second sound loudness is associated with the first speaker, and the third sound loudness is associated with the second speaker;

上述比较模块420可以包括:The above-mentioned comparison module 420 may include:

第一比值计算单元,用于计算第二声音响度和第三声音响度之间的第一比值;a first ratio calculation unit for calculating a first ratio between the loudness of the second sound and the loudness of the third sound;

第二比较单元,用于比较第一比值与预设比值,得到比较结果;其中,预设比值为当前音量档位下第一预设声音响度与第二预设声音响度之间的比值,第一预设声音响度与第一扬声器相对应,第二预设声音响度与第二扬声器相对应;The second comparison unit is configured to compare the first ratio with the preset ratio to obtain a comparison result; wherein, the preset ratio is the ratio between the loudness of the first preset sound and the loudness of the second preset sound at the current volume level, and the first A preset sound loudness corresponds to the first speaker, and a second preset sound loudness corresponds to the second speaker;

上述音量调整模块430可以用于:The volume adjustment module 430 described above can be used to:

在比较结果不满足第一预设条件的情况下,根据比较结果调节第一扬声器的音量;在比较结果不满足第二预设条件的情况下,根据比较结果调节第二扬声器的音量。If the comparison result does not satisfy the first preset condition, adjust the volume of the first speaker according to the comparison result; if the comparison result does not satisfy the second preset condition, adjust the volume of the second speaker according to the comparison result.

本实施例针对电子设备设置有多个扬声器的情况,电子设备中设置多个扬声器,是为了起到立体声效果,这种情况下,通常需要各个扬声器的外放声音响度相同,才能使用户在各个位置均感受到相同的声音效果。因此,本实施例利用两个扬声器的第一声音响度的比值与这两个扬声器的预设声音响度的比值进行比较,从而使得后续音量调整后,能够保证这两个扬声器的实际音量达到平衡状态,使电子设备具有较好的立体声效果。此时,这两个扬声器的实际声音响度可以并不等于预设声音响度。This embodiment is aimed at the situation where the electronic device is provided with multiple speakers. The purpose of setting multiple speakers in the electronic device is to achieve a stereo effect. The same sound effects are felt in all positions. Therefore, in this embodiment, the ratio of the loudness of the first sound of the two speakers is compared with the ratio of the loudness of the preset sound of the two speakers, so that after the subsequent volume adjustment, the actual volume of the two speakers can be guaranteed to reach a balance state, so that the electronic device has a better stereo effect. At this time, the actual sound loudness of the two speakers may not be equal to the preset sound loudness.

在本申请的再一些实施例中,上述第二比较单元可以包括:In still other embodiments of the present application, the above-mentioned second comparison unit may include:

第二比值计算单元,用于计算第一比值与预设比值之间的第二比值;a second ratio calculating unit, configured to calculate a second ratio between the first ratio and the preset ratio;

第三比较单元,用于比较第二比值与当前音量档位下的目标比值,得到比较结果;The third comparison unit is used to compare the second ratio with the target ratio under the current volume level to obtain a comparison result;

上述音量调整模块430可以具体用于:The above-mentioned volume adjustment module 430 can be specifically used for:

在第二比值大于或等于目标比值的情况下,根据比较结果调节第二扬声器的音量;在第二比值小于目标比值的情况下,根据比较结果调节第一扬声器的音量。If the second ratio is greater than or equal to the target ratio, adjust the volume of the second speaker according to the comparison result; if the second ratio is smaller than the target ratio, adjust the volume of the first speaker according to the comparison result.

本实施例中,将第一比值与预设比值的比值来与目标比值比较,根据第一比值与预设比值的比值是否符合要求,能够确定每组中的两个扬声器的外放音量的相对大小关系,进而确定待调整的扬声器及其调整策略,从而保证每组中两个扬声器的外放音量之间的平衡性,这种方式,保证了调整后扬声器外放过程中声音的立体效果。并且这种比较方式,使得用户能够根据实际情况来调整目标比值,进而能够达到根据实际情况选择不同的音量调整效果的目的。In this embodiment, the ratio between the first ratio and the preset ratio is compared with the target ratio, and according to whether the ratio between the first ratio and the preset ratio meets the requirements, the relative volume of the two speakers in each group can be determined. Size relationship, and then determine the speaker to be adjusted and its adjustment strategy, so as to ensure the balance between the external volume of the two speakers in each group. And this comparison method enables the user to adjust the target ratio according to the actual situation, thereby achieving the purpose of selecting different volume adjustment effects according to the actual situation.

在本申请的又一些实施例中,上述音量调整模块430可以具体用于:在第一比值大于或等于预设比值的情况下,根据比较结果调节第二扬声器的音量;在第一比值小于预设比值的情况下,根据比较结果调节第一扬声器的音量。In still other embodiments of the present application, the above-mentioned volume adjustment module 430 may be specifically configured to: when the first ratio is greater than or equal to the preset ratio, adjust the volume of the second speaker according to the comparison result; when the first ratio is less than the preset ratio In the case of setting the ratio, the volume of the first speaker is adjusted according to the comparison result.

本实施例中,直接比对了第一比值和预设比值的大小,由于预设比值作为标准值,因此基于第一比值与预设比值的大小关系,能够确定第一比值是否过大或者过小,进而能够直观的确定待调整的扬声器以及对扬声器进行调整时的音量调整方案。这种方式,保证了电子设备的扬声器能够具有立体声外放效果,当然,具体的音量调整方案可以由工作人员根据实际需求进行设置,本申请对此不做限定。In this embodiment, the magnitudes of the first ratio and the preset ratio are directly compared. Since the preset ratio is used as the standard value, it can be determined whether the first ratio is too large or too large based on the relationship between the first ratio and the preset ratio. Small, so that the speaker to be adjusted and the volume adjustment scheme when adjusting the speaker can be intuitively determined. In this way, it is ensured that the speaker of the electronic device can have a stereo sound effect. Of course, the specific volume adjustment scheme can be set by the staff according to actual needs, which is not limited in this application.

本申请实施例提供的电子设备能够实现图1至图5的方法实施例中实现的各个方法步骤,为避免重复,这里不再赘述。The electronic device provided in the embodiment of the present application can implement each method step implemented in the method embodiment of FIG. 1 to FIG. 5 , and to avoid repetition, details are not described here.

图7示出了本申请实施例提供的一种电子设备的硬件结构示意图。FIG. 7 shows a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present application.

该电子设备500包括但不限于:射频单元501、网络模块502、音频输出单元503、输入单元504、传感器505、显示单元506、用户输入单元507、接口单元508、存储器509、处理器510、以及电源511等部件。本领域技术人员可以理解,图7中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。在本申请实施例中,电子设备包括但不限于手机、平板电脑、笔记本电脑、掌上电脑、车载终端、可穿戴设备、以及计步器等。The electronic device 500 includes but is not limited to: a radio frequency unit 501, a network module 502, an audio output unit 503, an input unit 504, a sensor 505, a display unit 506, a user input unit 507, an interface unit 508, a memory 509, a processor 510, and Power 511 and other components. Those skilled in the art can understand that the structure of the electronic device shown in FIG. 7 does not constitute a limitation on the electronic device, and the electronic device may include more or less components than the one shown, or combine some components, or different components layout. In the embodiments of the present application, the electronic devices include but are not limited to mobile phones, tablet computers, notebook computers, handheld computers, vehicle-mounted terminals, wearable devices, and pedometers.

其中,处理器510,用于获取当前音量档位以及麦克风接收到的第一声音响度,第一声音响度与目标扬声器相对应;比较第一声音响度与当前音量档位下的预设声音响度,得到比较结果,其中,预设声音响度与目标扬声器相对应;在比较结果不满足预设条件的情况下,根据比较结果调节目标扬声器的音量,以使比较结果满足预设条件。Among them, the processor 510 is used to obtain the current volume level and the first sound loudness received by the microphone, and the first sound loudness corresponds to the target speaker; compare the first sound loudness with the preset volume under the current volume level sound loudness to obtain a comparison result, wherein the preset sound loudness corresponds to the target speaker; if the comparison result does not meet the preset condition, adjust the volume of the target speaker according to the comparison result, so that the comparison result satisfies the preset condition.

在本申请实施例中,在扬声器外放过程中,麦克风实际收到的第一声音响度反映的是目标扬声器的实际外放效果,电子设备内预先设置的当前音量档位下的预设声音响度为目标扬声器的理论外放效果,通过将第一声音响度与预设声音响度进行比较,能够确定当前目标扬声器的实际外放效果与理论外放效果的差距,当比较结果不满足预设条件时,表明目标扬声器的实际外放效果不理想,目标扬声器的输出端口受到了遮挡,因此本实施例根据比较结果对受到遮挡的目标扬声器的音量进行调整,从而使得即使在遮挡状态下,目标扬声器也能够达到满足要求的外放效果,从而提高声音的外放效果。In the embodiment of the present application, during the loudspeaker playback process, the loudness of the first sound actually received by the microphone reflects the actual playback effect of the target speaker, and the preset sound at the current volume level preset in the electronic device The loudness is the theoretical loudness effect of the target speaker. By comparing the first sound loudness with the preset sound loudness, the gap between the actual loudness effect of the current target loudspeaker and the theoretical loudness can be determined. When the comparison result does not meet the preset loudness condition, it indicates that the actual external effect of the target speaker is not ideal, and the output port of the target speaker is blocked. Therefore, this embodiment adjusts the volume of the blocked target speaker according to the comparison result, so that even in the blocked state, the target The loudspeaker can also achieve the desired external effect, thereby improving the external effect of the sound.

应理解的是,本申请实施例中,射频单元501可用于收发信息或通话过程中,信号的接收和发送,具体的,将来自基站的下行数据接收后,给处理器510处理;另外,将上行的数据发送给基站。通常,射频单元501包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器、双工器等。此外,射频单元501还可以通过无线通信系统与网络和其他设备通信。It should be understood that, in this embodiment of the present application, the radio frequency unit 501 can be used for receiving and sending signals during sending and receiving information or during a call. Specifically, after receiving the downlink data from the base station, it is processed by the processor 510; The uplink data is sent to the base station. Generally, the radio frequency unit 501 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 501 can also communicate with the network and other devices through a wireless communication system.

电子设备通过网络模块502为用户提供了无线的宽带互联网访问,如帮助用户收发电子邮件、浏览网页和访问流式媒体等。The electronic device provides the user with wireless broadband Internet access through the network module 502, such as helping the user to send and receive emails, browse web pages, access streaming media, and the like.

音频输出单元503可以将射频单元501或网络模块502接收的或者在存储器509中存储的音频数据转换成音频信号并且输出为声音。而且,音频输出单元503还可以提供与电子设备500执行的特定功能相关的音频输出(例如,呼叫信号接收声音、消息接收声音等等)。音频输出单元503包括扬声器、蜂鸣器以及受话器等。The audio output unit 503 may convert audio data received by the radio frequency unit 501 or the network module 502 or stored in the memory 509 into audio signals and output as sound. Also, the audio output unit 503 may also provide audio output related to a specific function performed by the electronic device 500 (eg, call signal reception sound, message reception sound, etc.). The audio output unit 503 includes a speaker, a buzzer, a receiver, and the like.

输入单元504用于接收音频或视频信号。输入单元504可以包括图形处理器(Graphics Processing Unit,GPU)5041和麦克风5042,图形处理器5041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。处理后的图像帧可以显示在显示单元506上。经图形处理器5041处理后的图像帧可以存储在存储器509(或其它存储介质)中或者经由射频单元501或网络模块502进行发送。麦克风5042可以接收声音,并且能够将这样的声音处理为音频数据。处理后的音频数据可以在电话通话模式的情况下转换为可经由射频单元501发送到移动通信基站的格式输出。The input unit 504 is used to receive audio or video signals. The input unit 504 may include a graphics processor (Graphics Processing Unit, GPU) 5041 and a microphone 5042, and the graphics processor 5041 is used for still pictures or video images obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode data is processed. The processed image frames may be displayed on the display unit 506 . The image frames processed by the graphics processor 5041 may be stored in the memory 509 (or other storage medium) or transmitted via the radio frequency unit 501 or the network module 502 . The microphone 5042 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format that can be transmitted to a mobile communication base station via the radio frequency unit 501 for output in the case of a telephone call mode.

电子设备500还包括至少一种传感器505,比如光传感器、运动传感器以及其他传感器。具体地,光传感器包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板5061的亮度,接近传感器可在电子设备500移动到耳边时,关闭显示面板5061和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别电子设备姿态(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;传感器505还可以包括指纹传感器、压力传感器、虹膜传感器、分子传感器、陀螺仪、气压计、湿度计、温度计、红外线传感器等,在此不再赘述。The electronic device 500 also includes at least one sensor 505, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 5061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 5061 and the display panel 5061 when the electronic device 500 is moved to the ear. / or backlight. As a kind of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of electronic devices (such as horizontal and vertical screen switching, related games , magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 505 may also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, Infrared sensors, etc., are not repeated here.

显示单元506用于显示由用户输入的信息或提供给用户的信息。显示单元506可包括显示面板5061,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板5061。The display unit 506 is used to display information input by the user or information provided to the user. The display unit 506 may include a display panel 5061, and the display panel 5061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.

用户输入单元507可用于接收输入的数字或字符信息,以及产生与电子设备的用户设置以及功能控制有关的键信号输入。具体地,用户输入单元507包括触控面板5071以及其他输入设备5072。触控面板5071,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板5071上或在触控面板5071附近的操作)。触控面板5071可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器510,接收处理器510发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板5071。除了触控面板5071,用户输入单元507还可以包括其他输入设备5072。具体地,其他输入设备5072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。The user input unit 507 may be used to receive input numerical or character information, and generate key signal input related to user setting and function control of the electronic device. Specifically, the user input unit 507 includes a touch panel 5071 and other input devices 5072 . The touch panel 5071, also referred to as a touch screen, can collect the user's touch operations on or near it (such as the user's finger, stylus, etc., any suitable object or accessory on or near the touch panel 5071). operate). The touch panel 5071 may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the touch controller. To the processor 510, the command sent by the processor 510 is received and executed. In addition, the touch panel 5071 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 5071 , the user input unit 507 may also include other input devices 5072 . Specifically, other input devices 5072 may include, but are not limited to, physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be repeated here.

进一步的,触控面板5071可覆盖在显示面板5061上,当触控面板5071检测到在其上或附近的触摸操作后,传送给处理器510以确定触摸事件的类型,随后处理器510根据触摸事件的类型在显示面板5061上提供相应的视觉输出。虽然在图7中,触控面板5071与显示面板5061是作为两个独立的部件来实现电子设备的输入和输出功能,但是在某些实施例中,可以将触控面板5071与显示面板5061集成而实现电子设备的输入和输出功能,具体此处不做限定。Further, the touch panel 5071 can be covered on the display panel 5061. When the touch panel 5071 detects a touch operation on or near it, it transmits it to the processor 510 to determine the type of the touch event, and then the processor 510 determines the type of the touch event according to the touch The type of event provides a corresponding visual output on display panel 5061. Although in FIG. 7 , the touch panel 5071 and the display panel 5061 are used as two independent components to realize the input and output functions of the electronic device, but in some embodiments, the touch panel 5071 and the display panel 5061 may be integrated The implementation of the input and output functions of the electronic device is not specifically limited here.

接口单元508为外部装置与电子设备500连接的接口。例如,外部装置可以包括有线或无线头戴式耳机端口、外部电源(或电池充电器)端口、有线或无线数据端口、存储卡端口、用于连接具有识别模块的装置的端口、音频输入/输出(I/O)端口、视频I/O端口、耳机端口等等。接口单元508可以用于接收来自外部装置的输入(例如,数据信息、电力等等)并且将接收到的输入传输到电子设备500内的一个或多个元件或者可以用于在电子设备500和外部装置之间传输数据。The interface unit 508 is an interface for connecting an external device to the electronic device 500 . For example, external devices may include wired or wireless headset ports, external power (or battery charger) ports, wired or wireless data ports, memory card ports, ports for connecting devices with identification modules, audio input/output (I/O) ports, video I/O ports, headphone ports, and more. The interface unit 508 may be used to receive input (eg, data information, power, etc.) from external devices and transmit the received input to one or more elements within the electronic device 500 or may be used between the electronic device 500 and external Transfer data between devices.

存储器509可用于存储软件程序以及各种数据。存储器509可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器509可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 509 may be used to store software programs as well as various data. The memory 509 may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program (such as a sound playback function, an image playback function, etc.) required for at least one function, and the like; Data created by the use of the mobile phone (such as audio data, phone book, etc.), etc. Additionally, memory 509 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.

处理器510是电子设备的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或执行存储在存储器509内的软件程序和/或模块,以及调用存储在存储器509内的数据,执行电子设备的各种功能和处理数据,从而对电子设备进行整体监控。处理器510可包括一个或多个处理单元;优选的,处理器510可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器510中。The processor 510 is the control center of the electronic device, using various interfaces and lines to connect various parts of the entire electronic device, by running or executing the software programs and/or modules stored in the memory 509, and calling the data stored in the memory 509. , perform various functions of electronic equipment and process data, so as to monitor electronic equipment as a whole. The processor 510 may include one or more processing units; preferably, the processor 510 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem The processor mainly handles wireless communication. It can be understood that, the above-mentioned modulation and demodulation processor may not be integrated into the processor 510.

电子设备500还可以包括给各个部件供电的电源511(比如电池),优选的,电源511可以通过电源管理系统与处理器510逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The electronic device 500 may also include a power supply 511 (such as a battery) for supplying power to various components. Preferably, the power supply 511 may be logically connected to the processor 510 through a power management system, so as to manage charging, discharging, and power consumption management through the power management system and other functions.

另外,电子设备500包括一些未示出的功能模块,在此不再赘述。In addition, the electronic device 500 includes some functional modules not shown, which will not be repeated here.

优选的,本申请实施例还提供一种电子设备,包括处理器510,存储器509,存储在存储器509上并可在所述处理器510上运行的程序或指令,该程序或指令被处理器510执行时实现上述扬声器控制方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Preferably, an embodiment of the present application further provides an electronic device, including a processor 510, a memory 509, a program or instruction stored in the memory 509 and executable on the processor 510, the program or instruction being executed by the processor 510 When executed, each process of the above speaker control method embodiment is implemented, and the same technical effect can be achieved. In order to avoid repetition, details are not described here.

本申请实施例还提供一种可读存储介质,可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述扬声器控制方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。其中,所述的可读存储介质,如只读存储器(Read-Only Memory,简称ROM)、随机存取存储器(Random Access Memory,简称RAM)、磁碟或者光盘等。The embodiments of the present application further provide a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or instruction is executed by a processor, each process of the foregoing speaker control method embodiment can be achieved, and the same technology can be achieved. The effect, in order to avoid repetition, is not repeated here. The readable storage medium is, for example, a read-only memory (Read-Only Memory, ROM for short), a random access memory (Random Access Memory, RAM for short), a magnetic disk, or an optical disk.

本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述扬声器控制方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。An embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement the above speaker control method embodiments. Each process can achieve the same technical effect. In order to avoid repetition, it will not be repeated here.

应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, a system-on-chip, a system-on-a-chip, or a system-on-a-chip, or the like.

需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the method of the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence or in a part that contributes to the prior art, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, CD-ROM), including several instructions to make a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in the various embodiments of this application.

上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。The embodiments of the present application have been described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific embodiments, which are merely illustrative rather than restrictive. Under the inspiration of this application, without departing from the scope of protection of the purpose of this application and the claims, many forms can be made, which all fall within the protection of this application.

Claims (10)

1. A loudspeaker control method is applied to electronic equipment, and is characterized in that the electronic equipment comprises N loudspeakers, wherein N is a positive integer; the method comprises the following steps:
acquiring a current volume gear and a first sound loudness received by a microphone, wherein the first sound loudness corresponds to a target loudspeaker;
comparing the first sound loudness with a preset sound loudness under the current sound volume gear to obtain a comparison result, wherein the preset sound loudness corresponds to the target loudspeaker;
and under the condition that the comparison result does not meet the preset condition, adjusting the volume of the target loudspeaker according to the comparison result so that the comparison result meets the preset condition.
2. The method of claim 1, wherein N is a positive integer greater than 1.
3. The method according to claim 1 or 2, wherein the comparing the first sound loudness with the preset sound loudness in the current volume step results in a comparison result comprising:
calculating a difference value between the first sound loudness and the preset sound loudness at the current sound volume level to obtain a target difference value;
comparing the target difference value with the target loudness difference value under the current volume gear to obtain a comparison result;
and when the comparison result does not meet the preset condition, adjusting the volume of the target loudspeaker according to the comparison result, including:
and under the condition that the target difference value is larger than or equal to the target loudness difference value, adjusting the volume of the target loudspeaker according to the comparison result.
4. The method of claim 3, wherein the target loudness difference is: a loudness that is a preset percentage of the preset sound loudness.
5. The method of claim 2, wherein the N speakers comprise a first speaker and a second speaker;
the acquiring of the current volume gear and the first sound loudness received by the microphone includes:
acquiring the current volume level, and a second sound loudness and a third sound loudness received by the microphone, wherein the second sound loudness is associated with the first loudspeaker, and the third sound loudness is associated with the second loudspeaker;
comparing the first sound loudness with a preset sound loudness at the current volume level to obtain a comparison result, wherein the preset sound loudness corresponds to the target speaker, and the comparing includes:
calculating a first ratio between the second sound loudness and the third sound loudness;
comparing the first ratio with a preset ratio to obtain a comparison result;
the preset ratio is the ratio between a first preset sound loudness and a second preset sound loudness in the current sound volume gear, the first preset sound loudness corresponds to the first loudspeaker, and the second preset sound loudness corresponds to the second loudspeaker;
and when the comparison result does not meet the preset condition, adjusting the volume of the target loudspeaker according to the comparison result, including:
under the condition that the comparison result does not meet a first preset condition, adjusting the volume of the first loudspeaker according to the comparison result;
and under the condition that the comparison result does not meet a second preset condition, adjusting the volume of the second loudspeaker according to the comparison result.
6. The method of claim 5, wherein comparing the first ratio with a preset ratio to obtain a comparison result comprises:
calculating a second ratio between the first ratio and the preset ratio;
comparing the second ratio with the target ratio under the current volume gear to obtain a comparison result;
and when the comparison result does not meet the preset condition, adjusting the volume of the target loudspeaker according to the comparison result, including:
under the condition that the second ratio is larger than or equal to the target ratio, adjusting the volume of the second loudspeaker according to the comparison result;
and under the condition that the second ratio is smaller than the target ratio, adjusting the volume of the first loudspeaker according to the comparison result.
7. The method according to claim 5, wherein the adjusting the volume of the target speaker according to the comparison result if the comparison result does not satisfy a preset condition comprises:
under the condition that the first ratio is larger than or equal to the preset ratio, adjusting the volume of the second loudspeaker according to the comparison result;
and under the condition that the first ratio is smaller than the preset ratio, adjusting the volume of the first loudspeaker according to the comparison result.
8. A loudspeaker control device is applied to electronic equipment and is characterized in that the electronic equipment comprises N loudspeakers, and N is a positive integer; the device comprises:
the first acquiring module is used for acquiring a current volume gear and first sound loudness received by a microphone, wherein the first sound loudness corresponds to a target loudspeaker;
the comparison module is used for comparing the first sound loudness with a preset sound loudness under the current sound volume level to obtain a comparison result, wherein the preset sound loudness corresponds to the target loudspeaker;
and the volume adjusting module is used for adjusting the volume of the target loudspeaker according to the comparison result under the condition that the comparison result does not meet the preset condition so as to enable the comparison result to meet the preset condition.
9. An electronic device comprising a processor, a memory, and a program or instructions stored on the memory and executable on the processor, the program or instructions when executed by the processor implementing the steps of the speaker control method according to any one of claims 1 to 7.
10. A readable storage medium, characterized in that the readable storage medium stores thereon a program or instructions which, when executed by a processor, implement the steps of the speaker control method according to any one of claims 1 to 7.
CN202010469439.4A 2020-05-28 2020-05-28 Speaker control method, speaker control device, electronic device, and medium Active CN111654800B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010469439.4A CN111654800B (en) 2020-05-28 2020-05-28 Speaker control method, speaker control device, electronic device, and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010469439.4A CN111654800B (en) 2020-05-28 2020-05-28 Speaker control method, speaker control device, electronic device, and medium

Publications (2)

Publication Number Publication Date
CN111654800A true CN111654800A (en) 2020-09-11
CN111654800B CN111654800B (en) 2021-09-17

Family

ID=72348713

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010469439.4A Active CN111654800B (en) 2020-05-28 2020-05-28 Speaker control method, speaker control device, electronic device, and medium

Country Status (1)

Country Link
CN (1) CN111654800B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115550755A (en) * 2021-06-30 2022-12-30 北京小米移动软件有限公司 Playing device control method, device, device and medium
TWI862163B (en) * 2023-09-13 2024-11-11 圓展科技股份有限公司 Speaker system and automatic tuning method thereof

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2429155A1 (en) * 2010-09-13 2012-03-14 HTC Corporation Mobile electronic device and sound playback method thereof
CN105100330A (en) * 2015-08-26 2015-11-25 广东欧珀移动通信有限公司 Method and mobile terminal for optimizing equipment sound effect
US20160381480A1 (en) * 2015-06-26 2016-12-29 Kyocera Corporation Electronic device
US20170012591A1 (en) * 2015-07-10 2017-01-12 Intel Corporation Balancing mobile device audio
CN106850966A (en) * 2016-12-28 2017-06-13 努比亚技术有限公司 A kind of method for realizing volume control, device and mobile terminal
CN107391078A (en) * 2017-07-14 2017-11-24 维沃移动通信有限公司 A kind of sound adjusting method and mobile terminal
CN107483735A (en) * 2017-08-18 2017-12-15 广东欧珀移动通信有限公司 Volume control method, device and storage medium of mobile terminal and mobile terminal
CN107509153A (en) * 2017-08-18 2017-12-22 广东欧珀移动通信有限公司 Detection method, device, storage medium and terminal of sound playback device
CN107734143A (en) * 2017-09-15 2018-02-23 维沃移动通信有限公司 A kind of failure based reminding method, mobile terminal and readable storage medium storing program for executing
WO2018081927A1 (en) * 2016-11-01 2018-05-11 华为技术有限公司 Volume adjustment method and apparatus, and electronic device
CN109121046A (en) * 2018-07-24 2019-01-01 Oppo(重庆)智能科技有限公司 Plug-hole processing method and Related product
CN109218913A (en) * 2018-08-27 2019-01-15 奇酷互联网络科技(深圳)有限公司 Sound adjusting method, terminal device and the device with store function

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2429155A1 (en) * 2010-09-13 2012-03-14 HTC Corporation Mobile electronic device and sound playback method thereof
US20160381480A1 (en) * 2015-06-26 2016-12-29 Kyocera Corporation Electronic device
US20170012591A1 (en) * 2015-07-10 2017-01-12 Intel Corporation Balancing mobile device audio
CN105100330A (en) * 2015-08-26 2015-11-25 广东欧珀移动通信有限公司 Method and mobile terminal for optimizing equipment sound effect
WO2018081927A1 (en) * 2016-11-01 2018-05-11 华为技术有限公司 Volume adjustment method and apparatus, and electronic device
CN106850966A (en) * 2016-12-28 2017-06-13 努比亚技术有限公司 A kind of method for realizing volume control, device and mobile terminal
CN107391078A (en) * 2017-07-14 2017-11-24 维沃移动通信有限公司 A kind of sound adjusting method and mobile terminal
CN107483735A (en) * 2017-08-18 2017-12-15 广东欧珀移动通信有限公司 Volume control method, device and storage medium of mobile terminal and mobile terminal
CN107509153A (en) * 2017-08-18 2017-12-22 广东欧珀移动通信有限公司 Detection method, device, storage medium and terminal of sound playback device
CN107734143A (en) * 2017-09-15 2018-02-23 维沃移动通信有限公司 A kind of failure based reminding method, mobile terminal and readable storage medium storing program for executing
CN109121046A (en) * 2018-07-24 2019-01-01 Oppo(重庆)智能科技有限公司 Plug-hole processing method and Related product
CN109218913A (en) * 2018-08-27 2019-01-15 奇酷互联网络科技(深圳)有限公司 Sound adjusting method, terminal device and the device with store function

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李宏斌: "基于短时傅里叶变换的异常音检测方法", 《声学技术》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115550755A (en) * 2021-06-30 2022-12-30 北京小米移动软件有限公司 Playing device control method, device, device and medium
CN115550755B (en) * 2021-06-30 2025-11-11 北京小米移动软件有限公司 Method, device, equipment and medium for controlling playing equipment
TWI862163B (en) * 2023-09-13 2024-11-11 圓展科技股份有限公司 Speaker system and automatic tuning method thereof

Also Published As

Publication number Publication date
CN111654800B (en) 2021-09-17

Similar Documents

Publication Publication Date Title
CN108551636B (en) Loudspeaker control method and mobile terminal
CN110730260B (en) Control method of electronic equipment and electronic equipment
CN111459456B (en) Audio control method and electronic device
CN111638779A (en) Audio playback control method, device, electronic device and readable storage medium
WO2017215660A1 (en) Scene sound effect control method, and electronic device
CN108196815B (en) Method for adjusting call sound and mobile terminal
CN110062104A (en) Application program launching method, device and mobile terminal
CN111372228A (en) Audio control method and electronic equipment
WO2020228538A1 (en) Screenshot method and mobile terminal
CN108430004B (en) Loudspeaker amplitude adjusting device, adjusting method and mobile terminal
CN110855313A (en) A signal control method and electronic device
CN111614329A (en) A power amplifier, electronic equipment, voltage control method and device
CN111078186A (en) Playing method and electronic equipment
CN108008808B (en) Operation parameter adjusting method and mobile terminal
CN109992228A (en) A kind of interface display parameter method of adjustment and terminal device
CN111654800A (en) Speaker control method, device, electronic device and medium
CN108540642B (en) Operation method of mobile terminal and mobile terminal
CN109963235B (en) Sound signal processing method and mobile terminal
CN108390996A (en) A kind of display methods, mobile terminal
CN108989560B (en) Screen switching control method in shooting mode, terminal device and storage medium
CN108696638B (en) Control method of a mobile terminal and mobile terminal
CN111526248A (en) Audio output mode switching method and electronic device
CN111541804A (en) Electronic equipment, control method and control device
CN111310165A (en) Account switching or registration method and electronic device
CN110087130A (en) A kind of video broadcasting method and terminal device

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
GR01 Patent grant
GR01 Patent grant