Audio playing control method and device, earphone equipment and storage medium

By combining playback status indicators and audio stream transmission status, the headphone device accurately controls the switching of the audio player status on the terminal device, solving the problem of inaccurate control in existing technologies and achieving higher control accuracy and energy saving.

CN121692016APending Publication Date: 2026-03-17GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2021-09-30
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Existing headphone devices suffer from insufficient precision in controlling audio playback on terminal devices.

Method used

The headphone device communicates with the terminal device, combines the playback status indicator and the audio stream transmission status to determine the current status of the terminal device's audio player, and sends playback control commands when the status is inconsistent in order to accurately control the switching of the audio player.

Benefits of technology

It improves the accuracy of controlling the audio player on the terminal device, avoids erroneous control caused by inaccurate status recognition, meets the actual needs of users, and saves power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121692016A_ABST
    Figure CN121692016A_ABST
Patent Text Reader

Abstract

The invention discloses an audio playing control method and device, earphone equipment and a storage medium. The method is applied to an earphone device, the earphone device is in communication connection with a terminal device, and the method comprises the following steps: responding to an execution operation for the earphone device, and according to at least one of a playing state identifier synchronized by the terminal device and a current audio stream transmission state of the terminal device, transmitting the audio stream to the terminal device; determining that an audio player of the terminal equipment is in a current first playing state; and under the condition that the first playing state is inconsistent with a target playing state corresponding to the execution operation, sending a playing control instruction to the terminal equipment, so that the terminal equipment switches the audio player from the first playing state to the target playing state. According to the audio playing control method and device, the earphone equipment and the storage medium, the earphone equipment can more accurately control the playing state of the audio player of the terminal equipment, and the control accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the Chinese Patent Application No. 202111161956.6, filed on September 30, 2021, entitled "Method, Device, Earphone Device and Storage Medium for Controlling Audio Playing", the disclosure of which is incorporated herein by reference in its entirety. TECHNICAL FIELD

[0002] The present application relates to the technical field of communication, in particular to a method and device for controlling audio playing, an earphone device and a storage medium. BACKGROUND

[0003] As an important accessory of terminal devices such as mobile phones, tablet computers and smart watches, earphone devices are used by users in many daily scenarios, such as listening to music, listening to video sound and talking to others. Currently, earphone devices support the function of controlling the audio playing and pausing of terminal devices, but there is still a problem of inaccurate control. SUMMARY

[0004] The present application discloses a method and device for controlling audio playing, an earphone device and a storage medium, which can more accurately control the playing state of the audio player of the terminal device and improve the control accuracy.

[0005] The present application discloses a method for controlling audio playing, applied to an earphone device, which is in communication connection with a terminal device, and the method comprises: In response to an execution operation for the earphone device, determining the first playing state of the audio player of the terminal device according to at least one of the playing state identifier synchronized by the terminal device and the current audio stream transmission state of the terminal device, wherein the playing state identifier is used to represent the playing state of the audio player of the terminal device when the terminal device synchronizes the playing state identifier; and the playing state includes playing or stopping playing. If the first playing state is inconsistent with the target playing state corresponding to the execution operation, sending a playing control instruction to the terminal device, wherein the playing control instruction is used to instruct the terminal device to switch the audio player from the first playing state to the target playing state.

[0006] The present application discloses a method for controlling audio playing, applied to an earphone device, which is in communication connection with a terminal device, and the method comprises: In response to the operation performed on the headphone device, a determination is made as to whether to send a playback control command to the terminal device based on at least one of the playback status identifier synchronized by the terminal device and the current audio stream transmission status of the terminal device; wherein, the playback status identifier is used to characterize the playback status of the audio player of the terminal device when the playback status identifier is synchronized; the playback status includes playing or stopped playing; If so, the playback control command is sent to the terminal device, the control command being used to instruct the terminal device to change the playback state of the audio player; If not, the playback control command will not be sent to the terminal device.

[0007] This application discloses a device for controlling audio playback, applied to a headphone device, wherein the headphone device is communicatively connected to a terminal device, and the device includes: A playback status determination module is configured to, in response to an operation performed on the headphone device, determine the current first playback status of the audio player of the terminal device based on at least one of a playback status identifier synchronized by the terminal device and the current audio stream transmission status of the terminal device; wherein, the playback status identifier is used to characterize the playback status of the audio player of the terminal device when the terminal device synchronizes the playback status identifier; the playback status includes playing or stopped playing; The instruction sending module is used to send a playback control instruction to the terminal device when the first playback state is inconsistent with the target playback state corresponding to the execution operation. The playback control instruction is used to instruct the terminal device to switch the audio player from the first playback state to the target playback state.

[0008] This application discloses a device for controlling audio playback, applied to a headphone device, wherein the headphone device is communicatively connected to a terminal device, and the device includes: The judgment module is used to respond to the operation performed on the headphone device and determine whether to send a playback control command to the terminal device based on at least one of the playback status identifier synchronized by the terminal device and the current audio stream transmission status of the terminal device; wherein, the playback status identifier is used to characterize the playback status of the audio player of the terminal device when the playback status identifier is synchronized; the playback status includes playing or stopped playing; The instruction sending module is configured to send the playback control instruction to the terminal device when the judgment result of the judgment module is yes, wherein the control instruction is used to instruct the terminal device to change the playback state of the audio player; and to not send the playback control instruction to the terminal device when the judgment result of the judgment module is no.

[0009] This application discloses an earphone device, including a memory and a processor. The memory stores a computer program, which, when executed by the processor, causes the processor to implement the method described above.

[0010] This application discloses a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described above.

[0011] The present application discloses a method, apparatus, headphone device, and storage medium for controlling audio playback. In response to an operation performed on the headphone device, the headphone device determines the current first playback state of the audio player based on at least one of a playback state identifier synchronized with the terminal device and the current audio stream transmission state of the terminal device. If the first playback state is inconsistent with the target playback state corresponding to the operation, a playback control command is sent to the terminal device to switch the audio player in the terminal device from the first playback state to the target playback state. In this application embodiment, the headphone device can combine the playback state identifier synchronized with the terminal device and the current audio stream transmission state of the terminal device to determine whether to send a playback control command to the terminal device. This avoids erroneous control due to inaccurate identification of the actual playback state of the audio player in the terminal device, enabling more accurate control of the playback state of the audio player and improving control accuracy. Attached Figure Description

[0012] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 This is an application scenario diagram of a method for controlling audio playback in one embodiment; Figure 2 This is a flowchart of a method for controlling audio playback in one embodiment; Figure 3 This is a flowchart illustrating, in one embodiment, how the headphone device actively controls the audio player of the terminal device to stop playing when the user performs an operation of removing or inserting the headphone into the case; Figure 4 In another embodiment, a flowchart shows how the headphone device actively controls the audio player of the terminal device to stop playing when the user performs an operation of removing or putting the headphones back in the case. Figure 5This is a flowchart illustrating, in one embodiment, how the headphone device actively controls the audio player of the terminal device to play audio when the user performs a wearing operation; Figure 6 In another embodiment, a flowchart shows the headphone device actively controlling the audio player of the terminal device to play audio when the user performs a wearing operation. Figure 7 A flowchart of a method for controlling audio playback in another embodiment; Figure 8 This is a block diagram of a device for controlling audio playback in one embodiment; Figure 9 A block diagram of a device for controlling audio playback in another embodiment; Figure 10 This is a structural block diagram of a headphone device in one embodiment. Detailed Implementation

[0014] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0015] It should be noted that the terms "comprising" and "having," and any variations thereof, in the embodiments and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.

