[go: up one dir, main page]

CN114501239B - Master-slave switching method and device of earphone, bluetooth earphone and storage medium - Google Patents

Master-slave switching method and device of earphone, bluetooth earphone and storage medium Download PDF

Info

Publication number
CN114501239B
CN114501239B CN202210178812.XA CN202210178812A CN114501239B CN 114501239 B CN114501239 B CN 114501239B CN 202210178812 A CN202210178812 A CN 202210178812A CN 114501239 B CN114501239 B CN 114501239B
Authority
CN
China
Prior art keywords
bluetooth
headset
sound signal
bluetooth headset
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.)
Active
Application number
CN202210178812.XA
Other languages
Chinese (zh)
Other versions
CN114501239A (en
Inventor
罗正宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202210178812.XA priority Critical patent/CN114501239B/en
Publication of CN114501239A publication Critical patent/CN114501239A/en
Application granted granted Critical
Publication of CN114501239B publication Critical patent/CN114501239B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R5/00Stereophonic arrangements
    • H04R5/033Headphones for stereophonic communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R3/00Circuits for transducers, loudspeakers or microphones
    • H04R3/12Circuits for transducers, loudspeakers or microphones for distributing signals to two or more loudspeakers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R5/00Stereophonic arrangements
    • H04R5/04Circuit arrangements, e.g. for selective connection of amplifier inputs/outputs to loudspeakers, for loudspeaker detection, or for adaptation of settings to personal preferences or hearing impairments
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R2420/00Details of connection covered by H04R, not provided for in its groups
    • H04R2420/03Connection circuits to selectively connect loudspeakers or headphones to amplifiers

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Otolaryngology (AREA)
  • Telephone Function (AREA)

Abstract

The application discloses a master-slave switching method and device of an earphone, a Bluetooth earphone and a storage medium, and relates to the technical field of electronic equipment. The method comprises the following steps: the method comprises the steps of obtaining a sound signal collected by a first microphone of a first Bluetooth headset to serve as a first sound signal, obtaining a sound signal collected by a second microphone of a second Bluetooth headset to serve as a second sound signal through a second Bluetooth link between the first Bluetooth headset and the second Bluetooth headset, and sending a switching instruction to the second Bluetooth headset through the second Bluetooth link under the condition that the first sound signal and the second sound signal meet preset signal conditions, wherein the switching instruction is used for indicating the second Bluetooth headset to serve as a main headset to establish a Bluetooth link with electronic equipment. According to the application, the switching control of the master earphone and the slave earphone is performed based on the sound signals acquired by the master earphone and the slave earphone, so that the accuracy of switching the master earphone and the slave earphone can be improved, and the cost of the Bluetooth earphone can be reduced.

Description

耳机的主从切换方法、装置、蓝牙耳机以及存储介质Master-slave switching method and device for earphone, Bluetooth earphone and storage medium

技术领域Technical Field

本申请涉及电子设备技术领域,更具体地,涉及一种耳机的主从切换方法、装置、蓝牙耳机以及存储介质。The present application relates to the technical field of electronic equipment, and more specifically, to a method and device for switching a master-slave portion of an earphone, a Bluetooth earphone, and a storage medium.

背景技术Background technique

随着科学技术的发展,电子设备的使用越来越广泛,功能越来越多,已经成为人们日常生活中的必备之一。目前,用户在利用电子设备拾取声音信号时,会经常使用蓝牙耳机进行拾取,特别是左、右声道无线分离的真无线立体声(True Wireless Stereo,TWS)耳机。TWS耳机通常可以分为主耳机与从耳机,但目前主从耳机的选择难以保证声音信号的良好采集,以及传输给电子设备的音频质量。With the development of science and technology, electronic devices are used more and more widely and have more and more functions. They have become one of the necessities in people's daily life. At present, when users use electronic devices to pick up sound signals, they often use Bluetooth headsets to pick up, especially True Wireless Stereo (TWS) headsets with wireless separation of left and right channels. TWS headsets can usually be divided into master headsets and slave headsets, but the current selection of master and slave headsets is difficult to ensure good acquisition of sound signals and the audio quality transmitted to electronic devices.

发明内容Summary of the invention

鉴于上述问题,本申请提出了一种耳机的主从切换方法、装置、电子设备以及存储介质,以解决上述问题。In view of the above problems, the present application proposes a master-slave switching method, device, electronic device and storage medium for headphones to solve the above problems.

第一方面,本申请实施例提供了一种耳机的主从切换方法,应用于第一蓝牙耳机,所述第一蓝牙耳机作为主耳机与电子设备建立有第一蓝牙链路时,第二蓝牙耳机作为从耳机与所述第一蓝牙耳机建立有第二蓝牙链路,所述第一蓝牙耳机包括第一麦克风,所述第二蓝牙耳机包括第二麦克风,所述方法包括:获取所述第一麦克风采集到的声音信号,作为第一声音信号;通过所述第二蓝牙链路获取所述第二麦克风采集到的声音信号,作为第二声音信号;在所述第一声音信号和所述第二声音信号满足预设信号条件的情况下,通过所述第二蓝牙链路向所述第二蓝牙耳机发送切换指令,所述切换指令用于指示所述第二蓝牙耳机作为主耳机与所述电子设备建立蓝牙链路。In a first aspect, an embodiment of the present application provides a master-slave switching method for headphones, which is applied to a first Bluetooth headset, when the first Bluetooth headset serves as a master headset to establish a first Bluetooth link with an electronic device, the second Bluetooth headset serves as a slave headset to establish a second Bluetooth link with the first Bluetooth headset, the first Bluetooth headset includes a first microphone, and the second Bluetooth headset includes a second microphone. The method includes: obtaining a sound signal collected by the first microphone as a first sound signal; obtaining a sound signal collected by the second microphone through the second Bluetooth link as a second sound signal; and when the first sound signal and the second sound signal meet a preset signal condition, sending a switching instruction to the second Bluetooth headset through the second Bluetooth link, wherein the switching instruction is used to instruct the second Bluetooth headset to serve as the master headset to establish a Bluetooth link with the electronic device.

第二方面,本申请实施例提供了一种耳机的主从切换装置,应用于第一蓝牙耳机,所述第一蓝牙耳机作为主耳机与电子设备建立有第一蓝牙链路时,第二蓝牙耳机作为从耳机与所述第一蓝牙耳机建立有第二蓝牙链路,所述第一蓝牙耳机包括第一麦克风,所述第二蓝牙耳机包括第二麦克风,所述装置包括:第一声音信号获取模块,用于获取所述第一麦克风采集到的声音信号,作为第一声音信号;第二声音信号获取模块,用于通过所述第二蓝牙链路获取所述第二麦克风采集到的声音信号,作为第二声音信号;主从耳机切换模块,用于在所述第一声音信号和所述第二声音信号满足预设信号条件的情况下,通过所述第二蓝牙链路向所述第二蓝牙耳机发送切换指令,所述切换指令用于指示所述第二蓝牙耳机作为主耳机与所述电子设备建立蓝牙链路。In a second aspect, an embodiment of the present application provides a master-slave switching device for headphones, which is applied to a first Bluetooth headset, when the first Bluetooth headset serves as a master headset to establish a first Bluetooth link with an electronic device, the second Bluetooth headset serves as a slave headset to establish a second Bluetooth link with the first Bluetooth headset, the first Bluetooth headset includes a first microphone, and the second Bluetooth headset includes a second microphone, and the device includes: a first sound signal acquisition module, used to acquire a sound signal collected by the first microphone as a first sound signal; a second sound signal acquisition module, used to acquire a sound signal collected by the second microphone through the second Bluetooth link as a second sound signal; a master-slave headset switching module, used to send a switching instruction to the second Bluetooth headset through the second Bluetooth link when the first sound signal and the second sound signal meet a preset signal condition, and the switching instruction is used to instruct the second Bluetooth headset to serve as the master headset to establish a Bluetooth link with the electronic device.

第三方面,本申请实施例提供了一种蓝牙耳机,包括存储器和处理器,所述存储器耦接到所述处理器,所述存储器存储指令,当所述指令由所述处理器执行时所述处理器执行上述方法。In a third aspect, an embodiment of the present application provides a Bluetooth headset, comprising a memory and a processor, wherein the memory is coupled to the processor, the memory stores instructions, and when the instructions are executed by the processor, the processor executes the above method.

第四方面,本申请实施例提供了一种计算机可读取存储介质,所述计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行上述方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a program code is stored, and the program code can be called by a processor to execute the above method.

在本申请实施例中,由于主耳机是基于主耳机的麦克风采集到的声音信号和从耳机的麦克风采集到的声音信号,确定是否需要进行主从耳机的切换,从而可以避免设置其他用于检测佩戴的传感器带来的成本问题,可以降低蓝牙耳机的成本。另外,由于主耳机是基于主耳机的麦克风采集到的声音信号和从耳机的麦克风采集到的声音信号,可以避免所设置的其他用于检测佩戴的传感器检测错误的问题,可以提升主从耳机切换的准确率。In the embodiment of the present application, since the master earphone determines whether it is necessary to switch between the master and slave earphones based on the sound signal collected by the microphone of the master earphone and the sound signal collected by the microphone of the slave earphone, the cost problem caused by setting other sensors for detecting wearing can be avoided, and the cost of the Bluetooth earphone can be reduced. In addition, since the master earphone is based on the sound signal collected by the microphone of the master earphone and the sound signal collected by the microphone of the slave earphone, the problem of detection errors of other sensors set up for detecting wearing can be avoided, and the accuracy of switching between the master and slave earphones can be improved.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

图1示出了可用于本申请实施例提供的耳机的主从切换方法的应用环境示意图;FIG1 is a schematic diagram showing an application environment of a master-slave switching method for headphones provided in an embodiment of the present application;

图2示出了本申请一实施例提供的耳机的主从切换方法的流程示意图;FIG2 is a schematic diagram showing a flow chart of a method for switching between a master and a slave of a headset provided in an embodiment of the present application;

图3示出了本申请一实施例提供的耳机的主从切换方法的流程示意图;FIG3 is a schematic diagram showing a flow chart of a method for switching between a master and a slave of a headset provided in an embodiment of the present application;

图4示出了本申请一实施例提供的耳机的主从切换方法的流程示意图;FIG4 is a schematic diagram showing a flow chart of a method for switching between a master and a slave of a headset provided in an embodiment of the present application;

图5示出了本申请一实施例提供的耳机的主从切换方法的流程示意图;FIG5 is a schematic diagram showing a flow chart of a method for switching between a master and a slave of a headset provided in an embodiment of the present application;

图6示出了本申请一实施例提供的耳机的主从切换方法的流程示意图;FIG6 is a schematic diagram showing a flow chart of a method for switching between a master and a slave of a headset provided in an embodiment of the present application;

图7示出了本申请一实施例提供的耳机的主从切换方法的流程示意图;FIG7 is a schematic diagram showing a flow chart of a method for switching between a master and a slave of a headset provided in an embodiment of the present application;

图8示出了本申请一实施例提供的耳机的主从切换方法的流程示意图;FIG8 is a schematic diagram showing a flow chart of a method for switching between a master and a slave of a headset provided in an embodiment of the present application;

图9示出了本申请一实施例通过的耳机的主从切换方法的时序图;FIG9 is a timing diagram showing a method for switching between a master and a slave of a headset according to an embodiment of the present application;

图10示出了本申请一实施例提供的耳机的主从切换装置的模块框图;FIG10 shows a module block diagram of a master-slave switching device for a headset provided in an embodiment of the present application;

图11示出了本申请实施例用于执行根据本申请实施例的耳机的主从切换方法的电子设备的框图;FIG11 is a block diagram of an electronic device for executing a master-slave switching method of a headset according to an embodiment of the present application;

图12示出了本申请实施例的用于保存或者携带实现根据本申请实施例的耳机的主从切换方法的程序代码的存储单元。FIG12 shows a storage unit for storing or carrying a program code for implementing a master-slave switching method for a headset according to an embodiment of the present application.

具体实施方式Detailed ways

为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

需要说明的是:在本申请实例中,“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that in the examples of the present application, "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

目前,大多电子设备,例如电脑、手机等,可以实现对音频数据的播放与拾取。随着科学技术的发展以及用户需求的增加,电子设备可以与外接音频采集设备连接,从而实现电子设备通过外接的音频采集设备采集音频数据(声音信号)。其中,音频采集设备可以包括具有麦克风的耳机、话筒等。上述音频采集设备可以采集音频数据,并将采集到的音频数据传输给电子设备进行处理,例如,采集到的音频数据可以经由电子设备通过网络传输给其他电子设备。其中,电子设备可以通过有线方式或者无线方式与音频采集设备连接,在此不做具体的限定。At present, most electronic devices, such as computers, mobile phones, etc., can play and pick up audio data. With the development of science and technology and the increase in user demand, electronic devices can be connected to external audio acquisition devices, so that the electronic devices can collect audio data (sound signals) through external audio acquisition devices. Among them, the audio acquisition device may include headphones, microphones, etc. with microphones. The above-mentioned audio acquisition device can collect audio data and transmit the collected audio data to the electronic device for processing. For example, the collected audio data can be transmitted to other electronic devices via the network via the electronic device. Among them, the electronic device can be connected to the audio acquisition device by wire or wirelessly, which is not specifically limited here.

在实际利用音频采集设备采集音频数据传输给电子设备时,用户经常使用无线通信方式的耳机实现音频数据的采集以及传输,例如,利用无线保真(Wireless Fidelity,WiFi)通信的耳机,或者利用蓝牙(Bluetooth,BT)通信的耳机进行音频数据的采集以及传输。特别是对于需求较高的用户,可以通过左声道与右声道无线分离的TWS耳机进行音频数据的采集与播放。上述TWS耳机可以实现真正的蓝牙左声道、右声道无线分离使用,即TWS耳机的两个耳机都不需要有线连接。When actually using an audio acquisition device to collect audio data and transmit it to an electronic device, users often use headphones with wireless communication to collect and transmit audio data, for example, headphones that use Wireless Fidelity (WiFi) communication, or headphones that use Bluetooth (BT) communication to collect and transmit audio data. Especially for users with higher demands, audio data can be collected and played through TWS headphones with wireless separation of the left and right channels. The above-mentioned TWS headphones can realize true wireless separation of the Bluetooth left and right channels, that is, neither of the two headphones of the TWS headphones requires a wired connection.

其中,TWS耳机由主耳机和从耳机构成,工作原理是电子设备与主耳机通过蓝牙连接,主耳机与从耳机通过近磁场感应技术(Near Field Magnetic Induction,简称NFMI)或者TWS协议连接。在下行场景中,电子设备上的数据信号通过蓝牙传输至主耳机,再由主耳机通过NFMI或TWS协议传输至从耳机,从而实现左右耳机接收电子设备传输的数据信号;或者,在下行场景中,电子设备上的数据信号通过蓝牙传输至主耳机,从耳机可以伪装成主耳机来侦听并接收由电子设备发送给主耳机的数据信号,或者,从耳机也可以接收由主耳机转发的电子设备发送给主耳机的数据信号。在上行场景中,主耳机直接工作而从耳机不工作,主耳机将采集到的音频数据直接通过蓝牙传输给电子设备。Among them, the TWS headset is composed of a master headset and a slave headset. The working principle is that the electronic device is connected to the master headset via Bluetooth, and the master headset and the slave headset are connected via near magnetic field induction technology (NFMI for short) or TWS protocol. In the downlink scenario, the data signal on the electronic device is transmitted to the master headset via Bluetooth, and then transmitted from the master headset to the slave headset via NFMI or TWS protocol, so that the left and right headsets receive the data signal transmitted by the electronic device; or, in the downlink scenario, the data signal on the electronic device is transmitted to the master headset via Bluetooth, and the slave headset can be disguised as the master headset to listen to and receive the data signal sent by the electronic device to the master headset, or, the slave headset can also receive the data signal sent by the electronic device to the master headset forwarded by the master headset. In the uplink scenario, the master headset works directly and the slave headset does not work, and the master headset transmits the collected audio data directly to the electronic device via Bluetooth.

在TWS耳机的单耳机使用场景下,为确保TWS耳机工作在主耳机模式下,是通过佩戴检测来确定TWS耳机的主从关系,一般地,佩戴检测是通过光感传感器或者电容传感器实现的,但是,佩戴检测可能存在检测错误。比如,佩戴TWS耳机通话过程中,取下主耳机放置在桌面时,可能将主耳机放置在桌面误检测为主耳机佩戴在耳朵上,导致主耳机和从耳机之间无法切换,而主耳距离用户较远,采集的声音信号弱,用户仅佩戴从耳机无法拾取通话声音,导致对方反馈通话音量小或者无声问题,降低用户通话的质量。In the single-earphone usage scenario of TWS earphones, in order to ensure that the TWS earphones work in the master earphone mode, the master-slave relationship of the TWS earphones is determined by wearing detection. Generally, wearing detection is achieved through a light sensor or a capacitive sensor. However, wearing detection may have detection errors. For example, when wearing a TWS earphone for a call, when the main earphone is removed and placed on the desktop, the main earphone may be placed on the desktop and mistakenly detected as being worn on the ear, resulting in the inability to switch between the main earphone and the slave earphone. The main ear is far away from the user, and the collected sound signal is weak. The user can only wear the slave earphone and cannot pick up the call sound, resulting in the other party reporting that the call volume is low or silent, reducing the quality of the user's call.

针对上述问题,发明人经过长期的研究发现,并提出了本申请实施例提供的耳机的主从切换方法、装置、蓝牙耳机以及存储介质,通过基于主耳机和从耳机采集到的声音信号进行主从耳机的切换控制,可以提升主从耳机切换的准确率以及降低蓝牙耳机的成本。其中,具体的耳机的主从切换方法在后续的实施例中进行详细的说明。In view of the above problems, the inventor has discovered after long-term research and proposed the master-slave switching method, device, Bluetooth headset and storage medium provided in the embodiments of the present application. By controlling the switching of the master and slave headsets based on the sound signals collected by the master headset and the slave headset, the accuracy of the master-slave headset switching can be improved and the cost of the Bluetooth headset can be reduced. The specific master-slave switching method of the headset is described in detail in the subsequent embodiments.

下面将针对可用于本申请实施例提供的耳机的主从切换方法的应用环境进行说明。The following describes an application environment of the master-slave switching method for the headset provided in an embodiment of the present application.

请参阅图1,图1示出了可用于本申请实施例提供的耳机的主从切换方法的应用环境示意图。如图1所示,其包括第一蓝牙耳机100、第二蓝牙耳机200以及电子设备300。作为一种方式,第一蓝牙耳机100可以作为主耳机与电子设备300建立有用于进行音频数据传输的第一蓝牙链路,第二蓝牙耳机200可以作为从耳机与第一蓝牙耳机100建立有用于进行音频数据传输的第二蓝牙链路,此时,第二蓝牙耳机200可以与电子设备300之间建立有用于监听电子设备300与第一蓝牙耳机100之间的音频数据传输的监听链路。作为又一种方式,第二蓝牙耳机200可以作为主耳机与电子设备300建立有用于进行音频数据传输的第一蓝牙链路,第一蓝牙耳机100可以作为从耳机与第二蓝牙耳机200建立有用于进行音频数据传输的第二蓝牙链路,此时,第一蓝牙耳机100可以与电子设备300之间建立有用于侦听电子设备300与第二蓝牙耳机200之间的音频数据传输的监听链路。Please refer to Figure 1, which shows a schematic diagram of an application environment of a master-slave switching method for a headset provided in an embodiment of the present application. As shown in Figure 1, it includes a first Bluetooth headset 100, a second Bluetooth headset 200, and an electronic device 300. As one way, the first Bluetooth headset 100 can be used as a master headset to establish a first Bluetooth link for audio data transmission with the electronic device 300, and the second Bluetooth headset 200 can be used as a slave headset to establish a second Bluetooth link for audio data transmission with the first Bluetooth headset 100. At this time, the second Bluetooth headset 200 can establish a monitoring link for monitoring audio data transmission between the electronic device 300 and the first Bluetooth headset 100 with the electronic device 300. As another way, the second Bluetooth headset 200 can be used as a master headset to establish a first Bluetooth link for audio data transmission with the electronic device 300, and the first Bluetooth headset 100 can be used as a slave headset to establish a second Bluetooth link for audio data transmission with the second Bluetooth headset 200. At this time, the first Bluetooth headset 100 can be used as a slave headset to establish a monitoring link for monitoring audio data transmission between the electronic device 300 and the second Bluetooth headset 200 with the electronic device 300.

在一些实施方式中,第一蓝牙耳机100可以是播放左声道音频数据的耳机,则第二蓝牙耳机200可以是播放右声道音频数据的耳机;第二蓝牙耳机200可以是播放左声道音频数据的耳机,则第一蓝牙耳机100可以是播放右声道音频数据的耳机。In some embodiments, the first Bluetooth headset 100 may be a headset that plays left channel audio data, and the second Bluetooth headset 200 may be a headset that plays right channel audio data; the second Bluetooth headset 200 may be a headset that plays left channel audio data, and the first Bluetooth headset 100 may be a headset that plays right channel audio data.

请参阅图2,图2示出了本申请一实施例提供的耳机的主从切换方法的流程示意图。该方法用于通过基于主耳机和从耳机采集到的声音信号进行主从耳机的切换控制,可以提升主从耳机切换的准确率以及降低蓝牙耳机的成本。在具体的实施例中,该耳机的主从切换方法应用于如图10所示的耳机的主从切换装置400以及配置有耳机的主从切换装置400的第一蓝牙耳机100(图11)。下面将以蓝牙耳机为例,说明本实施例的具体流程,当然,可以理解的,本实施例所应用的蓝牙耳机可以包括真正无线立体声(true wirelessstereo,TWS)耳机。在本实施例中,该第一蓝牙耳机作为主耳机与电子设备建立有第一蓝牙链路时,第二蓝牙耳机作为从耳机与第一蓝牙耳机建立有第二蓝牙链路,该第一蓝牙耳机包括第一麦克风,第二蓝牙耳机包括第二麦克风。下面将针对图2所示的流程进行详细的阐述,所述耳机的主从切换方法具体可以包括以下步骤:Please refer to Figure 2, which shows a schematic flow chart of a master-slave switching method for headphones provided in an embodiment of the present application. The method is used to control the switching of master-slave headphones based on the sound signals collected by the master headphone and the slave headphone, which can improve the accuracy of the master-slave headphone switching and reduce the cost of the Bluetooth headphone. In a specific embodiment, the master-slave switching method of the headphone is applied to the master-slave switching device 400 of the headphone as shown in Figure 10 and the first Bluetooth headphone 100 (Figure 11) equipped with the master-slave switching device 400 of the headphone. The following will take the Bluetooth headphone as an example to illustrate the specific process of this embodiment. Of course, it can be understood that the Bluetooth headphone used in this embodiment may include a true wireless stereo (TWS) headphone. In this embodiment, when the first Bluetooth headphone is used as the master headphone to establish a first Bluetooth link with the electronic device, the second Bluetooth headphone is used as the slave headphone to establish a second Bluetooth link with the first Bluetooth headphone, and the first Bluetooth headphone includes a first microphone, and the second Bluetooth headphone includes a second microphone. The process shown in Figure 2 will be described in detail below. The master-slave switching method of the headphone may specifically include the following steps:

步骤S110:获取所述第一麦克风采集到的声音信号,作为第一声音信号。Step S110: Acquire the sound signal collected by the first microphone as the first sound signal.

在本实施例中,以第一蓝牙耳机作为主耳机与电子设备建立有第一蓝牙链路为例进行说明。此时,第二蓝牙耳机作为从耳机与第一蓝牙耳机建立有第二蓝牙链路,以实现第一蓝牙耳机与电子设备之间的数据交互,以及第一蓝牙耳机与第二蓝牙耳机之间的数据交互。In this embodiment, a first Bluetooth headset is used as a master headset to establish a first Bluetooth link with an electronic device. At this time, a second Bluetooth headset is used as a slave headset to establish a second Bluetooth link with the first Bluetooth headset to achieve data interaction between the first Bluetooth headset and the electronic device, and between the first Bluetooth headset and the second Bluetooth headset.

作为一种方式,在第二蓝牙耳机与电子设备没有建立用于监听电子设备与第一蓝牙耳机之间的音频数据传输的监听链路的情况下,若电子设备向蓝牙耳机(第一蓝牙耳机和第二蓝牙耳机)发送音频数据时,则电子设备可以通过第一蓝牙链路将音频数据发送至第一蓝牙耳机,第一蓝牙耳机在接收到电子设备发送的音频数据时,则可以通过第二蓝牙链路将音频数据发送至第二蓝牙耳机,以实现第一蓝牙耳机和第二蓝牙耳机均可以获取到电子设备发送的音频数据。As a method, when the second Bluetooth headset and the electronic device have not established a monitoring link for monitoring the transmission of audio data between the electronic device and the first Bluetooth headset, if the electronic device sends audio data to the Bluetooth headsets (the first Bluetooth headset and the second Bluetooth headset), the electronic device can send the audio data to the first Bluetooth headset through the first Bluetooth link. When the first Bluetooth headset receives the audio data sent by the electronic device, it can send the audio data to the second Bluetooth headset through the second Bluetooth link, so that both the first Bluetooth headset and the second Bluetooth headset can obtain the audio data sent by the electronic device.

作为又一种方式,在第二蓝牙耳机与电子设备建立有用于监听电子设备与第一蓝牙耳机之间的音频数据传输的监听链路的情况下,则电子设备可以通过第一蓝牙链路将音频数据发送至第一蓝牙耳机,第二蓝牙耳机则可以基于监听链路,伪装成第一蓝牙耳机来侦听并接收由电子设备经由第一蓝牙链路发送给第一蓝牙耳机的音频数据,从而实现第一蓝牙耳机和第二蓝牙耳机可以同时获取到电子设备发送的音频数据,以降低第一蓝牙耳机和第二蓝牙耳机之间的延时。在一些实施方式中,第一蓝牙耳机可以通过第二蓝牙链路向第二蓝牙耳机传输相关通信参数,以便第二蓝牙耳机可以通过相关通信参数来侦听第一蓝牙链路的通信数据,其中,相关通信参数可以包括但不限于电子设备的通信连接地址、通信连接的加密参数信息等,使得第二蓝牙耳机无需执行通信连接的配对和建立,而可以伪装成第一蓝牙耳机来侦听并接收由电子设备经由第一蓝牙链路发送的音频数据。As another way, when the second Bluetooth headset and the electronic device establish a monitoring link for monitoring the audio data transmission between the electronic device and the first Bluetooth headset, the electronic device can send the audio data to the first Bluetooth headset through the first Bluetooth link, and the second Bluetooth headset can be disguised as the first Bluetooth headset based on the monitoring link to monitor and receive the audio data sent by the electronic device to the first Bluetooth headset via the first Bluetooth link, so that the first Bluetooth headset and the second Bluetooth headset can simultaneously obtain the audio data sent by the electronic device to reduce the delay between the first Bluetooth headset and the second Bluetooth headset. In some embodiments, the first Bluetooth headset can transmit relevant communication parameters to the second Bluetooth headset through the second Bluetooth link, so that the second Bluetooth headset can monitor the communication data of the first Bluetooth link through the relevant communication parameters, wherein the relevant communication parameters may include but are not limited to the communication connection address of the electronic device, the encryption parameter information of the communication connection, etc., so that the second Bluetooth headset does not need to perform pairing and establishment of the communication connection, but can be disguised as the first Bluetooth headset to monitor and receive the audio data sent by the electronic device via the first Bluetooth link.

在一些实施方式中,在电子设备需要进行声音信号的采集的情况下,例如,在电子设备需要进行通话的情况下,可以确定电子设备需要进行声音信号的采集。此时,需要从第一蓝牙耳机和第二蓝牙耳机中确定主耳机进行声音信号的采集,于本实施例中,则可以通过作为主耳机的第一蓝牙耳机进行声音信号的采集,并通过第一蓝牙链路将第一蓝牙耳机采集到的声音信号传输给电子设备,以供电子设备对第一蓝牙耳机采集到的声音信号进行处理。In some implementations, when the electronic device needs to collect sound signals, for example, when the electronic device needs to make a call, it can be determined that the electronic device needs to collect sound signals. At this time, it is necessary to determine the main earphone from the first Bluetooth earphone and the second Bluetooth earphone to collect the sound signal. In this embodiment, the sound signal can be collected by the first Bluetooth earphone as the main earphone, and the sound signal collected by the first Bluetooth earphone is transmitted to the electronic device through the first Bluetooth link, so that the electronic device processes the sound signal collected by the first Bluetooth earphone.

在一些实施方式中,该第一蓝牙耳机可以包括第一麦克风。第一蓝牙耳机可以控制第一麦克风进行声音信号的采集,并获取该第一麦克风采集到的声音信号作为第一声音信号。其中,该第一声音信号可以包括用户输入的语音。其中,该第一麦克风包括的麦克风的数量可以为一个或多个,在此不做限定。In some embodiments, the first Bluetooth headset may include a first microphone. The first Bluetooth headset may control the first microphone to collect sound signals, and obtain the sound signals collected by the first microphone as the first sound signal. The first sound signal may include a voice input by a user. The number of microphones included in the first microphone may be one or more, which is not limited here.

步骤S120:通过所述第二蓝牙链路获取所述第二麦克风采集到的声音信号,作为第二声音信号。Step S120: Acquire the sound signal collected by the second microphone through the second Bluetooth link as the second sound signal.

在一些实施方式中,该第二蓝牙耳机可以包括第二麦克风。则第二蓝牙耳机可以控制第二麦克风进行声音信号的采集,并获取该第二麦克风采集到的声音信号作为第二声音信号。其中,该第二声音信号可以包括用户输入的语音。其中,该第二麦克风包括的麦克风的数量可以为一个或多个,在此不做限定。In some embodiments, the second Bluetooth headset may include a second microphone. The second Bluetooth headset may control the second microphone to collect sound signals, and obtain the sound signals collected by the second microphone as the second sound signal. The second sound signal may include a voice input by a user. The number of microphones included in the second microphone may be one or more, which is not limited here.

作为一种可实施的方式,第二蓝牙耳机的第二麦克风与第一蓝牙耳机的第一麦克风可以均处于工作状态,则该第二蓝牙耳机可以直接通过该第二蓝牙耳机进行声音信号的采集。As an implementable manner, the second microphone of the second Bluetooth headset and the first microphone of the first Bluetooth headset can both be in working state, and the second Bluetooth headset can directly collect the sound signal through the second Bluetooth headset.

作为一种可实施的方式,第二蓝牙耳机的第二麦克风处于休眠状态,则第一蓝牙耳机可以通过第二蓝牙链路发送至声音信号采集指令至第二蓝牙耳机,该第二蓝牙耳机可以响应于该声音信号采集指令,唤醒第二麦克风并控制第二麦克风进行声音信号的采集。As an implementable method, if the second microphone of the second Bluetooth headset is in a sleep state, the first Bluetooth headset can send a sound signal collection instruction to the second Bluetooth headset through the second Bluetooth link, and the second Bluetooth headset can respond to the sound signal collection instruction, wake up the second microphone and control the second microphone to collect sound signals.

在一些实施方式中,第二蓝牙耳机在通过第二麦克风采集到声音信号时,则可以通过第二蓝牙链路将第二麦克风采集到的声音信号传输给第一蓝牙耳机,相应地,第一蓝牙耳机可以通过第二蓝牙链路获取该第二麦克风采集到的声音信号,并将通过第二蓝牙链路获取该第二麦克风采集到的声音信号作为第二声音信号。In some embodiments, when the second Bluetooth headset collects a sound signal through the second microphone, the sound signal collected by the second microphone can be transmitted to the first Bluetooth headset through the second Bluetooth link. Correspondingly, the first Bluetooth headset can obtain the sound signal collected by the second microphone through the second Bluetooth link, and use the sound signal collected by the second microphone through the second Bluetooth link as the second sound signal.

步骤S130:在所述第一声音信号和所述第二声音信号满足预设信号条件的情况下,通过所述第二蓝牙链路向所述第二蓝牙耳机发送切换指令,所述切换指令用于指示所述第二蓝牙耳机作为主耳机与所述电子设备建立蓝牙链路。Step S130: When the first sound signal and the second sound signal meet a preset signal condition, a switching instruction is sent to the second Bluetooth headset through the second Bluetooth link, wherein the switching instruction is used to instruct the second Bluetooth headset to establish a Bluetooth link with the electronic device as a master headset.

在一些实施方式中,第一蓝牙耳机可以预先设置并存储有预设信号条件,该预设信号条件用于作为该第一声音信号和第二声音信号的判断依据。因此,在本实施例中,第一蓝牙耳机在获得第一声音信号和第二声音信号后,则可以将第一声音信号和第二声音信号与预设信号条件进行比较,以判断该第一声音信号和第二声音信号是否满足预设信号条件。In some embodiments, the first Bluetooth headset may be pre-set and store a preset signal condition, and the preset signal condition is used as a basis for judging the first sound signal and the second sound signal. Therefore, in this embodiment, after obtaining the first sound signal and the second sound signal, the first Bluetooth headset may compare the first sound signal and the second sound signal with the preset signal condition to determine whether the first sound signal and the second sound signal meet the preset signal condition.

作为一种方式,在判断到第一声音信号和第二声音信号不满足预设信号条件的情况下,则可以认为第一蓝牙耳机更适合作为主耳机且第二蓝牙耳机更适合作为从耳机,则可以保持第一蓝牙耳机作为主耳机与电子设备建立第一蓝牙链路,以及保持第二蓝牙耳机作为从耳机与第一蓝牙耳机建立第二蓝牙链路,此时,可以将第一蓝牙耳机采集到的第一声音信号传输给电子设备,以供电子设备对第一声音信号进行处理。As a method, when it is determined that the first sound signal and the second sound signal do not meet the preset signal conditions, it can be considered that the first Bluetooth headset is more suitable as the master headset and the second Bluetooth headset is more suitable as the slave headset. The first Bluetooth headset can be maintained as the master headset to establish a first Bluetooth link with the electronic device, and the second Bluetooth headset can be maintained as the slave headset to establish a second Bluetooth link with the first Bluetooth headset. At this time, the first sound signal collected by the first Bluetooth headset can be transmitted to the electronic device so that the electronic device can process the first sound signal.

作为又一种方式,在判断到第一声音信号和第二声音信号满足预设信号条件的情况下,则可以认为第一蓝牙耳机更适合作为从耳机且第二蓝牙耳机更适合作为主耳机,则可以执行主耳机与从耳机的切换,以便第一蓝牙耳机从主耳机切换为从耳机,第二蓝牙耳机从从耳机切换为主耳机,此时,可以将第二蓝牙耳机采集到的第二声音信号传输给电子设备,以供电子设备对第二声音信号进行处理。其中,第一蓝牙耳机可以通过第二蓝牙链路发送切换指令至第二蓝牙耳机,该切换指令用于指示第二蓝牙耳机作为主耳机与电子设备建立蓝牙链路。As another way, when it is determined that the first sound signal and the second sound signal meet the preset signal conditions, it can be considered that the first Bluetooth headset is more suitable as a slave headset and the second Bluetooth headset is more suitable as a master headset, and the master headset and the slave headset can be switched, so that the first Bluetooth headset is switched from the master headset to the slave headset, and the second Bluetooth headset is switched from the slave headset to the master headset. At this time, the second sound signal collected by the second Bluetooth headset can be transmitted to the electronic device for the electronic device to process the second sound signal. The first Bluetooth headset can send a switching instruction to the second Bluetooth headset via the second Bluetooth link, and the switching instruction is used to instruct the second Bluetooth headset to establish a Bluetooth link with the electronic device as the master headset.

在一些实施方式中,第一蓝牙耳机在发送切换指令至第二蓝牙耳机之后,可以在接收到第二蓝牙耳机发送的用于表征第二蓝牙耳机已准备好与电子设备建立蓝牙连接的指示信息之后,才切换自己为从耳机,断开与电子设备之间的蓝牙链路,并在开始切换为从耳机的同时,发送连接指示信息至第二蓝牙耳机,第二蓝牙耳机在接收到连接指示信息之后,立即建立与电子设备之间的连接。由于第一蓝牙耳机未在发送切换指令之后立马切换为从耳机,而是在第二蓝牙耳机做好准备之后,才进行切换,从而可以避免第二蓝牙耳机未建立完成与电子设备之间的蓝牙链路的情况下,但是第一蓝牙耳机已与电子设备断开蓝牙链路,导致数据传输的中断的问题。In some embodiments, after sending a switching instruction to the second Bluetooth headset, the first Bluetooth headset may switch itself to the slave headset and disconnect the Bluetooth link with the electronic device only after receiving the indication information sent by the second Bluetooth headset to indicate that the second Bluetooth headset is ready to establish a Bluetooth connection with the electronic device, and send the connection indication information to the second Bluetooth headset at the same time as starting to switch to the slave headset, and the second Bluetooth headset immediately establishes the connection with the electronic device after receiving the connection indication information. Since the first Bluetooth headset does not switch to the slave headset immediately after sending the switching instruction, but switches after the second Bluetooth headset is ready, it can avoid the problem that the second Bluetooth headset has not established a Bluetooth link with the electronic device, but the first Bluetooth headset has disconnected the Bluetooth link with the electronic device, resulting in interruption of data transmission.

作为一种可实施的方式,在需要将第一蓝牙耳机从主耳机切换为从耳机,且将第二蓝牙耳机从从耳机切换为主耳机时,则第一蓝牙耳机可以将第一蓝牙链路的链接信息通过第二蓝牙链路发送给第二蓝牙耳机,第二蓝牙耳机接收到第一蓝牙耳机发送的第一蓝牙链路的链接信息时,则可以向第一蓝牙耳机回复确认标识(如ACK确认标识),第一蓝牙耳机在接收到第二蓝牙耳机发送的确认标识时,则可以通过第二蓝牙链路向第二蓝牙耳机发送切换指令,第二蓝牙耳机根据接收到的第一蓝牙链路的链接信息与电子设备通过建立第三蓝牙链路进行连接,在第二蓝牙耳机接收到电子设备发送的第三蓝牙链路的数据包的情况下,第二蓝牙耳机可以向第一蓝牙耳机发送收包成功的确认标识,第一蓝牙耳机则可以删除该第一蓝牙链路,断开与电子设备之间的连接,以实现主从耳机的无缝切换,给使用者更好的用户体验。As an implementable manner, when it is necessary to switch the first Bluetooth headset from a master headset to a slave headset, and to switch the second Bluetooth headset from a slave headset to a master headset, the first Bluetooth headset can send the link information of the first Bluetooth link to the second Bluetooth headset through the second Bluetooth link; when the second Bluetooth headset receives the link information of the first Bluetooth link sent by the first Bluetooth headset, it can reply a confirmation mark (such as an ACK confirmation mark) to the first Bluetooth headset; when the first Bluetooth headset receives the confirmation mark sent by the second Bluetooth headset, it can send a switching instruction to the second Bluetooth headset through the second Bluetooth link; the second Bluetooth headset is connected to the electronic device by establishing a third Bluetooth link according to the received link information of the first Bluetooth link; when the second Bluetooth headset receives a data packet of the third Bluetooth link sent by the electronic device, the second Bluetooth headset can send a confirmation mark of successful packet reception to the first Bluetooth headset; the first Bluetooth headset can delete the first Bluetooth link and disconnect from the electronic device, so as to achieve seamless switching between the master and slave headsets and provide users with a better user experience.

在本申请实施例中,由于主耳机是基于主耳机的麦克风采集到的声音信号和从耳机的麦克风采集到的声音信号,确定是否需要进行主从耳机的切换,从而无需设置其他用于检测佩戴的传感器带来的成本问题,可以降低蓝牙耳机的成本。另外,由于主耳机是基于主耳机的麦克风采集到的声音信号和从耳机的麦克风采集到的声音信号,可以避免所设置的其他用于检测佩戴的传感器检测错误的问题,可以提升主从耳机切换的准确率。In the embodiment of the present application, since the master earphone determines whether it is necessary to switch between the master and slave earphones based on the sound signal collected by the microphone of the master earphone and the sound signal collected by the microphone of the slave earphone, there is no need to set up other sensors for detecting wearing, which can reduce the cost of the Bluetooth earphone. In addition, since the master earphone is based on the sound signal collected by the microphone of the master earphone and the sound signal collected by the microphone of the slave earphone, the problem of detection errors of other sensors set up for detecting wearing can be avoided, and the accuracy of switching between the master and slave earphones can be improved.

请参阅图3,图3示出了本申请一实施例提供的耳机的主从切换方法的流程示意图。该方法应用于第一蓝牙耳机,该第一蓝牙耳机作为主耳机与电子设备建立有第一蓝牙链路时,第二蓝牙耳机作为从耳机与第一蓝牙耳机建立有第二蓝牙链路,该第一蓝牙耳机包括第一麦克风,第二蓝牙耳机包括第二麦克风,其中,该第二麦克风处于休眠状态。下面将针对图3所示的流程进行详细的阐述,所述耳机的主从切换方法具体可以包括以下步骤:Please refer to Figure 3, which shows a schematic flow chart of a method for switching between a master and a slave of a headset provided in an embodiment of the present application. The method is applied to a first Bluetooth headset, when the first Bluetooth headset as a master headset establishes a first Bluetooth link with an electronic device, the second Bluetooth headset as a slave headset establishes a second Bluetooth link with the first Bluetooth headset, the first Bluetooth headset includes a first microphone, and the second Bluetooth headset includes a second microphone, wherein the second microphone is in a dormant state. The process shown in Figure 3 will be described in detail below, and the method for switching between a master and a slave of a headset may specifically include the following steps:

步骤S210:获取所述第一麦克风采集到的声音信号,作为第一声音信号。Step S210: Acquire the sound signal collected by the first microphone as the first sound signal.

其中,步骤S210的具体描述请参阅步骤S110,在此不再赘述。The specific description of step S210 can be found in step S110 , which will not be repeated here.

步骤S220:获取所述第一声音信号对应的第一声音强度。Step S220: Obtain a first sound intensity corresponding to the first sound signal.

在一些实施方式中,第一蓝牙耳机在获得第一声音信号时,则可以对第一声音信号进行处理,获得该第一声音信号对应的声音强度作为第一声音强度。作为一种可实施的方式,第一蓝牙耳机在获得第一声音信号时,则可以通过预设的强度算法对第一声音信号进行计算,获得该第一声音信号对应的声音强度作为第一声音强度。In some embodiments, when the first Bluetooth headset obtains the first sound signal, it can process the first sound signal to obtain the sound intensity corresponding to the first sound signal as the first sound intensity. As an implementable manner, when the first Bluetooth headset obtains the first sound signal, it can calculate the first sound signal through a preset intensity algorithm to obtain the sound intensity corresponding to the first sound signal as the first sound intensity.

步骤S230:在所述第一声音强度小于或等于所述第一强度阈值的情况下,通过所述第二蓝牙链路向所述第二蓝牙耳机发送唤醒指令,所述唤醒指令用于指示所述第二蓝牙耳机控制所述第二麦克风从所述休眠状态切换为工作状态,并通过所述第二麦克风采集声音信号。Step S230: When the first sound intensity is less than or equal to the first intensity threshold, a wake-up instruction is sent to the second Bluetooth headset through the second Bluetooth link, and the wake-up instruction is used to instruct the second Bluetooth headset to control the second microphone to switch from the sleep state to the working state, and collect sound signals through the second microphone.

在一些实施方式中,该第二蓝牙耳机的第二麦克风处于休眠状态。即,在第一蓝牙耳机通过第一麦克风进行声音信号的采集的情况下,第二麦克风不进行声音信号的采集,此时可以降低第二蓝牙耳机的功耗。In some implementations, the second microphone of the second Bluetooth headset is in a dormant state, that is, when the first Bluetooth headset collects sound signals through the first microphone, the second microphone does not collect sound signals, thereby reducing the power consumption of the second Bluetooth headset.

在一些实施方式中,预设信号条件可以包括第一强度阈值。则第一蓝牙耳机可以预先设置并存储有第一强度阈值,该第一强度阈值用于作为该第一麦克风采集到的第一声音信号对应的第一声音强度的判断依据。因此,在本实施例中,第一蓝牙耳机在获得第一声音强度后,则可以将第一声音强度与第一强度阈值进行比较,以判断该第一声音强度是否小于或等于第一强度阈值。其中,该第一强度阈值可以为表征声音信号是否可以被用户正常接收的分界线,例如,该第一强度阈值可以为表征在通话场景下,声音信号是否可以满足正常通话需求的分界线,即,若声音信号的声音强度小于或等于第一强度阈值,则可以确定声音信号不可以被用户正常接收,即在通话场景下声音信号不满足正常通话需求;若声音信号的声音强度大于第一强度阈值,则可以确定声音信号可以被用户正常接收,即在通话场景下声音信号满足正常通话需求。In some embodiments, the preset signal condition may include a first intensity threshold. The first Bluetooth headset may be pre-set and store a first intensity threshold, which is used as a basis for judging the first sound intensity corresponding to the first sound signal collected by the first microphone. Therefore, in this embodiment, after obtaining the first sound intensity, the first Bluetooth headset may compare the first sound intensity with the first intensity threshold to determine whether the first sound intensity is less than or equal to the first intensity threshold. Among them, the first intensity threshold may be a dividing line that characterizes whether the sound signal can be normally received by the user. For example, the first intensity threshold may be a dividing line that characterizes whether the sound signal can meet the normal call requirements in a call scenario, that is, if the sound intensity of the sound signal is less than or equal to the first intensity threshold, it can be determined that the sound signal cannot be normally received by the user, that is, the sound signal does not meet the normal call requirements in the call scenario; if the sound intensity of the sound signal is greater than the first intensity threshold, it can be determined that the sound signal can be normally received by the user, that is, the sound signal meets the normal call requirements in the call scenario.

作为一种方式,在确定该第一声音强度大于第一强度阈值的情况下,则表征该第一蓝牙耳机的第一麦克风采集到的声音信号可以被用户正常接收,例如在通话场景下可以满足正常通话需求,因此,可以不进行主从耳机的切换,即继续保持第一蓝牙耳机作为主耳机,且保持第二蓝牙耳机作为从耳机。As a method, when it is determined that the first sound intensity is greater than the first intensity threshold, it indicates that the sound signal collected by the first microphone of the first Bluetooth headset can be normally received by the user, for example, it can meet normal call needs in a call scenario. Therefore, there is no need to switch between the master and slave headsets, that is, continue to keep the first Bluetooth headset as the master headset, and keep the second Bluetooth headset as the slave headset.

作为又一种方式,在确定该第一声音强度小于或等于第一强度阈值的情况下,则表征该第一蓝牙耳机的第一麦克风采集到的声音信号不可以被用户正常接收,例如在通话场景下无法满足正常通话需求,因此,可以唤醒第二蓝牙耳机的第二麦克风进行声音信号的采集,并根据第二麦克风采集到的声音信号确定是否进行主从耳机的切换。在一些实施方式中,第一蓝牙耳机可以通过第二蓝牙链路向第二蓝牙耳机发送唤醒指令,相应地,第二蓝牙耳机可以响应于该唤醒指令控制第二麦克风从休眠状态切换为工作状态,并控制第二麦克风进行声音信号的采集。As another way, when it is determined that the first sound intensity is less than or equal to the first intensity threshold, it indicates that the sound signal collected by the first microphone of the first Bluetooth headset cannot be normally received by the user, for example, it cannot meet the normal call requirements in a call scenario. Therefore, the second microphone of the second Bluetooth headset can be awakened to collect the sound signal, and determine whether to switch the master and slave headsets based on the sound signal collected by the second microphone. In some embodiments, the first Bluetooth headset can send a wake-up instruction to the second Bluetooth headset via the second Bluetooth link, and accordingly, the second Bluetooth headset can control the second microphone to switch from a dormant state to a working state in response to the wake-up instruction, and control the second microphone to collect sound signals.

步骤S240:通过所述第二蓝牙链路获取所述第二麦克风采集到的声音信号,作为第二声音信号。Step S240: Acquire the sound signal collected by the second microphone through the second Bluetooth link as the second sound signal.

其中,步骤S240的具体描述请参阅步骤S120,在此不再赘述。For the detailed description of step S240, please refer to step S120, which will not be repeated here.

步骤S250:获取所述第二声音信号对应的第二声音强度。Step S250: obtaining a second sound intensity corresponding to the second sound signal.

在一些实施方式中,第一蓝牙耳机在获得第二声音信号时,则可以对第二声音信号进行处理,获得该第二声音信号对应的声音强度作为第二声音强度。作为一种可实施的方式,第一蓝牙耳机在获得第二声音信号时,则可以通过预设的强度算法对第二声音信号进行计算,获得该第二声音信号对应的声音强度作为第二声音强度。In some embodiments, when the first Bluetooth headset obtains the second sound signal, it can process the second sound signal and obtain the sound intensity corresponding to the second sound signal as the second sound intensity. As an implementable manner, when the first Bluetooth headset obtains the second sound signal, it can calculate the second sound signal through a preset intensity algorithm and obtain the sound intensity corresponding to the second sound signal as the second sound intensity.

在一些实施方式中,第二蓝牙耳机在采集到声音信号(第二声音信号)时,则可以对第二声音信号进行处理,获得该第二声音信号对应的声音强度作为第二声音强度,并通过第二蓝牙链路将该第二声音强度发送至第一蓝牙耳机。作为一种可实施的方式,第二蓝牙耳机在采集到第二声音信号时,则可以通过预设的强度算法对第二声音信号进行计算,获得该第二声音信号对应的声音强度作为第二声音强度,并通过第二蓝牙链路将该第二声音强度发送至第一蓝牙耳机。In some embodiments, when the second Bluetooth headset collects the sound signal (second sound signal), it can process the second sound signal, obtain the sound intensity corresponding to the second sound signal as the second sound intensity, and send the second sound intensity to the first Bluetooth headset through the second Bluetooth link. As an implementable manner, when the second Bluetooth headset collects the second sound signal, it can calculate the second sound signal through a preset intensity algorithm, obtain the sound intensity corresponding to the second sound signal as the second sound intensity, and send the second sound intensity to the first Bluetooth headset through the second Bluetooth link.

在一些实施方式中,第二蓝牙耳机在采集到声音信号(第二声音信号)时,则可以对第二声音信号进行处理,获得该第二声音信号对应的声音强度作为第二声音强度,然后将第二声音强度与第一强度阈值进行比较,获得第一比较结果,并通过第二蓝牙链路将该第一比较结果发送至第一蓝牙耳机。In some embodiments, when the second Bluetooth headset collects a sound signal (second sound signal), it can process the second sound signal to obtain a sound intensity corresponding to the second sound signal as a second sound intensity, and then compare the second sound intensity with a first intensity threshold to obtain a first comparison result, and send the first comparison result to the first Bluetooth headset via the second Bluetooth link.

步骤S260:在所述第一声音强度小于或等于第一强度阈值且所述第二声音强度大于所述第一强度阈值的情况下,通过所述第二蓝牙链路向所述第二蓝牙耳机发送所述切换指令。Step S260: When the first sound intensity is less than or equal to a first intensity threshold and the second sound intensity is greater than the first intensity threshold, sending the switching instruction to the second Bluetooth headset through the second Bluetooth link.

在一些实施方式中,预设信号条件可以包括第一强度阈值。第一蓝牙耳机可以预先设置并存储有第一强度阈值,该第一强度阈值用于作为该第一蓝牙耳机采集到的第一声音信号对应的第一声音强度的判断依据,以及用于作为该第一蓝牙耳机接收到的第二声音信号对应的第二声音强度的判断依据。因此,在本实施例中,第一蓝牙耳机在获得第一声音强度后,则可以将第一声音强度与第一强度阈值进行比较,以判断该第一声音强度是否小于或等于第一强度阈值;第一蓝牙耳机在获得第二声音强度后,则可以将第二声音强度与第二强度阈值进行比较,以判断该第二声音强度是否大于第一强度阈值。In some embodiments, the preset signal condition may include a first intensity threshold. The first Bluetooth headset may be pre-set and store a first intensity threshold, which is used as a basis for determining the first sound intensity corresponding to the first sound signal collected by the first Bluetooth headset, and as a basis for determining the second sound intensity corresponding to the second sound signal received by the first Bluetooth headset. Therefore, in this embodiment, after obtaining the first sound intensity, the first Bluetooth headset may compare the first sound intensity with the first intensity threshold to determine whether the first sound intensity is less than or equal to the first intensity threshold; after obtaining the second sound intensity, the first Bluetooth headset may compare the second sound intensity with the second intensity threshold to determine whether the second sound intensity is greater than the first intensity threshold.

作为一种方式,在确定该第一声音强度大于第一强度阈值的情况下,则表征该第一蓝牙耳机的第一麦克风采集到的声音信号可以被用户正常接收,例如在通话场景下可以满足正常通话需求。因此,第一蓝牙耳机更加适合作为主耳机,此时,无论第二声音强度是大于第一强度阈值,还是小于或等于第一强度阈值,均可以不进行主从耳机的切换,即可以继续保持第一蓝牙耳机作为主耳机,且保持第二蓝牙耳机作为从耳机。As a method, when it is determined that the first sound intensity is greater than the first intensity threshold, it indicates that the sound signal collected by the first microphone of the first Bluetooth headset can be normally received by the user, for example, it can meet the normal call requirements in a call scenario. Therefore, the first Bluetooth headset is more suitable as the master headset. At this time, no matter whether the second sound intensity is greater than the first intensity threshold or less than or equal to the first intensity threshold, the master-slave headset switching may not be performed, that is, the first Bluetooth headset can continue to be kept as the master headset, and the second Bluetooth headset can be kept as the slave headset.

作为又一种方式,在确定第一声音强度小于或等于第一强度阈值,且第二声音强度小于或等于第一强度阈值的情况下,则表征该第一蓝牙耳机的第一麦克风采集到的声音信号不可以被用户正常接收,且第二蓝牙耳机的第二麦克风采集到的声音信号不可以被用户正常接收,例如,在通话场景下,第一蓝牙耳机采集到的声音信号和第二蓝牙耳机采集到的声音信号均无法满足正常通话需求。因此,可以认为是用户输入的声音本身较小,或者,可以认为是第一蓝牙耳机和第二蓝牙耳机均未处于佩戴状态,则可以不进行主从耳机的切换,即可以继续保持第一蓝牙耳机作为主耳机,且保持第二蓝牙耳机作为从耳机。As another way, when it is determined that the first sound intensity is less than or equal to the first intensity threshold, and the second sound intensity is less than or equal to the first intensity threshold, it indicates that the sound signal collected by the first microphone of the first Bluetooth headset cannot be normally received by the user, and the sound signal collected by the second microphone of the second Bluetooth headset cannot be normally received by the user. For example, in a call scenario, the sound signal collected by the first Bluetooth headset and the sound signal collected by the second Bluetooth headset cannot meet the normal call requirements. Therefore, it can be considered that the sound input by the user is relatively small, or it can be considered that the first Bluetooth headset and the second Bluetooth headset are not in the wearing state, then the master-slave headset switching can be omitted, that is, the first Bluetooth headset can continue to be kept as the master headset, and the second Bluetooth headset can be kept as the slave headset.

作为再一种方式,在确定第一声音强度小于或等于第一强度阈值,且第二声音强度大于第一强度阈值的情况下,则表征该第一蓝牙耳机的第一麦克风采集到的声音信号不可以被用户正常接收,且第二蓝牙耳机的第二麦克风采集到的声音信号可以被用户正常接收,例如,在通话场景下,第一蓝牙耳机采集到的声音信号无法满足正常通话需求,而第二蓝牙耳机采集到的声音信号满足正常通话需求。则可以认为第一蓝牙耳机更适合作为从耳机且第二蓝牙耳机更适合作为主耳机,则可以执行主耳机与从耳机的切换,以便第一蓝牙耳机从主耳机切换为从耳机,第二蓝牙耳机从从耳机切换为主耳机。As another way, when it is determined that the first sound intensity is less than or equal to the first intensity threshold, and the second sound intensity is greater than the first intensity threshold, it indicates that the sound signal collected by the first microphone of the first Bluetooth headset cannot be normally received by the user, and the sound signal collected by the second microphone of the second Bluetooth headset can be normally received by the user. For example, in a call scenario, the sound signal collected by the first Bluetooth headset cannot meet the normal call requirements, while the sound signal collected by the second Bluetooth headset meets the normal call requirements. It can be considered that the first Bluetooth headset is more suitable as a slave headset and the second Bluetooth headset is more suitable as a master headset, and the master headset and the slave headset can be switched so that the first Bluetooth headset is switched from the master headset to the slave headset, and the second Bluetooth headset is switched from the slave headset to the master headset.

在本实施例中,还在主耳机采集到的声音信号的声音强度小于或等于第一强度阈值时,控制从耳机的麦克风从休眠状态切换为工作状态进行声音信号的采集,以降低从耳机的功耗。另外,本实施例还在主耳机采集到声音信号对应的信号强度小于或等于第一强度阈值且从耳机采集到的声音信号对应的信号强度大于第一强度阈值时,进行主从耳机的切换,以使得可以通过主耳机采集到声音强度满足需求的声音信号,提升主从耳机的切换准确率。In this embodiment, when the sound intensity of the sound signal collected by the master earphone is less than or equal to the first intensity threshold, the microphone of the slave earphone is controlled to switch from the sleep state to the working state to collect the sound signal, so as to reduce the power consumption of the slave earphone. In addition, when the signal intensity corresponding to the sound signal collected by the master earphone is less than or equal to the first intensity threshold and the signal intensity corresponding to the sound signal collected by the slave earphone is greater than the first intensity threshold, the master and slave earphones are switched, so that the master earphone can collect the sound signal with the sound intensity meeting the requirement, thereby improving the switching accuracy of the master and slave earphones.

请参阅图4,图4示出了本申请一实施例提供的耳机的主从切换方法的流程示意图。该方法应用于第一蓝牙耳机,该第一蓝牙耳机作为主耳机与电子设备建立有第一蓝牙链路时,第二蓝牙耳机作为从耳机与第一蓝牙耳机建立有第二蓝牙链路,该第一蓝牙耳机包括第一麦克风,第二蓝牙耳机包括第二麦克风。下面将针对图4所示的流程进行详细的阐述,所述耳机的主从切换方法具体可以包括以下步骤:Please refer to FIG4, which shows a schematic flow chart of a method for switching between a master and a slave of a headset provided in an embodiment of the present application. The method is applied to a first Bluetooth headset, when the first Bluetooth headset as a master headset establishes a first Bluetooth link with an electronic device, the second Bluetooth headset as a slave headset establishes a second Bluetooth link with the first Bluetooth headset, the first Bluetooth headset includes a first microphone, and the second Bluetooth headset includes a second microphone. The process shown in FIG4 will be described in detail below, and the method for switching between a master and a slave of a headset may specifically include the following steps:

步骤S310:获取所述第一麦克风采集到的声音信号,作为第一声音信号。Step S310: Acquire the sound signal collected by the first microphone as the first sound signal.

步骤S320:通过所述第二蓝牙链路获取所述第二麦克风采集到的声音信号,作为第二声音信号。Step S320: Acquire the sound signal collected by the second microphone through the second Bluetooth link as the second sound signal.

其中,步骤S310-步骤S320的具体描述请参阅步骤S110-步骤S120,在此不再赘述。For the detailed description of step S310 to step S320, please refer to step S110 to step S120, which will not be repeated here.

步骤S330:获取所述第一声音信号对应的第三声音强度,并获取所述第二声音信号对应的第四声音强度。Step S330: obtaining a third sound intensity corresponding to the first sound signal, and obtaining a fourth sound intensity corresponding to the second sound signal.

在一些实施方式中,第一蓝牙耳机在获得第一声音信号时,则可以对第一声音信号进行处理,获得该第一声音信号对应的声音强度作为第三声音强度。In some implementations, when the first Bluetooth headset obtains the first sound signal, it may process the first sound signal to obtain the sound intensity corresponding to the first sound signal as the third sound intensity.

作为一种可实施的方式,第一蓝牙耳机在获得第一声音信号时,则可以通过预设的强度算法对第一声音信号进行计算,获得该第一声音信号对应的声音强度作为第三声音强度。As an implementable manner, when obtaining the first sound signal, the first Bluetooth headset may calculate the first sound signal using a preset intensity algorithm to obtain the sound intensity corresponding to the first sound signal as the third sound intensity.

在一些实施方式中,第一蓝牙耳机在获得第二声音信号时,则可以对第二声音信号进行处理,获得该第二声音信号对应的声音强度作为第四声音强度。作为一种可实施的方式,第一蓝牙耳机在获得第二声音信号时,则可以通过预设的强度算法对第二声音信号进行计算,获得该第二声音信号对应的声音强度作为第四声音强度。In some embodiments, when the first Bluetooth headset obtains the second sound signal, it can process the second sound signal to obtain the sound intensity corresponding to the second sound signal as the fourth sound intensity. As an implementable manner, when the first Bluetooth headset obtains the second sound signal, it can calculate the second sound signal through a preset intensity algorithm to obtain the sound intensity corresponding to the second sound signal as the fourth sound intensity.

在一些实施方式中,第二蓝牙耳机在采集到声音信号(第二声音信号)时,则可以对第二声音信号进行处理,获得该第二声音信号对应的声音强度作为第四声音强度,并通过第二蓝牙链路将该第四声音强度发送至第一蓝牙耳机。作为一种可实施的方式,第二蓝牙耳机在采集到第二声音信号时,则可以通过预设的强度算法对第二声音信号进行计算,获得该第二声音信号对应的声音强度作为第四声音强度,并通过第二蓝牙链路将该第四声音强度发送至第一蓝牙耳机。In some embodiments, when the second Bluetooth headset collects a sound signal (second sound signal), it can process the second sound signal to obtain a sound intensity corresponding to the second sound signal as a fourth sound intensity, and send the fourth sound intensity to the first Bluetooth headset through the second Bluetooth link. As an implementable manner, when the second Bluetooth headset collects the second sound signal, it can calculate the second sound signal through a preset intensity algorithm to obtain a sound intensity corresponding to the second sound signal as a fourth sound intensity, and send the fourth sound intensity to the first Bluetooth headset through the second Bluetooth link.

步骤S340:在所述第四声音强度大于所述第三声音强度,且所述第四声音强度和所述第三声音强度之间的差值大于第二强度阈值的情况下,通过所述第二蓝牙链路向所述第二蓝牙耳机发送切换指令,所述切换指令用于指示所述第二蓝牙耳机作为主耳机与所述电子设备建立蓝牙链路。Step S340: When the fourth sound intensity is greater than the third sound intensity, and the difference between the fourth sound intensity and the third sound intensity is greater than a second intensity threshold, a switching instruction is sent to the second Bluetooth headset through the second Bluetooth link, wherein the switching instruction is used to instruct the second Bluetooth headset to establish a Bluetooth link with the electronic device as a main headset.

在一些实施方式中,预设信号条件可以包括第二强度阈值。则第一蓝牙耳机可以预先设置并存储有第二强度阈值,该第二强度阈值用于作为该第一蓝牙耳机采集到的第一声音信号对应的第三强度阈值与第二蓝牙耳机采集到的第二声音信号对应的第四强度阈值之间的差值的判断依据。因此,在本实施例中,第一蓝牙耳机在获得第三声音强度和第四声音强度后,则可以将第三声音强度与第四声音强度进行大小比较,以及计算第四声音强度和第三声音强度之前的差值,以判断第四声音强度是否大于第三声音强度,以及判断第四声音强度和第三声音强度之间的差值是否大于第二强度阈值。其中,该第二强度阈值例如可以包括5分贝。其中,该第二强度阈值可以为表征主从耳机的切换对于声音信号的采集带来的提升效果的分界线,即,若从耳机采集到的声音信号对应的声音强度与主耳机采集到的声音信号对应的声音强度之间的差值大于该第二强度阈值时,表征主从耳机的切换对于声音信号的采集带来的提升效果明显;若从耳机采集到的声音信号对应的声音强度与主耳机采集到的声音信号对应的声音强度之间的差值小于或等于该第二强度阈值时,表征主从耳机的切换对于声音信号的采集带来的提升效果不佳。In some embodiments, the preset signal condition may include a second intensity threshold. The first Bluetooth headset may be pre-set and store a second intensity threshold, which is used as a basis for judging the difference between the third intensity threshold corresponding to the first sound signal collected by the first Bluetooth headset and the fourth intensity threshold corresponding to the second sound signal collected by the second Bluetooth headset. Therefore, in this embodiment, after obtaining the third sound intensity and the fourth sound intensity, the first Bluetooth headset may compare the third sound intensity with the fourth sound intensity, and calculate the difference between the fourth sound intensity and the third sound intensity to determine whether the fourth sound intensity is greater than the third sound intensity, and determine whether the difference between the fourth sound intensity and the third sound intensity is greater than the second intensity threshold. The second intensity threshold may, for example, include 5 decibels. Among them, the second intensity threshold can be a dividing line that represents the improvement effect brought about by the switching of master and slave headphones on the collection of sound signals, that is, if the difference between the sound intensity corresponding to the sound signal collected by the slave earphone and the sound intensity corresponding to the sound signal collected by the master earphone is greater than the second intensity threshold, it represents that the improvement effect brought about by the switching of master and slave headphones on the collection of sound signals is obvious; if the difference between the sound intensity corresponding to the sound signal collected by the slave earphone and the sound intensity corresponding to the sound signal collected by the master earphone is less than or equal to the second intensity threshold, it represents that the improvement effect brought about by the switching of master and slave headphones on the collection of sound signals is not good.

作为一种方式,在确定该第四声音强度小于第三强度阈值的情况下,表征该第一蓝牙耳机的第一麦克风采集到的声音信号对应的强度阈值大于第二蓝牙耳机的第二麦克风采集到的声音信号对应的强度阈值。因此,第一蓝牙耳机更加适合作为主耳机,此时,无论第四声音强度和第三声音强度之间的差值是否大于第二强度阈值,均可以不进行主从耳机的切换,即可以继续保持第一蓝牙耳机作为主耳机,且保持第二蓝牙耳机作为从耳机。As a way, when it is determined that the fourth sound intensity is less than the third intensity threshold, it is characterized that the intensity threshold corresponding to the sound signal collected by the first microphone of the first Bluetooth headset is greater than the intensity threshold corresponding to the sound signal collected by the second microphone of the second Bluetooth headset. Therefore, the first Bluetooth headset is more suitable as the master headset. At this time, regardless of whether the difference between the fourth sound intensity and the third sound intensity is greater than the second intensity threshold, the master-slave headset switching may not be performed, that is, the first Bluetooth headset may continue to be maintained as the master headset, and the second Bluetooth headset may be maintained as the slave headset.

作为又一种方式,在确定该第四声音强度大于第三强度阈值,且第四声音强度和第三声音强度之间的差值不大于第二强度阈值的情况下,表征虽然第二蓝牙耳机的第二麦克风采集到的声音信号对应的强度阈值大于第一蓝牙耳机的第一麦克风采集到的声音信号对应的强度阈值,即第一蓝牙耳机可能相较于第二蓝牙耳机离用户更远,但是,由于两个耳机采集到的声音信号之间的声音强度的差值较小,在这种情况下进行主从耳机的切换对于声音信号的采集带来的提升并不明显,同时还会造成蓝牙耳机功耗的增加。因此,可以不进行主从耳机的切换,即可以继续保持第一蓝牙耳机作为主耳机,且保持第二蓝牙耳机作为从耳机。As another way, when it is determined that the fourth sound intensity is greater than the third intensity threshold, and the difference between the fourth sound intensity and the third sound intensity is not greater than the second intensity threshold, it is characterized that although the intensity threshold corresponding to the sound signal collected by the second microphone of the second Bluetooth headset is greater than the intensity threshold corresponding to the sound signal collected by the first microphone of the first Bluetooth headset, that is, the first Bluetooth headset may be farther away from the user than the second Bluetooth headset, but because the difference in sound intensity between the sound signals collected by the two headsets is small, in this case, switching between the master and slave headsets does not significantly improve the collection of sound signals, and will also increase the power consumption of the Bluetooth headset. Therefore, the master and slave headsets may not be switched, that is, the first Bluetooth headset may continue to be kept as the master headset, and the second Bluetooth headset may be kept as the slave headset.

作为再一种方式,在确定该第四声音强度大于第三声音强度,且第四声音强度和第三声音强度之间的差值大于第二强度阈值的情况下,表征第二蓝牙耳机的第二麦克风采集到的声音信号对应的强度阈值大于第一蓝牙耳机的第一麦克风采集到的声音信号对应的强度阈值,即第一蓝牙耳机可能相较于第一蓝牙耳机离用户更远,同时,由于两个耳机采集到的声音信号之间的声音强度的差值较大,在这种情况下进行主从耳机的切换对于声音信号的采集带来的提升较为明显。因此,可以认为第一蓝牙耳机更适合作为从耳机且第二蓝牙耳机更适合作为主耳机,则可以执行主耳机与从耳机的切换,以便第一蓝牙耳机从主耳机切换为从耳机,第二蓝牙耳机从从耳机切换为主耳机。As another way, when it is determined that the fourth sound intensity is greater than the third sound intensity, and the difference between the fourth sound intensity and the third sound intensity is greater than the second intensity threshold, it is characterized that the intensity threshold corresponding to the sound signal collected by the second microphone of the second Bluetooth headset is greater than the intensity threshold corresponding to the sound signal collected by the first microphone of the first Bluetooth headset, that is, the first Bluetooth headset may be farther away from the user than the first Bluetooth headset. At the same time, since the difference in sound intensity between the sound signals collected by the two headsets is large, in this case, switching between the master and slave headsets brings a more obvious improvement in the collection of sound signals. Therefore, it can be considered that the first Bluetooth headset is more suitable as a slave headset and the second Bluetooth headset is more suitable as a master headset, and the switching between the master headset and the slave headset can be performed so that the first Bluetooth headset switches from the master headset to the slave headset, and the second Bluetooth headset switches from the slave headset to the master headset.

在本实施例中,还在从耳机采集到的声音信号的声音强度大于主耳机采集到的声音信号的声音强度,且从耳机采集到的声音信号的声音强度与主耳机采集到的声音信号的声音强度的差值大于第二强度阈值时,进行主从耳机的切换,以使得可以通过主耳机采集到声音强度满足需求的声音信号,提升主从耳机的切换准确率。In this embodiment, when the sound intensity of the sound signal collected by the slave earphone is greater than the sound intensity of the sound signal collected by the master earphone, and the difference between the sound intensity of the sound signal collected by the slave earphone and the sound intensity of the sound signal collected by the master earphone is greater than the second intensity threshold, the master-slave earphone is switched, so that the master earphone can collect the sound signal with the sound intensity meeting the requirement, thereby improving the switching accuracy of the master-slave earphone.

请参阅图5,图5示出了本申请一实施例提供的耳机的主从切换方法的流程示意图。该方法应用于第一蓝牙耳机,该第一蓝牙耳机作为主耳机与电子设备建立有第一蓝牙链路时,第二蓝牙耳机作为从耳机与第一蓝牙耳机建立有第二蓝牙链路,该第一蓝牙耳机包括第一麦克风,第二蓝牙耳机包括第二麦克风。下面将针对图5所示的流程进行详细的阐述,所述耳机的主从切换方法具体可以包括以下步骤:Please refer to FIG5, which shows a schematic flow chart of a method for switching between a master and a slave of a headset provided in an embodiment of the present application. The method is applied to a first Bluetooth headset, when the first Bluetooth headset as a master headset establishes a first Bluetooth link with an electronic device, the second Bluetooth headset as a slave headset establishes a second Bluetooth link with the first Bluetooth headset, the first Bluetooth headset includes a first microphone, and the second Bluetooth headset includes a second microphone. The process shown in FIG5 will be described in detail below, and the method for switching between a master and a slave of a headset may specifically include the following steps:

步骤S410:在所述电子设备处于通话状态的情况下,控制所述第一麦克风采集声音信号。Step S410: When the electronic device is in a call state, control the first microphone to collect sound signals.

其中,通话状态是指电子设备处于语音接通的状态,例如,电子设备处于电话接通的状态,电子设备通过即时通讯软件处于语音接通的状态,电子设备通过即时通讯软件处于视频接通的状态等。在一些实施方式中,在电子设备处于通话状态下,电子设备与其他电子设备建立通话,则电子设备对应的用户与其他电子设备对应的用户可以进行通话,其中,电子设备对应的用户可以通过第一蓝牙耳机和第二蓝牙耳机接收其他电子设备对应的用户输入的声音信号,电子设备对应的用户也可以通过第一蓝牙耳机或者第二蓝牙耳机输入声音信号,通过电子设备传输给其他电子设备被其他电子设备对应的用户接收。The call state refers to the state in which the electronic device is in a voice-connected state, for example, the electronic device is in a phone-connected state, the electronic device is in a voice-connected state through an instant messaging software, the electronic device is in a video-connected state through an instant messaging software, etc. In some embodiments, when the electronic device is in a call state, the electronic device establishes a call with another electronic device, and the user corresponding to the electronic device can have a call with the user corresponding to the other electronic device, wherein the user corresponding to the electronic device can receive the sound signal input by the user corresponding to the other electronic device through the first Bluetooth headset and the second Bluetooth headset, and the user corresponding to the electronic device can also input the sound signal through the first Bluetooth headset or the second Bluetooth headset, which is transmitted to the other electronic device by the electronic device and received by the user corresponding to the other electronic device.

在一些实施方式中,可以对电子设备是否处于通话状态进行检测。其中,在检测到电子设备处于通话状态的情况下,表征需要通过第一蓝牙耳机和第二蓝牙耳机中的主耳机进行声音信号的采集,而由于第一蓝牙耳机为主耳机,因此,第一蓝牙耳机可以控制其第一麦克风进行声音信号的采集。其中,在检测到电子设备未处于通话状态的情况下,表征不需要通过第一蓝牙耳机和第二蓝牙耳机进行声音信号的采集,则可以控制第一蓝牙耳机的第一麦克风和第二蓝牙耳机的第二麦克风均处于休眠状态。In some embodiments, it is possible to detect whether the electronic device is in a call state. Wherein, when it is detected that the electronic device is in a call state, it is indicated that the sound signal needs to be collected through the main earphone of the first Bluetooth headset and the second Bluetooth headset, and because the first Bluetooth headset is the main earphone, the first Bluetooth headset can control its first microphone to collect the sound signal. Wherein, when it is detected that the electronic device is not in a call state, it is indicated that the sound signal does not need to be collected through the first Bluetooth headset and the second Bluetooth headset, and the first microphone of the first Bluetooth headset and the second Bluetooth headset can be controlled to be in a dormant state.

作为一种可实施的方式,电子设备可以实时监听是否进入通话,并将监控到的信息发送至第一蓝牙耳机,其中,可以监听电子设备来电或去电时是否处于通话中的界面,其中,在监听到所述移动终端处于通话中(CALL_STATE_OFFHOOK)的情况下,则可以确定该电子设备处于通话状态。As an implementable method, the electronic device can monitor in real time whether a call is in progress and send the monitored information to the first Bluetooth headset, wherein the interface of whether the electronic device is in a call when a call is incoming or outgoing can be monitored, wherein, when it is monitored that the mobile terminal is in a call (CALL_STATE_OFFHOOK), it can be determined that the electronic device is in a call state.

步骤S420:获取所述第一麦克风采集到的声音信号,作为第一声音信号。Step S420: Acquire the sound signal collected by the first microphone as the first sound signal.

步骤S430:通过所述第二蓝牙链路获取所述第二麦克风采集到的声音信号,作为第二声音信号。Step S430: Acquire the sound signal collected by the second microphone through the second Bluetooth link as the second sound signal.

步骤S440:在所述第一声音信号和所述第二声音信号满足预设信号条件的情况下,通过所述第二蓝牙链路向所述第二蓝牙耳机发送切换指令,所述切换指令用于指示所述第二蓝牙耳机作为主耳机与所述电子设备建立蓝牙链路。Step S440: When the first sound signal and the second sound signal meet a preset signal condition, a switching instruction is sent to the second Bluetooth headset through the second Bluetooth link, wherein the switching instruction is used to instruct the second Bluetooth headset to establish a Bluetooth link with the electronic device as a master headset.

其中,步骤S420-步骤S440的具体描述请参阅步骤S110-步骤S130,在此不再赘述。For the detailed description of step S420 to step S440, please refer to step S110 to step S130, which will not be repeated here.

在本实施例中,还在电子设备处于通话状态时,再执行本实施例提供的耳机的主从切换方法,从而提升电子设备的通话效果。In this embodiment, when the electronic device is in a call state, the master-slave switching method of the headset provided in this embodiment is executed, thereby improving the call effect of the electronic device.

请参阅图6,图6示出了本申请一实施例提供的耳机的主从切换方法的流程示意图。该方法应用于第一蓝牙耳机,该第一蓝牙耳机作为主耳机与电子设备建立有第一蓝牙链路时,第二蓝牙耳机作为从耳机与第一蓝牙耳机建立有第二蓝牙链路,该第一蓝牙耳机包括第一麦克风,第二蓝牙耳机包括第二麦克风。在本实施例中,第一蓝牙耳机包括光感传感器。下面将针对图6所示的流程进行详细的阐述,所述耳机的主从切换方法具体可以包括以下步骤:Please refer to Figure 6, which shows a schematic flow chart of a master-slave switching method for headphones provided in an embodiment of the present application. The method is applied to a first Bluetooth headset, and when the first Bluetooth headset serves as a master headset and establishes a first Bluetooth link with an electronic device, the second Bluetooth headset serves as a slave headset and establishes a second Bluetooth link with the first Bluetooth headset, and the first Bluetooth headset includes a first microphone, and the second Bluetooth headset includes a second microphone. In this embodiment, the first Bluetooth headset includes a light sensor. The process shown in Figure 6 will be described in detail below, and the master-slave switching method for headphones may specifically include the following steps:

步骤S510:基于所述光感传感器确定所述第一蓝牙耳机处于佩戴状态。Step S510: determining, based on the light sensor, whether the first Bluetooth headset is in a wearing state.

在本实施例中,第一蓝牙耳机包括光感传感器。其中,该光感传感器例如可以包括环境光传感器、红外光传感器、太阳光传感器、紫外光传感器等,在此不做限定。其中,该第一蓝牙耳机通过其设置的光感传感器检测是否遮挡的方式,确定第一蓝牙耳机是否处于佩戴状态。In this embodiment, the first Bluetooth headset includes a light sensor. The light sensor may include, for example, an ambient light sensor, an infrared light sensor, a sunlight sensor, an ultraviolet light sensor, etc., which are not limited here. The first Bluetooth headset determines whether the first Bluetooth headset is in a wearing state by detecting whether the light sensor is blocked.

在一些实施方式中,第一蓝牙耳机可以通过光感传感器进行遮挡检测。其中,在第一蓝牙耳机通过光感传感器未检测到遮挡的情况下,则可以确定第一蓝牙耳机未入耳,即,第一蓝牙耳机未处于佩戴状态,则可以执行主从耳机的切换,即可以将第一蓝牙耳机从主耳机切换为从耳机,并将第二蓝牙耳机从从耳机切换为主耳机。In some implementations, the first Bluetooth headset may perform occlusion detection through a light sensor. If the first Bluetooth headset does not detect occlusion through the light sensor, it can be determined that the first Bluetooth headset is not in the ear, that is, the first Bluetooth headset is not in a wearing state, and the master-slave headset switching can be performed, that is, the first Bluetooth headset can be switched from the master headset to the slave headset, and the second Bluetooth headset can be switched from the slave headset to the master headset.

作为一种可实施的方式,在第一蓝牙耳机通过光感传感器未检测到遮挡的情况下,则可以确定第一蓝牙耳机未入耳,即,第一蓝牙耳机未处于佩戴状态,则可以对第二蓝牙耳机是否处于佩戴状态进行检测,其中,在检测到第二蓝牙耳机处于佩戴状态时,则可以执行主从耳机的切换,即可以将第一蓝牙耳机从主耳机切换为从耳机,并将第二蓝牙耳机从从耳机切换为主耳机。作为一种方式,第二蓝牙耳机可以包括光感传感器,则第二蓝牙耳机可以通过其包括的光感传感器检测其是否处于佩戴状态。作为又一种方式,第二蓝牙耳机可以包括电容传感器,则第二蓝牙耳机可以通过其包括的电容传感器检测其是否处于佩戴状态。作为再一种方式,第二蓝牙耳机可以包括第二麦克风,则第二蓝牙耳机可以通过第二麦克风检测其是否处于佩戴状态。As an implementable manner, when the first Bluetooth headset does not detect occlusion through the light sensor, it can be determined that the first Bluetooth headset is not in the ear, that is, the first Bluetooth headset is not in a wearing state, and then it can be detected whether the second Bluetooth headset is in a wearing state, wherein, when it is detected that the second Bluetooth headset is in a wearing state, the master-slave headset switching can be performed, that is, the first Bluetooth headset can be switched from the master headset to the slave headset, and the second Bluetooth headset can be switched from the slave headset to the master headset. As a manner, the second Bluetooth headset can include a light sensor, and the second Bluetooth headset can detect whether it is in a wearing state through the light sensor included therein. As another manner, the second Bluetooth headset can include a capacitive sensor, and the second Bluetooth headset can detect whether it is in a wearing state through the capacitive sensor included therein. As another manner, the second Bluetooth headset can include a second microphone, and the second Bluetooth headset can detect whether it is in a wearing state through the second microphone.

作为一种可实施的方式,在第一蓝牙耳机通过光感传感器检测到遮挡的情况下,在一般情况下会认为第一蓝牙耳机入耳,即,会认为第一蓝牙耳机处于佩戴状态,此时,则不会执行主从耳机的切换,即继续保持第一蓝牙耳机作为主耳机进行声音信号的采集,且继续保持第二蓝牙耳机作为从耳机。然而,在第一蓝牙耳机通过传感器检测到遮挡的情况下,也可能是由于第一蓝牙耳机放置在某处且光感被遮挡造成的,例如,可能是由于第一蓝牙耳机放置在桌面且光感被桌面遮挡造成的,此时,虽然通过第一蓝牙耳机的光感传感器检测到第一蓝牙耳机处于佩戴状态,但是仍然可能存在误检的可能。因此,在本实施例中,在基于光感传感器确定第一蓝牙耳机处于佩戴状态的情况下,可以再获取并基于主耳机的麦克风采集到的声音信号和从耳机的麦克风采集到的声音信号,确定是否需要进行主从耳机的切换,从而提升主从耳机切换的准确性。As an implementable method, when the first Bluetooth headset detects occlusion through the light sensor, it is generally considered that the first Bluetooth headset is in the ear, that is, it is considered that the first Bluetooth headset is in a wearing state. At this time, the switching of the master-slave headset will not be performed, that is, the first Bluetooth headset continues to be kept as the master headset to collect sound signals, and the second Bluetooth headset continues to be kept as the slave headset. However, when the first Bluetooth headset detects occlusion through the sensor, it may also be caused by the first Bluetooth headset being placed somewhere and the light sense is blocked. For example, it may be caused by the first Bluetooth headset being placed on the desktop and the light sense is blocked by the desktop. At this time, although the first Bluetooth headset is detected to be in a wearing state by the light sensor of the first Bluetooth headset, there may still be a possibility of false detection. Therefore, in this embodiment, when it is determined that the first Bluetooth headset is in a wearing state based on the light sensor, it can be obtained and based on the sound signal collected by the microphone of the master headset and the sound signal collected by the microphone of the slave headset, it is determined whether it is necessary to switch the master-slave headset, thereby improving the accuracy of the master-slave headset switching.

步骤S520:获取所述第一麦克风采集到的声音信号,作为第一声音信号。Step S520: Acquire the sound signal collected by the first microphone as the first sound signal.

步骤S530:通过所述第二蓝牙链路获取所述第二麦克风采集到的声音信号,作为第二声音信号。Step S530: Acquire the sound signal collected by the second microphone through the second Bluetooth link as the second sound signal.

步骤S540:在所述第一声音信号和所述第二声音信号满足预设信号条件的情况下,通过所述第二蓝牙链路向所述第二蓝牙耳机发送切换指令,所述切换指令用于指示所述第二蓝牙耳机作为主耳机与所述电子设备建立蓝牙链路。Step S540: When the first sound signal and the second sound signal meet a preset signal condition, a switching instruction is sent to the second Bluetooth headset through the second Bluetooth link, wherein the switching instruction is used to instruct the second Bluetooth headset to establish a Bluetooth link with the electronic device as a master headset.

其中,步骤S520-步骤S540的具体描述请参阅步骤S110-步骤S130,在此不再赘述。For the detailed description of step S520 to step S540, please refer to step S110 to step S130, which will not be repeated here.

在本实施例中,还在通过光感传感器确定主耳机处于佩戴状态时,再执行本实施例提供的耳机的主从切换方法,从而避免光感传感器的误检测,可以提升耳机的主从切换的准确率。In this embodiment, when the light sensor determines that the master earphone is in the wearing state, the master-slave switching method of the earphone provided in this embodiment is executed, thereby avoiding false detection of the light sensor and improving the accuracy of the master-slave switching of the earphone.

请参阅图7,图7示出了本申请一实施例提供的耳机的主从切换方法的流程示意图。该方法应用于第一蓝牙耳机,该第一蓝牙耳机作为主耳机与电子设备建立有第一蓝牙链路时,第二蓝牙耳机作为从耳机与第一蓝牙耳机建立有第二蓝牙链路,该第一蓝牙耳机包括第一麦克风,第二蓝牙耳机包括第二麦克风。在本实施例中,第一蓝牙耳机包括电容传感器。下面将针对图7所示的流程进行详细的阐述,所述耳机的主从切换方法具体可以包括以下步骤:Please refer to Figure 7, which shows a schematic flow chart of a master-slave switching method for headphones provided in an embodiment of the present application. The method is applied to a first Bluetooth headset, when the first Bluetooth headset serves as a master headset and establishes a first Bluetooth link with an electronic device, the second Bluetooth headset serves as a slave headset and establishes a second Bluetooth link with the first Bluetooth headset, the first Bluetooth headset includes a first microphone, and the second Bluetooth headset includes a second microphone. In this embodiment, the first Bluetooth headset includes a capacitive sensor. The process shown in Figure 7 will be described in detail below, and the master-slave switching method for headphones may specifically include the following steps:

步骤S610:基于所述电容传感器确定所述第一蓝牙耳机处于佩戴状态。Step S610: determining, based on the capacitive sensor, whether the first Bluetooth headset is in a wearing state.

在本实施例中,第一蓝牙耳机包括电容传感器。其中,该电容传感器例如可以包括压力式电容传感器。其中,该第一蓝牙耳机通过其设置的电容传感器检测电容量的方式,确定第一蓝牙耳机是否处于佩戴状态。In this embodiment, the first Bluetooth headset includes a capacitive sensor. The capacitive sensor may include a pressure-type capacitive sensor, for example. The first Bluetooth headset determines whether the first Bluetooth headset is in a wearing state by detecting capacitance through the capacitive sensor provided therein.

在一些实施方式中,第一蓝牙耳机可以通过电容传感器进行电容量检测。其中,在第一蓝牙耳机通过电容传感器检测到电容量不满足预设电容量的情况下,则可以确定第一蓝牙耳机未入耳,即,第一蓝牙耳机未处于佩戴状态,则可以执行主从耳机的切换,即可以将第一蓝牙耳机从主耳机切换为从耳机,并将第二蓝牙耳机从从耳机切换为主耳机。其中,该预设电容量可以为蓝牙耳机入耳时对应的电容量。In some embodiments, the first Bluetooth headset may detect capacitance through a capacitive sensor. Wherein, when the capacitance detected by the first Bluetooth headset through the capacitive sensor does not meet a preset capacitance, it can be determined that the first Bluetooth headset is not in the ear, that is, the first Bluetooth headset is not in a wearing state, and the master-slave headset switching can be performed, that is, the first Bluetooth headset can be switched from the master headset to the slave headset, and the second Bluetooth headset can be switched from the slave headset to the master headset. Wherein, the preset capacitance can be the capacitance corresponding to when the Bluetooth headset is in the ear.

作为一种可实施的方式,在第一蓝牙耳机通过电容传感器检测到电容量不满足预设电容量的情况下,则可以确定第一蓝牙耳机未入耳,即,第一蓝牙耳机未处于佩戴状态,则可以对第二蓝牙耳机是否处于佩戴状态进行检测,其中,在检测到第二蓝牙耳机处于佩戴状态时,则可以执行主从耳机的切换,即可以将第一蓝牙耳机从主耳机切换为从耳机,并将第二蓝牙耳机从从耳机切换为主耳机。作为一种方式,第二蓝牙耳机可以包括光感传感器,则第二蓝牙耳机可以通过其包括的光感传感器检测其是否处于佩戴状态。作为又一种方式,第二蓝牙耳机可以包括电容传感器,则第二蓝牙耳机可以通过其包括的电容传感器检测其是否处于佩戴状态。作为再一种方式,第二蓝牙耳机可以包括第二麦克风,则第二蓝牙耳机可以通过第二麦克风检测其是否处于佩戴状态。As an implementable manner, when the first Bluetooth headset detects that the capacitance does not meet the preset capacitance through the capacitive sensor, it can be determined that the first Bluetooth headset is not in the ear, that is, the first Bluetooth headset is not in the wearing state, and then the second Bluetooth headset can be detected whether it is in the wearing state, wherein, when the second Bluetooth headset is detected to be in the wearing state, the master-slave headset switching can be performed, that is, the first Bluetooth headset can be switched from the master headset to the slave headset, and the second Bluetooth headset can be switched from the slave headset to the master headset. As a manner, the second Bluetooth headset can include a light sensor, and the second Bluetooth headset can detect whether it is in the wearing state through the light sensor included therein. As another manner, the second Bluetooth headset can include a capacitive sensor, and the second Bluetooth headset can detect whether it is in the wearing state through the capacitive sensor included therein. As another manner, the second Bluetooth headset can include a second microphone, and the second Bluetooth headset can detect whether it is in the wearing state through the second microphone.

作为一种可实施的方式,在第一蓝牙耳机通过电容传感器检测到电容量满足预设电容量的情况下,在一般情况下会认为第一蓝牙耳机入耳,即,会认为第一蓝牙耳机处于佩戴状态,此时,则不会执行主从耳机的切换,即继续保持第一蓝牙耳机作为主耳机进行声音信号的采集,且继续保持第二蓝牙耳机作为从耳机。然而,在第一蓝牙耳机通过传感器检测到电容量满足预设电容量的情况下,也可能是由于用户手握第一蓝牙耳机的电容传感器的位置造成的,此时,虽然通过第一蓝牙耳机的电容传感器检测到第一蓝牙耳机处于佩戴状态,但是仍然可能存在误检的可能。因此,在本实施例中,在基于电容传感器确定第一蓝牙耳机处于佩戴状态的情况下,可以再获取并基于主耳机的麦克风采集到的声音信号和从耳机的麦克风采集到的声音信号,确定是否需要进行主从耳机的切换,从而提升主从耳机切换的准确性。As an implementable method, when the first Bluetooth headset detects that the capacitance meets the preset capacitance through the capacitive sensor, it is generally considered that the first Bluetooth headset is in the ear, that is, it is considered that the first Bluetooth headset is in a wearing state. At this time, the switching of the master-slave headset will not be performed, that is, the first Bluetooth headset continues to be kept as the master headset to collect sound signals, and the second Bluetooth headset continues to be kept as the slave headset. However, when the first Bluetooth headset detects that the capacitance meets the preset capacitance through the sensor, it may also be caused by the position of the capacitive sensor of the first Bluetooth headset held by the user. At this time, although the first Bluetooth headset is detected to be in a wearing state through the capacitive sensor of the first Bluetooth headset, there may still be the possibility of false detection. Therefore, in this embodiment, when it is determined that the first Bluetooth headset is in a wearing state based on the capacitive sensor, it can be obtained and based on the sound signal collected by the microphone of the master headset and the sound signal collected by the microphone of the slave headset, it is determined whether the master-slave headset needs to be switched, thereby improving the accuracy of the master-slave headset switching.

步骤S620:获取所述第一麦克风采集到的声音信号,作为第一声音信号。Step S620: Acquire the sound signal collected by the first microphone as the first sound signal.

步骤S630:通过所述第二蓝牙链路获取所述第二麦克风采集到的声音信号,作为第二声音信号。Step S630: Acquire the sound signal collected by the second microphone through the second Bluetooth link as the second sound signal.

步骤S640:在所述第一声音信号和所述第二声音信号满足预设信号条件的情况下,通过所述第二蓝牙链路向所述第二蓝牙耳机发送切换指令,所述切换指令用于指示所述第二蓝牙耳机作为主耳机与所述电子设备建立蓝牙链路。Step S640: When the first sound signal and the second sound signal meet a preset signal condition, a switching instruction is sent to the second Bluetooth headset through the second Bluetooth link, wherein the switching instruction is used to instruct the second Bluetooth headset to establish a Bluetooth link with the electronic device as a master headset.

其中,步骤S620-步骤S640的具体描述请参阅步骤S110-步骤S130,在此不再赘述。For the detailed description of step S620 to step S640, please refer to step S110 to step S130, which will not be repeated here.

在本实施例中,还在通过电容传感器确定主耳机处于佩戴状态时,再执行本实施例提供的耳机的主从切换方法,从而避免电容传感器的误检测,可以提升耳机的主从切换的准确率。In this embodiment, when the capacitive sensor determines that the master earphone is in the wearing state, the master-slave switching method of the earphone provided in this embodiment is executed, thereby avoiding false detection of the capacitive sensor and improving the accuracy of the master-slave switching of the earphone.

请参阅图8,图8示出了本申请一实施例提供的耳机的主从切换方法的流程示意图。该方法应用于第一蓝牙耳机,该第一蓝牙耳机作为主耳机与电子设备建立有第一蓝牙链路时,第二蓝牙耳机作为从耳机与第一蓝牙耳机建立有第二蓝牙链路,该第一蓝牙耳机包括第一麦克风,第二蓝牙耳机包括第二麦克风。下面将针对图8所示的流程进行详细的阐述,所述耳机的主从切换方法具体可以包括以下步骤:Please refer to FIG8 , which shows a schematic flow chart of a method for switching between a master and a slave of a headset provided in an embodiment of the present application. The method is applied to a first Bluetooth headset, when the first Bluetooth headset as a master headset establishes a first Bluetooth link with an electronic device, the second Bluetooth headset as a slave headset establishes a second Bluetooth link with the first Bluetooth headset, the first Bluetooth headset includes a first microphone, and the second Bluetooth headset includes a second microphone. The process shown in FIG8 will be described in detail below, and the method for switching between a master and a slave of a headset may specifically include the following steps:

步骤S710:获取所述第一麦克风采集到的声音信号,作为第一声音信号。Step S710: Acquire the sound signal collected by the first microphone as the first sound signal.

其中,步骤S710的具体描述请参阅步骤S110,在此不再赘述。For the detailed description of step S710, please refer to step S110, which will not be repeated here.

步骤S720:获取所述第一声音信号对应的第一声音强度。Step S720: Obtain a first sound intensity corresponding to the first sound signal.

步骤S730:在所述第一声音强度小于或等于所述第一强度阈值的情况下,通过所述第二蓝牙链路向所述第二蓝牙耳机发送唤醒指令,所述唤醒指令用于指示所述第二蓝牙耳机控制所述第二麦克风从所述休眠状态切换为工作状态,并通过所述第二麦克风采集声音信号。Step S730: When the first sound intensity is less than or equal to the first intensity threshold, a wake-up instruction is sent to the second Bluetooth headset through the second Bluetooth link, and the wake-up instruction is used to instruct the second Bluetooth headset to control the second microphone to switch from the sleep state to the working state, and collect sound signals through the second microphone.

步骤S740:通过所述第二蓝牙链路获取所述第二麦克风采集到的声音信号,作为第二声音信号。Step S740: Acquire the sound signal collected by the second microphone through the second Bluetooth link as the second sound signal.

步骤S750:获取所述第二声音信号对应的第二声音强度。Step S750: Obtain a second sound intensity corresponding to the second sound signal.

步骤S760:在所述第二声音强度大于所述第一强度阈值的情况下,通过所述第二蓝牙链路向所述第二蓝牙耳机发送所述切换指令。Step S760: When the second sound intensity is greater than the first intensity threshold, sending the switching instruction to the second Bluetooth headset through the second Bluetooth link.

其中,步骤S720-步骤S760的具体描述请参阅步骤S220-步骤S260,在此不再赘述。For the detailed description of steps S720 to S760, please refer to steps S220 to S260, which will not be repeated here.

步骤S770:在所述第二声音强度小于或等于所述第一强度阈值的情况下,计算所述第二声音强度和所述第一声音强度之间的差值。Step S770: when the second sound intensity is less than or equal to the first intensity threshold, calculating a difference between the second sound intensity and the first sound intensity.

步骤S780:在所述第二声音强度大于所述第一声音强度,且所述第二声音强度和所述第一声音强度之间的差值大于第二强度阈值的情况下,通过所述第二蓝牙链路向所述第二蓝牙耳机发送切换指令,所述切换指令用于指示所述第二蓝牙耳机作为主耳机与所述电子设备建立蓝牙链路。Step S780: When the second sound intensity is greater than the first sound intensity and the difference between the second sound intensity and the first sound intensity is greater than a second intensity threshold, a switching instruction is sent to the second Bluetooth headset through the second Bluetooth link, and the switching instruction is used to instruct the second Bluetooth headset to establish a Bluetooth link with the electronic device as a main headset.

其中,步骤S770-步骤S780的具体描述请参阅步骤S340,在此不再赘述。For the detailed description of steps S770 to S780, please refer to step S340, which will not be repeated here.

在本实施例中,还在主耳机采集到的声音信号的声音强度小于或等于第一强度阈值时,控制从耳机的麦克风从休眠状态切换为工作状态进行声音信号的采集,以降低从耳机的功耗。另外,本实施例还在主耳机采集到声音信号对应的信号强度小于或等于第一强度阈值且从耳机采集到的声音信号对应的信号强度大于第一强度阈值时,进行主从耳机的切换,以使得可以通过主耳机采集到声音强度满足需求的声音信号,提升主从耳机的切换准确率。再者,本实施例还在主从耳机采集到的声音信号对应的信号强度均小于或等于第一强度阈值时,再将从耳机采集到的声音信号对应的信号强度与主耳机采集到的声音信号对应的信号强度之间的差值与第二强度阈值进行比较,并在从耳机采集到的声音信号对应的信号强度与主耳机采集到的声音信号对应的信号强度之间的差值大于第二强度阈值,且从耳机采集到的声音信号对应的信号强度大于主耳机采集到的声音信号对应的信号强度时,进行主从耳机的切换,以使得可以通过主耳机采集到声音强度满足需求的声音信号,提升主从耳机的切换准确率。In this embodiment, when the sound intensity of the sound signal collected by the master earphone is less than or equal to the first intensity threshold, the microphone of the slave earphone is controlled to switch from the dormant state to the working state to collect the sound signal, so as to reduce the power consumption of the slave earphone. In addition, when the signal intensity corresponding to the sound signal collected by the master earphone is less than or equal to the first intensity threshold and the signal intensity corresponding to the sound signal collected by the slave earphone is greater than the first intensity threshold, the master and slave earphones are switched, so that the sound signal with the sound intensity meeting the requirement can be collected by the master earphone, and the switching accuracy of the master and slave earphones is improved. Furthermore, when the signal intensity corresponding to the sound signal collected by the master and slave earphones is less than or equal to the first intensity threshold, the difference between the signal intensity corresponding to the sound signal collected by the slave earphone and the signal intensity corresponding to the sound signal collected by the master earphone is compared with the second intensity threshold, and when the difference between the signal intensity corresponding to the sound signal collected by the slave earphone and the signal intensity corresponding to the sound signal collected by the master earphone is greater than the second intensity threshold, and the signal intensity corresponding to the sound signal collected by the slave earphone is greater than the signal intensity corresponding to the sound signal collected by the master earphone, the master and slave earphones are switched, so that the sound signal with the sound intensity meeting the requirement can be collected by the master earphone, and the switching accuracy of the master and slave earphones is improved.

请参阅图9,图9示出了本申请实施例提供的耳机的主从切换方法的时序图。在本实施例中,该耳机的主从切换方法应用于蓝牙耳机组,该蓝牙耳机组包括第一蓝牙耳机和第二蓝牙耳机,第一蓝牙耳机作为主耳机与电子设备建立有第一蓝牙链路时,第二蓝牙耳机作为从耳机与第一蓝牙耳机建立有第二蓝牙链路,第一蓝牙耳机包括第一麦克风,第二蓝牙耳机包括第二麦克风。下面将针对图9所示的流程进行阐述,所述耳机的主从切换方法具体可以包括以下步骤:Please refer to Figure 9, which shows a timing diagram of the master-slave switching method of the headset provided in an embodiment of the present application. In this embodiment, the master-slave switching method of the headset is applied to a Bluetooth headset group, and the Bluetooth headset group includes a first Bluetooth headset and a second Bluetooth headset. When the first Bluetooth headset is used as a master headset to establish a first Bluetooth link with an electronic device, the second Bluetooth headset is used as a slave headset to establish a second Bluetooth link with the first Bluetooth headset. The first Bluetooth headset includes a first microphone, and the second Bluetooth headset includes a second microphone. The process shown in Figure 9 will be described below. The master-slave switching method of the headset may specifically include the following steps:

步骤S810:所述第一蓝牙耳机获取通过所述第一麦克风采集到的声音信号,作为第一声音信号。Step S810: The first Bluetooth headset obtains a sound signal collected by the first microphone as a first sound signal.

步骤S820:所述第二蓝牙耳机通过所述第二麦克风采集到声音信号,并通过所述第二蓝牙链路将所述第二麦克风采集到的声音信号发送给所述第一蓝牙耳机。Step S820: the second Bluetooth headset collects sound signals through the second microphone, and sends the sound signals collected by the second microphone to the first Bluetooth headset through the second Bluetooth link.

步骤S830:所述第一蓝牙耳机通过所述第二蓝牙链路获取到所述第二麦克风采集到的声音信号,作为第二声音信号。Step S830: The first Bluetooth headset obtains the sound signal collected by the second microphone through the second Bluetooth link as the second sound signal.

步骤S840:所述第一蓝牙耳机在所述第一声音信号和所述第二声音信号满足预设信号条件的情况下,通过所述第二蓝牙链路向所述第二蓝牙耳机发送切换指令。Step S840: When the first sound signal and the second sound signal meet a preset signal condition, the first Bluetooth headset sends a switching instruction to the second Bluetooth headset through the second Bluetooth link.

步骤S850:所述第二蓝牙耳机响应于所述切换指令,作为主耳机与所述电子设备建立蓝牙链路。Step S850: The second Bluetooth headset responds to the switching instruction and establishes a Bluetooth link with the electronic device as a master headset.

在本申请实施例中,由于主耳机是基于主耳机的麦克风采集到的声音信号和从耳机的麦克风采集到的声音信号,确定是否需要进行主从耳机的切换,从而可以避免设置其他用于检测佩戴的传感器带来的成本问题,可以降低蓝牙耳机的成本。另外,由于主耳机是基于主耳机的麦克风采集到的声音信号和从耳机的麦克风采集到的声音信号,可以避免所设置的其他用于检测佩戴的传感器检测错误的问题,可以提升主从耳机切换的准确率。In the embodiment of the present application, since the master earphone determines whether it is necessary to switch between the master and slave earphones based on the sound signal collected by the microphone of the master earphone and the sound signal collected by the microphone of the slave earphone, the cost problem caused by setting other sensors for detecting wearing can be avoided, and the cost of the Bluetooth earphone can be reduced. In addition, since the master earphone is based on the sound signal collected by the microphone of the master earphone and the sound signal collected by the microphone of the slave earphone, the problem of detection errors of other sensors set up for detecting wearing can be avoided, and the accuracy of switching between the master and slave earphones can be improved.

请参阅图10,图10示出了本申请一实施例提供的耳机的主从切换装置的模块框图。该耳机的主从切换装置400应用于上述第一蓝牙耳机,该第一蓝牙耳机作为主耳机与电子设备建立有第一蓝牙链路时,第二蓝牙耳机作为从耳机与第一蓝牙耳机建立有第二蓝牙链路,该第一蓝牙耳机包括第一麦克风,第二蓝牙耳机包括第二麦克风。下面将针对图10所示的框图进行阐述,所述耳机的主从切换装置400包括:第一声音信号获取模块410、第二声音信号获取模块420以及主从耳机切换模块430,其中:Please refer to Figure 10, which shows a module block diagram of a master-slave switching device for headphones provided in an embodiment of the present application. The master-slave switching device 400 of the headphones is applied to the above-mentioned first Bluetooth headphones. When the first Bluetooth headphones serve as the master headphones and establish a first Bluetooth link with the electronic device, the second Bluetooth headphones serve as the slave headphones and establish a second Bluetooth link with the first Bluetooth headphones. The first Bluetooth headphones include a first microphone, and the second Bluetooth headphones include a second microphone. The block diagram shown in Figure 10 will be described below. The master-slave switching device 400 of the headphones includes: a first sound signal acquisition module 410, a second sound signal acquisition module 420, and a master-slave headphones switching module 430, wherein:

第一声音信号获取模块410,用于获取所述第一麦克风采集到的声音信号,作为第一声音信号。The first sound signal acquisition module 410 is used to acquire the sound signal collected by the first microphone as the first sound signal.

第二声音信号获取模块420,用于通过所述第二蓝牙链路获取所述第二麦克风采集到的声音信号,作为第二声音信号。The second sound signal acquisition module 420 is configured to acquire the sound signal collected by the second microphone through the second Bluetooth link as the second sound signal.

主从耳机切换模块430,用于在所述第一声音信号和所述第二声音信号满足预设信号条件的情况下,通过所述第二蓝牙链路向所述第二蓝牙耳机发送切换指令,所述切换指令用于指示所述第二蓝牙耳机作为主耳机与所述电子设备建立蓝牙链路。The master-slave earphone switching module 430 is used to send a switching instruction to the second Bluetooth earphone through the second Bluetooth link when the first sound signal and the second sound signal meet the preset signal conditions. The switching instruction is used to instruct the second Bluetooth earphone to establish a Bluetooth link with the electronic device as the master earphone.

进一步地,所述主从耳机切换模块430包括:第一声音强度获取子模块和第一主从耳机切换子模块,其中:Furthermore, the master-slave earphone switching module 430 includes: a first sound intensity acquisition submodule and a first master-slave earphone switching submodule, wherein:

第一声音强度获取子模块,用于获取所述第一声音信号对应的第一声音强度,并获取所述第二声音信号对应的第二声音强度。The first sound intensity acquisition submodule is used to acquire a first sound intensity corresponding to the first sound signal, and acquire a second sound intensity corresponding to the second sound signal.

第一主从耳机切换子模块,用于在所述第一声音强度小于或等于第一强度阈值且所述第二声音强度大于所述第一强度阈值的情况下,通过所述第二蓝牙链路向所述第二蓝牙耳机发送所述切换指令。The first master-slave headset switching submodule is used to send the switching instruction to the second Bluetooth headset through the second Bluetooth link when the first sound intensity is less than or equal to a first intensity threshold and the second sound intensity is greater than the first intensity threshold.

进一步地,所述第二麦克风处于休眠状态,所述主从耳机切换模块430还包括:唤醒指令发送子模块,其中:Furthermore, the second microphone is in a dormant state, and the master-slave headset switching module 430 further includes: a wake-up instruction sending submodule, wherein:

唤醒指令发送子模块,用于在所述第一声音强度小于或等于所述第一强度阈值的情况下,通过所述第二蓝牙链路向所述第二蓝牙耳机发送唤醒指令,所述唤醒指令用于指示所述第二蓝牙耳机控制所述第二麦克风从所述休眠状态切换为工作状态,并通过所述第二麦克风采集声音信号。A wake-up instruction sending submodule is used to send a wake-up instruction to the second Bluetooth headset through the second Bluetooth link when the first sound intensity is less than or equal to the first intensity threshold, and the wake-up instruction is used to instruct the second Bluetooth headset to control the second microphone to switch from the sleep state to the working state, and collect sound signals through the second microphone.

进一步地,所述主从耳机切换模块430包括:第二声音强度获取子模块和第二主从耳机切换子模块,其中:Furthermore, the master-slave earphone switching module 430 includes: a second sound intensity acquisition submodule and a second master-slave earphone switching submodule, wherein:

第二声音强度获取子模块,用于获取所述第一声音信号对应的第三声音强度,并获取所述第二声音信号对应的第四声音强度。The second sound intensity acquisition submodule is used to acquire a third sound intensity corresponding to the first sound signal, and acquire a fourth sound intensity corresponding to the second sound signal.

第二主从耳机切换子模块,用于在所述第四声音强度大于所述第三声音强度,且所述第四声音强度和所述第三声音强度之间的差值大于第二强度阈值的情况下,通过所述第二蓝牙链路向所述第二蓝牙耳机发送切换指令,所述切换指令用于指示所述第二蓝牙耳机作为主耳机与所述电子设备建立蓝牙链路。The second master-slave earphone switching submodule is used to send a switching instruction to the second Bluetooth earphone through the second Bluetooth link when the fourth sound intensity is greater than the third sound intensity and the difference between the fourth sound intensity and the third sound intensity is greater than a second intensity threshold, wherein the switching instruction is used to instruct the second Bluetooth earphone to establish a Bluetooth link with the electronic device as the master earphone.

进一步地,所述主从耳机的切换装置400还包括:声音信号采集模块,其中:Furthermore, the master-slave headset switching device 400 further includes: a sound signal collection module, wherein:

声音信号采集模块,用于在所述电子设备处于通话状态的情况下,控制所述第一麦克风采集声音信号。The sound signal collection module is used to control the first microphone to collect sound signals when the electronic device is in a call state.

进一步地,所述第一蓝牙耳机包括光感传感器,所述主从耳机的切换装置400还包括:第一佩戴状态确定模块,其中:Furthermore, the first Bluetooth headset includes a light sensor, and the master-slave headset switching device 400 further includes: a first wearing state determination module, wherein:

第一佩戴状态确定模块,用于基于所述光感传感器确定所述第一蓝牙处于佩戴状态。The first wearing state determining module is used to determine whether the first Bluetooth is in a wearing state based on the light sensor.

进一步地,所述第一蓝牙耳机包括电容传感器,所述主从耳机的切换装置400还包括:第二佩戴状态确定模块,其中:Furthermore, the first Bluetooth headset includes a capacitive sensor, and the master-slave headset switching device 400 further includes: a second wearing state determination module, wherein:

第二佩戴状态确定模块,用于基于所述电容传感器确定所述第一蓝牙耳机处于佩戴状态。The second wearing state determining module is used to determine whether the first Bluetooth headset is in a wearing state based on the capacitive sensor.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述装置和模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

在本申请所提供的几个实施例中,模块相互之间的耦合可以是电性,机械或其它形式的耦合。In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.

另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.

请参阅图11,其示出了本申请实施例提供的一种蓝牙耳机(第一蓝牙耳机)100的结构框图。本申请中的蓝牙耳机100可以包括一个或多个如下部件:处理器110、存储器120以及一个或多个应用程序,其中一个或多个应用程序可以被存储在存储器120中并被配置为由一个或多个处理器110执行,一个或多个程序配置用于执行如前述方法实施例所描述的方法。Please refer to Figure 11, which shows a structural block diagram of a Bluetooth headset (first Bluetooth headset) 100 provided in an embodiment of the present application. The Bluetooth headset 100 in the present application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by one or more processors 110, and the one or more programs are configured to execute the method described in the aforementioned method embodiment.

其中,处理器110可以包括一个或者多个处理核。处理器110利用各种接口和线路连接整个蓝牙耳机100内的各个部分,通过运行或执行存储在存储器120内的指令、程序、代码集或指令集,以及调用存储在存储器120内的数据,执行蓝牙耳机100的各种功能和处理数据。可选地,处理器110可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(ProgrammableLogic Array,PLA)中的至少一种硬件形式来实现。处理器110可集成中央处理器(CentralProcessing Unit,CPU)、图形处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责待显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器110中,单独通过一块通信芯片进行实现。Among them, the processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect the various parts of the entire Bluetooth headset 100, and executes various functions and processes data of the Bluetooth headset 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Optionally, the processor 110 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 110 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 110, but may be implemented separately through a communication chip.

存储器120可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。存储器120可用于存储指令、程序、代码、代码集或指令集。存储器120可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等。存储数据区还可以存储蓝牙耳机100在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). The memory 120 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the Bluetooth headset 100 during use.

