Audio playing method, audio playing system and electronic equipment

By determining the master and slave devices in multiple audio generation devices and sending audio data to the audio output device in a unified manner, the problem of difficulty in playing audio in a multi-device hyper-terminal system is solved, and the combined voice of multiple devices is realized, improving the user experience.

CN120238604APending Publication Date: 2025-07-01HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311855945.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-28
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

In a multi-device hyper-terminal system, it is difficult for users to receive audio from multiple terminal devices at the same time, resulting in a degradation of user experience.

Method used

By determining the audio generation master device and the audio generation slave device among multiple audio generation devices, the audio generation slave device sends the audio data to the audio generation master device, and the master device sends its own audio data and the audio data of the slave device to the audio output device for unified playback.

Benefits of technology

The joint voice of multiple devices has been realized, solving the problem of users' inability to hear through multiple devices, and improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120238604A_ABST
    Figure CN120238604A_ABST
Patent Text Reader

Abstract

The invention provides an audio playing method, an audio playing system and an electronic device, the method is applied to the audio playing system, the audio playing system comprises a first electronic device and a second electronic device, and the method comprises the following steps: determining a master device and a slave device in the first electronic device and the second electronic device, the slave device can send the audio data to the master device, and then the master device sends the audio data of the master device and the received audio data of the slave device to the audio output device so that the audio output device can play the audio data of the master device and the audio data of the slave device in a unified mode. According to the method, joint sounding of multiple electronic devices can be realized, so that the problem that a user cannot hear or cannot hear the audio of a certain electronic device clearly due to respective sounding of multiple electronic devices in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of audio playback, and more specifically, to an audio playback method, an audio playback system, and an electronic device. Background Art

[0002] In recent years, intelligent terminal technology has developed rapidly, and a user or a family often has multiple terminal devices. For example, a user's home may include a super terminal system composed of multiple terminals such as mobile phones, watches, earphones, and TVs. In such a super terminal system, when a user uses multiple terminal devices, it is possible to receive audio from multiple terminal devices at the same time.

[0003] For example, during exercise, a user uses intelligent earphones to play music on a mobile phone, uses an intelligent watch for exercise announcements, and uses a large-screen device to broadcast the exercise situation in real time. Then, when the user is wearing earphones to listen to music, due to the individual sound production of multiple devices, the user will inevitably not hear the exercise announcements of the watch and the large-screen device, thus reducing the user experience. Summary of the Invention

[0004] This application provides an audio playback method, an audio playback system, and an electronic device. The method determines a main audio generation device and a slave audio generation device among multiple audio generation devices, and then the slave audio generation device sends audio data to the main audio generation device. The main audio generation device sends its own audio data and the audio data of the slave device to an audio output device to play the audio uniformly using the audio output device, thereby solving the problem of individual sound production of multiple devices.

[0005] In a first aspect, this application provides an audio playback method. The method provided in the first aspect is applied to an audio playback system, and the audio playback system includes: a first electronic device and a second electronic device, where the first electronic device and the second electronic device are audio generation devices.

[0006] Specifically, the method includes: a target device among the first electronic device and the second electronic device determines a main device and a slave device among the first electronic device and the second electronic device; the target device sends the determination result to the other device among the first electronic device and the second electronic device; the slave device sends the audio data of the slave device to the main device; the main device sends the audio data of the main device and the audio data of the slave device to an audio output device.

[0007] The method provided by the first aspect determines an audio generation master device and an audio generation slave device among multiple audio generation devices (the first electronic device and the second electronic device). The audio generation slave device can send audio data to the audio generation master device, and the audio generation master device sends the audio data played by itself and the audio data sent by the audio generation slave device to the audio output device, finally realizing joint sound production of multiple devices, and solving the problem that in the related art, the user cannot hear clearly due to the separate sound production of multiple devices.

[0008] Optionally, in some embodiments, the device with the larger MAC address among the first electronic device and the second electronic device can determine the audio generation master device and the audio generation slave device among the first electronic device and the second electronic device. The embodiments of the present application do not make specific limitations on whether the first electronic device or the second electronic device determines the audio generation master device and the audio generation slave device.

[0009] It should be understood that the determination result sent by the target device to the other device among the first electronic device and the second electronic device can mean that the target device tells the other device that the other device is the master device or the other device is the slave device. Exemplarily, when the target device is the first electronic device and the other device is the second electronic device, the first electronic device sends the determination result that the second electronic device is the master device to the second electronic device, or the first electronic device sends the determination result that the second electronic device is the slave device to the second electronic device, so that the second electronic device knows that its own device is the master device or the slave device. When the second electronic device knows that its own device is the master device, the first electronic device is the slave device, or when the second electronic device knows that its own device is the slave device, the first electronic device is the master device.

[0010] Alternatively, the determination result sent by the target device to the other device among the first electronic device and the second electronic device can also mean that the target device tells the other device that the target device is the master device and the other device is the slave device, or tells the other device that the target device is the slave device and the other device is the master device. Exemplarily, when the target device is the first electronic device and the other device is the second electronic device, the first electronic device sends the determination result that the first electronic device is the master device and the second electronic device is the slave device to the second electronic device, or the first electronic device sends the determination result that the first electronic device is the slave device and the second electronic device is the master device to the second electronic device, so that the second electronic device knows that its own device is the master device or the slave device, and the target device is the master device or the slave device.

[0011] In a possible implementation of the first aspect, the master device sends the audio data of the master device and the audio data of the slave device to the audio output device for playback, including: the master device fuses the audio data of the master device and the audio data of the slave device according to the determination result to obtain the fused audio data, and the master device sends the fused audio data to the audio output device.

[0012] In this implementation, after the master device fuses the audio data of the master device and the audio data of the slave device and sends it to the audio output device, the audio output device only needs to directly play the processed audio data, thereby reducing the processing capacity of the audio output device.

[0013] Optionally, the process of the master device fusing the audio data of the master device and the audio data of the slave device according to the determination result may include mixing the audio data of the master device and the audio data of the slave device. Of course, the process of audio data fusion may also include other processing methods, which are not specifically limited in the embodiments of the present application.

[0014] In a possible implementation of the first aspect, the master device and the slave device are determined according to the priority of the service type of the first service of the first electronic device and the service type of the second service of the second electronic device. The first service is the part of the services running in the first electronic device or the service with the highest priority among all the services, and the second service is the part of the services running in the second electronic device or the service with the highest priority among all the services. The master device is the device corresponding to the service with the highest priority among the service types of the first service and the service type of the second service.

[0015] In this implementation, the master device and the slave device can be determined based on the priority of the service types corresponding to the audio data of the first electronic device and the second electronic device, so as to aggregate the audio data on multiple electronic devices to the same electronic device.

[0016] It should be understood that the part of the services running in the first electronic device refers to the part of the services that meet the preset service type. The preset service type can be a telephone service, a multimedia service, a sports and health service, etc. Alternatively, the part of the services can also refer to meeting the preset application list, and the preset application list includes telephone applications, multimedia applications, sports and health applications, etc.

[0017] Similarly, the part of the services running in the second electronic device can also refer to the part of the services that meet the preset service type. The preset service type can be a telephone service, a multimedia service, a sports and health service, etc. Alternatively, the part of the services can also refer to meeting the preset application list, and the preset application list includes telephone applications, multimedia applications, sports and health applications, etc.

[0018] It should also be understood that the first electronic device and the second electronic device can obtain the attributes of the running services, and determine whether the running services meet the preset service types or the preset application list based on the attributes of the running services.

[0019] Exemplarily, when the first electronic device is a mobile phone, music is being played in the foreground of the mobile phone, and a health service is running in the background of the mobile phone. When the second electronic device is a smartwatch, the smartwatch runs a health service. Then, the service with the highest priority among the running services in the first electronic device is audio. That is, the priorities of the audio service and the health service of the smartwatch are judged. When the priority of the audio service is higher than the priority of the health service, the mobile phone is the master device and the watch is the slave device.

[0020] It should be understood that the mobile phone and the watch can simultaneously establish a connection with an audio output device (e.g., headphones). However, the audio data channel of the headphones can only be connected to the mobile phone or the watch. When the mobile phone is the master device, the mobile phone can send a data stream switching command to the headphones, and the headphones switch the channel for receiving the audio stream to the mobile phone. The watch sends the audio data to the mobile phone, and the mobile phone plays the audio data of the mobile phone and the audio data of the headphones through the headphones.

