Audio playback method, device, electronic device, computer readable medium and product

By obtaining the audio to be played in the electronic device and determining the target audio, ensuring that the speaker and the audio playback device play at the same time, the problem of the speaker stopping playback after connecting the audio playback device is solved, improving the user experience.

CN113885827BActive Publication Date: 2024-12-03GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111177786.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-09
Publication Date
2024-12-03
Estimated Expiration
2041-10-09

AI Technical Summary

Technical Problem

When the electronic device is connected to the audio playback device, the speaker stops playing audio, which cannot meet the user's needs. Switching the device during audio playback causes the playback operation to be paused or interrupted, resulting in poor user experience.

Method used

By obtaining the audio to be played and determining the first target audio sent to the speaker and the second target audio sent to the audio playback device based on the audio type, ensure that the speaker and the audio playback device play the audio simultaneously, avoiding the speaker stopping playback when connecting the audio playback device. .

Benefits of technology

It realizes that when the electronic device is connected to the audio playback device, the speaker and the audio playback device can play audio, improving the user experience and avoiding the problem of pause or interruption of playback.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113885827B_ABST
    Figure CN113885827B_ABST
Patent Text Reader

Abstract

The present application discloses an audio playback method, device, electronic device, computer-readable medium and product, which relate to the field of mobile terminal technology. In response to connecting to an audio playback device, the audio to be played is obtained; based on the audio to be played, a first target audio to be sent to the speaker and a second target audio to be sent to the audio playback device are determined; the first target audio is sent to the speaker, and the second target audio is sent to the audio playback device, so that when the speaker plays the first target audio, the audio playback device plays the second target audio. Therefore, when the electronic device is connected to the audio playback device, the speaker and the audio playback device of the electronic device can both play audio, which can avoid the speaker stopping audio playback due to the connection of the electronic device to the audio playback device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of mobile terminal technology, and more specifically, to an audio playback method, device, electronic device, computer-readable medium and product. Background Art

[0002] As multi-channel Bluetooth audio transmission technology matures, the number of Bluetooth audio devices (wireless devices) that mobile terminals can connect to at the same time is also increasing. Multiple Bluetooth audio devices form a speaker system, which expands the use scenarios of mobile audio and improves the spatial audio effect. More and more attention is being paid to the technology. At present, after a mobile phone is connected to a Bluetooth audio device (such as a Bluetooth speaker), the sound is only played through the speaker, and the mobile phone's external speaker no longer works, which cannot meet user needs. Summary of the invention

[0003] The present application proposes an audio playback method, device, electronic device, computer-readable medium and product to improve the above-mentioned defects.

[0004] In a first aspect, an embodiment of the present application provides an audio playback method, which is applied to an electronic device, wherein the electronic device includes a speaker, and the method includes: in response to connecting to an audio playback device, obtaining audio to be played; based on the audio to be played, determining a first target audio to be sent to the speaker and a second target audio to be sent to the audio playback device; sending the first target audio to the speaker and sending the second target audio to the audio playback device, so that when the speaker plays the first target audio, the audio playback device plays the second target audio.

[0005] In a second aspect, an embodiment of the present application further provides an audio playback device, which is applied to an electronic device, wherein the electronic device includes a speaker, and the audio playback device includes: an acquisition unit, a determination unit, and a sending unit. The acquisition unit is used to acquire the audio to be played in response to being connected to the audio playback device. The determination unit is used to determine, based on the audio to be played, a first target audio to be sent to the speaker and a second target audio to be sent to the audio playback device. The sending unit is used to send the first target audio to the speaker and the second target audio to the audio playback device, so that when the speaker plays the first target audio, the audio playback device plays the second target audio.

[0006] In a third aspect, an embodiment of the present application also provides an electronic device, comprising: one or more processors; a memory; a speaker; and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the above method.

[0007] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the readable storage medium stores a program code executable by a processor, and when the program code is executed by the processor, the processor executes the above method.

[0008] In a fifth aspect, an embodiment of the present application further provides a computer product, which includes a program code executable by a processor, and when the program code is executed by the processor, the processor executes the above method.

[0009] The audio playback method, device, electronic device, computer-readable medium and product provided in the present application, in response to being connected to an audio playback device, obtain the audio to be played, the speaker and the peripheral audio playback device are used as the total playback device, and based on the audio to be played, the first target audio and the second target audio are determined; the first target audio is sent to the speaker, and the second target audio is sent to the audio playback device, so that when the speaker plays the first target audio, the audio playback device plays the second target audio. Therefore, when the electronic device is connected to the audio playback device, the speaker and the audio playback device of the electronic device can both play audio, which can avoid the speaker of the electronic device stopping audio playback due to the connection of the electronic device to the audio playback device.

[0010] Other features and advantages of the embodiments of the present application will be described in the subsequent description, and partly become apparent from the description, or can be understood by practicing the embodiments of the present application. The purposes and other advantages of the embodiments of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

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

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

[0014] Figure 3 A method flow chart of an audio playback method provided by an embodiment of the present application is shown;

[0015] Figure 4A schematic diagram of an audio playback interface provided by an embodiment of the present application is shown;

[0016] Figure 5 A method flow chart of an audio playback method provided by another embodiment of the present application is shown;

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

[0018] Figure 7 A schematic diagram of an audio playback system provided by yet another embodiment of the present application is shown;

[0019] Figure 8 A method flow chart of an audio playback method provided by another embodiment of the present application is shown;

[0020] Fig. 9 A schematic diagram showing the data flow of audio playback provided by an embodiment of the present application;

[0021] Fig.10 A schematic diagram showing the data flow of audio playback provided by another embodiment of the present application;

[0022] Fig.11 A schematic diagram showing the data flow of audio playback provided by another embodiment of the present application;

[0023] Fig.12 A module block diagram of an audio playback device provided by an embodiment of the present application is shown;

[0024] Fig.13 A structural block diagram of an electronic device provided by an embodiment of the present application is shown;

[0025] Fig.14 A schematic diagram of a computer-readable storage medium provided by an embodiment of the present application is shown;

[0026] Fig.15 A schematic diagram of a computer product provided by an embodiment of the present application is shown. DETAILED DESCRIPTION

