WO2021254294A1 - 一种切换音频输出通道的方法、装置和电子设备 - Google Patents

一种切换音频输出通道的方法、装置和电子设备 Download PDF

Info

Publication number
WO2021254294A1
WO2021254294A1 PCT/CN2021/099913 CN2021099913W WO2021254294A1 WO 2021254294 A1 WO2021254294 A1 WO 2021254294A1 CN 2021099913 W CN2021099913 W CN 2021099913W WO 2021254294 A1 WO2021254294 A1 WO 2021254294A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
distance
external audio
audio device
parameter
Prior art date
Application number
PCT/CN2021/099913
Other languages
English (en)
French (fr)
Inventor
杨晓
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to US18/009,422 priority Critical patent/US20230224398A1/en
Priority to EP21825942.2A priority patent/EP4152736A4/en
Publication of WO2021254294A1 publication Critical patent/WO2021254294A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72409User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories
    • H04M1/72412User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories using two-way short-range wireless interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • H04M1/72454User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions according to context-related or environment-related conditions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/60Substation equipment, e.g. for use by subscribers including speech amplifiers
    • H04M1/6033Substation equipment, e.g. for use by subscribers including speech amplifiers for providing handsfree use or a loudspeaker mode in telephone sets
    • H04M1/6041Portable telephones adapted for handsfree use
    • H04M1/6058Portable telephones adapted for handsfree use involving the use of a headset accessory device connected to the portable telephone
    • H04M1/6066Portable telephones adapted for handsfree use involving the use of a headset accessory device connected to the portable telephone including a wireless connection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/60Substation equipment, e.g. for use by subscribers including speech amplifiers
    • H04M1/6033Substation equipment, e.g. for use by subscribers including speech amplifiers for providing handsfree use or a loudspeaker mode in telephone sets
    • H04M1/6041Portable telephones adapted for handsfree use
    • H04M1/6075Portable telephones adapted for handsfree use adapted for handsfree use in a vehicle
    • H04M1/6083Portable telephones adapted for handsfree use adapted for handsfree use in a vehicle by interfacing with the vehicle audio system
    • H04M1/6091Portable telephones adapted for handsfree use adapted for handsfree use in a vehicle by interfacing with the vehicle audio system including a wireless interface
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72484User interfaces specially adapted for cordless or mobile telephones wherein functions are triggered by incoming communication events
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72409User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories
    • H04M1/724098Interfacing with an on-board device of a vehicle
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72442User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality for playing music files
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72469User interfaces specially adapted for cordless or mobile telephones for operating the device by selecting functions from two or more displayed items, e.g. menus or icons
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M2250/00Details of telephonic subscriber devices
    • H04M2250/02Details of telephonic subscriber devices including a Bluetooth interface
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M2250/00Details of telephonic subscriber devices
    • H04M2250/12Details of telephonic subscriber devices including a sensor for measuring a physical value, e.g. temperature or motion