[0021] In a possible implementation manner of the first aspect, the target device obtains the service type of the service with the highest priority among the running services in the target device, and receives from another device the service type of the service with the highest priority among the running services in the other device.

[0022] Exemplarily, when the target device is the first electronic device (e.g., a mobile phone) and the other device is the second electronic device (e.g., a watch), the mobile phone can obtain the service type of the service with the highest priority among the running services in the current device (e.g., the audio service), and receive from the watch the service type of the service with the highest priority among the running services in the watch (e.g., the health service). Thus, the mobile phone can determine that the mobile phone is the master device and the watch is the slave device based on the audio service and the health service.

[0023] In a possible implementation manner of the first aspect, the priorities of the service types include: the telephone service is higher than the multimedia service, and / or the multimedia service is higher than the sports and health service, and / or the telephone service is higher than the sports and health service.

[0024] Optionally, the multimedia service may include an audio service and a video service, where the priority of the audio service may be greater than the priority of the video service. The sports and health service may include a sports service and a health service, where the priority of the sports service may be greater than the priority of the health service.

[0025] In a possible implementation of the first aspect, the master device fuses the audio data of the master device and the audio data of the slave device according to the determination result to obtain the fused audio data, including: during the period when the audio data of the master device and the audio data of the slave device are played simultaneously, the master device reduces the volume of the audio data of the master device.

[0026] In this implementation, in order not to affect the simultaneous playback of the audio data stream of the master device and the audio data stream of the slave device, the master device can reduce the volume of the audio data of the master device without interrupting the audio data of the master device, so that the user can hear the audio data of the slave device.

[0027] Optionally, an implementation of the master device reducing the volume of the audio data of the master device is: the master device reduces the volume of the audio data of the master device to a certain volume value. For example, the master device can reduce the volume of the audio data of the master device from the original 20 decibels to 5 decibels.

[0028] Optionally, in another implementation of the master device reducing the volume of the audio data of the master device: the master device reduces the volume of the audio data of the master device by a certain volume value. For example, the master device can reduce the original 20 decibels of the master device by 10 decibels.

[0029] Optionally, in yet another implementation of the master device reducing the volume of the audio data of the master device: the master device reduces the volume of the audio data of the master device to be smaller than the volume of the audio data of the slave device. For example, if the volume of the audio data of the slave device is 10 decibels, the master device can reduce the audio of the audio data of the master device to below 10 decibels.

[0030] In a possible implementation of the first aspect, the volume of the reduced audio data of the master device is less than the volume of the audio data of the slave device.

[0031] In this implementation, when the audio output device plays the audio data of the master device and the audio data of the slave device simultaneously, if the volume of the audio data of the master device is greater than the volume of the audio data of the slave device, it can enable the user to receive the audio data of the slave device without interrupting the audio data of the master device. When the playback of the audio data of the slave device ends, the volume of the audio data of the master device can be restored to the normal volume.

[0032] In a possible implementation of the first aspect, the audio data of the master device is sent before the audio data of the slave device.

[0033] In this implementation manner, when the service corresponding to the audio data stream being played by the master device is a telephone service, after the master device normally plays the audio data corresponding to the telephone service when receiving the audio data sent by the slave device, it then sends the audio data to be played by the slave device to the audio output device, ensuring that the audio data to be played by the slave device can be heard by the user.

[0034] In a second aspect, the present application further provides an audio playback system, which includes: a first electronic device and a second electronic device. The first electronic device and the second electronic device are audio generating devices. The first electronic device is configured to execute the method executed by the first electronic device in the first aspect or any possible implementation manner of the first aspect. The second electronic device is configured to execute the method executed by the second electronic device in the first aspect or any possible implementation manner of the first aspect.

[0035] In a third aspect, the present application provides an audio playback method. The method provided in the third aspect can be executed by the first electronic device, or by a module (such as a processor, a chip, or a chip system, etc.) applied in the first electronic device, or can also be implemented by a logic node, a logic module, or software that can implement all or part of the functions of the electronic device. The present application does not make any limitations in this regard.

[0036] Specifically, the method includes: the first electronic device obtains a determination result, which is used to indicate that the first electronic device is the master device and the second electronic device is the slave device among the first electronic device and the second electronic device; the master device receives the audio data sent by the slave device; the master device sends the audio data of the master device and the audio data of the slave device to the audio output device.

[0037] For the method provided in the third aspect, the first electronic device can obtain the determination result of the audio generating master device and the audio generating slave device among multiple audio generating devices (the first electronic device and the second electronic device), and when the first electronic device is the master device, the first electronic device can receive the audio data of the slave device, and then send its own audio data and the audio data sent by the slave device to the audio output device for playback, finally realizing joint sound production of multiple devices, and solving the problem that the user cannot hear clearly due to the separate sound production of multiple devices in the related art.

[0038] Optionally, in some embodiments, the device with the larger MAC address among the first electronic device and the second electronic device can determine the audio generating master device and the audio generating slave device among the first electronic device and the second electronic device. The embodiments of the present application do not make specific limitations on whether the first electronic device or the second electronic device determines the audio generating master device and the audio generating slave device.

[0039] It should be understood that when the target device sends the determination result to the other device among the first electronic device and the second electronic device, it may mean that the target device tells the other device that the other device is the master device or the other device is the slave device. Exemplarily, when the target device is the first electronic device and the other device is the second electronic device, the first electronic device sends the determination result that the second electronic device is the master device to the second electronic device, or the first electronic device sends the determination result that the second electronic device is the slave device to the second electronic device, so that the second electronic device knows that its own device is the master device or the slave device.

[0040] Alternatively, when the target device sends the determination result to the other device among the first electronic device and the second electronic device, it may also mean that the target device tells the other device that the target device is the master device and the other device is the slave device, or tells the other device that the target device is the slave device and the other device is the master device. Exemplarily, when the target device is the first electronic device and the other device is the second electronic device, the first electronic device sends the determination result that the first electronic device is the master device and the second electronic device is the slave device to the second electronic device, or the first electronic device sends the determination result that the first electronic device is the slave device and the second electronic device is the master device to the second electronic device, so that the second electronic device knows that its own device is the master device or the slave device, and the target device is the master device or the slave device.

[0041] In a possible implementation manner of the third aspect, the first electronic device may determine that the first electronic device is the master device and the second electronic device is the slave device among the first electronic device and the second electronic device, or the first electronic device may obtain the determination result sent by the second electronic device.

[0042] In a possible implementation manner of the first aspect, the master device sends the audio data of the master device and the audio data of the slave device to the audio output device for playing, including: the master device fuses the audio data of the master device and the audio data of the slave device to obtain the fused audio data, and the master device sends the fused audio data to the audio output device for playing.

[0043] In this implementation manner, after the master device fuses the audio data of the master device and the audio data of the slave device and then sends it to the audio output device, the audio output device only needs to directly play the processed audio data, thereby reducing the processing capacity of the audio output device.

[0044] Optionally, the process of the master device fusing the audio data of the master device and the audio data of the slave device according to the determination result may include performing a mixing process on the audio data of the master device and the audio data of the slave device. Of course, the process of fusing audio data may also include other processing methods, which are not specifically limited in the embodiments of the present application.

[0045] In a possible implementation of the third aspect, the master device and the slave device are determined according to the service type priority of the first service of the first electronic device and the second service of the sound of the second electronic device. The first service is the service with the highest priority among the services running in the first electronic device, and the second service is the service with the highest priority among the services running in the second electronic device. The master device is the device corresponding to the service with the highest priority among the service types of the first service and the service type of the second service.

[0046] In this implementation, the master device and the slave device can be determined based on the priority of the service types corresponding to the audio data of the first electronic device and the second electronic device, so as to aggregate the audio data on multiple electronic devices to the same electronic device.

[0047] It should be understood that some of the services running in the first electronic device refer to those services that meet the preset service types, and the preset service types can be telephone services, multimedia services, or sports and health services, etc. Or, some services can also refer to those that meet the preset application list, and the preset application list includes telephone applications, multimedia applications, or sports and health applications, etc.

[0048] Similarly, some of the services running in the second electronic device can also refer to those services that meet the preset service types, and the preset service types can be telephone services, multimedia services, or sports and health services, etc. Or, some services can also refer to those that meet the preset application list, and the preset application list includes telephone applications, multimedia applications, or sports and health applications, etc.