[0027] In order to make those skilled in the art better understand the present application scheme, the technical scheme in the present application embodiment will be clearly and completely described below in conjunction with the drawings in the present application embodiment. Obviously, the described embodiment is only a part of the present application embodiment, rather than all the embodiments. The components of the present application embodiment usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the present application for protection, but merely represents the selected embodiment of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0028] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0029] As people's lives become more diverse, users have more and more electronic devices, and Bluetooth communication technology is also advancing rapidly. At present, in order to facilitate users' work and life, an electronic device can be connected to multiple other external devices via Bluetooth at the same time, so that users can control multiple devices to send data to the same device. Specifically, the electronic device can be a smart phone, tablet computer, e-book, wireless audio player, display, etc., which has a Bluetooth module inside and can establish a Bluetooth connection with other Bluetooth devices and exchange data. The wireless audio player can include a Bluetooth headset or a Bluetooth speaker, etc.

[0030] As multi-channel Bluetooth audio transmission technology becomes increasingly mature, the number of Bluetooth audio devices (wireless devices) that mobile terminals can connect to at the same time is also increasing. Multiple Bluetooth audio devices form a speaker system, which expands the use scenarios of mobile phone audio and improves the spatial audio effect. More and more attention is paid to the technology.

[0031] See also Figure 1 , Figure 1An audio playback system is shown, which includes an electronic device 100 and a speaker 200, wherein the smart phone, tablet computer, e-book reader and other electronic devices can run applications, and the speaker 200 is a device that can convert audio signals into sound, and its function is to convert audio electrical energy into corresponding sound energy and radiate it into space. The speaker 200 can be an independent speaker, for example, it can be an active or passive speaker, or it can be a car speaker, etc., which is not limited here. An application that can play audio is installed in the electronic device 100, specifically, the application can be audio playback software, video playback software or call software, etc. The electronic device 100 sends the audio to be played to the speaker 200, and the speaker 200 plays the voice.

[0032] Specifically, the electronic device may include a speaker 101. For example, a sound outlet is provided on the housing of the electronic device, and the speaker 101 is provided in the sound outlet. The sound emitted by the speaker 101 can be transmitted into the air through the sound outlet and heard by the user. Figure 1 The system shown includes two audio playing devices, namely a speaker and a sound box 200 .

[0033] In the case where an electronic device can be connected to multiple other external devices via Bluetooth at the same time, the electronic device 100 can be connected to multiple audio playback devices, such as Figure 2 As shown, Figure 2 The audio playback system shown includes an electronic device 100, a speaker 200, and a headset set, the headset set includes a first wireless headset 310 and a second wireless headset 320, the electronic device 100 can send audio data to the first wireless headset 310 and the second wireless headset 320, and the user listens to the audio data played by the first wireless headset 310 and the second wireless headset 320 by wearing the first wireless headset 310 and the second wireless headset 320. Figure 2 As shown, the electronic device 100 is connected to the first wireless headset 310 via Bluetooth, and then the first wireless headset 310 is connected to the second wireless headset 320 via Bluetooth, so that the electronic device 100, the first wireless headset 310 and the second wireless headset 320 are connected simultaneously through networking, that is, the first wireless headset 310 serves as a repeater for the electronic device 100 and the second wireless headset 320. In the embodiment of the present application, the electronic device 100, the first wireless headset 310 and the second wireless headset 320 can all be directly connected to the electronic device 100, or the first wireless headset 310 can serve as a master headset and the second wireless headset 320 can serve as a slave headset, which is not limited here.

[0034] The inventor has found in his research that, when the electronic device is connected to an external audio playback device, the audio data of the audio file currently played by the electronic device is played by the external audio playback device to which the electronic device is connected, and the speaker of the electronic device does not play the audio file. In addition, when the above-mentioned audio playback system plays audio, when the audio playback device is switched, the playback operation of the audio file currently requested to be played by the electronic device will be paused or interrupted, resulting in a poor user experience.

[0035] Therefore, in order to overcome the above-mentioned defects, the embodiments of the present application provide an audio playback method, device, electronic device, computer-readable medium and product. When the electronic device is connected to the audio playback device, the speaker of the electronic device and the audio playback device can both play audio, and the speaker of the electronic device can be prevented from stopping audio playback due to the connection of the electronic device to the audio playback device.

[0036] Specifically, see Figure 3 , Figure 3 An audio playback method provided in an embodiment of the present application is shown, which is applied to the above-mentioned electronic device, wherein the electronic device includes a speaker. The executor of the method is the electronic device, specifically, it can be a processor in the electronic device or a program module for user audio playback, for example, a multimedia module (Audio Manager), etc. The method includes: S301 to S303.

[0037] S301: In response to connecting with an audio playback device, obtaining audio to be played.

[0038] Specifically, when the electronic device is connected to at least one audio playback device, in response to the connection with the audio playback device, the audio to be played is obtained. The audio playback device refers to an audio playback device other than the speaker of the electronic device and has established a communication connection with the electronic device. In the embodiment of the present application, the type of the audio playback device is not limited, and it can be a speaker, a headset, a speaker of another electronic device, etc. The speaker can be an independent speaker or a car speaker, etc.

[0039] As an implementation mode, when the electronic device is connected to at least one audio playback device, the user can select the music to be played on the audio playback interface of the electronic device when the user desires to play the audio data. Figure 1In the audio playback interface shown, select an audio file and trigger the play button, so that the electronic device can determine that the selected audio file is the audio to be played. In some embodiments, there may be multiple audio files to be played, and the multiple audio files to be played come from different playback modules, which may be different modules within an application or from different applications. For example, an application has multiple playback modules, namely a video player and an audio player, then the audio data corresponding to the video file currently being played in the video player and the audio file currently being played by the audio player are both used as audio to be played, that is, when the application is playing audio, the audio player of the application is triggered to play audio, then the video and audio are both used as audio to be played. For another example, audio files requested to be played by two different applications are both used as audio to be played.

[0040] In other embodiments, the multiple audio files to be played are from the same playing module. Specifically, the multiple audio files to be played may be multiple audio files in a play list corresponding to the playing module, such as Figure 1 In the audio playing interface shown, the user can select multiple audio files to form an audio play list, and the audio files in the audio play list can all be used as the audio to be played, or the audio file currently being played can be used as the audio to be played.