Definitions

  • the present invention relates to electrical communication technology, in particular to a method, device and electronic equipment for switching audio output channels.
  • electronic devices such as mobile phones and PDAs (Personal Digital Assistants) can be connected to external audio devices, such as portable Bluetooth headsets and car Bluetooth speakers.
  • external audio devices such as Bluetooth (Bluetooth) connection
  • Bluetooth Bluetooth
  • the electronic device and the external audio device are within the effective range of Bluetooth, and the audio output channel can be switched from the speaker or earpiece set on the main body of the electronic device to the external audio device, thereby Convenient for users to use.
  • an electronic device When an electronic device is connected to an external audio device, such as when a mobile phone is connected to a Bluetooth headset to input/output audio, sometimes the user does not wear the Bluetooth headset, and the connection between the mobile phone and the Bluetooth headset will not be disconnected. At this time, if the user carries the mobile phone away from the Bluetooth headset , But the distance does not exceed the effective distance between the two to maintain the Bluetooth connection, for example, when the user is about 8 meters away from the Bluetooth headset, the audio output channel of the mobile phone is still switched to the state of the Bluetooth headset.
  • the user needs to find the mobile phone or Bluetooth headset and perform manual switching operations, and then the user can answer the incoming call normally with the mobile phone.
  • the above situation will cause the user to hear no sound when answering the call with the mobile phone when the user forgets that his mobile phone is connected to the Bluetooth headset, and mistakenly believe that it is the problem of the call signal that the user cannot hear the other party's voice. This situation seriously affects the user experience.
  • the present application provides a method, a device, and an electronic device for switching audio output channels.
  • the method can automatically switch the audio output mode of the electronic device without manual operation by the user, thereby improving the user experience when using an external audio device.
  • the present application provides a method for switching audio output channels, which is used in an electronic device with a built-in earpiece and a first sensor, wherein the first sensor is arranged at a first position of the electronic device, and its feature
  • the method includes: when the electronic device is connected to an external audio device, and the audio output channel of the electronic device is the external audio device, the electronic device detects a first operation; and responds to the first operation.
  • the electronic device determines the first distance between it and the external audio device; the electronic device determines the second distance between the obstructed object and the first position according to the detection signal of the first sensor; and when When the first distance is greater than the first distance threshold and the second distance is less than the second distance threshold, the electronic device switches the audio output channel from the external audio device to the built-in earpiece of the electronic device.
  • the switching method provided by the present application can automatically switch audio output channels by determining that the user is greater than the first distance threshold from the external audio device and the first location near the built-in earpiece is less than the second distance threshold, so that the user can listen to audio through the earpiece.
  • the first position is near the built-in earpiece
  • the first sensor is a proximity light sensor. By approaching the light sensor, it is judged whether the user is far away or close to the built-in earpiece, thereby judging the user's willingness to use the earpiece to listen to audio.
  • the first operation is answering a call or playing a voice message.
  • the audio output channel can be automatically switched to enhance the user's experience of using electronic equipment.
  • the electronic device and the external audio device are connected via Bluetooth, and the electronic device determines that it is connected to the external audio device.
  • the first distance of the external audio device includes: determining the first distance according to a received signal strength indicator RSSI of a Bluetooth connection between the electronic device and the external audio device.
  • determining the first distance between the electronic device and the external audio device further includes: according to the RSSI of the Bluetooth connection, And a parameter of the external audio device to determine the first distance, wherein the parameter has a preset value.
  • the first distance is determined by the parameter with the preset value and the RSSI, a reliable result can be obtained, and there is no need to calibrate the parameter in advance.
  • the method further includes: when the Bluetooth connection is established between the electronic device and the external audio device, Calibrating the parameters of the external audio device; and storing the calibrated parameters in the electronic device.
  • the Bluetooth connection is established between the electronic device and the external audio device, Calibrating the parameters of the external audio device; and storing the calibrated parameters in the electronic device.
  • determining the first distance between the electronic device and the external audio device further includes: according to the RSSI of the Bluetooth connection, And the calibrated parameter to determine the first distance. With the calibrated parameter value matched with the external audio device, more accurate results can be obtained when determining the first distance.
  • the calibrated parameters include the signal strength parameter A when the electronic device and the external audio device are separated by 1 meter, and /Or the environmental attenuation factor parameter n of the external audio device.
  • the present application provides a device for switching audio output channels, which is used in an electronic device with a built-in earpiece and a first sensor, wherein the first sensor is arranged at a first position of the electronic device, and its feature
  • the switching device includes: a detection unit, and when the electronic device is connected to an external audio device, and the audio output channel of the electronic device is the external audio device, the first receiving unit is used to detect the electronic device A first operation on the device; a determining unit, in response to the first operation, the determining unit is configured to determine the first distance between the electronic device and the external audio device, and according to the detection signal of the first sensor Determining a second distance between the obstructed object and the first position; and a switching unit, when the first distance is greater than a first distance threshold and the second distance is less than a second distance threshold, the switching unit is configured to The audio output channel of the electronic device is switched from the external audio device to the built-in earpiece of the electronic device.
  • the switching device provided by the present application can automatically switch the audio output channel by determining that the user is greater than the first distance threshold from the external audio device and the first position near the built-in earpiece is less than the second distance threshold, so that the user can listen to audio through the earpiece.
  • the first operation is answering a call or playing voice information.
  • the audio output channel can be automatically switched to enhance the user's experience of using electronic equipment.
  • the electronic device and the external audio device are connected via Bluetooth, and the determining unit determines the The first distance includes: the determining unit determines the first distance according to the received signal strength indicator RSSI of the Bluetooth connection.
  • the determining unit determining the first distance further includes: the determining unit according to the RSSI of the Bluetooth connection, and the external connection
  • the first distance is determined by a parameter of the audio device, wherein the parameter has a preset value.
  • the first distance is determined by the parameter with the preset value and the RSSI, a reliable result can be obtained, and there is no need to calibrate the parameter in advance.
  • the switching device further includes: a calibration unit, when the Bluetooth connection is established between the electronic device and the external audio device , The calibration unit is used to calibrate the parameters of the external audio device; and the storage unit is used to store the calibrated parameters.
  • a calibration unit when the Bluetooth connection is established between the electronic device and the external audio device , The calibration unit is used to calibrate the parameters of the external audio device; and the storage unit is used to store the calibrated parameters.
  • the calibration value obtained through the calibration unit matches the external audio device and is stored in the storage unit, so that when determining whether to automatically switch the audio output channel Used to determine the first distance.
  • the determining unit determining the first distance further includes: the determining unit according to the RSSI of the Bluetooth connection, and the calibration The latter parameters are used to determine the first distance. With the calibrated parameter value matched with the external audio device, more accurate results can be obtained when determining the first distance.
  • the calibrated parameter includes the signal strength parameter A when the electronic device and the external audio device are separated by 1 meter, and/ Or the environmental attenuation factor parameter n of the external audio device.
  • the present application provides an electronic device, characterized in that the electronic device includes a touch sensor, when the electronic device is connected to an external audio device, and the audio output channel of the electronic device is the external
  • the touch sensor receives the first operation
  • the proximity light sensor is arranged near the built-in microphone of the electronic equipment
  • the processor in response to the first operation, determines that the electronic equipment and the external audio equipment Whether the first distance between the two is greater than the first distance threshold, and whether the second distance between the obstructed object and the built-in microphone is less than the second distance threshold is determined according to the detection result of the proximity light sensor, wherein, when the first distance When a distance is greater than the first distance threshold and the second distance is less than a second distance threshold, the processor switches the audio output channel from the external audio device to the built-in earpiece of the electronic device.
  • the electronic device provided by the present application can automatically switch audio output channels by determining that the user is greater than the first distance threshold from the external audio device and the first location near the built-in earpiece is less than the second distance threshold, so that the user can listen to audio through the earpiece.
  • the electronic device further includes: a communication module configured to establish a Bluetooth connection with the external audio device, wherein the processor is further configured to determine The received signal strength of the Bluetooth connection indicates RSSI.
  • the processor is further configured to calibrate the parameters of the external audio device, and the electronic device further includes: a memory, For storing the calibrated parameters of the external audio device, the processor is further configured to calculate the first distance according to the RSSI of the Bluetooth connection and the calibrated parameters. With the calibrated parameter value matched with the external audio device, more accurate results can be obtained when determining the first distance.
  • the present application provides a computer-readable storage medium, including instructions, characterized in that, when the instructions run on an electronic device, the electronic device is caused to execute the method described in any of the above implementations. .
  • FIG. 1 is a schematic structural diagram of an electronic device provided by an embodiment of this application.
  • FIG. 2 is a block diagram of the software structure of an electronic device provided by an embodiment of the application.
  • FIG. 3 is a schematic diagram of an electronic device connected to an external audio device according to an embodiment of the application
  • FIG. 4 is a schematic diagram of a scene for switching audio output channels provided by an embodiment of the application.
  • FIG. 5 is a schematic diagram of a scene for switching audio output channels according to an embodiment of the application.
  • FIG. 6 is a schematic flowchart of a method for switching audio output channels provided by an embodiment of the application.
  • FIG. 7 is a schematic diagram of a solution for enabling switching of audio output channels according to an embodiment of the application.
  • FIG. 8 is a schematic diagram of a solution for enabling switching of audio output channels according to an embodiment of the application.
  • FIG. 9 is a schematic flowchart of a method for switching audio output channels according to an embodiment of the application.
  • FIG. 10 is a schematic structural diagram of an audio output switching device provided by an embodiment of the application.
  • first and second in the embodiments of the present application are used to distinguish different messages, devices, modules, applications, etc., and do not represent a sequence, nor do they limit the "first” And “second” is a different type.
  • the descriptions of “first” and “second” also do not limit the number.
  • the "first application” can be one “first application” or multiple “first applications”.
  • a and/or B in the embodiments of the present application is merely an association relationship describing associated objects, which means that there can be three types of relationships, for example, A alone, A and B exist at the same time, and B alone exists. condition.
  • the character “/” in the embodiment of the present application generally indicates that the associated objects before and after are in an “or” relationship.
  • FIG. 1 shows a schematic diagram of the structure of an electronic device 100.
  • the electronic device 100 such as a smart terminal, may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, and a battery 142, Antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone interface 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, A display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
  • SIM subscriber identification module
  • the sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light Sensor 180L, bone conduction sensor 180M, etc.
  • the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100.
  • the electronic device 100 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components.
  • the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU), etc.
  • AP application processor
  • modem processor modem processor
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller video codec
  • digital signal processor digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the different processing units may be independent devices or integrated in one or more processors.
  • the controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 to store instructions and data.
  • the memory in the processor 110 is a cache memory.
  • the memory can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
  • the processor 110 may include one or more interfaces.
  • the interface can include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, and a universal asynchronous transmitter (universal asynchronous transmitter) interface.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB Universal Serial Bus
  • the I2C interface is a bidirectional synchronous serial bus, which includes a serial data line (SDA) and a serial clock line (SCL).
  • the processor 110 may include multiple sets of I2C buses.
  • the processor 110 may couple the touch sensor 180K, charger, flash, camera 193, etc., respectively through different I2C bus interfaces.
  • the processor 110 may couple the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface to implement the touch function of the electronic device 100.
  • the I2S interface can be used for audio communication.
  • the PCM interface can also be used for audio communication to sample, quantize and encode analog signals.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the MIPI interface can be used to connect the processor 110 with the display screen 194, the camera 193 and other peripheral devices.
  • the MIPI interface includes camera serial interface (camera serial interface, CSI), display serial interface (display serial interface, DSI), etc.
  • the processor 110 and the camera 193 communicate through a CSI interface to implement the shooting function of the electronic device 100.
  • the processor 110 and the display screen 194 communicate through a DSI interface to realize the display function of the electronic device 100.
  • the GPIO interface can be configured through software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface can be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and so on.
  • the GPIO interface can also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the USB interface 130 is an interface that complies with the USB standard specification, and specifically may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and so on. It can be understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely a schematic description, and does not constitute a structural limitation of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
  • the charging management module 140 is used to receive charging input from the charger.
  • the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
  • the wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
  • the antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna can be used in combination with a tuning switch.
  • the mobile communication module 150 may provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the electronic device 100.
  • the mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like.
  • the mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform processing such as filtering, amplifying and transmitting the received electromagnetic waves to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic waves through the antenna 1 and radiate it out.
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110.
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be provided in the same device.
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal.
  • the demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low-frequency baseband signal is processed by the baseband processor and then passed to the application processor.
  • the application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays an image or video through the display screen 194.
  • the modem processor may be an independent device.
  • the modem processor may be independent of the processor 110 and be provided in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellites.
  • WLAN wireless local area networks
  • BT wireless fidelity
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication technology
  • infrared technology infrared, IR
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110.
  • the wireless communication module 160 may also receive a signal to be sent from the processor 110, perform frequency modulation, amplify it, and convert it into electromagnetic waves to radiate through the antenna 2.
  • the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time-division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc.
  • the GNSS may include the global positioning system (GPS), the global navigation satellite system (GLONASS), the Beidou navigation satellite system (BDS), and the quasi-zenith satellite system (quasi). -zenith satellite system, QZSS) and/or satellite-based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite-based augmentation systems
  • the electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like.
  • the GPU is a microprocessor for image processing, connected to the display 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations and is used for graphics rendering.
  • the processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos, and the like.
  • the display screen 194 includes a display panel.
  • the display panel can adopt liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • active-matrix organic light-emitting diode active-matrix organic light-emitting diode
  • AMOLED flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc.
  • the electronic device 100 may include one or N display screens 194, and N is a positive integer greater than one.
  • the electronic device 100 can realize a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
  • the ISP is used to process the data fed back from the camera 193.
  • the camera 193 is used to capture still images or videos.
  • the object generates an optical image through the lens and is projected to the photosensitive element.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
  • Video codecs are used to compress or decompress digital video.
  • the electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
  • MPEG moving picture experts group
  • MPEG2 MPEG2, MPEG3, MPEG4, and so on.
  • NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • the external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save music, video and other files in an external memory card.
  • the internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions.
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, at least one application program (such as a sound playback function, an image playback function, etc.) required by at least one function.
  • the data storage area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 100.
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
  • the internal memory is also used to store the translation application and cache all pictures generated during the running of the translation application, and all the pictures cached can be automatically deleted after the user exits the translation application.
  • the electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. For example, music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal.
  • the audio module 170 can also be used to encode and decode audio signals.
  • the audio module 170 may be provided in the processor 110, or part of the functional modules of the audio module 170 may be provided in the processor 110.
  • the speaker 170A also called “speaker” is used to convert audio electrical signals into sound signals.
  • the electronic device 100 can listen to music through the speaker 170A, or listen to a hands-free call.
  • the receiver 170B also called a "handset" is used to convert audio electrical signals into sound signals.
  • the electronic device 100 answers a call or voice message, it can receive the voice by bringing the receiver 170B close to the human ear.
  • the microphone 170C also called “microphone”, “microphone”, is used to convert sound signals into electrical signals.
  • the earphone interface 170D is used to connect wired earphones.
  • the earphone interface 170D may be a USB interface 130, or a 3.5mm open mobile terminal platform (open mobile terminal platform, OMTP) standard interface, and a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA
  • the pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal.
  • the pressure sensor 180A may be provided on the display screen 194.
  • the capacitive pressure sensor may include at least two parallel plates with conductive materials.
  • the electronic device 100 determines the intensity of the pressure according to the change in capacitance.
  • the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A.
  • the electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A.
  • touch operations that act on the same touch position but have different touch operation intensities can correspond to different operation instructions. For example: when a touch operation whose intensity is less than the first pressure threshold is applied to the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
  • the gyro sensor 180B may be used to determine the movement posture of the electronic device 100.
  • the air pressure sensor 180C is used to measure air pressure.
  • the electronic device 100 calculates the altitude based on the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
  • the magnetic sensor 180D includes a Hall sensor.
  • the acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes).
  • Distance sensor 180F used to measure distance.
  • the electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 may use the distance sensor 180F to measure the distance to achieve fast focusing.
  • the proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector such as a photodiode.
  • the ambient light sensor 180L is used to sense the brightness of the ambient light.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photographs, fingerprint answering calls, and so on.
  • the temperature sensor 180J is used to detect temperature.
  • Touch sensor 180K also called “touch device”.
  • the touch sensor 180K may be provided on the display screen 194, and the touch screen is composed of the touch sensor 180K and the display screen 194, which is also called a “touch screen”.
  • the touch sensor 180K is used to detect touch operations acting on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • the display screen 194 may provide visual output related to touch operations.
  • the touch sensor 180K may also be disposed on the surface of the electronic device 100, which is different from the position of the display screen 194.
  • the bone conduction sensor 180M can acquire vibration signals.
  • the button 190 includes a power-on button, a volume button, and so on.
  • the button 190 may be a mechanical button. It can also be a touch button.
  • the electronic device 100 may receive key input, and generate key signal input related to user settings and function control of the electronic device 100.
  • the motor 191 can generate vibration prompts.
  • the indicator 192 may be an indicator light, which may be used to indicate the charging status, power change, or to indicate messages, missed calls, notifications, and so on.
  • the SIM card interface 195 is used to connect to the SIM card.
  • the SIM card can be inserted into the SIM card interface 195 or pulled out from the SIM card interface 195 to achieve contact and separation with the electronic device 100.
  • the electronic device 100 may support 1 or N SIM card interfaces, and N is a positive integer greater than 1.
  • the SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc.
  • the same SIM card interface 195 can insert multiple cards at the same time. The types of the multiple cards can be the same or different.
  • the SIM card interface 195 can also be compatible with different types of SIM cards.
  • the SIM card interface 195 can also be compatible with external memory cards.
  • the electronic device 100 interacts with the network through the SIM card to implement functions such as call and data communication.
  • the electronic device 100 adopts an eSIM, that is, an embedded SIM card.
  • the eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
  • the touch sensor 180K of the electronic device 100 detects a trigger event acting on or near it, such as detecting The user answers the call or clicks on the voice message.
  • the processor 110 determines whether the distance between the electronic device 100 and the external audio device is greater than the first distance threshold, and determines whether there is an obstruction relative to the electronic device 100 through the proximity light sensor 180G From the far-to-close state, for example, the proximity light sensor 180G is used to determine whether the distance between the obstruction and the receiver 170B, that is, the earpiece, is greater than the second distance threshold.
  • the processor 110 determines whether the distance between the electronic device 100 and the external audio device is greater than the first distance threshold, uses the received signal strength determined by the wireless communication module 160 to indicate RSSI, for example, the Bluetooth signal RSSI of the external audio device. Calculate the distance between the electronic device 100 and the external audio device.
  • the audio module 170 switches the audio output channel to the electronic The receiver 170B of the device 100 is on the receiver.
  • the processor 110 may also use the ambient light sensor 180L to determine whether there is an obstructing object from far to close relative to the electronic device 100, for example, the ambient light sensor 180L determines the light sensor at the receiver 170B. quantity.
  • the processor 110 determines that the distance between the electronic device 100 and the external audio device is greater than the first distance threshold, and determines that the light sensitivity at the receiver 170B is less than the light sensitivity threshold, the audio module 170 switches the audio output channel to On the earpiece of the electronic device 100.
  • the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiment of the present invention takes an Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100 by way of example.
  • FIG. 2 is a software structure block diagram of the electronic device 100 shown in FIG. 1 according to an embodiment of the present invention.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Communication between layers through software interface.
  • the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
  • the application layer can include a series of application packages.
  • the application package can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, and a notification manager.
  • the window manager is used to manage window programs.
  • the window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, take a screenshot, etc.
  • the content provider is used to store and retrieve data and make these data accessible to applications.
  • the data may include video, image, audio, phone calls made and received, browsing history and bookmarks, phone book, etc.
  • the view system includes visual controls, such as controls that display text, controls that display pictures, and so on.
  • the view system can be used to build applications.
  • the display interface can be composed of one or more views.
  • a display interface that includes a short message notification icon may include a view that displays text and a view that displays pictures.
  • the phone manager is used to provide the communication function of the electronic device 100. For example, the management of the call status (including connecting, hanging up, etc.).
  • the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
  • the notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and it can automatically disappear after a short stay without user interaction.
  • the notification manager is used to notify that the download is complete, message reminders, and so on.
  • the notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or a scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window.
  • prompt text information in the status bar sound a prompt sound, electronic device vibration, flashing indicator light, etc.
  • Android Runtime (ie Android Runtime) includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.
  • the core library consists of two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android.
  • the application layer and the application framework layer run in a virtual machine.
  • the virtual machine executes the java files of the application layer and the application framework layer as binary files.
  • the virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
  • the system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), three-dimensional graphics processing library (for example: OpenGL ES), two-dimensional graphics engine (for example: SGL), etc.
  • the surface manager is used to manage the display subsystem and provides a combination of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to realize 3D graphics drawing, image rendering, synthesis, and layer processing.
  • the two-dimensional graphics engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
  • the corresponding hardware interrupt is sent to the kernel layer.
  • the kernel layer processes the touch operation into the original input event (including touch coordinates, time stamp of the touch operation, etc.).
  • the original input events are stored in the kernel layer.
  • the application framework layer obtains the original input event from the kernel layer and identifies the control corresponding to the input event. Taking the touch operation as a touch click operation, and the control corresponding to the click operation is the control of the camera application icon as an example, the camera application calls the interface of the application framework layer to start the camera application, and then starts the camera driver by calling the kernel layer.
  • the camera 193 shown in FIG. 1 captures still images or video.
  • the aforementioned display may be displayed on a display screen, which has a display function, and the display screen may or may not have a touch function.
  • the operation on the touch screen can be realized by virtual keys, and can be realized by clicking on the touch screen.
  • the operation on the non-touch screen can be realized by physical buttons.
  • FIG. 3 is a schematic diagram of an electronic device connected to an external audio device according to an embodiment of the application.
  • the electronic device may be the above-mentioned electronic device 100.
  • a mobile phone 301 is taken as an example as an embodiment of the electronic device 100.
  • Fig. 3a shows that the mobile phone 301 is connected with a wearable device, a neckband earphone 302, for example via Bluetooth.
  • FIG. 3b shows that the mobile phone 301 is connected to a true wireless stereo (TWS) headset 303, for example, connected via Bluetooth.
  • FIG. 3c shows that the mobile phone 301 is connected to the car Bluetooth speaker 305 on the vehicle 304, for example, connected via Bluetooth.
  • TWS true wireless stereo
  • the audio output channel can be switched from the speaker or earpiece (not shown in the figure) on the mobile phone to that of the external audio device, so that the user wears a neck-mounted headset 302 or TWS headset 303 to listen to the audio output from the mobile phone 301 and input audio to the mobile phone 301, or the user can listen to the music played by the mobile phone 301 from the car Bluetooth speaker 305 while driving.
  • the electronic device provided in this application can realize automatic switching of audio output devices.
  • FIG. 4 shows a schematic diagram of a scene of switching audio output devices.
  • the user is outside the car, for example, about 3 meters away from the vehicle 304. At this time, there is an incoming call on the mobile phone 301, and the user clicks the answer button 501, and puts the mobile phone 301 to his ear to answer the call, as shown in Figure 4 and Figure 5a Show.
  • the mobile phone 301 determines that it is currently connected to the car Bluetooth speaker 305 via Bluetooth, and determines that the distance between the mobile phone 301 and the car Bluetooth speaker 305 at this time has exceeded the first distance threshold, where the first distance threshold It can be set to 1 to 5 meters, such as 1 meter, 2 meters, 5 meters, and so on.
  • the first distance threshold It can be set to 1 to 5 meters, such as 1 meter, 2 meters, 5 meters, and so on.
  • the mobile phone 301 can use the sensor to determine the state of the user close to the mobile phone 301.
  • the audio output channel of the mobile phone 301 is switched to On the handset of the mobile phone 301.
  • the mobile phone 301 and the car Bluetooth speaker 305 are still within the effective connection range, so the audio of the mobile phone 301
  • the output channel is the car bluetooth speaker 305; when the user clicks the answer button 501 and before the user puts the mobile phone 301 to the ear, the incoming call audio will still be output to the car bluetooth speaker 305; when the user puts the mobile phone 301 After reaching the ear, the mobile phone 301 judges that the user is very close to the mobile phone 301 through the sensor, and then switches the audio output channel from the car Bluetooth speaker 305 to the earpiece.
  • the audio output channel of the mobile phone 301 is the car Bluetooth speaker 305
  • the incoming call audio may not be output to the car bluetooth speaker 305, but when the mobile phone 301 determines through the sensor that the user is gradually getting closer to the mobile phone 301, after switching the audio output channel from the car bluetooth speaker 305 to the earpiece, The audio of the incoming call is output on the earpiece.
  • the types of sensors provided on the mobile phone 301 include but are not limited to proximity light sensors, light sensors, and temperature sensors. Any one of the above types of sensors can be set near the earpiece of the mobile phone 301, or any combination of multiple types of sensors can be set.
  • the basic working principle of the proximity light sensor is that the light emitted by the proximity light sensor is reflected by a certain distance in front of the proximity light sensor (such as a human face), and then received by the proximity light sensor, and the light loss is determined according to the received light. Size and determine the distance between the obstructing object and the proximity light sensor based on this.
  • the light sensor can convert the received light intensity into an electrical signal.
  • the temperature sensor can convert the detected temperature into an electrical signal.
  • the proximity light sensor is taken as an example for description, where the proximity light sensor is disposed at a first position of the mobile phone 301, and the first position is near the earpiece of the mobile phone 301.
  • the second distance between the obstruction and the proximity light sensor can be determined, so as to determine whether the second distance is less than the second distance threshold; and when the user is far away from the mobile phone
  • the third distance between the obstruction and the proximity light sensor can be determined, so as to determine whether the third distance is greater than the second distance threshold.
  • the mobile phone 301 can By judging the user's willingness to use the handset of the mobile phone 301 to answer the incoming call, the audio output channel is automatically switched to the handset of the mobile phone 301.
  • the headset logo 502 and the Bluetooth logo 503 are shown. It should be understood that these two logos are merely exemplary and cannot be used as limitations to the present invention.
  • the Bluetooth logo 503 and the vehicle logo may appear on the status bar of the mobile phone 301, or only the Bluetooth logo 503 may appear, and may not appear related to the Bluetooth connection or headset , Any signs related to the vehicle.
  • the user wants to view the unread voice message 504 in an application through the mobile phone 301, as shown in FIG. 5b.
  • the mobile phone 301 determines that it is currently connected to the car Bluetooth speaker 305 via Bluetooth, and determines that the distance between the mobile phone 301 and the car Bluetooth speaker 305 at this time has exceeded the first distance threshold.
  • the mobile phone 301 further determines that the approach light is far to close, that is, the obstructed object (ie, the user) is in a state of being far away to close relative to the mobile phone 301, and the obstruction The distance between the object and the mobile phone 301 is less than the second distance threshold. Therefore, the user's willingness to listen to the voice message 504 through the mobile phone 301 is determined, and the audio output channel of the mobile phone 301 is switched to the earpiece of the mobile phone 301.
  • the mobile phone 301 after the user carries the mobile phone 301 away from the external audio device for a certain distance, even if the mobile phone 301 is still connected to the external audio device via Bluetooth, through the automatic switching process of the audio output channel described above, the mobile phone 301 The audio output channel can be switched back to the earpiece on the mobile phone 301 for the user to use the mobile phone 301 to answer incoming calls and listen to voice messages.
  • the mobile phone 301 and the car Bluetooth speaker 305 are still within the effective connection range, so the audio output of the mobile phone 301
  • the channel is the car bluetooth speaker 305; when the user clicks on the voice message 504 and before the user puts the mobile phone 301 to the ear, the voice message played at this time will still be output to the car bluetooth speaker 305; when the user puts the mobile phone 301 in the ear Later, the mobile phone 301 judges that the user is very close to the mobile phone 301 through the sensor, and then switches the audio output channel from the car Bluetooth speaker 305 to the earpiece.
  • the Bluetooth connection between the mobile phone 301 and the aforementioned external audio device is correspondingly disconnected.
  • the Bluetooth connection between the mobile phone 301 and the aforementioned external audio device can be reconnected accordingly. For example, when the user answers the call, removes the mobile phone 301 from the ear and returns to the vehicle 304, the mobile phone 301 judges that its approach light is close to far away, that is, the obstructing object (ie, the user) is relative to the mobile phone 301.
  • the mobile phone 301 From close to far away, and the distance between the obstructed object and the mobile phone 301 is greater than the second distance threshold, and the mobile phone 301 further determines that the distance from the car Bluetooth speaker 305 is less than the third distance threshold, where the third distance threshold is, for example, 1 meter . Therefore, it is determined that the user has returned to the environment where the external audio device was previously connected, so that the audio output channel of the mobile phone 301 is switched to the car Bluetooth speaker 305.
  • the previous device connection state can be continued, which further improves the experience of automatically switching the audio output channel.
  • FIG. 6 shows a schematic flowchart of the above-mentioned method 600 for switching audio output channels.
  • step 603 is entered.
  • Step 603 includes steps 605-611, where:
  • the electronic device 301 determines whether the distance between it and the external audio device is greater than the first distance threshold L1, and if the result of the determination is "Yes", then step 607 is entered. If the result of the judgment is "No", go to step 611, and the external audio device outputs the aforementioned audio. For example, when the mobile phone 301 determines that the distance from the external audio device is greater than the first distance threshold, it means that the user may not use the external audio device to answer the call, and therefore, it will further determine the user's intention to answer the call with the mobile phone.
  • the electronic device 301 further determines whether its approaching light is in a state from far away to approaching. If the result of the determination is "Yes”, then go to step 609, and if the result of the judgment is "No", then go to step 611.
  • judging that the proximity light is in the state from far away to approaching is obtained from the detection result of the proximity light sensor on the electronic device 301, wherein the proximity light sensor is arranged at the first position of the electronic device, The first position is near the earpiece of the electronic device 301.
  • the proximity light sensor is arranged at the first position of the electronic device, The first position is near the earpiece of the electronic device 301.
  • the proximity light is moving from far away to approaching; and when the user ends the call, when the mobile phone is moved away from the ear, according to the detection result of the proximity light sensor, the user’s ear can be determined.
  • the distance between the mobile phone 301 and the earpiece of the mobile phone 301 is greater than the second distance threshold, it is considered that the approach light is in a state of moving from close to far away.
  • step 605 and step 607 can be to execute 607 first and then execute 605, or to put 605 and 607 in the same step, for example, step: judging that the distance to the external audio device is greater than the first distance threshold and When the approach light changes from far away to close, if the result of the judgment is yes, then go to step 609, and if the result of the judgment is no, then go to step 611.
  • the earpiece of the electronic device 301 outputs audio
  • the external audio device outputs the above audio.
  • FIG. 7 is a schematic diagram of a scenario in which a solution for switching audio output channels is enabled according to an embodiment of the application.
  • Figures 7a and 7b show that the interface of the mobile phone 301 corresponds to the incoming call answering scene of Figure 5a and the voice message listening scene of Figure 5b, respectively.
  • FIG. 4 is still taken as an example for description.
  • the vehicle 304 is not turned off, and the mobile phone 301 and the car Bluetooth speaker 305 are still connected.
  • the interface shown in FIG. 7a appears on the mobile phone 301, that is, the incoming call is answered and a window 701 is displayed on the screen.
  • the window 701 is used to ask the user whether to enable the "smart switch" provided by the mobile phone 301, and the "smart switch” may be the method 600 for switching audio output channels shown in FIG.
  • click the enable button 702 click the enable button 702 and the mobile phone 301 switches the audio output channel of the mobile phone 301 to the handset of the mobile phone 301 according to the above-mentioned method 600 for switching audio output channels, or remains in the car Bluetooth speaker 305 on.
  • the user is not allowed to enable "smart switching", that is, click the prohibit button 703
  • the audio of the mobile phone 301 is still output to the car Bluetooth speaker 305 of the vehicle 304.
  • the user can also click the details button 704 to view the detailed introduction of the "smart switch". As shown in FIG. 7b, after the user clicks the details button 704, a window 705 is further displayed on the mobile phone 301 for the user to read the detailed introduction of "smart switching".
  • FIG. 7b is similar to the embodiment shown in FIG. 7a, except that the window 701 in FIG. 7b pops up in response to the user clicking on the voice message 504 shown in FIG.
  • the message interface 706 can be semi-transparent. At this time, the buttons 702 and 703 on the window 701 have priority over any buttons in the same position on the voice message interface 706. Other aspects of the embodiment shown in FIG. 7b will not be repeated here.
  • Figure 7 shows a scenario where a user answers incoming calls and listens to voice messages. It should be understood that the embodiments of this application can also be applied to scenarios where users answer voice calls and video calls in various applications, or are applied to users More scenarios for audio playback using electronic devices. For example, when an electronic device is connected to an external audio device, when the user plays any form of audio on the electronic device or answers any form of call, if the electronic device determines that the distance from the external audio device is greater than the first distance threshold,
  • the detailed content of "smart switching" may be:
  • the user can also calibrate the signal strength of the currently connected external audio device to more accurately calculate the distance between the mobile phone 301 and the external audio device.
  • the signal strength calibration can be performed after the user clicks to view the details of "Smart Switching" and then operates according to the prompts, or when the external audio device is connected to the mobile phone 301, or when the external audio device is connected to the mobile phone. After 301 is on, the user will proceed in the system settings.
  • FIG. 8 is a schematic diagram of a solution for enabling switching of audio output channels according to an embodiment of the application.
  • the user when the external audio device is connected to the mobile phone 301, the user can operate according to the prompts to perform signal strength calibration on the external audio device.
  • the user is connecting the mobile phone 301 to the neckband earphone 302, the TWS earphone 303, or the car Bluetooth speaker 305.
  • a window 801 pops up on the screen of the mobile phone 301 to ask the user whether to enable the aforementioned "smart switching" for the currently connected device E
  • the user can click the enable button 802 or the prohibit button 803, or select the query later button 804, which may be, for example, "Ask me again during a call” or the like.
  • the user can also click the details button 805 to learn the details of the "smart switching" solution. It should be understood that "Ask me again during a call” is only exemplary. Since the above-mentioned "smart switching" solution can be applied to scenarios such as the user answering calls and listening to voice messages, in this embodiment, the ask button later
  • the example of 804 cannot be used as a limitation to the present invention.
  • the window 801 is in the form of a floating window appearing on the display interface 806, however, the floating window is not a limitation to the present application.
  • a window 807 pops up on the mobile phone 301 to ask the user whether to calibrate the parameters of the currently connected device E, so as to better use the above-mentioned "smart switching" solution.
  • the mobile phone 301 will determine its current distance to the device E. When the distance is greater than the first distance threshold and the approach light is in the state of moving from farther to nearer, you need to correct The audio output channel is switched. What the window 807 prompts is to calibrate the parameters of the device E, so as to better calculate the above-mentioned distance.
  • the window 807 is in the form of a floating window appearing on the display interface 806.
  • the floating window is not a limitation of the present application.
  • the user can click 808 "Yes” or 809 “No", or click the details button 810 to view the detailed introduction of the calibration, such as the time required for calibration and so on.
  • the detailed introduction of the calibration is not shown in the figure, and it should be understood that the details of the calibration should not be used as a limitation to the present invention.
  • the mobile phone 301 performs parameter calibration on the device E.
  • the mobile phone 301 saves the calibration information (for example, the calibration value of parameter A) corresponding to the device E, and uses the calibration information to accurately calculate the transmitter (mobile phone 301) and the receiver each time the device E is connected (Equipment E) The actual distance.
  • the calibration value of the parameter n of the device E can also be obtained, where the parameter n is an environmental attenuation factor.
  • the mobile phone 301 saves the calibration value of the parameter n corresponding to the device E. In this way, when the mobile phone 301 is connected to the device E, it will use the stored calibration information of the parameter A and the parameter n related to the device E to accurately Calculate the actual distance between the transmitter (mobile phone 301) and the receiver (device E).
  • the mobile phone 301 uses the following formula to calculate the distance between the mobile phone 301 and the device E:
  • d is the actual distance between the mobile phone 301 and the device E to be calculated, in meters (m);
  • RSSI is the received signal strength indicator (Received Signal Strength Indicator), abs (RSSI) is the absolute value of RSSI, which is used to indicate the quality of the connection between two devices, where RSSI is a negative value, and the unit is decibel milliwatt (dBm) ), RSSI can be obtained through any related calculations or existing program interfaces;
  • A is the parameter A of device E, that is, the signal strength when the transmitting end (mobile phone 301) and the receiving end (device E) are separated by 1 meter;
  • n is the parameter n of equipment E, that is, the environmental attenuation factor of equipment E;
  • the parameter A and the parameter n can be the above-mentioned parameter A and the parameter n obtained after calibration, or the empirical value of the parameter A and the parameter n.
  • the "smart switching" solution provided by this application can use the empirical values of parameter A and parameter n to calculate the aforementioned mobile phone The actual distance d between 301 and device E.
  • the parameter A and the parameter n can use empirical values, for example, using the protocol supported by the external audio device. The empirical value of the matched parameter A and parameter n.
  • the mobile phone 301 when the mobile phone 301 is connected to different external audio equipment, it can be calibrated according to the actual state of the connected equipment to obtain more reasonable parameter values, such as parameter A and parameter n, and then The calibrated parameter values are stored together with the corresponding device information. When the mobile phone 301 is connected to these external audio devices, the corresponding parameters can be obtained and used to calculate the aforementioned distance d.
  • FIG. 9 is a schematic flowchart of a method for switching audio output channels according to an embodiment of the application.
  • the method 900 for switching audio output channels shown in FIG. 9A corresponds to the embodiment shown in FIG. 7, and the method 910 for switching audio output channels shown in FIG. 9b corresponds to the embodiment shown in FIG. 8.
  • the method 900 for switching audio output channels is used to ask the user whether to enable the aforementioned "smart switching" solution after a trigger event is detected on the electronic device, specifically:
  • the electronic device is connected to an external audio device.
  • the mobile phone 301 is connected to the car Bluetooth speaker 305 via Bluetooth.
  • a pop-up window appears on the electronic device 301, such as the pop-up windows 701 and 705 shown in FIG. 7a or 7b, through which the user is asked about the current situation Whether to open the "smart switch" program. If the user clicks the enable button 702, then step 603 shown in FIG. 6 is entered; if the user clicks the prohibit button 703, then step 907 is entered.
  • the external audio device is still used to output audio.
  • the mobile phone 301 before the user clicks the answer button 501 or clicks the voice message 504, the mobile phone 301 is still connected to the external audio device, that is, the audio output channel of the mobile phone 301 is the external audio device; when the user clicks to answer After the key 501 or the voice message 504 is clicked, and before the user clicks the enable button 702 to start the "smart switching" solution, the incoming call or the voice message played at this time will still be output to the external audio device; when the user clicks the enable button After 702, the mobile phone 301 switches the audio output channel from the external audio device to the earpiece.
  • the process may be very fast, and the call is connected at this time.
  • the incoming call or the played voice message may not be output to the external audio device, but after the user clicks the enable button 702, the mobile phone 301 immediately switches the audio output channel from the external audio device to the earpiece.
  • the method 910 for switching audio output channels is used to immediately ask the user whether to enable the aforementioned "smart switching" solution after the electronic device is connected to the external audio device, where the same reference numerals represent the same steps. specifically:
  • the electronic device is connected to an external audio device.
  • the mobile phone 301 is connected to the car Bluetooth speaker 305 via Bluetooth.
  • a pop-up window appears on the electronic device 301, such as the pop-up window 801 shown in FIG. 8a, through which the user is asked whether the "smart switching" solution is currently enabled. If the user clicks the enable key 802, step 909 is entered; if the user clicks the prohibit key 803, step 907 is entered.
  • the external audio device is still used to output audio.
  • the electronic device 301 calibrates the parameters of the external audio device to more accurately execute the above-mentioned "smart switching" solution.
  • a pop-up window may appear on the electronic device 301, such as the pop-up window 807 shown in FIG. 8b, through which the user is asked whether he agrees to calibrate the parameters of the external audio device.
  • the device calibrates the parameters of the external audio device and stores the calibrated parameters and the information of the external audio device. Then enter the method 600 for switching audio output channels shown in FIG. 6.
  • the method 600 for switching audio output channels shown in FIG. 6 is executed.
  • the calibrated parameters are used to calculate the distance between the electronic device and the external audio device, and it is determined whether the calculated distance is greater than the first distance threshold (step 605).
  • the calibrated parameter may be the parameter A and/or the parameter n of the external audio device. The calibrated parameter has been described in detail in the foregoing embodiment, so it will not be repeated here.
  • step 909 can be omitted, that is, the electronic device does not calibrate the parameters of the external audio device.
  • the method 600 for switching audio output channels shown in FIG. Value is used to calculate the distance between the electronic device and the external audio device, and determine whether the calculated distance is greater than the first distance threshold (step 605).
  • FIG. 10 is a schematic structural diagram of a device 1000 for switching audio output channels according to an embodiment of the application.
  • the apparatus 1000 includes:
  • the first determining unit 1001 is used to determine whether to enable "smart switching" through user feedback when the electronic device is connected to an external audio device, and/or determine whether to enable "smart switching" after a trigger event occurs.
  • the first determining unit 1001 is also used to determine whether to calibrate the parameters of the external audio device through the user's feedback after the user turns on the "smart switching", so as to more accurately execute the "smart switching" solution.
  • the first determining unit 1001 may present the aforementioned prompt information to the user in the form of a pop-up window, such as the window 701 and/or the window 705 shown in FIG. 7, and also the window 801 and/or the window 807 shown in FIG. 8.
  • the calibration unit 1003 when the first determining unit 1001 determines to calibrate the parameters of the external audio device, or when a connection is established between the electronic device and the external audio device, the calibration unit 1003 performs the calibration on the parameters of the external audio device calibration. Specifically, the calibration unit 1003 can calibrate the parameter A and/or the parameter n of the external audio device.
  • the storage unit 1004 is used to store the calibrated parameters of the calibration unit 1003, so that the electronic device can use the calibrated parameters corresponding to the external audio device during "smart switching".
  • the first determining unit 1001 is not necessary, and the electronic device 100 can directly activate the "smart switching" solution in response to a trigger event.
  • the calibration unit 1003 is not necessary.
  • the electronic device 100 uses the parameter A and the parameter n, the empirical value can be used instead of the calibrated parameter value. That is to say, the parameter A and parameter n may have preset values, respectively.
  • the detection unit 1005 when the electronic device is connected to an external audio device, is used to detect a trigger event, such as detecting a user's first operation, including detecting that the user connects to an incoming call or detects that the user plays a voice message.
  • a trigger event such as detecting a user's first operation, including detecting that the user connects to an incoming call or detects that the user plays a voice message.
  • the electronic device connects to the call or outputs audio. For example, in response to the user connecting the incoming call (for example, clicking the accept button 501), or clicking the voice message (for example, clicking the voice message 504), the electronic device connects the incoming call, or outputs audio corresponding to the voice message.
  • the electronic device has a sensor, such as a proximity light sensor, which is arranged at a first position on the electronic device and generates a corresponding detection signal.
  • the detection signal generated can indicate the distance between the obstructed object and the first position. For example, when the user puts the electronic device close to the face, the detection signal indicates that the distance between the obstructed object and the first position is less than the second distance threshold, and the approach light is in a state of moving away from the face to close, and when the user moves the electronic device away from the face
  • the detection signal indicates that the distance between the obstructed object and the first position is greater than the second distance threshold, and the approach light is in a state from close to far away.
  • the apparatus 1000 further includes:
  • the receiving unit 1007 is configured to receive the detection signal of the first sensor, such as the proximity light sensor, and the received signal strength indicator RSSI of the connection between the electronic device and the external audio device.
  • the electronic device and the external audio device may be wirelessly connected
  • the signal strength of the wireless connection indicates that the RSSI is the RSSI of the Bluetooth signal.
  • the second determining unit 1009 is configured to determine the first distance between the electronic device and the external audio device, and determine the second distance between the obstructed object and the first position on the electronic device according to the detection signal of the first sensor. Specifically, the determining unit 1009 may use the above-mentioned RSSI and the parameter A and/or parameter n of the external audio device after calibration by the calibration unit 1003 to determine the first distance, or may use the above-mentioned RSSI and the preset parameters A and/ Or the empirical value of parameter n to determine the first distance, and the second determining unit 1009 further determines whether the first distance is greater than the first distance threshold and whether the second distance is less than the second distance threshold. The detailed description will not be repeated here.
  • the switching unit 1015 when the first distance between the electronic device and the external audio device is greater than the first distance threshold, and the second distance is less than the second distance threshold, the switching unit 1015 switches the audio output channel from the external audio device to the electronic device On the receiver.
  • the switching unit 1015 switches the audio output channel from the external audio device to the electronic device On the receiver.
  • This application also provides a computer program product containing instructions.
  • the computer program product runs on an electronic device (for example, electronic device 100, 301), the electronic device executes a switch provided by an embodiment of this application. The steps in the audio output channel method.
  • the present application provides a computer-readable storage medium, including instructions, which, when the instructions run on an electronic device, cause the electronic device to execute the steps in the method for switching audio output channels provided in the embodiments of the present application.
  • the device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physically separate. Units can be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the connection relationship between the modules indicates that they have a communication connection, which can be specifically implemented as one or more communication buses or signal lines.
  • each aspect of the present invention or the possible implementation manners of each aspect can be specifically implemented as a system, a method, or a computer program product. Therefore, each aspect of the present invention, or the possible implementation manner of each aspect, may adopt the form of a complete hardware embodiment, a complete software embodiment (including firmware, resident software, etc.), or an embodiment combining software and hardware.
  • circuits including firmware, resident software, etc.
  • systems systems