[0016] It is understood that the terms "first," "second," etc., used in this application may be used to describe various elements herein, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of this application, a first earphone may be referred to as a second earphone, and similarly, a second earphone may be referred to as a first earphone. Both the first and second earphones are earphones, but they are not the same earphone. Furthermore, it should be noted that the terms "multiple," etc., used in the embodiments of this application refer to two or more.

[0017] Figure 1 This is an application scenario diagram of a method for controlling audio playback in one embodiment. For example... Figure 1As shown, the headphone device 10 can establish a communication connection with the terminal device 20. The headphone device 10 may include, but is not limited to, over-ear headphones, in-ear headphones, earbuds, and ear-hook headphones. Furthermore, the headphone device 10 may be a wireless Bluetooth headset, such as a True Wireless Stereo (TWS) Bluetooth headset. The terminal device 20 may include, but is not limited to, mobile phones, tablets, wearable devices (such as smartwatches, smart glasses, etc.), in-vehicle terminals, and PCs (Personal Computers). Furthermore, the headphone device 10 can establish a wireless communication connection with the terminal device 20 via Bluetooth or a wired communication connection via a data cable; the communication connection method is not limited here.

[0018] When the headphone device 10 detects an operation performed by the user, it can, in response to the operation, determine whether to send a playback control command to the terminal device 20 based on at least one of the playback status identifier synchronized by the terminal device 20 and the current audio stream transmission status of the terminal device 20. The playback status identifier indicates the playback status of the audio player on the terminal device 20 when the playback status identifier is synchronized; the playback status of the audio player may include playing or stopped.

[0019] The headphone device 10 can combine the playback status identifier synchronized with the terminal device and the current audio stream transmission status of the terminal device to determine whether to send a playback control command to the terminal device. By using at least one of the playback status identifier synchronized with the terminal device 20 and the current audio stream transmission status of the terminal device 20, the actual playback status of the audio player in the terminal device 20 can be more accurately determined. This avoids the situation where the actual playback status of the audio player in the terminal device 20 is not accurately identified, which may lead to erroneous control. The playback status of the audio player in the terminal device 20 can be controlled more accurately, thus improving the control accuracy.

[0020] like Figure 2 As shown, in one embodiment, a method for controlling audio playback is provided, which can be applied to the aforementioned headphone device. This method may include the following steps: Step 210: In response to the operation performed on the headphone device, determine the current first playback state of the audio player of the terminal device based on at least one of the playback state identifier synchronized by the terminal device and the current audio stream transmission state of the terminal device.

[0021] In some embodiments, the operations performed on the headphone device may include one or more of the following: removing the headphone device from the user's ear, placing the headphone device in the headphone case, and wearing the headphone device. The removal operation refers to removing the headphone device from the user's ear; the placing operation refers to placing the headphone device in the headphone case; and the wearing operation refers to wearing the headphone device on the user's ear. The operations performed on the headphone device may be performed on only a single earphone, such as placing a single earphone in the headphone case or removing a single earphone; or they may be performed on both earphones, such as removing both earphones simultaneously or wearing both earphones simultaneously.

[0022] In some embodiments, the headphone device may be equipped with one or more sensors to detect user actions. Optionally, the sensors may include one or more of the following: a distance sensor, a pressure sensor, a touch sensor, a light sensor, etc. For example, a distance sensor may be used to detect removal and wearing actions, and a light sensor may be used to detect insertion into the case, but these are not limited to these. As another implementation, for insertion into the case, the headphone device may also detect the action based on an insertion command sent by the headphone case. When the user places the headphone device into the headphone case, the headphone case may send an insertion command to the headphone device. Upon receiving the insertion command, the headphone device determines that an insertion operation has been detected. It should be noted that the headphone device may also detect user actions using other detection methods, and is not limited to the methods described above.

[0023] When the headphone device detects an operation performed by the user, it can respond to the operation by obtaining the playback status identifier of the most recently synchronized terminal device and / or the current audio stream transmission status of the terminal device, and determine the current first playback state of the audio player of the terminal device based on at least one of the playback status identifier synchronized by the terminal device and the current audio stream transmission status of the terminal device.

[0024] The playback status identifier can be used to characterize the playback status of the audio player on the terminal device when the playback status identifier is synchronized. This playback status may include playing or stopped. Optionally, the terminal device can synchronize the playback status identifier corresponding to the changed playback status to the headphone device each time it detects a change in the audio player's playback status. For example, when the terminal device detects that the audio player's playback status changes from playing to stopped, it can synchronize a playback status identifier indicating that the audio player's playback status is stopped; when the terminal device detects that the audio player's playback status changes from stopped to playing, it can synchronize a playback status identifier indicating that the audio player's playback status is playing. Optionally, the terminal device can also synchronize the playback status identifier to the headphone device at a preset time period, for example, every 3 seconds, 5 seconds, etc.

[0025] In some embodiments, the playback status identifier may consist of one or more of numbers, letters, symbols, etc. Different playback states of the audio player may correspond to different playback status identifiers. For example, a playback status identifier of "play" indicates that the audio player is playing, and a playback status identifier of "pause" indicates that the audio player is not playing; or, a playback status identifier of "1" indicates that the audio player is playing, and a playback status identifier of "0" indicates that the audio player is not playing, etc., but not limited to these.

[0026] It should be noted that the audio player in the terminal device can refer to audio playback applications such as video players and music players running on the terminal device; it can also refer to the audio module in the terminal device, which can be used to manage the audio playback of the terminal device, including managing whether to play audio data, and managing whether to play audio data through the terminal device's speakers or through other devices (such as headphones) that are connected to the terminal device.

[0027] The current audio stream transmission status of the terminal device can be used to indicate whether the headphone device is currently receiving an audio stream sent by the terminal device. Optionally, the audio stream transmission status may include any one of the following: a first state indicating no audio stream transmission, a second state indicating that the currently transmitted audio stream is a silent stream, and a third state indicating that the currently transmitted audio stream is not a silent stream. A silent stream may refer to an audio stream where all data values ​​are 0, which is represented by no sound in the headphone device. The current audio stream transmission status of the terminal device can be used to determine whether the headphone device is currently muted.

[0028] In related technologies, regardless of the user's action, the headphone device determines the actual playback status of the audio player on the terminal device based on the playback status identifier synchronized with the terminal device. However, because different terminal devices or different applications on the terminal device may have different mechanisms for synchronizing playback status identifiers, untimely synchronization can occur. For example, the audio player on the terminal device may have stopped playing, but it may take 3 seconds to synchronize with the headphone device. Therefore, inaccurate recognition of the actual playback status of the audio player on the terminal device by the headphone device can lead to erroneous control.

[0029] In some embodiments, the headphone device can jointly determine the current first playback state of the terminal device's audio player based on the playback state identifier synchronized by the terminal device and the current audio stream transmission state of the terminal device. This first playback state may refer to the current actual playback state of the terminal device.

[0030] Specifically, if the playback status indicator synchronized by the terminal device indicates that the audio player on the terminal device is playing, and the current audio stream transmission status of the terminal device is in the third state (the currently transmitted audio stream is not a silent stream), then it can be determined that the audio player on the terminal device is currently playing in the first playback state. The playback status indicator indicating that the audio player is playing, and the current audio stream transmission status being in the third state, means that the audio player is currently playing audio data. This avoids situations where the audio player has paused playback but has not yet synchronized a playback status indicator indicating that playback has stopped, or where the terminal device has just stopped the audio player, but audio is still being transmitted to the headphone device, which might be mistakenly identified as the audio player being played.