[0049] It should also be understood that the first electronic device and the second electronic device can obtain the attributes of the running services, and determine whether the running services meet the preset service types or the preset application list based on the attributes of the running services.

[0050] Exemplarily, when the first electronic device is a mobile phone, music is being played in the foreground of the mobile phone, and a health service is running in the background of the mobile phone. When the second electronic device is a smart watch and the smart watch is running a health service, then the service with the highest priority among the services running in the first electronic device is music. That is, the priorities of the music service and the health service of the smart watch are judged. When the priority of the music service is higher than the priority of the health service, the mobile phone is the master device and the watch is the slave device.

[0051] It should be understood that a mobile phone and a watch can establish connections with an audio output device (e.g., headphones) simultaneously, but the audio data channel of the headphones can only be connected to either the mobile phone or the watch. When the mobile phone is the master device, the mobile phone can send a data stream switching command to the headphones, and the headphones switch the channel for receiving the audio stream to the mobile phone. The watch sends the audio data to the mobile phone, and the mobile phone plays the audio data of the mobile phone and the audio data of the headphones through the headphones.

[0052] In a possible implementation of the third aspect, the first electronic device obtains the service type of the service with the highest priority among the services running on the first electronic device, and receives from the second electronic device the service type of the service with the highest priority among the services running on the second electronic device.

[0053] In this implementation, the first electronic device, as the target device, determines the service type of its own first service and receives the service type of the second service of the second electronic device, so as to determine the master device and the slave device between the first electronic device and the second electronic device.

[0054] Exemplarily, when the first electronic device is a mobile phone and the second electronic device is a watch, the mobile phone can obtain the service type of the service with the highest priority among the services running on the current device (e.g., audio service), and receive from the watch the service type of the service with the highest priority among the services running on the watch (e.g., health service). Thus, the mobile phone can determine that the mobile phone is the master device and the watch is the slave device based on the audio service and the health service.

[0055] In a possible implementation of the third aspect, the priority of the service types includes: the telephone service has a higher priority than the multimedia service, and / or the multimedia service has a higher priority than the sports and health service, and / or the telephone service has a higher priority than the sports and health service.

[0056] Optionally, the multimedia service can include an audio service and a video service, where the priority of the audio service can be greater than the priority of the video service. The sports and health service can include a sports service and a health service, where the priority of the sports service can be greater than the priority of the health service.

[0057] In a possible implementation of the third aspect, the master device fuses the audio data of the master device and the audio data of the slave device to obtain the fused audio data, including: during the period when the audio data of the master device and the audio data of the slave device are played simultaneously, the master device reduces the volume of the audio data of the master device.

[0058] In this implementation, in order not to affect the simultaneous playback of the audio data stream of the master device and the audio data stream of the slave device, the master device can reduce the volume of the audio data stream being played on the master device without interrupting the audio data stream being played, so that the user can hear the audio data stream of the slave device.

[0059] Optionally, an implementation of the master device reducing the volume of the audio data of the master device is: the master device reduces the volume of the audio data of the master device to a certain volume value. For example, the master device can reduce the volume of the audio data of the master device from the original 20 decibels to 5 decibels.

[0060] Optionally, in another implementation of the master device reducing the volume of the audio data of the master device: the master device reduces the volume of the audio data of the master device by a certain volume value. For example, the master device can reduce the original 20 decibels of the master device by 10 decibels.

[0061] Optionally, in yet another implementation of the master device reducing the volume of the audio data of the master device: the master device reduces the volume of the audio data of the master device to be smaller than the volume of the audio data of the slave device. For example, if the volume of the audio data of the slave device is 10 decibels, the master device can reduce the volume of the audio data of the master device to below 10 decibels.

[0062] In a possible implementation of the third aspect, the volume of the reduced audio data of the master device is less than the volume of the audio data of the slave device.

[0063] In this implementation, when the audio output device plays the audio data of the master device and the audio data of the slave device simultaneously, if the volume of the audio data of the master device is greater than the volume of the audio data of the slave device, it can enable the user not to interrupt the audio data of the master device when receiving the audio data of the slave device. When the playback of the audio data of the slave device ends, the volume of the audio data of the master device can be restored to the normal volume.

[0064] In a possible implementation of the third aspect, the audio data of the master device is sent before the audio data of the slave device.

[0065] In this implementation, when the service corresponding to the audio data stream being played on the master device is a telephone service, when the master device receives the audio data sent by the slave device, after normally playing the audio data corresponding to the telephone service, it then sends the audio data to be played by the slave device to the audio output device, ensuring that the audio data to be played by the slave device can be heard by the user.

[0066] In the fourth aspect, a communication device is provided, and the communication device includes units for performing each step in the above third aspect or any possible implementation of the third aspect.

[0067] In a fifth aspect, a communication device is provided. The communication device includes at least one processor and a memory, the processor and the memory are coupled, and the memory stores program instructions. When the program instructions stored in the memory are executed by the processor, the methods in the above third aspect or any possible implementation manner of the third aspect are executed.

[0068] In a sixth aspect, a communication device is provided. The communication device includes at least one processor and an interface circuit, and the at least one processor is configured to execute the methods in the above third aspect or any possible implementation manner of the third aspect.

[0069] In a seventh aspect, an electronic device is provided. The electronic device includes a processor and a memory. The memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the electronic device executes the methods in the above third aspect or any possible implementation manner of the third aspect.

[0070] In an eighth aspect, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, it is used to execute the methods in the above first aspect or any possible implementation manner of the first aspect, or is used to execute the methods in the above third aspect or any possible implementation manner of the third aspect.

[0071] In a ninth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program. When the computer program is executed, it is used to execute the methods in the above first aspect or any possible implementation manner of the first aspect, or execute the methods in the above third aspect or any possible implementation manner of the third aspect.

[0072] In a tenth aspect, a chip is provided. The chip includes: a processor, which is used to call and run a computer program from a memory, so that a communication device installed with the chip executes the methods for executing the above first aspect or any possible implementation manner of the first aspect, or executes the methods in the above third aspect or any possible implementation manner of the third aspect. Description of the Drawings

[0073] Figure 1 A schematic diagram showing an audio system in which multiple devices move jointly in a motion scenario is shown;

[0074] Figure 2 A schematic diagram of an audio playback system provided by an embodiment of the present application is shown;

[0075] Figure 3Shows a schematic diagram of establishing a connection using a super terminal provided by an embodiment of the present application;

[0076] Figure 4 Shows a schematic diagram of the modules of each electronic device in an audio system;

[0077] Figure 5 Shows a schematic diagram of a scenario applicable to an audio playback method provided by an embodiment of the present application;

[0078] Figure 6 Shows a schematic flowchart of the audio playback method 600 provided by an embodiment of the present application;

[0079] Figure 7 Shows a schematic diagram of the structure of the electronic device 100 provided by the present application;

[0080] Figure 8 Shows a schematic diagram of the software system of the electronic device 100 according to an embodiment of the present application;

[0081] Figure 9 Shows a schematic diagram of the structure of an electronic device provided by the present application. Detailed implementation manners

[0082] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application.

[0083] The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification and claims of the present application, the singular forms "a", "an", "the above", "the", and "this" are also intended to include, for example, the expression form of "one or more", unless there is a clear opposite indication in the context. It should also be understood that in the embodiments of the present application, "one or more" means one or more than two (including two); "and / or" describes the association relationship of associated objects and indicates that three relationships can exist; for example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after.

[0084] References to "one embodiment" or "some embodiments" or the like described in this specification mean that a particular feature, structure, or characteristic described in connection with that embodiment is included in one or more embodiments of the present application. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but rather mean "one or more but not all embodiments", unless otherwise specifically emphasized. The terms "comprising", "including", "having" and their variants mean "including but not limited to", unless otherwise specifically emphasized.

[0085] The "multiple" involved in the embodiments of the present application means greater than or equal to two. It should be noted that in the description of the embodiments of the present application, words such as "first" and "second" are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.

[0086] With the continuous development of intelligent terminals, devices such as smart phones, smart watches, and smart earphones have become increasingly popular, bringing great convenience to people's lives, studies, and work. For example, during exercise, users can play music on their mobile phones through smart earphones while using a smart watch or a large-screen device to provide real-time reports on the exercise situation.