[0041] As an implementation method, each audio to be played corresponds to a play request, and the current audio to be played can be determined by detecting the play request. Specifically, the play request can be a reminder message or a voice play request. Among them, the reminder message includes call reminder information, SMS reminder information, alarm reminder information, etc., which are used to remind the user that certain events have been triggered. For example, the call reminder information is used to remind the user that there is an incoming call.

[0042] As another implementation, the sounding request may be a request to play a voice each time during the sounding process of the electronic device, and the sounding request may be an audio sounding request, a video sounding request, or a call sounding request.

[0043] Specifically, if multiple audio playback software is installed in the electronic device, the software may be a music playback APP, a video playback APP, or a recording APP, etc. For example, a video playback interface is provided with a video playback button, and by detecting the touch of the video playback button, it is possible to determine whether the electronic device currently receives a request to play audio data. For example, the user selects a video, enters the video playback interface, and clicks the play button of the playback interface. The application program can detect what type of video the user currently clicks by monitoring the user's touch operation. Specifically, the play button is provided with preset attributes, and by detecting the attributes of the play button corresponding to the acquired touch operation, it is possible to determine the video to be played selected by the user, and then obtain the play request and the audio corresponding to the play request.

[0044] As an implementation mode, the audio duration of the audio to be played is greater than a specified value. Wherein, the specified value can be set according to actual needs. In an embodiment of the present application, the specified value can be set according to the system prompt sound of the electronic device. Wherein, the system prompt audio can be a key feedback sound, an operation confirmation sound, a warning message sound, etc. The duration of the system prompt sound is generally short, while the sound played by programs such as music, videos, and games generally lasts longer. Specifically, it can be to determine the duration of all system prompt sounds that can be output by the electronic device, and use the maximum duration as the specified value, or it can be to use the average value of each duration as the specified value. Therefore, when the electronic device obtains an audio playback request, it determines the audio file corresponding to the audio playback request. If the audio duration of the audio file is greater than the specified value, the audio file is determined as the audio to be played.

[0045] S302: Based on the audio to be played, determine a first target audio to be sent to the speaker and a second target audio to be sent to the audio playback device.

[0046] In some embodiments, the first target audio and the second target audio can be randomly selected from the audio to be played, or the first target audio and the second target audio can be determined based on the type of the audio to be played. Specifically, the first target audio is determined from a plurality of the audios to be played, and the audios other than the first target audio from the plurality of the audios to be played are used as alternative audios; the second target audio is determined from the alternative audios. The implementation method of determining the first target audio from a plurality of the audios to be played can refer to the subsequent embodiments. The determination of the second target audio from the alternative audios can be based on the number of the audios to be played and the total number of playback devices. The second target audio can also be determined by randomly selecting the second target audio from the alternative audios, or by determining the second target audio based on the type of the alternative audios. Specifically, please refer to the subsequent embodiments.

[0047] In other embodiments, considering that the relationship between the number of audio to be played and the total number of playback devices is different, it may involve the allocation of the audio to be played, the speakers, and the audio playback devices. Therefore, based on the first number of total playback devices and the second number of audio to be played, the first target audio and the second target audio can be determined from the audio to be played.

[0048] The overall playback device is the speaker and the audio playback device. For example, Figure 1 The first number of total playback devices in the audio playback system is 2. Figure 2 The first number of total playback devices in the audio playback system shown is 3. The first target audio corresponds to the speaker, that is, the first target audio is the audio played by the speaker, and the second target audio corresponds to the audio playback device, that is, the second target audio is played by the audio playback device.

[0049] There may be three situations in the size relationship between the first number and the second number, namely, the first number is less than the second number, the first number is equal to the second number, and the first number is greater than the second number. When the first number is greater than or equal to the second number, it can be ensured that each audio to be played can be played by at least one audio playback device. Then, when an audio device is assigned to each audio to be played, when it is determined that each audio device to be played is played, multiple audio playback devices may play the same audio to be played at the same time. If the first number is less than the second number, and the number of audio playback devices is less than the second number, some audio data to be played cannot be played. When it is necessary to determine which audio to be played can be played from the second number of audios to be played, specifically, in subsequent embodiments, based on the size relationship between the first number and the second number, the methods for determining the first target audio and the second target audio will be explained respectively.

[0050] As an implementation method, an audio playback device may be set for each audio to be played, wherein the audio to be played corresponding to the speaker is used as the first target audio, and the audio corresponding to the audio playback device is used as the second target audio. Figure 4 As shown, a device selection control 401 can be set in the audio playback interface. For example, the first audio requested to be played is selected in the audio playback interface as the audio to be played. Then, if the audio playback device set for the audio to be played through the device selection control 401 is a speaker, the first audio is the first target audio. If the audio playback device set for the audio to be played through the device selection control 401 is an audio playback device such as a speaker, the first audio is the second target audio.

[0051] S303: Send the first target audio to the speaker, and send the second target audio to the audio playback device, so that when the speaker plays the first target audio, the audio playback device plays the second target audio.

[0052] As an implementation mode, the processor of the electronic device sends the first target audio to the speaker, controls the speaker to play the first target audio and sends the second target audio to the audio playback device, so that when the speaker plays the first target audio, the audio playback device plays the second target audio. Specifically, the processor of the electronic device transmits the first target audio to the speaker of the electronic device through a wired channel, and the processor of the electronic device transmits the second target audio to the audio playback device through a Bluetooth channel, so that the electronic device can transmit the first target audio and the second target audio without conflict. In addition, the electronic device can also be provided with a multi-channel decoder or multiple decoders, and the first target audio and the second target audio are decoded simultaneously by different channel decoders or different decoders, so as to avoid the playback conflict of the first target audio and the second target audio.

[0053] As another implementation, when there are multiple audio playback devices and the second target audio needs to be sent to multiple audio playback devices, the electronic device sends each second target audio to the audio playback device corresponding to each second target audio through the Bluetooth channel. In order to avoid delays when multiple audio playback devices play the same second target audio, the audio played by each audio playback device can be collected by the microphone of the electronic device, the content of the audio can be identified, and based on the predetermined correspondence between the audio content and the timestamp, the playback progress of each of the audio playback devices is adjusted so that each audio playback device can play the same audio synchronously. Similarly, when the first target audio and the second target audio are the same, that is, when the speaker of the electronic device and multiple audio playback devices play the same audio, the playback progress of each audio playback device determined by the microphone of the electronic device is adjusted based on the playback progress of the speaker so that the speaker and each audio playback device can play the same audio synchronously.