请参阅图12,其示出了本申请实施例提供的一种计算机可读存储介质的结构框图。该计算机可读介质500中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。Please refer to Figure 12, which shows a block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 500 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.

计算机可读存储介质500可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读存储介质500包括非易失性计算机可读介质(non-transitory computer-readable storage medium)。计算机可读存储介质500具有执行上述方法中的任何方法步骤的程序代码510的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码510可以例如以适当形式进行压缩。The computer readable storage medium 500 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 500 includes a non-transitory computer-readable storage medium. The computer readable storage medium 500 has storage space for program code 510 that performs any method steps in the above method. These program codes can be read from or written to one or more computer program products. The program code 510 can be compressed, for example, in an appropriate form.

综上所述,在本申请实施例中,由于主耳机是基于主耳机的麦克风采集到的声音信号和从耳机的麦克风采集到的声音信号,确定是否需要进行主从耳机的切换,从而可以避免设置其他用于检测佩戴的传感器带来的成本问题,可以降低蓝牙耳机的成本。另外,由于主耳机是基于主耳机的麦克风采集到的声音信号和从耳机的麦克风采集到的声音信号,可以避免所设置的其他用于检测佩戴的传感器检测错误的问题,可以提升主从耳机切换的准确率。In summary, in the embodiment of the present application, since the master earphone determines whether it is necessary to switch between the master and slave earphones based on the sound signal collected by the microphone of the master earphone and the sound signal collected by the microphone of the slave earphone, the cost problem caused by setting other sensors for detecting wearing can be avoided, and the cost of the Bluetooth earphone can be reduced. In addition, since the master earphone is based on the sound signal collected by the microphone of the master earphone and the sound signal collected by the microphone of the slave earphone, the problem of detection errors of other sensors set up for detecting wearing can be avoided, and the accuracy of switching between the master and slave earphones can be improved.