Abstract

一种切换音频输出通道的方法,用于具有内置听筒和第一传感器的电子设备,其中,第一传感器设置于电子设备的第一位置,该方法包括:当电子设备与外接音频设备连接,且电子设备的音频输出通道为该外接音频设备时,电子设备检测到第一操作;响应于该第一操作,电子设备确定其与外接音频设备的第一距离;电子设备根据第一传感器的检测信号,确定遮挡物体与第一位置的第二距离;以及当第一距离大于第一距离阈值,且第二距离小于第二距离阈值时,电子设备将音频输出通道从外接音频设备切换至电子设备的内置听筒。通过第一距离和第二距离的确定与比较,可以为电子设备自动切换音频输出通道。

Description

一种切换音频输出通道的方法、装置和电子设备
本申请要求在2020年6月16日提交中国国家知识产权局、申请号为202010546635.7的中国专利申请的优先权,发明名称为“一种切换音频输出通道的方法、装置和电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及电通信技术,尤其涉及一种切换音频输出通道的方法、装置和电子设备。
背景技术
一般地,手机、PDA(Personal Digital Assistant,个人数字助理)等电子设备可连接外接音频设备,例如便携式蓝牙耳机、车载蓝牙音箱等。通过与外接音频设备的连接,例如蓝牙(Bluetooth)连接,电子设备和外接音频设备在蓝牙有效范围内,可将音频输出通道从电子设备主体上设置的扬声器或听筒切换至该外接音频设备,从而方便用户使用。
当电子设备连接外接音频设备时,例如手机连接蓝牙耳机以输入/输出音频时,有时用户未佩戴该蓝牙耳机,手机与蓝牙耳机的连接不会断开,此时如果用户携带手机远离该蓝牙耳机,但是离开的距离未超出二者保持蓝牙连接的有效距离时,例如用户携手机离开蓝牙耳机大约8米时,手机的音频输出通道仍然是切换至该蓝牙耳机的状态。如果用户此时需要接听来电,为了使来电切换到手机听筒,用户需要找到手机或蓝牙耳机并且进行手动切换的操作,然后用户才能用手机正常接听来电。上述情况会在用户忘记其手机正连接着蓝牙耳机时,导致用户用手机接听来电听不到任何声音,而误以为是通话信号的问题导致其听不到对方的声音。这种情况严重地影响了用户体验。
在电子设备连接耳机时,将音频输出通道从耳机切换回电子设备,需要依赖用户手动操作而不能自动执行,因此,用户使用耳机时的切换操作不够简单便捷。
发明内容
本申请提供一种切换音频输出通道的方法、装置和电子设备,该方法可以自动切换电子设备的音频输出方式,而无需用户手动操作,提升了用户使用外接音频设备时的使用体验。
第一方面,本申请提供了一种切换音频输出通道的方法,用于具有内置听筒和第一传感器的电子设备,其中,所述第一传感器设置于所述电子设备的第一位置,其特征在于,所述方法包括:当所述电子设备与外接音频设备连接,且所述 电子设备的音频输出通道为所述外接音频设备时,所述电子设备检测到第一操作;响应于所述第一操作,所述电子设备确定其与所述外接音频设备的第一距离;所述电子设备根据所述第一传感器的检测信号,确定遮挡物体与所述第一位置的第二距离;以及当所述第一距离大于第一距离阈值,且所述第二距离小于第二距离阈值时,所述电子设备将所述音频输出通道从所述外接音频设备切换至所述电子设备的内置听筒。本申请提供的切换方法通过确定用户距外接音频设备大于第一距离阈值,且距内置听筒附近的第一位置小于第二距离阈值,可以自动切换音频输出通道,以便用户通过听筒收听音频。
根据第一方面,在第一方面的第一实现方式中,所述第一位置在所述内置听筒的附近,所述第一传感器是接近光传感器。通过接近光传感器,来判断用户是否有远离到靠近内置听筒,从而判断用户使用听筒接听音频的意愿。
根据第一方面,或以上第一方面的任意一种实现方式,在第一方面的第二实现方式中,所述第一操作是通话接听或语音信息播放。当用户接听来电或点击语音消息时,可以通过自动切换音频输出通道,提升用户使用电子设备的体验。
根据第一方面,或以上第一方面的任意一种实现方式,在第一方面的第三实现方式中,所述电子设备与所述外接音频设备通过蓝牙连接,所述电子设备确定其与所述外接音频设备的所述第一距离包括:根据所述电子设备与所述外接音频设备之间的蓝牙连接的接收信号强度指示RSSI确定所述第一距离。
根据第一方面的第三实现方式,在第一方面的第四实现方式中,所述电子设备确定其与所述外接音频设备的所述第一距离进一步包括:根据所述蓝牙连接的RSSI,以及所述外接音频设备的参数来确定所述第一距离,其中所述参数具有预设值。通过具有预设值的参数以及RSSI来确定该第一距离,能够得到可靠的结果,且无需提前对参数进行校准。
根据第一方面的第三实现方式,在第一方面的第五实现方式中,所述方法还包括:当所述电子设备与所述外接音频设备之间建立所述蓝牙连接时,对所述外接音频设备的参数进行校准;以及将校准后的参数存储于所述电子设备中。通过蓝牙与外接音频设备连接时,可以提醒用户对该设备进行参数校准,该校准值与该外接音频设备匹配并存储,以便在确定是否自动切换音频输出通道时用于确定第一距离。
根据第一方面的第五实现方式,在第一方面的第六实现方式中,所述电子设备确定其与所述外接音频设备的所述第一距离进一步包括:根据所述蓝牙连接的RSSI,以及所述校准后的参数来确定所述第一距离。通过与该外界音频设备匹配的校准后的参数值,在确定第一距离时,可以得到更加精确的结果。
根据第一方面的第五实现方式,在第一方面的第七实现方式中,所述校准后的参数包括,所述电子设备与所述外接音频设备相隔1米时的信号强度参数A,和/或所述外接音频设备的环境衰减因子参数n。
第二方面,本申请提供了一种切换音频输出通道的装置,用于具有内置听筒和第一传感器的电子设备,其中,所述第一传感器设置于所述电子设备的第一位 置,其特征在于,所述切换装置包括:检测单元,当所述电子设备与外接音频设备连接,且所述电子设备的音频输出通道为所述外接音频设备时,所述第一接收单元用于检测述电子设备上的第一操作;确定单元,响应于所述第一操作,所述确定单元用于确定所述电子设备与所述外接音频设备的第一距离,并根据所述第一传感器的检测信号确定遮挡物体与所述第一位置的第二距离;以及切换单元,当所述第一距离大于第一距离阈值,且所述第二距离小于第二距离阈值时,所述切换单元用于将所述电子设备的所述音频输出通道从所述外接音频设备切换至所述电子设备的内置听筒。本申请提供的切换装置通过确定用户距外接音频设备大于第一距离阈值,且距内置听筒附近的第一位置小于第二距离阈值,可以自动切换音频输出通道,以便用户通过听筒收听音频。
根据第二方面,在第二方面的第一实现方式中,所述第一操作是通话接听或语音信息播放。当用户接听来电或点击语音消息时,可以通过自动切换音频输出通道,提升用户使用电子设备的体验。
根据第二方面,或以上第二方面的任意一种实现方式,在第二方面的第二实现方式中,所述电子设备与所述外接音频设备通过蓝牙连接,且所述确定单元确定所述第一距离包括:所述确定单元根据所述蓝牙连接的接收信号强度指示RSSI来确定所述第一距离。
根据第二方面的第二实现方式,在第二方面的第三实现方式中,所述确定单元确定所述第一距离进一步包括:所述确定单元根据所述蓝牙连接的RSSI,以及所述外接音频设备的参数来确定所述第一距离,其中所述参数具有预设值。通过具有预设值的参数以及RSSI来确定该第一距离,能够得到可靠的结果,且无需提前对参数进行校准。
根据第二方面的第二实现方式,在第二方面的第四实现方式中,所述切换装置还包括:校准单元,当所述电子设备与所述外接音频设备之间建立所述蓝牙连接时,所述校准单元用于对所述外接音频设备的参数进行校准;以及存储单元,用于存储校准后的参数。电子设备通过蓝牙与外接音频设备连接时,可以提醒用户对该设备进行参数校准,通过校准单元得到的校准值与该外接音频设备匹配并存储在存储单元,以便在确定是否自动切换音频输出通道时用于确定第一距离。
根据第二方面的第四实现方式,在第二方面的第五实现方式中,所述确定单元确定所述第一距离进一步包括:所述确定单元根据所述蓝牙连接的RSSI,以及所述校准后的参数来确定所述第一距离。通过与该外界音频设备匹配的校准后的参数值,在确定第一距离时,可以得到更加精确的结果。
根据第二方面的第四实现方式,在第二方面的第六实现方式中,所述校准后的参数包括所述电子设备与所述外接音频设备相隔1米时的信号强度参数A,和/或所述外接音频设备的环境衰减因子参数n。
第三方面,本申请提供了一种电子设备,其特征在于,所述电子设备包括:触摸传感器,当所述电子设备与外接音频设备连接,且所述电子设备的音频输出通道为所述外接音频设备时,所述触摸传感器接收第一操作;接近光传感器,设 置于所述电子设备的内置话筒附近;处理器,响应于所述第一操作,确定所述电子设备与所述外接音频设备之间的第一距离是否大于第一距离阈值,并且根据所述接近光传感器的检测结果确定遮挡物体与所述内置话筒之间的第二距离是否小于第二距离阈,其中,当所述第一距离大于所述第一距离阈值,且所述第二距离小于第二距离阈值时,所述处理器将音频输出通道从所述外接音频设备切换到所述电子设备的内置听筒。本申请提供的电子设备通过确定用户距外接音频设备大于第一距离阈值,且距内置听筒附近的第一位置小于第二距离阈值,可以自动切换音频输出通道,以便用户通过听筒收听音频。
根据第三方面,在第三方面的第一实现方式中,所述电子设备还包括:通信模块,用于与所述外接音频设备建立蓝牙连接,其中,所述处理器还用于确定所述蓝牙连接的接收信号强度指示RSSI。
根据第三方面的第一实现方式,在第三方面的第二实现方式中,所述处理器还用于对所述外接音频设备的参数进行校准,且所述电子设备还包括:存储器,用于存储所述外接音频设备的校准后的参数,其中,所述处理器进一步用于根据所述蓝牙连接的RSSI,以及所述校准后的参数来计算所述第一距离。通过与该外界音频设备匹配的校准后的参数值,在确定第一距离时,可以得到更加精确的结果。
第四方面,本申请提供了一种计算机可读存储介质,包括指令,其特征在于,当所述指令在电子设备上运行时,使得所述电子设备执行如以上任意实现方式中所述的方法。
附图说明
图1为本申请实施例提供的一种电子设备的结构示意图;
图2为本申请实施例提供的一种电子设备的软件结构框图;
图3为本申请实施例提供的一种电子设备连接外接音频设备的示意图;
图4为本申请实施例提供的一种切换音频输出通道的场景示意图;
图5为本申请实施例提供的一种切换音频输出通道的场景示意图;
图6为本申请实施例提供的一种切换音频输出通道的方法流程示意图;
图7为本申请实施例提供的一种启用切换音频输出通道方案的示意图;
图8为本申请实施例提供的一种启用切换音频输出通道方案的示意图;
图9为本申请实施例提供的一种切换音频输出通道的方法流程示意图;
图10为本申请实施例提供的音频输出切换装置的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例进行说明。
需要说明的是,本申请实施例中的“第一”、“第二”等描述,是用于区分不同的消息、设备、模块、应用等,不代表先后顺序,也不限定“第一”和“第二”是不同的类型。“第一”、“第二”等描述也不限定数量,例如“第一应用”可以 为一个“第一应用”,也可以为多个“第一应用”。
本申请实施例中的术语“A和/或B”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如单独存在A,同时存在A和B,单独存在B这三种情况。另外,本申请实施例中字符“/”,一般表示前后关联对象是一种“或”的关系。
本申请实施例提供的方法可以应用于图1所示的电子设备100中。图1示出了电子设备100的结构示意图。
电子设备100,例如智能终端,可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理 器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备100的触摸功能。
I2S接口可以用于音频通信。PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。UART接口是一种通用串行数据总线,用于异步通信。
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备100的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。电源管理模块141用于连接电池142,充电管理模块140与处理器110。电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放 大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic  light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行电子设备100的各种功能应用以及数据处理。
在本申请的一些实施例中,内部存储器还用于存储翻译应用和缓存该翻译应用运行过程中所产生的所有图片,用户退出该翻译应用后上述缓存的所有图片可以自动删除。
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟 音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动终端平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。气压传感器180C用于测量气压。在一些实施例中,电子设备100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。磁传感器180D包括霍尔传感器。加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。环境光传感器180L用于感知环境光亮度。指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。温度传感器180J用于检测温度。
触摸传感器180K,也称“触控器件”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触 摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。
骨传导传感器180M可以获取振动信号。按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。马达191可以产生振动提示。指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。
在本申请的一个实施例中,当电子设备100通过无线通信模块160与外接音频设备连接时,例如蓝牙连接,电子设备100的触摸传感器180K检测作用于其上或附近的触发事件,例如检测到用户接通来电或点击语音消息。响应于触摸传感器180K检测到的触发事件,处理器110确定电子设备100与该外接音频设备之间的距离是否大于第一距离阈值,并通过接近光传感器180G确定是否有遮挡物相对于电子设备100由远离到靠近的状态,例如通过接近光传感器180G确定遮挡物与受话器170B,即听筒之间的距离是否大于第二距离阈值。在处理器110确定电子设备100与该外接音频设备之间的距离是否大于第一距离阈值时,处理器通过无线通信模块160确定的接收信号强度指示RSSI,例如外接音频设备的蓝牙信号RSSI,来计算电子设备100与该外接音频设备之间的距离。
当处理器110确定电子设备100与该外接音频设备之间的距离大于第一距离阈值,且确定遮挡物与听筒之间的距离小于第二距离阈值时,音频模块170将音频输出通道切换到电子设备100的受话器170B,即听筒上。
在本申请的另一实施例中,处理器110还可以通过环境光传感器180L确定是否有遮挡物相对于电子设备100由远离到靠近的状态,例如通过环境光传感器180L确定受话器170B处的光感量。当处理器110确定电子设备100与该外接音频设备之间的距离大于第一距离阈值,且确定受话器170B处的光感量小于光感量门限值时,音频模块170将音频输出通道切换到电子设备100的听筒上。
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。
图2是本发明实施例图1所示电子设备100的软件结构框图。
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。
应用程序层可以包括一系列应用程序包。
如图2所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
如图2所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。
安卓运行时(即Android Runtime)包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),二维图形引擎(例如:SGL)等。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。
二维图形引擎是2D绘图的绘图引擎。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。
下面结合捕获拍照场景,示例性说明电子设备100软件以及硬件的工作流程。
当图1中的触摸传感器180K接收到触摸操作,相应的硬件中断被发给内核层。内核层将触摸操作加工成原始输入事件(包括触摸坐标,触摸操作的时间戳等信息)。原始输入事件被存储在内核层。应用程序框架层从内核层获取原始输入事件,识别该输入事件所对应的控件。以该触摸操作是触摸单击操作,该单击操作所对应的控件为相机应用图标的控件为例,相机应用调用应用框架层的接口,启动相机应用,进而通过调用内核层启动摄像头驱动,通过图1所示的摄像头193捕获静态图像或视频。
在一些实施例中,上述提到的显示可以通过显示屏显示,显示屏具有显示的功能,显示屏可以具有触摸功能,也可以不具有触摸功能。在触摸显示屏上的操作可以通过虚拟按键实现,可以点击触摸屏实现。在非触摸显示屏上的操作可以通过物理按键实现。
图3为本申请实施例提供的一种电子设备连接外接音频设备的示意图。其中,电子设备可以是上述电子设备100。在本申请的实施例中,以手机301为例,作为该电子设备100的一个实施例。
图3a示出手机301与可穿戴设备,挂脖式耳机302连接,例如通过蓝牙连接。图3b示出手机301与真正无线立体声(True Wireless Stereo,TWS)耳机303连接,例如通过蓝牙连接。图3c示出手机301在车辆304上与车载蓝牙音箱305连接,例如通过蓝牙连接。当手机301与上述外接音频设备连接时,可将音频输出通道从手机上的扬声器或听筒(图中未示出)切换至该外接音频设备的,从而使得用户佩戴挂脖式耳机302或TWS耳机303来收听手机301输出的音频以及输入音频给手机301,或者用户在开车时可以从车载蓝牙音箱305上收听手机301播放的音乐。
本申请提供的电子设备,例如手机301可以实现音频输出设备的自动切换。请参见图4,图4示出切换音频输出设备的场景的示意图。当用户从图3c的车辆304中走出,到附近的快递柜准备取快递时,由于用户未将车辆304熄火,以 便其取完快递即刻回到车中继续驾驶,因此,即使用户已经携带手机301下车,手机301仍然处于与车辆304上的车载蓝牙音箱305连接中的状态。
用户在车外,例如距离车辆304大概3米远的地方,此时,手机301上有来电,用户点击接听键501,并将手机301放到耳边准备接听来电,如图4和图5a所示。
在用户点击接听键501后,手机301判断出其当前正通过蓝牙连接至车载蓝牙音箱305,并且判断出此时手机301与车载蓝牙音箱305的距离已经超过第一距离阈值,其中第一距离阈值可以设置为1至5米,例如1米、2米、5米,等等。当用户将手机301放到耳边准备接听来电时,手机301可以通过传感器判断用户贴近手机301的状态,当判断出用户通过手机301来接听来电的意愿,则将手机301的音频输出通道切换到手机301的听筒上。
在本申请的一个实施例中,在用户点击接听键501之前,虽然手机301距离车辆304已经超过上述第一距离阈值,手机301与车载蓝牙音箱305仍处于有效连接范围内,因此手机301的音频输出通道为车载蓝牙音箱305;当用户点击接听键501后,且在用户将手机301放到耳边之前,此时接通的来电音频将仍然输出到车载蓝牙音箱305;当用户将手机301放到耳边后,手机301通过传感器判断出用户非常贴近手机301的状态,才将音频输出通道从车载蓝牙音箱305切换到听筒上。
在本申请的一个实施例中,应可理解,由于用户点击接听键501后再将手机301放到耳边,这个过程非常迅速,虽然手机301的音频输出通道为车载蓝牙音箱305,但是此时接通的来电音频可以是并没有输出到车载蓝牙音箱305上,而是当手机301通过传感器判断出用户正逐渐贴近手机301的状态时,将音频输出通道从车载蓝牙音箱305切换到听筒之后,在听筒上输出该来电的音频。
其中,手机301上设置的传感器的类型包括但不限于接近光传感器、光线传感器和温度传感器,在手机301的听筒附近可设置上述任一类型的传感器,也可设置任意多种类型传感器的组合。
接近光传感器的基本工作原理为接近光传感器发出的光线经该接近光传感器前方一定距离的遮挡物(如人脸)反射后,再由该接近光传感器接收到,根据接收到的光线确定光损失大小并据此确定遮挡物离接近光传感器的距离。光线传感器能够将接收到的光强度转化为电信号。温度传感器能够将检测到的温度转化为电信号。
在本申请的实施例中,以接近光传感器为例进行描述,其中,该接近光传感器设置于手机301的第一位置,该第一位置在手机301的听筒附近。当用户贴近手机301的听筒时,根据接近光传感器的检测,即可以判断遮挡物与接近光传感器之间的第二距离,从而确定该第二距离是否小于第二距离阈值;而当用户远离手机301的听筒时,根据接近光传感器的检测,即可以判断出遮挡物与接近光传感器之间的第三距离,从而确定该第三距离是否大于第二距离阈值。
如图4所示,通过上述音频输出通道的自动切换过程,用户携带手机301 离开车辆304一定距离后,即使用户没有主动断开手机301与车辆304上的音箱305之间的连接,手机301可以通过判断用户使用手机301听筒接听来电的意愿,自动地将音频输出通道切换到手机301的听筒上。
请再次参见图5a,在手机301的顶部状态栏中示出了耳机标识502和蓝牙标识503,应可理解,这两个标识仅是示范的作用,而不能作为对本发明的限制。当手机301连接着车载蓝牙音箱305时,手机301的状态栏上可能出现蓝牙标识503和车辆标识(未示出),也可能仅出现蓝牙标识503,还可能不出现和蓝牙连接有关或和耳机、车辆有关的任何标识。
请再次参见图4,当用户在车外,例如距离车辆304大概3米远的地方,此时,用户想通过手机301查看某应用中的未读语音消息504,如图5b所示。用户点击语音消息504,并将手机301放到耳边听取该语音消息504。
在用户点击语音消息504后,手机301判断出其当前正通过蓝牙连接至车载蓝牙音箱305,并且判断出此时手机301与车载蓝牙音箱305的距离已经超过第一距离阈值。当用户将手机301放到耳边准备听取语音消息504时,手机301进一步判断接近光为远离到靠近,即有遮挡物体(即用户)相对于手机301是由远离到靠近的状态,且该遮挡物体与手机301的距离小于第二距离阈值。因此,判断出用户通过手机301来听取语音消息504的意愿,从而将手机301的音频输出通道切换到手机301的听筒上。
因此,在类似于图4所示的场景中,用户携带手机301离开外接音频设备一定距离后,即使手机301仍然通过蓝牙连接着该外接音频设备,通过上述音频输出通道的自动切换过程,手机301可以为用户将音频输出通道切换回手机301上的听筒,以使用手机301来接听来电、和听取语音消息等。
在本申请的一个实施例中,在用户点击语音消息504之前,虽然手机301距离车辆304已经超过第一距离阈值,手机301与车载蓝牙音箱305仍处于有效连接范围内,因此手机301的音频输出通道为车载蓝牙音箱305;当用户点击语音消息504后,且在用户将手机301放到耳边之前,此时播放的语音消息将仍然输出到车载蓝牙音箱305;当用户将手机301放到耳边后,手机301通过传感器判断出用户非常贴近手机301的状态,才将音频输出通道从车载蓝牙音箱305切换到听筒上。
在本申请的一个实施例中,应可理解,由于用户点击语音消息504后再将手机301放到耳边,这个过程非常迅速,此时播放的语音消息可以是并没有输出到车载蓝牙音箱305上,而是当手机301通过传感器判断出用户正逐渐贴近手机301的状态时,就已将音频输出通道从车载蓝牙音箱305切换到听筒上。
应可理解,在类似于图4所示的场景中,手机301将音频输出通道自动切换到其听筒之后,手机301与上述外接音频设备之间的蓝牙连接则相应地断开。当用户接听完图5a所示的来电,或者收听完图5b所示的语音消息后,手机301与上述外接音频设备之间的蓝牙连接可以相应地重新连接。例如,当用户接听完来电,将手机301从耳边移开,并重新回到车辆304内,手机301判断其接近光为 靠近到远离的状态,即遮挡物体(即用户)相对于手机301是由靠近到远离的状态,且该遮挡物体与手机301的距离大于第二距离阈值,且手机301进一步判断其与车载蓝牙音箱305的距离小于第三距离阈值,其中第三距离阈值例如是1米。因此,判断出用户已经回到先前连接外接音频设备的环境中,从而将手机301的音频输出通道切换到车载蓝牙音箱305上。通过此实施例中的音频输出通道的自动切换过程,用户回到连接外接音频设备的环境中后,可以接续之前的设备连接状态,进一步提高自动切换音频输出通道的体验。
图6示出上述切换音频输出通道的方法600的流程示意图。当电子设备连接外接音频设备时,遇到触发事件,例如接通来电或收听语音消息时,则会进入切换音频输出通道的方法600的流程。
在601中,如图5a所示,用户在电子设备301上点击接受键501来接听来电,或如图5b所示,用户在电子设备301上点击语音消息504来收听语音。由于此时电子设备301连接着外接音频设备,因此在图5a或图5b所示的触发事件后,进入步骤603。
步骤603包括步骤605-611,其中:
在605中,电子设备301判断其与该外接音频设备之间距离是否大于第一距离阈值L1,如果判断的结果为“是”,则进入步骤607。如果判断的结果为“否”,则进入步骤611,由该外接音频设备输出上述音频。例如,当手机301判断与外接音频设备的距离大于第一距离阈值时,代表用户有可能不会使用该外接音频设备来接听来电,因此会进一步判断用户用手机接听来电的意图。
在607中,电子设备301进一步判断其接近光是否为由远离到靠近的状态,如果判断的结果为“是”,则进入步骤609,如果判断的结果为“否”,则进入步骤611。
在本申请的一个实施例中,判断接近光为由远离到靠近的状态是通过电子设备301上的接近光传感器的检测结果得到的,其中,该接近光传感器设置于电子设备的第一位置,该第一位置在电子设备301的听筒附近。举例说明,当用户点击接听键501后,在将手机301移至耳边的过程中,根据接近光传感器的检测结果,可以确定用户的耳部与手机301的听筒之间的距离,当该距离小于第二距离阈值时,则认为接近光是由远离到靠近的状态;而当用户通话结束,在将手机从耳边移开的过程中,根据接近光传感器的检测结果,可以确定用户的耳部与手机301的听筒之间的距离大于该第二距离阈值时,则认为接近光是由靠近到远离的状态。
应可理解,步骤605和步骤607的顺序可以是先执行607再执行605,还可以是将605和607放到同一步骤中,例如是步骤:判断与外接音频设备的距离大于第一距离阈值且接近光由远离到靠近的状态,如果判断的结果为是,则进入步骤609,如果判断的结果为否,则进入步骤611。
经过上述601-607的步骤,若流程进入609,则由电子设备301的听筒输出音频,若流程进入611,则由该外接音频设备输出上述音频。
图7为本申请实施例提供的一种启用切换音频输出通道方案的场景示意图。图7a和图7b中示出手机301的界面分别对应于图5a的来电接听场景和图5b的收听语音消息场景。在这个实施例中,还是以图4为例来进行说明。当手机301连接着车辆304的车载蓝牙音箱305,且用户携带手机301下车取快递时,车辆304未熄火,手机301与车载蓝牙音箱305仍处于连接状态。
用户点击图5a所示的接听键501后,手机301上出现图7a所示的界面,即,来电接听且屏幕上显示窗口701。窗口701用于询问用户是否启用手机301提供的“智能切换”,该“智能切换”可以是图6所示的切换音频输出通道的方法600。当用户允许启用“智能切换”时,即点击启用键702,手机301根据上述切换音频输出通道的方法600而将手机301的音频输出通道切换到手机301的听筒上,或仍然保留在车载蓝牙音箱305上。当用户不允许启用“智能切换”时,即点击禁止键703,手机301的音频仍然输出到车辆304的车载蓝牙音箱305上。
用户还可以点击详情键704以查看该“智能切换”的详情介绍。如图7b所示,在用户点击详情键704后,手机301上进一步显示窗口705以供用户阅读“智能切换”的详情介绍。
图7b所示的实施例与图7a所示的实施例相似,不同在于,图7b中的窗口701是响应于用户点击图5b所示的语音消息504后弹出的,且窗口701弹出后,语音消息界面706可以做半透明处理,此时窗口701上的按键702和703优先于语音消息界面706上相同位置的任何按键。对图7b所示的实施例的其他方面,此处不再赘述。
图7示出的是用户接听来电和收听语音消息的场景,应可理解,本申请的实施例还可以应用于用户接听各种应用程序内的语音通话和视频通话的场景,或者是应用于用户使用电子设备进行音频播放的更多场景。例如,当电子设备与外接音频设备连接时,用户在电子设备上播放任何形式的音频或接听任何形式的通话时,如果电子设备判断其与该外接音频设备的距离大于第一距离阈值时,
在本申请的一个实施例中,“智能切换”的详情内容可以是:
Figure PCTCN2021099913-appb-000001
在此实施例中,用户还可以对当前连接的外接音频设备进行信号强度校准, 以更加准确的计算手机301与外接音频设备之间的距离。该信号强度校准可以在用户点击查看“智能切换”的详情后根据提示操作来进行,也可以在外接音频设备连接到手机301上时根据提示操作来进行,还可以是在外接音频设备连接到手机301上后,用户在系统设置中进行。
图8为本申请实施例提供的一种启用切换音频输出通道方案的示意图。在图8所示的实施例中,当外接音频设备连接到手机301上时,用户可以根据提示操作以对该外接音频设备进行信号强度校准。如图8所示,用户正将手机301连接至挂脖式耳机302、TWS耳机303或车载蓝牙音箱305。当手机301与上述外接音频设备(以下称设备E)之间建立好连接,例如蓝牙连接时,手机301的屏幕上弹出窗口801,以询问用户是否对当前连接的设备E启用上述“智能切换”方案,用户可以点击启用键802或禁止键803,或者选择稍后询问键804,该稍后询问键804可以是例如“通话时再问我”等。用户还可以点击详情键805以了解该“智能切换”方案的详情介绍。应可理解,“通话时再问我”仅为示例性的,由于上述“智能切换”方案可以应用于用户接听来电,和收听语音消息等场景,因此,在此实施例中,稍后询问键804的示例并不能作为对本发明的限制。
在本申请的一个实施例中,窗口801是出现在显示界面806上的浮窗形式,然而,浮窗并不作为对本申请的限制。
当用户点击启用键802后,手机301上弹出窗口807,以询问用户是否对当前连接的设备E的参数进行校准,从而更好的使用上述“智能切换”方案。上述实施例中提到,在启用该“智能切换”方案时,手机301会判断其当前与设备E的距离,当距离大于第一距离阈值且接近光为由远离到靠近的状态时,需对音频输出通道进行切换。窗口807所提示的即是对设备E的参数进行校准,从而更好的计算出上述距离。
在本申请的一个实施例中,窗口807是出现在显示界面806上的浮窗形式,然而,浮窗并不作为对本申请的限制。
在窗口807上,用户可以点击808“是”或809“否”,或者点击详情键810以查看校准的详情介绍,例如校准所需时间等等。校准的详情介绍图中并未示出,应可理解,校准的细节不应作为对本发明的限制。
当用户点击806“是”,手机301对设备E进行参数校准。
在本申请的一个实施例中,对设备E进行校准后,至少可以得到设备E的参数A的校准值,其中,参数A是发射端(手机301)与接收端(设备E)相隔1米时的信号强度。手机301在完成校准后将与设备E对应的校准信息(例如,参数A的校准值)保存,已在每次连接设备E时利用该校准信息来准确地计算发射端(手机301)与接收端(设备E)的实际距离。
在本申请的另一实施例中,对设备E进行校准后,还可以得到设备E的参数n的校准值,其中,参数n是环境衰减因子。同样地,手机301将与设备E对应的参数n的校准值保存,这样,手机301在连接设备E时,将利用其所存储的与设备E相关的参数A和参数n的校准信息来准确地计算发射端(手机301) 与接收端(设备E)的实际距离。
在本申请的一个实施例中,手机301利用以下公式来计算手机301与设备E的距离:
公式一:d=10^((abs(RSSI)-A)/(10*n)),其中,
d为需计算得到的手机301与设备E之间的实际距离值,单位为米(m);
RSSI为接收信号强度指示(Received Signal Strength Indicator),abs(RSSI)为RSSI的绝对值,其用于指示两个设备之间的连接质量,其中,RSSI为负值,单位为分贝毫瓦(dBm),RSSI可以通过任何相关的计算或已有的程序接口来获取;
A为设备E的参数A,即发射端(手机301)与接收端(设备E)相隔1米时的信号强度;
n为设备E的参数n,即设备E的环境衰减因子;
其中,参数A和参数n可以是上述经校准后得到的参数A和参数n,也可以是参数A和参数n的经验值。
举例说明,当用户在图8b所示的实施例中点击809“否”,即不进行参数校准时,本申请提供的“智能切换”方案可以使用参数A和参数n的经验值来计算上述手机301与设备E之间的实际距离d。
本领域的技术人员应可理解,手机301与外接音频设备连接时进行参数A的校准并不是必须的,虽然不同的外接音频设备可能具有不同的蓝牙类型,且不同的蓝牙类型的信号强度可能存在差异。然而,当手机301未获取和设备相关的经校准后的参数A和参数n时,在上述公式一中,参数A和参数n可以使用经验值,例如使用与该外接音频设备所支持的协议向匹配的参数A和参数n的经验值。举例说明,对于支持蓝牙4.0版本的设备,可以为参数A赋值59,n赋值2.0;还可以为参数A赋值50,n赋值2.5;或者为参数A赋值70,n赋值2.0;又或者为参数A赋值60,n赋值3.3。应可理解,上述参数A和参数n的组合仅作为示例性的,不应作为对本申请的限制,对于支持不同协议的设备,或者支持同一协议不同版本的设备,参数A和参数n的赋值可以是相同或者不同的。当以任一经验值组合作为参数A和参数n的预设值组合后,可以根据以上所述来实现切换音频输出通道的方法。
具体地,通过参数A和参数n的经验值所计算出来的距离可以作为上述“智能切换”过程中的判断基础,即,用参数A和参数n的经验值计算得到的距离d也可以作为与上述第一距离阈值比较的基准,例如,d=10^((abs(RSSI)-59)/(10*2))。
在图8所示的实施例中,当手机301与不同的外接音频设备连接的初期,可以根据所连接设备的实际状态进行校准以得到更加合理的参数值,例如参数A和参数n,然后将校准后的参数值与对应的设备信息一起存储。当手机301再连接到这些外接音频设备时,可以获取其所对应的参数并用来计算上述距离d。
图9为本申请实施例提供的一种切换音频输出通道的方法的流程示意图。其中,图9A所示的切换音频输出通道的方法900对应图7所示的实施例,图9b所示的切换音频输出通道的方法910对应图8所示的实施例。
参见图9a,切换音频输出通道的方法900是用于,当电子设备上检测到触发事件后,询问用户是否开启前述的“智能切换”方案,具体地:
在901中,电子设备与外接音频设备连接。例如手机301通过蓝牙连接至车载蓝牙音箱305。
在903中,如图5a所示,用户在电子设备301上点击接听键501准备接听来电,或如图5b所示,用户在电子设备301上点击语音消息504准备收听语音。
在905中,基于步骤903中的触发事件,例如接通来电或收听语音消息,电子设备301上出现弹窗,例如图7a或7b所示的弹窗701和705,通过该弹窗询问用户当前是否开启“智能切换”方案。如果用户点击启用键702,则进入图6所示的步骤603;如果用户点击禁止键703,则进入步骤907。
在907中,仍然使用外接音频设备输出音频。
在本申请的一个实施例中,在用户点击接听键501或点击语音消息504之前,手机301与外接音频设备仍处于连接中,即手机301的音频输出通道为该外接音频设备;当用户点击接听键501或点击语音消息504后,且在用户点击启用键702以开启“智能切换”方案之前,此时接通的来电或播放的语音消息将仍然输出到外接音频设备上;当用户点击启用键702后,手机301才将音频输出通道从外接音频设备切换到听筒上。
在本申请的一个实施例中,应可理解,由于用户点击接听键501或点击语音消息504后再点击启用键702以开启“智能切换”方案的过程可能是非常迅速的,此时接通的来电或者播放的语音消息可以是并没有输出到外接音频设备上,而是在用户点击启用键702后,手机301立刻将音频输出通道从外接音频设备切换到听筒上。
请参见图9b,切换音频输出通道的方法910是用于,当电子设备与外接音频设备连接后,立刻询问用户是否开启前述“智能切换”方案,其中,相同的附图标记代表相同的步骤,具体地:
在901中,电子设备与外接音频设备连接。例如手机301通过蓝牙连接至车载蓝牙音箱305。
在905中,电子设备301上出现弹窗,例如图8a所示的弹窗801,通过该弹窗询问用户当前是否开启“智能切换”方案。如果用户点击启用键802,则进入步骤909;如果用户点击禁止键803,则进入步骤907。
在907中,仍然使用外接音频设备输出音频。
在909中,电子设备301对该外接音频设备的参数进行校准,以更加精确的执行上述“智能切换”方案。具体地,电子设备301上可以出现弹窗,例如图8b所示的弹窗807,通过该弹窗询问用户是否同意对该外接音频设备的参数进行校准,当用户点击808“是”,则电子设备对该外接音频设备的参数进行校准并 将校准后的参数与该外接音频设备的信息储存。然后进入图6所示的切换音频输出通道的方法600。
在本申请的一个实施例中,电子设备对该外接音频设备的参数进行校准并将校准后的参数与该外接音频设备的信息储存后,在执行图6所示的切换音频输出通道的方法600时,则通过校准后的参数来计算电子设备与该外接音频设备之间的距离,并判断该计算的距离是否大于第一距离阈值(步骤605)。其中,校准的参数可以是该外接音频设备的参数A,和/或参数n,在前述实施例中对校准的参数进行了详细的描述,因此此处不再赘述。
在本申请的另一实施例中,步骤909可以省略,即电子设备不对该外接音频设备的参数进行校准,这时,在执行图6所示的切换音频输出通道的方法600时,可以通过经验值来计算电子设备与该外接音频设备之间的距离,并判断该计算的距离是否大于第一距离阈值(步骤605)。
图10为本申请实施例提供的切换音频输出通道的装置1000的结构示意图。
如图10所示,装置1000包括:
第一确定单元1001,用于在电子设备连接外接音频设备时,通过用户的反馈来确定是否开启“智能切换”,和/或在触发事件发生后,确定是否开启“智能切换”。第一确定单元1001还用于在用户开启“智能切换”后,通过用户的反馈确定是否对该外接音频设备的参数进行校准,以更加精确的执行该“智能切换”方案。第一确定单元1001可以通过弹窗的形式对用户呈现上述提示信息,例如图7所示的窗口701、和/或窗口705,还例如图8所示的窗口801、和/或窗口807。
校准单元1003,当第一确定单元1001确定对该外接音频设备的参数进行校准时,或者当所述电子设备与所述外接音频设备之间建立连接时,校准单元1003对外接音频设备的参数进行校准。具体地,校准单元1003可以对该外接音频设备的参数A和/或参数n进行校准。
存储单元1004,用于存储校准单元1003校准后的参数,从而在进行“智能切换”中,电子设备可以使用与该外接音频设备对应的校准后的参数。
在本申请的一个实施例中,第一确定单元1001不是必须的,电子设备100可以响应于触发事件而直接启用“智能切换”方案。在本申请的另一实施例中,校准单元1003也不是必须的,电子设备100在使用参数A和参数n时,可以使用经验值,而不是使用经校准后的参数值,这就是说,参数A和参数n可以分别具有预设的值。
检测单元1005,在电子设备连接外接音频设备时,检测单元1005用于检测触发事件,如检测用户的第一操作,包括检测用户接通来电或检测用户播放语音信息。响应于该触发事件,电子设备接通通话或输出音频。例如,响应于用户接通来电(如点击接受键501),或点击语音消息(如点击语音消息504),电子设备接通该来电,或者输出与该语音消息对应的音频。
在本申请的一个实施例中,电子设备具有传感器,例如接近光传感器,设置于电子设备上的第一位置,并产生相应的检测信号。其产生的检测信号可以表 示遮挡物体与第一位置之间的距离。例如,当用户将电子设备贴近脸部时,该检测信号表示遮挡物体与第一位置之间的距离小于第二距离阈值,接近光为由远离到靠近的状态,而当用户将电子设备远离脸部时,该检测信号表示遮挡物体与第一位置之间的距离大于该第二距离阈值,接近光为由靠近到远离的状态。
再次参考图10,装置1000还包括:
接收单元1007,用于接收第一传感器,例如接近光传感器的检测信号,以及电子设备与外接音频设备之间的连接的接收信号强度指示RSSI,具体的,电子设备与外接音频设备可以是无线连接,例如蓝牙连接,且该无线连接的信号强度指示RSSI是蓝牙信号的RSSI。
第二确定单元1009,用于确定电子设备与外接音频设备之间的第一距离,且根据第一传感器的检测信号来确定遮挡物体与电子设备上的第一位置之间的第二距离。具体地,确定单元1009可以使用上述RSSI以及校准单元1003对该外接音频设备进行校准后的参数A和/或参数n来确定该第一距离,也可以使用上述RSSI以及预设的参数A和/或参数n的经验值来确定该第一距离,且第二确定单元1009进一步判断该第一距离是否大于第一距离阈值,以及该第二距离是否小于第二距离阈值,前述实施例对此有详细的描述,此处不再赘述。
切换单元1015,当电子设备与外接音频设备之间的第一距离大于第一距离阈值,且第二距离小于第二距离阈值时,切换单元1015将音频输出通道从外接音频设备切换到电子设备的听筒上。从而方便用户在电子设备上直接接听来电、或收听语音消息、等等。
本申请还提供了一种包含指令的计算机程序产品,当所述计算机程序产品在电子设备(例如电子设备100、301)上运行时,使得所述电子设备执行本申请实施例提供的一种切换音频输出通道的方法中的步骤。
本申请提供一种计算机可读存储介质,包括指令,当所述指令在电子设备上运行时,使得所述电子设备执行本申请实施例提供的一种切换音频输出通道的方法中的步骤。
本说明书中的各个实施例已有侧重地进行了描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。
需说明的是,以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。另外,本发明提供的装置实施例附图中,模块之间的连接关系表示它们之间具有通信连接,具体可以实现为一条或多条通信总线或信号线。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
本领域普通技术人员将会理解,本发明的各个方面、或各个方面的可能实现 方式可以被具体实施为系统、方法或者计算机程序产品。因此,本发明的各方面、或各个方面的可能实现方式可以采用完全硬件实施例、完全软件实施例(包括固件、驻留软件等等),或者组合软件和硬件方面的实施例的形式,在这里都统称为“电路”、“模块”或者“系统”。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。