[0054] As an implementation mode, it should be noted that the first target audio and the second target audio do not necessarily mean that the audio data of the two are different, but the first target audio and the second target audio represent that the corresponding audio playback devices are different, the audio player corresponding to the first target audio is the speaker of the electronic device, and the second target audio corresponds to the audio playback device. In some embodiments, the first target audio can be the same as the second target audio, so that the audio playback device and the speaker of the electronic device can play audio at the same time and play the same audio, and the first target audio can be different from the second target audio, so that the audio playback device and the speaker of the electronic device can play audio at the same time but play different audio.

[0055] In addition, when there are multiple second target audios, the first target audio may be the same as some of the second target audios. In addition, all the audios to be played may be played, or some of the audios to be played may be played, that is, the first target audio and all the second target audios may cover all the audios to be played, or the first target audio and all the second target audios may only include some of the audios to be played, specifically, it is not limited here.

[0056] In an embodiment of the present application, the speaker can play an audio to be played, and among all the audio playback devices, at least some of the audio playback devices are playing the audio to be played. That is, when the speaker plays the first target audio, at least some of the audio playback devices are playing audio. Specifically, it is set based on the number of determined second target audios and the number of audio playback devices and usage requirements, and is not limited here.

[0057] Therefore, when the electronic device is connected to an audio playback device, the audio to be played is obtained, and the speaker and the audio playback device are used as the total playback device. Based on the first number of total playback devices and the second number of the audio to be played, the first target audio and the second target audio are determined from the audio to be played, and the speaker is controlled to play the first target audio; each of the second target audio is sent to the audio playback device corresponding to the second target audio, so that each of the audio playback devices plays the second target audio corresponding to the audio playback device when the speaker plays the first target audio. Therefore, when the electronic device is connected to the audio playback device, the speaker and the audio playback device of the electronic device can both play audio, which can prevent the speaker of the electronic device from stopping audio playback due to the connection of the electronic device to the audio playback device. Please refer to Figure 5 , Figure 5 An audio playback method provided in an embodiment of the present application is shown, which is applied to the above-mentioned electronic device, wherein the electronic device includes a speaker, and the execution subject of the method is the electronic device. Specifically, the method includes: S501 to S506.

[0058] S501: In response to connecting with an audio playback device, obtaining audio to be played.

[0059] S502: If the first number is greater than or equal to the second number, determine whether the second number is 1.

[0060] The first number is greater than or equal to the second number, that is, the number of audio to be played is less than or equal to the total number of playback devices, that is, there are enough audio playback devices to play the audio to be played.

[0061] If there is only one audio to be played, then the audio playback device participating in the audio playback in the total playback device can play only one audio; if the number of audios to be played is greater than 1 and less than or equal to the first number, then the number of audio playback devices participating in the audio playback in the total playback device is more than one, and this number is not less than the number of audios to be played that need to be played simultaneously this time.

[0062] It can be determined whether the second number is 1, that is, whether the number of audios to be played is 1. If it is 1, S503 is executed; if not 1, S504 is executed.

[0063] S503: Set the first target audio and each of the second target audio to be the audio to be played.

[0064] It should be noted that the first target audio and the second target audio do not necessarily mean that their audio data are different, but the first target audio and the second target audio represent that the corresponding audio playback devices are different. The audio player corresponding to the first target audio is the speaker of the electronic device, and the audio player corresponding to the second target audio is the audio playback device. In addition, the audio playback devices corresponding to the same second target audio may be different or the same, and the audio playback devices corresponding to different second target audios cannot be the same, that is, in some embodiments, two different second target audios cannot correspond to the same audio playback device.

[0065] When there is one audio to be played, the first target audio and each of the second target audio are set as the audio to be played, that is, when only one audio needs to be played, the speaker of the electronic device and the audio playback device play the same audio at the same time.

[0066] For example, if the number of audio playback devices is 1, the first number of total playback devices is 2, and the number of audio to be played is 1, that is, assuming that the audio to be played is the first song, the first target audio played by the speaker is the first song, and the second target audio played by the audio playback device is also the first song. Figure 6In the audio playback system shown, the speaker 101 and the speaker 200 of the electronic device 100 are playing the first song at the same time. Therefore, when the speaker 101 and the speaker 200 of the electronic device 100 play the same audio at the same time, the "spatial sense of sound" can be enhanced and the "music follows" effect can be achieved. Specifically, when the electronic device and the audio playback device play the same audio, the electronic device can be regarded as another "speaker", and the electronic device can be carried by the user, that is, it moves with the user. Therefore, the electronic device and the audio playback device form a pair of stereo devices, which can increase the three-dimensional sense of sound; in addition, the audio playback device can be fixed in position, and the electronic device can move with the user. The user moves in a relatively large space, such as carrying an electronic device from the living room to the kitchen. The way in which the electronic device is matched with the audio playback device can reduce the change in hearing caused by the movement of the position.

[0067] As an implementation method, the speaker of the electronic device plays the audio to be played, but not every audio playback device plays the audio to be played. Assuming that the number of audio playback devices is 3, namely device 1, device 2 and device 3, the first number of total playback devices is 4, and the number of audio to be played is 1, that is, assuming that the audio to be played is the first song, the first target audio is set to the first song, the speaker of the electronic device plays the first song, the second target audio is also set to the first song, and the audio playback devices corresponding to the second target audio are set to device 2 and device 3. Therefore, the speaker of the electronic device, device 2 and device 3 play the first song together, and device 1 does not play the first song or other audio.

[0068] In some embodiments, when the first number is greater than or equal to the second number, when a speaker is assigned an audio to be played as the first target audio, and the number of the second target audio is less than the number of audio playback devices, an audio playback device corresponding to the second target audio can be determined from multiple audio playback devices. Specifically, the device type of each audio playback device can be determined, and the audio playback device corresponding to the second target audio can be determined based on the device type of the audio playback device.

[0069] Specifically, the device type may include a headphone type and an external speaker type, wherein the external speaker type may be a type of audio device capable of external speaker such as a sound box or a loudspeaker. In an embodiment of the present application, there is one audio to be played, and the speaker of the electronic device is playing the audio. In order to increase the stereo effect and the sound following effect, an external audio player of the external speaker type may be determined from all external audio players currently connected to the electronic device as the external audio player corresponding to the audio to be played. Assume that the number of audio player devices is 3, namely device 1, device 2, and device 3, and the number of audio to be played is 1, that is, assuming that the audio to be played is the first song, and device 2 and device 3 are both external speakers, then the audio player devices corresponding to the first song are device 2 and device 3.