[0087] Exemplarily, Figure 1 shows a schematic diagram of an audio system for the joint movement of multiple devices in a sports scenario. As Figure 1 shown, in a sports scenario, the multiple electronic devices included in the audio system are a smart phone 101, a smart watch 102, smart earphones 103, and a large-screen device 104 respectively. Among them, during exercise, users can play music on the smart phone 101 through the worn smart earphones 103, and use the smart watch 102 to provide operation reports, such as exercise duration, exercise speed, and heart rate, etc. At the same time, the large-screen device 104 can simulate the sports scenario in real time and provide real-time voice reports during the exercise, thus bringing an immersive experience to users.

[0088] However, in the above sports scenario, the user wears the smart earphones 103, and the music on the mobile phone 101 is played in the smart earphones 103. The smart watch 102 provides its own exercise reports, and the large-screen device 104 also provides its own exercise reports. Then, when the user is listening to music with the earphones 103 on, it is inevitable that they will not hear or hear clearly the exercise reports of the smart watch 102 and the large-screen device 104, thus reducing the user experience.

[0089] Therefore, when a user uses multiple electronic devices, how to avoid the individual voice announcements of multiple electronic devices, which may prevent the user from forming a unified voice announcement experience, is an issue that needs attention at present.

[0090] In view of this, the present application provides an audio playback method, which is applied to an audio playback system. The audio playback system includes: a first electronic device, a second electronic device, and an audio output device. Among them, the first electronic device and the second electronic device are audio generating devices. The method includes: the first electronic device or the second electronic device determines an audio playback master device and an audio playback slave device among the first electronic device and the second electronic device. The audio playback slave device sends the audio data stream to be played to the audio playback master device. After receiving the audio data stream to be played, the audio playback master device fuses the audio data being played by the master device and the audio data stream to be played to obtain a fused audio data stream. The master device sends the fused audio data stream to the audio output device, and uses the audio output device to play the fused audio data stream. This method avoids the problem that multiple terminal devices each announce voices, resulting in an inability to form a unified announcement experience, and further improves the user experience.

[0091] Before introducing the audio playback method provided by the present application, the audio playback system applicable to the present application will be specifically described first.

[0092] The audio playback method provided by the embodiments of the present application can be applied to Figure 2 the audio playback system shown in Figure 2 FIG. shows a schematic diagram of an audio playback system provided by an embodiment of the present application. As Figure 2 shown, the audio system includes an electronic device B (for example, a smart phone 101), an electronic device A (for example, a smart watch 102), and an audio output device C (for example, a smart earphone 103). The electronic device B can communicate with the electronic device A and the audio output device C in a wired manner or in a wireless manner.

[0093] Exemplarily, a connection can be established between the electronic device B, the electronic device A, and the audio output device C using Bluetooth. A wired connection can also be established between the electronic device B, the electronic device A, and the audio output device C through a universal serial bus (USB), or a wireless connection can be established through a 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), wireless fidelity (Wi-Fi), NFC, voice over Internet protocol (VoIP), or a communication protocol supporting a network slicing architecture.

[0094] In some other embodiments of the present application, the user can achieve the combined sound of multiple devices through the super terminal control. It should be understood that the super terminal control center is an application for multi-device collaborative control, presenting the near-field devices with the same account centered on the current device and integrating the collaborative services between devices. That is to say, the UI interface of the super terminal control center can provide an interface display of the super terminal function. For example, devices logged in with the same account within the nearby Bluetooth or wireless range can be displayed on this interface to facilitate the user to experience various super terminal functions.

[0095] Exemplarily, Figure 3 shows a schematic diagram of establishing a connection using the super terminal provided by an embodiment of the present application. As shown in Figure 3 Figure (a) therein, when the user enters the drop-down menu interface in the drop-down menu, the application program cards, super terminal cards, and Huawei Video cards commonly used by the user are displayed on the display interface. When the user clicks on the super terminal card, the super terminal control center can be entered, and the UI interface of the super terminal control center can display the local device and multiple nearby devices searched, as shown in Figure 3As shown in Figure (b) therein, multiple devices near the local device displayed on the display interface include: smart screen, smart watch, smart earphone, floor sweeper, and ecological fingerprint lock. The user can select multiple devices that need to perform combined sound on the display interface. For example, the user can drag and combine the watch icon, earphone icon, and mobile phone icon together, and the audio of these three electronic devices will be automatically fused to execute the audio playback method provided in the embodiments of the present application.

[0096] After the electronic device A, the electronic device B, and the audio output device are connected, the electronic device B and the electronic device A are audio data generating devices. When the electronic device B is the master device, the slave device A sends the audio data to be played to the master device B. The master device B is used to receive the audio data sent by the slave device A and fuse the audio data that itself needs to play with the audio data sent by the slave device A. Finally, the master device B sends the fused audio data to the audio output device C. In other words, the master device B and the slave device A can implement their own audio output functions in the audio output device C, so as to realize cross-device distributed audio capabilities and provide the user with a unified playback experience.

[0097] Exemplarily, the master device B and the slave device A can specifically be devices with audio input and output functions such as mobile phones, watches, speakers, tablet computers, TVs (which can also be called smart TVs, smart screens, or large-screen devices), laptops, ultra-mobile personal computers (UMPCs), handheld computers, netbooks, personal digital assistants (PDAs), wearable electronic devices, in-vehicle devices, virtual reality devices, etc. The embodiments of the present application do not impose any restrictions on this. For example, in addition to being traditional audio output devices such as Bluetooth headsets and wired earphones, the audio output device C can also be a smart electronic device installed with an operating system (such as the Android system), such as a mobile phone, a TV, a speaker, or an in-vehicle device. After receiving the audio data sent by the slave device A, the master device B can perform processing such as sampling, mixing, fusing, or adding sound effects to the audio data through its operating system.

[0098] It should be noted that in the embodiments of the present application, which of the master device B and the slave device A is the audio generation master device and which is the audio generation slave device is determined according to the priority of the service of the audio data being played currently. Exemplarily, at a certain moment, the mobile phone is playing music and the smartwatch is playing sports data. If the preset priority is that the audio service is greater than the health service, then the audio master device is the mobile phone and the smartwatch is the audio slave device. In other words, in other scenarios, when the mobile phone is playing sports data and the smartwatch is playing music, if the preset priority is that the audio service is greater than the health service, the mobile phone can be determined as the slave device and the smartwatch as the master device. The embodiments of the present application do not make specific limitations on which specific devices the master device and the slave device are.

[0099] In some possible implementation manners, Figure 4 shows a schematic diagram of the modules of each electronic device in the audio system, as Figure 4 shown, the smart phone 101 includes an audio playback device and a mobile phone audio management component, the smartwatch 102 includes an audio playback device and a smartwatch audio management component, and the smart earphone 103 includes an audio playback device and an earphone audio management component. Among them, the mobile phone audio management component is used to obtain audio data from the audio playback device of the mobile phone and determine the service corresponding to the audio data, and the smartwatch audio management component is used to obtain audio data from the audio playback device of the smartwatch and determine the service corresponding to the audio data. The mobile phone audio management component is further used to perform signaling negotiation with the smartwatch audio management component to determine the audio generation master device and the audio generation slave device from the mobile phone 101 or the smartwatch 102. Alternatively, the smartwatch audio management component is used to perform signaling negotiation with the mobile phone audio management component to determine the audio generation master device and the audio generation slave device from the mobile phone 101 or the smartwatch 102. When the mobile phone is the audio generation master device, the smartwatch audio management component is further used to send the audio data stream to the mobile phone audio management component, and the mobile phone audio management component fuses the received audio data stream with its own audio data. Then, the mobile phone audio management component sends the fused audio data to the earphone audio management component of the earphone 103, and finally uses the audio playback device of the earphone to play the fused audio data.

[0100] Combined with Figure 2 and Figure 4, the master device B includes an audio management component B1, the slave device A includes an audio management component A1, and the audio output device includes an audio management component C1. The audio management component A1 can obtain the audio data stream of the slave device A and determine the service corresponding to the audio data stream of the slave device A. The audio management component B1 can obtain the audio data stream in the master device B and determine the service corresponding to the audio data stream of the master device B. The audio management component A1 or the audio management component B1 can perform a priority judgment based on their respective service types to determine the master device and the slave device. Exemplarily, when the master device is device B, then the audio management component B1 is further configured to fuse the audio data stream of the master device and the audio data stream of the slave device A. Finally, the fused audio data stream is sent to the audio management component C1 of device C.

