WO2022199319A1 - Audio output method and apparatus, computer device, and storage medium - Google Patents

Audio output method and apparatus, computer device, and storage medium Download PDF

Info

Publication number
WO2022199319A1
WO2022199319A1 PCT/CN2022/077878 CN2022077878W WO2022199319A1 WO 2022199319 A1 WO2022199319 A1 WO 2022199319A1 CN 2022077878 W CN2022077878 W CN 2022077878W WO 2022199319 A1 WO2022199319 A1 WO 2022199319A1
Authority
WO
WIPO (PCT)
Prior art keywords
earphone
impact
earphones
terminal device
detection information
Prior art date
Application number
PCT/CN2022/077878
Other languages
French (fr)
Chinese (zh)
Inventor
张莉
周依鸽
过一
Original Assignee
深圳市欢太科技有限公司
Oppo广东移动通信有限公司
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 深圳市欢太科技有限公司, Oppo广东移动通信有限公司 filed Critical 深圳市欢太科技有限公司
Publication of WO2022199319A1 publication Critical patent/WO2022199319A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/162Interface to dedicated audio devices, e.g. audio drivers, interface to CODECs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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

Definitions

  • the present application relates to the field of computer technology, and in particular, to an audio output method, apparatus, computer device, and storage medium.
  • the terminal device may need to output multiple audio sources with different audio sources at the same time.
  • the terminal device can open the music playing APP and the video playing APP at the same time. In this case, the terminal device needs to output the audio from the music playing APP and the audio from the video playing APP at the same time.
  • a terminal device can mix and process multiple audios from different audio sources that it needs to output simultaneously, and output the mixed audio obtained by the mixing process to an earphone, so that the mixed audio can be played by the earphone.
  • the embodiments of the present application provide an audio output method, apparatus, computer device, and storage medium, which can improve the flexibility of audio output.
  • an audio output method comprising:
  • an audio output method for use in a first earphone, the method comprising:
  • the collision detection information is used to characterize the characteristics of the collision event that occurs in the first earphone, and the collision detection information is used.
  • For the terminal device to determine whether a mutual collision event occurs between the first earphone and the second earphone that has established a communication connection with the terminal device based on the impact detection information; receive and play the first audio output from the terminal device, the first An audio is output by the terminal device after determining that the first earphone and the second earphone collide with each other, and the terminal device is playing at least two audios from different audio sources, and the first audio is the at least one audio Part of the audio of the two audios.
  • an audio output device comprising:
  • a first detection module for detecting whether a collision event occurs between two earphones that have established a communication connection with the terminal device
  • a second detection module configured to detect whether the terminal device is playing at least two audios from different audio sources when a mutual collision event occurs between the two earphones;
  • the output module is configured to output the first audio of the at least two audios to one of the two earphones when the terminal device is playing at least two audios from different audio sources, and output the at least two audios to one of the two earphones.
  • a second audio of the two audios is output to the other of the two earphones.
  • an audio output device for use in the first earphone, the device comprising:
  • a generation module is used to generate impact detection information
  • a sending module is used to send the impact detection information to a terminal device that has established a communication connection with the first earphone, the impact detection information is used to characterize the characteristics of the impact event that occurs in the first earphone, and the impact detection information is used for for the terminal device to determine, based on the impact detection information, whether a mutual impact event occurs between the first earphone and the second earphone that has established a communication connection with the terminal device;
  • a receiving module configured to receive and play the first audio output from the terminal device, where the first audio is the event that the terminal device determines that the first earphone and the second earphone collide with each other, and the terminal device is playing After at least two audios from different audio sources are output, the first audio is a part of the at least two audios.
  • a computer device comprising a processor and a memory, a computer program is stored in the memory, and the processor implements the audio output method described in the first aspect and the second aspect when the processor executes the computer program .
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the audio output method according to the first aspect and the second aspect.
  • the terminal device By detecting whether a mutual collision event occurs between two earphones that have established a communication connection with the terminal device, and in the case of a mutual collision event between the two earphones, it is detected whether the terminal device is playing at least two audio sources from different sources. Audio, when the terminal device is playing at least two audios from different audio sources, outputs the first audio of the at least two audios to one of the two earphones, and outputs the at least two audios to one of the two earphones.
  • the second audio is output to the other one of the two earphones, so that the user can listen to the first audio based on the one earphone that has established a communication connection with the terminal device, and can listen to the first audio based on the second earphone that has established a communication connection with the terminal device.
  • the user can be provided with a flexible audio listening mode, so that the user can clearly listen to the audio from different audio sources based on different headphones, thereby improving the flexibility of the audio output.
  • FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application.
  • FIG. 2 is a flowchart of an audio output method provided by an embodiment of the present application.
  • FIG. 3 is a flowchart of an exemplary technical process for detecting whether a mutual collision event occurs between two earphones that have established a communication connection with a terminal device according to an embodiment of the present application;
  • FIG. 5 is a flowchart of an audio output method provided by an embodiment of the present application.
  • FIG. 6 is a block diagram of an audio output device provided by an embodiment of the present application.
  • FIG. 7 is a block diagram of an audio output device according to an embodiment of the present application.
  • FIG. 8 is a block diagram of a terminal device provided by an embodiment of the present application.
  • FIG. 9 is a block diagram of an earphone according to an embodiment of the present application.
  • the terminal device can establish a communication connection with the headset through wired or wireless communication, and the communication device can output audio to the headset based on the established communication connection, so as to be played by the headset.
  • the terminal device may need to output audio from multiple different audio sources at the same time.
  • the terminal device can open the music player APP and the video player APP at the same time.
  • the terminal device needs to output the audio from the music player at the same time.
  • the audio of the app and the audio from the video playback app may need to output audio from multiple different audio sources at the same time.
  • the terminal device can mix and process multiple audios from different audio sources that it needs to output at the same time, and output the mixed audio obtained by the mixing process to the earphone, so that the mixed audio can be played by the earphone.
  • the manner of outputting mixed audio in the prior art may cause the user to be unable to hear the audio of each audio source clearly, and cannot satisfy the user's requirement to listen to the audio of each audio source separately, so the flexibility is low.
  • the embodiments of the present application provide an audio output method, which can improve the flexibility of audio output.
  • the implementation environment may include a terminal device 101 and two earphones 102, and the two earphones 102 may belong to the same pair of earphones.
  • one of the two earphones 102 is a left earphone, and the two earphones 102
  • the other one of the earphones 102 is a right earphone, and in an optional embodiment of the present application, the two earphones 102 may be TWS earphones.
  • each headset 102 establishes a communication connection with the terminal device 101.
  • the headset 102 may establish a communication connection with the terminal device 101 in a wired manner, or may establish a communication connection with the terminal device 101 in a wireless manner.
  • a communication connection is established, wherein the wireless manner may be a short-range communication manner, for example, Bluetooth, WIFI, Zigbee, etc., which is not specifically limited in this embodiment of the present application.
  • the terminal device 101 in the embodiment of the present application may be an electronic device with an audio output function, such as a smart phone, a tablet computer, a desktop computer, a notebook computer, a music player, a television, a wearable device, and the like.
  • an audio output function such as a smart phone, a tablet computer, a desktop computer, a notebook computer, a music player, a television, a wearable device, and the like.
  • FIG. 2 shows a flowchart of an audio output method provided by an embodiment of the present application.
  • the audio output method may be applied to the terminal device shown in FIG. 1 .
  • the audio output method may include the following steps:
  • Step 201 The terminal device detects whether a mutual collision event occurs between two earphones that have established a communication connection with itself.
  • the mutual collision event refers to an event in which physical contact occurs between the two earphones, and the physical contact may include extrusion, relative sliding after contact, or separation after collision.
  • Step 202 If a mutual collision event occurs between the two earphones, the terminal device detects whether it is playing at least two audios from different audio sources.
  • the audio source refers to the audio source.
  • the audio source can be an application program
  • the application program can be a system program or a third-party application program.
  • the system program can be a phone program
  • the third-party application program can be an audio program. Player or video player, etc.
  • Step 203 If the terminal device is playing at least two audios from different audio sources, the terminal device outputs the first audio of the at least two audios to one of the two earphones, and the at least two audios The second audio in the earphone is output to the other earphone of the two earphones.
  • the terminal device can perform streaming processing on at least two audios from different audio sources that it is playing, that is, the terminal device can control the One of the earphones that has established a communication connection with itself plays a part of the audio (the first audio) in the at least two audios, and can control the other earphone that has established a communication connection with itself to play another part of the audio (the first audio) in the at least two audios. second audio).
  • the terminal device can establish a communication connection with the left earphone and the right earphone in the TWS earphone respectively. If the terminal device detects that the left earphone and the right earphone collide with each other, the terminal device can One channel of audio (for example, this channel of audio can be the audio from the music player APP) is output to the left ear earphone, and the other channel of audio that is being played (for example, this channel of audio can be the audio from the video player APP) is output to the Right ear headphone.
  • this channel of audio can be the audio from the music player APP
  • the terminal device by detecting whether a mutual collision event occurs between two earphones that have established a communication connection with the terminal device, and when a mutual collision event occurs between the two earphones, it is detected whether the terminal device is playing the At least two audios from different audio sources, when the terminal device is playing at least two audios from different audio sources, output the first audio of the at least two audios to one of the two earphones, The second audio of the at least two audios is output to the other one of the two earphones, so that the user can listen to the first audio based on the one earphone that has established a communication connection with the terminal device, and can listen to the first audio based on the one earphone that has established a communication connection with the terminal device.
  • a flexible audio listening mode can be provided for the user, so that the user can clearly listen to the audio from different audio sources based on different earphones, so that the flexibility of the audio output can be improved.
  • FIG. 3 is an exemplary technical process for detecting whether a mutual collision event occurs between two earphones that have established a communication connection with a terminal device provided by an embodiment of the application. As shown in FIG. 3 , the technical process include the following steps:
  • Step 301 The terminal device receives the impact detection information reported by each earphone that has established a communication connection with itself.
  • the impact detection information reported by the earphone is used to characterize the characteristics of the impact event that occurs in the earphone.
  • the feature may be the impact time, the energy value of the ambient sound collected by the earphone when the impact event occurs, and the value of the ambient sound collected by the earphone when the impact event occurs. Sound characteristics of ambient sound and/or motion state information of headphones, etc.
  • the impact detection information may be data measured by the earphone through a sensing element provided in itself.
  • the terminal device may determine whether a preset type of impact event occurs for each earphone according to the impact detection information reported by each earphone. If a predetermined type of impact event does not occur for a certain earphone, the terminal device can determine that there is no mutual impact event between the two earphones. If the terminal device determines that each of the two earphones has a predetermined type of impact event , the terminal device can, in the subsequent steps, detect whether a mutual collision event occurs between the two earphones according to the collision detection information reported by each earphone.
  • a preset type of impact event may be pre-agreed with the user, and the characteristics of the preset type of impact event are similar to the characteristics of impact events such as unintentional bumps that may occur in earphones in daily life. The difference is greater than the preset difference threshold.
  • a preset type of impact event may refer to an event in which the headset and other objects continuously make physical contact multiple times within a preset time period.
  • a preset type of impact event may refer to an event in which the headset and a specific material (for example, An event in which an object of plastic) continuously makes multiple physical contacts within a preset period of time.
  • a preset type of impact event may refer to the continuous multiple contact between the headset and other objects within a preset period of time. The intensity is greater than the preset strength.
  • a physical contact event with a threshold value may refer to the physical contact between the earphone and an object of a specific material (eg, plastic) for multiple consecutive times within a preset time period with a contact intensity greater than a preset intensity threshold value. event.
  • a specific material eg, plastic
  • the embodiment of the present application does not specifically limit the preset type of impact event, as long as it is significantly different from the impact event similar to unintentional impact that may occur in the earphones in daily life.
  • the terminal device first determines whether a preset type of impact event occurs in the earphones, and in the case where a preset type of impact event occurs in each earphone, the terminal device determines based on the impact detection information reported by each earphone. Whether there is a collision event between the two earphones, and the pre-set type of collision event is quite different from the accidental collision that may occur in the earphones in daily life. Therefore, it can effectively filter out the daily impact of the earphones The negative impact of collision events such as unintentional bumps that may occur in life on the judgment of the terminal equipment, so as to avoid misjudgment of the terminal equipment.
  • the earphone after the earphone generates the impact detection information, it can detect whether the impact detection information satisfies the reporting condition, wherein the reporting condition may be set according to the characteristics of the impact event of a preset type, After detecting that the collision detection information meets the reporting conditions, the earphone can report the collision detection information to the terminal device, so that the earphone can preliminarily filter the collision detection information obtained by itself based on the reporting conditions, so as to avoid the obvious impossible to characterize the prediction. The impact detection information of the type of impact event is reported to the terminal device, so that the calculation amount of the terminal device can be reduced.
  • the reporting condition may be set according to the characteristics of the impact event of a preset type
  • the embodiments of the present application provide the following four methods for detecting whether a predetermined type of collision event occurs in the earphones. Below, the embodiments of the present application will describe the four methods one by one. .
  • the impact detection information includes the ambient sound picked up by the earphone when the impact event occurs.
  • the earphone may be provided with a sound pickup element, for example, the sound pickup element may be a microphone.
  • the ambient sound is picked up based on the sound pickup element, and the picked up ambient sound is sent to the terminal device as impact detection information.
  • the earphone after the earphone picks up the ambient sound when the impact event occurs, it can detect whether the ambient sound meets the reporting conditions, and after the ambient sound meets the reporting conditions, send the ambient sound as impact detection information to the terminal device.
  • the terminal device After receiving the ambient sound picked up when the impact event occurs and reported by each earphone, for each earphone, the terminal device can detect whether the sound feature of the ambient sound reported by the earphone is consistent with the preset sound feature, wherein the preset sound feature Refers to the sound characteristics of the impact sound generated by a preset type of impact event. If the sound characteristics of the ambient sound reported by the headset are consistent with the preset sound characteristics, the terminal device can determine that the headset has a preset type of impact event. In this case, the terminal device can use the collision detection information reported by each earphone based on the subsequent steps to determine whether a mutual collision event occurs between the two earphones.
  • the terminal device can determine that the earphone does not have a preset type of impact event. In this case, the terminal device can determine that there is no mutual impact event between the two earphones.
  • consistent can be understood as the same or similar, where similar means that the difference is smaller than the preset difference threshold.
  • the sound characteristics of the ambient sound are consistent with the preset sound characteristics.
  • the sound feature of the ambient sound is the same as the preset sound feature, or the difference between the sound feature of the ambient sound and the preset sound feature is smaller than the preset gap threshold.
  • the terminal device can detect the number of times that the ambient sound reported by the earphone has an energy peak within a preset time period and whether the interval is the same as the number of times that the energy peak occurs within the preset time period indicated by the preset sound feature and the intervals are the same. If they are the same, the terminal device can determine that a preset type of impact event occurs on the earphone. If they are inconsistent, the terminal device can determine that the earphone does not have a preset type of impact event.
  • the terminal device can detect whether the magnitude of the energy peak value of the ambient sound reported by the earphone is consistent with the energy peak value indicated by the preset sound feature. If the impact event of the preset type is not consistent, the terminal device can determine that the earphone does not have the impact event of the preset type.
  • the terminal device can detect whether the magnitude of the frequency of the ambient sound reported by the headset is consistent with the magnitude of the frequency indicated by the preset sound feature, and if so, the terminal device can determine that the headset has a preset type If they are inconsistent, the terminal device can determine that the earphone does not have a preset type of impact event.
  • the impact detection information includes the motion state information of the headset, where the motion state information can be acceleration information, rotation angle information, etc.
  • the sensing element may be, for example, an accelerometer, a gyroscope, etc.
  • the headset may detect motion state information of the headset based on the motion detection sensing element, and send the detected motion state information to the terminal device as impact detection information.
  • the earphone after acquiring the motion state information, the earphone can detect whether the motion state information satisfies the reporting condition, and after the motion state information satisfies the reporting condition, The motion state information is sent to the terminal device as impact detection information.
  • the terminal device After receiving the motion state information reported by each earphone, for each earphone, the terminal device can detect whether the motion state information reported by the earphone is consistent with the preset impact motion state information, wherein the preset impact motion state information is a preset type If the motion state information reported by the earphone is consistent with the preset impact motion state information, the terminal device can determine that the earphone has a preset type of impact event. In this case, the terminal The device can use the impact detection information reported by each earphone based on the subsequent steps to determine whether a mutual impact event occurs between the two earphones. If the motion state information reported by the earphones is inconsistent with the preset impact motion state information, the terminal device can determine the earphones. A collision event of a preset type does not occur, and in this case, the terminal device may determine that a collision event does not occur between the two earphones.
  • the terminal device can determine the acceleration change of the earphone within a preset time period according to the acceleration information reported by the earphone, and the terminal device can detect the acceleration change of the earphone and the information indicated by the preset impact motion state information. Whether the acceleration changes are consistent, if so, the terminal device can determine that a preset type of impact event occurs on the earphone; if not, the terminal device can determine that the earphone does not have a preset type of impact event.
  • the terminal device can determine the posture change of the earphone within a preset time period according to the rotation angle information reported by the earphone, and the terminal device can detect the posture change of the earphone and the information indicated by the preset impact motion state information. Whether the posture changes are consistent, if so, the terminal device can determine that a preset type of impact event occurs on the earphone; if not, the terminal device can determine that the earphone does not have a preset type of impact event.
  • the impact detection information may include both the ambient sound picked up by the earphone when the impact event occurs and the motion state information of the earphone.
  • the terminal device can detect whether the sound characteristics of the ambient sound reported by the earphone are consistent with the preset sound characteristics, and can detect whether the motion state information reported by the earphone is consistent with the preset impact motion state information , if the sound characteristics of the ambient sound reported by the headset are consistent with the preset sound characteristics, and the motion state information reported by the headset is consistent with the preset impact motion state information, the terminal device can determine that a preset type of impact event occurs on the headset On the contrary, if the sound characteristics of the ambient sound reported by the earphone are inconsistent with the preset sound characteristics, or the motion state information reported by the earphone is inconsistent with the preset impact motion state information, the terminal device can determine that the earphone does not have the preset type. impact event.
  • the terminal device can jointly determine whether the earphone has a preset type of impact event based on multiple dimensions, so the accuracy of the determination is high.
  • the earphone can determine whether a preset type of impact event has occurred to itself based on the data measured by the sensing element set in the headset, and after determining that a preset type of impact event has occurred in itself After a type of impact event, the impact detection information is generated, wherein the impact detection information is used to indicate that a preset type of impact event occurs in the earphone.
  • the terminal device for each earphone, if the terminal device receives the impact detection information reported by the earphone, the terminal device can determine that the earphone has a preset type of impact event.
  • Step 302 The terminal device detects whether a mutual collision event occurs between the two earphones according to the collision detection information reported by each earphone.
  • the terminal device may detect whether the impact events occurring in the respective earphones are correlated according to the impact detection information reported by each earphone. Then, the terminal device can determine that a mutual collision event occurs between the two earphones, and if the collision events that occur in the respective earphones are not correlated, the terminal can determine that a mutual collision event does not occur between the two earphones.
  • the fact that the respective impact events of each earphone are correlated may mean that the difference between the characteristics of the respective impact events of each earphone is smaller than a preset difference threshold.
  • the embodiments of the present application provide two exemplary manners for detecting whether the impact events generated by the respective earphones are related, and the following embodiments of the present application will describe the two manners one by one.
  • the terminal device determines the impact time of the impact event of each earphone according to the impact detection information reported by each earphone. If the difference between the impact time of the two earphones when the impact event occurs is within the preset time gap It can be determined that the impact events that occur respectively between the two earphones are correlated, and then the terminal device can determine that a mutual impact event occurs between the two earphones.
  • the terminal device may use the time when each earphone reports the impact detection information as the impact time of the impact event of each earphone. In an optional embodiment of the present application, if the impact detection information includes ambient sound, the terminal device may also use the time when the energy peak in the ambient sound reported by each earphone appears as the impact time of the impact event of each earphone. In an optional embodiment of the present application, the impact detection information may also carry a timestamp when the earphone generated the impact detection information, and the terminal device may use the time indicated by the timestamp as the impact time of the earphone impact event.
  • the terminal device can obtain the energy value of the ambient sound reported by each earphone. Within the range of the preset energy gap, the terminal device may determine that the impact events of the two earphones are correlated, and then the terminal device may determine that a mutual impact event occurs between the two earphones.
  • FIG. 4 shows a flowchart of an audio output method provided by an embodiment of the present application.
  • the audio output method can be applied to any earphone shown in FIG. 1 .
  • the audio output method may include the following steps:
  • Step 401 The first earphone generates collision detection information, and sends the generated collision detection information to a terminal device that has established a communication connection with the first earphone.
  • the impact detection information is used to characterize the characteristics of the impact event that occurs with the first earphone, and the impact detection information is used for the terminal device to determine, based on the impact detection information, the first earphone and the second earphone that has established a communication connection with the terminal device. whether there is a collision between them.
  • Step 402 The first earphone receives and plays the first audio output from the terminal device.
  • the first audio is output by the terminal device after determining that the first earphone and the second earphone collide with each other, and the terminal device is playing at least two audios from different audio sources, and the first audio is the Part of at least two audios.
  • the earphone can determine whether a preset type of impact event has occurred based on the data measured by the sensing element set in the earphone. After the collision event, the collision detection information can be generated and reported to the terminal device, wherein the collision detection information is used to indicate that a preset type of collision event has occurred in the earphone. After receiving the collision detection information, the terminal device can determine to report the collision. A pre-set type of impact event occurred on the headset monitoring the event.
  • the first earphone can detect whether a preset type of impact event occurs in itself based on the following three exemplary manners.
  • the first way the first earphone detects whether the sound characteristics of the ambient sound picked up when the impact event occurs are consistent with the preset sound characteristics; if the sound characteristics of the ambient sound picked up when the impact event occurs are consistent with the preset sound characteristics, then The first earphone generates impact detection information.
  • the second method the first earphone detects whether its own motion state information is consistent with the preset impact motion state information; if the motion state information of the first earphone is consistent with the preset impact motion state information, the first earphone generates impact detection information.
  • the third method the first earphone detects whether the sound characteristics of the ambient sound picked up when the impact event occurs is consistent with the preset sound characteristics, and detects whether its own motion state information is consistent with the preset impact motion state information. If the sound feature of the ambient sound picked up when it occurs is consistent with the preset sound feature, and the motion state information of the first earphone is consistent with the preset impact motion state information, the first earphone generates impact detection information.
  • FIG. 5 shows a flowchart of an audio output method provided by an embodiment of the present application, and the audio output method can be applied to the implementation environment shown in FIG. 1 .
  • the audio output method may include the following steps:
  • Step 501 The earphone generates collision detection information, and sends the generated collision detection information to a terminal device that has established a communication connection with the earphone.
  • Step 502 The terminal device determines whether the two earphones collide with each other based on the received impact detection information sent by each of the two earphones that have established a communication connection with itself.
  • Step 503 If a collision event occurs between the two earphones, the terminal device detects whether it is playing at least two audios from different audio sources.
  • Step 504 If the terminal device is playing at least two audios from different audio sources, the terminal device outputs the first audio of the at least two audios to one of the two headphones, and the at least two audios The second audio output of the two headphones is output to the other of the two headphones.
  • Step 505 The headset receives the audio output from the terminal device, and plays the received audio.
  • FIG. 6 shows a block diagram of an audio output apparatus 600 provided by an embodiment of the present application.
  • the audio output apparatus 600 may be configured in a terminal device.
  • the audio output device 600 may include: a first detection module 601 , a second detection module 602 and an output module 603 .
  • the first detection module 601 is used to detect whether a mutual collision event occurs between two earphones that have established a communication connection with the terminal device.
  • the second detection module 602 is configured to detect whether the terminal device is playing at least two audios from different audio sources when a mutual collision event occurs between the two earphones.
  • the output module 603 is configured to output the first audio of the at least two audios to one of the two earphones when the terminal device is playing at least two audios from different audio sources, and output the first audio of the at least two audios to one of the two earphones. A second audio of the at least two audios is output to the other of the two earphones.
  • the first detection module 601 is specifically configured to: receive impact detection information reported by each earphone, where the impact detection information is used to characterize the characteristics of the impact event that occurs in the earphone; according to the impact detection information reported by each earphone Collision detection information, to detect whether a mutual collision event occurs between the two earphones.
  • the first detection module 601 is specifically configured to: determine the impact time of the impact event of each earphone according to the impact detection information reported by each earphone; if the two earphones have the impact of the impact event If the time gap is within the preset time gap range, it is determined that a collision event occurs between the two earphones.
  • the impact detection information includes ambient sounds collected by the earphones when the impact event occurs
  • the first detection module 601 is specifically configured to: according to the impact detection information reported by the earphones, determine whether the earphones are impacted The energy value of the ambient sound collected at the time of the event; if the difference between the energy values of the ambient sound collected by the two earphones when the collision event occurs is within the preset energy difference range, it is determined that the two earphones collide with each other event.
  • the impact detection information includes the ambient sound collected by the earphone when the impact event occurs, and the first detection module 601 is specifically configured to: for each earphone, detect the sound feature and prediction of the ambient sound reported by the earphone. Set whether the sound characteristics are consistent; if the sound characteristics of the ambient sound reported by the earphones are inconsistent with the preset sound characteristics, it is determined that there is no collision event between the two earphones.
  • the impact detection information includes motion state information of the earphone
  • the first detection module 601 is specifically configured to: for each earphone, detect whether the motion state information reported by the earphone is consistent with the preset impact motion state information ; if the motion state information reported by the earphones is inconsistent with the preset impact motion state information, it is determined that there is no mutual collision event between the two earphones.
  • the audio output device provided by the embodiments of the present application can implement the above method embodiments, and the implementation principles and technical effects thereof are similar, and details are not described herein again.
  • Each module in the above-mentioned audio output device may be implemented in whole or in part by software, hardware, and combinations thereof.
  • the above modules may be embedded in or independent of the processor of the terminal device in the form of hardware, or may be stored in the memory of the terminal device in the form of software, so that the processor can call and execute operations corresponding to the above modules.
  • FIG. 7 shows a block diagram of an audio output apparatus 700 provided by an embodiment of the present application.
  • the audio output apparatus 700 may be configured in a first earphone.
  • the audio output apparatus 700 may include: a generating module 701 , a sending module 702 and a receiving module 703 .
  • the generating module 701 is used to generate collision detection information.
  • the sending module 702 is configured to send the impact detection information to a terminal device that has established a communication connection with the first earphone, the impact detection information is used to characterize the characteristics of the impact event that occurs in the first earphone, and the impact detection information It is used for the terminal device to determine, based on the impact detection information, whether a mutual impact event occurs between the first earphone and the second earphone that has established a communication connection with the terminal device.
  • the receiving module 703 is configured to receive and play the first audio output from the terminal device, where the first audio is the event that the terminal device determines that a collision occurs between the first earphone and the second earphone, and the terminal device determines that a collision occurs between the first earphone and the second earphone.
  • the first audio is output after playing at least two audios from different audio sources, and the first audio is a part of the at least two audios.
  • the generating module 701 is specifically configured to: detect whether the sound characteristics of the ambient sound collected by the first earphone when the impact event occurs are consistent with the preset sound characteristics; if the first earphone occurs when the impact event occurs If the sound characteristics of the ambient sound collected at the time are consistent with the preset sound characteristics, the collision detection information is generated.
  • the generating module 701 is specifically configured to: detect whether the motion state information of the first earphone is consistent with the preset impact motion state information; if the motion state information of the first earphone is consistent with the preset impact motion If the status information is consistent, the collision detection information is generated.
  • the audio output device provided by the embodiments of the present application can implement the above method embodiments, and the implementation principles and technical effects thereof are similar, and details are not described herein again.
  • Each module in the above-mentioned audio output device may be implemented in whole or in part by software, hardware, and combinations thereof.
  • the above modules may be embedded in or independent of the processor of the earphone in the form of hardware, or may be stored in the memory of the earphone in the form of software, so that the processor can call and execute operations corresponding to the above modules.
  • FIG. 8 is a schematic diagram of an internal structure of a terminal device in an embodiment.
  • the terminal device includes a processor and a memory connected through a system bus.
  • the processor is used to provide computing and control capabilities to support the operation of the entire terminal equipment.
  • the memory may include non-volatile storage media and internal memory.
  • the nonvolatile storage medium stores an operating system and a computer program.
  • the computer program can be executed by the processor to implement an audio output method provided by the above embodiments.
  • the internal memory provides a cached execution environment for the operating system and computer programs in the non-volatile storage medium.
  • FIG. 8 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the terminal equipment to which the solution of the present application is applied. Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
  • FIG. 9 is a schematic diagram of the internal structure of an earphone in one embodiment.
  • the headset includes a processor and memory connected through a system bus.
  • the processor is used to provide computing and control capabilities to support the operation of the entire headset.
  • the memory may include non-volatile storage media and internal memory.
  • the nonvolatile storage medium stores an operating system and a computer program.
  • the computer program can be executed by the processor to implement an audio output method provided by the above embodiments.
  • the internal memory provides a cached execution environment for the operating system and computer programs in the non-volatile storage medium.
  • the earphone may further include an audio playing element, a sound pickup element, and a motion state monitoring element, wherein the motion state monitoring element may be an accelerometer, a gyroscope, and the like.
  • FIG. 9 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the earphone to which the solution of the present application is applied. More or fewer components are shown in the figures, either in combination or with different arrangements of components.
  • a terminal device in one embodiment, includes a memory and a processor, a computer program is stored in the memory, and the processor implements the following steps when executing the computer program:
  • the processor also implements the following steps when executing the computer program: receiving impact detection information reported by each earphone, where the impact detection information is used to characterize the characteristics of the impact event that occurs in the earphone; the collision detection information, to detect whether a mutual collision event occurs between the two earphones.
  • the processor when the processor executes the computer program, the following steps are also implemented: according to the impact detection information reported by each earphone, determine the impact time of the impact event of each earphone; if the two earphones have the impact event If the difference of the impact time is within the range of the preset time difference, it is determined that a mutual impact event occurs between the two earphones.
  • the impact detection information includes ambient sounds collected by the earphones when the impact event occurs
  • the processor also implements the following steps when executing the computer program: according to the impact detection information reported by each earphone, determine whether each earphone is in The energy value of the ambient sound collected when the impact event occurs; if the difference between the energy values of the ambient sound collected by the two earphones when the impact event occurs is within the preset energy gap, it is determined that the two earphones have occurred between the two earphones. collision event.
  • the impact detection information includes ambient sounds collected by the earphones when the impact event occurs
  • the processor also implements the following steps when executing the computer program: for each earphone, detecting the sound characteristics of the ambient sounds reported by the earphones Whether it is consistent with the preset sound feature; if the sound feature of the ambient sound reported by the earphone is inconsistent with the preset sound feature, it is determined that there is no collision event between the two earphones.
  • the impact detection information includes motion state information of the earphone
  • the processor also implements the following steps when executing the computer program: for each earphone, detecting the motion state information reported by the earphone and the preset impact motion state information Whether it is consistent; if the motion state information reported by the earphones is inconsistent with the preset impact motion state information, it is determined that there is no mutual impact event between the two earphones.
  • an earphone in one embodiment, the earphone includes a memory and a processor, a computer program is stored in the memory, and the processor implements the following steps when executing the computer program:
  • the collision detection information is used to characterize the characteristics of the collision event that occurs in the first earphone, and the collision detection information is used.
  • For the terminal device to determine whether a mutual collision event occurs between the first earphone and the second earphone that has established a communication connection with the terminal device based on the impact detection information; receive and play the first audio output from the terminal device, the first An audio is output by the terminal device after determining that the first earphone and the second earphone collide with each other, and the terminal device is playing at least two audios from different audio sources, and the first audio is the at least one audio Part of the audio of the two audios.
  • the processor further implements the following steps when executing the computer program: detecting whether the sound characteristics of the ambient sound collected by the first earphone when the impact event occurs is consistent with the preset sound characteristics; The sound feature of the ambient sound collected when the impact event occurs is consistent with the preset sound feature, and the impact detection information is generated.
  • the processor also implements the following steps when executing the computer program: detecting whether the motion state information of the first earphone is consistent with the preset impact motion state information; if the motion state information of the first earphone is consistent with the If the preset impact motion state information is consistent, the impact detection information is generated.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
  • the following steps are further implemented: receiving impact detection information reported by each earphone, where the impact detection information is used to characterize the characteristics of the impact event occurring in the earphone; according to each earphone The reported collision detection information detects whether a mutual collision event occurs between the two earphones.
  • the following steps are also implemented: according to the impact detection information reported by each earphone, determine the impact time of the impact event of each earphone; if the two earphones collide If the difference between the impact times of the events is within the range of the preset time difference, it is determined that a mutual impact event occurs between the two earphones.
  • the impact detection information includes ambient sounds collected by the earphones when the impact event occurs, and when the computer program is executed by the processor, the following steps are also implemented: determine each earphone according to the impact detection information reported by each earphone. The energy value of the ambient sound collected when the impact event occurs; if the difference between the energy values of the ambient sound collected by the two earphones when the impact event occurs is within the range of the preset energy gap, determine the difference between the two earphones. A collision event occurred.
  • the impact detection information includes ambient sound collected by the earphone when the impact event occurs
  • the computer program is executed by the processor to further implement the following steps: for each earphone, detect the sound of the ambient sound reported by the earphone Whether the feature is consistent with the preset sound feature; if the sound feature of the ambient sound reported by the earphone is inconsistent with the preset sound feature, it is determined that there is no collision event between the two earphones.
  • the impact detection information includes motion state information of the earphones
  • the computer program also implements the following steps when executed by the processor: for each earphone, detecting the motion state information reported by the earphones and the preset impact motion state Whether the information is consistent; if the motion state information reported by the earphones is inconsistent with the preset impact motion state information, it is determined that there is no mutual collision event between the two earphones.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
  • the collision detection information is used to characterize the characteristics of the collision event that occurs in the first earphone, and the collision detection information is used.
  • For the terminal device to determine whether a mutual collision event occurs between the first earphone and the second earphone that has established a communication connection with the terminal device based on the impact detection information; receive and play the first audio output from the terminal device, the first An audio is output by the terminal device after determining that the first earphone and the second earphone collide with each other, and the terminal device is playing at least two audios from different audio sources, and the first audio is the at least one audio Part of the audio of the two audios.
  • the following steps are further implemented: detecting whether the sound characteristics of the ambient sound collected by the first earphone when the impact event occurs is consistent with the preset sound characteristics;
  • the impact detection information is generated when the sound feature of the ambient sound collected by the earphone when the impact event occurs is consistent with the preset sound feature.
  • the following steps are further implemented: detecting whether the motion state information of the first earphone is consistent with the preset impact motion state information; If the preset impact motion state information is consistent, the impact detection information is generated.
  • Nonvolatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM is available in M forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Road (SyMchliMk) DRAM (SLDRAM), memory bus (RaMbus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous chain Road
  • RaMbus direct RAM
  • DRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

The present application relates to the technical field of computers, and discloses an audio output method and apparatus, a computer device, and a storage medium. The method comprises: detecting whether an impact event occurs between two earphones; if yes, detecting whether at least two audios from different sources are being played; and if yes, outputting a first audio to one of the earphones, and outputting a second audio to the other earphone. The technical solution provided by embodiments of the present application can improve the audio output flexibility.

Description

音频输出方法、装置、计算机设备及存储介质Audio output method, device, computer equipment and storage medium 技术领域technical field
本申请涉及计算机技术领域,特别是涉及一种音频输出方法、装置、计算机设备及存储介质。The present application relates to the field of computer technology, and in particular, to an audio output method, apparatus, computer device, and storage medium.
背景技术Background technique
当前,许多用户都习惯于使用耳机收听终端设备输出的音频。实际应用中,终端设备可能需要同时输出多个音源不同的音频。例如,终端设备可以同时打开音乐播放APP以及视频播放APP,在这种情况下,终端设备需要同时输出来源于音乐播放APP的音频和来源于视频播放APP的音频。At present, many users are accustomed to using earphones to listen to the audio output from the terminal device. In practical applications, the terminal device may need to output multiple audio sources with different audio sources at the same time. For example, the terminal device can open the music playing APP and the video playing APP at the same time. In this case, the terminal device needs to output the audio from the music playing APP and the audio from the video playing APP at the same time.
相关技术中,终端设备可以对自身需要同时输出的多个音源不同的音频进行混合处理,并将混合处理得到的混合音频输出至耳机,以由耳机对该混合音频进行播放。In the related art, a terminal device can mix and process multiple audios from different audio sources that it needs to output simultaneously, and output the mixed audio obtained by the mixing process to an earphone, so that the mixed audio can be played by the earphone.
然而,现有技术这种输出混合音频的方式灵活性较低。However, this way of outputting mixed audio in the prior art is less flexible.
发明内容SUMMARY OF THE INVENTION
基于此,本申请实施例提供了一种音频输出方法、装置、计算机设备及存储介质,可以提高音频输出的灵活性。Based on this, the embodiments of the present application provide an audio output method, apparatus, computer device, and storage medium, which can improve the flexibility of audio output.
第一方面,提供了一种音频输出方法,该方法包括:In a first aspect, an audio output method is provided, the method comprising:
检测与终端设备建立有通信连接的两个耳机之间是否发生相互撞击事件;若该两个耳机之间发生相互撞击事件,则检测该终端设备是否正在播放来自不同音源的至少两个音频;若该终端设备正在播放来自不同音源的至少两个音频,则将该至少两个音频中的第一音频输出至该两个耳机中的其中一个耳机中,将该至少两个音频中的第二音频输出至该两个耳机中的另一个耳机中。Detect whether a mutual collision event occurs between two earphones that have established a communication connection with the terminal device; if a mutual collision event occurs between the two earphones, detect whether the terminal device is playing at least two audios from different audio sources; if The terminal device is playing at least two audios from different audio sources, then outputs the first audio of the at least two audios to one of the two earphones, and outputs the second audio of the at least two audios to one of the two earphones. output to the other of the two headphones.
第二方面,提供了一种音频输出方法,用于第一耳机中,该方法包括:In a second aspect, an audio output method is provided for use in a first earphone, the method comprising:
生成撞击检测信息,并将该撞击检测信息发送至与该第一耳机建立有通信连接的终端设备中,该撞击检测信息用于表征该第一耳机发生的撞击事件的特征,该撞击检测信息用于供该终端设备基于该撞击检测信息确定该第一耳机与和该终端设备建立有通信连接的第二耳机之间是否发生相互撞击事件;接收并播放该终端设备输出的第一音频,该第一音频是该终端设备在确定该第一耳机与该第二耳机之间发生相互撞击事件,且,该终端设备正在播放来自不同音源的至少两个音频后输出的,该第一音频为该至少两个音频中的一部分音频。Generate collision detection information, and send the collision detection information to a terminal device that has established a communication connection with the first earphone. The collision detection information is used to characterize the characteristics of the collision event that occurs in the first earphone, and the collision detection information is used. For the terminal device to determine whether a mutual collision event occurs between the first earphone and the second earphone that has established a communication connection with the terminal device based on the impact detection information; receive and play the first audio output from the terminal device, the first An audio is output by the terminal device after determining that the first earphone and the second earphone collide with each other, and the terminal device is playing at least two audios from different audio sources, and the first audio is the at least one audio Part of the audio of the two audios.
第三方面,提供了一种音频输出装置,该装置包括:In a third aspect, an audio output device is provided, the device comprising:
第一检测模块,用于检测与终端设备建立有通信连接的两个耳机之间是否发生相互撞击事件;a first detection module for detecting whether a collision event occurs between two earphones that have established a communication connection with the terminal device;
第二检测模块,用于在该两个耳机之间发生相互撞击事件的情况下,检测该终端设备是否正在播放来自不同音源的至少两个音频;a second detection module, configured to detect whether the terminal device is playing at least two audios from different audio sources when a mutual collision event occurs between the two earphones;
输出模块,用于在该终端设备正在播放来自不同音源的至少两个音频的情况下,将该至少两个音频中的第一音频输出至该两个耳机中的其中一个耳机中,将该至少两个音频中的第二音频输出至该两个耳机中的另一个耳机中。The output module is configured to output the first audio of the at least two audios to one of the two earphones when the terminal device is playing at least two audios from different audio sources, and output the at least two audios to one of the two earphones. A second audio of the two audios is output to the other of the two earphones.
第四方面,提供了一种音频输出装置,用于第一耳机中,该装置包括:In a fourth aspect, an audio output device is provided for use in the first earphone, the device comprising:
生成模块,用于生成撞击检测信息;A generation module is used to generate impact detection information;
发送模块,用于将该撞击检测信息发送至与该第一耳机建立有通信连接的终端设备中,该撞击检测信息用于表征该第一耳机发生的撞击事件的特征,该撞击检测信息用于供该终端设备基于该撞击检测信息确定该第一耳机与和该终端设备建立有通信连接的第二耳机之间是否发生相互撞击事件;A sending module is used to send the impact detection information to a terminal device that has established a communication connection with the first earphone, the impact detection information is used to characterize the characteristics of the impact event that occurs in the first earphone, and the impact detection information is used for for the terminal device to determine, based on the impact detection information, whether a mutual impact event occurs between the first earphone and the second earphone that has established a communication connection with the terminal device;
接收模块,用于接收并播放该终端设备输出的第一音频,该第一音频是该终端设备在确定该第一耳机与该第二耳机之间发生相互撞击事件,且,该终端设备正在播放来自不同音源的至少两个音频后输出的,该第一音频为该至少两个音频中的一部分音频。A receiving module, configured to receive and play the first audio output from the terminal device, where the first audio is the event that the terminal device determines that the first earphone and the second earphone collide with each other, and the terminal device is playing After at least two audios from different audio sources are output, the first audio is a part of the at least two audios.
第五方面,提供了一种计算机设备,包括处理器和存储器,该存储器中存储有计算机程序,该处理器执行该计算机程序时实现如上述第一方面和上述第二方面所述的音频输出方法。In a fifth aspect, a computer device is provided, comprising a processor and a memory, a computer program is stored in the memory, and the processor implements the audio output method described in the first aspect and the second aspect when the processor executes the computer program .
第六方面,提供了一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述第一方面和所述第二方面所述的音频输出方法。In a sixth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, implements the audio output method according to the first aspect and the second aspect.
本申请实施例提供的技术方案带来的有益效果至少包括:The beneficial effects brought by the technical solutions provided in the embodiments of the present application include at least:
通过检测与终端设备建立有通信连接的两个耳机之间是否发生相互撞击事件,并在该两个耳机之间发生相互撞击事件的情况下,检测终端设备是否正在播放来自不同音源的至少两个音频,在终端设备正在播放来自不同音源的至少两个音频的情况下,将该至少两个音频中的第一音频输出至该两个耳机中的其中一个耳机中,将该至少两个音频中的第二音频输出至该两个耳机中的另一个耳机中,这样,用户就可以基于与终端设备建立有通信连接的一个耳机收听第一音频,基于与终端设备建立有通信连接的第二耳机收听第二音频,就可以为用户提供灵活的音频收听方式,使用户能够基于不同的耳机清晰地收听来自于不同音源的音频,从而可以提高音频输出的灵活性。By detecting whether a mutual collision event occurs between two earphones that have established a communication connection with the terminal device, and in the case of a mutual collision event between the two earphones, it is detected whether the terminal device is playing at least two audio sources from different sources. Audio, when the terminal device is playing at least two audios from different audio sources, outputs the first audio of the at least two audios to one of the two earphones, and outputs the at least two audios to one of the two earphones. The second audio is output to the other one of the two earphones, so that the user can listen to the first audio based on the one earphone that has established a communication connection with the terminal device, and can listen to the first audio based on the second earphone that has established a communication connection with the terminal device. By listening to the second audio, the user can be provided with a flexible audio listening mode, so that the user can clearly listen to the audio from different audio sources based on different headphones, thereby improving the flexibility of the audio output.
附图说明Description of drawings
图1为本申请实施例提供的一种实施环境的示意图;FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application;
图2为本申请实施例提供的一种音频输出方法的流程图;2 is a flowchart of an audio output method provided by an embodiment of the present application;
图3为本申请实施例提供的一种示例性的检测与终端设备建立有通信连接的两个耳机之间是否发生相互撞击事件的技术过程的流程图;3 is a flowchart of an exemplary technical process for detecting whether a mutual collision event occurs between two earphones that have established a communication connection with a terminal device according to an embodiment of the present application;
图4为本申请实施例提供的一种音频输出方法的流程图;4 is a flowchart of an audio output method provided by an embodiment of the present application;
图5为本申请实施例提供的一种音频输出方法的流程图FIG. 5 is a flowchart of an audio output method provided by an embodiment of the present application
图6为本申请实施例提供的一种音频输出装置的框图;6 is a block diagram of an audio output device provided by an embodiment of the present application;
图7为本申请实施例提供的一种音频输出装置的框图FIG. 7 is a block diagram of an audio output device according to an embodiment of the present application
图8为本申请实施例提供的一种终端设备的框图;FIG. 8 is a block diagram of a terminal device provided by an embodiment of the present application;
图9为本申请实施例提供的一种耳机的框图。FIG. 9 is a block diagram of an earphone according to an embodiment of the present application.
具体实施方式Detailed ways
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the objectives, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
当前,终端设备可以通过有线或者无线通信的方式与耳机建立通信连接,通信设备可以基于建立的通信连接将音频输出至耳机中,以由耳机进行播放。Currently, the terminal device can establish a communication connection with the headset through wired or wireless communication, and the communication device can output audio to the headset based on the established communication connection, so as to be played by the headset.
此外,在实际应用中,终端设备可能需要同时输出多个不同音源的音频,例如,终端设备可以同时打开音乐播放APP以及视频播放APP,在这种情况下,终端设备需要同时输出来源于音乐播放APP的音频和来源于视频播放APP的音频。In addition, in practical applications, the terminal device may need to output audio from multiple different audio sources at the same time. For example, the terminal device can open the music player APP and the video player APP at the same time. In this case, the terminal device needs to output the audio from the music player at the same time. The audio of the app and the audio from the video playback app.
相关技术中,终端设备可以对自身需要同时输出的多个音源不同的音频进行混合处理,并将混合处理得到的混合音频输出至耳机,以由耳机对该混合音频进行播放,这样,用户在通过耳机收听混合音频时就可以同时听到不同音源的音频的内容。In the related art, the terminal device can mix and process multiple audios from different audio sources that it needs to output at the same time, and output the mixed audio obtained by the mixing process to the earphone, so that the mixed audio can be played by the earphone. When listening to the mixed audio with headphones, you can hear the audio content of different audio sources at the same time.
然而,现有技术中输出混合音频的方式很可能导致用户无法听清各个音源的音频,也无法满足用户想要单独收听各个音源的音频的需求,因此,其灵活性较低。有鉴于此,本申请实施例提供了一种音频输出方法,该音频输出方法可以提高音频输出的灵活性。However, the manner of outputting mixed audio in the prior art may cause the user to be unable to hear the audio of each audio source clearly, and cannot satisfy the user's requirement to listen to the audio of each audio source separately, so the flexibility is low. In view of this, the embodiments of the present application provide an audio output method, which can improve the flexibility of audio output.
下面,将对本申请实施例提供的音频输出方法所涉及到的实施环境进行说明。Next, the implementation environment involved in the audio output method provided by the embodiment of the present application will be described.
如图1所述,该实施环境可以包括终端设备101以及两个耳机102,该两个耳机102可以同属于一副耳机,例如,该两个耳机102中的一个为左耳耳机,该两个耳机102中的另一个为右耳耳机,在本申请的可选实施例中,该两个耳机102可以为TWS耳机。As shown in FIG. 1 , the implementation environment may include a terminal device 101 and two earphones 102, and the two earphones 102 may belong to the same pair of earphones. For example, one of the two earphones 102 is a left earphone, and the two earphones 102 The other one of the earphones 102 is a right earphone, and in an optional embodiment of the present application, the two earphones 102 may be TWS earphones.
在本申请实施例中,各个耳机102均与终端设备101建立有通信连接,可选的,耳机102可以基于有线的方式与终端设备101建立有通信连接,也可以基于无线的方式与终端设备101建立有通信连接,其中,无线方式可以为近距离通信方式,例如,蓝牙、WIFI以及Zigbee等,本申请实施例对此不作具体限定。In this embodiment of the present application, each headset 102 establishes a communication connection with the terminal device 101. Optionally, the headset 102 may establish a communication connection with the terminal device 101 in a wired manner, or may establish a communication connection with the terminal device 101 in a wireless manner. A communication connection is established, wherein the wireless manner may be a short-range communication manner, for example, Bluetooth, WIFI, Zigbee, etc., which is not specifically limited in this embodiment of the present application.
本申请实施例中的终端设备101可以为智能手机、平板电脑、台式电脑、笔记本电脑、音乐播放器、电视机、可穿戴设备等具有音频输出功能的电子设备。The terminal device 101 in the embodiment of the present application may be an electronic device with an audio output function, such as a smart phone, a tablet computer, a desktop computer, a notebook computer, a music player, a television, a wearable device, and the like.
请参考图2,其示出了本申请实施例提供的一种音频输出方法的流程图,该音频输出方法可以应用于图1所示的终端设备中。如图2所示,该音频输出方法可以包括以下步骤:Please refer to FIG. 2 , which shows a flowchart of an audio output method provided by an embodiment of the present application. The audio output method may be applied to the terminal device shown in FIG. 1 . As shown in Figure 2, the audio output method may include the following steps:
步骤201、终端设备检测与自身建立有通信连接的两个耳机之间是否发生相互撞击事件。Step 201: The terminal device detects whether a mutual collision event occurs between two earphones that have established a communication connection with itself.
其中,在本申请实施例中,相互撞击事件指的是该两个耳机之间发生物理接触的事件,该物理接触可以包括挤压、接触后相对滑动或者碰撞后分开等。Wherein, in the embodiment of the present application, the mutual collision event refers to an event in which physical contact occurs between the two earphones, and the physical contact may include extrusion, relative sliding after contact, or separation after collision.
步骤202、若该两个耳机之间发生相互撞击事件,则终端设备检测自身是否正在播放来自不同音源的至少两个音频。Step 202: If a mutual collision event occurs between the two earphones, the terminal device detects whether it is playing at least two audios from different audio sources.
其中,音源指的是音频来源,例如,音源可以为应用程序,该应用程序可以为系统程序也可以为第三方应用程序,例如,该系统程序可以为电话程序,该第三方应用程序可以为音频播放程序或者视频播放程序等等。The audio source refers to the audio source. For example, the audio source can be an application program, and the application program can be a system program or a third-party application program. For example, the system program can be a phone program, and the third-party application program can be an audio program. Player or video player, etc.
步骤203、若终端设备正在播放来自不同音源的至少两个音频,则终端设备将该至少两个音频中的第一音频输出至该两个耳机中的其中一个耳机中,将该至少两个音频中的第二音频输出至该两个耳机中的另一个耳机中。Step 203: If the terminal device is playing at least two audios from different audio sources, the terminal device outputs the first audio of the at least two audios to one of the two earphones, and the at least two audios The second audio in the earphone is output to the other earphone of the two earphones.
在本申请实施例中,若检测到该两个耳机之间发生相互撞击事件,则终端设备可以对自身正在播放的来自不同音源的至少两个音频进行分流处理,也即是,终端设备可以控制与自身建立有通信连接的其中一个耳机播放该至少两个音频中的一部分音频(第一音频),可以控制与自身建立有通信连接的另一个耳机播放该至少两个音频中的另一部分音频(第二音频)。In this embodiment of the present application, if it is detected that the two earphones collide with each other, the terminal device can perform streaming processing on at least two audios from different audio sources that it is playing, that is, the terminal device can control the One of the earphones that has established a communication connection with itself plays a part of the audio (the first audio) in the at least two audios, and can control the other earphone that has established a communication connection with itself to play another part of the audio (the first audio) in the at least two audios. second audio).
例如,终端设备可以与TWS耳机中的左耳耳机和右耳耳机分别建立有通信连接,若终端设备检测到该左耳耳机和该右耳耳机发生了相互撞击事件,则终端设备可以将正在播放的一路音频(例如,该路音频可以为来源于音乐播放APP的音频)输出至左耳耳机,将正在播放的另一路音频(例如,该路音频可以为来源于视频播放APP的音频)输出至右耳耳机。For example, the terminal device can establish a communication connection with the left earphone and the right earphone in the TWS earphone respectively. If the terminal device detects that the left earphone and the right earphone collide with each other, the terminal device can One channel of audio (for example, this channel of audio can be the audio from the music player APP) is output to the left ear earphone, and the other channel of audio that is being played (for example, this channel of audio can be the audio from the video player APP) is output to the Right ear headphone.
在本实施例中,通过检测与终端设备建立有通信连接的两个耳机之间是否发生相互撞击事件,并在该两个耳机之间发生相互撞击事件的情况下,检测终端设备是否正在播放来自不同音源的至少两个音频,在终端设备正在播放来自不同音源的至少两个音频的情况下,将该至少两个音频中的第一音频输出至该两个耳机中的其中一个耳机中,将该至少两个音频中的第二音频输出至该两个耳机中的另一个耳机中,这样,用户就可以基于与终端设备建立有通信连接的一个耳机收听第一音频,基于与终端设备建立有通信连接的第二耳机收听第二音频,就可以为用户提供灵活的音频收听方式,使用户能够基于不同的耳机清晰地收听来自于不同音源的音频,从而可以提高音频输出的灵活性。In this embodiment, by detecting whether a mutual collision event occurs between two earphones that have established a communication connection with the terminal device, and when a mutual collision event occurs between the two earphones, it is detected whether the terminal device is playing the At least two audios from different audio sources, when the terminal device is playing at least two audios from different audio sources, output the first audio of the at least two audios to one of the two earphones, The second audio of the at least two audios is output to the other one of the two earphones, so that the user can listen to the first audio based on the one earphone that has established a communication connection with the terminal device, and can listen to the first audio based on the one earphone that has established a communication connection with the terminal device. By listening to the second audio through the second earphone connected in communication, a flexible audio listening mode can be provided for the user, so that the user can clearly listen to the audio from different audio sources based on different earphones, so that the flexibility of the audio output can be improved.
请参考图3,其为本申请实施例提供的一种示例性的检测与终端设备建立有通信连接的两个耳机之间是否发生相互撞击事件的技术过程,如图3所示,该技术过程包括以下步骤:Please refer to FIG. 3 , which is an exemplary technical process for detecting whether a mutual collision event occurs between two earphones that have established a communication connection with a terminal device provided by an embodiment of the application. As shown in FIG. 3 , the technical process Include the following steps:
步骤301、终端设备接收与自身建立有通信连接的每个耳机上报的撞击检测信息。Step 301: The terminal device receives the impact detection information reported by each earphone that has established a communication connection with itself.
其中,耳机上报的撞击检测信息用于表征耳机发生的撞击事件的特征,例如,该特征可以为撞击时间、撞击事件发生时耳机采集到的环境音的能量值,撞击事件发生时耳机采集到的环境音的声音特征和/或耳机的运动状态信息等。The impact detection information reported by the earphone is used to characterize the characteristics of the impact event that occurs in the earphone. For example, the feature may be the impact time, the energy value of the ambient sound collected by the earphone when the impact event occurs, and the value of the ambient sound collected by the earphone when the impact event occurs. Sound characteristics of ambient sound and/or motion state information of headphones, etc.
在本申请实施例中,撞击检测信息可以为耳机通过自身中设置的传感元件测量到的数据。In this embodiment of the present application, the impact detection information may be data measured by the earphone through a sensing element provided in itself.
在本申请的可选实施例中,在接收到各耳机上报的撞击检测信息之后,终端设备可以根据各耳机上报的撞击检测信息,确定各耳机是否发生预设类型的撞击事件,若终端设备确定某一耳机没有发生预设类型的撞击事件,则终端设备可以确定该两个耳机之间没有发生相互撞击事件,若终端设备确定该两个耳机中的各个耳机均发生了预设类型的撞击事件,则终端设备可以在后续步骤中根据每个耳机上报的撞击检测信息,检测两个耳机之间是否发生相互撞击事件。In an optional embodiment of the present application, after receiving the impact detection information reported by each earphone, the terminal device may determine whether a preset type of impact event occurs for each earphone according to the impact detection information reported by each earphone. If a predetermined type of impact event does not occur for a certain earphone, the terminal device can determine that there is no mutual impact event between the two earphones. If the terminal device determines that each of the two earphones has a predetermined type of impact event , the terminal device can, in the subsequent steps, detect whether a mutual collision event occurs between the two earphones according to the collision detection information reported by each earphone.
其中,在本申请实施例中,预设类型的撞击事件可以是与用户预先约定好的,该预设类型的撞击事件的特征与日常生活中耳机可能出现的类似于无意磕碰等撞击事件的特征的差异大于预设差异阈值。Wherein, in the embodiment of the present application, a preset type of impact event may be pre-agreed with the user, and the characteristics of the preset type of impact event are similar to the characteristics of impact events such as unintentional bumps that may occur in earphones in daily life. The difference is greater than the preset difference threshold.
例如,预设类型的撞击事件指的可以是耳机与其他物体在预设时长内连续进行多次物理接触的事件,又例如,预设类型的撞击事件指的可以是耳机与特定材质(例如,塑料)的物体在预设时长内连续进行多次物理接触的事件,又例如,预设类型的撞击事件指的可以是耳机与其他物体在预设时长内连续进行多次接触强度大于预设强度阈值的物理接触的事件,又例如,预设类型的撞击事件指的可以是耳机与特定材质(例如,塑料)的物体在预设时长内连续进行多次接触强度大于预设强度阈值的物理接触的事件。For example, a preset type of impact event may refer to an event in which the headset and other objects continuously make physical contact multiple times within a preset time period. For another example, a preset type of impact event may refer to an event in which the headset and a specific material (for example, An event in which an object of plastic) continuously makes multiple physical contacts within a preset period of time. For another example, a preset type of impact event may refer to the continuous multiple contact between the headset and other objects within a preset period of time. The intensity is greater than the preset strength. A physical contact event with a threshold value, for another example, a preset type of impact event may refer to the physical contact between the earphone and an object of a specific material (eg, plastic) for multiple consecutive times within a preset time period with a contact intensity greater than a preset intensity threshold value. event.
本申请实施例不对预设类型的撞击事件进行具体限定,只要其与日常生活中耳机可能出现的类似于无意磕碰等撞击事件有较大的差异就可以。The embodiment of the present application does not specifically limit the preset type of impact event, as long as it is significantly different from the impact event similar to unintentional impact that may occur in the earphones in daily life.
由于在本申请的可选实施例中,终端设备先是判断耳机是否发生预设类型的撞击事件,并在各个耳机均发生预设类型的撞击事件的情况下,基于各耳机上报的撞击检测信息判断该两个耳机之间是否发生相互撞击事件,而预设类型的撞击事件与日常生活中耳机可能出现的类似于无意磕碰等撞击事件有较大的差异,因此,可以有效地过滤掉耳机在日常生活中可能出现的类似于无意磕碰等碰撞事件对终端设备的判断造成的负面影响,避免终端设备产生误判。Because in an optional embodiment of the present application, the terminal device first determines whether a preset type of impact event occurs in the earphones, and in the case where a preset type of impact event occurs in each earphone, the terminal device determines based on the impact detection information reported by each earphone. Whether there is a collision event between the two earphones, and the pre-set type of collision event is quite different from the accidental collision that may occur in the earphones in daily life. Therefore, it can effectively filter out the daily impact of the earphones The negative impact of collision events such as unintentional bumps that may occur in life on the judgment of the terminal equipment, so as to avoid misjudgment of the terminal equipment.
需要指出的是,在实际应用中,耳机在生成撞击检测信息之后,可以检测该撞击检测信息是否满足上报条件,其中,该上报条件可以是根据预设类型的撞击事件的特征所设定的,在检测到该撞击检测信息满足上报条件之后,耳机可以将该撞击检测信息上报至终端设备,这样,耳机可以基于上报条件对自身获取到的撞击检测信息进行初步过滤,避免将明显不可能表征预设类型的撞击事件的撞击检测信息上报至终端设备,从而可以减轻终端设备的计算量。It should be pointed out that, in practical applications, after the earphone generates the impact detection information, it can detect whether the impact detection information satisfies the reporting condition, wherein the reporting condition may be set according to the characteristics of the impact event of a preset type, After detecting that the collision detection information meets the reporting conditions, the earphone can report the collision detection information to the terminal device, so that the earphone can preliminarily filter the collision detection information obtained by itself based on the reporting conditions, so as to avoid the obvious impossible to characterize the prediction. The impact detection information of the type of impact event is reported to the terminal device, so that the calculation amount of the terminal device can be reduced.
本申请实施例根据耳机上报的撞击检测信息的内容的不同,提供了以下四种检测耳机是否发生预设 类型的撞击事件的方式,下面,本申请实施例将对这四种方式一一进行说明。According to the different contents of the collision detection information reported by the earphones, the embodiments of the present application provide the following four methods for detecting whether a predetermined type of collision event occurs in the earphones. Below, the embodiments of the present application will describe the four methods one by one. .
第一种方式:撞击检测信息包括耳机在撞击事件发生时拾取的环境音,在实际应用中,耳机中可以设置有拾音元件,该拾音元件例如可以是麦克风,耳机可以在撞击事件发生时基于该拾音元件拾取环境音,并将拾取的环境音作为撞击检测信息发送至终端设备。The first way: the impact detection information includes the ambient sound picked up by the earphone when the impact event occurs. In practical applications, the earphone may be provided with a sound pickup element, for example, the sound pickup element may be a microphone. The ambient sound is picked up based on the sound pickup element, and the picked up ambient sound is sent to the terminal device as impact detection information.
如上文所述,可选的,耳机在撞击事件发生时拾取到环境音之后,可以检测该环境音是否满足上报条件,并在该环境音满足上报条件后,将该环境音作为撞击检测信息发送至终端设备。As mentioned above, optionally, after the earphone picks up the ambient sound when the impact event occurs, it can detect whether the ambient sound meets the reporting conditions, and after the ambient sound meets the reporting conditions, send the ambient sound as impact detection information to the terminal device.
在接收到各耳机上报的在撞击事件发生时拾取的环境音之后,对于各耳机,终端设备可以检测该耳机上报的环境音的声音特征与预设声音特征是否一致,其中,该预设声音特征指的是预设类型的撞击事件所产生的撞击声音的声音特征,若该耳机上报的环境音的声音特征与预设声音特征一致,则终端设备可以确定该耳机发生预设类型的撞击事件,在这种情况下,终端设备可以基于后续步骤利用各耳机上报的撞击检测信息判断该两个耳机之间是否发生相互撞击事件,若该耳机上报的环境音的声音特征与预设声音特征不一致,则终端设备可以确定该耳机未发生预设类型的撞击事件,在这种情况下,终端设备可以确定该两个耳机之间没有发生相互撞击事件。After receiving the ambient sound picked up when the impact event occurs and reported by each earphone, for each earphone, the terminal device can detect whether the sound feature of the ambient sound reported by the earphone is consistent with the preset sound feature, wherein the preset sound feature Refers to the sound characteristics of the impact sound generated by a preset type of impact event. If the sound characteristics of the ambient sound reported by the headset are consistent with the preset sound characteristics, the terminal device can determine that the headset has a preset type of impact event. In this case, the terminal device can use the collision detection information reported by each earphone based on the subsequent steps to determine whether a mutual collision event occurs between the two earphones. If the sound characteristics of the ambient sound reported by the earphones are inconsistent with the preset sound characteristics, Then the terminal device can determine that the earphone does not have a preset type of impact event. In this case, the terminal device can determine that there is no mutual impact event between the two earphones.
需要指出的是,在本申请实施例中,一致可以理解为相同或者相似,其中,相似指的是差距小于预设差距阈值,例如,环境音的声音特征与预设声音特征一致指的可以是环境音的声音特征与预设声音特征相同,或者,环境音的声音特征与预设声音特征之间的差距小于预设差距阈值。本申请实施例下文中也有关于“一致”的描述,其含义与此处同理,下文中本申请实施例将不再赘述。It should be pointed out that, in this embodiment of the present application, consistent can be understood as the same or similar, where similar means that the difference is smaller than the preset difference threshold. For example, the sound characteristics of the ambient sound are consistent with the preset sound characteristics. The sound feature of the ambient sound is the same as the preset sound feature, or the difference between the sound feature of the ambient sound and the preset sound feature is smaller than the preset gap threshold. In the following embodiments of the present application, there is also a description of "consistent", and the meaning thereof is the same as that here, and will not be repeated in the following embodiments of the present application.
在本申请的可选实施例中,终端设备可以检测耳机上报的环境音在预设时长内出现能量峰值的次数以及间隔是否与预设声音特征所指示的在预设时长内出现能量峰值的次数以及间隔一致,若一致,则终端设备可以确定耳机发生预设类型的撞击事件,若不一致,则终端设备可以确定耳机未发生预设类型的撞击事件。In an optional embodiment of the present application, the terminal device can detect the number of times that the ambient sound reported by the earphone has an energy peak within a preset time period and whether the interval is the same as the number of times that the energy peak occurs within the preset time period indicated by the preset sound feature and the intervals are the same. If they are the same, the terminal device can determine that a preset type of impact event occurs on the earphone. If they are inconsistent, the terminal device can determine that the earphone does not have a preset type of impact event.
在本申请的可选实施例中,终端设备可以检测耳机上报的环境音的能量峰值的大小是否与预设声音特征所指示的能量峰值的大小一致,若一致,则终端设备可以确定耳机发生预设类型的撞击事件,若不一致,则终端设备可以确定耳机未发生预设类型的撞击事件。In an optional embodiment of the present application, the terminal device can detect whether the magnitude of the energy peak value of the ambient sound reported by the earphone is consistent with the energy peak value indicated by the preset sound feature. If the impact event of the preset type is not consistent, the terminal device can determine that the earphone does not have the impact event of the preset type.
在本申请的可选实施例中,终端设备可以检测耳机上报的环境音的频率的大小是否与预设声音特征所指示的频率的大小一致,若一致,则终端设备可以确定耳机发生预设类型的撞击事件,若不一致,则终端设备可以确定耳机未发生预设类型的撞击事件。In an optional embodiment of the present application, the terminal device can detect whether the magnitude of the frequency of the ambient sound reported by the headset is consistent with the magnitude of the frequency indicated by the preset sound feature, and if so, the terminal device can determine that the headset has a preset type If they are inconsistent, the terminal device can determine that the earphone does not have a preset type of impact event.
第二种方式:撞击检测信息包括耳机的运动状态信息,其中,该运动状态信息可以为加速度信息、旋转角度信息等,在实际应用中,耳机中可以设置有运动检测传感元件,该运动检测传感元件例如可以是加速度计、陀螺仪等,耳机可以基于运动检测传感元件检测耳机的运动状态信息,并将检测到的运动状态信息作为撞击检测信息发送至终端设备。The second way: the impact detection information includes the motion state information of the headset, where the motion state information can be acceleration information, rotation angle information, etc. The sensing element may be, for example, an accelerometer, a gyroscope, etc. The headset may detect motion state information of the headset based on the motion detection sensing element, and send the detected motion state information to the terminal device as impact detection information.
与上文所述同理地,在本申请的可选实施例中,耳机在获取到运动状态信息之后,可以检测该运动状态信息是否满足上报条件,并在该运动状态信息满足上报条件后,将该运动状态信息作为撞击检测信息发送至终端设备。Similarly to the above, in an optional embodiment of the present application, after acquiring the motion state information, the earphone can detect whether the motion state information satisfies the reporting condition, and after the motion state information satisfies the reporting condition, The motion state information is sent to the terminal device as impact detection information.
在接收到各耳机上报的运动状态信息之后,对于各耳机,终端设备可以检测该耳机上报的运动状态信息与预设撞击运动状态信息是否一致,其中,该预设撞击运动状态信息为预设类型的撞击事件所对应的撞击运动状态信息,若该耳机上报的运动状态信息与预设撞击运动状态信息一致,则终端设备可以确定该耳机发生预设类型的撞击事件,在这种情况下,终端设备可以基于后续步骤利用各耳机上报的撞击检测信息判断该两个耳机之间是否发生相互撞击事件,若该耳机上报的运动状态信息与预设撞击运动状态信息不一致,则终端设备可以确定该耳机未发生预设类型的撞击事件,在这种情况下,终端设备可以确定该两个耳机之间没有发生相互撞击事件。After receiving the motion state information reported by each earphone, for each earphone, the terminal device can detect whether the motion state information reported by the earphone is consistent with the preset impact motion state information, wherein the preset impact motion state information is a preset type If the motion state information reported by the earphone is consistent with the preset impact motion state information, the terminal device can determine that the earphone has a preset type of impact event. In this case, the terminal The device can use the impact detection information reported by each earphone based on the subsequent steps to determine whether a mutual impact event occurs between the two earphones. If the motion state information reported by the earphones is inconsistent with the preset impact motion state information, the terminal device can determine the earphones. A collision event of a preset type does not occur, and in this case, the terminal device may determine that a collision event does not occur between the two earphones.
在本申请的可选实施例中,终端设备可以根据耳机上报的加速度信息确定耳机在预设时长内的加速度变化情况,终端设备可以检测耳机的加速度变化情况与预设撞击运动状态信息所指示的加速度变化情况是否一致,若一致,则终端设备可以确定耳机发生预设类型的撞击事件,若不一致,则终端设备可以确定耳机未发生预设类型的撞击事件。In an optional embodiment of the present application, the terminal device can determine the acceleration change of the earphone within a preset time period according to the acceleration information reported by the earphone, and the terminal device can detect the acceleration change of the earphone and the information indicated by the preset impact motion state information. Whether the acceleration changes are consistent, if so, the terminal device can determine that a preset type of impact event occurs on the earphone; if not, the terminal device can determine that the earphone does not have a preset type of impact event.
在本申请的可选实施例中,终端设备可以根据耳机上报的旋转角度信息确定耳机在预设时长内的姿态变化情况,终端设备可以检测耳机的姿态变化情况与预设撞击运动状态信息所指示的姿态变化情况是否一致,若一致,则终端设备可以确定耳机发生预设类型的撞击事件,若不一致,则终端设备可以确定耳机未发生预设类型的撞击事件。In an optional embodiment of the present application, the terminal device can determine the posture change of the earphone within a preset time period according to the rotation angle information reported by the earphone, and the terminal device can detect the posture change of the earphone and the information indicated by the preset impact motion state information. Whether the posture changes are consistent, if so, the terminal device can determine that a preset type of impact event occurs on the earphone; if not, the terminal device can determine that the earphone does not have a preset type of impact event.
第三种方式:该撞击检测信息可以同时包括耳机在撞击事件发生时拾取的环境音以及耳机的运动状态信息。The third way: the impact detection information may include both the ambient sound picked up by the earphone when the impact event occurs and the motion state information of the earphone.
在这种情况下,对于各耳机,终端设备可以检测该耳机上报的环境音的声音特征与预设声音特征是否一致,并可以检测该耳机上报的运动状态信息与预设撞击运动状态信息是否一致,若该耳机上报的环境音的声音特征与预设声音特征一致,且,该耳机上报的运动状态信息与预设撞击运动状态信息一致,则终端设备可以确定该耳机发生预设类型的撞击事件,反之,若该耳机上报的环境音的声音特征与预设声音特征不一致,或者,该耳机上报的运动状态信息与预设撞击运动状态信息不一致,则终端设备可以确定该耳机未发生预设类型的撞击事件。In this case, for each earphone, the terminal device can detect whether the sound characteristics of the ambient sound reported by the earphone are consistent with the preset sound characteristics, and can detect whether the motion state information reported by the earphone is consistent with the preset impact motion state information , if the sound characteristics of the ambient sound reported by the headset are consistent with the preset sound characteristics, and the motion state information reported by the headset is consistent with the preset impact motion state information, the terminal device can determine that a preset type of impact event occurs on the headset On the contrary, if the sound characteristics of the ambient sound reported by the earphone are inconsistent with the preset sound characteristics, or the motion state information reported by the earphone is inconsistent with the preset impact motion state information, the terminal device can determine that the earphone does not have the preset type. impact event.
在第三种方式中,终端设备可以基于多个维度共同判断耳机是否发生预设类型的撞击事件,因此,其判断的准确性较高。In the third manner, the terminal device can jointly determine whether the earphone has a preset type of impact event based on multiple dimensions, so the accuracy of the determination is high.
第四种方式:在本申请的可选实施例中,耳机可以基于自身中设置的传感元件测量到的数据来判断自身是否发生了预设类型的撞击事件,并在确定自身发生了预设类型的撞击事件后,生成撞击检测信息,其中,该撞击检测信息用于指示耳机发生了预设类型的撞击事件。The fourth way: In an optional embodiment of the present application, the earphone can determine whether a preset type of impact event has occurred to itself based on the data measured by the sensing element set in the headset, and after determining that a preset type of impact event has occurred in itself After a type of impact event, the impact detection information is generated, wherein the impact detection information is used to indicate that a preset type of impact event occurs in the earphone.
则对于终端设备而言,对于各耳机,若终端设备接收到该耳机上报的撞击检测信息,则终端设备即可确定该耳机发生了预设类型的撞击事件。Then, for the terminal device, for each earphone, if the terminal device receives the impact detection information reported by the earphone, the terminal device can determine that the earphone has a preset type of impact event.
步骤302、终端设备根据每个耳机上报的撞击检测信息,检测该两个耳机之间是否发生相互撞击事件。Step 302: The terminal device detects whether a mutual collision event occurs between the two earphones according to the collision detection information reported by each earphone.
在本申请的可选实施例中,终端设备可以根据每个耳机上报的撞击检测信息,检测各个耳机所分别发生的撞击事件是否具有关联性,若各个耳机所分别发生的撞击事件具有关联性,则终端设备可以确定该两个耳机之间发生相互撞击事件,若各个耳机所分别发生的撞击事件不具有关联性,则终端可以确定该两个耳机之间未发生相互撞击事件。In an optional embodiment of the present application, the terminal device may detect whether the impact events occurring in the respective earphones are correlated according to the impact detection information reported by each earphone. Then, the terminal device can determine that a mutual collision event occurs between the two earphones, and if the collision events that occur in the respective earphones are not correlated, the terminal can determine that a mutual collision event does not occur between the two earphones.
其中,在本申请的可选实施例中,各个耳机所分别发生的撞击事件具有关联性指的可以是:各个耳机所分别发生的撞击事件的特征之间的差异小于预设差异阈值。Wherein, in an optional embodiment of the present application, the fact that the respective impact events of each earphone are correlated may mean that the difference between the characteristics of the respective impact events of each earphone is smaller than a preset difference threshold.
本申请实施例提供了两种示例性地检测各耳机所分别发生的撞击事件是否具有关联性的方式,下面,本申请实施例将对这两种方式一一进行说明。The embodiments of the present application provide two exemplary manners for detecting whether the impact events generated by the respective earphones are related, and the following embodiments of the present application will describe the two manners one by one.
第一种方式:终端设备根据各耳机上报的撞击检测信息,确定各耳机发生撞击事件的撞击时间,若该两个耳机发生撞击事件的撞击时间的差距在预设时间差距范围内,则终端设备可以确定该两个耳机所分别发生的撞击事件具有关联性,继而终端设备可以确定该两个耳机之间发生相互撞击事件。The first way: the terminal device determines the impact time of the impact event of each earphone according to the impact detection information reported by each earphone. If the difference between the impact time of the two earphones when the impact event occurs is within the preset time gap It can be determined that the impact events that occur respectively between the two earphones are correlated, and then the terminal device can determine that a mutual impact event occurs between the two earphones.
在本申请的可选实施例中,终端设备可以将各耳机上报撞击检测信息的时间作为各耳机发生撞击事件的撞击时间。在本申请的可选实施例中,若撞击检测信息包括环境音,则终端设备还可以将各耳机上报的环境音中能量峰值出现的时间作为各耳机发生撞击事件的撞击时间。在本申请的可选实施例中,该撞击检测信息中还可以携带有耳机生成该撞击检测信息的时间戳,终端设备可以将该时间戳所指示的时间作为耳机发生撞击事件的撞击时间。In an optional embodiment of the present application, the terminal device may use the time when each earphone reports the impact detection information as the impact time of the impact event of each earphone. In an optional embodiment of the present application, if the impact detection information includes ambient sound, the terminal device may also use the time when the energy peak in the ambient sound reported by each earphone appears as the impact time of the impact event of each earphone. In an optional embodiment of the present application, the impact detection information may also carry a timestamp when the earphone generated the impact detection information, and the terminal device may use the time indicated by the timestamp as the impact time of the earphone impact event.
第二种方式:在撞击检测信息包括耳机在撞击事件发生时拾取的环境音的情况下,终端设备可以获取各耳机上报的环境音的能量值,若各耳机上报的环境音的能量值的差距在预设能量差距范围内,则终端设备可以确定该两个耳机所分别发生的撞击事件具有关联性,继而终端设备可以确定该两个耳机之间发生相互撞击事件。The second way: when the impact detection information includes the ambient sound picked up by the earphones when the impact event occurs, the terminal device can obtain the energy value of the ambient sound reported by each earphone. Within the range of the preset energy gap, the terminal device may determine that the impact events of the two earphones are correlated, and then the terminal device may determine that a mutual impact event occurs between the two earphones.
请参考图4,其示出了本申请实施例提供的一种音频输出方法的流程图,该音频输出方法可以应用于图1所示的任一耳机中,为了方便说明,下文中统一将其称为第一耳机。如图4所示,该音频输出方法可以包括以下步骤:Please refer to FIG. 4 , which shows a flowchart of an audio output method provided by an embodiment of the present application. The audio output method can be applied to any earphone shown in FIG. 1 . For the convenience of description, the following is unified Called the first earphone. As shown in Figure 4, the audio output method may include the following steps:
步骤401、第一耳机生成撞击检测信息,并将生成的撞击检测信息发送至与第一耳机建立有通信连接的终端设备中。Step 401: The first earphone generates collision detection information, and sends the generated collision detection information to a terminal device that has established a communication connection with the first earphone.
其中,该撞击检测信息用于表征第一耳机发生的撞击事件的特征,该撞击检测信息用于供终端设备 基于该撞击检测信息确定第一耳机与和该终端设备建立有通信连接的第二耳机之间是否发生相互撞击事件。Wherein, the impact detection information is used to characterize the characteristics of the impact event that occurs with the first earphone, and the impact detection information is used for the terminal device to determine, based on the impact detection information, the first earphone and the second earphone that has established a communication connection with the terminal device. whether there is a collision between them.
步骤402、第一耳机接收并播放终端设备输出的第一音频。Step 402: The first earphone receives and plays the first audio output from the terminal device.
其中,该第一音频是终端设备在确定第一耳机与第二耳机之间发生相互撞击事件,且,终端设备正在播放来自不同音源的至少两个音频后输出的,该第一音频为所述至少两个音频中的一部分音频。The first audio is output by the terminal device after determining that the first earphone and the second earphone collide with each other, and the terminal device is playing at least two audios from different audio sources, and the first audio is the Part of at least two audios.
如上文所述,在一些可能的情况下,可以由耳机基于自身中设置的传感元件测量到的数据来判断自身是否发生了预设类型的撞击事件,在耳机检测到自身发生预设类型的撞击事件之后,可以生成并向终端设备上报撞击检测信息,其中,该撞击检测信息用于指示耳机发生了预设类型的撞击事件,终端设备在接收到该撞击检测信息之后,可以确定上报该撞击监测事件的耳机发生了预设类型的撞击事件。As mentioned above, in some possible cases, the earphone can determine whether a preset type of impact event has occurred based on the data measured by the sensing element set in the earphone. After the collision event, the collision detection information can be generated and reported to the terminal device, wherein the collision detection information is used to indicate that a preset type of collision event has occurred in the earphone. After receiving the collision detection information, the terminal device can determine to report the collision. A pre-set type of impact event occurred on the headset monitoring the event.
与上文中终端设备检测耳机是否发生预设类型的撞击事件相类似地,第一耳机可以基于以下三种示例性的方式检测自身是否发生预设类型的撞击事件。Similar to the above-mentioned terminal device detecting whether a preset type of impact event occurs to the earphone, the first earphone can detect whether a preset type of impact event occurs in itself based on the following three exemplary manners.
第一种方式:第一耳机检测在撞击事件发生时拾取的环境音的声音特征与预设声音特征是否一致;若在撞击事件发生时拾取的环境音的声音特征与预设声音特征一致,则第一耳机生成撞击检测信息。The first way: the first earphone detects whether the sound characteristics of the ambient sound picked up when the impact event occurs are consistent with the preset sound characteristics; if the sound characteristics of the ambient sound picked up when the impact event occurs are consistent with the preset sound characteristics, then The first earphone generates impact detection information.
第二种方式:第一耳机检测自身的运动状态信息与预设撞击运动状态信息是否一致;若第一耳机的运动状态信息与预设撞击运动状态信息一致,则第一耳机生成撞击检测信息。The second method: the first earphone detects whether its own motion state information is consistent with the preset impact motion state information; if the motion state information of the first earphone is consistent with the preset impact motion state information, the first earphone generates impact detection information.
第三种方式:第一耳机检测在撞击事件发生时拾取的环境音的声音特征与预设声音特征是否一致,并检测自身的运动状态信息与预设撞击运动状态信息是否一致,若在撞击事件发生时拾取的环境音的声音特征与预设声音特征一致,且,第一耳机的运动状态信息与预设撞击运动状态信息一致,则第一耳机生成撞击检测信息。The third method: the first earphone detects whether the sound characteristics of the ambient sound picked up when the impact event occurs is consistent with the preset sound characteristics, and detects whether its own motion state information is consistent with the preset impact motion state information. If the sound feature of the ambient sound picked up when it occurs is consistent with the preset sound feature, and the motion state information of the first earphone is consistent with the preset impact motion state information, the first earphone generates impact detection information.
请参考图5,其示出了本申请实施例提供的一种音频输出方法的流程图,该音频输出方法可以应用于图1所示的实施环境中。如图5所示,该音频输出方法可以包括以下步骤:Please refer to FIG. 5 , which shows a flowchart of an audio output method provided by an embodiment of the present application, and the audio output method can be applied to the implementation environment shown in FIG. 1 . As shown in Figure 5, the audio output method may include the following steps:
步骤501、耳机生成撞击检测信息,并将生成的撞击检测信息发送至与该耳机建立有通信连接的终端设备中。Step 501: The earphone generates collision detection information, and sends the generated collision detection information to a terminal device that has established a communication connection with the earphone.
步骤502、终端设备基于接收到的与自身建立有通信连接的两个耳机中的各个耳机发送的撞击检测信息,确定该两个耳机是否相互撞击事件。Step 502: The terminal device determines whether the two earphones collide with each other based on the received impact detection information sent by each of the two earphones that have established a communication connection with itself.
步骤503、若该两个耳机之间发生相互撞击事件,则终端设备检测自身是否正在播放来自不同音源的至少两个音频。Step 503: If a collision event occurs between the two earphones, the terminal device detects whether it is playing at least two audios from different audio sources.
步骤504、若终端设备正在播放来自不同音源的至少两个音频,则终端设备将至少两个音频中的第一音频输出至该两个耳机中的其中一个耳机中,将该至少两个音频中的第二音频输出至两个耳机中的另 一个耳机中。Step 504: If the terminal device is playing at least two audios from different audio sources, the terminal device outputs the first audio of the at least two audios to one of the two headphones, and the at least two audios The second audio output of the two headphones is output to the other of the two headphones.
步骤505、耳机接收终端设备输出的音频,并对接收到的音频进行播放。Step 505: The headset receives the audio output from the terminal device, and plays the received audio.
请参考图6,其示出了本申请实施例提供的一种音频输出装置600的框图,该音频输出装置600可以配置于终端设备中。如图6所示,该音频输出装置600可以包括:第一检测模块601、第二检测模块602以及输出模块603。Please refer to FIG. 6 , which shows a block diagram of an audio output apparatus 600 provided by an embodiment of the present application. The audio output apparatus 600 may be configured in a terminal device. As shown in FIG. 6 , the audio output device 600 may include: a first detection module 601 , a second detection module 602 and an output module 603 .
其中,该第一检测模块601,用于检测与终端设备建立有通信连接的两个耳机之间是否发生相互撞击事件。Wherein, the first detection module 601 is used to detect whether a mutual collision event occurs between two earphones that have established a communication connection with the terminal device.
该第二检测模块602,用于在该两个耳机之间发生相互撞击事件的情况下,检测该终端设备是否正在播放来自不同音源的至少两个音频。The second detection module 602 is configured to detect whether the terminal device is playing at least two audios from different audio sources when a mutual collision event occurs between the two earphones.
该输出模块603,用于在该终端设备正在播放来自不同音源的至少两个音频的情况下,将该至少两个音频中的第一音频输出至该两个耳机中的其中一个耳机中,将该至少两个音频中的第二音频输出至该两个耳机中的另一个耳机中。The output module 603 is configured to output the first audio of the at least two audios to one of the two earphones when the terminal device is playing at least two audios from different audio sources, and output the first audio of the at least two audios to one of the two earphones. A second audio of the at least two audios is output to the other of the two earphones.
在其中一个实施例中,该第一检测模块601,具体用于:接收每个耳机上报的撞击检测信息,该撞击检测信息用于表征耳机发生的撞击事件的特征;根据每个耳机上报的该撞击检测信息,检测该两个耳机之间是否发生相互撞击事件。In one embodiment, the first detection module 601 is specifically configured to: receive impact detection information reported by each earphone, where the impact detection information is used to characterize the characteristics of the impact event that occurs in the earphone; according to the impact detection information reported by each earphone Collision detection information, to detect whether a mutual collision event occurs between the two earphones.
在其中一个实施例中,该第一检测模块601,具体用于:根据每个耳机上报的该撞击检测信息,确定每个耳机发生撞击事件的撞击时间;若该两个耳机发生撞击事件的撞击时间的差距在预设时间差距范围内,则确定该两个耳机之间发生相互撞击事件。In one embodiment, the first detection module 601 is specifically configured to: determine the impact time of the impact event of each earphone according to the impact detection information reported by each earphone; if the two earphones have the impact of the impact event If the time gap is within the preset time gap range, it is determined that a collision event occurs between the two earphones.
在其中一个实施例中,该撞击检测信息包括耳机在撞击事件发生时采集的环境音,该第一检测模块601,具体用于:根据各耳机上报的该撞击检测信息,确定各耳机在发生撞击事件时采集到的环境音的能量值;若该两个耳机在发生撞击事件时采集到的环境音的能量值的差距在预设能量差距范围内,则确定该两个耳机之间发生相互撞击事件。In one embodiment, the impact detection information includes ambient sounds collected by the earphones when the impact event occurs, and the first detection module 601 is specifically configured to: according to the impact detection information reported by the earphones, determine whether the earphones are impacted The energy value of the ambient sound collected at the time of the event; if the difference between the energy values of the ambient sound collected by the two earphones when the collision event occurs is within the preset energy difference range, it is determined that the two earphones collide with each other event.
在其中一个实施例中,该撞击检测信息包括耳机在撞击事件发生时采集的环境音,该第一检测模块601,具体用于:对于各耳机,检测该耳机上报的环境音的声音特征与预设声音特征是否一致;若该耳机上报的环境音的声音特征与该预设声音特征不一致,则确定该两个耳机之间未发生相互撞击事件。In one embodiment, the impact detection information includes the ambient sound collected by the earphone when the impact event occurs, and the first detection module 601 is specifically configured to: for each earphone, detect the sound feature and prediction of the ambient sound reported by the earphone. Set whether the sound characteristics are consistent; if the sound characteristics of the ambient sound reported by the earphones are inconsistent with the preset sound characteristics, it is determined that there is no collision event between the two earphones.
在其中一个实施例中,该撞击检测信息包括耳机的运动状态信息,该第一检测模块601,具体用于:对于各耳机,检测该耳机上报的运动状态信息与预设撞击运动状态信息是否一致;若该耳机上报的运动状态信息与该预设撞击运动状态信息不一致,则确定该两个耳机之间未发生相互撞击事件。In one embodiment, the impact detection information includes motion state information of the earphone, and the first detection module 601 is specifically configured to: for each earphone, detect whether the motion state information reported by the earphone is consistent with the preset impact motion state information ; if the motion state information reported by the earphones is inconsistent with the preset impact motion state information, it is determined that there is no mutual collision event between the two earphones.
本申请实施例提供的音频输出装置,可以实现上述方法实施例,其实现原理和技术效果类似,在此不再赘述。The audio output device provided by the embodiments of the present application can implement the above method embodiments, and the implementation principles and technical effects thereof are similar, and details are not described herein again.
关于音频输出装置的具体限定可以参见上文中对于音频输出方法的限定,在此不再赘述。上述音频输出装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于终端设备的处理器中,也可以以软件形式存储于终端设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For specific limitations on the audio output device, reference may be made to the limitations on the audio output method above, which will not be repeated here. Each module in the above-mentioned audio output device may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in or independent of the processor of the terminal device in the form of hardware, or may be stored in the memory of the terminal device in the form of software, so that the processor can call and execute operations corresponding to the above modules.
请参考图7,其示出了本申请实施例提供的一种音频输出装置700的框图,该音频输出装置700可以配置于第一耳机中。如图7所示,该音频输出装置700可以包括:生成模块701、发送模块702以及接收模块703。Please refer to FIG. 7 , which shows a block diagram of an audio output apparatus 700 provided by an embodiment of the present application. The audio output apparatus 700 may be configured in a first earphone. As shown in FIG. 7 , the audio output apparatus 700 may include: a generating module 701 , a sending module 702 and a receiving module 703 .
其中,该生成模块701,用于生成撞击检测信息。Wherein, the generating module 701 is used to generate collision detection information.
该发送模块702,用于将该撞击检测信息发送至与该第一耳机建立有通信连接的终端设备中,该撞击检测信息用于表征该第一耳机发生的撞击事件的特征,该撞击检测信息用于供该终端设备基于该撞击检测信息确定该第一耳机与和该终端设备建立有通信连接的第二耳机之间是否发生相互撞击事件。The sending module 702 is configured to send the impact detection information to a terminal device that has established a communication connection with the first earphone, the impact detection information is used to characterize the characteristics of the impact event that occurs in the first earphone, and the impact detection information It is used for the terminal device to determine, based on the impact detection information, whether a mutual impact event occurs between the first earphone and the second earphone that has established a communication connection with the terminal device.
该接收模块703,用于接收并播放该终端设备输出的第一音频,该第一音频是该终端设备在确定该第一耳机与该第二耳机之间发生相互撞击事件,且,该终端设备正在播放来自不同音源的至少两个音频后输出的,该第一音频为该至少两个音频中的一部分音频。The receiving module 703 is configured to receive and play the first audio output from the terminal device, where the first audio is the event that the terminal device determines that a collision occurs between the first earphone and the second earphone, and the terminal device determines that a collision occurs between the first earphone and the second earphone. The first audio is output after playing at least two audios from different audio sources, and the first audio is a part of the at least two audios.
在其中一个实施例中,该生成模块701,具体用于:检测该第一耳机在撞击事件发生时采集的环境音的声音特征与预设声音特征是否一致;若该第一耳机在撞击事件发生时采集的环境音的声音特征与该预设声音特征一致,则生成该撞击检测信息。In one embodiment, the generating module 701 is specifically configured to: detect whether the sound characteristics of the ambient sound collected by the first earphone when the impact event occurs are consistent with the preset sound characteristics; if the first earphone occurs when the impact event occurs If the sound characteristics of the ambient sound collected at the time are consistent with the preset sound characteristics, the collision detection information is generated.
在其中一个实施例中,该生成模块701,具体用于:检测该第一耳机的运动状态信息与预设撞击运动状态信息是否一致;若该第一耳机的运动状态信息与该预设撞击运动状态信息一致,则生成该撞击检测信息。In one embodiment, the generating module 701 is specifically configured to: detect whether the motion state information of the first earphone is consistent with the preset impact motion state information; if the motion state information of the first earphone is consistent with the preset impact motion If the status information is consistent, the collision detection information is generated.
本申请实施例提供的音频输出装置,可以实现上述方法实施例,其实现原理和技术效果类似,在此不再赘述。The audio output device provided by the embodiments of the present application can implement the above method embodiments, and the implementation principles and technical effects thereof are similar, and details are not described herein again.
关于音频输出装置的具体限定可以参见上文中对于音频输出方法的限定,在此不再赘述。上述音频输出装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于耳机的处理器中,也可以以软件形式存储于耳机中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For specific limitations on the audio output device, reference may be made to the limitations on the audio output method above, which will not be repeated here. Each module in the above-mentioned audio output device may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in or independent of the processor of the earphone in the form of hardware, or may be stored in the memory of the earphone in the form of software, so that the processor can call and execute operations corresponding to the above modules.
图8为一个实施例中终端设备的内部结构示意图。如图8所示,该终端设备包括通过系统总线连接的处理器以及存储器。其中,该处理器用于提供计算和控制能力,支撑整个终端设备的运行。存储器可包括非易失性存储介质及内存储器。非易失性存储介质存储有操作系统和计算机程序。该计算机程序可 被处理器所执行,以用于实现以上各个实施例所提供的一种音频输出方法。内存储器为非易失性存储介质中的操作系统以及计算机程序提供高速缓存的运行环境。FIG. 8 is a schematic diagram of an internal structure of a terminal device in an embodiment. As shown in FIG. 8 , the terminal device includes a processor and a memory connected through a system bus. Among them, the processor is used to provide computing and control capabilities to support the operation of the entire terminal equipment. The memory may include non-volatile storage media and internal memory. The nonvolatile storage medium stores an operating system and a computer program. The computer program can be executed by the processor to implement an audio output method provided by the above embodiments. The internal memory provides a cached execution environment for the operating system and computer programs in the non-volatile storage medium.
本领域技术人员可以理解,图8中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的终端设备的限定,具体的终端设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 8 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the terminal equipment to which the solution of the present application is applied. Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
图9为一个实施例中耳机的内部结构示意图。如图9所示,该耳机包括通过系统总线连接的处理器以及存储器。其中,该处理器用于提供计算和控制能力,支撑整个耳机的运行。存储器可包括非易失性存储介质及内存储器。非易失性存储介质存储有操作系统和计算机程序。该计算机程序可被处理器所执行,以用于实现以上各个实施例所提供的一种音频输出方法。内存储器为非易失性存储介质中的操作系统以及计算机程序提供高速缓存的运行环境。FIG. 9 is a schematic diagram of the internal structure of an earphone in one embodiment. As shown in Figure 9, the headset includes a processor and memory connected through a system bus. Among them, the processor is used to provide computing and control capabilities to support the operation of the entire headset. The memory may include non-volatile storage media and internal memory. The nonvolatile storage medium stores an operating system and a computer program. The computer program can be executed by the processor to implement an audio output method provided by the above embodiments. The internal memory provides a cached execution environment for the operating system and computer programs in the non-volatile storage medium.
除此以外,该耳机还可以包括音频播放元件、拾音元件以及运动状态监测元件,其中,该运动状态监测元件可以为加速度计、陀螺仪等。In addition, the earphone may further include an audio playing element, a sound pickup element, and a motion state monitoring element, wherein the motion state monitoring element may be an accelerometer, a gyroscope, and the like.
本领域技术人员可以理解,图9中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的耳机的限定,具体的耳机可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 9 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the earphone to which the solution of the present application is applied. More or fewer components are shown in the figures, either in combination or with different arrangements of components.
在本申请的一个实施例中,提供了一种终端设备,该终端设备包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现以下步骤:In one embodiment of the present application, a terminal device is provided, the terminal device includes a memory and a processor, a computer program is stored in the memory, and the processor implements the following steps when executing the computer program:
检测与终端设备建立有通信连接的两个耳机之间是否发生相互撞击事件;若该两个耳机之间发生相互撞击事件,则检测该终端设备是否正在播放来自不同音源的至少两个音频;若该终端设备正在播放来自不同音源的至少两个音频,则将该至少两个音频中的第一音频输出至该两个耳机中的其中一个耳机中,将该至少两个音频中的第二音频输出至该两个耳机中的另一个耳机中。Detect whether a mutual collision event occurs between two earphones that have established a communication connection with the terminal device; if a mutual collision event occurs between the two earphones, detect whether the terminal device is playing at least two audios from different audio sources; if The terminal device is playing at least two audios from different audio sources, then outputs the first audio of the at least two audios to one of the two earphones, and outputs the second audio of the at least two audios to one of the two earphones. output to the other of the two headphones.
在本申请的一个实施例中,处理器执行计算机程序时还实现以下步骤:接收每个耳机上报的撞击检测信息,该撞击检测信息用于表征耳机发生的撞击事件的特征;根据每个耳机上报的该撞击检测信息,检测该两个耳机之间是否发生相互撞击事件。In an embodiment of the present application, the processor also implements the following steps when executing the computer program: receiving impact detection information reported by each earphone, where the impact detection information is used to characterize the characteristics of the impact event that occurs in the earphone; the collision detection information, to detect whether a mutual collision event occurs between the two earphones.
在本申请的一个实施例中,处理器执行计算机程序时还实现以下步骤:根据每个耳机上报的该撞击检测信息,确定每个耳机发生撞击事件的撞击时间;若该两个耳机发生撞击事件的撞击时间的差距在预设时间差距范围内,则确定该两个耳机之间发生相互撞击事件。In an embodiment of the present application, when the processor executes the computer program, the following steps are also implemented: according to the impact detection information reported by each earphone, determine the impact time of the impact event of each earphone; if the two earphones have the impact event If the difference of the impact time is within the range of the preset time difference, it is determined that a mutual impact event occurs between the two earphones.
在本申请的一个实施例中,该撞击检测信息包括耳机在撞击事件发生时采集的环境音,处理器执行计算机程序时还实现以下步骤:根据各耳机上报的该撞击检测信息,确定各耳机在发生撞击事件时采集 到的环境音的能量值;若该两个耳机在发生撞击事件时采集到的环境音的能量值的差距在预设能量差距范围内,则确定该两个耳机之间发生相互撞击事件。In an embodiment of the present application, the impact detection information includes ambient sounds collected by the earphones when the impact event occurs, and the processor also implements the following steps when executing the computer program: according to the impact detection information reported by each earphone, determine whether each earphone is in The energy value of the ambient sound collected when the impact event occurs; if the difference between the energy values of the ambient sound collected by the two earphones when the impact event occurs is within the preset energy gap, it is determined that the two earphones have occurred between the two earphones. collision event.
在本申请的一个实施例中,该撞击检测信息包括耳机在撞击事件发生时采集的环境音,处理器执行计算机程序时还实现以下步骤:对于各耳机,检测该耳机上报的环境音的声音特征与预设声音特征是否一致;若该耳机上报的环境音的声音特征与该预设声音特征不一致,则确定该两个耳机之间未发生相互撞击事件。In one embodiment of the present application, the impact detection information includes ambient sounds collected by the earphones when the impact event occurs, and the processor also implements the following steps when executing the computer program: for each earphone, detecting the sound characteristics of the ambient sounds reported by the earphones Whether it is consistent with the preset sound feature; if the sound feature of the ambient sound reported by the earphone is inconsistent with the preset sound feature, it is determined that there is no collision event between the two earphones.
在本申请的一个实施例中,该撞击检测信息包括耳机的运动状态信息,处理器执行计算机程序时还实现以下步骤:对于各耳机,检测该耳机上报的运动状态信息与预设撞击运动状态信息是否一致;若该耳机上报的运动状态信息与该预设撞击运动状态信息不一致,则确定该两个耳机之间未发生相互撞击事件。In an embodiment of the present application, the impact detection information includes motion state information of the earphone, and the processor also implements the following steps when executing the computer program: for each earphone, detecting the motion state information reported by the earphone and the preset impact motion state information Whether it is consistent; if the motion state information reported by the earphones is inconsistent with the preset impact motion state information, it is determined that there is no mutual impact event between the two earphones.
本申请实施例提供的终端设备,其实现原理和技术效果与上述方法实施例类似,在此不再赘述。The implementation principle and technical effect of the terminal device provided by the embodiments of the present application are similar to those of the foregoing method embodiments, and details are not described herein again.
在本申请的一个实施例中,提供了一种耳机,该耳机包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现以下步骤:In one embodiment of the present application, an earphone is provided, the earphone includes a memory and a processor, a computer program is stored in the memory, and the processor implements the following steps when executing the computer program:
生成撞击检测信息,并将该撞击检测信息发送至与该第一耳机建立有通信连接的终端设备中,该撞击检测信息用于表征该第一耳机发生的撞击事件的特征,该撞击检测信息用于供该终端设备基于该撞击检测信息确定该第一耳机与和该终端设备建立有通信连接的第二耳机之间是否发生相互撞击事件;接收并播放该终端设备输出的第一音频,该第一音频是该终端设备在确定该第一耳机与该第二耳机之间发生相互撞击事件,且,该终端设备正在播放来自不同音源的至少两个音频后输出的,该第一音频为该至少两个音频中的一部分音频。Generate collision detection information, and send the collision detection information to a terminal device that has established a communication connection with the first earphone. The collision detection information is used to characterize the characteristics of the collision event that occurs in the first earphone, and the collision detection information is used. For the terminal device to determine whether a mutual collision event occurs between the first earphone and the second earphone that has established a communication connection with the terminal device based on the impact detection information; receive and play the first audio output from the terminal device, the first An audio is output by the terminal device after determining that the first earphone and the second earphone collide with each other, and the terminal device is playing at least two audios from different audio sources, and the first audio is the at least one audio Part of the audio of the two audios.
在本申请的一个实施例中,处理器执行计算机程序时还实现以下步骤:检测该第一耳机在撞击事件发生时采集的环境音的声音特征与预设声音特征是否一致;若该第一耳机在撞击事件发生时采集的环境音的声音特征与该预设声音特征一致,则生成该撞击检测信息。In an embodiment of the present application, the processor further implements the following steps when executing the computer program: detecting whether the sound characteristics of the ambient sound collected by the first earphone when the impact event occurs is consistent with the preset sound characteristics; The sound feature of the ambient sound collected when the impact event occurs is consistent with the preset sound feature, and the impact detection information is generated.
在本申请的一个实施例中,处理器执行计算机程序时还实现以下步骤:检测该第一耳机的运动状态信息与预设撞击运动状态信息是否一致;若该第一耳机的运动状态信息与该预设撞击运动状态信息一致,则生成该撞击检测信息。In an embodiment of the present application, the processor also implements the following steps when executing the computer program: detecting whether the motion state information of the first earphone is consistent with the preset impact motion state information; if the motion state information of the first earphone is consistent with the If the preset impact motion state information is consistent, the impact detection information is generated.
本申请实施例提供的耳机,其实现原理和技术效果与上述方法实施例类似,在此不再赘述。The implementation principle and technical effect of the earphone provided by the embodiment of the present application are similar to those of the foregoing method embodiment, and details are not described herein again.
在本申请的一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:In an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
检测与终端设备建立有通信连接的两个耳机之间是否发生相互撞击事件;若该两个耳机之间发生相 互撞击事件,则检测该终端设备是否正在播放来自不同音源的至少两个音频;若该终端设备正在播放来自不同音源的至少两个音频,则将该至少两个音频中的第一音频输出至该两个耳机中的其中一个耳机中,将该至少两个音频中的第二音频输出至该两个耳机中的另一个耳机中。Detect whether a mutual collision event occurs between two earphones that have established a communication connection with the terminal device; if a mutual collision event occurs between the two earphones, detect whether the terminal device is playing at least two audios from different audio sources; if The terminal device is playing at least two audios from different audio sources, then outputs the first audio of the at least two audios to one of the two earphones, and outputs the second audio of the at least two audios to one of the two earphones. output to the other of the two headphones.
在本申请的一个实施例中,计算机程序被处理器执行时还实现以下步骤:接收每个耳机上报的撞击检测信息,该撞击检测信息用于表征耳机发生的撞击事件的特征;根据每个耳机上报的该撞击检测信息,检测该两个耳机之间是否发生相互撞击事件。In an embodiment of the present application, when the computer program is executed by the processor, the following steps are further implemented: receiving impact detection information reported by each earphone, where the impact detection information is used to characterize the characteristics of the impact event occurring in the earphone; according to each earphone The reported collision detection information detects whether a mutual collision event occurs between the two earphones.
在本申请的一个实施例中,计算机程序被处理器执行时还实现以下步骤:根据每个耳机上报的该撞击检测信息,确定每个耳机发生撞击事件的撞击时间;若该两个耳机发生撞击事件的撞击时间的差距在预设时间差距范围内,则确定该两个耳机之间发生相互撞击事件。In an embodiment of the present application, when the computer program is executed by the processor, the following steps are also implemented: according to the impact detection information reported by each earphone, determine the impact time of the impact event of each earphone; if the two earphones collide If the difference between the impact times of the events is within the range of the preset time difference, it is determined that a mutual impact event occurs between the two earphones.
在本申请的一个实施例中,该撞击检测信息包括耳机在撞击事件发生时采集的环境音,计算机程序被处理器执行时还实现以下步骤:根据各耳机上报的该撞击检测信息,确定各耳机在发生撞击事件时采集到的环境音的能量值;若该两个耳机在发生撞击事件时采集到的环境音的能量值的差距在预设能量差距范围内,则确定该两个耳机之间发生相互撞击事件。In an embodiment of the present application, the impact detection information includes ambient sounds collected by the earphones when the impact event occurs, and when the computer program is executed by the processor, the following steps are also implemented: determine each earphone according to the impact detection information reported by each earphone. The energy value of the ambient sound collected when the impact event occurs; if the difference between the energy values of the ambient sound collected by the two earphones when the impact event occurs is within the range of the preset energy gap, determine the difference between the two earphones. A collision event occurred.
在本申请的一个实施例中,该撞击检测信息包括耳机在撞击事件发生时采集的环境音,计算机程序被处理器执行时还实现以下步骤:对于各耳机,检测该耳机上报的环境音的声音特征与预设声音特征是否一致;若该耳机上报的环境音的声音特征与该预设声音特征不一致,则确定该两个耳机之间未发生相互撞击事件。In an embodiment of the present application, the impact detection information includes ambient sound collected by the earphone when the impact event occurs, and the computer program is executed by the processor to further implement the following steps: for each earphone, detect the sound of the ambient sound reported by the earphone Whether the feature is consistent with the preset sound feature; if the sound feature of the ambient sound reported by the earphone is inconsistent with the preset sound feature, it is determined that there is no collision event between the two earphones.
在本申请的一个实施例中,该撞击检测信息包括耳机的运动状态信息,计算机程序被处理器执行时还实现以下步骤:对于各耳机,检测该耳机上报的运动状态信息与预设撞击运动状态信息是否一致;若该耳机上报的运动状态信息与该预设撞击运动状态信息不一致,则确定该两个耳机之间未发生相互撞击事件。In one embodiment of the present application, the impact detection information includes motion state information of the earphones, and the computer program also implements the following steps when executed by the processor: for each earphone, detecting the motion state information reported by the earphones and the preset impact motion state Whether the information is consistent; if the motion state information reported by the earphones is inconsistent with the preset impact motion state information, it is determined that there is no mutual collision event between the two earphones.
本实施例提供的计算机可读存储介质,其实现原理和技术效果与上述方法实施例类似,在此不再赘述。The implementation principle and technical effect of the computer-readable storage medium provided in this embodiment are similar to those of the foregoing method embodiments, and details are not described herein again.
在本申请的一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:In an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
生成撞击检测信息,并将该撞击检测信息发送至与该第一耳机建立有通信连接的终端设备中,该撞击检测信息用于表征该第一耳机发生的撞击事件的特征,该撞击检测信息用于供该终端设备基于该撞击检测信息确定该第一耳机与和该终端设备建立有通信连接的第二耳机之间是否发生相互撞击事件;接收并播放该终端设备输出的第一音频,该第一音频是该终端设备在确定该第一耳机与该第二耳机之间发生相互撞击事件,且,该终端设备正在播放来自不同音源的至少两个音频后输出的,该第一音频为该至少 两个音频中的一部分音频。Generate collision detection information, and send the collision detection information to a terminal device that has established a communication connection with the first earphone. The collision detection information is used to characterize the characteristics of the collision event that occurs in the first earphone, and the collision detection information is used. For the terminal device to determine whether a mutual collision event occurs between the first earphone and the second earphone that has established a communication connection with the terminal device based on the impact detection information; receive and play the first audio output from the terminal device, the first An audio is output by the terminal device after determining that the first earphone and the second earphone collide with each other, and the terminal device is playing at least two audios from different audio sources, and the first audio is the at least one audio Part of the audio of the two audios.
在本申请的一个实施例中,计算机程序被处理器执行时还实现以下步骤:检测该第一耳机在撞击事件发生时采集的环境音的声音特征与预设声音特征是否一致;若该第一耳机在撞击事件发生时采集的环境音的声音特征与该预设声音特征一致,则生成该撞击检测信息。In an embodiment of the present application, when the computer program is executed by the processor, the following steps are further implemented: detecting whether the sound characteristics of the ambient sound collected by the first earphone when the impact event occurs is consistent with the preset sound characteristics; The impact detection information is generated when the sound feature of the ambient sound collected by the earphone when the impact event occurs is consistent with the preset sound feature.
在本申请的一个实施例中,计算机程序被处理器执行时还实现以下步骤:检测该第一耳机的运动状态信息与预设撞击运动状态信息是否一致;若该第一耳机的运动状态信息与该预设撞击运动状态信息一致,则生成该撞击检测信息。In an embodiment of the present application, when the computer program is executed by the processor, the following steps are further implemented: detecting whether the motion state information of the first earphone is consistent with the preset impact motion state information; If the preset impact motion state information is consistent, the impact detection information is generated.
本实施例提供的计算机可读存储介质,其实现原理和技术效果与上述方法实施例类似,在此不再赘述。The implementation principle and technical effect of the computer-readable storage medium provided in this embodiment are similar to those of the foregoing method embodiments, and details are not described herein again.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以M种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(SyMchliMk)DRAM(SLDRAM)、存储器总线(RaMbus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage In the medium, when the computer program is executed, it may include the processes of the above-mentioned method embodiments. Wherein, any reference to memory, storage, database or other medium used in the various embodiments provided in this application may include non-volatile and/or volatile memory. Nonvolatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in M forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Road (SyMchliMk) DRAM (SLDRAM), memory bus (RaMbus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above-described embodiments can be combined arbitrarily. For the sake of brevity, all possible combinations of the technical features in the above-described embodiments are not described. However, as long as there is no contradiction between the combinations of these technical features, All should be regarded as the scope described in this specification.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only represent several embodiments of the present application, and the descriptions thereof are relatively specific and detailed, but should not be construed as a limitation on the scope of the patent application. It should be pointed out that for those skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the scope of protection of the patent of the present application shall be subject to the appended claims.

Claims (20)

  1. 一种音频输出方法,其中,所述方法包括:An audio output method, wherein the method comprises:
    检测与终端设备建立有通信连接的两个耳机之间是否发生相互撞击事件;Detect whether there is a mutual collision event between the two earphones that have established a communication connection with the terminal device;
    若所述两个耳机之间发生相互撞击事件,则检测所述终端设备是否正在播放来自不同音源的至少两个音频;If a mutual collision event occurs between the two earphones, detecting whether the terminal device is playing at least two audios from different audio sources;
    若所述终端设备正在播放来自不同音源的至少两个音频,则将所述至少两个音频中的第一音频输出至所述两个耳机中的其中一个耳机中,将所述至少两个音频中的第二音频输出至所述两个耳机中的另一个耳机中。If the terminal device is playing at least two audios from different audio sources, output the first audio of the at least two audios to one of the two earphones, and output the at least two audios to one of the two earphones. The second audio in the earphone is output to the other earphone of the two earphones.
  2. 根据权利要求1所述的方法,其中,所述检测与终端设备建立有通信连接的两个耳机之间是否发生相互撞击事件,包括:The method according to claim 1, wherein the detecting whether a mutual collision event occurs between two earphones that have established a communication connection with the terminal device comprises:
    接收每个所述耳机上报的撞击检测信息,所述撞击检测信息用于表征耳机发生的撞击事件的特征;Receive the impact detection information reported by each of the earphones, where the impact detection information is used to characterize the characteristics of the impact event that occurs in the earphone;
    根据每个所述耳机上报的所述撞击检测信息,检测所述两个耳机之间是否发生相互撞击事件。According to the collision detection information reported by each of the earphones, it is detected whether a mutual collision event occurs between the two earphones.
  3. 根据权利要求2所述的方法,其中,所述根据每个所述耳机上报的所述撞击检测信息,检测所述两个耳机之间是否发生相互撞击事件,包括:The method according to claim 2, wherein the detecting whether a mutual collision event occurs between the two earphones according to the collision detection information reported by each of the earphones comprises:
    根据每个所述耳机上报的所述撞击检测信息,确定每个所述耳机发生撞击事件的撞击时间;According to the impact detection information reported by each of the earphones, determine the impact time of the impact event of each of the earphones;
    若所述两个耳机发生撞击事件的撞击时间的差距在预设时间差距范围内,则确定所述两个耳机之间发生相互撞击事件。If the difference between the collision times of the two earphones when the collision event occurs is within a preset time difference range, it is determined that a mutual collision event occurs between the two earphones.
  4. 根据权利要求3所述的方法,其中,所述撞击时间为所述耳机上报所述撞击检测信息的时间;或者,The method according to claim 3, wherein the impact time is the time when the earphone reports the impact detection information; or,
    在所述撞击检测信息包括所述耳机在撞击事件发生时采集的环境音的情况下,所述撞击时间为所述环境音中能量峰值出现的时间;或者,In the case where the impact detection information includes ambient sound collected by the earphone when the impact event occurs, the impact time is the time when the energy peak in the ambient sound appears; or,
    在所述撞击检测信息携带所述耳机生成所述撞击检测信息的时间戳的情况下,所述撞击时间为所述时间戳所指示的时间。In a case where the impact detection information carries a timestamp at which the earphone generated the impact detection information, the impact time is the time indicated by the timestamp.
  5. 根据权利要求2所述的方法,其中,所述撞击检测信息包括耳机在撞击事件发生时采集的环境音,所述根据每个所述耳机上报的所述撞击检测信息,检测所述两个耳机之间是否发生相互撞击事件,包括:The method according to claim 2, wherein the impact detection information includes ambient sounds collected by earphones when an impact event occurs, and the two earphones are detected according to the impact detection information reported by each earphone. Whether there is a collision event between them, including:
    根据各所述耳机上报的所述撞击检测信息,确定各所述耳机在发生撞击事件时采集到的环境音的 能量值;According to the impact detection information reported by each of the earphones, determine the energy value of the ambient sound collected by each of the earphones when an impact event occurs;
    若所述两个耳机在发生撞击事件时采集到的环境音的能量值的差距在预设能量差距范围内,则确定所述两个耳机之间发生相互撞击事件。If the difference between the energy values of the ambient sounds collected by the two earphones when the collision event occurs is within a preset energy difference range, it is determined that a mutual collision event occurs between the two earphones.
  6. 根据权利要求2所述的方法,其中,所述撞击检测信息包括耳机在撞击事件发生时采集的环境音,所述根据每个所述耳机上报的所述撞击检测信息,检测所述两个耳机之间是否发生相互撞击事件,包括:The method according to claim 2, wherein the impact detection information includes ambient sounds collected by earphones when an impact event occurs, and the two earphones are detected according to the impact detection information reported by each earphone. Whether there is a collision event between them, including:
    对于各所述耳机,检测所述耳机上报的环境音的声音特征与预设声音特征是否一致;若所述耳机上报的环境音的声音特征与所述预设声音特征不一致,则确定所述两个耳机之间未发生相互撞击事件。For each of the earphones, detect whether the sound characteristics of the ambient sound reported by the earphones are consistent with the preset sound characteristics; if the sound characteristics of the ambient sound reported by the earphones are inconsistent with the preset sound characteristics, determine whether the two There was no collision between the headphones.
  7. 根据权利要求6所述的方法,其中,所述检测所述耳机上报的环境音的声音特征与预设声音特征是否一致,包括:The method according to claim 6, wherein the detecting whether the sound feature of the ambient sound reported by the earphone is consistent with the preset sound feature comprises:
    检测所述耳机上报的环境音在第一预设时长内出现能量峰值的次数以及间隔是否与所述预设声音特征所指示的在所述第一预设时长内出现能量峰值的次数以及间隔一致。Detecting whether the number of times and the interval of energy peaks in the ambient sound reported by the earphone are consistent with the number of times and intervals of energy peaks in the first preset time period indicated by the preset sound feature .
  8. 根据权利要求6所述的方法,其中,所述检测所述耳机上报的环境音的声音特征与预设声音特征是否一致,包括:The method according to claim 6, wherein the detecting whether the sound feature of the ambient sound reported by the earphone is consistent with the preset sound feature comprises:
    检测所述耳机上报的环境音的能量峰值的大小是否与所述预设声音特征所指示的能量峰值的大小一致。It is detected whether the magnitude of the energy peak of the ambient sound reported by the earphone is consistent with the magnitude of the energy peak indicated by the preset sound feature.
  9. 根据权利要求6所述的方法,其中,所述检测所述耳机上报的环境音的声音特征与预设声音特征是否一致,包括:The method according to claim 6, wherein the detecting whether the sound feature of the ambient sound reported by the earphone is consistent with the preset sound feature comprises:
    检测所述耳机上报的环境音的频率的大小是否与所述预设声音特征所指示的频率的大小一致。It is detected whether the magnitude of the frequency of the ambient sound reported by the earphone is consistent with the magnitude of the frequency indicated by the preset sound feature.
  10. 根据权利要求2所述的方法,其中,所述撞击检测信息包括耳机的运动状态信息,所述根据每个所述耳机上报的所述撞击检测信息,检测所述两个耳机之间是否发生相互撞击事件,包括:The method according to claim 2, wherein the collision detection information includes motion state information of the earphones, and the collision detection information reported by each earphone is used to detect whether the two earphones interact with each other. Impact events, including:
    对于各所述耳机,检测所述耳机上报的运动状态信息与预设撞击运动状态信息是否一致;若所述耳机上报的运动状态信息与所述预设撞击运动状态信息不一致,则确定所述两个耳机之间未发生相互撞击事件。For each of the earphones, it is detected whether the motion state information reported by the earphones is consistent with the preset impact motion state information; if the motion state information reported by the earphones is inconsistent with the preset impact motion state information, it is determined that the two There was no collision between the headphones.
  11. 根据权利要求10所述的方法,其中,所述运动状态信息包括加速度信息,所述检测所述耳机 上报的运动状态信息与预设撞击运动状态信息是否一致,包括:The method according to claim 10, wherein, the motion state information includes acceleration information, and whether the motion state information reported by the detection earphone is consistent with the preset impact motion state information, including:
    根据所述耳机上报的加速度信息确定所述耳机在第二预设时长内的加速度变化情况;Determine, according to the acceleration information reported by the earphone, the acceleration change of the earphone within the second preset time period;
    检测所述耳机的加速度变化情况与所述预设撞击运动状态信息所指示的加速度变化情况是否一致。It is detected whether the acceleration change of the earphone is consistent with the acceleration change indicated by the preset impact motion state information.
  12. 根据权利要求10所述的方法,其中,所述运动状态信息包括旋转角度信息,所述检测所述耳机上报的运动状态信息与预设撞击运动状态信息是否一致,包括:The method according to claim 10, wherein the motion state information includes rotation angle information, and the detecting whether the motion state information reported by the earphone is consistent with the preset impact motion state information includes:
    根据所述耳机上报的旋转角度信息确定所述耳机在第三预设时长内的姿态变化情况;Determine, according to the rotation angle information reported by the earphone, the posture change of the earphone within the third preset time period;
    检测所述耳机的姿态变化情况与所述预设撞击运动状态信息所指示的姿态变化情况是否一致。It is detected whether the posture change of the earphone is consistent with the posture change indicated by the preset impact motion state information.
  13. 一种音频输出方法,其中,用于第一耳机中,所述方法包括:An audio output method, wherein, used in a first earphone, the method includes:
    生成撞击检测信息,并将所述撞击检测信息发送至与所述第一耳机建立有通信连接的终端设备中,所述撞击检测信息用于表征所述第一耳机发生的撞击事件的特征,所述撞击检测信息用于供所述终端设备基于所述撞击检测信息确定所述第一耳机与和所述终端设备建立有通信连接的第二耳机之间是否发生相互撞击事件;Generate collision detection information, and send the collision detection information to a terminal device that has established a communication connection with the first earphone, where the collision detection information is used to characterize the characteristics of the collision event that occurred in the first earphone, so The collision detection information is used for the terminal device to determine, based on the collision detection information, whether a mutual collision event occurs between the first earphone and the second earphone that has established a communication connection with the terminal device;
    接收并播放所述终端设备输出的第一音频,所述第一音频是所述终端设备在确定所述第一耳机与所述第二耳机之间发生相互撞击事件,且,所述终端设备正在播放来自不同音源的至少两个音频后输出的,所述第一音频为所述至少两个音频中的一部分音频。Receive and play the first audio output from the terminal device, where the first audio is the event that the terminal device determines that the first earphone and the second earphone collide with each other, and the terminal device is The first audio is output after playing at least two audios from different audio sources, and the first audio is a part of the at least two audios.
  14. 根据权利要求13所述的方法,其中,所述生成撞击检测信息,包括:The method of claim 13, wherein said generating impact detection information comprises:
    检测所述第一耳机在撞击事件发生时采集的环境音的声音特征与预设声音特征是否一致;Detecting whether the sound feature of the ambient sound collected by the first earphone when the impact event occurs is consistent with the preset sound feature;
    若所述第一耳机在撞击事件发生时采集的环境音的声音特征与所述预设声音特征一致,则生成所述撞击检测信息。If the sound feature of the ambient sound collected by the first earphone when the impact event occurs is consistent with the preset sound feature, the impact detection information is generated.
  15. 根据权利要求13所述的方法,其中,所述生成撞击检测信息,包括:The method of claim 13, wherein said generating impact detection information comprises:
    检测所述第一耳机的运动状态信息与预设撞击运动状态信息是否一致;Detecting whether the motion state information of the first earphone is consistent with the preset impact motion state information;
    若所述第一耳机的运动状态信息与所述预设撞击运动状态信息一致,则生成所述撞击检测信息。If the motion state information of the first earphone is consistent with the preset impact motion state information, the impact detection information is generated.
  16. 根据权利要求13所述的方法,其中,所述生成撞击检测信息,包括:The method of claim 13, wherein said generating impact detection information comprises:
    检测所述第一耳机在撞击事件发生时采集的环境音的声音特征与预设声音特征是否一致;Detecting whether the sound feature of the ambient sound collected by the first earphone when the impact event occurs is consistent with the preset sound feature;
    检测所述第一耳机的运动状态信息与预设撞击运动状态信息是否一致;Detecting whether the motion state information of the first earphone is consistent with the preset impact motion state information;
    若所述第一耳机在撞击事件发生时采集的环境音的声音特征与所述预设声音特征一致,且,所述第一耳机的运动状态信息与所述预设撞击运动状态信息一致,则生成所述撞击检测信息。If the sound characteristics of the ambient sound collected by the first earphone when the impact event occurs are consistent with the preset sound characteristics, and the motion state information of the first earphone is consistent with the preset impact motion state information, then The impact detection information is generated.
  17. 一种音频输出装置,其中,所述装置包括:An audio output device, wherein the device comprises:
    第一检测模块,用于检测与终端设备建立有通信连接的两个耳机之间是否发生相互撞击事件;a first detection module for detecting whether a collision event occurs between two earphones that have established a communication connection with the terminal device;
    第二检测模块,用于在所述两个耳机之间发生相互撞击事件的情况下,检测所述终端设备是否正在播放来自不同音源的至少两个音频;a second detection module, configured to detect whether the terminal device is playing at least two audios from different audio sources when a mutual collision event occurs between the two earphones;
    输出模块,用于在所述终端设备正在播放来自不同音源的至少两个音频的情况下,将所述至少两个音频中的第一音频输出至所述两个耳机中的其中一个耳机中,将所述至少两个音频中的第二音频输出至所述两个耳机中的另一个耳机中。an output module, configured to output a first audio of the at least two audios to one of the two earphones when the terminal device is playing at least two audios from different audio sources, A second audio of the at least two audios is output to the other of the two earphones.
  18. 一种音频输出装置,其中,用于第一耳机中,所述装置包括:An audio output device, used in a first earphone, the device comprising:
    生成模块,用于生成撞击检测信息;A generation module is used to generate impact detection information;
    发送模块,用于将所述撞击检测信息发送至与所述第一耳机建立有通信连接的终端设备中,所述撞击检测信息用于表征所述第一耳机发生的撞击事件的特征,所述撞击检测信息用于供所述终端设备基于所述撞击检测信息确定所述第一耳机与和所述终端设备建立有通信连接的第二耳机之间是否发生相互撞击事件;a sending module, configured to send the impact detection information to a terminal device that has established a communication connection with the first earphone, the impact detection information is used to characterize the characteristics of the impact event that occurs in the first earphone, the The collision detection information is used for the terminal device to determine, based on the collision detection information, whether a mutual collision event occurs between the first earphone and the second earphone that has established a communication connection with the terminal device;
    接收模块,用于接收并播放所述终端设备输出的第一音频,所述第一音频是所述终端设备在确定所述第一耳机与所述第二耳机之间发生相互撞击事件,且,所述终端设备正在播放来自不同音源的至少两个音频后输出的,所述第一音频为所述至少两个音频中的一部分音频。a receiving module, configured to receive and play the first audio output from the terminal device, where the first audio is the event that the terminal device determines that the first earphone and the second earphone collide with each other, and, The first audio is output after the terminal device is playing at least two audios from different audio sources, and the first audio is a part of the at least two audios.
  19. 一种计算机设备,其中,包括处理器和存储器,所述存储器中存储有计算机程序,所述处理器执行所述计算机程序时实现如权利要求1至16任一所述的音频输出方法。A computer device, comprising a processor and a memory, wherein a computer program is stored in the memory, and the processor implements the audio output method according to any one of claims 1 to 16 when the processor executes the computer program.
  20. 一种计算机可读存储介质,其中,其上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至16任一所述的音频输出方法。A computer-readable storage medium, wherein a computer program is stored thereon, and when the computer program is executed by a processor, the audio output method according to any one of claims 1 to 16 is implemented.
PCT/CN2022/077878 2021-03-24 2022-02-25 Audio output method and apparatus, computer device, and storage medium WO2022199319A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110315199.7 2021-03-24
CN202110315199.7A CN112925503A (en) 2021-03-24 2021-03-24 Audio output method, audio output device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2022199319A1 true WO2022199319A1 (en) 2022-09-29

Family

ID=76175878

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/077878 WO2022199319A1 (en) 2021-03-24 2022-02-25 Audio output method and apparatus, computer device, and storage medium

Country Status (2)

Country Link
CN (1) CN112925503A (en)
WO (1) WO2022199319A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112925503A (en) * 2021-03-24 2021-06-08 深圳市欢太科技有限公司 Audio output method, audio output device, computer equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110159814A1 (en) * 2008-06-24 2011-06-30 Sony Computer Entertainment Inc. Wireless Device Multimedia Feed Switching
US20150105014A1 (en) * 2013-10-15 2015-04-16 Voyetra Turtle Beach, Inc. Auto-pairing of headset to headset basestation
CN106358126A (en) * 2016-09-26 2017-01-25 宇龙计算机通信科技(深圳)有限公司 Multi-audio frequency playing method, system and terminal
CN107066231A (en) * 2017-04-28 2017-08-18 维沃移动通信有限公司 A kind of acoustic information player method and mobile terminal
CN109445740A (en) * 2018-09-30 2019-03-08 Oppo广东移动通信有限公司 Audio frequency playing method, device, electronic equipment and storage medium
CN112925503A (en) * 2021-03-24 2021-06-08 深圳市欢太科技有限公司 Audio output method, audio output device, computer equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9819710B2 (en) * 2011-08-25 2017-11-14 Logitech Europe S.A. Easy sharing of wireless audio signals
CN112351507B (en) * 2020-10-30 2023-04-14 维沃移动通信有限公司 Interaction control method, interaction control device, electronic equipment and readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110159814A1 (en) * 2008-06-24 2011-06-30 Sony Computer Entertainment Inc. Wireless Device Multimedia Feed Switching
US20150105014A1 (en) * 2013-10-15 2015-04-16 Voyetra Turtle Beach, Inc. Auto-pairing of headset to headset basestation
CN106358126A (en) * 2016-09-26 2017-01-25 宇龙计算机通信科技(深圳)有限公司 Multi-audio frequency playing method, system and terminal
CN107066231A (en) * 2017-04-28 2017-08-18 维沃移动通信有限公司 A kind of acoustic information player method and mobile terminal
CN109445740A (en) * 2018-09-30 2019-03-08 Oppo广东移动通信有限公司 Audio frequency playing method, device, electronic equipment and storage medium
CN112925503A (en) * 2021-03-24 2021-06-08 深圳市欢太科技有限公司 Audio output method, audio output device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN112925503A (en) 2021-06-08

Similar Documents

Publication Publication Date Title
US9113246B2 (en) Automated left-right headphone earpiece identifier
WO2020228095A1 (en) Real-time voice wake-up audio device, operation method and apparatus, and storage medium
US20210144463A1 (en) Method for Controlling Volume of Wireless Headset, and Computer-Readable Storage Medium
US10503462B2 (en) Systems and methods for handling application notifications
US20110196519A1 (en) Control of audio system via context sensor
CN104978166A (en) Volume adjusting method and device
WO2020019821A1 (en) Microphone hole-blockage detection method and related product
CN106302997B (en) Output control method, electronic equipment and system
CN107122161B (en) Audio data playing control method and terminal
TW201333813A (en) Audio player and control method thereof
WO2020019820A1 (en) Microphone hole blockage detection method and related product
CN110691300B (en) Audio playing device and method for providing information
WO2022199319A1 (en) Audio output method and apparatus, computer device, and storage medium
WO2020019858A1 (en) Microphone hole clogging detection method and related products
WO2020211766A1 (en) Audio processing method, circuit and terminal
CN112468924A (en) Earphone noise reduction method and device
TW201439895A (en) Electronic device and method for sensing headset
WO2017027397A3 (en) Event detection for playback management in an audio device
US8885852B2 (en) Audio control system
WO2017032031A1 (en) Volume adjustment method and user terminal
US10405114B2 (en) Automated detection of an active audio output
WO2019109420A1 (en) Left and right channel determining method and earphone device
WO2021258414A1 (en) Method and apparatus for suppressing vibration of housing of electronic device, and device and storage medium
TW201715380A (en) Electronic apparatus and sound signal adjustment method thereof
WO2021258466A1 (en) Mode switching method and apparatus for external sound playback, and device, medium and sound production system

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: 22773981

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: 22773981

Country of ref document: EP

Kind code of ref document: A1