Claims (19)

  1. 一种切换音频输出通道的方法,用于具有内置听筒和第一传感器的电子设备,其中,所述第一传感器设置于所述电子设备的第一位置,其特征在于,所述方法包括:
    当所述电子设备与外接音频设备连接,且所述电子设备的音频输出通道为所述外接音频设备时,所述电子设备检测到第一操作;
    响应于所述第一操作,
    所述电子设备确定其与所述外接音频设备的第一距离;
    所述电子设备根据所述第一传感器的检测信号,确定遮挡物体与所述第一位置的第二距离;以及
    当所述第一距离大于第一距离阈值,且所述第二距离小于第二距离阈值时,所述电子设备将所述音频输出通道从所述外接音频设备切换至所述电子设备的内置听筒。
  2. 如权利要求1所述的方法,其特征在于,所述第一位置在所述内置听筒的附近,所述第一传感器是接近光传感器。
  3. 如权利要求1所述的方法,其特征在于,所述第一操作是通话接听或语音信息播放。
  4. 如权利要求1所述的方法,其特征在于,所述电子设备与所述外接音频设备通过蓝牙连接,所述电子设备确定其与所述外接音频设备的所述第一距离包括:
    根据所述电子设备与所述外接音频设备之间的蓝牙连接的接收信号强度指示RSSI确定所述第一距离。
  5. 如权利要求4所述的方法,其特征在于,所述电子设备确定其与所述外接音频设备的所述第一距离进一步包括:
    根据所述蓝牙连接的RSSI,以及所述外接音频设备的参数来确定所述第一距离,其中所述参数具有预设值。
  6. 如权利要求4所述的方法,其特征在于,所述方法还包括:
    当所述电子设备与所述外接音频设备之间建立所述蓝牙连接时,对所述外接音频设备的参数进行校准;以及
    将校准后的参数存储于所述电子设备中。
  7. 如权利要求6所述的方法,其特征在于,所述电子设备确定其与所述外接音频设备的所述第一距离进一步包括:
    根据所述蓝牙连接的RSSI,以及所述校准后的参数来确定所述第一距离。
  8. 如权利要求6所述的方法,其特征在于,所述校准后的参数包括,所述电子设备与所述外接音频设备相隔1米时的信号强度参数A,和/或所述外接音频设备的环境衰减因子参数n。
  9. 一种切换音频输出通道的装置,用于具有内置听筒和第一传感器的电子设备,其中,所述第一传感器设置于所述电子设备的第一位置,其特征在于,所述切换装置包括:
    检测单元,当所述电子设备与外接音频设备连接,且所述电子设备的音频输出通道为所述外接音频设备时,所述第一接收单元用于检测述电子设备上的第一操作;
    确定单元,响应于所述第一操作,所述确定单元用于确定所述电子设备与所述外接音频设备的第一距离,并根据所述第一传感器的检测信号确定遮挡物体与所述第一位置的第二距离;以及
    切换单元,当所述第一距离大于第一距离阈值,且所述第二距离小于第二距离阈值时,所述切换单元用于将所述电子设备的所述音频输出通道从所述外接音频设备切换至所述电子设备的内置听筒。
  10. 如权利要求9所述的装置,其特征在于,所述第一操作是通话接听或语音信息播放。
  11. 如权利要求9所述的装置,其特征在于,所述电子设备与所述外接音频设备通过蓝牙连接,且所述确定单元确定所述第一距离包括:
    所述确定单元根据所述蓝牙连接的接收信号强度指示RSSI来确定所述第一距离。
  12. 如权利要求11所述的装置,其特征在于,所述确定单元确定所述第一距离进一步包括:
    所述确定单元根据所述蓝牙连接的RSSI,以及所述外接音频设备的参数来确定所述第一距离,其中所述参数具有预设值。
  13. 如权利要求11所述的装置,其特征在于,所述切换装置还包括:
    校准单元,当所述电子设备与所述外接音频设备之间建立所述蓝牙连接时,所述校准单元用于对所述外接音频设备的参数进行校准;以及
    存储单元,用于存储校准后的参数。
  14. 如权利要求13所述的装置,其特征在于,所述确定单元确定所述第一 距离进一步包括:
    所述确定单元根据所述蓝牙连接的RSSI,以及所述校准后的参数来确定所述第一距离。
  15. 如权利要求13所述的装置,其特征在于,所述校准后的参数包括所述电子设备与所述外接音频设备相隔1米时的信号强度参数A,和/或所述外接音频设备的环境衰减因子参数n。
  16. 一种电子设备,其特征在于,所述电子设备包括:
    触摸传感器,当所述电子设备与外接音频设备连接,且所述电子设备的音频输出通道为所述外接音频设备时,所述触摸传感器接收第一操作;
    接近光传感器,设置于所述电子设备的内置话筒附近;
    处理器,响应于所述第一操作,确定所述电子设备与所述外接音频设备之间的第一距离是否大于第一距离阈值,并且根据所述接近光传感器的检测结果确定遮挡物体与所述内置话筒之间的第二距离是否小于第二距离阈,
    其中,当所述第一距离大于所述第一距离阈值,且所述第二距离小于第二距离阈值时,所述处理器将音频输出通道从所述外接音频设备切换到所述电子设备的内置听筒。
  17. 如权利要求16所述的电子设备,其特征在于,所述电子设备还包括:
    通信模块,用于与所述外接音频设备建立蓝牙连接,
    其中,所述处理器还用于确定所述蓝牙连接的接收信号强度指示RSSI。
  18. 如权利要求17所述的电子设备,其特征在于,所述处理器还用于对所述外接音频设备的参数进行校准,且所述电子设备还包括:
    存储器,用于存储所述外接音频设备的校准后的参数,
    其中,所述处理器进一步用于根据所述蓝牙连接的RSSI,以及所述校准后的参数来计算所述第一距离。
  19. 一种计算机可读存储介质,包括指令,其特征在于,当所述指令在电子设备上运行时,使得所述电子设备执行如权利要求1-8中任一项所述的方法。
