Method, electronic device and system for playing audio
By acquiring data from assisting devices, the system intelligently adjusts the audio playback method, resolving issues such as disconnected or unstable playback in multi-screen collaboration scenarios, thereby improving user experience and product usability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2021-10-28
- Publication Date
- 2026-07-31
AI Technical Summary
In multi-screen collaboration mode, when electronic devices play audio, disconnection or instability can cause accidental playback, resulting in cumbersome user operation and a poor user experience.
By acquiring data from assistive devices, the method of playing audio can be determined, including through its own speakers, other devices, or by stopping playback. Based on this data, user needs can be predicted, reducing manual operations.
It enables intelligent adjustment of playback mode based on the scenario, improving user experience, reducing accidental playback, and enhancing product usability.
Smart Images

Figure CN116056050B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, electronic device, and system for playing audio. Background Technology
[0002] Currently, there are various ways to play audio. For example, when using a computer as an audio source, users can play audio directly through the computer's speakers (referred to as external playback), or through headphones, speakers, or other devices directly or indirectly connected to the computer. However, the way electronic devices play audio is still not intelligent enough. For instance, in multi-screen collaboration mode, if a mobile phone and a computer are connected, and the mobile phone and headphones are connected, audio can be played through the headphones when the computer is used as an audio source. However, if the connection between the mobile phone and the computer is lost (e.g., the user takes the mobile phone out of the computer's communication range, or the connection between the mobile phone and the computer is unstable), unless the user manually connects the headphones to the computer or disables the computer's audio playback function, the computer may accidentally play audio externally. This is cumbersome for users, results in a poor user experience, and reduces product usability. Summary of the Invention
[0003] This application discloses a method, electronic device, and system for playing audio, enabling an audio source device to determine the way to play audio based on data obtained from a communicable assisting device. This ensures that the determined way to play audio meets the user's playback needs in the current scenario, making it more intelligent and avoiding poor user experience caused by inappropriate audio playback methods.
[0004] In a first aspect, embodiments of this application provide a method for playing audio, applied to a first device, the first device being used to provide audio for playback, the method comprising: acquiring first data when a first triggering condition is met, the first triggering condition including receiving a first instruction for playing audio, or disconnecting from the device for playing audio, the first data including data acquired by at least one assisting device communicable to the first device; and determining, based on the first data, that the first device plays audio in a first manner among multiple manners, the multiple manners including the following: playing audio through the speaker of the first device, playing audio through a second device, and stopping playing audio.
[0005] In this application, the first device can determine the audio playback method based on first data. The first data includes data obtained by at least one assisting device that can communicate with the first device. The data sources are wide-ranging, and the playback method determined based on the first data can be well applied to the current playback scenario, meet the user's playback needs in the current scenario, avoid poor user experience caused by an unsuitable playback method, and eliminate the need for cumbersome manual operations to adjust the audio playback method. The audio playback method is more intelligent, and the product has high usability.
[0006] In one possible implementation, the second device is a device among the at least one assisting device, or the second device is a device connected to the at least one assisting device.
[0007] In some embodiments, the multiple methods also include playing audio through a device other than the second device, wherein the device other than the second device is a device among the at least one assisting device, or the device other than the second device is a device connected to the at least one assisting device.
[0008] In this application, the device used to play the audio provided by the first device can be an assisting device that provides the first data, or a device that assists in connecting the device. The application scenarios are relatively wide, which improves the usability of the product.
[0009] In one possible implementation, the first data includes at least one of the following: the type of the assisting device, the state of the assisting device, the type of the device connected to the assisting device, and the state of the device connected to the assisting device.
[0010] In some embodiments, the type of the assisting device or the type of device connected to the assisting device includes types distinguished by hardware, such as a tablet computer and a smartphone. In some embodiments, the type of the assisting device or the type of device connected to the assisting device includes types distinguished by software, such as a sound playback device used to play audio provided by an audio source device.
[0011] In some embodiments, the state of the assisting device or the state of the device connected to the assisting device includes whether it is in a connectable state. In some embodiments, the state of the assisting device or the state of the device connected to the assisting device includes whether it is playing audio as a sound playback device, wherein the sound playback device is used to play audio provided by the audio source device.
[0012] In this application, the first data may include information about the assisting device and / or information about the devices connected to the assisting device. The first device can obtain information about the surrounding devices through the first data, and the determined audio playback method is more in line with the user's playback needs in the current playback scenario. The success rate of executing the determined audio playback method is also higher, and the audio playback method is more intelligent.
[0013] In one possible implementation, the first data includes the user's state, which includes whether the user is asleep or active.
[0014] In some embodiments, the user's state is data acquired by the assistive device, which is a wearable device.
[0015] In some embodiments, the user whose status corresponds to the user includes the user using the first device; in other embodiments, the user whose status corresponds to the user includes other users besides the user using the first device.
[0016] In one possible implementation, the second device is a wireless headset, and the first data includes whether the user is in a sleep state or an exercise state, and the first method is to play audio through the second device.
[0017] In this application, the first data may include the user's status. The first device can obtain the current user (the user using the first device) and / or the surrounding users through the first data, and determine the audio playback method to better meet the user's playback needs in the current playback scenario, avoid inappropriate audio playback methods from affecting users in a specific state, and make the audio playback method more intelligent.
[0018] In one possible implementation, the first data includes the current time and / or the location of the first device.
[0019] In some embodiments, the current time and the location of the first device are detected by the first device itself, rather than obtained by the assisting device, to reduce unnecessary data transmission and thus reduce power consumption.
[0020] In one possible implementation, the second device is a smart speaker, and when the current time belongs to a preset leisure period and the location of the first device belongs to a preset home space, the first method is to play audio through the second device; or, the second device is a wireless headset, and when the current time belongs to a preset rest period and the location of the first device belongs to a preset home space, the first method is to play audio through the second device; or, the second device is a wireless headset, and when the location of the first device belongs to a preset outdoor space, the first method is to play audio through the second device.
[0021] In this application, the first data may include the current time and the location of the first device. The first device can predict the current playback scenario based on the first data, and determine a way to play audio that is more in line with the user's playback needs in the current playback scenario, making the way to play audio more intelligent.
[0022] In one possible implementation, the first triggering condition includes receiving the first instruction; when the first triggering condition is met, the first device is not connected to the second device, and the device most recently connected to the second device is a device other than the first device; the first data includes the state of the second device, the state of the second device is a connectable state, and the first method is playing audio through the second device; after determining that the method of the first device playing audio is the first method among multiple methods, the method further includes: establishing a connection with the second device and playing audio through the second device.
[0023] In this application, when the first device determines to play audio through the second device based on the first data, even if the device most recently connected to the second device is not the first device, the first device can still establish a connection with the second device to enable audio playback through the second device, thereby using a more user-friendly audio playback method and ensuring user experience.
[0024] In one possible implementation, the first triggering condition includes disconnecting from the device used to play audio, the first data includes the type of the second device and the state of the second device, the type of the second device is the same as the type of the device used to play audio, the state of the second device is a connectable state, and the first mode is playing audio through the second device; after determining that the mode of playing audio through the first device is the first mode among multiple modes, the method further includes: establishing a connection with the second device and playing audio through the second device.
[0025] In this application, when the first trigger condition is that the connection with the device used to play audio is disconnected, and the first device determines the way to play audio based on the first data, it can preferentially use a second device of the same type as the aforementioned device used to play audio to play audio, thereby reducing the "disconnection feeling", better meeting user needs, and making the way to play audio more intelligent.
[0026] In one possible implementation, acquiring the first data includes: sending a request message to a third device and receiving second data sent by the third device based on the request message, wherein the first data includes the second data, and the third device is one of the at least one assisting device, or the third device is a device that receives the second data sent by the assisting device.
[0027] In this application, the first device can obtain the first data directly from the assisting device or from other devices. The specific acquisition method can be selected according to the actual scenario, with a wide range of application scenarios and high product availability.
[0028] In one possible implementation, the request message includes information indicating the data type of the second data; or, before acquiring the first data, the method further includes: the first device and the third device negotiating to determine the type of the second data.
[0029] In this application, when the first device acquires the first data, it can indicate the required data type in the request message, or it can negotiate the required data type in advance. The specific acquisition method can be selected according to the actual scenario, which has a wide range of applications and high product availability.
[0030] In one possible implementation, acquiring the first data includes: receiving third data sent by a fourth device among the at least one assisting device, and receiving fourth data sent by a fifth device among the at least one assisting device, wherein the first data includes the third data and the fourth data, the fourth device and the fifth device are of different types, and the third data and the fourth data are of different types.
[0031] In this application, different types of assistive devices can provide different types of data, and the data sources are extensive and targeted. The way of playing audio determined based on the first data is more in line with the user's playback needs in the current playback scenario, and the way of playing audio is more intelligent.
[0032] In one possible implementation, determining that the first device plays audio in a first manner among multiple methods based on the first data includes: determining, based on a first preset rule, that when the first data satisfies a first condition, the first device plays audio in the first manner among the multiple methods, wherein the first preset rule is used to indicate the correspondence between the condition satisfied by the first data and the manner in which the first device plays audio; or, determining that the first device plays audio in a first manner among multiple methods based on the first data includes: using the first data as input to a first model to obtain the output of the first model, wherein the output of the first model is the first manner.
[0033] In this application, the first device can determine the way to play audio according to preset rules or through a machine model. The specific determination method can be selected according to the actual scenario, which has a wide range of applications and high product usability.
[0034] In one possible implementation, before acquiring the first data when the first triggering condition is met, the method further includes: when the first user plays audio using the first device, acquiring fifth data and a second method for the first device to play audio, the fifth data including data acquired by the at least one assisting device; determining the first preset rule corresponding to the first user based on the fifth data and the second method, or using the fifth data as input to the first model and the second method as output to the first model to train the first model corresponding to the first user.
[0035] In this application, the first device can learn the user's playback habits when the user plays audio in daily use of the first device. For example, it can determine a first preset rule or train a first model. Based on such preset rules or machine models, it can determine the way to play audio, which is more in line with the user's needs and the way to play audio is more intelligent.
[0036] In one possible implementation, after determining that the first device plays audio in a first manner among multiple methods, the method further includes: executing the first manner; receiving a second user operation for switching the first device's audio playback mode; in response to the second user operation, switching the first device's audio playback mode from the first manner to a third manner; updating the first preset rule based on the first data and the third manner, or updating the first model based on the first data and the third manner.
[0037] In this application, when the determined first method does not meet the user's needs, the first device can update the preset rules or machine model, and determine the way to play audio based on such preset rules or machine model, so as to better meet the user's needs and make the way to play audio more intelligent.
[0038] In some embodiments, different preset rules apply to different users. For example, when a first user uses a first device, the audio playback method is determined based on a first preset rule, while when a second user uses the first device, the audio playback method is determined based on a second preset rule. This method of determining audio playback is more in line with user needs and is more intelligent.
[0039] In some embodiments, different models are used for different users. For example, when a first user uses a first device, the method of playing audio is determined based on a first model, while when a second user uses the first device, the method of playing audio is determined based on a second model. This method of determining audio playback is more in line with user needs and is more intelligent.
[0040] In one possible implementation, the assisting device is a device that is logged into the same account as the first device.
[0041] In this application, the user of the assisting device can be the user of the first device, referred to as the current user. It can be understood that the first data is for the current user, and the way of playing audio determined based on the first data is more in line with the current user's playback needs, and the way of playing audio is more intelligent.
[0042] In one possible implementation, the first method is to stop playing audio. After determining that the first device is playing audio in one of multiple ways, the method further includes: when stopping the playback of audio provided by the first device, displaying a prompt message, the prompt message being used to inform the user that the first device has no device available for playing audio.
[0043] In this application, when the first device determines to stop playing audio, it can display a prompt message to help the user obtain the current audio playback status in a timely manner.
[0044] Secondly, embodiments of this application provide another method for playing audio, applied to an assistive device. The method includes: receiving a request message sent by the first device when a first triggering condition is met, the first triggering condition including receiving a first instruction for playing audio, or disconnecting from the device for playing audio; sending first data to the first device based on the request message, the first data being used by the first device to determine that the mode of playing audio is a first mode among multiple modes, the multiple modes including the following: playing audio through the speaker of the first device, playing audio through a second device, and stopping playing audio.
[0045] In this application, the first device can determine the way of playing audio based on the first data provided by the assisting device. The data used to determine the way of playing audio comes from a wide range of sources, and the determined playback method can be well applied to the current playback scenario, meet the user's playback needs in the current scenario, avoid poor user experience caused by an unsuitable playback method, and eliminate the need for cumbersome manual operation to adjust the way of playing audio. The way of playing audio is more intelligent and the product has high usability.
[0046] In one possible implementation, the second device is a device among the at least one assisting device, or the second device is a device connected to the at least one assisting device.
[0047] In this application, the device used to play the audio provided by the first device can be an assisting device that provides the first data, or a device that assists in connecting the device. The application scenarios are relatively wide, which improves the usability of the product.
[0048] In one possible implementation, the first data includes at least one of the following: the type of the assisting device, the state of the assisting device, the type of the device connected to the assisting device, and the state of the device connected to the assisting device. In some embodiments, the type of the assisting device or the type of the device connected to the assisting device includes types distinguished by hardware, such as a tablet computer and a smartphone. In some embodiments, the type of the assisting device or the type of the device connected to the assisting device includes types distinguished by software, such as a sound playback device used to play audio provided by an audio source device.
[0049] In some embodiments, the state of the assisting device or the state of the device connected to the assisting device includes whether it is in a connectable state. In some embodiments, the state of the assisting device or the state of the device connected to the assisting device includes whether it is playing audio as a sound playback device, wherein the sound playback device is used to play audio provided by the audio source device.
[0050] In this application, the first data may include information about the assisting device and / or information about the devices connected to the assisting device. The first device can obtain information about the surrounding devices through the first data, and the determined audio playback method is more in line with the user's playback needs in the current playback scenario. The success rate of executing the determined audio playback method is also higher, and the audio playback method is more intelligent.
[0051] In one possible implementation, the first data includes the user's state, which includes whether the user is asleep or active.
[0052] In some embodiments, the user's state is data acquired by the assistive device, which is a wearable device.
[0053] In some embodiments, the user whose status corresponds to the user includes the user using the first device; in other embodiments, the user whose status corresponds to the user includes other users besides the user using the first device.
[0054] In one possible implementation, before receiving the request message sent by the first device when the first trigger condition is met, the method further includes: negotiating with the first device to determine a first type; sending the first data to the first device based on the request message includes: sending the first data of the first type to the first device based on the request message.
[0055] In one possible implementation, the request information includes information indicating a second type; sending the first data to the first device based on the request message includes: sending the first data of the second type to the first device based on the request message.
[0056] In this application, the data type of the first data provided by the assisting device can be a data type pre-negotiated with the first device, or it can be a data type indicated in the request message sent by the first device. The specific provision method can be selected according to the actual scenario, with wide application scenarios and high product availability.
[0057] Thirdly, embodiments of this application provide a communication system including a first device and at least one assisting device. The first device is used to provide audio for playback, and the at least one assisting device is a device that the first device can communicate with. The first device is used to acquire first data when a first triggering condition is met. The first triggering condition includes receiving a first instruction for playing audio or disconnecting from the device for playing audio. The first data includes data acquired by the at least one assisting device. The first device is used to determine, based on the first data, that the method of playing audio by the first device is a first method among multiple methods, including: playing audio through the speaker of the first device, playing audio through a second device, and stopping audio playback.
[0058] In this application, the first device can determine the audio playback method based on first data. The first data includes data obtained by at least one assisting device that can communicate with the first device. The data sources are wide-ranging, and the playback method determined based on the first data can be well applied to the current playback scenario, meet the user's playback needs in the current scenario, avoid poor user experience caused by an unsuitable playback method, and eliminate the need for cumbersome manual operations to adjust the audio playback method. The audio playback method is more intelligent, and the product has high usability.
[0059] In one possible implementation, the second device is a device among the at least one assisting device, or the second device is a device connected to the at least one assisting device.
[0060] In some embodiments, the multiple methods also include playing audio through a device other than the second device, wherein the device other than the second device is a device among the at least one assisting device, or the device other than the second device is a device connected to the at least one assisting device.
[0061] In this application, the device used to play the audio provided by the first device can be an assisting device that provides the first data, or a device that assists in connecting the device. The application scenarios are relatively wide, which improves the usability of the product.
[0062] In one possible implementation, the first data includes at least one of the following: the type of the assisting device, the state of the assisting device, the type of the device connected to the assisting device, and the state of the device connected to the assisting device.
[0063] In some embodiments, the type of the assisting device or the type of device connected to the assisting device includes types distinguished by hardware, such as a tablet computer and a smartphone. In some embodiments, the type of the assisting device or the type of device connected to the assisting device includes types distinguished by software, such as a sound playback device used to play audio provided by an audio source device.
[0064] In some embodiments, the state of the assisting device or the state of the device connected to the assisting device includes whether it is in a connectable state. In some embodiments, the state of the assisting device or the state of the device connected to the assisting device includes whether it is playing audio as a sound playback device, wherein the sound playback device is used to play audio provided by the audio source device.
[0065] In this application, the first data may include information about the assisting device and / or information about the devices connected to the assisting device. The first device can obtain information about the surrounding devices through the first data, and the determined audio playback method is more in line with the user's playback needs in the current playback scenario. The success rate of executing the determined audio playback method is also higher, and the audio playback method is more intelligent.
[0066] In one possible implementation, the first data includes the user's state, which includes whether the user is asleep or active.
[0067] In some embodiments, the user's state is data acquired by the assistive device, which is a wearable device.
[0068] In some embodiments, the user whose status corresponds to the user includes the user using the first device; in other embodiments, the user whose status corresponds to the user includes other users besides the user using the first device.
[0069] In one possible implementation, the second device is a wireless headset, and the first data includes whether the user is in a sleep state or an exercise state, and the first method is to play audio through the second device.
[0070] In this application, the first data may include the user's status. The first device can obtain the current user (the user using the first device) and / or the surrounding users through the first data, and determine the audio playback method to better meet the user's playback needs in the current playback scenario, avoid inappropriate audio playback methods from affecting users in a specific state, and make the audio playback method more intelligent.
[0071] In one possible implementation, the first data includes the current time and / or the location of the first device.
[0072] In some embodiments, the current time and the location of the first device are detected by the first device itself, rather than obtained by the assisting device, to reduce unnecessary data transmission and thus reduce power consumption.
[0073] In one possible implementation, the second device is a smart speaker, and when the current time belongs to a preset leisure period and the location of the first device belongs to a preset home space, the first method is to play audio through the second device; or, the second device is a wireless headset, and when the current time belongs to a preset rest period and the location of the first device belongs to a preset home space, the first method is to play audio through the second device; or, the second device is a wireless headset, and when the location of the first device belongs to a preset outdoor space, the first method is to play audio through the second device.
[0074] In this application, the first data may include the current time and the location of the first device. The first device can predict the current playback scenario based on the first data, and determine a way to play audio that is more in line with the user's playback needs in the current playback scenario, making the way to play audio more intelligent.
[0075] In one possible implementation, the first triggering condition includes receiving the first instruction; when the first triggering condition is met, the first device is not connected to the second device, and the device most recently connected to the second device is a device other than the first device; the first data includes the state of the second device, the state of the second device is a connectable state, and the first method is playing audio through the second device; the first device is further configured to establish a connection with the second device and play audio through the second device after determining that the method of playing audio on the first device is the first method among multiple methods.
[0076] In this application, when the first device determines to play audio through the second device based on the first data, even if the device most recently connected to the second device is not the first device, the first device can still establish a connection with the second device to enable audio playback through the second device, thereby using a more user-friendly audio playback method and ensuring user experience.
[0077] In one possible implementation, the first triggering condition includes disconnecting from the device used to play audio, the first data includes the type of the second device and the state of the second device, the type of the second device is the same as the type of the device used to play audio, the state of the second device is a connectable state, and the first mode is playing audio through the second device; the first device is further configured to establish a connection with the second device and play audio through the second device after determining that the mode of playing audio on the first device is the first mode among multiple modes.
[0078] In this application, when the first trigger condition is that the connection with the device used to play audio is disconnected, and the first device determines the way to play audio based on the first data, it can preferentially use a second device of the same type as the aforementioned device used to play audio to play audio, thereby reducing the "disconnection feeling", better meeting user needs, and making the way to play audio more intelligent.
[0079] In one possible implementation, acquiring the first data includes: sending a request message to a third device and receiving second data sent by the third device based on the request message, wherein the first data includes the second data, and the third device is one of the at least one assisting device, or the third device is a device that receives the second data sent by the assisting device.
[0080] In this application, the first device can obtain the first data directly from the assisting device or from other devices. The specific acquisition method can be selected according to the actual scenario, with a wide range of application scenarios and high product availability.
[0081] In one possible implementation, the request message includes information indicating the data type of the second data; or, the first device is further configured to negotiate with the third device to determine the data type of the second data before acquiring the first data.
[0082] In this application, when the first device acquires the first data, it can indicate the required data type in the request message, or it can negotiate the required data type in advance. The specific acquisition method can be selected according to the actual scenario, which has a wide range of applications and high product availability.
[0083] In one possible implementation, acquiring the first data includes: receiving third data sent by a fourth device among the at least one assisting device, and receiving fourth data sent by a fifth device among the at least one assisting device, wherein the first data includes the third data and the fourth data, the fourth device and the fifth device are of different types, and the third data and the fourth data are of different types.
[0084] In this application, different types of assistive devices can provide different types of data, and the data sources are extensive and targeted. The way of playing audio determined based on the first data is more in line with the user's playback needs in the current playback scenario, and the way of playing audio is more intelligent.
[0085] In one possible implementation, determining that the first device plays audio in a first manner among multiple methods based on the first data includes: determining, based on a first preset rule, that when the first data satisfies a first condition, the first device plays audio in the first manner among the multiple methods, wherein the first preset rule is used to indicate the correspondence between the condition satisfied by the first data and the manner in which the first device plays audio; or, determining that the first device plays audio in a first manner among multiple methods based on the first data includes: using the first data as input to a first model to obtain the output of the first model, wherein the output of the first model is the first manner.
[0086] In this application, the first device can determine the way to play audio according to preset rules or through a machine model. The specific determination method can be selected according to the actual scenario, which has a wide range of applications and high product usability.
[0087] In one possible implementation, the first device is further configured to acquire fifth data and a second method for the first device to play audio when the first user plays audio using the first device before acquiring the first data when the first trigger condition is met, wherein the fifth data includes data acquired by the at least one assisting device; determine the first preset rule corresponding to the first user based on the fifth data and the second method, or train the first model corresponding to the first user by using the fifth data as input to the first model and the second method as output to the first model.
[0088] In this application, the first device can learn the user's playback habits when the user plays audio in daily use of the first device. For example, it can determine a first preset rule or train a first model. Based on such preset rules or machine models, it can determine the way to play audio, which is more in line with the user's needs and the way to play audio is more intelligent.
[0089] In one possible implementation, the first device is further configured to: execute the first mode after determining that the first device plays audio in a first mode among multiple modes; receive a second user operation for switching the first device's audio playback mode; in response to the second user operation, switch the first device's audio playback mode from the first mode to a third mode; update the first preset rule based on the first data and the third mode, or update the first model based on the first data and the third mode.
[0090] In this application, when the determined first method does not meet the user's needs, the first device can update the preset rules or machine model, and determine the way to play audio based on such preset rules or machine model, so as to better meet the user's needs and make the way to play audio more intelligent.
[0091] In some embodiments, different preset rules apply to different users. For example, when a first user uses a first device, the audio playback method is determined based on a first preset rule, while when a second user uses the first device, the audio playback method is determined based on a second preset rule. This method of determining audio playback is more in line with user needs and is more intelligent.
[0092] In some embodiments, different models are used for different users. For example, when a first user uses a first device, the method of playing audio is determined based on a first model, while when a second user uses the first device, the method of playing audio is determined based on a second model. This method of determining audio playback is more in line with user needs and is more intelligent.
[0093] In one possible implementation, the assisting device is a device that is logged into the same account as the first device.
[0094] In this application, the user of the assisting device can be the user of the first device, referred to as the current user. It can be understood that the first data is for the current user, and the way of playing audio determined based on the first data is more in line with the current user's playback needs, and the way of playing audio is more intelligent.
[0095] Fourthly, embodiments of this application provide an electronic device, including a transceiver, a processor, and a memory; the memory is used to store computer program code, the computer program code including computer instructions, and the processor calls the computer instructions to cause the user device to execute the method for playing audio provided by the first and second aspects of the embodiments of this application, as well as any implementation of the first and second aspects.
[0096] Fifthly, embodiments of this application provide a computer storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, are used to perform the method for playing audio provided by the first and second aspects of embodiments of this application, as well as any implementation of the first and second aspects.
[0097] Sixthly, embodiments of this application provide a computer program product that, when run on a communication device, causes the communication device to execute the method for playing audio provided by the first and second aspects of the embodiments of this application, as well as any implementation of the first and second aspects.
[0098] In a seventh aspect, embodiments of this application provide an electronic device that includes the methods or apparatus described in any embodiment of this application. The electronic device is, for example, a chip.
[0099] It should be understood that the descriptions of technical features, technical solutions, beneficial effects, or similar language in this application do not imply that all features and advantages can be achieved in any single embodiment. Rather, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution, or beneficial effect is included in at least one embodiment. Therefore, the descriptions of technical features, technical solutions, or beneficial effects in this specification do not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions, and beneficial effects described in this embodiment can be combined in any suitable manner. Those skilled in the art will understand that embodiments can be implemented without one or more specific technical features, technical solutions, or beneficial effects of a particular embodiment. In other embodiments, additional technical features and beneficial effects may be identified in specific embodiments that do not embody all embodiments. Attached Figure Description
[0100] The accompanying drawings used in the embodiments of this application are described below.
[0101] Figure 1 This is a schematic diagram of the architecture of a communication system provided in an embodiment of this application;
[0102] Figure 2A This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;
[0103] Figure 2B This is a schematic diagram of the software architecture of an electronic device provided in an embodiment of this application;
[0104] Figures 3A-3C These are schematic diagrams illustrating some application scenarios provided in the embodiments of this application;
[0105] Figures 4-5This is a flowchart illustrating some methods for playing audio provided in embodiments of this application;
[0106] Figure 6A This is a schematic diagram of a training machine model provided in an embodiment of this application;
[0107] Figure 6B This is a schematic diagram illustrating the use of a machine model according to an embodiment of this application;
[0108] Figure 7 This is a schematic diagram of the structure of a main device provided in an embodiment of this application;
[0109] Figure 8 This is a schematic diagram of a user interface embodiment provided in this application. Detailed Implementation
[0110] The technical solutions in the embodiments of this application will be clearly and thoroughly described below with reference to the accompanying drawings. The terminology used in the implementation section of the embodiments of this application is only used to explain the specific embodiments of this application and is not intended to limit this application.
[0111] Please see Figure 1 , Figure 1 This is a schematic diagram of the architecture of a communication system provided in an embodiment of this application.
[0112] like Figure 1 As shown, electronic device 100 can be connected to at least one electronic device 200 via wired and / or wireless means. Wired means include, for example, high definition multimedia interface (HDMI), universal serial bus (USB), coaxial cable, fiber optic, etc., while wireless means include, for example, Bluetooth, wireless fidelity (Wi-Fi), near field communication (NFC), ultra-wideband (UWB), etc.
[0113] In some embodiments, electronic device 100 can be directly connected to at least one electronic device 200 and communicate with it, for example, such as Figure 1 As shown, the electronic device 100 is a smartphone. The electronic device 100 connects to wireless headphones 201, smartwatches 203, etc. via Bluetooth, and connects to smart speakers 202 and gateway devices (such as routers) 204 via Wi-Fi. The electronic device 200 may include the aforementioned wireless headphones 201, smart speakers 202, smartwatches 203 and gateway devices 204.
[0114] In some embodiments, electronic device 100 may be indirectly connected to at least one electronic device 200. Optionally, electronic device 100 may be connected and communicate with at least one electronic device 200 through a connected device, for example, such as... Figure 1 As shown, electronic device 100 is a smartphone. Electronic device 100 can communicate with tablet computer 205, desktop computer 206, etc., through a connected gateway device 204. Electronic device 200 may include the aforementioned tablet computer 205 and desktop computer 206. Electronic device 100 can communicate with smartphone 207, laptop computer 208, etc., through the cloud. The cloud may include at least one server, which can be a hardware server or a virtual server. Electronic device 200 may include the aforementioned smartphone 207 and laptop computer 208.
[0115] This application does not limit the method of communication via the cloud. For example, if both electronic device 100 and laptop 208 have application A installed and log in to the same account or associated account through application A, electronic device 100 can communicate with laptop 208 through the cloud (e.g., including an application server that provides services for application A). It is not limited to this; it is also possible to log in to the account through other means such as a mini-program without installing the application, or even without logging in to an account at all.
[0116] In some embodiments, although electronic device 100 is not connected to electronic device 200, it can establish a connection with electronic device 200 and then communicate. This can be understood as electronic device 200 being an electronic device that is not connected to electronic device 100 but can communicate with it. Optionally, electronic device 100 can store connection information of at least one electronic device 200 (e.g., Bluetooth address and password, Wi-Fi name and password, etc.) and connect to at least one electronic device 200 through the connection information (e.g., sending information including the password to electronic device 300 corresponding to the Bluetooth address to request the establishment of a connection). Optionally, the connection information of electronic device 200 can be obtained when electronic device 100 previously connected to electronic device 200. Optionally, the connection information of electronic device 200 can be obtained by electronic device 100 through the cloud. For example, after electronic device 100 logs in to account A, it can obtain the connection information of electronic device 200 that has previously logged in to account A. This application does not limit the way electronic device 100 obtains the connection information of electronic device 200.
[0117] Figure 1The electronic devices shown are merely examples, and the specific form of the devices is not limited. Any electronic device involved in the embodiments of this application can be a user terminal device such as a mobile phone, tablet computer, handheld computer, personal digital assistant (PDA), smart home device such as smart TV and smart camera, wearable device such as smart bracelet, smart watch, and smart glasses, or other devices such as desktop computer, laptop computer, ultra-mobile personal computer (UMPC), netbook, and smart screen.
[0118] The following describes an exemplary electronic device of this application, to... Figure 1 The following explanation uses electronic device 100 as an example. The explanation of electronic device 200 is similar and will not be repeated.
[0119] Please see Figure 2A , Figure 2A This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application.
[0120] like Figure 2A As shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0121] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0122] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0123] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0124] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0125] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0126] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, USB Type-C port, etc. USB port 130 can be used to connect a charger to charge electronic device 100, and can also be used for data transfer between electronic device 100 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.
[0127] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0128] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0129] In some embodiments, when the electronic device 100 is connected to a device for playing audio (hereinafter referred to as a sound playback device), the audio provided by the electronic device 100 can be played through the sound playback device, and the electronic device 100 can be referred to as an audio source device. For example, when the electronic device 100 is connected to wireless headphones (such as Bluetooth headphones) via wireless communication, the user can listen to the music provided by the electronic device 100 by wearing the wireless headphones. As another example, when the electronic device 100 is connected to a smart speaker via wireless communication, the music provided by the electronic device 100 can be played through the smart speaker.
[0130] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.
[0131] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0132] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.
[0133] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0134] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).
[0135] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0136] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.
[0137] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0138] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0139] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.
[0140] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0141] Internal memory 121 can be used to store computer executable program code, which includes instructions. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional applications and data processing of electronic device 100 by running instructions stored in internal memory 121 and / or instructions stored in memory located in the processor.
[0142] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0143] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.
[0144] The speaker 170A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. Users can listen to music or make hands-free calls through the speaker 170A of the electronic device 100. In this case, both the audio playback device and the audio source device can be the electronic device 100.
[0145] The receiver 170B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When a user answers a telephone call or voice message through the receiver 170B of the electronic device 100, they can listen to the voice by bringing the receiver 170B close to their ear. At this time, the sound playback device and the sound source device used to play the audio can both be the electronic device 100.
[0146] Microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 170C, inputting the sound signal into microphone 170C. Electronic device 100 may have at least one microphone 170C. In some embodiments, electronic device 100 may have two microphones 170C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, electronic device 100 may also have three, four, or more microphones 170C, which can collect sound signals, reduce noise, identify the sound source, and perform directional recording, etc.
[0147] The headphone jack 170D is used to connect wired headphones. The headphone jack 170D can be a USB 130 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, or a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface. When a wired headphone is connected to the headphone jack 170D, the user can listen to the audio from electronic device 100 by wearing the wired headphones.
[0148] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be disposed on display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the intensity of the touch operation based on pressure sensor 180A. Electronic device 100 can also calculate the touch position based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example, when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS is executed.
[0149] Touch sensor 180K, also known as a "touch device," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touchscreen." Touch sensor 180K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of electronic device 100, in a different position than display screen 194.
[0150] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. For example, a layered architecture software system can be the Android system or the Huawei Mobile Services (HMS) system. This application embodiment uses the layered architecture Android system as an example to illustrate the software structure of the terminal.
[0151] Figure 2B This is a schematic diagram of the software architecture of an electronic device 100 provided in an embodiment of this application.
[0152] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0153] The application layer can include a series of application packages.
[0154] like Figure 2B As shown, the application package may include applications such as camera, calendar, map, WLAN, music, SMS, gallery, call, navigation, Bluetooth, and video.
[0155] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0156] like Figure 2B As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
[0157] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.
[0158] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.
[0159] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0160] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including connection and disconnection).
[0161] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0162] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.
[0163] The Android Runtime consists of core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
[0164] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.
[0165] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0166] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0167] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0168] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0169] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0170] A 2D graphics engine is a graphics engine for 2D drawing.
[0171] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
[0172] The following example, using a music playback scenario, illustrates the workflow of the software and hardware of electronic device 100.
[0173] Assume electronic device 100 is connected to wireless headphones via wireless communication. When touch sensor 180K receives a touch operation, a corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, touch operation timestamp, etc.). The raw input event is stored in the kernel layer. The application framework layer retrieves the raw input event from the kernel layer and identifies the control corresponding to the input event. Assume the touch operation is a single click, and the control corresponding to this single click is a control used to play music in a music application. The music application can call the interface of the application framework layer, and then call the audio driver of the kernel layer to control the wireless headphones to play music. Here, electronic device 100 acts as the audio source, providing audio data, and the wireless headphones act as the sound playback device, playing the audio provided by the audio source.
[0174] Currently, there are various ways to play audio. For example, when electronic device 100 provides audio as a sound source, it can play audio through a connected sound playback device (such as a wireless headset or smart speaker connected via wireless communication module 160), through speaker 170A (referred to as external playback), or through receiver 180B (referred to as earpiece playback), and so on. However, the ways to play audio are still not intelligent enough to meet user needs, resulting in low product usability. Specific examples are shown below:
[0175] For example, wireless headphones automatically connect to the last connected device by default. If the connection fails, no operation is performed. When a user uses a smartphone as the audio source to play audio, if the smartphone is not the device that the wireless headphones were last connected to, the smartphone may accidentally play audio out of the speaker unless the user manually connects the wireless headphones and the smartphone or first turns off the audio playback function of the smartphone. To achieve the desired audio playback method, the user needs to perform relatively cumbersome operations, resulting in a poor user experience.
[0176] For example, in multi-screen collaboration mode, a smartphone and a computer are connected, and the smartphone and wireless headphones are connected. When the computer is the audio source, audio can be played through the wireless headphones. However, if the connection between the smartphone and the computer is lost, unless the user manually connects the wireless headphones to the computer or first disables the computer's audio playback function, the computer may accidentally play audio out of the speakers. Achieving the desired audio playback method requires relatively cumbersome user operations, resulting in a poor user experience. Alternatively, the user may need to maintain the connection between the smartphone and the computer, for example, they may not be able to take the phone out of the computer's communication range, thus limiting the usage scenarios.
[0177] This application provides a method for playing audio, which allows a master device to intelligently adjust the audio playback mode based on data from slave devices (referred to as linkage data). The master device acts as the audio source, providing audio data to execute the adjusted audio playback mode. Slave devices are at least one device that can communicate with the master device. The type and number of slave devices are not limited, nor are the type and quantity of linkage data. Therefore, this method has universal applicability, fully leveraging the advantages of the Internet of Things in all scenarios to adjust the audio playback mode. This effectively avoids poor user experience caused by inappropriate audio playback modes, resulting in high product usability.
[0178] For example, in Figure 1In the system shown, electronic device 100 can act as a sound source to provide audio data (electronic device 100 is the aforementioned master device). Electronic device 100 can acquire not only its own data but also data from at least one communicable electronic device 200 (electronic device 200 is the aforementioned slave device, and the acquired data from electronic device 200 is the aforementioned linkage data). Electronic device 100 can combine its own data and linkage data to determine the audio playback method and execute the determined audio playback method.
[0179] For ease of explanation, the data acquired by any electronic device can be called status data. When the electronic device is the master device, the status data of the communicating electronic devices is the aforementioned linkage data. It can be understood that status data and linkage data are relative concepts. For example, the linkage data for electronic device 100 is the status data for electronic device 200.
[0180] This application does not limit the types of status data and linkage data, such as but not limited to current time, current location, whether connected to the network, the status of the device itself, the type of the device itself, information of connected devices (such as the status of connected devices, the type of connected devices), and user status information such as whether the user is in a sleep state or an active state.
[0181] In some embodiments, the state of a device may include whether it is in a connectable state, such as when a signal can be found. In some embodiments, the state of a device may include whether it is playing audio as a sound playback device.
[0182] In some embodiments, the device type may include a type distinguished by hardware, such as tablets and smartphones being two different device types. In some embodiments, the device type may include a type distinguished by software, such as whether it is a sound playback device, so that the main device does not need to determine the sound playback device that can be used to play audio, thus reducing the processing load on the main device.
[0183] This application does not limit the method by which the electronic device obtains its own status data. For example, electronic device 100 can directly determine the current time based on the system time; electronic device 100 can obtain its current location via GPS; electronic device 100 can obtain information such as whether it is connected to other devices and the number of connected devices through mobile communication module 150 and / or wireless communication module 160; electronic device 100 can capture images of the surrounding environment and the user through camera 193; electronic device 100 can obtain its attitude information based on signals detected by gyroscope sensor 180B and accelerometer sensor 180E; electronic device 100 can directly obtain information about connected devices from stored data, such as the identifier and address of electronic device 200 when connected. Examples of how electronic device 200 obtains its own status data are similar and will not be repeated here.
[0184] This application does not limit the method by which electronic devices obtain linkage data. For example, electronic device 100 can directly obtain the status data of electronic device 200 from stored data, such as the identifier and address of electronic device 200 when connected to it. Alternatively, electronic device 100 can directly receive status data from electronic device 200, for example, by sending request information to electronic device 200 through mobile communication module 150 and / or wireless communication module 160, and receiving linkage data sent by electronic device 200 based on the request information. Another example is that electronic device 100 can indirectly receive status data from electronic device 200, that is, receive status data from other devices. For instance, when electronic device 200 logs into account B, it can send its own status data to the cloud, and subsequently, electronic device 100 can obtain the status data of electronic device 200 from the cloud through account B.
[0185] The following are exemplary application scenarios related to the embodiments of this application.
[0186] Please see Figure 3A , Figure 3A An illustrative diagram of an application scenario is shown.
[0187] like Figure 3AAs shown, when the wireless earbuds and mobile phone A are connected, the user can wear the wireless earbuds to listen to audio provided by mobile phone A as the audio source. Mobile phone A can display the user interface 310 of the music application. The user interface 310 indicates that "Song A" is currently being played, that is, the wireless earbuds are playing the audio of "Song A" provided by mobile phone A as the audio source. After the wireless earbuds and mobile phone A are disconnected, before connecting to other devices, mobile phone A is the last connected device for the wireless earbuds (also known as the most recently connected device). After the wireless earbuds are turned on (for example, after the user takes the wireless earbuds out of the charging case), they will actively try to connect to the last connected device. If the connection fails (for example, mobile phone A is not within the communication range of the wireless earbuds, or mobile phone A does not have Bluetooth enabled), the wireless earbuds will be in a detached state. In the detached state, the Bluetooth function of the wireless earbuds remains on, but they will not actively connect to other devices. Devices within the communication range of the wireless earbuds can search for the wireless earbuds via Bluetooth, and the wireless earbuds can receive connection requests sent by other devices. Not limited to this, in other embodiments, if the wireless earphone has not been connected to any device, such as when it is first started after leaving the factory, the wireless earphone may also be in a free state. This application does not limit the preconditions for the wireless earphone to be in a free state.
[0188] like Figure 3A As shown, mobile phone B displays the user interface 320 of a music application. The user interface 320 is used to display playlist information, such as the playlist name 321: "Playlist 1", and the song list 322 included in the playlist, which may include, for example, multiple songs such as song 1, song 2, song 3, and song 4. The user interface 320 may also include a playback control 323, which is used to play the songs in the playlist.
[0189] In some embodiments, when the wireless earphones are in a detached state, mobile phone B can receive user operations for playing audio. For example, mobile phone B can receive touch operations (such as click operations) applied to a control on any song in song list 322, and in response to the touch operation, play the audio of the song corresponding to the control. Alternatively, mobile phone B can receive touch operations (such as click operations) applied to playback control 323, and in response to the touch operation, play the audio of songs in "Playlist 1," for example, playing the songs in "Playlist 1" sequentially.
[0190] In some embodiments, mobile phone B may, in response to a user operation for playing audio, detect at least one communicable device and send a request message to the detected device. The device receiving the request message may send linkage data to mobile phone B based on the request message. For example, when mobile phone B finds a wireless headset via Bluetooth, it may send a request message to the wireless headset, and the wireless headset may send linkage data to mobile phone B based on the request message.
[0191] In some embodiments, mobile phone B can determine the audio playback method based on linkage data. Optionally, mobile phone B can obtain its own status data and combine the status data and linkage data to determine the audio playback method. For example, mobile phone B can obtain its location (which is part of its status data) via GPS or other means and determine that the location is outdoors. The linkage data may include the wireless headphones not currently playing audio. Mobile phone B can determine that the wireless headphones are currently idle and can be used to play audio based on the linkage data. Mobile phone B can determine the audio playback method as playing through wireless headphones based on self-learned user habits (assuming users are accustomed to using wireless headphones to play audio outdoors and to using speakers in a home environment), combined with its status data and linkage data. Therefore, mobile phone B can send a connection request to the wireless headphones to establish a connection. For example, mobile phone B can obtain the Bluetooth address of the wireless headphones from its memory and send a connection request to the device corresponding to that Bluetooth address. After establishing a connection between mobile phone B and the wireless headphones, mobile phone B can instruct the wireless headphones to play audio. At this time, the user can wear the wireless headphones to listen to the audio provided by mobile phone B as the audio source.
[0192] Not limited to the examples above, in other examples, when mobile phone B receives a user operation to play audio, the wireless headset can be in a connected state (e.g., still connected to mobile phone A). Assuming the wireless headset's connection method is preemptive, meaning it can receive connection requests from other devices while connected, and can cancel its current connection and connect to other devices upon accepting a connection request. When mobile phone B obtains linkage data indicating that the wireless headset's status is connectable (e.g., it can find Bluetooth signals), mobile phone B determines that playing audio via the wireless headset is possible. Mobile phone B can directly send a connection request to the wireless headset. Upon accepting the request, the wireless headset can cancel its connection with mobile phone A and connect to mobile phone B, allowing mobile phone B to play audio through the wireless headset. The linkage data may also include, for example, whether the connection method is preemptive.
[0193] Not limited to the above examples, in other examples, when mobile phone B receives a user operation for playing audio, the wireless headphones can be in a connected state (e.g., still connected to mobile phone A). The linkage data of mobile phone B can include data obtained by mobile phone A, such as the device type of mobile phone A, the device type of the wireless headphones connected to mobile phone A, the status of the wireless headphones connected to mobile phone A, etc. In other words, the status data of the wireless headphones can be sent from mobile phone A to mobile phone B.
[0194] Not limited to the above examples, in other examples, the linkage data may include the wireless headphones currently playing audio (e.g., connected to other audio source devices). Assuming the wireless headphones are not preemptive in their connection method, if mobile phone B has other communicable wireless headphones, it can be determined that the playback method is to play audio through other communicable wireless headphones. If other communicable wireless headphones are already connected, the other communicable wireless headphones can be directly instructed to play audio; if they are not connected, they should be connected first and then instructed to play audio.
[0195] Not limited to the examples above, in other examples, the linkage data may include the wireless headphones currently playing audio (e.g., connected to other audio source devices). Assuming the wireless headphones' connection method is not preemptive, phone B can determine that the user's usual playback method (playing with wireless headphones) cannot be executed in the current scenario. Therefore, it can determine that the audio playback method should be stopped and display a prompt message. Specific examples are as follows: Figure 3B As shown, mobile phone B can display the user interface 330 of a music application, and user interface 330 and Figure 3A The user interface 320 shown is similar, except that it also includes a prompt message 331. The prompt message 331 may include the text: "No available device to play audio". It can be used to prompt the user that the current mobile phone B cannot connect to a sound playback device such as wireless headphones to play audio. The user can choose the method of playing audio by combining the prompt message, such as manually starting and connecting other wireless headphones to avoid accidental playback.
[0196] In some embodiments, the linkage data may include the device's connection method, such as whether it is preemptive. The master device can determine the audio playback method based on the device's connection method. For example, as described in other examples above, the processing logic of mobile phone B in determining the audio playback method differs depending on whether the wireless headphones are preemptive or not.
[0197] Not limited to the above examples, mobile phone B can also obtain data from other devices besides wireless headphones. For example, if the user is also wearing a smartwatch, the linked data of mobile phone B can include data from the smartwatch to determine how to play audio.
[0198] Understandably, after receiving a user's command to play audio, phone B will not directly play the audio aloud. Instead, it will combine phone B's status data, linkage data, and self-learned user habits to determine the way to play the audio. Users do not need to manually connect a specific audio playback device (such as the wireless headphones mentioned above) to phone B, reducing unnecessary user operations and preventing accidental playback, thus improving the user experience.
[0199] Please see Figure 3C , Figure 3C An illustrative diagram of yet another application scenario is shown.
[0200] like Figure 3C As shown, mobile phone A and desktop computer A can connect and achieve multi-screen collaboration. Mobile phone A can display the user interface 340 for SMS messages. The screen of mobile phone A can be projected onto the screen of desktop computer A. Desktop computer A can display the user interface 350. The user interface 350 can include a music window 351 and a projection window 352. The music window 351 indicates that "song A" is currently playing. The projection window 352 can be used to display the screen of the multi-screen collaboration device (i.e., mobile phone A), which is the user interface 340 of mobile phone A. Furthermore, mobile phone A can connect to wireless headphones. Users can wear wireless headphones (sound playback device) to listen to audio (the audio of "song A") provided by desktop computer A connected to mobile phone A as the audio source. For example, the audio played by the wireless headphones is sent to the wireless headphones by desktop computer A through mobile phone A. When the connection between mobile phone A and desktop computer A is lost, for example, when another user borrows mobile phone A and leaves the current room, mobile phone A is no longer within the communication range of desktop computer A, or the connection between desktop computer A and mobile phone A is unstable and causes the connection to be lost, the wireless headphones cannot obtain the audio provided by desktop computer A as the audio source through mobile phone A, and therefore the audio playback is canceled.
[0201] In some embodiments, when desktop computer A detects a disconnection from mobile phone A, which can also be understood as detecting a (direct or indirect) disconnection of the connected audio playback device (i.e., wireless headphones), it can detect at least one communicable device and send a request message to the detected device. The device receiving the request message can then send linkage data to desktop computer A based on the request message. For example, desktop computer A can send request messages to detected mobile phone A, wireless headphones, smartwatches, tablets, and smart speakers, and these devices can send linkage data to desktop computer A based on the received request messages.
[0202] In some embodiments, desktop computer A can determine the audio playback method based on linkage data. Optionally, desktop computer A can obtain its own status data and combine the status data and linkage data to determine the audio playback method. For example, linkage data may include the wireless headphones not currently playing audio, the user wearing the smartwatch being in sleep mode, the location of the tablet computer and the current absence of external audio playback, and the location of the smart speaker and the current absence of external audio playback. The communication method between desktop computer A and the wireless headphones, smartwatch, and smart speaker is a near-field communication method such as Bluetooth, NFC, or infrared. Therefore, desktop computer A can determine that desktop computer A, wireless headphones, smartwatch, and smart speaker are all in the same space. Desktop computer A can determine that the aforementioned space is a home space based on the location of the smart speaker in the linkage data. The communication method between desktop computer A and tablet computer can be implemented through the cloud, Wi-Fi, etc. Desktop computer A can determine that tablet computer is also in a home space based on the location of tablet computer in the linkage data. Furthermore, desktop computer A can obtain the current time as "22:30" (status data belonging to desktop computer A). Desktop computer A can learn user habits (assuming a home environment where users sleep at night and there are no external audio players or smart speakers, in which case users typically use wireless headphones to play audio) and, based on its own status and interaction data, determine that the audio playback method should be through wireless headphones. Therefore, desktop computer A can send a connection request to the wireless headphones to establish a connection. After the connection is established, desktop computer A instructs the wireless headphones to play audio, which the user can then listen to by wearing the wireless headphones and using desktop computer A as the audio source.
[0203] Not limited to the above examples, in other examples, when desktop computer A determines that the wireless headphones are in an unconnectable state (e.g., no signal of the wireless headphones is found, or the linkage data includes that the wireless headphones are playing audio), and the linkage data also includes information about other wireless headphones (e.g., they are in a connectable state), desktop computer A can determine that the audio is being played through other wireless headphones.
[0204] Not limited to the above examples, in other examples, the linkage data may include the wireless headphones currently playing audio (e.g., connected to other audio source devices). In this case, desktop computer A can determine that the playback method that the user is used to in the current scenario (playing with wireless headphones) cannot be executed. Therefore, it can determine that the audio playback method should be stopped and display a prompt message, allowing the user to choose the audio playback method themselves, thus avoiding accidental playback.
[0205] Beyond the examples above, in other examples, the linked data could include a user wearing a smartwatch who is not asleep, and desktop computer A obtaining the current time as "15:30". Desktop computer A can, based on self-learned user habits (assuming a home environment where users typically use smart speakers to play audio in the afternoon when no one is sleeping), combine desktop computer A's status data and linked data to determine that the audio should be played through the smart speaker. Therefore, desktop computer A can instruct the smart speaker to play audio. In other examples, desktop computer A can also determine the audio playback method based on device connectivity. For example, if there are two smart speakers, one already connected to desktop computer A and the other not, desktop computer A can determine to play audio through the connected smart speaker. This reduces unnecessary steps and improves product usability while ensuring a good user experience.
[0206] Understandably, when desktop computer A detects that the (directly or indirectly) connected audio playback device (i.e., wireless headphones) has been disconnected, it will not directly play audio aloud. Instead, it will combine desktop computer A's status data, linkage data, and self-learned user habits to determine the way to play audio, which is in line with user habits. Users do not need to manually connect the specified audio playback device (such as the wireless headphones mentioned above) and desktop computer A, reducing unnecessary user operations and preventing accidental playback, thus improving the user experience.
[0207] Understandably, the linkage data is the status data of the devices that desktop computer A can communicate with. In some embodiments, the number and type of these devices can be determined by desktop computer A according to the application scenario, its own processing capabilities, etc. The usage scenario is universal, and the advantages of the Internet of Things are fully utilized in the all-scenario mode to improve the intelligence of audio playback and enhance the effectiveness of communication between devices.
[0208] The following section describes the method for playing audio provided in this application.
[0209] Please see Figure 4 , Figure 4 This application provides a method for playing audio. This method can be applied to... Figure 1 The illustrated electronic device 100. This method can be applied to... Figure 2A The illustrated electronic device 100. This method can be applied to... Figure 2B The electronic device 200 shown. The method may include, but is not limited to, the following steps:
[0210] S101: When the first triggering condition is met, the first device obtains the status data of the first device.
[0211] In some embodiments, S101 is an optional step.
[0212] Specifically, the first device can be the main device in the above embodiments, and the first device and the main device can be interchanged in the following embodiments.
[0213] In some embodiments, the first triggering condition may include the main device receiving a first instruction for playing audio. Optionally, the first instruction is an instruction in response to a user operation for playing audio, which can be understood as the first instruction being triggered by the user operation. The type of user operation includes, but is not limited to, touch operations on the main device's display screen, voice commands issued by the user, gesture operations, etc., such as user operations for answering incoming calls, listening to voice messages, playing songs, etc. Optionally, the first instruction is not triggered by a user operation; for example, the first instruction is an instruction to receive an incoming call. In some embodiments, when the main device receives the first instruction, the main device is not connected to an audio playback device (e.g., wireless headphones, smart speakers, smart glasses, smart TVs, smart screens, etc.). For example, before receiving the user operation for playing audio, the main device has not received a user operation for connecting an audio playback device. In the above case, satisfying the first triggering condition can be understood as the main device playing audio "for the first time" without the user actively connecting an audio playback device, rather than continuing the previous audio playback process. Optionally, the audio playback device is a device determined by the main device for playing audio based on linkage data. For example, Figure 3A When the mobile phone B receives a click operation on the playback control 323 in the user interface 320, or a click operation on the control of any song in the song list 322, it can be determined that the first triggering condition is met. This can be understood as the "first" time that the mobile phone B is used to play audio. For details, please refer to [link / reference]. Figure 3A Explanation.
[0214] In other embodiments, the first triggering condition may include the master device detecting a disconnection from the audio playback device. Optionally, the audio playback device was playing audio before the connection with the master device was disconnected. The audio is provided by the master device as the audio source. In the above case, satisfying the first triggering condition can be understood as the master device needing to continue the previously played audio process. For example, Figure 3C The desktop computer A shown is the main device, and the wireless headphones are the audio playback device. Desktop computer A connects to the wireless headphones via mobile phone A, and plays audio provided by desktop computer A as the audio source through the wireless headphones. During the playback of "Song A" audio by the wireless headphones, if desktop computer A detects a disconnection from mobile phone A, and desktop computer A can no longer provide audio to the wireless headphones through mobile phone A, then desktop computer A can be considered to have met the first trigger condition. This can be understood as desktop computer A needing to continue playing the audio of "Song A". For details, please refer to [link to relevant documentation]. Figure 3C Explanation.
[0215] Specifically, the main device is an audio source device that can provide audio for playback. Optionally, any electronic device that can act as an audio source can be the main device. The status data of the main device is the data that the main device can acquire, and optionally includes data detected by the main device through its included modules. The types of the main device's status data include, but are not limited to, at least one of the following: current time, current location, whether connected to a network, information about connectable devices (e.g., devices with unique identifiers such as addresses stored in a database, devices that can be searched for via Bluetooth, etc.) (e.g., device type, device status), information about connected devices (e.g., device type, device status), and user status information such as whether the user is in a sleep or active state (e.g., determined based on collected user physiological parameters). For an example of how the main device acquires its own status data, please refer to the example above of how electronic devices acquire their own status data.
[0216] S102: When the first triggering condition is met, the master device obtains the linkage data of the master device.
[0217] Specifically, the linkage data of the master device may include the status data of at least one assisting device that the master device can communicate with. The assisting device can be the slave device as described in the above embodiments; in the following embodiments, the assisting device and the slave device can be interchanged. Master device and slave device are relative concepts; for example, Figure 1 In the communication system shown, when electronic device 100 acts as an audio source to provide audio playback, electronic device 100 can be the master device, and electronic devices 200 that can communicate with electronic device 100 can be slave devices. Examples include wireless headphones 201, smart speakers 202, smartwatches 203, and gateway devices 204 directly connected to electronic device 100, and tablet computers 205, desktop computers 206, smartphones 207, and laptop computers 208 indirectly connected to electronic device 100. When the master device changes, the slave devices relative to the master device also change. For example, when tablet computer 205 acts as an audio source to provide audio playback, it can be the master device. In this case, the slave devices are electronic devices that tablet computer 205 can communicate with, such as the directly connected gateway device 204, and the indirectly connected desktop computer 206 and electronic device 100.
[0218] The status data of a slave device refers to the data that the slave device can obtain. This status data may include its own data or data from connected devices. The types of slave device status data include, but are not limited to, at least one of the following: slave device type, slave device status, current time, current location, whether connected to a network, types of connected devices, status of connected devices, and user status information such as whether the user is asleep or active (e.g., determined based on collected user physiological parameters). For an example of how a slave device obtains its own status data, please refer to the example above regarding how electronic devices obtain their own status data.
[0219] For an example of how a master device acquires linkage data, please refer to the example above of how electronic devices acquire linkage data.
[0220] In some embodiments, the data type of any slave device's status data in the master device's linkage data (i.e., status data of at least one slave device) can be related to the device type of that slave device, as shown in Table 1 below.
[0221] Table 1. Linkage data of the main equipment.
[0222]
[0223] In this context, the first type of slave device is a device that can function as an audio source, meaning it can also function as a master device. It's important to note that the ability of a first-type slave device to function as a master device refers to its ability to function as a master device in other situations, not just in the current scenario. At any given time, only one master device exists in the communication system of this application, but multiple slave devices can exist. Among these multiple slave devices, there can be slave devices that have previously served as master devices, i.e., first-type slave devices. First-type slave devices can provide the master device with preset or self-learned audio playback methods commonly used in the current scenario. For example, they can provide the master device with the playback method commonly used at the current time, or the current location and the playback method commonly used at the current location. First-type slave devices can also provide their own status to the master device, such as whether audio is currently being played. If audio is currently being played, they can also provide the playback method to the master device. The first type of slave device can also provide information about the connected device to the master device, such as whether there is a connectable or connected audio playback device. A connectable device is, for example, a device that has stored a unique identifier or a device that can search for Bluetooth signals. Optionally, if there is a connectable or connected audio playback device, the master device can provide the connection information of the audio playback device (such as Bluetooth address, access password, etc.).
[0224] The second type of slave device is a device connected to at least one wearable device. This slave device can obtain the status of at least one user wearing the at least one wearable device, such as whether they are asleep or active. In some embodiments, the slave device and the at least one connected wearable device can be close together, as can the slave device and the master device, for example, by connecting via near-field communication methods such as Bluetooth, infrared, or NFC. Optionally, the at least one user can be a user close to the master device, rather than the user using the master device. This application can comprehensively consider the status of other users close to the user using the master device to determine the audio playback method. For example, if a nearby user is asleep, audio will not be played externally, avoiding accidental external playback and improving the user experience.
[0225] The third type of slave device can be a wearable device. This type of slave device can provide the status of the user wearing the device, such as whether they are asleep or exercising. In some embodiments, the slave device can be a device connected to the master device, for example, via near-field communication methods such as Bluetooth, infrared, or NFC. Optionally, the user can be the user of the master device. This application can comprehensively consider the status of the user using the master device to determine the audio playback method, avoiding accidental playback errors and improving the user experience.
[0226] The fourth type of slave device can be a sound playback device that plays audio through a speaker. In some embodiments, the fourth type of slave device can provide its current location to the master device. In other embodiments, the fourth type of slave device can also provide its distance from the master device, or whether it is in the same room as the master device, etc., to the master device. The fourth type of slave device can also provide its own status to the master device, such as whether it is currently playing audio. This application can comprehensively consider the situation of other devices playing audio to determine the audio playback method. For example, when a smart speaker close to the user using the master device is playing audio, the audio is not played through the speaker, and the playback method is more in line with the user's needs. For example, if there is a sound playback device that is not playing audio and that sound playback device is a commonly used sound playback device, then that sound playback device is used to play audio.
[0227] In some embodiments, the slave device is the device connected to the master device. The master device can directly determine the distance to the slave device based on the strength of the received signal, without requiring the slave device to provide its current location. In some embodiments, the slave device can provide the location of the connected device to the master device, allowing the master device to comprehensively consider and determine the audio playback method.
[0228] In some embodiments, the master device can send a request message to the slave device, and the slave device sends linkage data to the master device based on the request message. In other embodiments, the master device can send a request message to other devices besides the slave device, and the other devices send linkage data (i.e., the slave device's status data) to the master device based on the request message. For example, when the slave device logs into the first account through the first application, it can send its own status data to the application server in the cloud that provides services for the first application. The slave device's status data can be stored in the cloud as information of the first account. When the master device logs into the first account through the first application, it can request the application server to obtain the first account's information (i.e., linkage data).
[0229] In some embodiments, the master device can obtain the status data of the slave device as linkage data when it determines that the user using the master device and the user using the slave device are similar or the same. For example, when the distance between the master device and the slave device is less than or equal to a preset distance threshold or they are in the same space, the master device sends a request to the slave device to request linkage data. Another example is that the master device can obtain the status data of slave devices that have previously logged into a logged-in account. For specific examples, see the example above where the master device can obtain linkage data from devices other than the slave device. This ensures that the determined audio playback method is tailored to the current user, highly personalized, and better suited to the current user's needs.
[0230] In some embodiments, when the master device acquires linkage data, it can indicate the required linkage data (data type) by sending a request message. The device receiving the request message can determine the required linkage data based on the request information and send it to the master device. For example, a request message sent by the master device to a wearable slave device may include information requesting the wearer's status. Optionally, the data type of the linkage data requested by the master device may differ for different slave devices.
[0231] In other embodiments, the device providing the linkage data can pre-negotiate the required linkage data (data type) with the master device. This allows the device to directly send the pre-negotiated data type's status data to the master device upon receiving a request message. The request message can be used solely to request linkage data without specifying its exact type, reducing the data volume of the request message. Optionally, the data type of the linkage data negotiated and determined by the master device can differ for different slave devices.
[0232] In some embodiments, the device providing the linkage data may also determine the data type of the linkage data to be sent based on the context (e.g., the connection status with other devices, the type of other connected devices).
[0233] In some embodiments, after receiving the linkage data, the master device can filter the linkage data, such as filtering out useless data and abnormal data. Useless data is linkage data that the master device does not need (which can be understood as sending extra linkage data). For example, the linkage data sent by the slave device includes 10 types, but the master device only needs 8 of them in the current scenario. Abnormal data is, for example, garbled characters or data that is significantly different from normal data.
[0234] In some embodiments, the order of S101 and S102 is not limited. S101 can be executed first and S102 can be executed later, or S102 can be executed first and S101 can be executed later, or S101 and S102 can be executed simultaneously.
[0235] S103: The master device determines the audio playback method (hereinafter referred to as playback method) based on the first data.
[0236] In some embodiments, the first data includes status data of the master device. In some embodiments, the first data includes linkage data of the master device. The following embodiments illustrate this by assuming that the first data includes both status data and linkage data of the master device.
[0237] In some embodiments, the master device can determine the playback mode as one of multiple modes (referred to as the first mode) based on the master device's status data and linkage data. These multiple modes include, but are not limited to, the following: playback via the master device's speaker (external playback mode), playback via the master device's receiver (earpiece mode), playback and pausing of audio playback via audio playback device A. It is not limited to these; it may also include playback via other modules included in the master device, and playback via other audio playback devices besides the master device, such as playback via audio playback device B. Optionally, audio playback device A and audio playback device B may have different device types, for example, audio playback device A may be a wireless headset and audio playback device B may be a smart speaker. Optionally, audio playback device A and audio playback device B may have the same device type, for example, both may be wireless headsets. The audio playback device is the master device and any device other than the modules included in the master device for playing audio. The audio playback device can be any device that the master device can communicate with, and the device type includes, but is not limited to, wireless headsets, smart speakers, smart glasses, smart TVs, smart screens, etc. In some embodiments, the sound playback device is one of at least one slave device; in other embodiments, the sound playback device is a device connected to any one of the slave devices; and in still other embodiments, the sound playback device is a device other than a slave device.
[0238] In other embodiments, the determined playback mode is to stop playing audio. For example, if the main device determines that the user's preferred playback mode is to play through a sound playback device other than the main device, but it cannot currently connect to a sound playback device, or a communicable sound playback device is playing audio and cannot play the audio provided by the main device, the determined playback mode can be to stop playing.
[0239] In some embodiments, the master device can determine the playback mode based on the master device's status data and linkage data according to preset rules. Optionally, the preset rules can indicate the correspondence between the conditions satisfied by the first data and the playback modes of the first device. For example, it can indicate that when the master device's status data and linkage data satisfy the first condition, the determined playback mode is the first playback mode; when the master device's status data and linkage data satisfy the second condition, the determined playback mode is the second playback mode, for example as follows: Figure 5 The logical judgment process is shown below. Optionally, the preset rules are pre-set by the main device, such as those set at the factory. Optionally, the main device can receive user operations to determine the preset rules. See the following example for a specific example. Figure 8 Optionally, since different users generally have different playback habits, the main device can learn the playback habits that users are used to and determine preset rules (including updating preset rules) based on the learned user habits.
[0240] For example, when a user plays audio using a main device (also the audio source device), the main device can acquire scene data that characterizes the current scenario and the currently used playback mode. Scene data can include the main device's state data and linkage data. The difference between scene data and the state data and linkage data used to determine the playback mode is that the main device acquires the scene data at different times. Optionally, the device also acquires its own state data (i.e., the main device's linkage data) at different times. This allows the main device to acquire scene data for multiple scenarios and corresponding playback modes (which can be understood as learning the playback modes the user habitually uses). Based on the main device's state data, linkage data, and stored scene data for multiple scenarios, the main device can identify the current scenario and determine the corresponding playback mode. Optionally, the preset rules learned by the main device can differ for different users. When determining the playback mode, the main device can first identify the current user (e.g., through a logged-in account, collected physiological parameters, or other authentication methods), and then use the preset rules corresponding to the current user to determine the playback mode. Not limited to this, preset rules can also be learned by other devices. The main device can determine the preset rules on its own or obtain them from other devices. For example, when user A logs in to the first account through the cloud, it can obtain the preset rules corresponding to the first account from the cloud and then use the preset rules to determine the playback method.
[0241] In some embodiments, the slave device that acquires scene data and the slave device that provides linkage data may be the same. In other embodiments, the slave device that acquires scene data and the slave device that provides linkage data may be different. For example, there may be more slave devices that acquire scene data than slave devices that provide linkage data.
[0242] In other embodiments, the master device can use a machine model to determine the playback mode based on its state data and linkage data. Optionally, the master device can use its state data and linkage data as input to the machine model to obtain the output: the playback mode. Optionally, the machine model is pre-configured on the master device, such as when it leaves the factory. Optionally, different users generally use different playback modes, and the master device can learn the playback modes that users are accustomed to using and train the machine model (including updating the machine model) based on the self-learned user habits. An example of the master device training the machine model is as follows. Figure 6A As shown, an example of how the main device uses a machine model to determine the playback method is as follows: Figure 6B As shown. However, this is not the only limitation; the machine model can also be trained by other devices. The main device can train the machine model itself or obtain it from other devices.
[0243] In some embodiments, the preset rules or machine model may also include priority settings, such as, but not limited to, setting priorities according to device type, device state, connection method (e.g., whether it is preemptive), and distance between the first device, for example... Figure 3C In the scenario shown, the device originally used to play audio provided by desktop computer A was a wireless headset. The connection between desktop computer A and the wireless headset is disconnected. When determining the method of playing audio, the method of playing audio through the wireless headset has a higher priority than the method of playing audio through other device types.
[0244] S104: The main device executes the determined playback method.
[0245] In some embodiments, S104 is an optional step.
[0246] In some embodiments, when the determined playback method is playback through a module such as a speaker or earpiece of the main device, the main device may instruct the speaker or earpiece to play the audio provided by the main device.
[0247] In other embodiments, when the determined playback method is to play audio through a sound playback device connected to the main device, the main device can send audio to the sound playback device so that the sound playback device can play the audio provided by the main device. Optionally, if the sound playback device is directly connected to the main device, the main device can send audio directly through the communication line with the sound playback device. Optionally, if the sound playback device is indirectly connected to the main device through other devices, the main device can send audio to the sound playback device through other devices.
[0248] In other embodiments, when the determined playback mode is that the main device plays audio from a playback device not connected to, the main device can first send a connection request to the playback device, connect to the playback device, and then send audio to the playback device so that the playback device plays the audio provided by the main device. See above for specific examples. Figure 3A and Figure 3C Optionally, when the main device fails to connect to the audio playback device, it can stop playing audio. Optionally, when audio playback stops, the main device can display a prompt message to inform the user that it cannot connect to the audio playback device, allowing the user to choose a playback method.
[0249] In other embodiments, when the determined playback mode is "stop playback," the main device can display a prompt message to allow the user to select a playback mode. Optionally, the prompt message can be used to inform the user of the current status of the audio playback device. For example, it may indicate that the main device's currently communicable audio playback device is playing audio and cannot be used to play the audio provided by the main device, or that the main device currently has no communicable audio playback device. Specific examples can be found above. Figure 3B The prompt message is 331.
[0250] In some examples, the first triggering condition includes the master device receiving a first instruction for playing audio. When the master device determines that the first triggering condition is met, the first device may not be connected to the second device, and the second device's most recently connected device is a device other than the first device. The first device may determine to play audio through the second device based on first data (e.g., including the second device being in a connectable state). When the first device executes the determined playback method, it can establish a connection with the second device and play audio through the second device. See above for specific examples. Figure 3A The first device is mobile phone B, the second device is a wireless headset, and the device most recently connected to the second device is mobile phone A.
[0251] In other examples, the first triggering condition includes the master device detecting a disconnection from the audio playback device. Assuming the first data includes the type of the second device and that the second device is in a connectable state, and the type of the second device is the same as the aforementioned audio playback device, the first device can determine that the second device will play audio based on the first data. When the first device executes the determined playback mode, it can establish a connection with the second device and play audio through the second device. See above for specific examples. Figure 3C The first device is desktop computer A, and the second device is wireless headphones.
[0252] In some embodiments, after the master device executes a determined playback mode, if the master device does not receive a user operation to switch playback modes within a preset time period, the master device can learn that the determined playback mode is the playback mode that the user is accustomed to using. For example, the master device can update the aforementioned preset rules or machine model based on the determined playback mode and the status data and linkage data of the master device used to determine the playback mode.
[0253] In some embodiments, after the master device executes a determined playback mode, when the master device receives a user operation to switch the playback mode within a preset time period, the master device can learn the switched playback mode as the playback mode that the user is accustomed to using. For example, the master device can update the aforementioned preset rules or machine model based on the switched playback mode, as well as the status data and linkage data of the master device used to determine the playback mode.
[0254] Not limited to the examples above, the main device can also determine the playback method based solely on the linkage data.
[0255] Understandably, the linkage data, optional and status data of the main device in the above example can be used to characterize the current playback scenario. Different linkage data (optional and status data) can characterize different playback scenarios and determine different playback methods. Therefore, the playback method determined by the linkage data (optional and status data) is more in line with the current playback scenario. In addition, the playback method determined by self-learned user habits is more in line with user habits, thus making the way audio is played more intelligent.
[0256] exist Figure 4 In the method shown, the master device can learn the playback methods that users are accustomed to using based on the linkage between it and the slave device. Based on the master device's status data and linkage data (slave device's status data), it intelligently adjusts the audio playback method to avoid poor user experience caused by accidental external playback and to meet user needs. Combining linkage data to determine the playback method allows for full utilization of the advantages of the Internet of Things in all scenarios, improving the effectiveness of communication between devices. The optimization of audio playback method switching also greatly enhances users' understanding of the Internet of Things.
[0257] Furthermore, any communicable device of the master device can act as a slave device to determine the playback method, which can be used in scenarios with a single slave device or multiple slave devices, thus broadening the application scenarios.
[0258] In some embodiments, the master device can determine the way audio is played according to preset rules, for example, as shown in the following example. Figure 5 As shown.
[0259] Please see Figure 5 , Figure 5 This is a flowchart illustrating another method for playing audio provided in an embodiment of this application. This process can be applied to... Figure 1 The electronic device 100 shown. This process can be applied to... Figure 2A The illustrated electronic device 100. This method can be applied to... Figure 2B The electronic device 200 is shown. This process can belong to... Figure 4 S103-S104 are shown.
[0260] Figure 5 Preset rules (such as user habits learned by the main device) include: in a home space, during entertainment time and when no user is asleep, the preferred playback method is to play audio using a smart speaker, and the second choice is to play audio through the speaker. In an outdoor space, or during rest time, or when a user is asleep, the preferred playback method is to play audio using wireless headphones, and the second choice is to stop playback.
[0261] This process may include, but is not limited to, the following steps:
[0262] S201: The main device determines whether the current location of the main device belongs to the home space.
[0263] Specifically, the main device can pre-set the geographical location category. For example, geographical locations within a preset range are considered home spaces, while geographical locations outside the preset range are considered outdoor spaces. The main device obtains its status data: given the current location, it can determine whether the current location belongs to a home space. If it does, it can proceed to the next step, i.e., execute S202. If it does not belong to a home space, it meets the preset rule that "the preferred playback method in outdoor spaces is using wireless headphones." At this point, the main device can determine whether the preferred playback method in the preset rule can be executed, and therefore can execute S208.
[0264] S202: The main device determines whether the current time is a rest period.
[0265] Specifically, the master device can pre-set time categories, such as 00:00 to 08:00, 13:00 to 14:00, and 22:00 to 00:00 as rest time, and other times as entertainment time. The master device can obtain its own system time or obtain it from linked data. If the master device determines that the current time does not belong to rest time, it can continue to the next step of judgment, that is, execute S203. If it determines that the current time belongs to rest time, it meets the preset rule that "the preferred playback method during rest time is to use wireless headphones". At this time, the master device can determine whether the preferred playback method in the preset rule can be executed, so it can execute S208.
[0266] S203: The main device determines whether a user is in a sleep state.
[0267] Specifically, the master device can determine whether a user is asleep by using its own status data or by using linked data. In some embodiments, the master device's status data and / or linked data can directly include information indicating whether a user is asleep. The master device can directly determine whether a user is asleep. For example, if the slave device is a smartphone connected to a smart bracelet, the slave device can determine whether a user is asleep based on physiological parameters such as heart rate and respiratory rate sent by the smart bracelet, and the determination result can be used as linked data. In other embodiments, the master device's status data and / or linked data can include information used to determine whether a user is asleep, such as physiological parameters like heart rate and respiratory rate. The master device determines whether a user is asleep based on this information.
[0268] In some embodiments, the information used to determine whether a user is asleep may be obtained from a device located close to the main device. This can be understood as the user being close to the main device; for example, the information may be sent by a device connected to the main device via near-field communication. The method of audio playback is determined by comprehensively considering the states of other users close to the user using the main device. For example, if a nearby user is asleep, audio may not be played through the speaker to avoid accidental playback errors and improve the user experience.
[0269] When the main device determines that no user is asleep, it meets the preset rule "In a home space, during entertainment time and when no user is asleep, the preferred playback method is to use a smart speaker". At this time, the main device can determine whether the preferred playback method in the preset rule can be executed, so it can execute S204. If it determines that a user is asleep, it meets the preset rule "When a user is asleep, the preferred playback method is to use wireless headphones". At this time, the main device can determine whether the preferred playback method in the preset rule can be executed, so it can execute S208.
[0270] S204: The main device determines whether to connect to the smart speaker.
[0271] Specifically, the master device can determine whether it is directly or indirectly connected to a smart speaker, for example, whether there is a smart speaker among the connected devices, or whether there is a device connected to a smart speaker among the connected devices. When no smart speaker is connected, step S205 can be executed. When a smart speaker is connected, the master device can determine that the preferred playback method in the preset rules can be executed, so it can determine that the playback method is playback through the smart speaker and execute the playback method, that is, execute step S207.
[0272] S205: The main device determines whether there is an available smart speaker.
[0273] Specifically, the master device can determine whether there is a smart speaker that can be directly or indirectly connected and is not being used to play audio (i.e., an idle smart speaker). For example, it can determine whether there is a smart speaker among the devices that can detect Bluetooth signals. If there is a smart speaker, the master device sends a message to the smart speaker to request whether the smart speaker is currently being used to play audio. When there is an idle smart speaker, step S206 can be executed. When there is no idle smart speaker, the master device can determine that the preferred playback method in the preset rules cannot be determined, so the playback method is determined to be the secondary playback method (external audio playback) in the preset rules, and this playback method is executed, i.e., step S213 is executed.
[0274] S206: The main device connects to the smart speaker.
[0275] Specifically, when the master device determines that there is an available smart speaker, it can send a connection request to the smart speaker to connect. When the master device successfully connects to the smart speaker, it can determine that the preferred playback method in the preset rules can be executed. Therefore, it can determine that the playback method is to play through the smart speaker and execute this playback method, that is, execute S207.
[0276] S207: The main device instructs the smart speaker to play audio.
[0277] Specifically, when the main device is connected to a smart speaker, it can instruct the smart speaker to play audio. For example, the main device sends instruction information and audio data to the smart speaker, and the smart speaker responds to the instruction information by playing the audio data.
[0278] In other embodiments, when the main device fails to connect to the smart speaker, the main device can determine that the preferred playback method in the preset rules cannot be executed, and therefore determine the playback method as the secondary playback method (external audio playback) in the preset rules, and execute the playback method, that is, execute S213.
[0279] S208: The main device determines whether the main device is connected to wireless headphones.
[0280] Specifically, the master device can determine whether it is directly or indirectly connected to wireless headphones, for example, whether there are wireless headphones among the connected devices, or whether there is a device connected to wireless headphones among the connected devices. When no wireless headphones are connected, S209 can be executed. When wireless headphones are connected, the master device can determine that the preferred playback method in the preset rules can be executed, so it can determine that the playback method is playback through wireless headphones and execute the playback method, that is, execute S211.
[0281] S209: The master device determines whether there is an available wireless earphone.
[0282] Specifically, the master device can determine whether there is a wireless headset that can be directly or indirectly connected and is not being used to play audio (i.e., an idle wireless headset). For example, it can determine whether there is a wireless headset among the devices whose Bluetooth signals can be detected. If there is a wireless headset, it sends a message to the wireless headset to request whether the wireless headset is currently being used to play audio. When there is an idle wireless headset, S210 can be executed. When there is no idle wireless headset, the master device can determine that the preferred playback method in the preset rules cannot be executed, so it determines the playback method to be the secondary playback method in the preset rules (stop playback) and executes this playback method, i.e., executes S212.
[0283] S210: The main device connects to the wireless headset.
[0284] Specifically, when the master device determines that there is an available wireless earphone, it can send a connection request to the wireless earphone to connect to the smart speaker. When the master device successfully connects to the wireless earphone, it can determine that the preferred playback method in the preset rules can be executed. Therefore, it can determine that the playback method is to play through the wireless earphone and execute this playback method, that is, execute S211.
[0285] S211: The master device instructs the wireless headphones to play audio.
[0286] Specifically, when the main device is connected to wireless headphones, it can instruct the wireless headphones to play audio. For example, the main device sends audio data to the wireless headphones, and the wireless headphones play the audio data after receiving it.
[0287] In other embodiments, when the main device fails to connect to the wireless headphones, the main device can determine that the preferred playback method in the preset rules cannot be executed, and therefore determine the playback method as the secondary playback method in the preset rules (stop playback), and execute the playback method, that is, execute S212.
[0288] S212: The main device stops playing audio.
[0289] Specifically, when the main device determines that the preferred playback method (playing through wireless headphones) in the preset rules cannot be executed, it can execute a secondary playback method: stop playback. In some embodiments, when the main device stops playing audio, it can display a prompt message so that the user can select a playback method themselves; see details below. Figure 4 The instructions for stopping playback in S104.
[0290] S213: External audio output from the main device.
[0291] Specifically, when the main device determines that the preferred playback method (playing through a smart speaker) in the preset rules cannot be executed, it can execute the secondary playback method: external audio playback, that is, playing audio through the main device's speaker.
[0292] Not limited to Figure 5 In the example shown, in other examples, S201-S203 can be a single step. For instance, if the devices connected to the main device have pre-set spatial tags, the main device can obtain data from devices with the spatial tag "home space" and determine whether the user using these devices is in a sleep state. If not in a sleep state, proceed to S204; if in a sleep state, proceed to S208. This application does not limit the specific method by which the main device determines the audio playback method according to preset rules.
[0293] In some embodiments, the host device can learn how the user plays audio during daily use of the host device to train a machine model. This machine model is used to determine how to play audio. Specific examples are shown below. Figure 6A .
[0294] like Figure 6A As shown, when the first user plays audio using the main device in any scenario, the main device can obtain the scenario data. For a description of the scenario data, please refer to [link to documentation / reference]. Figure 4 The description of scene data in S103 includes information such as current time, current location, whether the main device is connected to the internet, and information about the devices connected to the main device. The main device can also obtain the playback mode used in the current scene. The main device can use scene data from at least one scene as input to the first model and the playback mode used in these at least one scene as output to train the first model. The first model is used to determine the playback mode when the first user plays audio. This process can be understood as the main device learning the first user's playback habits.
[0295] The main device can learn the first user's playback habits in various scenarios. For example, the main device can map scene data from multiple scenarios to... Figure 6AIn the two-dimensional plane shown, this two-dimensional plane can correspond to the first model, where any point can represent scene data of a scene. The scene data of these multiple scenes can include scene data corresponding to playback mode A and scene data of playback mode B. Figure 6A The shape of the dots is used to distinguish scene data corresponding to different playback modes. Triangular dots represent scene data corresponding to playback mode A, and circular dots represent scene data corresponding to playback mode B. The main device can divide this two-dimensional plane into two-dimensional planes corresponding to different playback modes, such as... Figure 6A As shown, the system is divided into two-dimensional plane A corresponding to playback mode A and two-dimensional plane B corresponding to playback mode B. This ensures that two-dimensional plane A includes as many points as possible representing the scene data for playback mode A (i.e., triangle points), and two-dimensional plane B includes as many points as possible representing the scene data for playback mode B (i.e., circular points). For example, over 80% of the triangle points are in two-dimensional plane A, and over 80% of the circular points are in two-dimensional plane B. When using the first model trained in this way, if the input data points of the first model fall into two-dimensional plane A, the output of the first model is playback mode A corresponding to two-dimensional plane A; if the input data points of the first model fall into two-dimensional plane B, the output of the first model is playback mode B corresponding to two-dimensional plane B. A specific example is as follows. Figure 6B As shown.
[0296] In some embodiments, the master device may use a machine model to determine the playback method based on the master device's status data and linkage data. See below for specific examples. Figure 6B , Figure 6B Based on the machine model used Figure 6A Let's take the first determined model as an example for illustration.
[0297] like Figure 6B As shown, the main device can use its status data and linkage data as input to the first model to obtain the output of the first model: playback mode. For example, the main device can map its status data and linkage data (referred to as input data A) to... Figure 6B A point in the two-dimensional plane shown, namely Figure 6B The point of the rhombus shown can be determined by the main device to be located in two-dimensional plane A. The playback mode (playback mode A) corresponding to two-dimensional plane A is the output of the first model.
[0298] Understandably, Figures 6A-6B This explanation uses two playback modes as an example; in practice, there can be many more playback modes. For instance, the machine model used to determine the playback mode can use a multi-label classification algorithm, such as the Rank-SVM algorithm.
[0299] Not limited to the two-dimensional plane in the above examples, in other embodiments, the plane corresponding to the machine model and the playback method can be a one-dimensional plane, a three-dimensional plane, or a hyperplane with a dimension higher than three.
[0300] In some embodiments, after the master device obtains the status data or linkage data of the master device, it can first transform this data, for example, converting irregular data into regular data. Regular data may be data whose results only include yes or no, such as whether the device is connected to the network or whether the connected device is a sound playback device. Irregular data may be data whose results include a certain range, such as the current time or current location. For example, the master device can identify the geographical location within a first range as label 1, the geographical location within a second range as label 2, and the geographical location within a third range as label 3. The master device can identify the time from 00:00 to 08:00, 13:00 to 14:00, and 22:00 to 00:00 as label 00, and other times as label 01. This can effectively improve the effectiveness of machine model processing and eliminate other factors affecting the intelligent adjustment of playback mode.
[0301] In some embodiments, the master device can learn preprocessing methods during the user's daily use of the master device. For example, the master device can gradually and accurately determine the first range of the home space based on the master device's status data and / or linkage data.
[0302] Understandably, scene data, main device status data, and linkage data can all include data strongly correlated with the user (such as whether they are asleep, physiological parameters, logged-in account, etc.), which can be used to distinguish different users. Furthermore, the first model is the model corresponding to the first user, and the machine models corresponding to different users can be different. Similarly, the preset rules corresponding to different users can also be different. Therefore, this application can provide users with intelligent and personalized audio playback services.
[0303] In some embodiments, the structure of the main device may also be as follows: Figure 7 As shown.
[0304] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of a main device provided in an embodiment of this application.
[0305] like Figure 7 As shown, the main device 700 may include a detection unit 701, a data unit 702, a preprocessing unit 703, a decision-making unit 704, and an execution unit 705, wherein:
[0306] Detection unit 701 is used to determine whether the first triggering condition is met; see details below. Figure 4The explanation in S104 regarding whether the first triggering condition is met.
[0307] Data unit 702 is used to acquire linkage data from master device 700; see details below. Figure 4 The description of obtaining the linkage data of the master device in S102 is provided. In some embodiments, the data unit 702 is also used to obtain the status data of the master device 700. For details, please refer to [link to documentation]. Figure 4 Instructions for obtaining the status data of the master device in S101.
[0308] The preprocessing unit 703 is used to preprocess the acquired status data and / or linkage data of the master device 700. The preprocessed data is then sent to the decision unit 704 for further processing. In some embodiments, the preprocessing unit 703 is used to filter the linkage data of the master device 700, for example, filtering out useless data and abnormal data. Useless data is linkage data that the master device does not need (which can be understood as extra linkage data being sent), and abnormal data is, for example, garbled characters or data that differs significantly from normal data. In some embodiments, the preprocessing unit 703 is used to perform transformation processing on the status data and / or linkage data of the master device 700. Specific examples can be found in [link to relevant documentation]. Figures 6A-6B This document explains how to transform irregular data into regular data.
[0309] In some embodiments, the preprocessing unit 703 is also used to train a machine model; specific examples can be found above. Figure 6A .
[0310] Decision unit 704 is used to determine the playback mode based on the status data and linkage data of the main device 700. For details, please refer to [link / reference needed]. Figure 4 Explanation of S103.
[0311] Execution unit 705 is used to execute a determined playback method; see details below. Figure 4 Explanation of S104.
[0312] In some embodiments, Figure 2A The electronic device 100 shown can be Figure 7 The main device 700 shown is shown. Figure 2A The processor 110 shown may include Figure 7 The units shown include a mobile communication module 150, a wireless communication module 160, and a sensor module 180, which may include a detection unit 701 and a data unit 702. The audio module 170 may include an execution unit 705.
[0313] In some embodiments, the master device can also receive user operations and, in response to the user operations, determine preset rules for determining the playback mode, as shown in the following examples. Figure 8 As shown.
[0314] Please see Figure 8 , Figure 8 A schematic diagram of an example user interface embodiment is shown. Figure 8 The smartphone shown is used as an example of the main device for illustration. Figure 8 (A) shows the user interface 810 before clicking 812A. Figure 8 (B) shows the user interface 820 after clicking 812A.
[0315] like Figure 8 As shown in (A), the main device can display a user interface 810. The user interface 810 may include a title 811 and a settings list 812. The title 811 may include a theme 811A and a title description 811B. The theme 811A may include the text "Playback Settings," and the title description 811B may include the text "Usage Scenarios for Setting Playback Modes," indicating that the user interface 810 is a user interface for setting playback mode preferences. The settings list 812 may include various playback modes, such as speaker playback, earpiece playback, wireless headphone playback, smart speaker playback 812A, and smart screen playback. The main device can receive touch operations (e.g., click operations) applied to the controls corresponding to any playback mode in the settings list 812. In response to the touch operation, the main device displays the user interface for setting the usage scenarios of that playback mode. For example, in response to a click on the smart speaker 812A, the main device displays... Figure 8 The user interface 820 shown in (B) is shown.
[0316] like Figure 8 As shown in (B), the main device can display a user interface 820. The user interface 820 may include a title 821 and a list of usage scenario settings. The title 821 may include the text "Smart Speaker Playback," indicating that the user interface 820 is a user interface for setting usage scenarios for smart speaker playback preferences. The usage scenario settings list includes, for example, a settings bar 822 for usage time, a settings bar 823 for usage location, and a settings bar 824 for usage habits, wherein:
[0317] The usage time setting field 822 can be used to set the user's preferred time to play audio on the smart speaker. Setting value 822A indicates that the current usage time is set to 15:00 to 18:00.
[0318] The location setting bar 823 can be used to set the user's preferred location for playing audio using the smart speaker. Setting value 823A indicates that the currently set playback location is the home space.
[0319] The usage preference settings bar 824 can be used to set other user preferences for playing audio using the smart speaker. For example, setting value 824A includes not using the smart speaker to play audio when other devices besides the main device are playing audio, not using the smart speaker to play audio when there is a user in sleep mode, and using the smart speaker to play audio when the audio source device (main device) is far away.
[0320] Not limited to Figure 8 In the example scenario, users can also set their preferred playback method when playing audio. The amount of data that users can set for their usage scenarios can be more or less, and this application does not limit the specific way users set these settings.
[0321] In this application, the main device can determine the playback method using preset content, such as according to the preset rules built in at the factory, or it can learn the user's playback habits by itself, or the user can set the playback habits themselves. The method is flexible, the application scenarios are wide, and the product has high usability.
[0322] It should be noted that when the electronic device plays audio in this application, it may not display the image corresponding to the audio, such as when answering a call or playing a song. Alternatively, it may display the image corresponding to the audio, which can be understood as playing video.
[0323] Understandably, when the main device does not obtain the main device's status data, the main device can determine the playback mode based on the linkage data, not the main device's status data. Therefore, the "main device's status data and linkage data" used to determine the playback mode can be replaced with "main device's linkage data".
[0324] It should be noted that in the embodiments of this application, "at least one" refers to one or more, and "more" refers to two or more. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terminology used in the specification of this application is for the purpose of describing particular embodiments only and is not intended to limit this application. It should be understood that, unless otherwise stated, " / " in this application means "or". For example, A / B can mean A or B. "And / or" in this application is merely a description of the relationship between related objects, indicating that three relationships can exist. It should be noted that in the embodiments of this application, terms such as "first" and "second" are used only for the purpose of distinguishing descriptions and should not be construed as indicating or implying relative importance or order. Features defined with "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. To be precise, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a specific way.
[0325] Those skilled in the art will understand that implementing all or part of the processes in the methods of the above embodiments can be accomplished by a computer program using computer program-related hardware. This computer program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing computer program code, such as read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A method for playing audio, characterized in that, Applied to a first device, the first device being used to provide audio for playback, the method includes: When a first triggering condition is met, first data is acquired. The first triggering condition includes disconnection from the device used to play audio. The first data includes the status data of the first device and data acquired by at least one assisting device that can communicate with the first device. Based on the first data, it is determined that the first device plays audio in a first manner among multiple methods, which includes the following: playing audio through the speaker of the first device, playing audio through a second device, and stopping audio playback; Wherein, the second device is a device among the at least one assisting device, or the second device is a device connected to the at least one assisting device; if it is determined based on the first data that the method of playing audio through the second device is executable, then the first method is playing audio through the second device; if it is determined based on the first data that the method of playing audio through the second device is not executable, then the first method is playing audio through the speaker of the first device or stopping playing audio.
2. The method as described in claim 1, characterized in that, The first data includes at least one of the following: the type of the assisting device, the status of the assisting device, the type of the device connected to the assisting device, and the status of the device connected to the assisting device.
3. The method as described in claim 1, characterized in that, The first data includes the user's status, which includes whether the user is asleep or active.
4. The method as described in claim 3, characterized in that, The second device is a wireless headset, and the first data includes whether the user is in a sleep state or an exercise state, and the first method is to play audio through the second device.
5. The method as described in claim 1, characterized in that, The first data includes the current time and / or the location of the first device.
6. The method as described in claim 5, characterized in that, The second device is a smart speaker. When the current time is a preset leisure period and the location of the first device is a preset home space, the first method is to play audio through the second device. or, The second device is a wireless headset. When the current time is within a preset rest period and the location of the first device is within a preset home space, the first method is to play audio through the second device. or, The second device is a wireless headset. When the location of the first device is a preset outdoor space, the first method is to play audio through the second device.
7. The method according to any one of claims 1-6, characterized in that, The first triggering condition includes disconnecting from the device used to play audio; the first data includes the type of the second device and the status of the second device; the type of the second device is the same as the type of the device used to play audio; the status of the second device is a connectable state; and the first method is playing audio through the second device. After determining that the first device plays audio in a first manner among multiple methods, the method further includes: Establish a connection with the second device and play audio through the second device.
8. The method according to any one of claims 1-6, characterized in that, The acquisition of the first data includes: Send a request message to a third device and receive second data sent by the third device based on the request message, wherein the first data includes the second data, and the third device is a device among the at least one assisting device, or the third device is a device that receives the second data sent by the assisting device.
9. The method as described in claim 8, characterized in that, The request message includes information indicating the data type of the second data; or... Before acquiring the first data, the method further includes: the first device and the third device negotiating to determine the type of the second data.
10. The method according to any one of claims 1-6, characterized in that, The acquisition of the first data includes: The system receives third data sent by a fourth device among the at least one assisting devices, and receives fourth data sent by a fifth device among the at least one assisting devices. The first data includes the third data and the fourth data. The fourth device and the fifth device are of different types, and the third data and the fourth data are of different types.
11. The method according to any one of claims 1-6, characterized in that, The step of determining, based on the first data, that the first device plays audio in a first manner among multiple methods includes: determining, based on a first preset rule, that when the first data meets a first condition, the first device plays audio in the first manner among the multiple methods, whereby the first preset rule indicates the correspondence between the condition met by the first data and the manner in which the first device plays audio; or, The step of determining the first device to play audio in a first manner among multiple methods based on the first data includes: using the first data as input to a first model to obtain the output of the first model, wherein the output of the first model is the first method.
12. The method as described in claim 11, characterized in that, Before acquiring the first data when the first triggering condition is met, the method further includes: When a first user plays audio using the first device, the system acquires fifth data and a second method for the first device to play audio, wherein the fifth data includes data acquired by the at least one assisting device. The first preset rule corresponding to the first user is determined based on the fifth data and the second method, or the first model corresponding to the first user is trained by using the fifth data as the input of the first model and the second method as the output of the first model.
13. The method as described in claim 12, characterized in that, After determining that the first device plays audio in a first manner among multiple methods, the method further includes: Perform the first method; Receive a second user operation for switching the way the first device plays audio; In response to the second user's operation, the audio playback mode of the first device is switched from the first mode to the third mode; The first preset rule is updated based on the first data and the third method, or the first model is updated based on the first data and the third method.
14. The method according to any one of claims 1-6, characterized in that, The assisting device is a device that is logged into the same account as the first device.
15. The method according to any one of claims 1-6, characterized in that, The first method is to stop playing audio. After determining that the first device is playing audio in the first of multiple methods, the method further includes: When playback of the audio provided by the first device stops, a prompt message is displayed, which is used to inform the user that the first device does not have a device available for playing audio.
16. A method for playing audio, characterized in that, Applied to assistive devices, the method includes: Receive a request message sent by a first device when a first trigger condition is met, wherein the first trigger condition includes disconnection from the device used for playing audio; Based on the request message, first data is sent to the first device. The first data is used by the first device to determine, in conjunction with the status data of the first device, the mode of playing audio is a first mode among multiple modes, which includes the following: playing audio through the speaker of the first device, playing audio through the second device, and stopping playing audio. Wherein, the second device is a device in at least one of the assisting devices, or the second device is a device connected to the at least one assisting device; if the first data is used by the first device to determine that the method of playing audio through the second device is executable, then the first method is playing audio through the second device; if the first data is used by the first device to determine that the method of playing audio through the second device is not executable, then the first method is playing audio through the speaker of the first device or stopping playing audio.
17. The method as described in claim 16, characterized in that, The first data includes at least one of the following: the type of the assisting device, the status of the assisting device, the type of the device connected to the assisting device, and the status of the device connected to the assisting device.
18. The method as described in claim 16 or 17, characterized in that, Before receiving the request message sent by the first device when the first trigger condition is met, the method further includes: The first type is determined through negotiation with the first device; Sending the first data to the first device based on the request message includes: Based on the request message, the first data of the first type is sent to the first device.
19. The method as described in claim 16 or 17, characterized in that, The request message includes information indicating a second type; sending the first data to the first device based on the request message includes: Based on the request message, the first data of the second data type is sent to the first device.
20. A communication system, characterized in that, It includes a first device and at least one assisting device, the first device being used to provide audio for playback, and the at least one assisting device being a device that can communicate with the first device, wherein: The first device is configured to acquire first data when a first triggering condition is met, the first triggering condition including disconnection from the device for playing audio, and the first data including status data of the first device and data acquired by the at least one assisting device; The first device is configured to determine, based on the first data, that the method by which the first device plays audio is a first method among multiple methods, the multiple methods including: playing audio through the speaker of the first device, playing audio through a second device, and stopping playing audio; Wherein, the second device is a device among the at least one assisting device, or the second device is a device connected to the at least one assisting device; if the first data is used by the first device to determine that the method of playing audio through the second device is executable, then the first method is playing audio through the second device; if the first data is used by the first device to determine that the method of playing audio through the second device is not executable, then the first method is playing audio through the speaker of the first device or stopping playing audio.
21. The communication system as described in claim 20, characterized in that, The first data includes at least one of the following: the type of the assisting device, the status of the assisting device, the type of the device connected to the assisting device, and the status of the device connected to the assisting device.
22. The communication system as described in claim 20 or 21, characterized in that, The acquisition of the first data includes: Send a request message to a third device and receive second data sent by the third device based on the request message, wherein the first data includes the second data, and the third device is a device among the at least one assisting device, or the third device is a device that receives the second data sent by the assisting device.
23. The communication system as described in claim 22, characterized in that, The request message includes information indicating the data type of the second data; or... The first device is further configured to negotiate with the third device to determine the data type of the second data before acquiring the first data.
24. The communication system as described in claim 20 or 21, characterized in that, The acquisition of the first data includes: The system receives third data sent by a fourth device among the at least one assisting devices, and receives fourth data sent by a fifth device among the at least one assisting devices. The first data includes the third data and the fourth data. The fourth device and the fifth device are of different types, and the third data and the fourth data are of different types.
25. An electronic device, characterized in that, The device includes a transceiver, a processor, and a memory, wherein the memory stores a computer program, and the processor invokes the computer program to perform the method as described in any one of claims 1-19.
26. A computer storage medium, characterized in that, The computer storage medium stores a computer program, which, when executed by a processor, implements the method described in any one of claims 1-19.