[0101] The following specifically describes the scenarios applicable to the audio playback method provided by the embodiments of the present application. Figure 5 FIG. shows a schematic diagram of a scenario applicable to an audio playback method provided by an embodiment of the present application, as Figure 5 shown, the audio system includes multiple electronic devices, and each electronic device separately collects audio data. Exemplarily, when the multiple electronic devices respectively include a watch, a mobile phone, and a Bluetooth headset, the watch is starting a sports service. During the process of the user wearing the watch and exercising, the watch will perform sports announcements, heart rate reminders, etc., or the watch will announce other parameters related to sports; the mobile phone is playing audio, for example, the mobile phone is playing music, video, or voice courses, etc., or the mobile phone is playing other audio; the Bluetooth headset plays the audio of the mobile phone. If all of the above three devices meet the playback judgment conditions, then the multiple electronic devices use the audio playback method provided by the embodiments of the present application to jointly emit sound. If the above three devices do not meet the playback conditions, then the individual electronic devices emit sound separately.

[0102] It should be understood that the above scenarios are for illustrative purposes only and do not constitute a limitation on the scenarios applicable to the audio playback method provided by the present application.

[0103] For ease of understanding, the following specifically elaborates on the audio playback method provided by the embodiments of the present application in combination with the accompanying drawings and application scenarios.

[0104] Figure 6 FIG. shows a schematic flowchart of an audio playback method 600 provided by an embodiment of the present application. As Figure 6 shown, Figure 6 the method 600 shown in may include steps S610 to S640. The following combines Figure 6 to detail each step in method 600.

[0105] It should be understood that in the embodiments of the present application, taking each electronic device as the execution subject of method 600 as an example, method 600 is described. By way of example and not limitation, the execution subject of method 600 may also be a chip applied in each electronic device.

[0106] S610. The target device in the first electronic device and the second electronic device determines the master device and the slave device in the first electronic device and the second electronic device.

[0107] In the embodiments of the present application, when the first electronic device and the second electronic device respectively generate audio data, in order to send the audio data respectively generated by the first electronic device and the second electronic device to the audio output device by using the same electronic device, the audio generation master device and the audio generation slave device can be determined in the first electronic device and the second electronic device. The master device can send the audio data of the first electronic device and the audio data of the second electronic device to the audio output device, and the audio output device can play them uniformly based on the received audio data, so that the slave device itself does not emit sound.

[0108] It should be noted that the execution subject for determining the master device and the slave device in the first electronic device and the second electronic device is called the target device. The target device can be the first electronic device or the second electronic device. Of course, it can also be other processing devices. The embodiments of the present application do not make specific limitations on this.

[0109] Optionally, the device with the larger MAC address in the first electronic device and the second electronic device can determine the audio generation master device and the audio generation slave device in the first electronic device and the second electronic device.

[0110] In some embodiments, the first electronic device can detect that multiple services are running, and each service corresponds to an audio data. The second electronic device can detect the multiple services running, and each service corresponds to an audio data. The first electronic device or the second electronic device can determine the master device and the slave device in the first electronic device and the second electronic device based on the service with the highest priority among some or all of the services running in the first electronic device and the service with the highest priority among some or all of the services running in the second electronic device.

[0111] It should be understood that the part of the services running in the first electronic device refers to the part of the services that meet the preset service types. The preset service types can be telephone services, multimedia services, sports and health services, etc. Or, the part of the services can also refer to meeting the preset application list, and the preset application list includes telephone applications, multimedia applications, sports and health applications, etc.

[0112] Similarly, the part of the services that are running on the second electronic device can also refer to that part of the services meeting a preset service type, which can be a telephone service, a multimedia service, a sports and health service, etc. Alternatively, the part of the services can also refer to meeting a preset application list, which includes telephone applications, multimedia applications, sports and health applications, etc.

[0113] It should also be understood that the first electronic device and the second electronic device can obtain the attributes of the services that are running, and determine whether the services that are running meet the preset service type or the preset application list based on the attributes of the services that are running.

[0114] In some possible implementation manners, when the services that are running on the first electronic device change, or the services that are running on the second electronic device change, the first electronic device and the second electronic device need to re-obtain the attributes of the services that are running, and determine whether the services that are running meet the preset service type or the preset application list based on the attributes of the services that are running. Thus, the first electronic device determines the first service based on the latest running service, the second electronic device determines the second service based on the latest running service, and finally the first electronic device or the second electronic device re-determines the service priority based on the first service and the second service.

[0115] Exemplarily, when the first electronic device is a mobile phone, music is being played in the foreground of the mobile phone, and a health service is running in the background of the mobile phone. When the second electronic device is a smart watch, the smart watch is running a health service. Then, the service with the highest priority among the services that are running on the first electronic device is audio, that is, the priorities of the audio service and the health service of the smart watch are judged. When the priority of the audio service is higher than the priority of the health service, the mobile phone is the master device and the watch is the slave device.

[0116] It should be understood that the mobile phone and the watch can simultaneously establish a connection with an audio output device (for example, headphones), but the audio data channel of the headphones can only be connected to the mobile phone or the watch. When the mobile phone is the master device, the mobile phone can send a data stream switching command to the headphones, and the headphones switch the channel for receiving the audio stream to the mobile phone. The watch sends the audio data to the mobile phone, and the mobile phone plays the audio data of the mobile phone and the audio data of the headphones through the headphones.

[0117] In some other embodiments, the target device in the first electronic device or the second electronic device can obtain the service type of the service with the highest priority among the services that are running in the target device, and receive from the other electronic device the service type of the service with the highest priority among the services that are running in the other electronic device. Thus, the target device can determine the master device and the slave device between the first electronic device and the second electronic device.

[0118] Exemplarily, when the target device is a first electronic device (e.g., a mobile phone) and the other device is a second electronic device (e.g., a watch), the mobile phone can obtain the service type of the service with the highest priority among the services currently running on the device (e.g., an audio service), and receive from the watch the service type of the service with the highest priority among the services currently running on the watch (e.g., a health service). Thus, the mobile phone can determine that the mobile phone is the master device and the watch is the slave device based on the audio service and the health service.

[0119] In some embodiments of the present application, the services of the audio data generated by the first electronic device and the second electronic device mainly include telephone services, multimedia services, and sports health services. Among them, the multimedia services may include audio services and video services, and the sports health services may include sports services and health services.

[0120] Optionally, the telephone service has a higher priority than the multimedia service, and / or the multimedia service has a higher priority than the sports health service, and / or the telephone service has a higher priority than the sports health service. Among them, when the multimedia service includes an audio service and a video service, the priority of the audio service may be greater than the priority of the video service, and when the sports health service includes a sports service and a health service, the priority of the sports service may be greater than the priority of the health service.

[0121] In some other embodiments, the first electronic device includes a first audio management component, the second electronic device includes a second audio management component, and the first audio management component and the second audio management component are connected through a distributed transmission capability. The first audio management component can obtain the first audio data of the first electronic device and determine the service type corresponding to the first audio data, and then send the service type corresponding to the first audio to the second audio management component. The second audio management component determines the service type corresponding to the second audio data stream based on the second audio data stream, and judges the priority of the service type corresponding to the first audio data stream and the service type corresponding to the second audio data stream, and determines the master device and the slave device in the first electronic device and the second electronic device according to the priority of the service type corresponding to the first audio data and the service type corresponding to the second audio data.

[0122] S620. The target device sends the determination result to the other device in the first electronic device and the second electronic device.

[0123] In step S620, in order for the first electronic device and the second electronic device to obtain the determination result of whether their respective devices are the master device or the slave device, the target device in the first electronic device and the second electronic device needs to send the determination result to the other device in the first electronic device and the second electronic device.

[0124] It should be understood that the determination result sent by the target device to the other device among the first electronic device and the second electronic device may mean that the target device tells the other device that the other device is the master device or the other device is the slave device. Exemplarily, when the target device is the first electronic device and the other device is the second electronic device, the first electronic device sends the determination result that the second electronic device is the master device to the second electronic device, or the first electronic device sends the determination result that the second electronic device is the slave device to the second electronic device, so that the second electronic device knows that its own device is the master device or the slave device. When the second electronic device knows that its own device is the master device, the first electronic device is the slave device, or when the second electronic device knows that its own device is the slave device, the first electronic device is the master device.