PCT/CN2021/099913 2020-06-16 2021-06-12 一种切换音频输出通道的方法、装置和电子设备 WO2021254294A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US18/009,422 US20230224398A1 (en) 2020-06-16 2021-06-12 Audio output channel switching method and apparatus and electronic device
EP21825942.2A EP4152736A4 (en) 2020-06-16 2021-06-12 AUDIO OUTPUT CHANNEL SWITCHING METHOD, APPARATUS AND ELECTRONIC DEVICE

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010546635.7 2020-06-16
CN202010546635.7A CN113890929B (zh) 2020-06-16 2020-06-16 一种切换音频输出通道的方法、装置和电子设备

Publications (1)

Publication Number Publication Date
WO2021254294A1 true WO2021254294A1 (zh) 2021-12-23

Family

ID=79011780

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/099913 WO2021254294A1 (zh) 2020-06-16 2021-06-12 一种切换音频输出通道的方法、装置和电子设备

Country Status (4)

Country Link
US (1) US20230224398A1 (zh)
EP (1) EP4152736A4 (zh)
CN (1) CN113890929B (zh)
WO (1) WO2021254294A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114885317A (zh) * 2022-07-08 2022-08-09 荣耀终端有限公司 设备间协同控制的方法、通信系统、电子设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103167123A (zh) * 2012-07-24 2013-06-19 深圳市金立通信设备有限公司 基于距离传感器实现手机来电自动接听的系统及方法
CN109040448A (zh) * 2018-08-03 2018-12-18 联想(北京)有限公司 一种控制方法及电子设备
CN110430562A (zh) * 2019-08-30 2019-11-08 RealMe重庆移动通信有限公司 蓝牙通信方法及相关装置
US20190354340A1 (en) * 2016-08-26 2019-11-21 Huawei Technologies Co., Ltd. Audio Output Method, Electronic Device, and Storage Medium
CN110890905A (zh) * 2019-11-22 2020-03-17 三星电子(中国)研发中心 一种控制音频输出的方法和使用该方法的电子装置

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3115124U (ja) * 2005-07-26 2005-11-04 和恩科技股▼ふん▲有限公司 双方向ボイス伝送機能を有するブルートゥースヘッドフォンハウジング
CN103024193A (zh) * 2012-12-25 2013-04-03 北京百度网讯科技有限公司 用于移动终端的播放控制方法、装置和移动终端
US8706162B1 (en) * 2013-03-05 2014-04-22 Sony Corporation Automatic routing of call audio at incoming call
CN104717363A (zh) * 2015-03-23 2015-06-17 努比亚技术有限公司 一种移动终端及其快速进行音频通道切换的方法和装置
US10588000B2 (en) * 2015-06-19 2020-03-10 Lenovo (Singapore) Pte. Ltd. Determination of device at which to present audio of telephonic communication
CN108551526A (zh) * 2018-04-19 2018-09-18 深圳市沃特沃德股份有限公司 计算距离的方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103167123A (zh) * 2012-07-24 2013-06-19 深圳市金立通信设备有限公司 基于距离传感器实现手机来电自动接听的系统及方法
US20190354340A1 (en) * 2016-08-26 2019-11-21 Huawei Technologies Co., Ltd. Audio Output Method, Electronic Device, and Storage Medium
CN109040448A (zh) * 2018-08-03 2018-12-18 联想(北京)有限公司 一种控制方法及电子设备
CN110430562A (zh) * 2019-08-30 2019-11-08 RealMe重庆移动通信有限公司 蓝牙通信方法及相关装置
CN110890905A (zh) * 2019-11-22 2020-03-17 三星电子(中国)研发中心 一种控制音频输出的方法和使用该方法的电子装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114885317A (zh) * 2022-07-08 2022-08-09 荣耀终端有限公司 设备间协同控制的方法、通信系统、电子设备及存储介质
CN114885317B (zh) * 2022-07-08 2022-11-25 荣耀终端有限公司 设备间协同控制的方法、通信系统、电子设备及存储介质