[0070] S504: Determine a first target audio from the plurality of audios to be played, and use at least a portion of the audios in the plurality of audios to be played except the first target audio as a second target audio.

[0071] If the second number of audios to be played is less than or equal to the first number of total playback devices, and the second number of audios to be played is greater than 1, it is necessary to determine the first target audio that the speaker needs to play and the second target audio that the audio playback device needs to play from the multiple audios to be played.

[0072] As an implementation method, it is assumed that an audio player device is assigned to each audio to be played, so that the speaker of the electronic device and the audio player device currently connected to the electronic device can play all the audio to be played together, and the audio played by each audio player device is different. Then, an audio is determined from the multiple audios to be played as the first target audio, and then all audios other than the audio to be played are used as the second target audio. Then, an audio player device is assigned to each second target audio, and the audio player devices corresponding to different second target audios are different, so as to avoid the same peripheral audio playing two different second target audios at the same time. Therefore, when the electronic device wants to play multiple audios, different audios can be played through different audio devices, so that all the audios to be played can be played. For example, the number of audio playback devices is 3, namely device 1, device 2 and device 3. The number of audios to be played is 3, then the total audio playback devices are three audio playback devices and the speaker of the electronic device, a total of 4. Assuming that the 3 audios to be played are audio 1, audio 2 and audio 3, then, one audio is determined from audio 1, audio 2 and audio 3 as the first target audio, for example, audio 1 is the first target audio, and then audio 2 and audio 3 are used as the second target audio. At least two audio playback devices are determined from device 1, device 2 and device 3 to play audio 2 and audio 3 respectively. For example, the audio playback device corresponding to audio 2 is device 1, and the audio playback device corresponding to audio 3 is device 3. It can be seen that the audio playback devices corresponding to audio 2 and audio 3 are different.

[0073] In this implementation, the number of multiple audio playback devices is greater than the number of second target audios, and a specified number of audio playback devices needs to be determined from the multiple audio playback devices as target audio playback devices, and the specified number is the same as the number of second target audios, so that each target audio playback device plays a second target audio. In some embodiments, the implementation method of determining the target audio playback device from multiple audio playback devices may be to determine the priority of each audio playback device, and determine the specified number of audio playback devices as target audio playback devices based on the priority of each audio playback device. As an implementation method, all audio playback devices can be sorted according to priority to obtain a specified sequence, and the specified number of audio playback devices at the front of the specified sequence are used as target audio playback devices.

[0074] As an implementation manner, the priority of each audio playback device may be set based on at least one of a connection time, a data transmission rate, and a user importance of each audio playback device.

[0075] As an implementation mode, the priority of each audio playback device is determined based on the connection time of each audio playback device, thereby determining the target terminal based on the connection time of each candidate terminal. In some embodiments, the priority of the audio playback device can be determined according to the order of connection time. For example, the priority is positively correlated with the connection time, that is, the earlier the connection time, the lower the priority, and the later the connection time, the higher the priority. It can also be that the priority is negatively correlated with the connection time, that is, the earlier the connection time, the higher the priority, and the later the connection time, the lower the priority. This is not limited here.

[0076] As an implementation mode, the attribute information may be a data transmission rate. The priority of each audio playback device is determined based on the data transmission rate corresponding to each of the audio playback devices. Specifically, the priority is positively correlated with the data transmission rate, that is, the lower the data transmission rate, the lower the priority, and the higher the data transmission rate, the higher the priority. The priority may also be negatively correlated with the data transmission rate, that is, the lower the data transmission rate, the higher the priority, and the higher the data transmission rate, the lower the priority.

[0077] As an implementation method, a user importance can be set for each audio playback device, and the user importance can be used as a measure of the importance of the user using the audio playback device. Specifically, the user importance of the audio playback device can be determined according to the terminal type of the audio playback device. In some embodiments, when the audio playback device sends a connection request, the device name of the audio playback device can be sent to the electronic device, and the electronic device determines the terminal type of the audio playback device based on the device name, and then determines the user importance of the audio playback device based on the correspondence between the pre-set terminal type and the user importance.

[0078] Determine the user importance of each of the audio playback devices; determine the priority of each of the audio playback devices based on the user importance of each of the audio playback devices, and determine the target user terminal from the multiple audio playback devices based on the priorities of the multiple audio playback devices. Specifically, the priority is positively correlated with the user importance, that is, the higher the user importance, the lower the priority, and the lower the user importance, the higher the priority; the priority can also be negatively correlated with the user importance, that is, the higher the user importance, the higher the priority, and the lower the user importance, the lower the priority.

[0079] As another implementation, it is assumed that at least one audio playback device is assigned to each audio to be played, so that each audio to be played is played and it is possible that multiple audio playback devices play the same audio to be played at the same time. For example, the number of audio playback devices is 3, namely device 1, device 2 and device 3, and the number of audios to be played is 3, then the total audio playback devices are three audio playback devices and the speaker of the electronic device, a total of 4, assuming that the 3 audios to be played are audio 1, audio 2 and audio 3, then, one audio is determined from audio 1, audio 2 and audio 3 as the first target audio, for example, audio 1 is the first target audio, then audio 2 and audio 3 are used as the second target audio, and at least two audio playback devices are determined from device 1, device 2 and device 3 to play audio 2 and audio 3 respectively, for example, the audio playback devices corresponding to audio 2 are device 1 and device 2, and the audio playback device corresponding to audio 3 is device 3. It can be seen that the audio playback devices corresponding to audio 2 and audio 3 are different from each other, so devices 1 and 2 play audio 2 together.

[0080] As an implementation manner, the implementation manner of determining the first target audio from the plurality of audios to be played may include: determining the data type corresponding to each of the audios to be played; and determining the first target audio based on the data type corresponding to each of the audios to be played. Specifically, the data type may include audio type, video type, game type, call type, and prompt voice type, etc.

[0081] As an implementation, determine the play request corresponding to each audio to be played, determine the service module corresponding to the play request, and the service module triggers the play request of the audio to be played. Determine the data type of the audio to be played requested by the service module based on the type of the service module.

