WO2022033176A1 - 音频播放控制方法、装置、电子设备及存储介质 - Google Patents

音频播放控制方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2022033176A1
WO2022033176A1 PCT/CN2021/101231 CN2021101231W WO2022033176A1 WO 2022033176 A1 WO2022033176 A1 WO 2022033176A1 CN 2021101231 W CN2021101231 W CN 2021101231W WO 2022033176 A1 WO2022033176 A1 WO 2022033176A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
target application
audio
target
playback
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2021/101231
Other languages
English (en)
French (fr)
Inventor
包建全
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Publication of WO2022033176A1 publication Critical patent/WO2022033176A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output
    • G06F3/165Management of the audio stream, e.g. setting of volume, audio stream path
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/011Arrangements for interaction with the human body, e.g. for user immersion in virtual reality
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output

Definitions

  • the present application relates to the field of communication technologies, and in particular, to an audio playback control method, device, electronic device, and storage medium.
  • the audio output methods of electronic devices mainly include speaker output and headphone output.
  • users usually pair and connect the electronic device and wireless headphones first, and wear the wireless headphones on the ears as an audio output channel to play audio signals.
  • Embodiments of the present application provide an audio playback control method, apparatus, electronic device, and storage medium.
  • a first aspect of an embodiment of the present application provides an audio playback control method, which is applied to an electronic device, where the electronic device is connected to a wireless headset, and the method includes:
  • the target application of the electronic device uses the wireless earphone end as the audio output path of the target audio, if it is determined that the wireless earphone is taken off, then determine whether the target application responds to pause playback;
  • a second aspect of an embodiment of the present application provides an audio playback control method, which is applied to an electronic device, where the electronic device is connected to at least one of a pair of wireless earphones, and the method includes:
  • the response information of the target application of the electronic device is obtained, and the response information is used to indicate whether the target application can respond to the wireless headset.
  • the audio output path of the target application is determined according to the response information.
  • a third aspect of an embodiment of the present application provides an audio playback control device, which is applied to an electronic device, where the electronic device is connected to a wireless headset, and the audio playback control device includes:
  • the processing unit is configured to continue outputting the target audio to the wireless earphone if the target application program does not respond to pause play; if the target application program responds to pause play, use the electronic device end as an audio output channel.
  • a fourth aspect of the embodiments of the present application provides an audio playback control device, which is applied to electronic equipment, where the electronic device is connected to at least one of a pair of wireless headphones, and the audio playback control device includes:
  • the obtaining unit is configured to obtain the response information of the target application of the electronic device when the state information indicating that the pair of wireless earphones are both taken off is obtained, and the response information is used to characterize the ability of the target application No response to the pause playback instruction sent by the wireless headset;
  • a determining unit configured to determine the audio output path of the target application according to the response information.
  • a fifth aspect of the embodiments of the present application provides an audio playback control system, including an electronic device and a wireless earphone, the electronic device is connected to the wireless earphone, wherein,
  • the wireless headset determines to change from the wearing state to the non-wearing state, or, the wireless headset determines that the wireless headset changes from the wearing state to the non-wearing state and the target application of the electronic device is in the playing state,
  • the electronic device After the electronic device receives the pause playback instruction, if the target application can respond to the pause playback instruction, pause playback of the target audio;
  • the wireless headset sends a state change instruction to the electronic device within a preset time after sending the play pause instruction to the electronic device; the electronic device obtains the target after receiving the state change instruction
  • the response information of the application program, and the audio playback path of the target application program is determined according to the response information.
  • a sixth aspect of an embodiment of the present application provides an audio playback control system, including an electronic device and a wireless earphone, the wireless earphone includes a first earphone and a second earphone, the electronic device is connected to at least one earphone of the wireless earphone, in,
  • any one of the wireless earphones is determined to change from the wearing state to the non-wearing state, or, if any one of the wireless earphones is determined to change from the wearing state to the non-wearing state and the target application of the electronic device is playing condition,
  • the wireless earphone determines that both earphones are taken off, sending status information to the electronic device;
  • the electronic device obtains the response information of the target application after receiving the status information
  • the electronic device determines the audio playback path of the target application according to the response information.
  • a seventh aspect of embodiments of the present application provides an electronic device, including: a processor and a memory; and one or more programs, where the one or more programs are stored in the memory and configured to be processed by the processor
  • the program includes instructions for some or all of the steps described in the first aspect or the second aspect of the embodiments of the present application.
  • An eighth aspect of an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium is used to store a computer program, wherein the computer program causes a computer to execute the first aspect or the first aspect of the embodiment of the present application. Instructions for some or all of the steps described in the second aspect.
  • a ninth aspect of the embodiments of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute as implemented in the present application Some or all of the steps described in the first aspect or the second aspect.
  • the computer program product may be a software installation package.
  • FIG. 1A is a schematic structural diagram of an electronic device disclosed in an embodiment of the present application.
  • FIG. 1B is a schematic flowchart of an audio playback control method disclosed in an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of another audio playback control method disclosed in an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of another audio playback control method disclosed in an embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of an electronic device disclosed in an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of an audio playback control device disclosed in an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of an audio playback control system disclosed in an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of an audio playback control system disclosed in an embodiment of the present application.
  • the electronic devices described in the embodiments of this application may include various handheld devices with wireless communication functions, vehicle-mounted devices, wireless headsets, computing devices, or other processing devices connected to wireless modems, as well as various forms of user equipment (user equipment, UE), mobile station (mobile station, MS), terminal device (terminal device), etc.
  • the electronic device may be, for example, a smart phone, a tablet computer, an earphone box, a wearable device, and the like.
  • the devices mentioned above are collectively referred to as electronic devices.
  • the wireless earphones may specifically be: Bluetooth earphones, true wireless stereo (TWS) earphones, and of course other earphones based on wireless transmission, such as light conduction earphones, etc.
  • the above-mentioned Bluetooth earphones can be It is a common bluetooth earphone, that is, an earphone that plays sound through a speaker.
  • the above-mentioned bluetooth earphone can also be a bone conduction earphone, and the present application does not limit the sound conduction mode of the wireless earphone.
  • the above wireless headset can establish a wireless connection with an electronic device,
  • the wireless earphone may be a hanging earphone, an in-ear earphone, or a headphone, which is not limited in this embodiment of the present application.
  • FIG. 1A is a schematic structural diagram of an electronic device disclosed in an embodiment of the present application.
  • the electronic device 100 includes a storage and processing circuit 110, and a sensor 170 connected to the storage and processing circuit 110, wherein:
  • Electronic device 100 may include control circuitry, which may include storage and processing circuitry 110 .
  • the storage and processing circuitry 110 may include memory, such as hard drive memory, non-volatile memory (such as flash memory or other electronically programmable read-only memory used to form solid state drives, etc.), volatile memory (such as static or dynamic random access memory, etc.) access memory, etc.), etc., which are not limited in the embodiments of the present application.
  • Processing circuitry in storage and processing circuitry 110 may be used to control the operation of electronic device 100 .
  • the processing circuit may be implemented based on one or more microprocessors, microcontrollers, digital signal processors, baseband processors, power management units, audio codec chips, application specific integrated circuits, display driver integrated circuits, and the like.
  • Storage and processing circuitry 110 may be used to run software in electronic device 100, such as Internet browsing applications, Voice over Internet Protocol (VOIP) phone calling applications, email applications, media playback applications, operating system functions Wait.
  • These software can be used to perform some control operations, for example, camera-based image acquisition, ambient light measurement based on ambient light sensor, proximity sensor measurement based on proximity sensor, information based on status indicator implementation such as status indicators for LEDs Display functions, touch sensor-based detection of touch events, functions associated with displaying information on multiple (eg, layered) display screens, operations associated with performing wireless communication functions, functions associated with collecting and generating audio signals Operations, control operations associated with collecting and processing button press event data, and other functions in the electronic device 100, etc., are not limited in this embodiment of the present application.
  • Electronic device 100 may include input-output circuitry 150 .
  • the input-output circuit 150 may be used to enable the electronic device 100 to input and output data, ie, allowing the electronic device 100 to receive data from an external device and also allow the electronic device 100 to output data from the electronic device 100 to an external device.
  • the input-output circuit 150 may further include a sensor 170 .
  • the sensor 170 may include an ultrasonic fingerprint recognition module, and may also include an ambient light sensor, a proximity sensor based on light and capacitance, a touch sensor (eg, a light-based touch sensor and/or a capacitive touch sensor, where the touch sensor may be a touch sensor)
  • a touch sensor eg, a light-based touch sensor and/or a capacitive touch sensor, where the touch sensor may be a touch sensor
  • a part of the display screen can also be used independently as a touch sensor structure
  • acceleration sensor and other sensors, etc.
  • the ultrasonic fingerprint recognition module can be integrated under the screen, or the ultrasonic fingerprint recognition module can be arranged on the side of the electronic device or On the back, without limitation, the ultrasonic fingerprint recognition module can be used to collect fingerprint images.
  • the sensor 170 may include a first camera and a second camera, the first camera may be a front camera or a rear camera, the second camera may be a front camera or a rear camera, and the second camera may be an infrared (Infrared Radiation, IR) camera Camera or visible light camera, when IR camera is shooting, the pupil reflects infrared light, so IR camera will be more accurate than RGB camera when shooting pupil image; visible light camera needs more follow-up pupil detection, and the calculation accuracy and accuracy are higher than IR camera. High, the versatility is better than the IR camera, but the computation is heavy.
  • IR Infrared Radiation
  • Input-output circuitry 150 may also include one or more display screens, such as display screen 130 .
  • the display screen 130 may include one or a combination of a liquid crystal display screen, an organic light emitting diode display screen, an electronic ink display screen, a plasma display screen, and a display screen using other display technologies.
  • Display 130 may include a touch sensor array (ie, display 130 may be a touch display).
  • the touch sensor can be a capacitive touch sensor formed from an array of transparent touch sensor electrodes, such as indium tin oxide (ITO) electrodes, or can be a touch sensor formed using other touch technologies, such as sonic touch, pressure sensitive touch, resistive touch Touch, optical touch, etc., are not limited in the embodiments of the present application.
  • ITO indium tin oxide
  • the electronic device 100 may also include an audio component 140 .
  • Audio component 140 may be used to provide audio input and output functionality for electronic device 100 .
  • Audio components 140 in electronic device 100 may include speakers, microphones, buzzers, tone generators, and other components for generating and detecting sounds.
  • Communication circuitry 120 may be used to provide electronic device 100 with the ability to communicate with external devices.
  • Communication circuitry 120 may include analog and digital input-output interface circuitry, and wireless communication circuitry based on radio frequency signals and/or optical signals.
  • Wireless communication circuitry in communication circuitry 120 may include radio frequency transceiver circuitry, power amplifier circuitry, low noise amplifiers, switches, filters, and antennas.
  • the wireless communication circuitry in the communication circuitry 120 may include circuitry for supporting Near Field Communication (NFC) by transmitting and receiving near-field coupled electromagnetic signals.
  • NFC Near Field Communication
  • the communication circuit 120 may include a near field communication antenna and a near field communication transceiver.
  • Communication circuitry 120 may also include cellular telephone transceivers and antennas, wireless local area network transceiver circuits and antennas, and the like.
  • the electronic device 100 may further include batteries, power management circuits and other input-output units 160 .
  • Input-output unit 160 may include buttons, joysticks, click wheels, scroll wheels, touch pads, keypads, keyboards, cameras, light emitting diodes and other status indicators, and the like.
  • a user may input commands through the input-output circuit 150 to control the operation of the electronic device 100 , and the output data of the input-output circuit 150 may be used to effect receiving status information and other outputs from the electronic device 100 .
  • FIG. 1B is a schematic flowchart of an audio playback control method disclosed in an embodiment of the present application. As shown in FIG. 1B , the audio playback control method is applied to an electronic device, and the electronic device is connected to a wireless headset, including the following steps :
  • the target application of the electronic device uses the wireless earphone end as the audio output path of the target audio, if it is determined that the wireless earphone is taken off, determine whether the target application responds to pause playback.
  • the target application can be any of the following: an audio playback application, a video playback application, a live broadcast application, a chat call application, etc.
  • the audio playback application refers to an application mainly used for audio playback, such as a music playback application. , reading applications or broadcasting applications, etc., are not limited here.
  • the target audio refers to any audio played through the target application.
  • the audio output channel refers to the channel through which the target audio is output.
  • the wireless earphone end is used as the audio output channel (that is, it can be played through the speaker of the earphone end or the playback device such as bone conduction)
  • the electronic device end is used as the audio output channel (and can Playing through a playback device such as a speaker on the earphone end)
  • using the wireless earphone end or the electronic device end as the audio output channel may be in the state of playing the target audio or in the state of paused playback.
  • the target audio is output through the wireless earphone.
  • the wireless earphone can detect its own wearing state. If it is detected that the wireless earphone is removed Then, the status information can be reported to the electronic device, so that after the electronic device receives the status information, it can be determined that the wireless headset is taken off.
  • the wireless earphone can report status information to the electronic device after detecting that the wireless earphone is taken off, so that the electronic device can determine that the wireless earphone is taken off.
  • the wireless earphone includes a first earphone and a second earphone
  • the first earphone is connected to the second earphone
  • the first earphone is connected to the electronic device
  • the first earphone detects that it is taken off and receives the second earphone.
  • the reported state information indicates that when the second earphone is taken off, the first earphone can report the state information that both the first earphone and the second earphone are taken off to the electronic device.
  • the wireless earphone includes a first earphone and a second earphone, and the first earphone and the second earphone are respectively connected to the electronic device, the first earphone can report the information of the first earphone to the electronic device when it detects that it has been taken off. Status information; when the second earphone detects that it is taken off, the second earphone can report the status information of the second earphone to the electronic device, so that the electronic device can determine the received state information of the first earphone and the state information of the second earphone. Both the first earphone and the second earphone are taken off.
  • the wireless earphone includes a first earphone and a second earphone
  • the first earphone is connected to the second earphone
  • the main earphone of the first earphone and the second earphone is connected to the electronic device.
  • the main earphone sends status information to the electronic device
  • the electronic device determines whether the first earphone and the second earphone are both taken off according to the obtained states of the two earphones (maybe one earphone takes off the other earphone first. removed afterward, so that the rear earphones are considered to be removed when they are removed).
  • the detection of being removed can be obtained by comparing the wearing conditions of two or more times. For example, the previous detection is a wearing state, and the latter detection is a non-wearing state, then it is determined to be removed. Of course, it can also be determined according to The situation of multiple detections is determined, and other detection methods may also be used, which is not limited in this embodiment.
  • the wireless earphone includes a single earphone or a dual earphone. If the wireless earphone is a dual earphone, the connection between the electronic device and the wireless earphone includes: at least one of the dual earphones is connected to the electronic device;
  • the target application responds to pause playback, including:
  • the connection to the electronic device can be a wireless earphone or a pair of wireless earphones. If it is a pair of wireless earphones, when it is detected that the pair of wireless earphones have been taken off, it is determined whether the target application program responds to pause playback .
  • the method further includes:
  • the target application can respond to the pause instruction, the target audio can be paused; otherwise, the target audio cannot be paused.
  • the wireless earphone can send a pause play instruction to the electronic device to instruct the electronic device to pause the target audio currently played by the target application. If the target application can respond to the pause instruction, the electronic device will pause to play the target audio, and if the target application cannot respond to the pause instruction, the electronic device will not pause to play the target audio.
  • the earphone can send status information to the electronic device after a preset time after issuing the pause instruction, so that the electronic device knows that the earphone is taken off.
  • the preset time can be set according to actual needs, for example, 4 microseconds.
  • step 101 judging whether the target application program responds to pause playback, including:
  • the electronic device can determine whether the target application program responds to the pause playback according to whether the target application program has performed the operation of pausing the playback of the target audio during the actual running process of the target application program.
  • the target application responds to pause playback, otherwise the target application does not respond to pause playback.
  • the target application may pause according to the pause playback instruction first, so that it can directly determine whether to respond according to the actual playback pause status, thereby determining the audio output path.
  • the play pause instruction may also be triggered by the user's operation on the target application on the electronic device. For example, the user's operation on the electronic device causes the target audio to be paused. Therefore, this solution performs channel switching according to the actual pause situation, without first setting a preset
  • the association relationship has strong versatility and flexibility, which is convenient for users to use.
  • judging whether the target application program responds to pause playback includes: obtaining the response information of the target application program, and determining whether the target application program responds to pause playback according to the response information, thereby determining the audio output path;
  • the specific may include:
  • the target application identification information is identification information identifying the target application, and the target application identification information may be an application name, an application serial number, an application icon, etc., which is not limited here.
  • the electronic device can obtain the process number corresponding to the audio track (audio track) currently in the active (active) state; then obtain the target application identification information corresponding to the target application program according to the process number, and a preset response relationship can be preset in the electronic device table, the response information of whether each application program in the electronic device can respond to the pause play instruction can be preset in the preset response relationship table.
  • the response information can represent the target application
  • the application can respond to the pause instruction; if the target application is configured to be unable to respond to the pause instruction, the response information may indicate that the target application cannot respond to the pause instruction.
  • the preset response relationship table can be searched according to the target application identification information, the response information corresponding to the target application identification information can be obtained, and whether the target application can respond to the suspension can be determined according to the response information. Play command.
  • a preset response relationship table can be preset to represent whether the target application can respond to the pause instruction.
  • Music and video playback music can respond to pause playback, and the preset response relationship table can be stored locally on the electronic device or in the cloud.
  • Pause playback instruction triggered by the operation of the device, etc.
  • the electronic device end is used as the audio output channel, and specifically, the target audio can be played through the speaker of the electronic device.
  • the target application does not respond to pause playback, in order to avoid directly switching to the electronic device end as the audio output channel, the electronic device end will cause an impact on the surrounding people and bring a bad experience to the user, you can continue
  • the target audio is output through the wireless earphone, so whether the user needs to manually turn off the playback of the target audio or continues to listen to the target audio through the wireless earphone, other people around will not be affected.
  • the target application responds to pause playback when the wireless headset is removed, there will be no impact of the target audio on the surrounding people. Therefore, the audio output channel corresponding to the wireless headset can be disconnected, and the electronic device end is used as the audio output channel.
  • the electronic device can play the target audio through the speaker of the electronic device, so as to ensure that the user can listen to the target audio after the wireless headset is removed.
  • the electronic device can be more flexibly controlled to switch the audio output channel, thereby improving the user experience of the user. It can be understood that after using the electronic device end as the audio output path, it also includes:
  • If the target application is an audio and video playback application, determine the wearing mode and playback volume of the wireless headset before it is taken off;
  • the wearing mode of the wireless headset is earhook and the playback volume is greater than the preset volume value, reduce the audio playback volume.
  • the above-mentioned wearing mode may be any one of the following: ear-mounted type, in-ear type or head-mounted type, which is not limited here.
  • the electronic device determines the wearing mode of the wireless headset before it is taken off. Specifically, it can obtain the headset model corresponding to the wireless headset during the process of pairing with the wireless headset and establishing a connection, and then according to the headset model of the wireless headset from the preset
  • the database searches for the corresponding earphone parameters, and the earphone parameters include the wearing mode of the wireless earphone, so that the electronic device can determine the wearing mode according to the earphone model of the wireless earphone.
  • the target application is an audio and video playback application, further determine the wearing mode and playback volume of the wireless headset before it is taken off, if the wearing mode of the wireless headset is earhook and the playback volume is greater than the preset volume If the value is set, the playback volume of the audio can be reduced to prevent the target audio output from the wireless earphones from being too loud and disturbing the surrounding people.
  • the embodiments of the present application may further include:
  • the audio output is performed on the wireless earphone end, otherwise, the audio output is performed on the electronic device end;
  • the wireless earphones are a pair of earphones, if the wireless earphones are in a wearing state, it includes: any one of the wireless earphones is in a wearing state.
  • the wireless earphone when the wireless earphone starts to play the target audio, it can be determined whether the wireless earphone is in the wearing state. If the wireless earphone is in the wearing state, the audio output is performed to the wireless earphone end; otherwise, the audio output is performed to the electronic device end.
  • the wearing state of the headset controls the audio output path of the target audio.
  • the audio playback path is determined according to the response information or the actual paused playback situation, so that when the user is not wearing headphones, some applications that cannot be paused can be prevented from being directly released through the electronic device to affect the surrounding environment or leak user privacy. It can avoid that some applications that can be paused are still output through the earphone after the earphone is removed, which is inconvenient for the user to actually use, so it is more in line with the user's needs.
  • the audio output channel is determined according to the detection result, which can further facilitate the use of the user.
  • the target application program of the electronic device uses the wireless earphone end as the audio output path of the target audio, if it is determined that the wireless earphone is taken off, it is determined whether the target application program responds to pause playback; if not, Continue to output the target audio to the wireless earphone. If so, use the electronic device as the audio output channel.
  • the target application does not respond to pause playback, continue to output the target audio through the wireless earphone, so as to select the audio output channel flexibly and reasonably , which can avoid the sound interruption of the target audio when the target audio is not paused when the earphone is removed, and avoid affecting the surrounding people when the target audio is played out through the electronic device, which will bring bad users to the user. experience.
  • FIG. 2 is a schematic flowchart of another audio playback control method disclosed in an embodiment of the present application.
  • the audio playback control method is applied to an electronic device, and the electronic device is connected to at least one of a pair of wireless earphones, and the method includes the following steps:
  • the response information of the target application of the electronic device is obtained, and the response information is used to indicate whether the target application can respond to the pause instruction sent by the wireless earphone terminal.
  • the target application can be any of the following: an audio playback application, a video playback application, a live broadcast application, a chat call application, etc.
  • the audio playback application refers to an application mainly used for audio playback, such as a music playback application. , reading applications or broadcasting applications, etc., are not limited here.
  • the electronic device obtains the status information that the wireless earphone is taken off, and specifically, can receive the status information reported by the wireless earphone. It can be understood that if the wireless earphone includes a first earphone and a second earphone, the first earphone is connected to the second earphone, and the first earphone is connected to the electronic device, then the first earphone detects that it is taken off and receives the second earphone. The reported state information indicates that when the second earphone is taken off, the first earphone can report the state information that both the first earphone and the second earphone are taken off to the electronic device.
  • the wireless earphone includes a first earphone and a second earphone, and the first earphone and the second earphone are respectively connected to the electronic device, the first earphone can report the information of the first earphone to the electronic device when it detects that it has been taken off. Status information; when the second earphone detects that it is taken off, the second earphone can report the status information of the second earphone to the electronic device, so that the electronic device can determine the received state information of the first earphone and the state information of the second earphone. Both the first earphone and the second earphone are taken off.
  • the wireless earphone includes a first earphone and a second earphone
  • the first earphone is connected to the second earphone
  • the main earphone of the first earphone and the second earphone is connected to the electronic device.
  • the main earphone sends status information to the electronic device
  • the electronic device determines whether the first earphone and the second earphone are both taken off according to the obtained states of the two earphones (maybe one earphone takes off the other earphone first. removed afterward, so that the rear earphones are considered to be removed when they are removed).
  • the detection of being removed can be obtained by comparing the wearing conditions of two or more times. For example, the previous detection is a wearing state, and the latter detection is a non-wearing state, then it is determined to be removed. Of course, it can also be determined according to The situation of multiple detections is determined, and other detection methods may also be used, which is not limited in this embodiment.
  • the response information of the target application program of the electronic device is obtained, including:
  • the target application identification information is identification information identifying the target application, and the target application identification information may be an application name, an application serial number, an application icon, etc., which is not limited here.
  • the electronic device can obtain the process number corresponding to the audio track (audio track) currently in the active state; and then obtain the target application identification information corresponding to the target application program according to the process number, which can be preset in the electronic device.
  • the preset response relationship table can be preset in the preset response relationship table. Whether each application program in the electronic device can respond to the response information of the pause play instruction can be preset. In this way, after obtaining the target application identification information of the target application The identification information searches the preset response relationship table to obtain response information corresponding to the identification information of the target application.
  • the preset response relationship table may be preset in the electronic device or in the cloud. By setting the response relationship table, the response of the target application program can be determined, so as to timely and accurately determine a reasonable audio output path, which is convenient for users to use.
  • the acquisition of the state information representing that both the pair of wireless earphones are taken off can be obtained after the pause instruction is acquired, and the method further includes:
  • the target application program When the pause playback instruction is obtained, the target application program responds to the pause playback instruction to pause playback of the target audio, or the target application does not respond to the pause playback instruction to continue playing the target audio.
  • the electronic device will pause to play the target audio, and if the target application cannot respond to the pause instruction, the electronic device will not pause to play the target audio.
  • the electronic device may determine, according to the response information, that the audio output path of the target application is the electronic device end or the wireless earphone end.
  • the response information is represented as the target application program can respond to the pause playback instruction to pause playback of the target audio
  • the audio output path of the target application program is determined according to the response information, including:
  • that the electronic device end is an audio output channel may specifically refer to the speaker of the electronic device as an audio output channel.
  • the target application can respond to the pause playback instruction to pause the playback of the target audio when the wireless headset is removed, there will be no impact of the target audio on the surrounding people. Therefore, the audio output channel corresponding to the wireless headset can be disconnected.
  • the electronic device end is the audio output channel.
  • the response information is represented as the target application program can respond to the pause playback instruction to pause playback of the target audio
  • the audio output path of the target application program is determined according to the response information, including:
  • the response information is characterized as the target application program can respond to the pause playback instruction to pause playback of the target audio, keep the audio output path at the wireless headset end, and continue to output the target audio through the wireless headset, so as to avoid the target audio when the headset is removed.
  • the target audio affects the surrounding people when the target audio is played out through the electronic device, which brings a bad user experience to the user.
  • the audio output path of the target application program is determined according to the response information, including:
  • the response information is characterized as the target application program cannot respond to the pause playback instruction to pause playback of the target audio, keep the audio output channel at the wireless earphone end, and continue to output the target audio through the wireless earphone, so as to avoid the need for the earphone to be removed.
  • the sound of the target audio is interrupted when the playback of the target audio is not paused, and the surrounding people are prevented from being affected when the target audio is played externally through the electronic device, which brings a bad user experience to the user.
  • the last one can be combined with any of the previous two audio output channel selection schemes, so as to meet different application requirements.
  • the method further includes:
  • the wireless earphone end is determined as the audio output channel, and the target audio is transmitted to the wireless earphone end.
  • the electronic device After the target audio is paused, if the electronic device receives the playback instruction, it will resume playing the target audio, and if it is determined that at least one of the wireless headphones is in a wearing state, it is determined that the wireless earphone end is used as the audio output channel, and the wireless earphone is sent to the wireless earphone. end to transmit the target audio.
  • step A1 it further includes:
  • the electronic device end is used as the audio output channel, and the speaker of the electronic device is controlled to play the target audio.
  • the electronic device After the target audio is suspended, if the electronic device receives the playback instruction, it will resume playing the target audio. If a pair of wireless earphones are both in a non-wearing state, it is determined that the electronic device is used as the audio output channel to control the electronic device. The speaker plays the target audio, thereby ensuring that the user can hear the target audio.
  • the response information of the target application program of the electronic device is obtained, and the response information is used to indicate whether the target application program can respond to the wireless earphone terminal.
  • the audio output channel can be flexibly switched according to the situation to improve the user experience.
  • FIG. 3 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the electronic device includes: a processor 310 , a communication interface 330 and a memory 320 ; and one or more programs 321 , one or more programs 321 are stored in the memory 320, and are configured to be executed by the processor, the electronic device is connected with the wireless headset, the program 321 includes instructions for performing the following steps:
  • the target application program of the electronic device uses the wireless earphone end as the audio output path of the target audio, if it is determined that the wireless earphone is taken off, it is determined whether the target application program responds to pause playback;
  • the wireless earphone includes a single earphone or a dual earphone. If the wireless earphone is a dual earphone, connecting the electronic device with the wireless earphone includes: connecting at least one of the dual earphones to the electronic device; if it is determined that the wireless earphone is taken off , in judging whether the target application program responds to pausing playback, program 321 includes instructions for performing the following steps:
  • the program 321 before judging whether the target application responds to pausing playback, the program 321 further includes instructions for performing the following steps:
  • the target application can respond to the pause instruction, the target audio can be paused; otherwise, the target audio cannot be paused.
  • program 321 includes instructions for performing the following steps:
  • program 321 includes instructions for performing the following steps:
  • the preset response relationship table is searched according to the target application identification information, and the response information corresponding to the target application identification information is obtained, and the response information is used to represent whether the target application program can respond to the pause playback instruction.
  • program 321 also includes instructions for performing the following steps:
  • the audio output is performed on the wireless earphone end, otherwise, the audio output is performed on the electronic device end;
  • the wireless earphones are a pair of earphones, if the wireless earphones are in a wearing state, it includes: any one of the wireless earphones is in a wearing state.
  • the electronic device is connected to at least one of a pair of wireless earphones, and the program 321 includes instructions for performing the following steps:
  • the response information of the target application program of the electronic device is obtained, and the response information is used to indicate whether the target application program can respond to the pause play instruction sent by the wireless earphone terminal;
  • the program 321 after acquiring the state information representing that a pair of wireless earphones are both taken off, the program 321 includes an instruction for executing the following steps after acquiring the instruction to pause playback:
  • the target application program When the playback pause instruction is obtained, the target application program responds to the playback pause instruction to pause playback of the target audio, or the target application does not respond to the playback pause instruction to continue playback of the target audio.
  • the program 321 when the response information represents that the target application can respond to the pause play instruction to pause the playback of the target audio, in terms of determining the audio output path of the target application according to the response information, the program 321 further includes steps for performing the following steps: command:
  • the program 321 when the response information represents that the target application can respond to the pause playback instruction to pause the playback of the target audio, in terms of determining the audio output path of the target application according to the response information, the program 321 includes the following steps: instruction:
  • the program 321 includes steps for performing the following steps: command:
  • program 321 also includes instructions for performing the following steps:
  • the wireless earphone end is determined as the audio output channel, and the target audio is transmitted to the wireless earphone end.
  • program 321 also includes instructions for performing the following steps:
  • the electronic device end is used as the audio output channel, and the speaker of the electronic device is controlled to play the target audio.
  • the program 321 includes instructions for performing the following steps:
  • the preset response relationship table is searched according to the target application identification information, and the response information corresponding to the target application identification information is obtained.
  • FIG. 4 is a schematic structural diagram of an audio playback control apparatus provided in this embodiment, which is applied to electronic equipment, and the electronic equipment is connected to a wireless headset.
  • the audio playback control apparatus includes a judgment unit 401 and a processing unit 402 , wherein ,
  • Judging unit 401 is used for when the target application program of the electronic device uses the wireless earphone end as the audio output path of the target audio, if it is determined that the wireless earphone is taken off, then judge whether the target application program responds to pause playback;
  • the processing unit 402 is configured to continue outputting the target audio to the wireless earphone if the target application program does not respond to the pause of playback; if the target application program responds to the pause of playback, the electronic device end is used as the audio output channel.
  • the wireless earphones include single earphones or dual earphones. If the wireless earphones are dual earphones, the connection between the electronic device and the wireless earphones includes: at least one of the dual earphones is connected to the electronic device; In terms of whether the application program responds to pausing playback, the judging unit 401 is specifically used for:
  • processing unit 402 is further configured to:
  • the target application can respond to the pause instruction, the target audio can be paused; otherwise, the target audio cannot be paused.
  • the judging unit 401 is specifically used for:
  • the judging unit 401 is used to: obtain the response information of the target application program, and determine whether the target application program responds to pause playback according to the response information, thereby determining the audio output path; Specifically, it can be used for,
  • the preset response relationship table is searched according to the target application identification information, and the response information corresponding to the target application identification information is obtained, and the response information is used to represent whether the target application program can respond to the pause playback instruction.
  • processing unit 402 is also used for:
  • the audio output is performed on the wireless earphone end, otherwise, the audio output is performed on the electronic device end;
  • the wireless earphones are a pair of earphones, if the wireless earphones are in a wearing state, it includes: any one of the wireless earphones is in a wearing state.
  • the target application program of the electronic device uses the wireless earphone end as the audio output path of the target audio, if it is determined that the wireless earphone is taken off, it is determined whether the target application program responds to pause playback; if not, Continue to output the target audio to the wireless earphone. If so, use the electronic device as the audio output channel.
  • the target application does not respond to pause playback, continue to output the target audio through the wireless earphone, so as to select the audio output channel flexibly and reasonably , which can avoid the sound interruption of the target audio when the target audio is not paused when the earphone is removed, and avoid affecting the surrounding people when the target audio is played out through the electronic device, which will bring bad users to the user. experience.
  • FIG. 5 is a schematic structural diagram of an audio playback control apparatus provided in this embodiment, which is applied to at least one connection between an electronic device and a pair of wireless headphones.
  • the audio playback control apparatus includes an acquisition unit 501 and a determination unit 502. in,
  • the obtaining unit 501 is used for obtaining the response information of the target application of the electronic device when the state information representing that a pair of wireless earphones are both taken off is obtained, and the response information is used to characterize whether the target application can respond to the information sent by the wireless earphone terminal. Pause playback command;
  • the determining unit 502 is configured to determine the audio output path of the target application according to the response information.
  • the determining unit 502 is further configured to:
  • the target application program When the playback pause instruction is obtained, the target application program responds to the playback pause instruction to pause playback of the target audio, or the target application does not respond to the playback pause instruction to continue playback of the target audio.
  • the determining unit 502 is specifically used for:
  • the determining unit 502 is specifically used for:
  • the determining unit 502 is specifically used for:
  • determining unit 502 is also used for:
  • the wireless earphone end is determined as the audio output channel, and the target audio is transmitted to the wireless earphone end.
  • determining unit 502 is also used for:
  • the electronic device end is used as the audio output channel, and the speaker of the electronic device is controlled to play the target audio.
  • the obtaining unit is specifically used for:
  • the response information of the target application program of the electronic device is obtained, and the response information is used to indicate whether the target application program can respond to the wireless earphone terminal.
  • the audio output channel can be flexibly switched according to the situation to improve the user experience.
  • each program module of the audio playback control device in this embodiment can be specifically implemented according to the methods in the above method embodiments, and the specific implementation process can refer to the relevant descriptions of the above method embodiments, which will not be repeated here. .
  • FIG. 6 is an audio playback control system provided by an embodiment of the present application, including an electronic device and a wireless headset, and the electronic device is connected to the wireless headset, wherein,
  • the wireless headset determines to change from the wearing state to the non-wearing state, or, the wireless headset determines that it changes from the wearing state to the non-wearing state and the target application of the electronic device is in the playing state,
  • the electronic device After the electronic device receives the pause playback instruction, if the target application can respond to the pause playback instruction, it pauses the playback of the target audio;
  • the wireless headset sends a state change instruction to the electronic device within a preset time after sending the pause play instruction to the electronic device; after the electronic device receives the state change instruction, it obtains the response information of the target application, and determines the target application according to the response information. audio playback channel.
  • the wireless headset can send a pause playback instruction to the electronic device , if the target application can respond to the pause instruction, the electronic device pauses to play the target audio; if the target application cannot respond to the pause instruction, it continues to play the target audio.
  • the above response information is used to represent whether the target application can respond to the pause instruction.
  • the electronic device can receive the state change instruction sent by the wireless headset within a preset time after receiving the pause instruction.
  • the state change instruction is used to instruct the wireless headset to change from the wearing state to the non-wearing state. After the electronic device receives the state change instruction , obtain the response information of the target application, and determine the audio playback path of the target application according to the response information.
  • the audio output path of the target application is determined according to the response information, including:
  • the audio output path of the target application is determined according to the response information, including:
  • the audio output path of the target application program is determined according to the response information, including:
  • the response information of the target application program of the electronic device is obtained, and the response information is used to indicate whether the target application program can respond to the information sent by the wireless headset terminal.
  • Pause playback instruction determine the audio output path of the target application according to the response information. In this way, when the wireless earphones are all taken off, the audio output path can be flexibly switched according to whether the target application can respond to the pause playback instruction to improve the user experience.
  • FIG. 7 is another audio playback control system provided by an embodiment of the present application, including an electronic device and a wireless earphone.
  • the wireless earphone includes a first earphone and a second earphone, and the electronic device is connected to at least one earphone of the wireless earphone. ,in,
  • any one of the wireless earphones is determined to change from the wearing state to the non-wearing state, or, if any one of the wireless earphones is determined to change from the wearing state to the non-wearing state and the target application of the electronic device is in the playing state,
  • the wireless earphone determines that both earphones are taken off, send status information to the electronic device;
  • the electronic device obtains the response information of the target application after receiving the status information
  • the electronic device determines the audio playback path of the target application according to the response information.
  • the above response information is used to represent whether the target application can respond to the pause instruction.
  • the state change instruction is used to instruct the wireless headset to change from the wearing state to the non-wearing state.
  • any earphone of the wireless earphone is determined to change from the wearing state to the non-wearing state, or, if any earphone of the wireless earphone is determined to change from the wearing state to the non-wearing state and the target application of the electronic device is in the playing state, Then send a pause play instruction to the electronic device. If the wireless earphones determine that both earphones are taken off, status information is sent to the electronic device.
  • the electronic device After the electronic device receives the pause instruction, if the target application of the electronic device can respond to the pause instruction, it will pause the playback of the target audio; if the target application of the electronic device cannot respond to the pause instruction, it will continue to play the target audio. After receiving the status information, the electronic device can obtain the response information of the target application, and determine the audio playback path of the target application according to the response information.
  • the audio output path of the target application is determined according to the response information, including:
  • the audio output path of the target application is determined according to the response information, including:
  • the audio output path of the target application program is determined according to the response information, including:
  • the response information of the target application of the electronic device is obtained, and the response information is used to indicate whether the target application can respond to the wireless earphone terminal.
  • Pause playback instruction sent determine the audio output path of the target application program according to the response information. In this way, when the wireless earphones are all taken off, the audio output path can be flexibly switched according to whether the target application program can respond to the pause playback instruction, improving the user experience. experience.
  • Embodiments of the present application further provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, and the computer program causes a computer to execute any one of the image processing method embodiments described above.
  • the above-mentioned computer includes an electronic device.
  • Embodiments of the present application further provide a computer program product, where the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute any one of the method embodiments described above. Some or all of the steps of an image processing method.
  • the computer program product may be a software installation package, and the computer includes an electronic device.
  • the disclosed apparatus may be implemented in other manners.
  • the device embodiments described above are only illustrative.
  • the division of the above-mentioned units is only a logical function division.
  • multiple units or components may be combined or integrated. to another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical or other forms.
  • the units described above as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the above-mentioned integrated units if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable memory.
  • the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art, or all or part of the technical solution, and the computer software product is stored in a memory.
  • a computer device which may be a personal computer, a server, or a network device, etc.
  • the aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Telephone Function (AREA)
  • Headphones And Earphones (AREA)
  • Circuit For Audible Band Transducer (AREA)