[0031] If the playback status indicator synchronized by the terminal device indicates that the audio player on the terminal device is stopped playing, and the current audio stream transmission status of the terminal device is either the first state (no audio stream transmission) or the second state (the currently transmitted audio stream is silent), then it can be determined that the audio player on the terminal device is currently stopped playing in the first playback state. The playback status indicator indicating that the audio player is stopped playing, and the current audio stream transmission status being either the first or second state, means that the audio player is currently not playing audio data. This avoids situations where the audio player has started playing but has not yet synchronized the playback status indicator, or where the terminal device has just started controlling the audio player to play, but no audio stream has yet been transmitted to the headphone device, which could be mistakenly identified as the audio player stopping playback. Compared to identifying the actual playback status of the audio player on the terminal device solely based on the synchronized playback status indicator, combining the synchronized playback status indicator and the current audio stream transmission status of the terminal device can more accurately identify the actual playback status of the audio player.

[0032] In some embodiments, for different usage scenarios of the headphone device, a corresponding identification strategy for the actual playback state of the audio player in the terminal device can be set respectively. The first playback state of the audio player in the terminal device can be determined based on the playback state identifier synchronized by the terminal device and / or the current audio stream transmission state of the terminal device. The first playback state may refer to the current actual playback state of the terminal device.

[0033] For example, in a scenario where headphones are removed (i.e., the headphone device detects the removal operation), the current first playback state of the audio player on the terminal device can be determined based on the playback status identifier synchronized with the terminal device and the current audio stream transmission status. Conversely, in a scenario where headphones are worn (i.e., the headphone device detects the wearing operation), the current first playback state of the audio player on the terminal device can be determined solely based on the current audio stream transmission status, and so on. However, this is not the only approach. Selecting appropriate recognition strategies based on different headphone usage scenarios allows for more flexible and accurate identification of the actual playback state of the audio player on the terminal device.

[0034] Step 220: If the first playback state is inconsistent with the target playback state corresponding to the operation, a playback control command is sent to the terminal device.

[0035] Step 230: If the first playback state is consistent with the target playback state corresponding to the operation being performed, no playback control command is sent to the terminal device.

[0036] The target playback state for each execution operation can be preset. This target playback state can be the playback state desired by the user after performing the operation. For example, when a user removes the headphones, they usually want to hear external sounds; therefore, the operation is "remove," and the corresponding target playback state could be "stop playing." When a user wears the headphones, they usually want to hear the sound from the terminal device; therefore, the operation is "wear," and the corresponding target playback state could be "playing." It should be noted that the target playback state for each execution operation can be set according to actual needs or the actual headphone usage scenario, and this application embodiment does not specifically limit this.

[0037] If the audio player on the terminal device is in a different state than the target playback state corresponding to the operation being performed, it indicates that the playback state of the audio player needs to be changed. The headphone device can send a playback control command to the terminal device, which instructs the terminal device to switch the audio player from the first playback state to the target playback state to meet the user's actual needs. The playback control command can correspond to the target playback state. For example, if the target playback state is "playing," the playback control command can be a "start playback" command; if the target playback state is "stop playback," the playback control command can be a "stop playback" command.

[0038] If the audio player on the terminal device is in the same first playback state as the target playback state corresponding to the operation, it means that the audio player is already in the playback state required by the user and there is no need to change the playback state of the audio player. Therefore, no playback control command is sent to the terminal device.

[0039] In this embodiment, the headphone device can combine the playback status identifier of the terminal device at the same frequency with the current audio stream transmission status of the terminal device to determine whether to send a playback control command to the terminal device. This avoids the situation where inaccurate identification of the actual playback status of the audio player in the terminal device leads to erroneous control, and can more accurately control the playback status of the audio player in the terminal device, thereby improving control accuracy.

[0040] In some embodiments, when the user performs an action such as removing or inserting the headphones, the headphone device can actively control the audio player of the terminal device to stop playing. For example... Figure 3 As shown, the above-described method for controlling audio playback may include the following steps: Step 302: Determine that the audio player on the terminal device is in playback mode.

[0041] In this embodiment, the headphone device may trigger active control to stop playback only if it detects an operation to remove or insert the headphone device into the case after determining that the audio player of the terminal device is in a playing state.

[0042] In some embodiments, in a scenario where a user removing the headphones triggers the audio player on the control terminal device to stop playing, if the headphones receive a playback status flag from the terminal device indicating that the audio player is in playback mode while the headphones are being worn, or if the headphones continuously receive a non-silent audio stream transmitted from the terminal device for a certain period of time, then it can be determined that the audio player on the terminal device has entered a playback state. When the headphones detect the removal operation, the audio player on the active control terminal device can be triggered to stop playing.

[0043] In some embodiments, in a scenario where a user places the headphones into the headphone case, triggering the audio player on the control terminal device to stop playing, if the headphones are outside the case, and the headphone receives a playback status flag from the terminal device indicating that the audio player is in playback mode, or if the headphone receives a non-silent audio stream transmitted from the terminal device for a certain period of time, then it can be determined that the audio player on the terminal device has entered a playback state. Upon detecting the headphone insertion operation, the audio player on the active control terminal device can be triggered to stop playing.

[0044] Optionally, if the audio player on the terminal device is not currently playing, the headphone device will not trigger an active control to stop playback when it detects a removal or insertion operation; that is, it will not respond to the removal or insertion operation. For example, if the audio player on the terminal device is playing when the user is wearing the headphone device, removing the headphone device can trigger an automatic stop playback operation. If the user restarts playback after removing the headphone device, inserting the headphone device into the headphone case will trigger another automatic stop playback operation. If the user does not restart playback after removing the headphone device, inserting the headphone device into the headphone case will not trigger an insertion operation (or the insertion operation can be ignored entirely).

[0045] Only when the headphone device determines that the audio player on the terminal device is in a playing state will the user's actions of removing or inserting the headphone into the case trigger the headphone device to actively control the audio player on the terminal device to stop playback. This can improve the accuracy of the headphone device in controlling the playback status of the audio player, meet different user needs, and also save the headphone device's power consumption (there is no need to analyze whether to send a stop playback command).

[0046] Step 304: In response to the removal or insertion operation of the headphone device, determine the current first playback state of the audio player of the terminal device based on at least one of the playback status identifier synchronized by the terminal device and the current audio stream transmission state of the terminal device.

[0047] Step 306: If the first playback status is "playing", then send a stop playback command to the terminal device.

[0048] Step 308: If the first playback state is stopped, then no stop playback command is sent to the terminal device.

[0049] The stop playback command is used to instruct the terminal device to control the audio player to stop playing audio data.

[0050] If the audio player on the terminal device is confirmed to be in a playing state, and the headphone device detects a removal or insertion operation, it can respond to the removal or insertion operation and determine whether to send a stop playback command to the terminal device based on at least one of the playback status identifier synchronized by the terminal device and the current audio stream transmission status of the terminal device.

[0051] The target playback state corresponding to the removal and insertion operations can be stopped playback. If the terminal device's current first playback state (i.e., actual playback state) is playing, which is inconsistent with the target playback state, the headphone device needs to send a stop playback command to the terminal device to control the audio player in the terminal device to stop playing audio data. If the terminal device's current first playback state (i.e., actual playback state) is stopped playback, which is consistent with the target playback state, the headphone device does not need to send a stop playback command to the terminal device. Since some terminal devices may control the audio player to switch back and forth between playing and stopped playback based on the playback control commands sent by the headphone device, regardless of whether the headphone device sends a stop playback command or a start playback command, it will switch the current playback state of the audio player. Therefore, in this embodiment, when the terminal device's current first playback state is stopped playback, a stop playback command is not sent to the terminal device, which can avoid these terminal devices switching from stopped playback to playing playback again, which does not meet user expectations.