[0082] Specifically, the service module can be a functional module in an application program in an audio playback device. For example, if the application program is a game application program, the game application program may include a video playback module for playing some game images and audio. The service type of the service module can be the application type of the application program corresponding to the service module, or it can be the functional type of the service module. For example, if a service module is a video playback module in a game application program, the type of the application program corresponding to the service module, i.e., the game type, can be used as the service type of the service module, or the functional type of the service module, i.e., the audio type corresponding to the video playback module, can be used as the functional type of the service module. Then, the service type of the service module is used as the data type of the audio to be played that the service module requests to play.

[0083] In an embodiment of the present application, the service type of the service module may be the program type of the application corresponding to the service module. Then, according to a first correspondence between a pre-set program type and user importance, the user importance corresponding to the service module is determined, and then the user terminal reading of each first application is determined. In some embodiments, in the first correspondence, the user importance of video, game, audio, and call types increases in sequence. Therefore, after determining the service type corresponding to each audio playback device, the user importance corresponding to the service type of each audio playback device is determined.

[0084] It should be noted that some applications may have multiple functions. For example, an application may include audio playback (e.g., song playback), video playback (e.g., video file playback), call and other functions. In this case, the frequency of the application executing different functions within a preset time period can be counted, and the type corresponding to the function with the highest frequency can be used as the program type of the application. For example, if the application plays audio files most frequently within the preset time period, the type of the application is audio type. For another example, if the application plays video files most frequently within the preset time period, the type of the application is video type.

[0085] As an implementation method, the implementation method of determining the first target audio based on the data type corresponding to each of the audios to be played is to search for the audios to be played of the specified type among the data types of the multiple audios to be played; and determine the first target audio based on the audios to be played of the specified type. Among them, the specified type can be a type corresponding to a video screen, that is, the audio to be played of the specified type corresponds to a video screen, and the specified type can include video types, game types, and navigation voice types, etc., which are types that play video screens while playing audio. Of course, the specified type can also be other types, which can be set according to actual usage requirements and are not limited here. In an embodiment of the present application, the audio to be played of the specified type corresponds to a video screen, and the audio of the specified type is used as the first target audio, and the video screen of the video file corresponding to the first target audio is displayed on the screen of the electronic device, so that when the electronic device plays the video file, the screen and audio of the video file are output by the electronic device, which can improve the user's viewing experience.

[0086] If, from the multiple audios to be played, the number of audios to be played whose data type belongs to the specified type is one, then the audio to be played of the specified type is used as the first target audio; if the number of audios to be played whose data type belongs to the specified type is multiple, it is necessary to determine one audio to be played from the multiple audios to be played as the first target audio; specifically, if there are multiple audios to be played that belong to the specified type, determine a to-be-played application corresponding to each audio to be played that belongs to the specified type, the to-be-played application is an application that requests to play the audio to be played; determine a target application based on the application type of the to-be-selected application; and use the audio to be played corresponding to the target application as the first target audio.

[0087] As an implementation method, the category of an application can be the category set by the developer of the application when developing the application, or it can be the category set by the user for the application after the application is installed on the electronic device. For example, when a user installs an application on an electronic device, after the installation is completed and the application is entered, a dialog box will be displayed to instruct the user to set the category for the application. The specific category to which the application belongs can be set by the user according to the needs. For example, the user can set a social software to an audio category, a video category, or a social category. In addition, the electronic device is installed with application installation software, such as an application store. Then, an application list is set in the application installation software, in which the user can download the application and can update and open the application, and the application installation software can realize different applications according to categories, such as audio, video or game categories. Therefore, when the user uses the application installation software to install the application, he can already know the category of the application. Furthermore, the type of the application can also be determined according to the frequency of each business module used by the application.

[0088] The implementation method of determining the target application based on the application type of the selected application is to determine the selected application whose application type belongs to a preset type as the target application, wherein the preset type can be a navigation type, a video call type or a video type, etc., and specifically, it can be set according to actual needs. As another implementation method, the real-time level corresponding to the application type of the selected application can also be determined, and the target application is determined based on the real-time level. Specifically, a first corresponding relationship can be pre-set, and the first corresponding relationship includes multiple application types and the real-time level corresponding to each application type. The real-time level represents the real-time requirements of the application of this type for audio playback. The higher the real-time level, the higher the real-time requirements for audio playback, which can be determined based on the first corresponding relationship. The real-time level corresponding to the application type of each selected application of different application types, and the application corresponding to the application type with the highest real-time level is used as the target application. Therefore, the audio requested to be played by the application with a high real-time level is played directly on the speaker of the electronic device, avoiding the need to transmit it to the audio playback device and excessive delay.

[0089] like Figure 7 As shown, the audio to be played includes a first song and a navigation voice, the navigation voice corresponds to a video screen and its real-time level is higher than that of the first song, then the speaker of the electronic device plays the navigation voice, and the audio playback device and the speaker play the first song.

[0090] S505: Determine an audio playback device corresponding to each second target audio, wherein the audio playback devices corresponding to each second target audio are different from each other.

[0091] S506: Send the first target audio to the speaker, and send the second target audio to the audio playback device, so that when the speaker plays the first target audio, the audio playback device plays the second target audio.

[0092] See also Figure 8 , Figure 8 An audio playback method provided in an embodiment of the present application is shown, which is applied to the above-mentioned electronic device, wherein the electronic device includes a speaker, and the execution subject of the method is the electronic device. Specifically, the method includes: S801 to S805.

[0093] S801: In response to connecting with an audio playback device, obtaining audio to be played.

[0094] S802: If the first number is less than the second number, determine a first target audio from the plurality of audios to be played, and use the audios other than the first target audio from the plurality of audios to be played as candidate audios.

[0095] Since the total number of playback devices is less than the number of audios to be played that are currently requested to be played, it cannot be guaranteed that all the audios that are currently required to be played can be played. Therefore, the audios to be played need to be screened. Specifically, first determine the first target audio from the multiple audios to be played. The method for determining the first target audio can refer to the above embodiment and will not be repeated here. Then, the audios other than the first target audio from the multiple audios to be played are used as candidate audios.