Abstract

本申请实施例公开了一种音频播放控制方法、装置、电子设备及存储介质,其中方法包括:在电子设备的目标应用程序以无线耳机端作为目标音频的音频输出通路时,若确定无线耳机被摘下,则判断目标应用程序是否响应暂停播放;若否,继续对无线耳机输出目标音频,若是,则以电子设备端为音频输出通路,如此,可灵活、合理地选择音频输出通路,从而可避免在使用耳机时,给用户带来不好的用户体验。

Description

音频播放控制方法、装置、电子设备及存储介质 技术领域
本申请涉及通信技术领域,具体涉及一种音频播放控制方法、装置、电子设备及存储介质。
背景技术
电子设备的音频输出方式主要包括扬声器输出和耳机输出,目前用户通常先将电子设备与无线耳机进行配对连接,将无线耳机佩戴在耳朵上作为音频输出通路播放音频信号。
发明内容
本申请实施例提供了一种音频播放控制方法、装置、电子设备及存储介质。
本申请实施例第一方面提供一种音频播放控制方法,应用于电子设备,所述电子设备与无线耳机进行连接,所述方法包括:
在所述电子设备的目标应用程序以所述无线耳机端作为目标音频的音频输出通路时,若确定所述无线耳机被摘下,则判断所述目标应用程序是否响应暂停播放;
若否,继续对所述无线耳机输出所述目标音频,若是,则以所述电子设备端为音频输出通路。
本申请实施例第二方面提供一种音频播放控制方法,应用于电子设备,所述电子设备与一对无线耳机的至少一个连接,所述方法包括:
当获取到表征所述一对无线耳机均被摘下的状态信息时,获取所述电子设备的目标应用程序的响应信息,所述响应信息用于表征所述目标应用程序能否响应所述无线耳机端发送的暂停播放指令;
根据所述响应信息确定所述目标应用程序的音频输出通路。
本申请实施例第三方面提供一种音频播放控制装置,应用于电子设备,所述电子设备与无线耳机进行连接,所述音频播放控制装置包括:
判断单元,用于在所述电子设备的目标应用程序以所述无线耳机端作为目标音频的音频输出通路时,若确定所述无线耳机被摘下,则判断所述目标应用程序是否响应暂停播放;
处理单元,用于若所述目标应用程序未响应暂停播放,继续对所述无线耳机输出所述目标音频;若所述目标应用程序响应暂停播放,则以所述电子设备端为音频输出通路。
本申请实施例第四方面提供一种音频播放控制装置,应用于电子设备,所述电子设备与一对无线耳机中的至少一个连接,所述音频播放控制装置包括:
获取单元,用于当获取到表征所述一对无线耳机均被摘下的状态信息时,获取所述电子设备的目标应用程序的响应信息,所述响应信息用于表征所述目标应用程序能否响应所述无线耳机端发送的暂停播放指令;
确定单元,用于根据所述响应信息确定所述目标应用程序的音频输出通路。
本申请实施例第五方面提供一种音频播放控制系统,包括电子设备和无线耳机,所述电子设备与所述无线耳机连接,其中,
若所述无线耳机确定从佩戴状态变化为非佩戴状态,或,所述无线耳机确定从佩戴状态变化为非佩戴状态且所述电子设备的目标应用程序处于播放状态,
则发送暂停播放指令给所述电子设备;
所述电子设备接收到所述暂停播放指令后,若所述目标应用程序能够响应所述暂停播放指令,则暂停播放目标音频;
若所述目标应用程序不能够响应所述暂停播放指令,则继续播放目标音频;
所述无线耳机在发送所述暂停播放指令给所述电子设备之后的预设时间内,发送状态变化指令给所述电子设备;所述电子设备接收到所述状态变化指令后,获取所述目标应用程序的响应信息,并根据所述响应信息确定所述目标应用程序的音频播放通路。
本申请实施例第六方面提供一种音频播放控制系统,包括电子设备和无线耳机,所述无线耳机包括第一耳机和第二耳机,所述电子设备至少与所述无线耳机的一个耳机连接,其中,
若所述无线耳机的任一耳机确定从佩戴状态变为非佩戴状态,或者,若所述无线耳机的任一耳机确定从佩戴状态变为非佩戴状态且所述电子设备的目标应用程序处于播放状态,
则发送暂停播放指令给所述电子设备,所述电子设备接收到所述暂停播放指令后,若所述电子设备的目标应用程序能够响应所述暂停播放指令,则暂停播放目标音频;
若所述电子设备的目标应用程序不能够响应所述暂停播放指令,则继续播放目标音频;
若所述无线耳机确定两个耳机均被摘下,则向所述电子设备发送状态信息;
所述电子设备接收所述状态信息后获取所述目标应用程序的响应信息;
所述电子设备根据所述响应信息确定所述目标应用程序的音频播放通路。
本申请实施例第七方面提供一种电子设备,包括:处理器和存储器;以及一个或多个程序,所述一个或多个程序被存储在所述存储器中,并且被配置成由所述处理器执行,所述程序包括用于如本申请实施例第一方面或第二方面中所描述的部分或全部步骤的指令。
本申请实施例第八方面提供一种计算机可读存储介质,其中,所述计算机可读存储介质用于存储计算机程序,其中,所述计算机程序使得计算机执行如本申请实施例第一方面或第二方面中所描述的部分或全部步骤的指令。
本申请实施例第九方面提供一种计算机程序产品,其中,所述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,所述计算机程序可操作来使计算机执行如本申请实施例第一方面或第二方面中所描述的部分或全部步骤。该计算机程序产品可以为一个软件安装包。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍。
图1A是本申请实施例公开的一种电子设备的结构示意图;
图1B是本申请实施例公开的一种音频播放控制方法的流程示意图;
图2是本申请实施例公开的另一种音频播放控制方法的流程示意图;
图3是本申请实施例公开的又一种音频播放控制方法的流程示意图;
图4是本申请实施例公开的一种电子设备的结构示意图;
图5是本申请实施例公开的一种音频播放控制装置的结构示意图;
图6是本申请实施例公开的一种音频播放控制系统的架构示意图;
图7是本申请实施例公开的一种音频播放控制系统的架构示意图。
具体实施方式
为了使本技术领域的人员更好地理解本发明方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别不同 对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可以理解还包括没有列出的步骤或单元,或可以理解还包括对于这些过程、方法、产品或设备固有的其他步骤或单元。
还应当进一步理解,在本发明说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本发明的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。
在实际应用无线耳机的场景中,会因为在无线耳机端与电子设备端进行音频输出通路选择上的不合理,给用户带来不好的用户体验。
本申请实施例中描述的电子设备可以包括各种具有无线通信功能的手持设备、车载设备、无线耳机、计算设备或连接到无线调制解调器的其他处理设备,以及各种形式的用户设备(user equipment,UE),移动台(mobile station,MS),终端设备(terminal device)等等,电子设备例如可以为智能手机、平板电脑、耳机盒、穿戴式设备等等。为方便描述,上面提到的设备统称为电子设备。
本申请实施例中,无线耳机具体可以为:蓝牙耳机、真无线立体声(true wireless stereo,TWS)耳机,当然也可以为其他的基于无线传输的耳机,例如光传导耳机等等,上述蓝牙耳机可以为普通的蓝牙耳机,即通过喇叭播放声音的耳机,当然上述蓝牙耳机还可以为骨传导耳机,本申请对无线耳机的声音传导方式并不限定。上述无线耳机可以与电子设备建立无线连接,
可以理解,无线耳机可以为挂耳式耳机,也可以为入耳式耳机,也可以为头戴式耳机,本申请实施例不做限定。
请参阅图1A,图1A是本申请实施例公开的一种电子设备的结构示意图,电子设备100包括存储和处理电路110,以及与存储和处理电路110连接的传感器170,其中:
电子设备100可以包括控制电路,该控制电路可以包括存储和处理电路110。该存储和处理电路110可以包括存储器,例如硬盘驱动存储器,非易失性存储器(例如闪存或用于形成固态驱动器的其它电子可编程只读存储器等),易失性存储器(例如静态或动态随机存取存储器等)等,本申请实施例不作限制。存储和处理电路110中的处理电路可以用于控制电子设备100的运转。该处理电路可以基于一个或多个微处理器,微控制器,数字信号处理器,基带处理器,功率管理单元,音频编解码器芯片,专用集成电路,显示驱动器集成电路等来实现。
存储和处理电路110可用于运行电子设备100中的软件,例如互联网浏览应用程序,互联网协议语音(Voice over Internet Protocol,VOIP)电话呼叫应用程序,电子邮件应用程序,媒体播放应用程序,操作系统功能等。这些软件可以用于执行一些控制操作,例如,基于照相机的图像采集,基于环境光传感器的环境光测量,基于接近传感器的接近传感器测量,基于诸如发光二极管的状态指示灯等状态指示器实现的信息显示功能,基于触摸传感器的触摸事件检测,与在多个(例如分层的)显示屏上显示信息相关联的功能,与执行无线通信功能相关联的操作,与收集和产生音频信号相关联的操作,与收集和处理按钮按压事件数据相关联的控制操作,以及电子设备100中的其它功能等,本申请实施例不作限制。
电子设备100可以包括输入-输出电路150。输入-输出电路150可用于使电子设备100实现数据的输入和输出,即允许电子设备100从外部设备接收数据和也允许电子设备100 将数据从电子设备100输出至外部设备。输入-输出电路150可以进一步包括传感器170。传感器170可以包括超声波指纹识别模组,还可以包括环境光传感器,基于光和电容的接近传感器,触摸传感器(例如,基于光触摸传感器和/或电容式触摸传感器,其中,触摸传感器可以是触控显示屏的一部分,也可以作为一个触摸传感器结构独立使用),加速度传感器,和其它传感器等,超声波指纹识别模组可以集成于屏幕下方,或者,超声波指纹识别模组可以设置于电子设备的侧面或者背面,在此不作限定,该超声波指纹识别模组可以用于采集指纹图像。
传感器170可以包括第一摄像头和第二摄像头,第一摄像头可以为前置摄像头或者后置摄像头,第二摄像头可以为前置摄像头或者后置摄像头,第二摄像头可以为红外(Infrared Radiation,IR)摄像头或者可见光摄像头,IR摄像头在拍摄时,瞳孔反射红外光,因此IR摄像头在拍摄瞳孔图像会比RGB相机更加准确;可见光摄像头需要进行更多的后续瞳孔检测,计算精度和准确性比IR摄像头要高,通用性比IR摄像头更好,但是计算量大。
输入-输出电路150还可以包括一个或多个显示屏,例如显示屏130。显示屏130可以包括液晶显示屏,有机发光二极管显示屏,电子墨水显示屏,等离子显示屏,使用其它显示技术的显示屏中一种或者几种的组合。显示屏130可以包括触摸传感器阵列(即,显示屏130可以是触控显示屏)。触摸传感器可以是由透明的触摸传感器电极(例如氧化铟锡(ITO)电极)阵列形成的电容式触摸传感器,或者可以是使用其它触摸技术形成的触摸传感器,例如音波触控,压敏触摸,电阻触摸,光学触摸等,本申请实施例不作限制。
电子设备100还可以包括音频组件140。音频组件140可以用于为电子设备100提供音频输入和输出功能。电子设备100中的音频组件140可以包括扬声器,麦克风,蜂鸣器,音调发生器以及其它用于产生和检测声音的组件。
通信电路120可以用于为电子设备100提供与外部设备通信的能力。通信电路120可以包括模拟和数字输入-输出接口电路,和基于射频信号和/或光信号的无线通信电路。通信电路120中的无线通信电路可以包括射频收发器电路、功率放大器电路、低噪声放大器、开关、滤波器和天线。举例来说,通信电路120中的无线通信电路可以包括用于通过发射和接收近场耦合电磁信号来支持近场通信(Near Field Communication,NFC)的电路。例如,通信电路120可以包括近场通信天线和近场通信收发器。通信电路120还可以包括蜂窝电话收发器和天线,无线局域网收发器电路和天线等。
电子设备100还可以进一步包括电池,电力管理电路和其它输入-输出单元160。输入-输出单元160可以包括按钮,操纵杆,点击轮,滚动轮,触摸板,小键盘,键盘,照相机,发光二极管和其它状态指示器等。
用户可以通过输入-输出电路150输入命令来控制电子设备100的操作,并且可以使用输入-输出电路150的输出数据以实现接收来自电子设备100的状态信息和其它输出。
下面对本申请实施例进行详细介绍。
请参阅图1B,图1B是本申请实施例公开的一种音频播放控制方法的流程示意图,如图1B所示,该音频播放控制方法应用于电子设备,电子设备与无线耳机连接,包括如下步骤:
101、在电子设备的目标应用程序以无线耳机端作为目标音频的音频输出通路时,若确定无线耳机被摘下,则判断目标应用程序是否响应暂停播放。
其中,目标应用程序可以为以下任意一种:音频播放应用、视频播放应用、直播应用、聊天通话应用等等,音频播放应用是指主要用于进行音频播放的应用程序,例如可以是音乐播放应用、读书应用或广播应用等,此处不作限制。
其中,目标音频是指通过目标应用程序进行播放的任一音频。
其中,音频输出通路是指目标音频通过哪个通道输出,例如以无线耳机端作为音频输 出通路(即能够通过耳机端的扬声器或骨传导等播放设备播放),以电子设备端作为音频输出通路(及能够通过耳机端的扬声器等播放设备播放),需要说明的是,以无线耳机端或者电子设备端作为音频输出通路可以是正在播放目标音频的状态也可以是暂停播放的状态。
具体实施中,电子设备在运行目标应用程序时,通过无线耳机输出目标音频,在用户使用无线耳机收听目标音频的过程中,无线耳机可对自身的佩戴状态进行检测,若检测到无线耳机被摘下,可向电子设备上报状态信息,从而,电子设备接收到该状态信息之后,可确定无线耳机被摘下。
可以理解,若无线耳机包括单耳机,则该无线耳机可在检测到自身被摘下之后,向电子设备上报状态信息,从而,电子设备可确定无线耳机被摘下。
可以理解,若无线耳机包括第一耳机和第二耳机,第一耳机与第二耳机连接,第一耳机与电子设备连接,则第一耳机在检测到自身被摘下,且接收到第二耳机上报的状态信息表征第二耳机被摘下时,第一耳机可向电子设备上报第一耳机与第二耳机均被摘下的状态信息。
可以理解,若无线耳机包括第一耳机和第二耳机,第一耳机、第二耳机分别与电子设备连接,则第一耳机在检测到自身被摘下时,可向电子设备上报第一耳机的状态信息;第二耳机在检测到自身被摘下时,可向电子设备上报第二耳机的状态信息,从而,电子设备可根据接收到的第一耳机的状态信息和第二耳机的状态信息确定第一耳机与第二耳机均被摘下。
可以理解,若无线耳机包括第一耳机和第二耳机,第一耳机与第二耳机连接,第一耳机与第二耳机中的主耳机与电子设备连接,当两个耳机中的任一耳机检测到被摘下时,通过主耳机发送状态信息给电子设备,电子设备根据获取到的两个耳机的状态确定第一耳机与第二耳机是否均被摘下(可能是一个耳机先摘下一个耳机后摘下,以在后耳机被摘下时认为均被摘下)。
可以理解,检测被摘下,可以是根据两次或多次检测佩戴情况进行比较得到,例如前一次检测为佩戴状态,后一次检测为非佩戴状态,则确定为被摘下,当然还可以根据多次检测的情况确定,还可以是其他检测方法,本实施例对此不做限定。
可以理解,无线耳机包括单耳机或双耳机,若无线耳机为双耳机,则电子设备与无线耳机连接包括:双耳机中的至少一个与电子设备连接;
若确定无线耳机被摘下,则判断目标应用程序是否响应暂停播放,包括:
若确定双耳机均被摘下,则判断目标应用程序是否响应暂停播放。
其中,与电子设备连接的可以是一个无线耳机,也可以是一对无线耳机,若为一对无线耳机,则在检测到一对无线耳机都被摘下时,判断目标应用程序是否响应暂停播放。
可以理解,在判断目标应用程序是否响应暂停播放之前,该方法还包括:
接收由无线耳机发送的暂停播放指令;
若目标应用程序能够响应暂停播放指令,则能够暂停播放目标音频,否则不能够暂停播放目标音频。
其中,当与电子设备连接的无线耳机摘下时,无线耳机可向电子设备发送暂停播放指令,以指示电子设备暂停目标应用程序当前播放的目标音频。若目标应用程序能够响应该暂停播放指令,则电子设备会暂停播放目标音频,若目标应用程序不能够响应该暂停播放指令,则电子设备不会暂停播放目标音频。耳机可以在发出暂停播放指令后经过预设时间再发送状态信息给电子设备,以使得电子设备获知该耳机被摘下,该预设时间可以根据实际需要进行设定,例如4微秒。
可以理解,上述步骤101中,判断目标应用程序是否响应暂停播放,包括:
11、判断目标应用程序是否暂停播放目标音频。
本申请实施例中,电子设备可根据目标应用程序实际运行过程中是否执行了暂停播放目标音频的操作来判断目标应用程序是否响应暂停播放,若目标应用程序执行了暂停播放目标音频的操作,则目标应用程序响应暂停播放,否则目标应用程序未响应暂停播放。该应用场景下,因为无线耳机发送的暂停播放指令在状态信息之前发出,因此目标应用程序可能先根据暂停播放指令暂停,从而可以直接根据实际是否暂停播放状态来确定是否响应从而确定音频输出通路,该暂停播放指令也可以是用户在电子设备端对目标应用程序的操作触发的,例如用户对电子设备的操作使得目标音频暂停播放,因此该方案根据实际暂停情况进行通路切换,无需先设置预设关联关系,通用性强,灵活性好,方便了用户使用。
可以理解,上述步骤101中,判断目标应用程序是否响应暂停播放,包括:获取目标应用程序的响应信息,根据响应信息确定目标应用程序是否响应暂停播放,从而确定音频输出通路;具体的可包括:
12、获取当前处于激活状态的音轨对应的进程号;
13、根据进程号获取目标应用程序的目标应用标识信息;
14、根据目标应用标识信息查找预设响应关系表,得到与目标应用标识信息对应的响应信息,响应信息用于表征目标应用程序能否响应暂停播放指令。
其中,目标应用标识信息为标识目标应用程序的标识信息,目标应用标识信息可以为应用程序名称、应用程序序号、应用程序图标等,此处不作限制。
电子设备可获取当前处于激活(active)状态的音轨(audio track)对应的进程号;然后根据该进程号获取与目标应用程序对应的目标应用标识信息,电子设备中可预先设置预设响应关系表,预设响应关系表中可预先设置电子设备中各个应用程序分别能否响应暂停播放指令的响应信息,例如,若目标应用程序被配置为能够响应暂停播放指令,则该响应信息可表征目标应用程序能够响应暂停播放指令;若目标应用程序被配置为不能够响应暂停播放指令,则该响应信息可表征目标应用程序不能够响应暂停播放指令。如此,在获取目标应用程序的目标应用标识信息之后,可根据目标应用标识信息查找预设响应关系表,得到与目标应用标识信息对应的响应信息,根据该响应信息确定目标应用程序能否响应暂停播放指令。
需要说明的是,该实施例可以预先设置一个预设响应关系表用来表征目标应用程序能否响应暂停播放指令,例如直播应用不能响应暂停播放,视频/语音通话应用不能响应暂停播放,音乐播放音乐、视频播放音乐能够响应暂停播放,该预设响应关系表可以存储在电子设备本地也可以存储在云端,该暂停播放指令可以是无线耳机摘下后发出的,也可以是检测到用户对电子设备的操作触发的暂停播放指令等。该实施例无需判断目标音频是否实际暂停播放,而是获取响应信息来确定是否响应播放暂停,准确性好,方便了用户使用。
102、若否,继续对无线耳机输出目标音频,若是,则以电子设备端为音频输出通路。
其中,以电子设备端为音频输出通路,具体可通过电子设备的扬声器播放目标音频。
其中,若目标应用程序未响应暂停播放,则为了避免直接切换到电子设备端为音频输出通路后,电子设备端外放导致对周围的人造成影响,给用户带来不好的体验,可以继续通过无线耳机输出目标音频,从而,无论接下来用户是需要手动关闭对目标音频的播放,还是继续通过无线耳机收听目标音频,都不会影响周围其他人。
若目标应用程序在无线耳机摘下时响应暂停播放,则不存在目标音频外放给周围人带来的影响,因此,可断开无线耳机对应的音频输出通路,以电子设备端为音频输出通路,当接下来用户手动控制目标应用程序取消暂停播放时,电子设备可通过电子设备的扬声器播放目标音频,从而保证无线耳机摘下后用户可以收听到目标音频。
可见,通过上述操作,可更加灵活地控制电子设备进行音频输出通路的切换,从而提 升用户的用户体验。可以理解,在以电子设备端为音频输出通路之后,还包括:
若目标应用程序为音视频播放应用程序,确定无线耳机在被摘下之前的佩戴模式以及播放音量;
若无线耳机的佩戴模式为耳挂式,且播放音量大于预设音量值,降低音频的播放音量。
其中,上述佩戴模式可为以下任意一种:挂耳式、入耳式或者头戴式,此处不作限制。
其中,电子设备确定无线耳机在被摘下之前的佩戴模式,具体可获取在与无线耳机进行配对以及建立连接的过程中,获取无线耳机对应的耳机型号,然后根据无线耳机的耳机型号从预设数据库查找对应的耳机参数,耳机参数包括无线耳机的佩戴模式,从而,电子设备可根据无线耳机的耳机型号确定佩戴模式。
具体实施中,考虑到无线耳机在被摘下后,继续通过无线耳机输出目标音频时,若播放目标音频的音量较大,则也可能会影响周围的人,因此,本申请针对音视频播放的场景,在目标应用程序为音视频播放应用程序的情况下,进一步确定无线耳机在被摘下之前的佩戴模式以及播放音量,若无线耳机的佩戴模式为耳挂式,且播放音量大于预设音量值,则可降低音频的播放音量,从而防止无线耳机输出目标音频的音量太大,吵到周围的人。
可以理解,在不冲突的情况下,在前述步骤101、102和/或各种具体实施方式的基础上,本申请实施例中,还可以包括:
在电子设备开始播放目标音频时,确定无线耳机是否处于佩戴状态;
若无线耳机处于佩戴状态,对无线耳机端进行音频输出,否则,对电子设备端进行音频输出;
当无线耳机为一对耳机时,若无线耳机处于佩戴状态包括:无线耳机的任一个耳机处于佩戴状态。
其中,无线耳机在开始播放目标音频时,可确定无线耳机是否处于佩戴状态,若无线耳机处于佩戴状态,对无线耳机端进行音频输出,否则,对电子设备端进行音频输出,如此,可根据无线耳机的佩戴状态控制目标音频的音频输出通路。
需要说明的,根据响应信息或实际暂停播放情况来确定音频播放通路,从而可以使得在用户未佩戴耳机时,避免一些无法暂停的应用直接通过电子设备外放出来影响周围环境或泄露用户隐私,也可避免一些可以暂停的应用在耳机被取下后,仍然通过耳机输出,不方便用户实际使用,因此更符合用户的使用需求,进一步的,在再次播放时,先进行无线耳机佩戴状态的检测,根据检测结果确定音频输出通路,可以进一步方便用户的使用。
可以看出,本申请实施例通过在电子设备的目标应用程序以无线耳机端作为目标音频的音频输出通路时,若确定无线耳机被摘下,则判断目标应用程序是否响应暂停播放;若否,继续对无线耳机输出目标音频,若是,则以电子设备端为音频输出通路,如此,可在目标应用程序未响应暂停播放时,继续通过无线耳机输出目标音频,从而灵活、合理地选择音频输出通路,可避免在摘下耳机时,目标音频未暂停播放的情况下目标音频的声音中断,以及避免通过电子设备端将目标音频进行外放时影响到周围的人,给用户带来不好的用户体验。
请参阅图2,图2是本申请实施例公开的另一种音频播放控制方法的流程示意图。如图2所示,该音频播放控制方法应用于电子设备,电子设备与一对无线耳机的至少一个连接,该方法包括如下步骤:
201、当获取到表征一对无线耳机均被摘下的状态信息时,获取电子设备的目标应用程序的响应信息,响应信息用于表征目标应用程序能否响应无线耳机端发送的暂停播放指令。
其中,目标应用程序可以为以下任意一种:音频播放应用、视频播放应用、直播应用、聊天通话应用等等,音频播放应用是指主要用于进行音频播放的应用程序,例如可以是音 乐播放应用、读书应用或广播应用等,此处不作限制。
其中,电子设备获取无线耳机被摘下的状态信息,具体地,可接收无线耳机上报的状态信息。可以理解,若无线耳机包括第一耳机和第二耳机,第一耳机与第二耳机连接,第一耳机与电子设备连接,则第一耳机在检测到自身被摘下,且接收到第二耳机上报的状态信息表征第二耳机被摘下时,第一耳机可向电子设备上报第一耳机与第二耳机均被摘下的状态信息。可以理解,若无线耳机包括第一耳机和第二耳机,第一耳机、第二耳机分别与电子设备连接,则第一耳机在检测到自身被摘下时,可向电子设备上报第一耳机的状态信息;第二耳机在检测到自身被摘下时,可向电子设备上报第二耳机的状态信息,从而,电子设备可根据接收到的第一耳机的状态信息和第二耳机的状态信息确定第一耳机与第二耳机均被摘下。可以理解,若无线耳机包括第一耳机和第二耳机,第一耳机与第二耳机连接,第一耳机与第二耳机中的主耳机与电子设备连接,当两个耳机中的任一耳机检测到被摘下时,通过主耳机发送状态信息给电子设备,电子设备根据获取到的两个耳机的状态确定第一耳机与第二耳机是否均被摘下(可能是一个耳机先摘下一个耳机后摘下,以在后耳机被摘下时认为均被摘下)。
可以理解,检测被摘下,可以是根据两次或多次检测佩戴情况进行比较得到,例如前一次检测为佩戴状态,后一次检测为非佩戴状态,则确定为被摘下,当然还可以根据多次检测的情况确定,还可以是其他检测方法,本实施例对此不做限制。
可以理解,上述步骤201中,获取电子设备的目标应用程序的响应信息,包括:
21、获取当前处于激活状态的音轨对应的进程号;
22、根据进程号确定目标应用程序的目标应用标识信息;
23、根据目标应用标识信息查找预设响应关系表,得到与目标应用标识信息对应的响应信息。
其中,目标应用标识信息为标识目标应用程序的标识信息,目标应用标识信息可以为应用程序名称、应用程序序号、应用程序图标等,此处不作限制。
具体实施中,电子设备可获取当前处于激活(active)状态的音轨(audio track)对应的进程号;然后根据该进程号获取与目标应用程序对应的目标应用标识信息,电子设备中可预先设置预设响应关系表,预设响应关系表中可预先设置电子设备中各个应用程序分别能否响应暂停播放指令的响应信息,如此,在获取目标应用程序的目标应用标识信息之后,可根据目标应用标识信息查找预设响应关系表,得到与目标应用标识信息对应的响应信息。需要说明的,该预设响应关系表可以预先设置在电子设备中也可以设置在云端。通过设置响应关系表可以确定出目标应用程序的响应情况,从而及时、准确的确定合理的音频输出通路,方便用户的使用。
可以理解,获取到表征一对无线耳机均被摘下的状态信息可以在获取暂停播放指令之后,该方法还包括:
A1、当获取到暂停播放指令时,目标应用程序响应暂停播放指令以暂停播放目标音频,或者目标应用程序不响应暂停播放指令以继续播放目标音频。
其中,若目标应用程序能够响应该暂停播放指令,则电子设备会暂停播放目标音频,若目标应用程序不能够响应该暂停播放指令,则电子设备不会暂停播放目标音频。
202、根据响应信息确定目标应用程序的音频输出通路。
例如,电子设备可根据响应信息确定目标应用程序的音频输出通路为电子设备端或者无线耳机端。
可以理解,当响应信息表征为目标应用程序能够响应暂停播放指令以暂停播放目标音频时,上述步骤202中,根据响应信息确定目标应用程序的音频输出通路,包括:
确定以电子设备端为音频输出通路。
其中,电子设备端为音频输出通路具体可以指电子设备的扬声器作为音频输出通路。
若目标应用程序在无线耳机摘下时能够响应暂停播放指令以暂停播放目标音频,则不存在目标音频外放给周围人带来的影响,因此,可断开无线耳机对应的音频输出通路,以电子设备端为音频输出通路,当接下来用户手动控制目标应用程序取消暂停播放时,电子设备可通过电子设备的扬声器播放目标音频,从而保证耳机摘下后用户可以收听到目标音频。
可以理解,当响应信息表征为目标应用程序能够响应暂停播放指令以暂停播放目标音频时,上述步骤202中,根据响应信息确定目标应用程序的音频输出通路,包括:
将音频输出通路保持在无线耳机端。
其中,当响应信息表征为目标应用程序能够响应暂停播放指令以暂停播放目标音频时,将音频输出通路保持在无线耳机端,继续通过无线耳机输出目标音频,从而可避免在摘下耳机时,目标音频重新恢复播放的情况下目标音频通过电子设备端将目标音频进行外放时影响到周围的人,给用户带来不好的用户体验。
可以理解,当响应信息表征为目标应用程序不能够响应暂停播放指令以暂停播放目标音频时,上述步骤202中,根据响应信息确定目标应用程序的音频输出通路,包括:
确定以无线耳机端为音频输出通路。
其中,当响应信息表征为目标应用程序不能够响应暂停播放指令以暂停播放目标音频时,将音频输出通路保持在无线耳机端,继续通过无线耳机输出目标音频,从而可避免在摘下耳机时,目标音频未暂停播放的情况下目标音频的声音中断,以及避免通过电子设备端将目标音频进行外放时影响到周围的人,给用户带来不好的用户体验。基于步骤202下,给出的三种具体的音频输出通路选择方式,最后一种可与前面两种音频输出通路选择方案任一组合,从而可以满足不同的应用需求。
可以理解,本申请实施例中,上述步骤A1之后,该方法还包括:
在目标音频被暂停播放后,当接收到播放指令时,若确定无线耳机中至少一个处于佩戴状态,则确定以无线耳机端为音频输出通路,并向无线耳机端传输目标音频。
其中,在目标音频被暂停播放后,若电子设备接收到播放指令,会恢复播放目标音频,若确定无线耳机中至少一个处于佩戴状态,则确定以无线耳机端为音频输出通路,并向无线耳机端传输目标音频。
可以理解,本申请实施例中,上述步骤A1之后,还包括:
在目标音频被暂停播放后,当接收到播放指令时,若确定一对无线耳机均处于非佩戴状态,则以电子设备端为音频输出通路,并控制电子设备的扬声器播放目标音频。
其中,在目标音频被暂停播放后,若电子设备接收到播放指令,会恢复播放目标音频,若一对无线耳机均处于非佩戴状态,则确定以电子设备端为音频输出通路,控制电子设备的扬声器播放目标音频,从而,可保证用户能够听到目标音频。
可以看出,本申请实施例当获取到表征一对无线耳机均被摘下的状态信息时,获取电子设备的目标应用程序的响应信息,响应信息用于表征目标应用程序能否响应无线耳机端发送的暂停播放指令;根据响应信息确定目标应用程序的音频输出通路,如此,可灵活、合理地选择音频输出通路,在无线耳机均被摘下时,根据目标应用程序能否响应暂停播放指令的情况灵活切换音频输出通路,提升用户体验。
与上述一致地,请参阅图3,图3是本申请实施例提供的一种电子设备的结构示意图,该电子设备包括:处理器310、通信接口330和存储器320;以及一个或多个程序321,一个或多个程序321被存储在存储器320中,并且被配置成由处理器执行,电子设备与无线耳机进行连接,程序321包括用于执行以下步骤的指令:
在电子设备的目标应用程序以无线耳机端作为目标音频的音频输出通路时,若确定无线耳机被摘下,则判断目标应用程序是否响应暂停播放;
若否,继续对无线耳机输出目标音频,若是,则以电子设备端为音频输出通路。
在一个可能的示例中,无线耳机包括单耳机或双耳机,若无线耳机为双耳机,则电子设备与无线耳机连接包括:双耳机中的至少一个与电子设备连接;若确定无线耳机被摘下,在判断目标应用程序是否响应暂停播放方面,程序321包括用于执行以下步骤的指令:
若确定双耳机均被摘下,则判断目标应用程序是否响应暂停播放。
在一个可能的示例中,在判断目标应用程序是否响应暂停播放之前,程序321还包括用于执行以下步骤的指令:
接收由无线耳机发送的暂停播放指令;
若目标应用程序能够响应暂停播放指令,则能够暂停播放目标音频,否则不能够暂停播放目标音频。
在一个可能的示例中,在判断目标应用程序是否响应暂停播放方面,程序321包括用于执行以下步骤的指令:
判断目标应用程序是否暂停播放目标音频。
在一个可能的示例中,在判断目标应用程序是否响应暂停播放方面,程序321包括用于执行以下步骤的指令:
获取当前处于激活状态的音轨对应的进程号;
根据进程号获取目标应用程序的目标应用标识信息;
根据目标应用标识信息查找预设响应关系表,得到与目标应用标识信息对应的响应信息,响应信息用于表征目标应用程序能否响应暂停播放指令。
在一个可能的示例中,程序321还包括用于执行以下步骤的指令:
在电子设备开始播放目标音频时,确定无线耳机是否处于佩戴状态;
若无线耳机处于佩戴状态,对无线耳机端进行音频输出,否则,对电子设备端进行音频输出;
当无线耳机为一对耳机时,若无线耳机处于佩戴状态包括:无线耳机的任一个耳机处于佩戴状态。
在本申请另一个实施例中,电子设备与一对无线耳机的至少一个连接,程序321包括用于执行以下步骤的指令:
当获取到表征一对无线耳机均被摘下的状态信息时,获取电子设备的目标应用程序的响应信息,响应信息用于表征目标应用程序能否响应无线耳机端发送的暂停播放指令;
根据响应信息确定目标应用程序的音频输出通路。
在一个可能的示例中,获取到表征一对无线耳机均被摘下的状态信息在获取暂停播放指令之后,程序321包括用于执行以下步骤的指令:
当获取到暂停播放指令时,目标应用程序响应暂停播放指令以暂停播放目标音频,或者目标应用程序不响应暂停播放指令以继续播放目标音频。
在一个可能的示例中,当响应信息表征为目标应用程序能够响应暂停播放指令以暂停播放目标音频时,在根据响应信息确定目标应用程序的音频输出通路方面,程序321还包括用于执行以下步骤的指令:
确定以电子设备端为音频输出通路。
在一个可能的示例中,当响应信息表征为目标应用程序能够响应暂停播放指令以暂停播放目标音频时,在根据响应信息确定目标应用程序的音频输出通路方面,程序321包括 用于执行以下步骤的指令:
将音频输出通路保持在无线耳机端。
在一个可能的示例中,当响应信息表征为目标应用程序不能够响应暂停播放指令以暂停播放目标音频时,在根据响应信息确定目标应用程序的音频输出通路方面,程序321包括用于执行以下步骤的指令:
确定以无线耳机端为音频输出通路。
在一个可能的示例中,程序321还包括用于执行以下步骤的指令:
在目标音频被暂停播放后,当接收到播放指令时,若确定无线耳机中至少一个处于佩戴状态,则确定以无线耳机端为音频输出通路,并向无线耳机端传输目标音频。
在一个可能的示例中,程序321还包括用于执行以下步骤的指令:
在目标音频被暂停播放后,当接收到播放指令时,若确定一对无线耳机均处于非佩戴状态,则以电子设备端为音频输出通路,并控制电子设备的扬声器播放目标音频。
在一个可能的示例中,在获取电子设备的目标应用程序的响应信息方面,程序321包括用于执行以下步骤的指令:
确定以无线耳机端为音频输出通路。
获取当前处于激活状态的音轨对应的进程号;
根据进程号确定目标应用程序的目标应用标识信息;
根据目标应用标识信息查找预设响应关系表,得到与目标应用标识信息对应的响应信息。
请参阅图4,图4是本实施例提供的一种音频播放控制装置的结构示意图,应用于电子设备,电子设备与无线耳机进行连接,音频播放控制装置包括判断单元401和处理单元402,其中,
判断单元401,用于在电子设备的目标应用程序以无线耳机端作为目标音频的音频输出通路时,若确定无线耳机被摘下,则判断目标应用程序是否响应暂停播放;
处理单元402,用于若目标应用程序未响应暂停播放,继续对无线耳机输出目标音频;若目标应用程序响应暂停播放,则以电子设备端为音频输出通路。
可以理解,无线耳机包括单耳机或双耳机,若无线耳机为双耳机,则电子设备与无线耳机连接包括:双耳机中的至少一个与电子设备连接;若确定无线耳机被摘下,在判断目标应用程序是否响应暂停播放方面,判断单元401具体用于:
若确定双耳机均被摘下,则判断目标应用程序是否响应暂停播放。
可以理解,在判断目标应用程序是否响应暂停播放之前,处理单元402还用于:
接收由无线耳机发送的暂停播放指令;
若目标应用程序能够响应暂停播放指令,则能够暂停播放目标音频,否则不能够暂停播放目标音频。
可以理解,在判断目标应用程序是否响应暂停播放方面,判断单元401具体用于:
判断目标应用程序是否暂停播放目标音频。
可以理解,在判断目标应用程序是否响应暂停播放方面,判断单元401用于:获取目标应用程序的响应信息,根据响应信息确定目标应用程序是否响应暂停播放,从而确定音频输出通路;具体可用于,
获取当前处于激活状态的音轨对应的进程号;
根据进程号获取目标应用程序的目标应用标识信息;
根据目标应用标识信息查找预设响应关系表,得到与目标应用标识信息对应的响应信息,响应信息用于表征目标应用程序能否响应暂停播放指令。
可以理解,处理单元402还用于:
在电子设备开始播放目标音频时,确定无线耳机是否处于佩戴状态;
若无线耳机处于佩戴状态,对无线耳机端进行音频输出,否则,对电子设备端进行音频输出;
当无线耳机为一对耳机时,若无线耳机处于佩戴状态包括:无线耳机的任一个耳机处于佩戴状态。
可以看出,本申请实施例通过在电子设备的目标应用程序以无线耳机端作为目标音频的音频输出通路时,若确定无线耳机被摘下,则判断目标应用程序是否响应暂停播放;若否,继续对无线耳机输出目标音频,若是,则以电子设备端为音频输出通路,如此,可在目标应用程序未响应暂停播放时,继续通过无线耳机输出目标音频,从而灵活、合理地选择音频输出通路,可避免在摘下耳机时,目标音频未暂停播放的情况下目标音频的声音中断,以及避免通过电子设备端将目标音频进行外放时影响到周围的人,给用户带来不好的用户体验。
请参阅图5,图5是本实施例提供的一种音频播放控制装置的结构示意图,应用于电子设备与一对无线耳机的至少一个连接,音频播放控制装置包括获取单元501和确定单元502,其中,
获取单元501,用于当获取到表征一对无线耳机均被摘下的状态信息时,获取电子设备的目标应用程序的响应信息,响应信息用于表征目标应用程序能否响应无线耳机端发送的暂停播放指令;
确定单元502,用于根据响应信息确定目标应用程序的音频输出通路。
可以理解,获取到表征一对无线耳机均被摘下的状态信息在获取暂停播放指令之后,确定单元502还用于:
当获取到暂停播放指令时,目标应用程序响应暂停播放指令以暂停播放目标音频,或者目标应用程序不响应暂停播放指令以继续播放目标音频。
可以理解,当响应信息表征为目标应用程序能够响应暂停播放指令以暂停播放目标音频时,在根据响应信息确定目标应用程序的音频输出通路方面,确定单元502具体用于:
确定以电子设备端为音频输出通路。
可以理解,当响应信息表征为目标应用程序能够响应暂停播放指令以暂停播放目标音频时,在根据响应信息确定目标应用程序的音频输出通路方面,确定单元502具体用于:
将音频输出通路保持在无线耳机端。
可以理解,当响应信息表征为目标应用程序不能够响应暂停播放指令以暂停播放目标音频时,在根据响应信息确定目标应用程序的音频输出通路方面,确定单元502具体用于:
确定以无线耳机端为音频输出通路。
可以理解,确定单元502还用于:
在目标音频被暂停播放后,当接收到播放指令时,若确定无线耳机中至少一个处于佩戴状态,则确定以无线耳机端为音频输出通路,并向无线耳机端传输目标音频。
可以理解,确定单元502还用于:
在目标音频被暂停播放后,当接收到播放指令时,若确定一对无线耳机均处于非佩戴状态,则以电子设备端为音频输出通路,并控制电子设备的扬声器播放目标音频。
可以理解,在获取电子设备的目标应用程序的响应信息方面,获取单元具体用于:
获取当前处于激活状态的音轨对应的进程号;
根据进程号确定目标应用程序的目标应用标识信息;
根据目标应用标识信息查找预设响应关系表,得到与目标应用标识信息对应的响应信 息。
可以看出,本申请实施例当获取到表征一对无线耳机均被摘下的状态信息时,获取电子设备的目标应用程序的响应信息,响应信息用于表征目标应用程序能否响应无线耳机端发送的暂停播放指令;根据响应信息确定目标应用程序的音频输出通路,如此,可灵活、合理地选择音频输出通路,在无线耳机均被摘下时,根据目标应用程序能否响应暂停播放指令的情况灵活切换音频输出通路,提升用户体验。
可以理解的是,本实施例的音频播放控制装置的各程序模块的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。
请参阅图6,图6是本申请实施例提供的一种音频播放控制系统,包括电子设备和无线耳机,电子设备与无线耳机连接,其中,
若无线耳机确定从佩戴状态变化为非佩戴状态,或,无线耳机确定从佩戴状态变化为非佩戴状态且电子设备的目标应用程序处于播放状态,
则发送暂停播放指令给电子设备;
电子设备接收到暂停播放指令后,若目标应用程序能够响应暂停播放指令,则暂停播放目标音频;
若目标应用程序不能够响应暂停播放指令,则继续播放目标音频;
无线耳机在发送暂停播放指令给电子设备之后的预设时间内,发送状态变化指令给电子设备;电子设备接收到状态变化指令后,获取目标应用程序的响应信息,并根据响应信息确定目标应用程序的音频播放通路。
其中,若无线耳机确定从佩戴状态变化为非佩戴状态,或,无线耳机确定从佩戴状态变化为非佩戴状态且电子设备的目标应用程序处于播放状态,则无线耳机可向电子设备发送暂停播放指令,若目标应用程序能够响应该暂停播放指令,则电子设备暂停播放目标音频;目标应用程序不能够响应暂停播放指令,则继续播放目标音频。
其中,上述响应信息用于表征目标应用程序能否响应暂停播放指令。电子设备可在接收到暂停播放指令之后的预设时间内,接收无线耳机发送的状态变化指令,状态变化指令用于指示无线耳机从佩戴状态变化为非佩戴状态,电子设备接收到状态变化指令后,获取目标应用程序的响应信息,并根据响应信息确定目标应用程序的音频播放通路。
可以理解,当响应信息表征为目标应用程序能够响应暂停播放指令以暂停播放目标音频时,根据响应信息确定目标应用程序的音频输出通路,包括:
确定以电子设备端为音频输出通路。
可以理解,当响应信息表征为目标应用程序能够响应暂停播放指令以暂停播放目标音频时,根据响应信息确定目标应用程序的音频输出通路,包括:
将音频输出通路保持在无线耳机端。
可以理解,当响应信息表征为目标应用程序不能够响应暂停播放指令以暂停播放目标音频时,根据响应信息确定目标应用程序的音频输出通路,包括:
确定以无线耳机端为音频输出通路。
可以看出,本申请实施例中,当获取到无线耳机被摘下的状态信息时,获取电子设备的目标应用程序的响应信息,响应信息用于表征目标应用程序能否响应无线耳机端发送的暂停播放指令;根据响应信息确定目标应用程序的音频输出通路,如此,可在无线耳机均被摘下时,根据目标应用程序能否响应暂停播放指令的情况灵活切换音频输出通路,提升用户体验。
请参阅图7,图7是本申请实施例提供的另一种音频播放控制系统,包括电子设备和无线耳机,无线耳机包括第一耳机和第二耳机,电子设备至少与无线耳机的一个耳机连接,其中,
若无线耳机的任一耳机确定从佩戴状态变为非佩戴状态,或者,若无线耳机的任一耳机确定从佩戴状态变为非佩戴状态且电子设备的目标应用程序处于播放状态,
则发送暂停播放指令给电子设备,电子设备接收到暂停播放指令后,若电子设备的目标应用程序能够响应暂停播放指令,则暂停播放目标音频;
若电子设备的目标应用程序不能够响应暂停播放指令,则继续播放目标音频;
若无线耳机确定两个耳机均被摘下,则向电子设备发送状态信息;
电子设备接收状态信息后获取目标应用程序的响应信息;
电子设备根据响应信息确定目标应用程序的音频播放通路。
其中,上述响应信息用于表征目标应用程序能否响应暂停播放指令。状态变化指令用于指示无线耳机从佩戴状态变化为非佩戴状态。
具体实施中,若无线耳机的任一耳机确定从佩戴状态变为非佩戴状态,或者,若无线耳机的任一耳机确定从佩戴状态变为非佩戴状态且电子设备的目标应用程序处于播放状态,则发送暂停播放指令给电子设备。若无线耳机确定两个耳机均被摘下,则向电子设备发送状态信息。
电子设备接收到暂停播放指令后,若电子设备的目标应用程序能够响应暂停播放指令,则暂停播放目标音频;若电子设备的目标应用程序不能够响应暂停播放指令,则继续播放目标音频。电子设备接收状态信息后,可获取目标应用程序的响应信息,根据响应信息确定目标应用程序的音频播放通路。
可以理解,当响应信息表征为目标应用程序能够响应暂停播放指令以暂停播放目标音频时,根据响应信息确定目标应用程序的音频输出通路,包括:
确定以电子设备端为音频输出通路。
可以理解,当响应信息表征为目标应用程序能够响应暂停播放指令以暂停播放目标音频时,根据响应信息确定目标应用程序的音频输出通路,包括:
将音频输出通路保持在无线耳机端。
可以理解,当响应信息表征为目标应用程序不能够响应暂停播放指令以暂停播放目标音频时,根据响应信息确定目标应用程序的音频输出通路,包括:
确定以无线耳机端为音频输出通路。
可以看出,本申请实施例中,当获取到两个耳机均被摘下的状态信息时,获取电子设备的目标应用程序的响应信息,响应信息用于表征目标应用程序能否响应无线耳机端发送的暂停播放指令;根据响应信息确定目标应用程序的音频输出通路,如此,可在无线耳机均被摘下时,根据目标应用程序能否响应暂停播放指令的情况灵活切换音频输出通路,提升用户体验。
本申请实施例还提供一种计算机可读存储介质,其中,该计算机可读存储介质存储用于电子数据交换的计算机程序,该计算机程序使得计算机执行如上述图像处理方法实施例中记载的任一方法的部分或全部步骤,上述计算机包括电子设备。
本申请实施例还提供一种计算机程序产品,上述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,上述计算机程序可操作来使计算机执行如上述方法实施例中记载的任一图像处理方法的部分或全部步骤。该计算机程序产品可以为一个软件安装包,上述计算机包括电子设备。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的 动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如上述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
上述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储器中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储器中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例上述方法的全部或部分步骤。而前述的存储器包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储器中,存储器可以包括:闪存盘、只读存储器(英文:Read-Only Memory,简称:ROM)、随机存取器(英文:Random Access Memory,简称:RAM)、磁盘或光盘等。
以上对本申请实施例进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (20)

  1. 一种音频播放控制方法,应用于电子设备,所述电子设备与无线耳机连接,所述方法包括:
    在所述电子设备的目标应用程序以所述无线耳机端作为目标音频的音频输出通路时,若确定所述无线耳机被摘下,则判断所述目标应用程序是否响应暂停播放;
    若否,继续对所述无线耳机输出所述目标音频,若是,则以所述电子设备端为音频输出通路。
  2. 根据权利要求1所述的方法,其中,所述无线耳机包括单耳机或双耳机,若所述无线耳机为双耳机,则所述电子设备与无线耳机连接包括:所述双耳机中的至少一个与所述电子设备连接;
    若确定所述无线耳机被摘下,则判断所述目标应用程序是否响应暂停播放,包括:
    若确定所述双耳机均被摘下,则判断所述目标应用程序是否响应暂停播放。
  3. 根据权利要求1所述的方法,其中,
    在所述判断所述目标应用程序是否响应暂停播放之前,所述方法还包括:
    接收由所述无线耳机发送的暂停播放指令;
    若所述目标应用程序能够响应所述暂停播放指令,则能够暂停播放目标音频,否则不能够暂停播放目标音频。
  4. 根据权利要求1所述的方法,其中,所述判断所述目标应用程序是否响应暂停播放,包括:
    判断所述目标应用程序是否暂停播放目标音频。
  5. 根据权利要求1所述的方法,其中,所述判断所述目标应用程序是否响应暂停播放,包括:
    获取当前处于激活状态的音轨对应的进程号;
    根据所述进程号获取所述目标应用程序的目标应用标识信息;
    根据所述目标应用标识信息查找预设响应关系表,得到与所述目标应用标识信息对应的响应信息,所述响应信息用于表征所述目标应用程序能否响应所述暂停播放指令。
  6. 根据权利要求1-5任一项所述的方法,其中,所述方法还包括:
    在所述电子设备开始播放所述目标音频时,确定所述无线耳机是否处于佩戴状态;
    若所述无线耳机处于佩戴状态,对所述无线耳机端进行音频输出,否则,对所述电子设备端进行音频输出;
    当所述无线耳机为一对耳机时,所述若所述无线耳机处于佩戴状态包括:所述无线耳机的任一个耳机处于佩戴状态。
  7. 一种音频播放控制方法,应用于电子设备,所述电子设备与一对无线耳机的至少一个连接,所述方法包括:
    当获取到表征所述一对无线耳机均被摘下的状态信息时,获取所述电子设备的目标应用程序的响应信息,所述响应信息用于表征所述目标应用程序能否响应所述无线耳机端发送的暂停播放指令;
    根据所述响应信息确定所述目标应用程序的音频输出通路。
  8. 根据权利要求7所述的方法,其中,所述获取到表征所述一对无线耳机均被摘下的状态信息在获取所述暂停播放指令之后,所述方法还包括:
    当获取到所述暂停播放指令时,所述目标应用程序响应所述暂停播放指令以暂停播放目标音频,或者所述目标应用程序不响应所述暂停播放指令以继续播放所述目标音频。
  9. 根据权利要求7或8所述的方法,其中,当所述响应信息表征为所述目标应用程序能够响应所述暂停播放指令以暂停播放目标音频时,所述根据所述响应信息确定所述目标应用程序的音频输出通路,包括:
    确定以所述电子设备端为所述音频输出通路。
  10. 根据权利要求7或8所述的方法,其中,当所述响应信息表征为所述目标应用程序能够响应暂停播放指令以暂停播放目标音频时,所述根据所述响应信息确定所述目标应用程序的音频输出通路,包括:
    将所述音频输出通路保持在所述无线耳机端。
  11. 根据权利要求7或8所述的方法,其中,当所述响应信息表征为所述目标应用程序不能够响应所述暂停播放指令以暂停播放目标音频时,所述根据所述响应信息确定所述目标应用程序的音频输出通路,包括:
    确定以所述无线耳机端为所述音频输出通路。
  12. 根据权利要求8所述的方法,其中,所述方法还包括:
    在所述目标音频被暂停播放后,当接收到播放指令时,若确定所述无线耳机中至少一个处于佩戴状态,则确定以所述无线耳机端为所述音频输出通路,并向所述无线耳机端传输所述目标音频。
  13. 根据权利要求7或8所述的方法,其中,所述方法还包括:
    在所述目标音频被暂停播放后,当接收到播放指令时,若确定所述一对无线耳机均处于非佩戴状态,则以所述电子设备端为所述音频输出通路,并控制所述电子设备的扬声器播放所述目标音频。
  14. 根据权利要求7或8所述的方法,其中,所述获取所述电子设备的目标应用程序的响应信息,包括:
    获取当前处于激活状态的音轨对应的进程号;
    根据所述进程号确定所述目标应用程序的目标应用标识信息;
    根据所述目标应用标识信息查找预设响应关系表,得到与所述目标应用标识信息对应的响应信息。
  15. 一种音频播放控制装置,应用于电子设备,所述电子设备与无线耳机连接,所述音频播放控制装置包括:
    判断单元,用于在所述电子设备的目标应用程序以所述无线耳机端作为目标音频的音频输出通路时,若确定所述无线耳机被摘下,则判断所述目标应用程序是否响应暂停播放;
    处理单元,用于若所述目标应用程序未响应暂停播放,继续对所述无线耳机输出所述 目标音频;若所述目标应用程序响应暂停播放,则以所述电子设备端为音频输出通路。
  16. 一种音频播放控制装置,应用于电子设备,所述电子设备与一对无线耳机中的至少一个连接,所述音频播放控制装置包括:
    获取单元,用于当获取到表征所述一对无线耳机均被摘下的状态信息时,获取所述电子设备的目标应用程序的响应信息,所述响应信息用于表征所述目标应用程序能否响应所述无线耳机端发送的暂停播放指令;
    确定单元,用于根据所述响应信息确定所述目标应用程序的音频输出通路。
  17. 一种音频播放控制系统,包括电子设备和无线耳机,所述电子设备与所述无线耳机连接,其中,
    若所述无线耳机确定从佩戴状态变化为非佩戴状态,或,所述无线耳机确定从佩戴状态变化为非佩戴状态且所述电子设备的目标应用程序处于播放状态,
    则发送暂停播放指令给所述电子设备;
    所述电子设备接收到所述暂停播放指令后,若所述目标应用程序能够响应所述暂停播放指令,则暂停播放目标音频;
    若所述目标应用程序不能够响应所述暂停播放指令,则继续播放目标音频;
    所述无线耳机在发送所述暂停播放指令给所述电子设备之后的预设时间内,发送状态变化指令给所述电子设备;所述电子设备接收到所述状态变化指令后,获取所述目标应用程序的响应信息,并根据所述响应信息确定所述目标应用程序的音频播放通路。
  18. 一种音频播放控制系统,包括电子设备和无线耳机,所述无线耳机包括第一耳机和第二耳机,所述电子设备至少与所述无线耳机的一个耳机连接,其中,
    若所述无线耳机的任一耳机确定从佩戴状态变为非佩戴状态,或者,若所述无线耳机的任一耳机确定从佩戴状态变为非佩戴状态且所述电子设备的目标应用程序处于播放状态,
    则发送暂停播放指令给所述电子设备,所述电子设备接收到所述暂停播放指令后,若所述电子设备的目标应用程序能够响应所述暂停播放指令,则暂停播放目标音频;
    若所述电子设备的目标应用程序不能够响应所述暂停播放指令,则继续播放目标音频;
    若所述无线耳机确定两个耳机均被摘下,则向所述电子设备发送状态信息;
    所述电子设备接收所述状态信息后获取所述目标应用程序的响应信息;
    所述电子设备根据所述响应信息确定所述目标应用程序的音频播放通路。
  19. 一种电子设备,包括:处理器和存储器;以及一个或多个程序,所述一个或多个程序被存储在所述存储器中,并且被配置成由所述处理器执行,所述程序包括用于如权利要求1-14任一项所述的方法的指令。
  20. 一种计算机可读存储介质,其用于存储计算机程序,其中,所述计算机程序使得计算机执行如权利要求1-14任一项所述的方法。