最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. The master-slave switching method of the earphone is characterized by being applied to a first Bluetooth earphone, when the first Bluetooth earphone is used as a master earphone and a first Bluetooth link is established with electronic equipment, a second Bluetooth earphone is used as a slave earphone and a second Bluetooth link is established with the first Bluetooth earphone, the first Bluetooth earphone comprises a first microphone, the second Bluetooth earphone comprises a second microphone, and the second microphone is in a dormant state, and the method comprises the following steps:
acquiring a sound signal acquired by the first microphone as a first sound signal;
acquiring a first sound intensity corresponding to the first sound signal;
When the first sound intensity is smaller than or equal to a first intensity threshold value, sending a wake-up instruction to the second Bluetooth headset through the second Bluetooth link, wherein the wake-up instruction is used for indicating the second Bluetooth headset to control the second microphone to switch from the dormant state to the working state, and collecting sound signals through the second microphone;
Acquiring sound signals acquired by the second microphone through the second Bluetooth link to serve as second sound signals;
transmitting the link information of the first Bluetooth link to the second Bluetooth headset through the second Bluetooth link under the condition that the first sound signal and the second sound signal meet preset signal conditions;
And when receiving the confirmation identification sent by the second Bluetooth headset based on the link information, sending a switching instruction to the second Bluetooth headset through the second Bluetooth link, wherein the switching instruction is used for indicating the second Bluetooth headset to be used as a main headset to establish a Bluetooth link with the electronic equipment so that the second Bluetooth headset is connected with the electronic equipment through establishing a third Bluetooth link according to the received link information of the first Bluetooth link.
2. The method according to claim 1, wherein the sending a switching instruction to the second bluetooth headset through the second bluetooth link in the case that the first sound signal and the second sound signal satisfy a preset signal condition includes:
acquiring a second sound intensity corresponding to the second sound signal;
And under the condition that the first sound intensity is smaller than or equal to a first intensity threshold value and the second sound intensity is larger than the first intensity threshold value, sending the switching instruction to the second Bluetooth headset through the second Bluetooth link.
3. The method according to claim 1, wherein the sending, by the second bluetooth headset, a switching instruction to instruct the second bluetooth headset to establish a bluetooth link with the electronic device as a master headset, in a case where the first sound signal and the second sound signal satisfy a preset signal condition, includes:
Acquiring a third sound intensity corresponding to the first sound signal and a fourth sound intensity corresponding to the second sound signal;
and under the condition that the fourth sound intensity is larger than the third sound intensity and the difference value between the fourth sound intensity and the third sound intensity is larger than a second intensity threshold, sending a switching instruction to the second Bluetooth headset through the second Bluetooth link, wherein the switching instruction is used for indicating the second Bluetooth headset to be used as a main headset to establish a Bluetooth link with the electronic equipment.
4. The method of claim 1, comprising, prior to said acquiring the sound signal acquired by the first microphone as a first sound signal:
and under the condition that the electronic equipment is in a call state, controlling the first microphone to collect sound signals.
5. The method of any of claims 1-4, wherein the first bluetooth headset includes a light sensor, and further comprising, prior to said acquiring the sound signal acquired by the first microphone as the first sound signal:
and determining that the first Bluetooth headset is in a wearing state based on the light sensor.
6. The method of any of claims 1-4, wherein the first bluetooth headset includes a capacitive sensor, and further comprising, prior to said acquiring the sound signal acquired by the first microphone as a first sound signal:
And determining that the first Bluetooth headset is in a wearing state based on the capacitance sensor.
7. The master-slave switching method of the earphone is characterized by being applied to a Bluetooth earphone set, wherein the Bluetooth earphone set comprises a first Bluetooth earphone and a second Bluetooth earphone, when the first Bluetooth earphone is used as a master earphone and is established with an electronic device, the second Bluetooth earphone is used as a slave earphone and is established with a second Bluetooth link with the first Bluetooth earphone, the first Bluetooth earphone comprises a first microphone, the second Bluetooth earphone comprises a second microphone, and the second microphone is in a dormant state, and the method comprises the following steps:
the first Bluetooth headset acquires the sound signal acquired by the first microphone as a first sound signal;
the first Bluetooth headset acquires first sound intensity corresponding to the first sound signal;
The first Bluetooth headset sends a wake-up instruction to the second Bluetooth headset through the second Bluetooth link under the condition that the first sound intensity is smaller than or equal to a first intensity threshold;
the second Bluetooth headset controls the second microphone to be switched from the dormant state to the working state based on the wake-up instruction;
the second Bluetooth headset collects sound signals through the second microphone and sends the sound signals collected by the second microphone to the first Bluetooth headset through the second Bluetooth link;
the first Bluetooth headset acquires the sound signal acquired by the second microphone through the second Bluetooth link to serve as a second sound signal;
the first Bluetooth headset sends the link information of the first Bluetooth link to the second Bluetooth headset through the second Bluetooth link under the condition that the first sound signal and the second sound signal meet preset signal conditions;
the second Bluetooth headset sends a confirmation mark based on the link information;
The first Bluetooth headset sends a switching instruction to the second Bluetooth headset through the second Bluetooth link when receiving the confirmation identification sent by the second Bluetooth headset based on the link information;
and the second Bluetooth headset responds to the switching instruction and is used as a main headset to be connected with the electronic equipment by establishing a third Bluetooth link according to the received link information of the first Bluetooth link.
8. The utility model provides a master-slave switching device of earphone, its characterized in that is applied to first bluetooth headset, when first bluetooth headset has established first bluetooth link as main earphone and electronic equipment, second bluetooth headset has established second bluetooth link as slave earphone with first bluetooth headset, first bluetooth headset includes first microphone, second bluetooth headset includes the second microphone, the second microphone is in sleep state, the device includes:
the first sound signal acquisition module is used for acquiring the sound signal acquired by the first microphone and taking the sound signal as a first sound signal;
The first sound intensity acquisition sub-module is used for acquiring first sound intensity corresponding to the first sound signal;
The wake-up instruction sending sub-module is used for sending a wake-up instruction to the second Bluetooth headset through the second Bluetooth link under the condition that the first sound intensity is smaller than or equal to a first intensity threshold value, wherein the wake-up instruction is used for indicating the second Bluetooth headset to control the second microphone to switch from the dormant state to the working state and collect sound signals through the second microphone;
the second sound signal acquisition module is used for acquiring the sound signal acquired by the second microphone through the second Bluetooth link to be used as a second sound signal;
The master-slave earphone switching module is used for sending the link information of the first Bluetooth link to the second Bluetooth earphone through the second Bluetooth link under the condition that the first sound signal and the second sound signal meet the preset signal condition; and when receiving the confirmation identification sent by the second Bluetooth headset based on the link information, sending a switching instruction to the second Bluetooth headset through the second Bluetooth link, wherein the switching instruction is used for indicating the second Bluetooth headset to be used as a main headset to establish a Bluetooth link with the electronic equipment so that the second Bluetooth headset is connected with the electronic equipment through establishing a third Bluetooth link according to the received link information of the first Bluetooth link.
9. A bluetooth headset comprising a memory and a processor, the memory being coupled to the processor, the memory storing instructions that when executed by the processor perform the method of any of claims 1-7.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a program code, which is callable by a processor for executing the method according to any one of claims 1-7.
CN202210178812.XA 2022-02-25 2022-02-25 Master-slave switching method and device of earphone, bluetooth earphone and storage medium Active CN114501239B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210178812.XA CN114501239B (en) 2022-02-25 2022-02-25 Master-slave switching method and device of earphone, bluetooth earphone and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210178812.XA CN114501239B (en) 2022-02-25 2022-02-25 Master-slave switching method and device of earphone, bluetooth earphone and storage medium