[0096] For example, the number of audio playback devices is 3, namely device 1, device 2 and device 3, and the number of audios to be played is 5. The total audio playback devices are three audio playback devices and the speaker of the electronic device, a total of 4. Assuming that the 5 audios to be played are audio 1, audio 2, audio 3, audio 4 and audio 5, if audio 1 is the first target audio, audio 2, audio 3, audio 4 and audio 5 are alternative audios.

[0097] S803: Determine the second target audio from the candidate audio, where the number of the second target audio is less than or equal to the number of the audio playback devices.

[0098] Assuming that the number of audio playback devices is the third number, the number of alternative audios is the fourth number, and the fourth number is greater than the third number, it cannot be guaranteed that the current alternative audios can be played at the same time. Therefore, the number of alternative audios needs to be reduced, that is, it is necessary to determine audios from the alternative audios that are less than the third number as the second target audio.

[0099] Assuming that audio 2, audio 3, audio 4 and audio 5 are candidate audios, and the number of audio playback devices is 3, namely device 1, device 2 and device 3 respectively, the fourth number of candidate audios is 4, then at least one audio needs to be removed from the candidate audios so that the number of second target audios is less than or equal to the number of audio playback devices. For example, audio 3, audio 4 and audio 5 are selected from audio 2, audio 3, audio 4 and audio 5 as the second target audios.

[0100] As an implementation method, determining the second target audio from the alternative audios may be to determine the data type corresponding to each audio and use the audio of the specified type as the second target audio. Alternatively, the real-time level corresponding to each alternative audio may be determined and the second target audio may be determined based on the real-time level. For example, N alternative audios with the highest real-time level may be selected as the second target audio, where N is a positive number and is less than or equal to the number of audio playback devices.

[0101] S804: Determine an audio playback device corresponding to each second target audio, where the audio playback devices corresponding to each second target audio are different.

[0102] S805: Send the first target audio to the speaker, and send the second target audio to the audio playback device, so that when the speaker plays the first target audio, the audio playback device plays the second target audio.

[0103] As an implementation method, Fig. 9 As shown, assuming that the number of audio playback devices is 1, the number of audios to be played is 1, that is, the navigation APP sound source, when the electronic device is not currently connected to the audio playback device, the navigation APP sound source is amplified by the smart power amplifier (Smart PA) after the audio codec, and then played by the speaker of the electronic device. When the electronic device is currently connected to the audio playback device, the navigation APP sound source can be played by the audio playback device and the speaker of the electronic device together.

[0104] As another embodiment, Fig.10 As shown, assuming that the number of audio playback devices is 1, the number of audios to be played is 2, namely, the navigation APP audio source and the music APP audio source. Since the navigation APP audio source corresponds to a video screen, that is, it is necessary to play the navigation APP audio source and the navigation screen during navigation, the speaker plays the navigation APP audio source, and when the electronic device is currently connected to the audio playback device, the audio playback device plays the music APP audio source. Fig.10 In the figure, the dotted line represents the data flow of the audio that needs to be played by the audio playback device, and the solid line represents the data flow of the audio that needs to be played by the speaker.

[0105] As another embodiment, Fig.11 As shown, assuming that the number of audio playback devices is 1, the number of audios to be played is 3, namely, the navigation APP audio source, the music APP audio source 1 and the video APP audio source 2, and the number of audios to be played is greater than the total number of audio devices, then one audio can be selected from the audios to be played as the first target audio, and then a second target audio can be selected from the audios other than the first target audio. For example, the navigation APP audio source is used as the first target audio, and the music APP audio source 1 is used as the second target audio. In addition, both the navigation APP audio source and the video APP audio source 2 correspond to video screens, but the navigation APP audio source is more real-time. Therefore, the navigation APP audio source is used as the first target audio, and then the audio playback device plays the music APP audio source 1, and the speaker plays the navigation APP audio source.

[0106] See also Fig.12 , which shows a structural block diagram of an audio playback device 1200 provided in an embodiment of the present application. The device may include: an acquisition unit 1201, a determination unit 1202 and a sending unit 1203.

[0107] The acquisition unit 1201 is used to acquire the audio to be played in response to being connected to the audio playback device.

[0108] The determining unit 1202 is configured to determine, based on the audio to be played, a first target audio to be sent to the speaker and a second target audio to be sent to the audio playback device.

[0109] Furthermore, the determination unit 1202 is also used to determine the first target audio and the second target audio from the audio to be played based on a first number of total playback devices and a second number of the audio to be played, wherein the total playback device is the speaker and the audio playback device.

[0110] Furthermore, the determining unit 1202 is further configured to set the first target audio and each of the second target audio as the audio to be played if the first number is greater than or equal to the second number and the second number is 1.

[0111] Furthermore, the determination unit 1202 is also used to determine a first target audio from a plurality of audios to be played, and at least part of the audio in the plurality of audios to be played except the first target audio as the second target audio if the first number is greater than or equal to the second number and the second number is not 1; and determine an audio playback device corresponding to each of the second target audios, wherein the audio playback devices corresponding to each of the second target audios are different from each other.

[0112] Furthermore, the determination unit 1202 is also used to determine the first target audio from the multiple audios to be played, and the audios other than the first target audio from the multiple audios to be played are used as alternative audios if the first number is less than the second number; determine the second target audio from the alternative audios, and the number of the second target audios is less than or equal to the number of audio playback devices; determine the audio playback device corresponding to each of the second target audios, and the audio playback devices corresponding to each of the second target audios are different.

[0113] Furthermore, the determination unit 1202 is further configured to determine a first target audio from the plurality of audios to be played, and use audios other than the first target audio from the plurality of audios to be played as candidate audios; and determine the second target audio from the candidate audios.

[0114] Furthermore, the determination unit 1202 is further configured to determine a data type corresponding to each of the to-be-played audios; and determine a first target audio based on the data type corresponding to each of the to-be-played audios.

[0115] Furthermore, the determining unit 1202 is further configured to search for an audio to be played of a specified type among the data types of the multiple audios to be played, and determine the first target audio based on the audio to be played of the specified type. The audio to be played of the specified type corresponds to a video screen, and the video screen is displayed on the screen of the electronic device.

[0116] Furthermore, the determination unit 1202 is also used to determine a candidate application corresponding to each audio to be played of the specified type if there are multiple audios to be played of the specified type, the candidate application being the application requesting to play the audio to be played; determine a target application based on the application type of the candidate application; and use the audio to be played corresponding to the target application as the first target audio.