Also Published As

Publication number Publication date
US20230224398A1 (en) 2023-07-13
CN113890929B (zh) 2023-03-10
EP4152736A4 (en) 2023-11-08
CN113890929A (zh) 2022-01-04
EP4152736A1 (en) 2023-03-22

Similar Documents

Publication Publication Date Title
WO2020000448A1 (zh) 一种柔性屏幕的显示方法及终端
CN113645351B (zh) 应用界面交互方法、电子设备和计算机可读存储介质
CN111095723B (zh) 无线充电方法及电子设备
WO2020119492A1 (zh) 消息处理方法及相关装置
WO2020073288A1 (zh) 一种触发电子设备执行功能的方法及电子设备
CN113573390B (zh) 天线功率调节方法、终端设备及存储介质
WO2021218429A1 (zh) 应用窗口的管理方法、终端设备及计算机可读存储介质
WO2021000817A1 (zh) 环境音处理方法及相关装置
CN113472477B (zh) 无线通信系统及方法
CN114115770A (zh) 显示控制的方法及相关装置
WO2021254294A1 (zh) 一种切换音频输出通道的方法、装置和电子设备
CN110058729B (zh) 调节触摸检测的灵敏度的方法和电子设备
WO2022062902A1 (zh) 一种文件传输方法和电子设备
WO2022037725A1 (zh) 一种系统服务恢复方法、装置和电子设备
WO2022007757A1 (zh) 跨设备声纹注册方法、电子设备及存储介质
CN115706916A (zh) 一种基于位置信息的Wi-Fi连接方法及装置
CN116346982B (zh) 处理音频的方法、电子设备及可读存储介质
CN116048236B (zh) 通信方法及相关装置
CN113050864B (zh) 一种截屏方法及相关设备
CN116320880B (zh) 音频处理方法和装置
CN114205318B (zh) 头像显示方法及电子设备
CN116723384B (zh) 进程的控制方法、电子设备及可读存储介质
JP7462659B2 (ja) 情報表示方法および装置
CN116301483A (zh) 一种应用卡片的管理方法、电子设备和存储介质
CN115857964A (zh) 应用程序安装方法及相关设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21825942

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021825942

Country of ref document: EP

Effective date: 20221213

NENP Non-entry into the national phase

Ref country code: DE