[0052] In some embodiments, determining the current first playback state of the audio player on the terminal device based on at least one of the playback state identifier synchronized by the terminal device and the current audio stream transmission state of the terminal device may include: If the playback status flag synchronized by the terminal device indicates that the audio player on the terminal device is currently playing, then it is determined that the audio player on the terminal device is currently playing in the first playback state; and / or, If the playback status flag synchronized by the terminal device indicates that the audio player on the terminal device is in a stopped playback state, and the current audio stream transmission state of the terminal device is in either the first or second state, then it is determined that the audio player on the terminal device is in a stopped playback state in the current first playback state; and / or, If the playback status indicator synchronized by the terminal device indicates that the playback status of the audio player on the terminal device is stopped, and the audio stream transmission status of the terminal device is in the third state, then it is determined that the audio player on the terminal device is currently playing in the first playback state.

[0053] In one specific implementation, when the headphone device detects a removal or insertion operation, it can determine whether the playback status identifier synchronized with the terminal device indicates that the audio player of the terminal device is in playback mode. For example, if the playback status identifier is represented by avrcp state, it can determine whether avrcp state is "play". If it is, it indicates that the audio player of the terminal device is in playback mode; if not, it indicates that the audio player of the terminal device is in playback mode.

[0054] If the playback status indicator synchronized by the terminal device indicates that the audio player on the terminal device is playing, then it can be determined that the audio player on the terminal device is currently playing in the first playback state. If the playback status indicator synchronized by the terminal device indicates that the audio player on the terminal device is stopped, then it can be determined whether the current audio stream transmission state of the terminal device is in the first or second state, that is, whether there is currently no audio stream being transmitted or whether the transmitted audio stream is a silent stream. If the current audio stream transmission state of the terminal device is in the first or second state, then it can be determined that the audio player on the terminal device is currently stopped in the first playback state. If the current audio stream transmission state of the terminal device is in the third state, that is, there is currently an audio stream being transmitted, and the transmitted audio stream is not a silent stream, then it can be determined that the audio player on the terminal device is currently playing in the first playback state.

[0055] In scenarios where the headphone device triggers the active control of the audio player on the terminal device to stop playback, if the audio player on the terminal device is actually playing, but the headphone device mistakenly identifies it as stopped and fails to send a stop command, the impact on the user is greater. Therefore, the headphone device can jointly determine whether the audio player on the terminal device is truly stopped based on the playback status indicator synchronized with the terminal device and the current audio stream transmission status of the terminal device, ensuring a more accurate send of the stop command to the terminal device. This allows for flexible configuration of the headphone device's recognition strategy for identifying the actual playback status of the audio player according to the user's actual needs in different scenarios, improving the flexibility and accuracy of the recognition.

[0056] In some embodiments, the method described above may further include: when the first playback state is in playback, setting a resume playback flag to a first flag, the first flag indicating that the headphone device controls the audio player to resume playback when the wearing operation is detected again; and / or, when the first playback state is stopped playback, setting a resume playback flag to a second flag, the second flag indicating that the headphone device does not control the playback state of the audio player when the wearing operation is detected again.

[0057] After detecting a removal or insertion into the case, the headphone device can set a "resume playback" flag based on the current initial playback state. This flag indicates whether the headphone device will actively control the audio player to resume playback the next time a wearing operation is detected. If the initial playback state is "playing," the "resume playback" flag can be set to the first flag, and the headphone device will actively control the audio player to resume playback the next time a wearing operation is detected. If the initial playback state is "stopped," the "resume playback" flag can be set to the second flag, and the headphone device will not actively control the audio player to resume playback the next time a wearing operation is detected. This ensures that if the user removes the headphone device or puts it in the case, and then puts it back in, the audio player's playback state will be consistent with that before the headphone was removed or placed in the case.

[0058] For example, if the terminal device is in the "playing" state when the user removes the headphones, the headphones can set the "restore playback" flag as the first flag. When the user puts the headphones back on, the headphones will control the terminal device's audio player to return to the "playing" state.

[0059] Optionally, the first and second marks mentioned above may consist of one or more of numbers, letters, symbols, etc., with the first mark distinguished from the second mark. For example, the first mark may be "true" and the second mark may be "false", but it is not limited to these.

[0060] Figure 4 This is a flowchart illustrating how, in another embodiment, when the user performs an action such as removing or inserting the headphones, the headphone device actively controls the audio player on the terminal device to stop playing. Figure 4 As shown, the process by which the headphone device actively controls the audio player on the terminal device to stop playing may include: Step 402: The headphone device detects a removal or insertion operation.

[0061] Step 404: The headphone device determines whether the AVRCP state is "play". If it is, proceed to step 406; otherwise, proceed to step 408.

[0062] The avrcp state indicates the playback status of the terminal device synchronized with the headphone device. When the avrcp state is "play", it indicates that the audio player on the terminal device is playing.

[0063] Step 406: Set auto_play_flag=true.

[0064] The auto_play_flag flag indicates the resume playback flag. Setting auto_play_flag=true means that the headphone device will control the audio player to resume playback the next time it detects wearing.

[0065] Step 408: The headphone device determines whether it is muted. If yes, proceed to step 412; otherwise, proceed to step 406.

[0066] The headphone device's determination of whether it is muted may include: the headphone device determining whether there is currently no audio stream being transmitted, or whether the currently transmitted audio stream is a muted stream.

[0067] Step 410: The headphone device sends a pause command to the terminal device. The pause command can be used to instruct the terminal device to control the audio player to stop playing audio data.

[0068] Step 412, set auto_play_flag=false.

[0069] Setting `auto_play_flag=true` means that the headphone device will not control the audio player to resume playback the next time it detects wearing activity.

[0070] In some embodiments, if no wearing operation is detected within a first time period after an operation is performed on the headphone device, the resume playback flag can be set to a second flag.

[0071] When the headphone device detects a removal or insertion operation, a first timer can be started. This first timer can be set to a first time interval. The first timer can begin counting down and determine whether a wearing operation is detected within the time interval. If the headphone device does not detect a wearing operation within the first time interval set by the first timer, it indicates that the user likely does not intend to continue playing audio data. In this case, a second flag can be set to resume playback. The headphone device will then not actively control the audio player on the terminal device to resume playback the next time a wearing operation is detected. The first time interval can be set according to actual needs, such as 30 seconds, 45 seconds, 1 minute, etc., but is not limited to these.

[0072] Optionally, if the user removes or puts one earbud into the case while the other earbud is still worn, the headphone device may not start the first timer or reset the playback resumption flag upon detecting the removal or placement of the earbud. The playback resumption flag can be set based on the current playback state of the audio player. For example, if the user removes the left earbud while the right earbud is still in their ear, and the audio player on the terminal device is currently playing, the headphone device will actively stop the audio player from playing. When the user puts the left earbud back in, the device will actively start the audio player from playing again.

[0073] When the headphone device detects that both earbuds have been removed or placed back in their case, a first timer can be started. Based on this first timer, it can determine whether a wearing operation was detected within a first time period. If no wearing operation was detected within the first time period, the playback resumption flag is set to a second flag. If a wearing operation was detected within the first time period, the playback resumption flag is set according to the current playback state of the audio player. For example, if the user removes both the left and right earbuds simultaneously, the audio player on the terminal device is currently playing, and the headphone device will actively control the audio player to stop playing. If the user puts the headphone device back on within 30 seconds (putting on the left and / or right earbud), the headphone device will actively control the audio player to start playing again. If the user does not put the headphone device back on within 30 seconds, the headphone device will not actively control the audio player to start playing the next time the user puts on the headphone device. This allows for flexible setting of the playback resumption flag according to the user's actual needs, meeting different user requirements for wearing and using the headphone device and improving the user experience.