[0125] Alternatively, the determination result sent by the target device to the other device among the first electronic device and the second electronic device may also mean that the target device tells the other device that the target device is the master device and the other device is the slave device, or tells the other device that the target device is the slave device and the other device is the master device. Exemplarily, when the target device is the first electronic device and the other device is the second electronic device, the first electronic device sends the determination result that the first electronic device is the master device and the second electronic device is the slave device to the second electronic device, or the first electronic device sends the determination result that the first electronic device is the slave device and the second electronic device is the master device to the second electronic device, so that the second electronic device knows that its own device is the master device or the slave device, and whether the target device is the master device or the slave device.

[0126] S630. The slave device sends the audio data of the slave device to the master device.

[0127] Generally, the slave device will send the audio data to be played to the audio management component of the slave device for audio playback. However, in the embodiments of the present application, in order to enable the user to play audio on a unified electronic device, after the first electronic device or the second electronic device determines the master device and the slave device among the first electronic device and the second electronic device. The slave device needs to send the audio data of the slave device to the master device, and the master device sends it to the audio output device uniformly.

[0128] In other words, after the slave device sends the audio data of the slave device to the master device, the slave device itself does not make a sound.

[0129] In a possible implementation manner, the first application on the slave device can detect the audio data stream to be played.

[0130] Exemplarily, when the slave device is a watch, the sports and health application installed on the watch can detect the audio data stream to be played. Then, the first application sends the detected audio data stream to be played to the second audio management component on the slave device, and the second audio management component sends the audio data stream to be played to the audio management component of the master device.

[0131] S640. The master device sends the audio data of the master device and the audio data of the slave device to the audio output device for playing.

[0132] In the embodiment of the present application, after receiving the audio data of the slave device, the master device can send its own audio data and the audio data of the slave device to the audio output device, and the audio output device plays the audio data of the master device and the audio data of the slave device uniformly.

[0133] In some embodiments, the master device sends its own audio data and the audio data of the slave device to the audio output device respectively on the audio channel of the master device, and the audio output device plays the audio data of the master device and the audio data of the slave device.

[0134] Optionally, when the master device sends the audio data of the master device and the audio data of the slave device to the audio data device respectively, the audio data of the master device can be played before the audio data of the slave device.

[0135] Exemplarily, when the service corresponding to the audio data of the master device is a business call service and the service corresponding to the audio data of the slave device is a health service, after the master device ends the call service, it plays the data of the health service sent by the slave device through the Bluetooth headset, so that the user is not disturbed during the call, and after the user's call, it can ensure that the multimedia data is received in time, thus improving the user experience.

[0136] In some other embodiments, the master device fuses its own audio data and the audio data of the slave device and then sends the fused audio data to the audio output device, and the audio output device plays the fused audio data.

[0137] Optionally, the process of the master device fusing the audio data of the master device and the audio data of the slave device according to the determination result may include performing a mixing process on the audio data of the master device and the audio data of the slave device. Of course, the process of audio data fusion may also include other processing methods, and the embodiments of the present application do not make specific limitations on this.

[0138] In some possible implementation manners, the master device performing a mixing process on the audio data of the master device and the audio data of the slave device includes reducing the volume of the audio data of the master device during the time period when the audio data of the master device and the audio data of the slave device are played simultaneously. Thus, while the master device does not interrupt the audio data of the master device, the user can still hear the audio data of the slave device.

[0139] Optionally, one implementation for the master device to reduce the volume of its audio data is that the master device reduces the volume of its audio data to a certain volume value. For example, the master device can reduce the volume of its audio data from the original 20 decibels to 5 decibels.

[0140] Optionally, in another implementation for the master device to reduce the volume of its audio data: the master device reduces the volume of its audio data by a certain volume value. For example, the master device can reduce the original 20 decibels by 10 decibels.

[0141] Optionally, in yet another implementation for the master device to reduce the volume of its audio data: the master device reduces the volume of its audio data to be lower than the volume of the slave device's audio data. For example, if the volume of the slave device's audio data is 10 decibels, the master device can reduce the volume of its audio data to below 10 decibels.

[0142] S650. The audio output device plays the audio data of the master device and the slave device.

[0143] It can be understood that after the master device sends the audio data of the master device and the slave device to the audio output device, the audio output device plays the audio data generated by multiple audio generating devices uniformly.

[0144] In a possible implementation, the audio output device plays the audio of the master device by reducing the current volume of the master device's audio, and plays the audio of the slave device by increasing the volume of the slave device's audio, so as to ensure that the original audio data of the master device and the audio data to be played of the slave device can be played together, and when the user listens to the audio data of the slave device, they will not be interfered by the audio data of the master device, thereby improving the user experience.

[0145] In another possible implementation, the audio output device plays the audio data of the slave device after finishing the audio data of the current master device, so that the user is not interfered during the call, and after the user's call, it can ensure that multimedia data is received in time, thereby improving the user experience.

[0146] In method 600, the first electronic device or the second electronic device determines an audio playback master device and an audio playback slave device among the first electronic device and the second electronic device. The audio playback slave device sends the audio data stream to be played to the audio playback master device. After receiving the audio data stream to be played, the audio playback master device fuses the audio data being played by the master device and the audio data stream to be played to obtain a fused audio data stream. The master device sends the fused audio data stream to the audio output device, and the fused audio data stream is played using the audio output device. This method avoids the problem that multiple terminal devices play sounds separately, resulting in an inability to form a unified playback experience, and further improves the user experience.

[0147] It should be understood that Figure 6 taking the first electronic device as the target device, determining an audio generation master device and an audio generation slave device among the first electronic device and the second electronic device, and the first electronic device being the master device for audio fusion as an example for illustration. Of course, the second electronic device can also be used as the target device, determine an audio generation master device and an audio generation slave device among the first electronic device and the second electronic device, and the second electronic device can also be the master device for audio fusion. The embodiments of the present application will not give specific examples for illustration.

[0148] The above combination Figures 1-6 describes the embodiments of the audio playback method provided by the embodiments of the present application. Next, the electronic device provided by the embodiments of the present application will be described. The electronic device can be the audio generation device (the first electronic device, the second electronic device) in the above embodiments, or the audio output device. The embodiments of the present application do not make specific limitations on this.

[0149] Exemplarily, Figure 7FIG. 0 shows a schematic diagram of the structure of an electronic device 100 provided in this application. 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 interface 170D, a sensor module 180, a button 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 acceleration sensor 180E, a distance sensor 180F, a proximity light 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.

[0150] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.

[0151] In the embodiment of this application, the processor 110 may determine the audio playback master device and the audio playback slave device based on the audio data. When the electronic device is the audio playback master device, the processor 110 is further configured to perform a fusion process on the audio streams of the audio playback master device and the audio playback slave device.

[0152] Among them, the controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0153] A memory can also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can hold the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can directly call it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0154] Among them, the memory is used to store the application program code for implementing the solution of this application, and is controlled by the processor 110 to execute. The processor 110 is used to execute the application program code stored in the memory to control the electronic device 100 to implement the audio playback method provided in the embodiments of this application.

[0155] In some embodiments, the processor 110 may include one or more interfaces. The 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.

[0156] It can be understood that the interface connection relationships between the modules illustrated in the embodiments of this application are only 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 adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0157] The charging management module 140 is used to receive a charging input from a charger. The charger can be a wireless charger or a wired charger. In some embodiments of wired charging, the charging management module 140 can receive the charging input of the wired charger through the USB interface 130. In some embodiments of wireless charging, the charging management module 140 can receive the wireless charging input through the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device through the power management module 141.

[0158] The wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, and the baseband processor, etc.

[0159] The electronic device 100 implements the display function through the GPU, the display screen 194, and the application processor, etc. 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 for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change the display information.

[0160] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), and a low temperature polycrystalline oxide (LTPO), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0161] The electronic device 100 can implement the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor, etc.

[0162] The external memory interface 120 can be used to connect to an external memory card, such as a Micro SD card, to implement the storage capacity expansion of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. For example, files such as music and videos are saved in the external memory card.

[0163] The internal memory 121 can be used to store computer-executable program code, and the executable program code includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.). The data storage area can store data created during the use of the electronic device 100 (such as audio data, phone book, etc.). In addition, the internal memory 121 can include high-speed random access memory, and can also include non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0164] The electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor, etc. For example, music playback, recording, etc.

[0165] The touch sensor 180K, also known as the "touch panel". The touch sensor 180K can be disposed on the display screen 194, and the touch screen, also known as the "touch screen", is composed of the touch sensor 180K and the display screen 194. The touch sensor 180K is used to detect touch operations acting thereon or nearby. 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 the display screen 194. In some other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, at a different position from the display screen 194.