Publications (2)

Publication Number Publication Date
CN114501239A CN114501239A (en) 2022-05-13
CN114501239B true CN114501239B (en) 2024-05-10

Family

ID=81483670

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210178812.XA Active CN114501239B (en) 2022-02-25 2022-02-25 Master-slave switching method and device of earphone, bluetooth earphone and storage medium

Country Status (1)

Country Link
CN (1) CN114501239B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115499818B (en) * 2022-11-16 2023-06-02 荣耀终端有限公司 Data processing method, system, electronic device, bluetooth peripheral and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109413526A (en) * 2018-09-30 2019-03-01 Oppo广东移动通信有限公司 Headphone control method, device, electronic device, and storage medium
CN109618052A (en) * 2018-12-11 2019-04-12 努比亚技术有限公司 A kind of call audio switching method and device, mobile terminal and readable storage medium storing program for executing
CN109743654A (en) * 2019-01-29 2019-05-10 上海与德通讯技术有限公司 A kind of bluetooth headset major-minor ear switching method, device, equipment and medium
CN112235677A (en) * 2020-10-09 2021-01-15 歌尔科技有限公司 Master-slave switching method of wireless earphone, wireless earphone and readable storage medium
CN113038317A (en) * 2019-12-25 2021-06-25 Oppo广东移动通信有限公司 Earphone control method and device, Bluetooth earphone and storage medium
WO2021218190A1 (en) * 2020-04-27 2021-11-04 歌尔股份有限公司 Primary-secondary ear switching method and apparatus for tws earphones in communication scenario, and medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107894881A (en) * 2017-10-18 2018-04-10 恒玄科技(上海)有限公司 The method that principal and subordinate link switching, conversation monitoring and the Mike of bluetooth earphone switch

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109413526A (en) * 2018-09-30 2019-03-01 Oppo广东移动通信有限公司 Headphone control method, device, electronic device, and storage medium
CN109618052A (en) * 2018-12-11 2019-04-12 努比亚技术有限公司 A kind of call audio switching method and device, mobile terminal and readable storage medium storing program for executing
CN109743654A (en) * 2019-01-29 2019-05-10 上海与德通讯技术有限公司 A kind of bluetooth headset major-minor ear switching method, device, equipment and medium
CN113038317A (en) * 2019-12-25 2021-06-25 Oppo广东移动通信有限公司 Earphone control method and device, Bluetooth earphone and storage medium
WO2021218190A1 (en) * 2020-04-27 2021-11-04 歌尔股份有限公司 Primary-secondary ear switching method and apparatus for tws earphones in communication scenario, and medium
CN112235677A (en) * 2020-10-09 2021-01-15 歌尔科技有限公司 Master-slave switching method of wireless earphone, wireless earphone and readable storage medium