[0117] Furthermore, the audio duration of the audio to be played is greater than a specified value.

[0118] The sending unit 1203 is used to send the first target audio to the speaker and send the second target audio to the audio playback device, so that when the speaker plays the first target audio, the audio playback device plays the second target audio.

[0119] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0120] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.

[0121] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.

[0122] Please refer to Fig.13 , which shows a structural block diagram of an electronic device provided in an embodiment of the present application. The electronic device 100 may be an electronic device capable of running applications, such as a smart phone, a tablet computer, an e-book, etc. The electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by one or more processors 110, and the one or more programs are configured to execute the method described in the aforementioned method embodiment.

[0123] The processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Optionally, the processor 110 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 110 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 110, but may be implemented separately through a communication chip.

[0124] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). The memory 120 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the electronic device 100 during use.

[0125] Please refer to Fig.14 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 1400 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.

[0126] The computer readable storage medium 1400 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 1400 includes a non-transitory computer-readable storage medium. The computer readable storage medium 1400 has storage space for program code 1410 that performs any method steps in the above method. These program codes can be read from or written to one or more computer program products. The program code 1410 can be compressed, for example, in an appropriate form.

[0127] Please refer to Fig.15 , which shows a structural block diagram 1500 of a computer program product provided by an embodiment of the present application. The computer program product 1500 includes a computer program / instruction 1510, and when the computer program / instruction 1510 is executed by a processor, the steps of the above method are implemented.

[0128] In summary, the audio playback method, device, electronic device, computer-readable medium and product provided by the present application, when the electronic device is connected to an external audio playback device, obtains the audio to be played, the speaker and the external audio playback device are used as the total playback device, and based on the first number of total playback devices and the second number of the audio to be played, the first target audio and the second target audio are determined from the audio to be played, and the speaker is controlled to play the first target audio; each of the second target audio is sent to the external audio playback device corresponding to the second target audio, so that each of the external audio playback devices plays the second target audio corresponding to the external audio playback device when the speaker plays the first target audio. Therefore, when the electronic device is connected to the external audio playback device, the speaker and the external audio playback device of the electronic device can both play audio, which can avoid the speaker of the electronic device stopping audio playback due to the connection of the electronic device to the external audio playback device.

[0129] Specifically, when an electronic device (for example, a mobile phone terminal) is connected to a Bluetooth audio peripheral, the dual-ring function of the device can provide audio enhancement according to different scenarios and needs; by dual-ringing the mobile phone terminal and the audio peripheral (car-mounted Bluetooth speaker) and playing the audio sources of different APPs (navigation and music) respectively, the mutual influence and interference during the playback process can be reduced, and a clear and smooth listening experience can be achieved; when playing the same audio source, the dual ringing of the mobile phone speaker and the Bluetooth audio device enhances the spatial sense and presence of the music, achieving the effect of "music follows".

[0130] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, 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.

Claims

1. An audio playback method, characterized in that: Applied to an electronic device, the electronic device includes a speaker, and the electronic device is a mobile terminal, and the method includes: In response to connecting with the audio playback device, obtaining audio to be played; If the first number of the total playback devices is greater than the second number of the audio to be played and the second number is 1, the first target audio and the second target audio are both set to be the audio to be played, and a speaker is determined as the audio playback device corresponding to the second target audio from all the audio playback devices currently connected to the electronic device, wherein the total playback device is the speaker and the audio playback device; If the first number is greater than or equal to the second number and the second number is not 1, determining a first target audio from the plurality of audios to be played, and at least part of the audios in the plurality of audios to be played except the first target audio is used as a second target audio; If there are multiple audio playback devices, and the number of the multiple audio playback devices is greater than the number of second target audios, determine the priority of each audio playback device, and determine a specified number of audio playback devices as target audio playback devices based on the priority of each audio playback device, wherein the specified number is the same as the number of second target audios; Corresponding each of the target audio playback devices to a second target audio to obtain an audio playback device corresponding to each of the second target audios, wherein the audio playback devices corresponding to each of the second target audios are different from each other; The first target audio is sent to the speaker, and the second target audio is sent to the audio playback device corresponding to the second target audio, so that when the speaker plays the first target audio, the audio playback device corresponding to the second target audio plays the second target audio.

2. The method according to claim 1, characterized in that Also includes: If the first number is less than the second number, determining a first target audio from the plurality of audios to be played, and using the audios other than the first target audio from the plurality of audios to be played as candidate audios; Determine the second target audio from the candidate audios, where the number of the second target audios is less than or equal to the number of the audio playback devices; An audio playback device corresponding to each second target audio is determined, and the audio playback devices corresponding to each second target audio are different from each other.

3. The method according to claim 1, characterized in that The step of determining a first target audio from the plurality of audios to be played includes: Determine the data type corresponding to each of the audios to be played; Based on the data type corresponding to each of the to-be-played audios, a first target audio is determined.

4. The method according to claim 3, characterized in that The determining the first target audio based on the data type corresponding to each of the to-be-played audios includes: Searching for audio data of a specified type among a plurality of audio data types to be played; The first target audio is determined based on the audio to be played that belongs to the specified type.

5. The method according to claim 4, characterized in that The specified type of audio to be played corresponds to a video picture, and the video picture is displayed on the screen of the electronic device.

6. The method according to claim 4, characterized in that The determining the first target audio based on the to-be-played audio of the specified type includes: If there are multiple audios to be played that belong to the specified type, determine a candidate application corresponding to each audio to be played that belongs to the specified type, and the candidate application is an application requesting to play the audio to be played; Determine a target application based on the application type of the candidate application; The to-be-played audio corresponding to the target application is used as the first target audio.

7. The method according to any one of claims 1 to 6, characterized in that: The audio duration of the audio to be played is greater than a specified value.

8. An electronic device, characterized in that: include: one or more processors; Memory; speaker; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the method according to any one of claims 1-7.

9. A computer-readable medium, characterized in that The computer-readable medium stores a program code executable by a processor, and when the program code is executed by the processor, the processor executes the method according to any one of claims 1 to 7.

10. A computer product, characterized in that: The computer product comprises a program code executable by a processor, and when the program code is executed by the processor, the processor is caused to perform the method according to any one of claims 1 to 7.