[0074] It should be noted that in scenarios where the headphone device actively controls the audio player on the terminal device to stop playback, the headphone device can also jointly determine whether the first playback state is playing or stopped based on the playback status identifier and the audio stream transmission status. The headphone device's recognition strategy can be adjusted based on different needs.

[0075] In this embodiment, when the headphone device detects a removal or insertion operation, it can accurately determine whether to send a stop playback command to the terminal device by combining the synchronous playback status identifier of the terminal device and the current audio stream transmission status of the terminal device. This enables more accurate control over the playback status of the audio player on the terminal device and improves control accuracy.

[0076] In some embodiments, when the user performs a wearing operation, the headphone device can actively control the audio player of the terminal device to start playing audio data. For example... Figure 5 As shown, in one embodiment, the above-described method for controlling audio playback may further include the following steps: Step 502: In response to the wearing operation of the headphone device, determine the current first playback state of the audio player of the terminal device based on at least one of the playback status identifier synchronized by the terminal device and the current audio stream transmission state of the terminal device.

[0077] Step 504: If the first playback state is stopped, a start playback command is sent to the terminal device.

[0078] Step 506: If the first playback status is "playing", then do not send a start playback command to the terminal device.

[0079] In some embodiments, before determining that the audio player of the terminal device is in the current first playback state, the headphone device may determine that the resume playback flag is set to the first flag. When the headphone device detects a wearing operation, it may determine whether the resume playback flag is the first flag. If the resume playback flag is the first flag, it indicates that this wearing operation will trigger the active control of the audio player of the terminal device to play. Then, it may further determine whether it is necessary to send a start playback command to the terminal device based on at least one of the playback state identifier synchronized by the terminal device and the current audio stream transmission state of the terminal device.

[0080] The "Start Playback" command can be used to instruct the terminal device to control the audio player to play audio data.

[0081] In some embodiments, determining the current first playback state of the audio player of the terminal device based on at least one of the playback state identifier synchronized by the terminal device and the current audio stream transmission state of the terminal device may include: if the current audio stream transmission state of the terminal device is a first state or a second state, then determining that the audio player of the terminal device is stopped playing in the current first playback state; and / or, if the current audio stream transmission state of the terminal device is a third state, then determining that the audio player of the terminal device is playing in the current first playback state.

[0082] In scenarios where the headphone device triggers active control of the audio player on the terminal device to start playback, if the audio player on the terminal device is actually in a stopped state, but the headphone device mistakenly identifies it as playing and fails to send a start playback command, the impact on the user is greater. Therefore, to further prevent the terminal device from transmitting a non-silent audio stream just as the audio player pauses playback, after determining that the terminal device's current audio stream transmission state is in the third state for a second time period, it can be determined whether the synchronous playback state flag of the terminal device indicates that the terminal device's audio player is playing, or whether the terminal device's audio stream transmission state remains in the third state. The second time period can be set according to actual needs, such as 1 second, 3 seconds, 4 seconds, etc., but is not limited to these.

[0083] If the terminal device's current audio stream transmission state is in the third state, and after the second time period, the terminal device's synchronized playback status indicator indicates that the audio player is playing, or the terminal device's audio stream transmission state remains in the third state, then the terminal device's audio player is determined to be playing in the current first playback state. If, after the second time period, the terminal device's synchronized playback status indicator indicates that the audio player is stopped, or the terminal device's audio stream transmission state is in the first or second state, then the terminal device's audio player is determined to be stopped in the current first playback state. This can reduce the situation where the terminal device's audio player is paused but misidentified as playing, improving the accuracy of recognition and thus improving the accuracy of the headphone device actively controlling the audio player in the terminal device to play.

[0084] In some embodiments, after sending a start playback command to the terminal device, the headphone device can set the resume playback flag to a second flag. This avoids the situation where, if a single earphone is worn during the current wearing operation, a new start playback command needs to be sent to the terminal device upon detecting another wearing operation, thus reducing the power consumption of the headphone device.

[0085] Figure 6 In another embodiment, when the user performs a wearing operation, the headphone device actively controls the audio player of the terminal device to play audio. Figure 4 As shown, the process by which the headphone device actively controls the audio player of the terminal device to play audio may include: Step 602: The headphone device detects a wearing operation.

[0086] Step 604: The headphone device checks if auto_play_flag=true. If it is, proceed to step 606; otherwise, end the process.

[0087] If auto_play_flag=true, it means that the headphone device needs to actively control the audio player to resume playback. If auto_play_flag=false, it means that the headphone device does not need to actively control the audio player to resume playback.

[0088] Step 606: Determine if the device is muted. If yes, proceed to step 610; otherwise, proceed to step 608.

[0089] The headphone device's determination of whether it is muted may include: the headphone device determining whether there is currently no audio stream being transmitted, or whether the currently transmitted audio stream is a muted stream.

[0090] Step 608: After 1 second, determine whether it is not muted or aVRCP state=play. If it is muted or aVRCP state is not play, proceed to step 610. If it is not muted or aVRCP state=play, end the process.

[0091] avrcp state=play indicates that the audio player on the terminal device was in playback state when the terminal device last synchronized playback status flag was displayed.

[0092] Step 610: The headphone device sends a play command to the terminal device. The play command can be used to instruct the terminal device to control the audio player to start playing audio data.

[0093] Step 612, set auto_play_flag=false.

[0094] In this embodiment, when the headphone device detects a wearing operation, it can combine the synchronous playback status identifier of the terminal device and the current audio stream transmission status of the terminal device to accurately determine whether to send a start playback command to the terminal device. This enables more accurate control over the playback status of the audio player on the terminal device, improving control accuracy.

[0095] In some embodiments, since some terminal devices may control the audio player to switch between playing and stopped playback based on playback control commands sent by the headphone device, the current playback state of the audio player will be switched regardless of whether the headphone device sends a stop playback command or a start playback command. Therefore, after the headphone device responds to the first execution operation for the first headphone and sends a playback control command to the terminal device, the method may further include: if a second execution operation for the second headphone is detected within a third time period, and the second execution operation is consistent with the first execution operation, then no response is made to the second execution operation.

[0096] The headphone device may include a first earphone and a second earphone. After the headphone device responds to a first execution operation targeting the first earphone and sends a playback control command to the terminal device, a second timer may be started. The second timer may be set to a third time period, which can be set according to actual needs, such as 1 second, 2 seconds, 3 seconds, 5 seconds, etc., but is not limited to this. The second timer may start counting down. If, during the second timer's countdown, the headphone device detects a second execution operation targeting the second earphone, and this second execution operation is identical to the first execution operation, then it may not respond to the second execution operation. Within the third time period set by the second timer, if the same execution operation is detected, the same playback control command will not be sent to the terminal device repeatedly.

[0097] For example, if a user removes the left earphone, the earphone device sends a stop playback command to the terminal device to stop the audio player from playing. If the user removes the right earphone within one second, the earphone device will not send another stop playback command, preventing the audio player on the terminal device from switching back from a stopped state to a playing state. Similarly, if a user wears the left earphone, the earphone device sends a start playback command to the terminal device to start the audio player. If the user wears the right earphone within one second, the earphone device will not send another start playback command, preventing the audio player on the terminal device from switching back from a playing state to a paused state.

[0098] In this embodiment, based on the fact that the headphone device accurately determines whether to send a playback control command to the terminal device according to at least one of the playback status identifier synchronized with the terminal device and the current audio stream transmission status of the terminal device, a third time period is further set to avoid repeatedly sending the same playback control command to the terminal device when the same execution operation is detected at the same time in a short period of time, which would lead to inaccurate control of the playback status of the audio player, and further improves the accuracy of controlling the playback status of the audio player of the terminal device.