PCT/CN2021/101231 2020-08-14 2021-06-21 音频播放控制方法、装置、电子设备及存储介质 Ceased WO2022033176A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010821060.5A CN114077414A (zh) 2020-08-14 2020-08-14 音频播放控制方法、装置、电子设备及存储介质
CN202010821060.5 2020-08-14

Publications (1)

Publication Number Publication Date
WO2022033176A1 true WO2022033176A1 (zh) 2022-02-17

Family

ID=80247627

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/101231 Ceased WO2022033176A1 (zh) 2020-08-14 2021-06-21 音频播放控制方法、装置、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN114077414A (zh)
WO (1) WO2022033176A1 (zh)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115119098A (zh) * 2022-08-30 2022-09-27 荣耀终端有限公司 音频播放控制方法、tws耳机及存储介质
CN115175065A (zh) * 2022-09-06 2022-10-11 荣耀终端有限公司 广播方法、tws耳机及存储介质
CN117156416A (zh) * 2023-08-02 2023-12-01 惠州市德赛西威汽车电子股份有限公司 车载蓝牙控制方法,控制系统及指令状态机
CN117492689A (zh) * 2023-12-28 2024-02-02 荣耀终端有限公司 音频处理方法及电子设备
WO2024119944A1 (zh) * 2022-12-07 2024-06-13 Oppo广东移动通信有限公司 参数配置方法、装置、音频设备组以及可读存储介质
CN118210470A (zh) * 2024-05-21 2024-06-18 南京乐韵瑞信息技术有限公司 音频的播放方法、装置、电子设备和存储介质
CN119544852A (zh) * 2023-08-30 2025-02-28 华为技术有限公司 音频播放控制方法、电子设备以及可读存储介质
US12254243B1 (en) 2024-08-26 2025-03-18 Linkplay Technology Inc. Audio playback method and apparatus, electronic device and storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116887117B (zh) * 2023-08-08 2024-07-12 深圳市星科启创新科技有限公司 一种无线耳机的控制方法、装置、无线耳机及介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103024193A (zh) * 2012-12-25 2013-04-03 北京百度网讯科技有限公司 用于移动终端的播放控制方法、装置和移动终端
CN105491469A (zh) * 2014-09-15 2016-04-13 Tcl集团股份有限公司 一种基于耳机佩戴状态控制音频输出模式的方法及系统
CN106453791A (zh) * 2016-10-27 2017-02-22 宇龙计算机通信科技(深圳)有限公司 声音信号的输出方法及装置、耳机状态的检测方法及装置
WO2020082387A1 (zh) * 2018-10-27 2020-04-30 深圳市欢太科技有限公司 音频通道更换方法及相关设备

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108683798B (zh) * 2018-04-19 2021-04-23 维沃移动通信有限公司 一种声音输出控制方法及移动终端
CN113039518B (zh) * 2018-12-06 2023-12-05 深圳市欢太科技有限公司 播放控制方法和装置、计算机可读存储介质、电子设备
CN112997471B (zh) * 2018-12-10 2022-07-12 深圳市欢太科技有限公司 音频通路切换方法和装置、可读存储介质、电子设备
CN109814798B (zh) * 2019-01-17 2021-03-12 Oppo广东移动通信有限公司 耳返功能控制方法、装置以及移动终端

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103024193A (zh) * 2012-12-25 2013-04-03 北京百度网讯科技有限公司 用于移动终端的播放控制方法、装置和移动终端
CN105491469A (zh) * 2014-09-15 2016-04-13 Tcl集团股份有限公司 一种基于耳机佩戴状态控制音频输出模式的方法及系统
CN106453791A (zh) * 2016-10-27 2017-02-22 宇龙计算机通信科技(深圳)有限公司 声音信号的输出方法及装置、耳机状态的检测方法及装置
WO2020082387A1 (zh) * 2018-10-27 2020-04-30 深圳市欢太科技有限公司 音频通道更换方法及相关设备

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115119098A (zh) * 2022-08-30 2022-09-27 荣耀终端有限公司 音频播放控制方法、tws耳机及存储介质
CN115119098B (zh) * 2022-08-30 2022-12-27 荣耀终端有限公司 音频播放控制方法、tws耳机及存储介质
CN115175065A (zh) * 2022-09-06 2022-10-11 荣耀终端有限公司 广播方法、tws耳机及存储介质
WO2024119944A1 (zh) * 2022-12-07 2024-06-13 Oppo广东移动通信有限公司 参数配置方法、装置、音频设备组以及可读存储介质
CN117156416A (zh) * 2023-08-02 2023-12-01 惠州市德赛西威汽车电子股份有限公司 车载蓝牙控制方法,控制系统及指令状态机
CN119544852A (zh) * 2023-08-30 2025-02-28 华为技术有限公司 音频播放控制方法、电子设备以及可读存储介质
CN117492689A (zh) * 2023-12-28 2024-02-02 荣耀终端有限公司 音频处理方法及电子设备
CN117492689B (zh) * 2023-12-28 2024-04-19 荣耀终端有限公司 音频处理方法及电子设备
CN118210470A (zh) * 2024-05-21 2024-06-18 南京乐韵瑞信息技术有限公司 音频的播放方法、装置、电子设备和存储介质
US12254243B1 (en) 2024-08-26 2025-03-18 Linkplay Technology Inc. Audio playback method and apparatus, electronic device and storage medium