Also Published As

Publication number Publication date
CN114501239A (en) 2022-05-13

Similar Documents

Publication Publication Date Title
CN109445739B (en) Audio playback method, apparatus, electronic device, and computer-readable medium
US11778363B2 (en) Audio data transmission method applied to switching between single-earbud mode and double-earbud mode of TWS headset and device
CN109151212B (en) Equipment control method and device and electronic equipment
CN113038317B (en) Earphone control method and device, bluetooth earphone and storage medium
CN113038316A (en) Earphone control method and device, Bluetooth earphone and storage medium
US10630826B2 (en) Information processing device
CN109413555B (en) Audio output method, device, earphone, and electronic device
WO2020063046A1 (en) Audio playback method and device, electronic device and storage medium
US10950238B2 (en) Bluetooth speaker base, method and system for controlling thereof
CN109379490B (en) Audio playing method and device, electronic equipment and computer readable medium
WO2020019843A1 (en) Microphone hole blockage detection method and related product
CN109271131B (en) Earphone control method and device, electronic equipment and storage medium
CN113453114B (en) Encoding control method, encoding control device, wireless headset and storage medium
CN113727231A (en) Earphone volume adjusting method and equipment
CN110189753A (en) Bluetooth speaker and its control method, system and storage medium
CN108990105A (en) wireless communication transmission method, device, mobile terminal and computer readable storage medium
CN111601290B (en) Bluetooth sound box, earphone, bluetooth audio playing device, bluetooth sound box system and Bluetooth audio switching method
CN114245362B (en) Device reconnection method and Bluetooth peripheral
CN109358832A (en) Audio transmission method, device, electronic equipment and storage medium
US20240357278A1 (en) Operation control method of headset, ring headset and storage medium
CN112771828A (en) Audio data communication method and electronic equipment
WO2021233398A1 (en) Wireless audio system, wireless communication method, and device
CN108566221A (en) Call control method and relevant device
CN114501239B (en) Master-slave switching method and device of earphone, bluetooth earphone and storage medium
CN113115151B (en) Control method and device of wireless earphone, equipment and storage medium

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