[0099] like Figure 7 As shown, in one embodiment, a method for controlling audio playback is provided, which can be applied to the aforementioned headphone device. This method may include the following steps: Step 710, in response to performing an operation on the headphone device.

[0100] Step 720: Based on at least one of the playback status identifier synchronized by the terminal device and the current audio stream transmission status of the terminal device, determine whether to send a playback control command to the terminal device. If yes, proceed to step 730; otherwise, proceed to step 740.

[0101] Step 730: Send a playback control command to the terminal device. This control command can be used to instruct the terminal device to change the playback state of the audio player.

[0102] Step 740: Do not send playback control commands to the terminal device.

[0103] In some embodiments, the audio stream transmission state includes any one of a first state characterizing no audio stream transmission, a second state characterizing the currently transmitted audio stream as a silent stream, and a third state characterizing the currently transmitted audio stream as a non-silent stream.

[0104] In some embodiments, the operation includes either a removal operation or a placement operation of the headphone device into the headphone case, and the playback control instruction includes a stop playback instruction. Step 720 may include: determining whether the playback status indicator synchronized by the terminal device indicates that the audio player of the terminal device is in playback mode; if yes, then proceed to step 730; if no, then determining whether the current audio stream transmission status of the terminal device is a first state or a second state; if the current audio stream transmission status of the terminal device is a first state or a second state, then proceed to step 730; if the current audio stream transmission status of the terminal device is a third state, then proceed to step 740.

[0105] In some embodiments, the above method further includes: if the playback status identifier synchronized by the terminal device indicates that the audio player of the terminal device is in playback mode, then setting the resume playback flag to a first flag, the first flag being used to indicate that the headphone device controls the audio player to resume playback mode the next time a wearing operation is detected; and / or, If the playback status flag synchronized by the terminal device indicates that the audio player on the terminal device is in a stopped playback state, and the current audio stream transmission state of the terminal device is in either the first state or the second state, then the resume playback flag is set to the second flag. The second flag indicates that the headphone device will not control the playback state of the audio player when it detects wearing operation again; and / or, If the playback status flag synchronized by the terminal device indicates that the audio player on the terminal device is in a stopped playback state, and the current audio stream transmission state of the terminal device is in the third state, then the resume playback flag will be set to the first flag.

[0106] In some embodiments, the operation includes wearing the device, and the playback control instruction includes a start playback instruction. Step 720 may include: determining whether the current audio stream transmission state of the terminal device is a first state or a second state; if the current audio stream transmission state of the terminal device is a first state or a second state, then proceed to step 730; if the current audio stream transmission state of the terminal device is a third state, then proceed to step 740.

[0107] In some embodiments, if the current audio stream transmission state of the terminal device is a third state, then step 740 is executed, including: after determining that the current audio stream transmission state of the terminal device is a third state for a second time period, determining whether the playback state identifier synchronized by the terminal device indicates that the audio player of the terminal device is playing, or determining whether the audio stream transmission state of the terminal device is still a third state; if the playback state identifier synchronized by the terminal device indicates that the audio player of the terminal device is playing, or the audio stream transmission state of the terminal device is still a third state, then step 740 is executed.

[0108] If, after the second time period, the playback status indicator of the terminal device synchronously indicates that the playback status of the audio player of the terminal device is paused, or the audio stream transmission status of the terminal device is not in the third state, then step 730 is executed.

[0109] In some embodiments, before step 720, the method further includes: determining whether the resume playback flag setting is a first flag; if it is a first flag, then performing the above-described step of determining whether the current audio stream transmission state of the terminal device is a first state or a second state.

[0110] In some embodiments, step 710 includes: responding to a first execution operation for the first earphone. After step 730, the method further includes: if a second execution operation for the second earphone is detected during a third time period, and the second execution operation is consistent with the first execution operation, then not responding to the second execution operation.

[0111] It should be noted that the description of the method for controlling audio playback provided in this embodiment can be found in the relevant descriptions in the above embodiments, and will not be repeated here.

[0112] In this embodiment, the headphone device can combine the playback status identifier synchronized with the terminal device and the current audio stream transmission status of the terminal device to determine whether to send a playback control command to the terminal device. This enables more accurate control of the playback status of the audio player on the terminal device and improves control accuracy.

[0113] like Figure 8 As shown, in one embodiment, a device 800 for controlling audio playback is provided, which can be applied to the above-mentioned headphone device. The device 800 for controlling audio playback may include a playback status determination module 810 and a command sending module 820.

[0114] The playback status determination module 810 is used to determine the current first playback status of the audio player of the terminal device in response to the operation performed on the headphone device, based on at least one of the playback status identifier synchronized by the terminal device and the current audio stream transmission status of the terminal device; wherein, the playback status identifier is used to characterize the playback status of the audio player of the terminal device when the playback status identifier is synchronized; the playback status includes playing or stopping playback.

[0115] In some embodiments, the audio stream transmission state includes any one of a first state characterizing no audio stream transmission, a second state characterizing the currently transmitted audio stream as a silent stream, and a third state characterizing the currently transmitted audio stream as a non-silent stream.

[0116] The instruction sending module 820 is used to send a playback control instruction to the terminal device when the first playback state is inconsistent with the target playback state corresponding to the operation. The playback control instruction is used to instruct the terminal device to switch the audio player from the first playback state to the target playback state.

[0117] In this embodiment, the headphone device can combine the playback status identifier of the terminal device at the same frequency with the current audio stream transmission status of the terminal device to determine whether to send a playback control command to the terminal device. This avoids the situation where inaccurate identification of the actual playback status of the audio player in the terminal device leads to erroneous control, and can more accurately control the playback status of the audio player in the terminal device, thereby improving control accuracy.

[0118] In one embodiment, the playback state determination module 810 is further configured to: determine that the audio player of the terminal device is playing in the current first playback state if the playback state identifier synchronized by the terminal device indicates that the audio player of the terminal device is playing; and / or, determine that the audio player of the terminal device is stopped playing in the current first playback state if the playback state identifier synchronized by the terminal device indicates that the audio player of the terminal device is stopped playing, and the current audio stream transmission state of the terminal device is the first state or the second state; and / or, determine that the audio player of the terminal device is playing in the current first playback state if the playback state identifier synchronized by the terminal device indicates that the audio player of the terminal device is stopped playing, and the audio stream transmission state of the terminal device is the third state.

[0119] In one embodiment, the operation includes either removing the headphones or placing them in the headphone case; the target playback state corresponding to the operation is stopped playback. The instruction sending module 820 is further configured to send a stop playback instruction to the terminal device if the first playback state is playing, the stop playback instruction instructing the terminal device to control the audio player to stop playing audio data.

[0120] In one embodiment, the playback state determination module 810 is further configured to determine that the audio player of the terminal device has entered a playing state before responding to the operation performed on the headphone device.

[0121] In one embodiment, the above-described device 800 for controlling audio playback includes, in addition to a playback status determination module 810 and an instruction sending module 820, a flag setting module.

[0122] The flag setting module is used to set the resume playback flag to a first flag when the first playback state is in playback mode, the first flag indicating that the headphone device will control the audio player to resume playback mode the next time a wearing operation is detected; and / or, to set the resume playback flag to a second flag when the first playback state is in stop playback mode, the second flag indicating that the headphone device will not control the playback state of the audio player the next time a wearing operation is detected.

[0123] In one embodiment, the flag setting module is further configured to set the resume playback flag to a second flag if no wearing operation is detected within the first time period.