[0166] The keys 190 include a power-on key, a volume key, etc. The motor 191 can generate a vibration prompt. The indicator 192 can be an indicator light, which can be used to indicate the charging state, the change in battery power, and can also be used to indicate messages, missed calls, notifications, etc. The SIM card interface 195 is used to connect to the SIM card.

[0167] The hardware system of the electronic device 100 has been described in detail above. Next, the software system of the electronic device will be introduced. In the embodiments of the present invention, the Android system is used to exemplarily illustrate the software architecture of the electronic device 100. Of course, the above-mentioned electronic device 100 can also adopt other software architectures, such as the Harmony system, etc.

[0168] Figure 8 FIG. shows a schematic diagram of the software system of the electronic device 100 according to an embodiment of the present application, as Figure 8 shown, the system architecture may include an application layer (application, APP) 210, an application framework layer 220, a hardware abstraction layer (hardware abstract layer, HAL) 230, a driver layer 240, and a hardware layer 250.

[0169] As Figure 8 shown, in the application layer, applications such as calls, memos, browsers, contacts, cameras, galleries, calendars, maps, Bluetooth, music, videos, and text messages can be installed.

[0170] It should be noted that these applications installed in the application layer can have audio functions. For example, the music APP can play audio, and the camera APP can output the system-predefined shutter sound when taking pictures. Another example is that the video APP can output the audio corresponding to the video picture while playing the video. Another example is that the map APP can output navigation voices after the navigation function is turned on. In the embodiments of the present application, applications with audio functions can be referred to as audio APPs.

[0171] The application framework layer 220 can provide application programming interfaces (application programming interface, API) and programming frameworks for the applications in the application layer 210; the application framework layer can include some predefined functions.

[0172] As Figure 8 shown, taking the music APP as an example of the audio APP, there is an audio architecture 601 in the Android system for implementing the audio function of the audio APP. In the application framework layer, the above-mentioned audio architecture 601 may include an AudioManager, an audio player, and an audio processor.

[0173] Exemplarily, the audio player can be a player such as AudioTrack or MediaPlayer. The audio processor can be a processor such as AudioFlinger. When the audio APP needs to play audio, it can call the audio player and input corresponding audio data to the audio player. For example, the audio APP can input the original audio data to the audio player. After the audio player processes the original audio data, such as parsing, decompressing, or decoding, it obtains frames of PCM (pulse code modulation) data. Or, the audio APP can also directly output PCM data to the audio player. Furthermore, the audio player can send the audio data to the audio processor for audio processing.

[0174] Specifically, the audio processor can perform audio processing on the audio data according to the audio playback policy output by the audio manager. Exemplarily, the audio manager can include an Audio Service and an AudioPolicy module. When the audio APP is running, it can call the Audio Service to notify the AudioPolicy module to set the specific audio playback policy when inputting and outputting audio data.

[0175] For example, the adjustment of the volume size, that is, the master device reduces its own audio volume by a certain proportion, then fuses the obtained audio of the slave device. When the audio stream of the slave device ends, the volume of the audio stream of the master device is restored to normal. This audio playback policy can also include the sampling rate of the audio data, sound effect settings, mixing settings, etc.

[0176] Still as Figure 8 shown, between the application framework layer and the kernel layer of the Android system, there can also be a HAL (hardware abstraction layer). The HAL is responsible for interacting with each hardware device of the mobile phone. On the one hand, the HAL hides the implementation details of each hardware device, and on the other hand, it can provide an interface for the Android system to call each hardware device. The HAL provides HALs corresponding to different mobile phone hardware devices, such as Audio HAL, Camera HAL, Wi-Fi HAL, etc.

[0177] Exemplarily, according to different audio output devices, the Audio HAL can be further divided into Primary HAL, A2dp HAL, etc. AudioFlinger can call the Primary HAL to output audio data to the speaker of the mobile phone, or AudioFlinger can call the A2dp HAL to output audio data to the Bluetooth headset connected to the mobile phone. Taking the A2dp HAL as an example, when the mobile phone is powered on, the Bluetooth APP (also known as the Bluetooth service) in the application layer can create the A2dp HAL in the HAL. At this time, the A2dp HAL can run in the form of an empty process, and the A2dp HAL is not yet connected to a specific Bluetooth device. When the mobile phone is connected to a certain Bluetooth device (such as Figure 2 the intelligent headset in the audio system shown), the Bluetooth APP can register information such as the identification and Bluetooth address of the Bluetooth headset in the audio manager, and send the relevant hardware parameters of the Bluetooth headset (such as the sampling rate of the Bluetooth headset) to the A2dp HAL, so that the A2dp HAL can support data transceiver with the Bluetooth headset. At this time, the A2dp HAL remains unchanged during the process of the mobile phone maintaining a connection with the Bluetooth headset. When the mobile phone is disconnected from the Bluetooth headset, the Bluetooth APP can clear the relevant information of the first Bluetooth headset in the audio manager and restore the A2dp HAL to run as an empty process in the HAL.

[0178] In addition, the application framework layer may further include a window manager, a content provider, a view system, a resource manager, a notification manager, etc., and the embodiments of the present application do not impose any restrictions thereon.

[0179] For example, the above window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc. The above content provider is used to store and obtain data, and make this data accessible to application programs. The data may include videos, images, audio, dialed and received calls, browsing history and bookmarks, phone books, etc. The above view system can be used to construct the display interface of an application program. Each display interface can be composed of one or more controls. Generally speaking, controls may include interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. The above resource manager provides various resources for application programs, such as localized strings, icons, pictures, layout files, video files, and so on. The above notification manager enables application programs to display notification information in the status bar, can be used to convey notification-type messages, can automatically disappear after a short stay without user interaction. For example, the notification manager is used to inform that the download is completed, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as the notification of a background-running application program, and can also be a notification that appears on the screen in the form of a dialogue window. For example, prompt text information in the status bar, emit a prompt sound, vibrate, the indicator light flashes, etc.

[0180] As Figure 8 shown, the Android runtime includes a core library and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.

[0181] The core library contains two parts: one part is the functional functions that need to be called by the Java language, and the other part is the core library of Android.

[0182] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as the management of object life cycles, stack management, thread management, security and exception management, and garbage collection.

[0183] The system library can include multiple functional modules. For example: surface manager, Media Libraries, 3D graphics processing library (e.g., OpenGL ES), 2D graphics engine (e.g., SGL), etc.

[0184] Among them, the surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications. The media library supports the playback and recording of multiple common audio and video formats, as well as static image files, etc. The media library can support multiple audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc. The 2D graphics engine is the drawing engine for 2D drawing.

[0185] The kernel layer is located below the HAL and is the layer between hardware and software. The kernel layer at least includes a display driver, a camera driver, an audio driver, a sensor driver, etc., and the embodiments of the present application do not make any restrictions on this. It can be understood that the structure schematically shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure can be implemented in hardware, software, or a combination of software and hardware.

[0186] The above has introduced in detail the examples of the photographing method provided by the present application. It can be understood that in order for the electronic device to implement the above functions, it includes the corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should easily realize that, combined with the units and algorithm steps of each example described in the embodiments disclosed in this article, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0187] The present application can divide the photographing method into functional units according to the above method examples. For example, each function can be divided into each functional unit, or two or more functions can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. It should be noted that the division of units in the present application is schematic, only a logical function division, and there may be other division methods in actual implementation.

[0188] Figure 9 The structure diagram of an electronic device provided by the present application is shown. Figure 9The dashed line therein indicates that the unit or module is optional. The electronic device 900 can be used to implement the methods described in the above method embodiments. The electronic device 900 can be a terminal device or a server, or a module applied to a terminal device or a server (such as a processor, a chip, or a chip system, etc.), or a logical node, a logical module, or software that can implement all or part of the terminal functions, or a logical node, a logical module, or software that can implement all or part of the server functions.

[0189] The electronic device 900 includes one or more processors 901, and the one or more processors 901 can support the electronic device 900 to implement Figure 6 the methods in the corresponding method embodiments. The processor 901 can be a general-purpose processor or a dedicated processor. For example, the processor 1701 can be a Central Processing Unit (CPU). The CPU can be used to control the electronic device 900, execute software programs, and process the data of software programs. The electronic device 900 can also include a communication unit 905 for implementing signal input (reception) and output (transmission).