Also Published As

Publication number Publication date
CN114077414A (zh) 2022-02-22

Similar Documents

Publication Publication Date Title
WO2022033176A1 (zh) 音频播放控制方法、装置、电子设备及存储介质
US11102697B2 (en) Method for controlling earphone switching and earphone
CN108966067B (zh) 播放控制方法及相关产品
CN108541080B (zh) 第一电子设备与第二电子设备进行回连的方法及相关产品
CN109040887A (zh) 主从耳机切换控制方法及相关产品
CN108777827B (zh) 无线耳机、音量调整方法及相关产品
CN109150221B (zh) 一种可穿戴设备主从切换方法及相关产品
CN108900231B (zh) 动态天线调整方法及相关产品
CN108683980B (zh) 一种音频信号的传输方法及移动终端
CN109561420B (zh) 一种紧急求救的方法及相关设备
CN109067965B (zh) 翻译方法、翻译装置、可穿戴装置及存储介质
CN111093137B (zh) 一种音量控制方法、设备及计算机可读存储介质
CN108769387A (zh) 应用控制方法及相关设备
CN108897516B (zh) 一种可穿戴设备音量调整方法及相关产品
CN108833683B (zh) 动态天线调整实现方法及相关产品
CN110460721B (zh) 一种启动方法、装置及移动终端
CN108834013B (zh) 一种可穿戴设备电量均衡方法及相关产品
CN108882084B (zh) 一种可穿戴设备电量均衡方法及相关产品
WO2024244895A1 (zh) 用于助听的智能眼镜、助听方法以及辅助系统
CN108668018B (zh) 移动终端、音量控制方法及相关产品
CN108810261B (zh) 通话中天线切换方法及相关产品
CN109121034B (zh) 基于音量的主从切换方法及相关产品
CN115037831B (zh) 一种模式控制方法、装置、电子设备及耳机
CN109040425B (zh) 信息处理方法及相关产品
CN106817495B (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: 21855231

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21855231

Country of ref document: EP

Kind code of ref document: A1