[0124] In this embodiment, when the headphone device detects a removal or insertion operation, it can accurately determine whether to send a stop playback command to the terminal device by combining the synchronous playback status identifier of the terminal device and the current audio stream transmission status of the terminal device. This enables more accurate control over the playback status of the audio player on the terminal device and improves control accuracy.

[0125] In one embodiment, the operation includes a wearing operation, and the target playback state corresponding to the operation is "playing". The instruction sending module 820 is further configured to send a start playback instruction to the terminal device if the first playback state is "stopped playback". The start playback instruction is used to instruct the terminal device to control the audio player to play audio data.

[0126] In one embodiment, the playback state determination module 810 is further configured to determine that the audio player of the terminal device is stopped playing in the current first playback state if the current audio stream transmission state of the terminal device is a first state or a second state; and / or, to determine that the audio player of the terminal device is playing in the current first playback state if the current audio stream transmission state of the terminal device is a third state.

[0127] In one embodiment, the playback state determination module 810 is further configured to determine that the audio player of the terminal device is currently playing in the first playback state if the current audio stream transmission state of the terminal device is the third state, and after the second time period, the playback state identifier synchronized by the terminal device indicates that the playback state of the audio player of the terminal device is playing or the audio stream transmission state of the terminal device is still the third state.

[0128] In one embodiment, the playback state determination module 810 is further configured to determine that the resume playback flag is set to a first flag before determining that the audio player of the terminal device is in the current first playback state. The flag setting module is further configured to set the resume playback flag to a second flag.

[0129] In this embodiment, when the headphone device detects a wearing operation, it can combine the synchronous playback status identifier of the terminal device and the current audio stream transmission status of the terminal device to accurately determine whether to send a start playback command to the terminal device. This enables more accurate control over the playback status of the audio player on the terminal device, improving control accuracy.

[0130] In one embodiment, the playback state determination module 810 is further configured to respond to the first execution operation for the first earphone, and after sending a playback control command to the terminal device, if a second execution operation for the second earphone is detected within a third time period, and the second execution operation is consistent with the first execution operation, then not to respond to the second execution operation.

[0131] In this embodiment, based on the fact that the headphone device accurately determines whether to send a playback control command to the terminal device according to at least one of the playback status identifier synchronized with the terminal device and the current audio stream transmission status of the terminal device, a third time period is further set to avoid repeatedly sending the same playback control command to the terminal device when the same execution operation is detected at the same time in a short period of time, which would lead to inaccurate control of the playback status of the audio player, and further improves the accuracy of controlling the playback status of the audio player of the terminal device.

[0132] like Figure 9As shown, in one embodiment, another device 900 for controlling audio playback is provided, which can be applied to the above-mentioned headphone device. The device 900 for controlling audio playback may include a judgment module 910 and an instruction sending module 920.

[0133] The judgment module 910 is used to respond to the operation performed on the headphone device and determine whether to send a playback control command to the terminal device based on at least one of the synchronous playback status identifier of the terminal device and the current audio stream transmission status of the terminal device; wherein, the playback status identifier is used to characterize the playback status of the audio player of the terminal device when the synchronous playback status identifier is displayed; the playback status includes playing or stopping playback.

[0134] The instruction sending module 920 is used to send the playback control instruction to the terminal device when the judgment result of the judgment module is yes, the control instruction being used to instruct the terminal device to change the playback state of the audio player; and to not send the playback control instruction to the terminal device when the judgment result of the judgment module is no.

[0135] In one embodiment, the audio stream transmission state includes any one of the following: a first state indicating no audio stream transmission, a second state indicating that the currently transmitted audio stream is a silent stream, and a third state indicating that the currently transmitted audio stream is not a silent stream.

[0136] In one embodiment, the operation includes either removing the headphones or placing them in the headphone case. The determination module 910 is further configured to determine whether the playback status indicator synchronized by the terminal device indicates that the audio player on the terminal device is playing; if so, it sends a playback control command to the terminal device via the instruction sending module 920, which instructs the terminal device to stop playing audio data; if not, it determines whether the current audio stream transmission status of the terminal device is a first or second state; if the current audio stream transmission status of the terminal device is a third state, it sends a playback control command to the terminal device via the instruction sending module 920; if the current audio stream transmission status of the terminal device is a first or second state, the instruction sending module 920 does not send a playback control command to the terminal device.

[0137] In one embodiment, the device 900 for controlling audio playback includes, in addition to the judgment module 910 and the instruction sending module 920, a flag setting module.

[0138] The flag setting module is configured to: if the playback status flag synchronized by the terminal device indicates that the audio player of the terminal device is in playback mode, then set the resume playback flag to a first flag, the first flag indicating that the headphone device will control the audio player to resume playback mode the next time a wearing operation is detected; and / or, if the playback status flag synchronized by the terminal device indicates that the audio player of the terminal device is in playback mode, and the current audio stream transmission state of the terminal device is in a first state or a second state, then set the resume playback flag to a second flag, the second flag indicating that the headphone device will not control the playback state of the audio player the next time a wearing operation is detected.

[0139] In one embodiment, the operation includes wearing the device. The judgment module 910 is further configured to determine whether the current audio stream transmission state of the terminal device is a first state or a second state; if the current audio stream transmission state of the terminal device is a first state or a second state, then the instruction sending module 920 sends a playback control instruction to the terminal device, the playback control instruction being used to instruct the terminal device to control the audio player to play audio data; if the current audio stream transmission state of the terminal device is a third state, then the instruction sending module 920 does not send a playback control instruction to the terminal device.

[0140] In one embodiment, the judging module 910 is further configured to, after determining that the current audio stream transmission state of the terminal device is the third state for a second time period, judge whether the playback state identifier synchronized by the terminal device indicates that the audio player of the terminal device is playing, or judge whether the audio stream transmission state of the terminal device is still the third state; if the playback state identifier synchronized by the terminal device indicates that the audio player of the terminal device is playing, or the audio stream transmission state of the terminal device is still the third state, then the instruction sending module 920 does not send a playback control instruction to the terminal device.

[0141] In one embodiment, the judgment module 910 is further configured to, after determining that the current audio stream transmission state of the terminal device is the third state during the second time period, if the playback state identifier synchronized by the terminal device indicates that the playback state of the audio player of the terminal device is stopped, or the audio stream transmission state of the terminal device is the first state or the second state, then send a playback control instruction to the terminal device through the instruction sending module 920.

[0142] In one embodiment, the determining module 910 is further configured to, after sending a playback control command to the terminal device via the instruction sending module 920 in response to the first execution operation for the first earphone, if a second execution operation for the second earphone is detected within a third time period, and the second execution operation is consistent with the first execution operation, then not respond to the second execution operation.

[0143] In this embodiment, the headphone device can combine the playback status identifier synchronized with the terminal device and the current audio stream transmission status of the terminal device to determine whether to send a playback control command to the terminal device. This enables more accurate control of the playback status of the audio player on the terminal device and improves control accuracy.

[0144] Figure 10 This is a structural block diagram of a headphone device in one embodiment. Figure 10 As shown, the headphone device 1000 may include one or more of the following components: a processor 1010 and a memory 1020 coupled to the processor 1010, wherein the memory 1020 may store one or more computer programs, which may be configured to implement the methods described in the above embodiments when executed by one or more processors 1010.

[0145] The processor 1010 may include one or more processing cores. The processor 1010 connects to various parts within the headphone device 1000 using various interfaces and lines, and performs various functions and processes data of the headphone device 1000 by running or executing instructions, programs, code sets, or instruction sets stored in the memory 1020, and by calling data stored in the memory 1020. Optionally, the processor 1010 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 1010 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 1010 and may be implemented separately using a communication chip.