[0190] The above electronic device 900 can be a chip (system), and the chip (system) includes a memory and a processor, wherein the processor is configured to execute a computer program stored in the memory to implement the methods shown in the above respective embodiments.

[0191] The communication unit 905 can be the input and / or output circuit of the chip (system), or the communication unit 905 can be the communication interface of the chip (system), and the chip (system) can be a component of the electronic device 900.

[0192] For another example, the communication unit 905 can be the transceiver of the electronic device 900, or the communication unit 905 can be the transceiver circuit of the electronic device 900.

[0193] The electronic device 900 can include one or more memories 902, on which there is a program 904. The program 904 can be run by the processor 901 to generate an instruction 903, so that the processor 901 executes the methods described in the above method embodiments according to the instruction 903. Optionally, data can also be stored in the memory 1702. Optionally, the processor 901 can also read the data stored in the memory 902. The data can be stored at the same storage address as the program 1704, or the data can be stored at a different storage address from the program 904.

[0194] The processor 901 and the memory 902 can be set separately or integrated together. For example, they can be integrated on a System On Chip (SOC) of the electronic device.

[0195] The specific manner in which the processor 901 executes the audio playback method can be referred to the relevant descriptions in the method embodiments.

[0196] It should be understood that each step of the above method embodiments can be completed by the logic circuit in the form of hardware or the instructions in the form of software in the processor 901. The processor 901 can be a CPU, a digital signal processor (DSP), a field programmable gate array (FPGA), or other programmable logic devices. For example, discrete gates, transistor logic devices, or discrete hardware components.

[0197] The present application also provides a computer program product, which implements the method of any method embodiment in the present application when executed by the processor 901.

[0198] This computer program product can be stored in the memory 902, for example, it is the program 904. After processes such as preprocessing, compilation, assembly, and linking, the program 904 is finally converted into an executable target file that can be executed by the processor 901.

[0199] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by the computer, it implements the method of any method embodiment in the present application. This computer program can be a high-level language program or an executable target program.

[0200] The computer-readable storage medium is, for example, the memory 902. The memory 902 can be a volatile memory or a non-volatile memory, or the memory 902 can include both a volatile memory and a non-volatile memory. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and direct rambus RAM (DRRAM).

[0201] Those skilled in the art can clearly understand that, for the convenience and conciseness of description, the specific working processes and the resulting technical effects of the above-described devices and apparatuses can refer to the corresponding processes and technical effects in the foregoing method embodiments, and will not be elaborated herein again.

[0202] In several embodiments provided in the present application, the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, some features of the above-described method embodiments can be ignored or not executed. The above-described apparatus embodiments are merely illustrative. The splitting of units is only a logical function splitting, and there can be other splitting methods in actual implementation. Multiple units or components can be combined or integrated into another system. In addition, the coupling between units or the coupling between each component can be a direct coupling or an indirect coupling. The above coupling includes electrical, mechanical, or other forms of connection.

[0203] The above embodiments are only used to illustrate the technical solutions of the present application, rather than limiting them. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features, and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

[0204] Finally, as described above, the above are only the specific implementation manners of the present application, but the protection scope of the present application is not limited thereto. Any changes or replacements within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. An audio playing method, characterized in that, The method is applied to an audio playback system, which includes: a first electronic device and a second electronic device. The first electronic device and the second electronic device are audio generating devices. The method includes: A target device among the first electronic device and the second electronic device determines a master device and a slave device among the first electronic device and the second electronic device; The target device sends the determination result to the other device among the first electronic device and the second electronic device; The slave device sends the audio data of the slave device to the master device; The master device sends the audio data of the master device and the audio data of the slave device to an audio output device for playback.

2. The method according to claim 1, wherein The master device sending the audio data of the master device and the audio data of the slave device to an audio output device for playback includes: The master device fuses the audio data of the master device and the audio data of the slave device to obtain fused audio data; The master device sends the fused audio data to an audio output device for playback.

3. The method according to claim 1 or 2, characterized in that, A target device among the first electronic device and the second electronic device determining a master device and a slave device among the first electronic device and the second electronic device includes: Determining the master device and the slave device according to the priority of the service type of the first service of the first electronic device and the service type of the second service of the second electronic device. The first service is the service with the highest priority among some or all of the services running in the first electronic device, and the second service is the service with the highest priority among some or all of the services running in the second electronic device. The master device is the device corresponding to the service type with the highest priority among the service type of the first service and the service type of the second service.

4. The method according to any one of claims 1-3, characterized in that, The method further includes: The target device obtains the service type of the service with the highest priority among the services running in the target device, and receives from the other device the service type of the service with the highest priority among the services running in the other device.

5. The method according to claim 3 or 4, characterized in that, The priority of the service types includes: the telephone service has a higher priority than the multimedia service, and / or the multimedia service has a higher priority than the sports and health service, and / or the telephone service has a higher priority than the sports and health service.

6. The method according to any one of claims 2-5, characterized in that, The master device fusing the audio data of the master device and the audio data of the slave device to obtain fused audio data includes: During the period when the audio data of the master device and the audio data of the slave device are played simultaneously, the master device reduces the volume of the audio data of the master device.

7. The method according to claim 6, characterized in that, The volume of the reduced audio data of the master device is less than the volume of the audio data of the slave device.

8. The method according to claim 1, wherein, The audio data of the master device is sent before the audio data of the slave device.

9. An audio playback system, characterized in that, The audio playback system includes: a first electronic device and a second electronic device, where the first electronic device and the second electronic device are audio generating devices. The first electronic device is configured to execute the method executed by the first electronic device according to any one of claims 1-8, and the second electronic device is configured to execute the method executed by the second electronic device according to any one of claims 1-8.

10. An audio playback method, characterized in that, The method is applied to a first electronic device, and the method includes: The first electronic device obtains a determination result, where the determination result is used to indicate that the first electronic device is the master device and the second electronic device is the slave device among the first electronic device and the second electronic device; The master device receives audio data sent by the slave device; The master device sends the audio data of the master device and the audio data of the slave device to an audio output device for playback.

11. The method according to claim 10, wherein The first electronic device obtaining a determination result includes: The first electronic device determines that the first electronic device is the master device and the second electronic device is the slave device among the first electronic device and the second electronic device, or the first electronic device obtains the determination result sent by the second electronic device.

12. The method according to claim 10 or 11, characterized in that, The master device sending the audio data of the master device and the audio data of the slave device to an audio output device for playback includes: The master device fuses the audio data of the master device and the audio data of the slave device to obtain fused audio data; The master device sends the fused audio data to an audio output device for playback.

13. The method according to claim 11 or 12, characterized in that, The first electronic device determining that the first electronic device is the master device and the second electronic device is the slave device among the first electronic device and the second electronic device includes: The first electronic device determines the master device and the slave device according to the priority of the service type of the first service of the first electronic device and the service type of the second service of the second electronic device. The first service is the service with the highest priority among some or all of the services running in the first electronic device, and the second service is the service with the highest priority among some or all of the services running in the second electronic device. The master device is the device with the highest service priority among the service types of the first service and the service type of the second service.

14. The method according to claim 13, wherein, The method further includes: The first electronic device obtains the service type of the service with the highest priority among the services running in the first electronic device, and receives from the second electronic device the service type of the service with the highest priority among the services running in the second electronic device.

15. The method according to claim 13 or 14, characterized in that, The service priorities are, in descending order: the telephone service is higher than the multimedia service, and / or the multimedia service is higher than the sports and health service, and / or, the telephone service is higher than the sports and health service.

16. The method according to any one of claims 12-14, characterized in that, The master device fusing the audio data of the master device and the audio data of the slave device to obtain fused audio data includes: During the period when the audio data of the master device and the audio data of the slave device are played simultaneously, the volume of the audio data of the master device is reduced.

17. The method according to claim 16, wherein The volume of the audio data of the master device after reduction is less than the volume of the audio data of the slave device.

18. The method according to claim 10, characterized in that, The audio data of the master device is sent before the audio data of the slave device.

19. An electronic device, characterized in that, The electronic device includes: a memory and a processor, the memory is used for storing a computer program; the processor is used for executing the method according to any one of claims 10-18 when calling the computer program.

20. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method according to any one of claims 1-8, or implements the method according to any one of claims 10-18.

21. A computer program product, characterized in that, When the computer program product runs on an electronic device, it causes the electronic device to execute the method according to any one of claims 1-8, or is used for executing the method according to any one of claims 10-18.