[0146] The memory 1020 may include random access memory (RAM) or read-only memory (ROM). The memory 1020 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 1020 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch control, sound playback, image playback, etc.), and instructions for implementing the various method embodiments described above. The data storage area may also store data created during use by the headphone device 1000.

[0147] The headphone device 1000 may also include a Bluetooth module, which can be used to provide Bluetooth communication functionality, establish Bluetooth connections with other electronic devices, and perform Bluetooth data transmission. The Bluetooth module may support one or more Bluetooth protocols (such as Classic Bluetooth, BLE, etc.), but is not limited to these, and may change as Bluetooth protocols evolve.

[0148] Understandably, the headphone device 1000 may include more or fewer structural elements than those shown in the above block diagram, such as a power module, physical buttons, sensors, etc., and is not limited herein.

[0149] This application discloses a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the methods described in the above embodiments.

[0150] This application discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program can be executed by a processor to implement the methods described in the above embodiments.

[0151] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, ROM, etc.

[0152] Any references to memory, storage, databases, or other media used herein may include non-volatile and / or volatile memory. Suitable non-volatile memory may include ROM, Programmable ROM (PROM), Erasable PROM (EPROM), Electrically Erasable PROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which is used as an external cache memory. By way of illustration and not limitation, RAM may take many forms, such as Static RAM (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), Rambus DRAM (RDRAM), and Direct Rambus DRAM (DRDRAM).

[0153] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Those skilled in the art should also recognize that the embodiments described in the specification are optional embodiments, and the actions and modules involved are not necessarily essential to this application.

[0154] In the various embodiments of this application, it should be understood that the sequence number of each process does not necessarily imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0155] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they can be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0156] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0157] The foregoing has provided a detailed description of a method, apparatus, headphone device, and storage medium for controlling audio playback, as disclosed in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and its core ideas. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method of controlling audio playback, the method comprising: The method is applied to a headset device, the headset device is in communication connection with a terminal device, the headset device comprises a first headset and a second headset; the method comprises: In response to a first execution operation for the first headset, a play control instruction is sent to the terminal device, the play control instruction is used to instruct the terminal device to switch the audio player to a target play state corresponding to the first execution operation; If a second execution operation for the second headset is detected within a third time period, and the second execution operation is consistent with the first execution operation, the second execution operation is not responded.

2. The method of claim 1, wherein, The not responding to the second execution operation comprises: The same play control instruction is not repeatedly sent to the terminal device.

3. The method of claim 1, wherein, The first execution operation and the second execution operation are a taking-off operation, and the play control instruction is a stop playing instruction; and / or, The first execution operation and the second execution operation are a putting-in operation, and the play control instruction is a stop playing instruction; and / or, The first execution operation and the second execution operation are a wearing operation, and the play control instruction is a start playing instruction.

4. The method of claim 1, wherein, The responding to the first execution operation for the first headset and sending the play control instruction to the terminal device comprises: In response to a first execution operation for the first headset, it is determined that the audio player of the terminal device is in a current first play state; In the case that the first play state is inconsistent with a target play state corresponding to the first execution operation, a play control instruction is sent to the terminal device; The method further comprises: In the case that the first play state is consistent with the target play state corresponding to the first execution operation, no play control instruction is sent to the terminal device.

5. The method of claim 4, wherein, The first execution operation comprises any one of a taking-off operation and a putting-in operation of placing the first headset in a headset box; and the target play state corresponding to the first execution operation is a stop playing; The sending the play control instruction to the terminal device in the case that the first play state is inconsistent with the target play state corresponding to the first execution operation comprises: If the first play state is playing, a stop playing instruction is sent to the terminal device, the stop playing instruction is used to instruct the terminal device to control the audio player to stop playing audio data.

6. The method of claim 5, wherein, The method further comprises: In the case that the taking-off operation or the putting-in operation is detected, a resume playing flag is set according to the first play state, the resume playing flag is used to represent whether the headset device actively controls the audio player of the terminal device to play when a wearing operation is detected next time.

7. The method of claim 6, wherein, The setting the resume playing flag according to the first play state comprises: In the case that the first play state is playing, the resume playing flag is set as a first flag, the first flag is used to represent that the headset device controls the audio player to resume playing when a wearing operation is detected next time; and / or, In a case where the first playing state is a stop playing, the resuming playing flag is set as a second flag, the second flag is used to represent that the earphone device does not control the playing state of the audio player when detecting a wearing operation next time.

8. The method of claim 6, wherein, The method further comprises: In a case where the taking-off operation or the putting-in operation is detected, if a wearing operation is not detected within a first time period, the resuming playing flag is set as a second flag.

9. The method of claim 8, wherein, The setting of the resuming playing flag in a case where the taking-off operation or the putting-in operation is detected, if a wearing operation is not detected within a first time period, comprises: In a case where the first earphone and the second earphone both perform the taking-off operation or the putting-in operation, if a wearing operation is not detected within a first time period, the resuming playing flag is set as a second flag. After the resuming playing flag is set according to the first playing state, the method further comprises: If only the taking-off operation or the putting-in operation of the first earphone is detected, and the second earphone is in a wearing state, the current resuming playing flag is not changed.

10. The method of claim 4, wherein, The first execution operation comprises a wearing operation, and the target playing state corresponding to the first execution operation is playing; In a case where the first playing state is inconsistent with the target playing state corresponding to the first execution operation, the method further comprises: If the first playing state is stop playing, a start playing instruction is sent to the terminal device, the start playing instruction is used to instruct the terminal device to control the audio player to play audio data.

11. The method according to any one of claims 4 to 10, characterized in that, The determining of the current first playing state of the audio player of the terminal device comprises: According to at least one of a playing state identifier synchronized by the terminal device and a current audio stream transmission state of the terminal device, the current first playing state of the audio player of the terminal device is determined; the playing state identifier is used to represent the playing state of the audio player of the terminal device when the terminal device synchronizes the playing state identifier; the playing state comprises playing or stop playing.

12. The method of claim 11, wherein, The audio stream transmission state comprises any one of a first state used to represent no audio stream transmission, a second state used to represent that a current transmitted audio stream is a mute stream, and a third state used to represent that a current transmitted audio stream is not a mute stream.

13. The method of claims 1-4, 10, wherein, The first execution operation comprises a wearing operation, and the target playing state corresponding to the first execution operation is playing; the sending of the playing control instruction to the terminal device comprises: In a case where the resuming playing flag is a first flag, a start playing instruction is sent to the terminal device, the start playing instruction is used to instruct the terminal device to control the audio player to play audio data.

14. The method of claim 13, wherein, After the start playing instruction is sent to the terminal device, the method further comprises: The resuming playing flag is set as a second flag, the second flag is used to represent that the earphone device does not control the playing state of the audio player when detecting a wearing operation next time.

15. An apparatus for controlling audio playback, the apparatus comprising: The application is applied to a headset device, the headset device is in communication connection with a terminal device, the headset device comprises a first headset and a second headset; the device comprises: An instruction sending module is configured to send a play control instruction to the terminal device in response to a first execution operation for the first headset, the play control instruction being configured to instruct the terminal device to switch the audio player to a target play state corresponding to the first execution operation; A play state determination module is configured to, after sending the play control instruction to the terminal device, if a second execution operation for the second headset is detected within a third time period and the second execution operation is consistent with the first execution operation, not respond to the second execution operation.

16. An earphone device, characterized by The application also provides a computer readable storage medium, which comprises a computer program, and the computer program is executed by a processor to implement the method in any one of claims 1 to 14.

17. A computer program product, characterised in that, The application also provides a computer program, which is executed by a processor to implement the method in any one of claims 1 to 14.