Audio control method and device

CN120202679APending Publication Date: 2025-06-24HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202280101871.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2022-11-18
Publication Date
2025-06-24

AI Technical Summary

Technical Problem

In smart terminal systems, the default fixed allocation of audio focus leads to the failure of reasonable allocation of audio service resources, affecting user experience.

Method used

The audio sink device receives the audio stream attribute information sent by the audio source device and determines the audio focus type based on the duration and priority of the audio stream to achieve reasonable allocation of audio service resources.

Benefits of technology

By dynamically matching the audio focus type with the duration of the audio stream, storage and processing resource allocation is optimized to improve user experience and system efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120202679A_ABST
    Figure CN120202679A_ABST
Patent Text Reader

Abstract

The invention provides an audio control method and a related device. The method comprises the steps that a sound sink device receives attribute information of a first audio stream from a sound source device; and the sound sink device determines an audio focus type of the first audio stream based on the attribute information, wherein the audio focus type is a long focus type or a short focus type. According to the invention, reasonable allocation of audio service resources can be realized, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Audio control method and device Technical Field

[0001] The present application relates to the field of audio processing technology, and in particular to an audio control method and device. Background Art

[0002] In current smart terminal systems (such as Android or Hongmeng systems), audio focus design has been introduced to avoid mixing caused by audio playing simultaneously by two applications (Application, APP). Audio focus is a virtual control point. An application can only play audio after obtaining audio focus. When it loses audio focus, the audio playback of the application stops. That is, by controlling the occupation and release of audio focus, it can be ensured that only one application can maintain audio focus at the same time. Audio focus includes two types: long focus and short focus. The long focus type means that audio will be played for a long time, and the audio focus will be occupied for a long time. When a new application applies for long focus, the application currently holding the audio focus will permanently lose focus, and after the application releases focus, the application that lost focus cannot regain focus. The short focus type means that audio will only be played briefly, and the audio focus will be released quickly. When a new application applies for short focus, the application currently holding the audio focus will temporarily lose focus. After the new application releases focus, the application that lost focus will regain focus. When the audio sink device uses the audio from the audio source device, the audio sink device defaults to allocating a fixed type of audio focus (either a fixed long focus or a fixed short focus) to the audio from the audio source device, resulting in unreasonable allocation of the audio service resources of the audio sink, affecting the user experience.

[0003] Summary of the Invention

[0004] The present application provides an audio control method and device that can reasonably allocate audio service resources and improve user experience.

[0005] In a first aspect, the present application provides an audio control method, comprising: a music sink device receiving attribute information of a first audio stream from a sound source device; the music sink device determining an audio focus type of the first audio stream based on the attribute information, where the audio focus type is either a long focus type or a short focus type.

[0006] Optionally, the aforementioned attribute information indicates one or more of the following: a first duration of the first audio stream, a first type of the aforementioned first duration, or a priority of the aforementioned first audio stream.

[0007] In this solution, the audio sink device determines the audio focus type of the audio stream based on the audio stream attribute information from the audio source device. This determines the audio focus type and matches the audio duration of the audio stream, thereby achieving a reasonable allocation of audio service resources (such as playback resources) and improving the user experience.

[0008] In one possible implementation, the attribute information indicates a first type of a first duration of the first audio stream. Before the music sink device receives the attribute information of the first audio stream from the sound source device, the method further includes: the music sink device sending first information to the sound source device; the first information includes the duration of one or more audio streams stored in the music sink device, and the duration of the one or more audio streams is used to determine the first type.

[0009] Optionally, the first information may be carried in a local audio stream attribute read response message sent by the music sink device to the music source device and sent to the music source device.

[0010] In this solution, the audio sink device can send its local audio stream environment information (including the duration of one or more audio streams) to the audio source device. This allows the audio source device to determine a more reasonable duration type for the audio stream based on the local audio stream environment information. Furthermore, after the audio stream is transmitted to the audio sink device, the audio sink device can reasonably determine the audio focus type of the audio stream based on the duration type of the audio stream. The determined audio focus type is matched to the audio duration of the audio stream, thereby achieving reasonable allocation of audio service resources (e.g., playback resources) and improving the user experience.

[0011] In a possible implementation, the duration of the one or more audio streams is stored in an audio focus management stack of the audio sink device.

[0012] In this solution, the audio sink device can store the duration of the local audio stream in the audio focus management stack for quick retrieval.

[0013] In one possible implementation, the aforementioned attribute information indicates a first type of the first duration of the aforementioned first audio stream; when the first type is a short audio duration type, the audio focus type of the first audio stream is a short focus type; or, when the first type is a long audio duration type, the audio focus type of the first audio stream is a long focus type.

[0014] In this solution, the audio sink device can reasonably determine the audio focus type of the audio stream based on the duration of the audio stream. The determined audio focus type is matched with the audio duration of the audio stream, thereby achieving a reasonable allocation of audio service resources (such as playback resources) and improving the user experience.

[0015] In one possible implementation, the aforementioned attribute information indicates a first duration of the aforementioned first audio stream; when the aforementioned first duration is less than a first threshold, the audio focus type of the first audio stream is a short focus type; or, when the aforementioned first duration is greater than the aforementioned first threshold, the audio focus type of the first audio stream is a short focus type.

[0016] In this solution, the audio sink device can reasonably determine the audio focus type of the audio stream based on the duration of the audio stream. The determined audio focus type matches the audio duration of the audio stream, thereby achieving a reasonable allocation of audio service resources (such as playback resources) and improving the user experience.

[0017] In one possible implementation, the receiving of the attribute information of the first audio stream by the music sink device from the sound source device includes: the receiving of the attribute information of the first audio stream by the music sink device from the sound source device during an audio stream configuration or reconfiguration phase; or the receiving of the attribute information of the first audio stream by the music sink device from the sound source device during an audio stream transmission phase.

[0018] In this solution, an audio occupancy field can be added to the audio stream configuration message or the audio stream transmission message to transmit the attribute information of the audio stream, so that there is no need to send another message to transmit the attribute information of the audio stream, saving transmission resources and improving communication efficiency.

[0019] In a possible implementation, the method further includes: the audio sink device determining, based on the attribute information, a storage space allocated for the first audio stream and / or a processing priority of the first audio stream.

[0020] In this solution, determining the storage space of an audio stream based on its attribute information can rationally allocate storage resources and reduce storage resource waste. In addition, determining the processing priority of an audio stream based on its attribute information can rationally allocate processing resources while processing the audio stream in a timely manner, thereby improving the processing efficiency of the system.

[0021] In one possible implementation, the music sink device determines the storage space to allocate for the first audio stream based on the attribute information, including: when the attribute information indicates that a first duration of the first audio stream is greater than a second threshold, the music sink device allocates a first storage space for the first audio stream; the duration of the audio stream that can be stored in the first storage space is less than the first duration, and the first storage space is used to cyclically store unused audio streams of the first audio stream.

[0022] In this solution, if the duration of the audio stream is long, a smaller storage space can be allocated and the storage space can be used cyclically to store the audio stream, so as to achieve the purpose of recycling and saving storage space.

[0023] In a second aspect, the present application provides an audio control method, comprising: the music sink device assigning audio focus to a first audio stream in the form of a short focus; the music sink device determining that a duration for which the first audio stream occupies the audio focus is greater than a threshold; and the music sink device changing the audio focus type of the first audio stream from a short focus to a long focus.

[0024] Optionally, before the music sink device assigns the audio focus to the first audio stream in the form of a short focus, the process further includes: the music sink device receiving an audio stream transmission request for the first audio stream from the audio source device; and the audio stream transmission request does not indicate attribute information of the first audio stream.

[0025] Optionally, after the music sink device assigns the audio focus to the first audio stream in the form of a short focus, the method further includes: the music sink device sending an audio stream transmission change event of the first audio stream to the audio source device.

[0026] In this solution, the audio sink dynamically requests a corresponding type of audio focus for an audio stream based on the duration of the audio focus occupied by the audio stream. This ensures that the type of audio focus requested matches the duration of the audio stream, thereby achieving a reasonable allocation of audio service resources (such as playback resources) and improving the user experience.

[0027] In a third aspect, the present application provides an audio control method, comprising: a sound source device obtaining attribute information of a first audio stream; the aforementioned sound source device sending the aforementioned attribute information to a sound sink device; and the aforementioned attribute information being used to determine an audio focus type of the aforementioned first audio stream.

[0028] Optionally, the aforementioned attribute information indicates one or more of the following: a first duration of the first audio stream, a first type of the aforementioned first duration, or a priority of the aforementioned first audio stream.

[0029] In this solution, the audio source device can send audio stream attribute information to the audio sink device. The audio sink device can determine the audio focus type of the audio stream based on the audio stream attribute information. The determined audio focus type is matched with the audio duration of the audio stream, thereby achieving a reasonable allocation of audio service resources (e.g., playback resources) and improving the user experience.

[0030] In one possible implementation, the attribute information indicates a first type of a first duration of the first audio stream; and before the audio source device obtains the attribute information of the first audio stream, the method further includes:

[0031] The audio source device receives first information from the audio sink device; the first information includes the duration of one or more audio streams stored in the audio sink device;

[0032] The audio source device determines a second duration based on the duration of the one or more audio streams.

[0033] The sound source device determines the first type based on the second duration and the first duration.

[0034] Optionally, when the aforementioned first duration is less than the aforementioned second duration, the aforementioned first type is a short audio duration type; or, when the aforementioned first duration is greater than the aforementioned second duration, the aforementioned first type is a long audio duration type.

[0035] In this solution, the audio source device can receive local audio stream environment information (including the duration of one or more audio streams) from the audio sink device. This allows the audio source device to determine a more reasonable duration type for the audio stream based on the local audio stream environment information of the audio sink device. Furthermore, after the audio stream is transmitted to the audio sink device, the audio sink device can reasonably determine the audio focus type of the audio stream based on the duration type of the audio stream. The determined audio focus type is matched with the audio duration of the audio stream, thereby achieving reasonable allocation of audio service resources (e.g., playback resources) and improving user experience.

[0036] In one possible implementation, before the aforementioned sound source device obtains the attribute information of the first audio stream, it also includes: the aforementioned sound source device determines the attribute information of the aforementioned first audio stream based on the associated information of the application to which the aforementioned first audio stream belongs; the associated information of the aforementioned application includes the audio play list, audio play mode or historical play data of the aforementioned application.

[0037] In this solution, for real-time audio streams like music or calls that depend on user interaction and have uncertain duration, the audio source device can estimate the duration of the audio stream based on information associated with the application to which the audio stream belongs, through historical data statistics or artificial intelligence (AI) analysis. This allows the subsequent audio sink device to more reasonably determine the audio focus type of the audio stream based on the duration of the audio stream.

[0038] In a possible implementation, after the audio source device obtains the attribute information of the first audio stream, the audio source device further determines, based on the attribute information, a storage space allocated to the first audio stream and / or a processing priority of the first audio stream.

[0039] In this solution, determining the storage space of an audio stream based on its attribute information can rationally allocate storage resources and reduce storage resource waste. In addition, determining the processing priority of an audio stream based on its attribute information can rationally allocate processing resources while processing the audio stream in a timely manner, thereby improving the processing efficiency of the system.

[0040] In a fourth aspect, the present application provides a music sink device, comprising:

[0041] a receiving unit, configured to receive attribute information of a first audio stream from an audio source device;

[0042] A processing unit is configured to determine an audio focus type of the first audio stream based on the attribute information, where the audio focus type is a long focus type or a short focus type.

[0043] In a possible implementation manner, the attribute information indicates one or more of the following: a first duration of the first audio stream, a first type of the first duration, or a priority of the first audio stream.

[0044] In one possible implementation, the attribute information indicates a first type of a first duration of the first audio stream. The music sink device further includes a sending unit configured to send first information to the sound source device before the receiving unit receives the attribute information of the first audio stream from the sound source device. The first information includes the duration of one or more audio streams stored in the music sink device, and the duration of the one or more audio streams is used to determine the first type.

[0045] In a possible implementation manner, the sending unit is specifically configured to send a local audio stream attribute reading response message to the audio source device, where the local audio stream attribute reading response message includes the first information.

[0046] In a possible implementation, the duration of the one or more audio streams is stored in an audio focus management stack of the audio sink device.

[0047] In one possible implementation, the aforementioned attribute information indicates a first type of a first duration of the aforementioned first audio stream; when the aforementioned first type is a short audio duration type, the audio focus type of the aforementioned first audio stream is a short focus type; or, when the aforementioned first type is a long audio duration type, the audio focus type of the aforementioned first audio stream is a long focus type.

[0048] In one possible implementation, the aforementioned attribute information indicates a first duration of the aforementioned first audio stream; when the aforementioned first duration is less than a first threshold, the audio focus type of the first audio stream is a short focus type; or, when the aforementioned first duration is greater than the aforementioned first threshold, the audio focus type of the first audio stream is a short focus type.

[0049] In a possible implementation manner, the aforementioned receiving unit is specifically configured to:

[0050] receiving an audio stream configuration message from the audio source device during the audio stream configuration or reconfiguration phase, wherein the audio occupancy field of the audio stream configuration message includes attribute information of the first audio stream; or

[0051] During the audio stream transmission phase, an audio stream transmission message is received from the audio source device, wherein the audio occupancy field of the audio stream transmission message includes attribute information of the first audio stream.

[0052] In a possible implementation manner, the processing unit is further configured to determine a storage space allocated to the first audio stream and / or a processing priority of the first audio stream based on the attribute information.

[0053] In one possible implementation, the processing unit is specifically configured to: allocate a first storage space for the first audio stream when the attribute information indicates that the first duration of the first audio stream is greater than a second threshold; the duration of the audio stream that can be stored in the first storage space is less than the first duration, and the first storage space is used to cyclically store unused audio streams in the first audio stream.

[0054] In a fifth aspect, the present application provides a music sink device, comprising:

[0055] A processing unit is configured to allocate audio focus to the first audio stream in the form of a short focus based on the audio stream transmission request; determine that a duration for which the first audio stream occupies the audio focus is greater than a threshold; and change the audio focus type of the first audio stream from a short focus to a long focus.

[0056] In one possible implementation, the audio sink device further includes a receiving unit configured to receive an audio stream transmission request for the first audio stream from the audio source device before the processing unit assigns audio focus to the first audio stream in the form of a short focus; the audio stream transmission request does not indicate attribute information of the first audio stream.

[0057] In one possible implementation, the audio sink device further includes a sending unit configured to send an audio stream transmission change event of the first audio stream to the audio source device after the processing unit assigns the audio focus to the first audio stream in the form of a short focus.

[0058] In a sixth aspect, the present application provides a sound source device, comprising:

[0059] a processing unit, configured to obtain attribute information of the first audio stream;

[0060] The sending unit is configured to send the audio stream transmission request to the audio sink device; the attribute information is used to determine the audio focus type of the first audio stream.

[0061] In a possible implementation manner, the attribute information indicates one or more of the following: a first duration of the first audio stream, a first type of the first duration, or a priority of the first audio stream.

[0062] In one possible implementation, the attribute information indicates a first type of a first duration of the first audio stream; the audio source device further includes a receiving unit configured to receive first information from the audio sink device before the processing unit obtains the attribute information of the first audio stream; the first information includes the duration of one or more audio streams stored in the audio sink device;

[0063] The processing unit is further configured to determine a second duration based on the durations of the one or more audio streams; and determine the first type based on the second duration and the first duration.

[0064] In one possible implementation, when the aforementioned first duration is less than the aforementioned second duration, the aforementioned first type is a short audio duration type; or, when the aforementioned first duration is greater than the aforementioned second duration, the aforementioned first type is a long audio duration type.

[0065] In one possible implementation, before obtaining the attribute information of the first audio stream, the processing unit is further used to determine the attribute information of the first audio stream based on the associated information of the application to which the first audio stream belongs; the associated information of the application includes the audio play list, audio play mode or historical play data of the application.

[0066] In a possible implementation, the processing unit is further configured to, after acquiring attribute information of the first audio stream, determine, based on the attribute information, a storage space allocated to the first audio stream and / or a processing priority of the first audio stream.

[0067] In a seventh aspect, the present application provides a music sink device comprising a processor and a memory. The memory is coupled to the processor, and when the processor executes a computer program or computer instructions stored in the memory, the method described in any one of the first aspects can be implemented. The music sink device may also include a communication interface for communicating with other devices (e.g., a sound source device). Exemplarily, the communication interface may be a transceiver, circuit, bus, module, or other type of communication interface.

[0068] In a possible implementation, the audio sink device may include:

[0069] Memory for storing computer programs or computer instructions;

[0070] The processor is configured to: receive attribute information of a first audio stream from an audio source device through a communication interface; and determine an audio focus type of the first audio stream based on the attribute information, wherein the audio focus type is a long focus type or a short focus type.

[0071] In another possible implementation, when the processor executes a computer program or computer instruction stored in the memory, the method described in any one of the second aspects may be implemented. For example, the processor is configured to:

[0072] Allocate audio focus to the first audio stream in the form of a short focus; determine that the duration for which the first audio stream occupies the audio focus is greater than a threshold; and change the audio focus type of the first audio stream from a short focus to a long focus.

[0073] It should be noted that the computer programs or computer instructions in the memory of this application may be pre-stored or downloaded from the Internet and stored when the audio sink device is used. This application does not specifically limit the source of the computer programs or computer instructions in the memory. The coupling in the embodiments of this application is an indirect coupling or connection between units or modules, which can be electrical, mechanical, or other forms, and is used for information exchange between units or modules.

[0074] In an eighth aspect, the present application provides a sound source device comprising a processor and a memory. The memory is coupled to the processor, and when the processor executes a computer program or computer instructions stored in the memory, the method described in any one of the third aspects above can be implemented. The sound source device may also include a communication interface for communicating between the sound source device and another device (e.g., a sound sink device). Exemplarily, the communication interface may be a transceiver, circuit, bus, module, or other type of communication interface.

[0075] In a possible implementation, the sound source device may include:

[0076] Memory for storing computer programs or computer instructions;

[0077] The processor is configured to: obtain attribute information of a first audio stream; send the attribute information to a music sink device via a communication interface; and use the attribute information to determine an audio focus type of the first audio stream.

[0078] It should be noted that the computer program or computer instructions in the memory of this application can be pre-stored or downloaded from the Internet and stored when the audio source device is used. This application does not specifically limit the source of the computer program or computer instructions in the memory. The coupling in the embodiments of this application is an indirect coupling or connection between units or modules, which can be electrical, mechanical, or other forms, for information exchange between units or modules.

[0079] In a ninth aspect, an embodiment of the present application provides an audio communication system, comprising a sound sink device and a sound source device; wherein the sound sink device is used to execute the method described in any one of the first or second aspects above, and the sound source device is used to execute the method described in any one of the third aspects above.

[0080] In the tenth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program or computer instructions, and the aforementioned computer program or computer instructions are executed by a processor to implement the method described in any one of the above-mentioned first aspects.

[0081] In the eleventh aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program or computer instructions, and the aforementioned computer program or computer instructions are executed by a processor to implement the method described in any one of the above-mentioned second aspects.

[0082] In the twelfth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program or computer instructions, and the aforementioned computer program or computer instructions are executed by a processor to implement the method described in any one of the above-mentioned third aspects.

[0083] In a thirteenth aspect, an embodiment of the present application provides a computer program product. When the computer program product is executed by a processor, the method described in any one of the above-mentioned first aspects will be implemented.

[0084] In a fourteenth aspect, an embodiment of the present application provides a computer program product. When the computer program product is executed by a processor, the method described in any one of the above-mentioned second aspects will be implemented.

[0085] In a fifteenth aspect, an embodiment of the present application provides a computer program product. When the computer program product is executed by a processor, the method described in any one of the above third aspects will be implemented.

[0086] The solutions provided in the above-mentioned fourth to fifteenth aspects are used to implement or cooperate with the corresponding methods provided in the above-mentioned first, second or third aspects, and therefore can achieve the same or corresponding beneficial effects as the corresponding methods in the first, second or third aspects, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0087] Figures 1 and 2 are schematic diagrams of an audio stream requesting audio focus;

[0088] Figure 3 shows a schematic diagram of the system architecture;

[0089] FIG4 is a schematic diagram showing the interaction process between the audio source device and the audio sink device;

[0090] 5 to 7A are flowcharts of an audio control method according to an embodiment of the present application;

[0091] 8 to 12 are schematic structural diagrams of the device provided in the embodiments of the present application. DETAILED DESCRIPTION

[0092] In the embodiment of the present application, "multiple" refers to two or more. In the embodiment of the present application, "and / or" is used to describe the association relationship of associated objects, indicating three relationships that can exist independently. For example, A and / or B can represent: A exists alone, B exists alone, or A and B exist at the same time. The description methods such as "at least one (or at least one) of a1, a2, ... and an" adopted in the embodiment of the present application include the situation where any one of a1, a2, ... and an exists alone, and also include any combination of any multiple of a1, a2, ... and an, each of which can exist alone; for example, the description method of "at least one of a, b and c" includes the situation where a is alone, b is alone, c is alone, a and b combination, a and c combination, b and c combination, or a, b, c combination.

[0093] In the various embodiments of the present application, unless otherwise specified or there is a logical conflict, the terms and / or descriptions between the various embodiments are consistent and can be referenced by each other. The technical features in different embodiments can be combined to form new embodiments according to their inherent logical relationships.

[0094] The following first introduces the relevant concepts of technical terms involved in the embodiments of this application.

[0095] 1. Audio source: A device that generates and / or sends audio streams.

[0096] 2. Audio host: A device that receives and uses (including playing) audio streams.

[0097] 3. Audio Focus: Audio focus is a virtual control point introduced in the audio host to prevent mixing caused by two audio streams playing simultaneously. An audio stream must obtain audio focus before it can play. If it loses audio focus, the audio stream stops playing.

[0098] There are two types of audio focus: long focus and short focus. They are described below.

[0099] 4. Long Focus: Long focus indicates that audio will be played for a long time, and the audio focus will be occupied for a long time. When a new audio stream requests long focus, the audio stream currently holding audio focus permanently loses focus. Furthermore, after the audio stream releases focus, the audio stream that lost focus cannot regain focus.

[0100] 5. Short focus: Short focus means that the audio is played only briefly, and the audio focus is released quickly. When a new audio stream requests short focus, the current audio stream holding audio focus temporarily loses focus. After the new audio stream releases focus, the audio stream that lost focus regains focus.

[0101] 6. Audio Focus Management Stack: This is the data structure used by the audio host system to manage audio focus. Each element in the stack represents an application and the resources it occupies. The top element is the application holding audio focus. When a new application requests long focus, the stack element is removed and the new application is pushed onto the stack, causing other applications to permanently lose audio focus, as shown in Figure 1. When a new application requests short focus, it is pushed onto the stack as the top element and holds audio focus. When the new application releases audio focus, it is popped off the stack and transfers audio focus to the new top element, as shown in Figure 2.

[0102] It is understandable that the above-mentioned application can be any application that can have audio playback requirements, such as various music applications, audiobook applications, reading applications, or telephone applications, etc. Alternatively, the application can be, for example, an application that implements wireless communication or wired communication between the audio sink device and other devices (such as audio source devices). Taking the implementation of wireless communication as an example, the application can be, for example, a Spark Link communication application on the audio sink device, a long-term evolution (LTE) network communication application, a fifth-generation mobile communication technology (5G) communication application, a wireless local area network (e.g., Wi-Fi) communication application, a Bluetooth (BT) communication application, a Zigbee communication application, or an in-vehicle short-range wireless communication application, etc. It is understandable that the application can be an application that can be downloaded and installed in an application store, or it can be a mini-program, or it can be a web page, etc., and the embodiments of the present application are not limited thereto.

[0103] It is understandable that, when the above application has a requirement for playing an audio stream, the application can apply for an audio focus for the audio stream waiting to be played.

[0104] It is understood that audio focus can be represented by other names. Any object that can implement the function corresponding to the above audio focus is considered audio focus as described in the embodiments of this application. That is, the embodiments of this application do not limit the name of the object that implements this function. The embodiments of this application use the object called audio focus as an example for description.

[0105] For example, see Figure 3, which shows a schematic diagram of the system architecture of an embodiment of the present application. The system architecture includes a sound source device 310 and a sound sink device 320. Wired communication or wireless communication can be achieved between the sound source device 310 and the sound sink device 320. For example, the wireless communication between the sound source device 310 and the sound sink device 320 can be achieved through wireless communication technologies such as Spark Link technology, long term evolution (LTE) network technology, fifth generation mobile communication technology (5G), wireless local area network (e.g., Wi-Fi) technology, Bluetooth (BT) technology, Zigbee technology, or vehicle-mounted short-range wireless communication network technology.

[0106] The audio source device 310 may send an audio stream to the audio sink device 320 , and the audio sink device 320 may receive and use (eg, play) the audio stream.

[0107] For example, the above-mentioned sound source device 310 may include, but is not limited to, any electronic product based on an intelligent operating system, which can interact with the user through input devices such as a keyboard, a virtual keyboard, a touchpad, a touch screen, and a voice control device. Such as a smartphone, a tablet personal computer (Tablet PC), a handheld computer, a wearable electronic device, a personal computer (PC), a television, or a car-mounted device. Among them, the intelligent operating system includes, but is not limited to, any operating system that enriches the device's functions by providing various applications to the device, such as Android, IOS, Windows, MAC, or Harmony OS.

[0108] For example, the audio sink device 320 may include, but is not limited to, any electronic product based on an intelligent operating system that can interact with a user through input devices such as a keyboard, a virtual keyboard, a touchpad, a touch screen, and a voice control device, such as a smartphone, a tablet personal computer (Tablet PC), a handheld computer, a wearable electronic device, a personal computer (PC), a television, an in-vehicle device, headphones, or speakers.

[0109] It will be understood that the above description of the sound source device 310 and the sound sink device 320 is merely an example and does not constitute a limitation on the embodiments of the present application.

[0110] In one possible implementation, as exemplified in FIG4 , a schematic diagram illustrating the flow of interaction between the audio source device 310 and the audio sink device 320 is shown. The interaction between the audio source device 310 and the audio sink device 320 may include, but is not limited to, service discovery, audio attribute acquisition, audio stream configuration or reconfiguration, audio stream transmission channel opening or closing, audio stream transmission or stopping, and audio stream release. It is understood that a communication connection has already been established between the audio source device 310 and the audio sink device 320 prior to implementing the interaction process shown in FIG4 . This communication connection may be, for example, a wireless communication connection. The following exemplifies a specific implementation of the interaction process shown in FIG4 .

[0111] Service Discovery: In a specific implementation, the audio source device 310 and the audio sink device 320 may first perform a service discovery operation. The primary purpose of this service discovery operation is to allow the audio source device 310 to discover the audio services (e.g., audio stream management services and audio attribute disclosure services) provided by the audio sink device 320. During this service discovery process, the audio source device 310 can obtain the structure member information of the audio stream management service and audio attribute disclosure service in the audio sink device 320 to learn about the services provided by the audio sink device 320. This structure member information can be understood as descriptive information used to represent these services.

[0112] Audio Attribute Acquisition: After obtaining the structural member information of the audio attribute public service of the music sink device 320, the audio source device 310 can further obtain specific information from the audio attribute public service of the music sink device 320 to obtain the audio processing capabilities of the music sink device 320 (such as audio codec capabilities).

[0113] Audio Stream Configuration or Reconfiguration: After learning the audio processing capabilities of the audio sink device 320, the audio source device 310 can configure audio stream parameters within the capabilities of the audio sink device 320. For example, if the audio sink device 320 supports multiple encoders, the audio source device 310 can select one of these encoders as the encoder for the audio stream transmitted between the audio source device 310 and the audio sink device 320. Optionally, the audio stream parameters between the audio source device 310 and the audio sink device 320 can be reconfigured to determine more optimal audio stream parameters.

[0114] Opening or closing the audio stream transmission channel: After the audio stream parameters are configured between the source device 310 and the sink device 320, the source device 310 and the sink device 320 can negotiate to establish a transmission channel for the audio stream. Furthermore, after the audio stream transmission is complete, the source device 310 and the sink device 320 can close the audio stream transmission channel.

[0115] Audio Stream Transmission or Stoppage: After establishing the audio stream transmission channel, the audio source device 310 can transmit the audio stream to the audio sink device 320. After the audio source device 310 completes the audio stream transmission to the audio sink device 320, the audio stream transmission can be stopped. Alternatively, the audio stream transmission may be stopped due to a sudden loss of connection between the audio source device 310 and the audio sink device 320.

[0116] Audio stream release: After the audio stream transmission is completed or stopped, the audio source device 310 and the audio sink device 320 can release the resources occupied by the audio stream (such as access layer link resources) and clear the configured related parameters.

[0117] It will be understood that the process shown in FIG4 is merely an example and does not constitute a limitation to the embodiments of the present application.

[0118] In a specific implementation, in order to avoid mixing caused by the simultaneous playback of audio streams from two applications, an audio focus design is introduced in the system of the audio host device. Audio focus includes two types: long focus and short focus. Long focus is suitable for audio streams with longer audio durations, while short focus is suitable for audio streams with shorter audio durations. However, in some existing audio application scenarios, such as wireless audio application scenarios, the system of the audio host device defaults to applying for a single type of audio focus, resulting in the inability to reasonably allocate audio service resources, affecting the user experience. To this end, an embodiment of the present application provides an audio control method.

[0119] For example, see Figure 5, which shows a flowchart of an audio control method provided by an embodiment of the present application. The method includes but is not limited to the following steps:

[0120] S501: The audio source device sends attribute information of a first audio stream to the audio sink device.

[0121] For example, the sound source device may be the sound source device 310 shown in FIG3 . The sound sink device may be the sound sink device 320 shown in FIG3 .

[0122] In one possible implementation, the attribute information of the first audio stream may be carried in an audio stream transmission request and sent to the audio sink device. That is, the audio source device sends an audio stream transmission request to the audio sink device, and the audio stream transmission request includes the attribute information. In a specific implementation, the audio stream transmission request may be a message sent by the audio source device to the audio sink device after establishing an audio stream transmission channel between the audio source device and the audio sink device, requesting the transmission of the audio stream. This message is used to inform the audio sink device that the audio source device is preparing to send an audio stream to the audio sink device, so that the audio sink device can prepare to receive the audio stream. This preparation may include, for example, requesting an audio focus and storage space (e.g., buffer space) for the received audio stream. A detailed description is provided in the subsequent description and is not detailed here.

[0123] The establishment of the audio stream transmission channel can be exemplified by referring to the description of the audio stream transmission channel opening step in Figure 4. The audio stream transmission request can be, for example, a message sent in the audio stream transmission phase in Figure 4.

[0124] In another possible implementation, the attribute information of the first audio stream may be included in an audio stream configuration request and sent to the audio sink device. Alternatively, the attribute information of the first audio stream may be included in an audio stream configuration response message and sent to the audio sink device. Exemplarily, the audio stream configuration response message may be a response message sent by the audio source device to the audio sink device based on the audio stream configuration message sent by the audio sink device. The following description uses the example of the attribute information of the first audio stream being included in the audio stream configuration request. That is, the audio source device sends an audio stream configuration request to the audio sink device, and the audio stream configuration request includes the attribute information. In a specific implementation, the audio stream configuration request may be a message sent by the audio source device to the audio sink device requesting the audio stream configuration after obtaining specific information from the audio attribute disclosure service of the audio sink device. This message is used to inform the audio sink device of the configured audio stream parameters (e.g., codec parameters, transmission mode parameters, or transparent transmission mode parameters, etc.). A detailed description is provided in the subsequent description and is not elaborated here.

[0125] For example, the specific information in the audio attribute disclosure service of the audio sink device can be referred to the description of the audio attribute acquisition step in Figure 4. The audio stream configuration request can be, for example, the message sent during the audio stream configuration or reconfiguration phase in Figure 4.

[0126] Exemplarily, the attribute information of the first audio stream may include one or more of the following: a first duration of the first audio stream, a first type of the first duration, or a priority of the first audio stream.

[0127] Exemplarily, the duration of an audio stream may be represented by a value obtained by multiplying the inverse of the sampling rate of the audio stream (ie, the sampling period) by the number of sampling points of the audio stream.

[0128] Exemplarily, the duration type of the audio stream may include a short audio duration type and a long audio duration type. If the duration of the audio stream is less than or equal to a certain threshold (referred to as threshold 1), it belongs to the short audio duration type. If the duration of the audio stream is greater than or equal to a certain threshold (referred to as threshold 2), it belongs to the long audio duration type. The threshold 1 and threshold 2 may be equal or unequal. If they are not equal, the threshold 2 is greater than the threshold 1. The threshold 1 and threshold 2 may be set according to actual implementation, and the embodiments of the present application do not impose any restrictions on this.

[0129] Exemplarily, the priority of an audio stream can include two types: high priority and low priority. In one possible implementation, the priority of the audio stream can be determined based on the application to which the audio stream belongs. For example, if the audio stream comes from an application with a high probability of playing audio for a long time, such as a phone application, a music player application, or a book listening application, then the priority of the audio stream is high priority. Conversely, if the audio stream comes from an application with a high probability of playing audio (message prompt tone) for a short time, such as a text message application or a message notification application, then the priority of the audio stream is low priority. In another possible implementation, the priority of the audio stream can be determined based on the duration of the audio stream. For its specific implementation, please refer to the determination of the type of audio stream duration mentioned above. Then, if the duration of the audio stream is less than a certain threshold, the priority of the audio stream is low priority. If the duration of the audio stream is greater than a certain threshold, the priority of the audio stream is high priority. If the duration of the audio stream is equal to the certain threshold, the priority of the audio stream can be low priority or high priority. It will be understood that this is merely an example and does not constitute a limitation to the embodiments of the present application.

[0130] In one possible implementation, the attribute information of the first audio stream includes the first duration. For example, it is assumed that the first duration cannot be calculated by the sampling rate and number of sampling points of the first audio stream. For example, the duration of a real-time audio stream that depends on user operations, such as music or calls, is uncertain. In this case, the sound source device can determine the duration of the first audio stream based on the associated information of the application to which the first audio stream belongs. The associated information of the application may include the audio playlist, audio playback mode or historical playback data of the application. For example, it is assumed that the application to which the first audio stream belongs is a music application or a telephone application. Then, the duration of the first audio stream is estimated based on the associated information of the application by means of historical data statistics or artificial intelligence (AI) analysis. It can be understood that the method of estimating the duration of the first audio stream is only an example, and the embodiments of the present application do not limit this method and its specific implementation process.

[0131] In one possible implementation, the attribute information of the first audio stream includes the first type. Furthermore, the first type is determined based on the duration of one or more audio streams stored in the audio sink device. In this case, before the audio source device sends the attribute information of the first audio stream to the audio sink device, the audio sink device may send the duration of the one or more audio streams to the audio source device. For an exemplary implementation process, see Figure 6.

[0132] In Figure 6, the audio source device may first send a request message to the audio sink device to obtain the local audio stream attributes of the audio sink device (see S501A). Exemplarily, the request message may be a command to read the local audio stream attributes (SSAP_REA D_REQ (Local Audio Stream Attributes)). After receiving the request message, the audio sink device may obtain information about one or more locally stored audio streams based on the request message. The information about the one or more audio streams may include the duration of the one or more audio streams. Optionally, the information about the one or more audio streams may also include information such as the number of the one or more audio streams and the type of the one or more audio streams.

[0133] Illustratively, the information of the one or more audio streams described above is an attribute of a local audio stream environment in the audio sink device. The attributes of the local audio stream environment may be designed and stored in an audio stream management service in the audio sink device. For more information, see Table 1, which exemplifies the attributes of the local audio stream environment.

[0134] Table 1

[0135]

[0136] As can be seen in Table 1, the local audio stream environment attributes of the audio sink device can be obtained by reading from the audio source device or receiving a notification. In addition, the number of audio streams included in the local audio stream environment attributes can occupy 1 byte, the audio stream type occupies 2 bytes, and the audio stream duration occupies 3 bytes. The local audio stream environment attributes can support one or more of the following permissions: authentication permission, encryption permission, or authorization permission. Among them, authentication permission supports whether authentication is required or not; encryption permission supports whether encryption is required or not; authorization permission supports whether authorization is required or not. The specific definition of the one or more permissions can be specified by the audio use case standard and is not limited by the embodiments of this application. In addition, the above-mentioned "required" option indicates that the local audio stream environment attributes are attributes that must exist in the audio stream management service of the audio sink device. It will be understood that the local audio stream environment attributes of the audio sink device shown in Table 1 above are only examples and do not constitute a limitation on the embodiments of this application.

[0137] In another possible implementation, the duration of the one or more audio streams can be stored in the audio focus management stack of the audio host device. Based on the previous description, it can be seen that the one or more audio streams have their own applications. For example, in a specific implementation, the application to which the audio stream belongs can add the duration parameter of the audio stream in the audio focus management stack to the audio focus management stack through the audio focus application interface. For example, based on the previous introduction, it can be seen that each element in the stack represents an application and the resources it occupies. Then, the duration parameter of an audio stream can be saved in the data structure of the corresponding element of the application to which the audio stream belongs in the audio focus management stack. In this case, the above-mentioned audio host device can obtain the duration of the one or more audio streams from the audio focus management stack based on the request message of the above-mentioned local audio stream attributes. Optionally, the number of the one or more audio streams and the type of the one or more audio streams can also be obtained from the audio focus management stack.

[0138] After the music sink device obtains the local audio stream attribute information based on the request message, it may send the local audio stream attribute information to the sound source device (see S501B in FIG. 6 ). For example, the music sink device may carry the local audio stream attribute information in a local audio stream attribute read response message (SSAP_READ_RSP message) to send to the sound source device.

[0139] Exemplarily, the above steps S501A and S501B may be interactive steps in the audio attribute acquisition process shown in FIG. 4 .

[0140] After receiving the message from the music sink device, the sound source device obtains the duration of one or more audio streams stored locally in the music sink device. The sound source device may then determine the first type based on the duration of the one or more audio streams. Exemplarily, the sound source device may calculate a threshold (referred to as the second duration) for determining the first type based on the duration of the one or more audio streams. Exemplarily, the second duration may be the average or weighted average of the durations of the one or more audio streams, or the maximum value among the durations of the one or more audio streams. After obtaining the second duration, the sound source device may compare the first duration of the first audio stream with the second duration. If the first duration is less than the second duration, the first type is a short audio duration type. If the first duration is greater than the second duration, the first type is a long audio duration type. If the first duration is equal to the second duration, the first type may be either a short audio duration type or a long audio duration type.

[0141] In another possible implementation, the attribute information of the first audio stream includes the priority of the first audio stream. If the priority is determined based on the duration of the audio stream, then the determination of the priority of the first audio stream can refer to the determination of the first type. Exemplarily, if the first duration of the first audio stream is less than the second duration, then the priority of the first audio stream is low priority. If the first duration of the first audio stream is equal to the second duration, then the priority of the first audio stream is high priority. If the first duration of the first audio stream is equal to the second duration, then the priority of the first audio stream can be low priority or high priority.

[0142] In an embodiment of the present application, based on the local audio stream attribute information in the music sink device, the type or priority of the duration of the audio stream to be transmitted from the sound source device to the music sink device is determined. This allows the music sink device to more reasonably determine the audio focus of the audio stream based on the type or priority of the duration, thereby achieving reasonable allocation of audio playback resources.

[0143] For example, in one possible implementation, the audio stream transmission request may be an audio stream transmission message (SSAP_CALL_METHOD_REQ message). In an embodiment of the present application, an audio occupancy field may be added to the audio stream transmission message. The audio occupancy field then carries attribute information of the first audio stream. For ease of understanding, see Table 2 for an example.

[0144] Table 2

[0145]

[0146] Table 2 illustrates an exemplary description of an audio stream transmission message. As can be seen in Table 2, the audio stream transmission message may carry the opcode 0x03, indicating that it is an audio stream transmission message. This opcode may occupy one byte. Furthermore, the audio stream transmission message includes several parameters (or fields): the number of audio access points, the audio access point identifier, and the audio occupancy. The number of audio access points field occupies one byte and describes the number of audio access points to be operated. The audio access point identifier field occupies one byte and describes the identifier of the audio access point to be operated. The audio occupancy field occupies four bytes and describes the audio stream duration type and / or the audio stream duration. The audio stream duration type in the audio occupancy field occupies one byte. 0x00 indicates that the audio stream duration type (or occupancy type) is unspecified; 0x01 indicates that the audio stream duration type is a short audio duration type (or a short occupancy type); and 0x02 indicates that the audio stream duration type is a long audio duration type (or a long occupancy type). The Audio Occupancy field specifies the duration of the audio stream, which occupies three bytes. 0x000000 can be used to indicate an unspecified audio stream duration, followed by a specific value to indicate the specific audio stream duration. This embodiment of the present application does not limit the duration of the audio stream. Furthermore, the Audio Occupancy field may include reserved bits, which are currently undefined.

[0147] In another possible implementation, the audio occupancy field may also be used to carry the priority of the audio stream. The specific representation method may refer to the representation method of the audio stream duration type, which will not be described in detail here.

[0148] For example, in one possible implementation, the audio stream configuration request may be an audio stream configuration message (SSAP_CALL_METHOD_REQ message). In this embodiment of the present application, an audio occupancy field may be added to the audio stream configuration message. The audio occupancy field then carries attribute information of the first audio stream. For ease of understanding, see Table 3 for an example.

[0149] Table 3

[0150]

[0151] Table 3 exemplifies the relevant description of the Audio Stream Configuration Message. As can be seen in Table 3, the Audio Stream Configuration Message may carry the opcode 0x01, indicating that the message is an Audio Stream Configuration Message. This opcode may occupy a length of 1 byte. Similar to Table 2 above, the Audio Stream Configuration Message also includes the following parameters (or fields): Number of Audio Host Access Points, Audio Host Access Point Identifier, and Audio Occupancy. For detailed descriptions of these parameters, please refer to the relevant descriptions in Table 2 above and are not repeated here. Furthermore, the Audio Stream Configuration Message also includes the following fields: Codec Identifier, Codec Parameters, Transmission Mode, Transparent Transmission Mode, Service Data Unit (SDU) Period, Audio Stream Type, and Port Number. For detailed descriptions of these fields, please refer to Table 3 above and are not repeated here.

[0152] It can be understood that the above-mentioned audio stream transmission message and audio stream configuration message can both be represented by SSAP_CALL_METHOD_REQ. The difference is that different messages can be distinguished by operation codes in the SSAP_CALL_METHOD_REQ message.

[0153] In a specific implementation, after obtaining the attribute information of the first audio stream, the audio source device may add the attribute information to the audio stream transmission request (e.g., to the audio occupancy field of the audio stream transmission message) and send the request to the audio sink device. Alternatively, after obtaining the attribute information of the first audio stream, the audio source device may add the attribute information to the audio stream configuration request (e.g., to the audio occupancy field of the audio stream configuration message) and send the request to the audio sink device.

[0154] S502: The audio sink device receives attribute information of the first audio stream from the audio source device.

[0155] The audio sink device receives the audio stream transmission request or audio stream configuration request from the audio source device and obtains attribute information of the first audio stream from the request. For example, the attribute information of the first audio stream may be obtained from the audio occupancy field of the audio stream transmission message or audio stream configuration message.

[0156] S503: The audio sink device determines an audio focus type of the first audio stream based on the attribute information, where the audio focus type is a long focus type or a short focus type.

[0157] In one possible implementation, the attribute information of the first audio stream obtained by the audio sink device includes the first type. In this case, if the attribute information of the first audio stream also includes the first duration, the audio sink device may first determine whether the first type is reasonable based on the first duration. Exemplarily, the audio sink device may compare the first duration with a threshold for determining the type of audio stream duration (i.e., the second duration). Exemplarily, the audio sink device may obtain the duration of one or more audio streams stored in the audio sink device from the audio focus management stack or the local audio stream environment attributes stored by the audio stream management service. Then, similar to the method used by the audio source device to obtain the second duration, the second duration is obtained by taking the average, weighted average, or maximum value of the durations of the one or more audio streams.

[0158] If the first duration obtained is less than or equal to the second duration, and the first type obtained is a short audio duration type, then the first type is reasonable. Alternatively, if the first duration is greater than or equal to the second duration, and the first type obtained is a long audio duration type, then the first type is reasonable. If the first duration is less than or equal to the second duration, and the first type obtained is a long audio duration type, then the first type is unreasonable. Alternatively, if the first duration is greater than or equal to the second duration, and the first type obtained is a short audio duration type, then the first type is unreasonable.

[0159] If the first type obtained above is reasonable, the audio sink device may determine the audio focus type of the first audio stream based on the first type. Specifically, if the first type is a short audio duration type, then the audio focus type of the first audio stream may be determined to be a short focus type. If the first type is a long audio duration type, then the audio focus type of the first audio stream may be determined to be a long focus type.

[0160] If the first type of information obtained above is unreasonable, in one possible implementation, the audio sink device may reject the audio stream transmission request or audio stream configuration request from the audio source device. The audio sink device may also send a response message (e.g., an SSAP_CALL_METHOD_RSP message) to the audio stream transmission request or audio stream configuration request to the audio source device. The response message to the audio stream transmission request or audio stream configuration request may carry a result code indicating that the first type of information included in the audio stream transmission request or audio stream configuration request is unreasonable. Furthermore, the response message to the audio stream transmission request may also carry an operation code 0x03, the number of audio access points, and an audio access point identifier. The meaning of these items of information can be found in the description of Table 2 above and are not further described here. Alternatively, the response message to the audio stream configuration request may also carry an operation code 0x01, the number of audio access points, and an audio access point identifier. The meaning of these items of information can be found in the description of Table 3 above and are not further described here.

[0161] In another possible implementation, if the first type obtained is unreasonable, the audio sink device may not adopt the first type specified in the audio stream transmission request or audio stream configuration request. Instead, the duration type of the first audio stream may be re-determined based on the first duration included in the audio stream transmission request or audio stream configuration request. Specifically, if the first duration is less than the second duration, the duration type of the first audio stream is determined to be a short audio duration type. If the first duration is greater than the second duration, the duration type of the first audio stream is determined to be a long audio duration type. If the first duration is equal to the second duration, the duration type of the first audio stream is determined to be a short audio duration type or a long audio duration type. The audio focus type of the first audio stream is then determined based on the re-determined duration type of the first audio stream. For the specific implementation, see the previous description and are not repeated here.

[0162] Alternatively, the audio sink device may not re-determine the type of the duration of the first audio stream, but instead determine the audio focus type of the first audio stream based on the first duration included in the audio stream transmission request or the audio stream configuration request. Specifically, the audio sink device may compare the first duration with a preset threshold or with the second duration. If the first duration is less than the preset threshold (or the second duration), the audio focus type of the first audio stream is determined to be a short focus type. If the first duration is greater than the preset threshold (or the second duration), the audio focus type of the first audio stream is determined to be a long focus type. If the first duration is equal to the preset threshold (or the second duration), the audio focus type of the first audio stream is determined to be a short focus type or a long focus type. It is understandable that the preset threshold can be set according to actual implementation and is not limited in the embodiments of this application.

[0163] In an embodiment of the present application, when the audio stream duration type specified by the sound source device is unreasonable, the audio sink device can select a reasonable audio focus type based on the duration of the audio stream indicated by the sound source device, thereby quickly applying for an available audio focus for the audio stream, playing the audio as quickly as possible, and improving the user experience.

[0164] In another possible implementation, the attribute information of the first audio stream obtained by the audio sink device includes the first type, but does not include the first duration. For example, in the audio stream transmission message sent by the audio source device to the audio sink device, the value of the audio stream duration in the audio occupancy field is 0x000000, indicating that the duration of the first audio stream is not specified. In this case, the audio sink device may not determine whether the first type is reasonable. Instead, it determines the audio focus type of the first audio stream based on the first type. The specific implementation is described above and is not further elaborated here.

[0165] In one possible implementation, the attribute information of the first audio stream obtained by the music sink device includes the first duration but does not include the first type. In this case, the music sink device may determine the audio focus type of the first audio stream based on the first duration. Specifically, the music sink device may compare the first duration with a preset threshold or the second duration. If the first duration is less than the preset threshold (or the second duration), the audio focus type of the first audio stream is determined to be a short focus type. If the first duration is greater than the preset threshold (or the second duration), the audio focus type of the first audio stream is determined to be a long focus type. If the first duration is equal to the preset threshold (or the second duration), the audio focus type of the first audio stream is determined to be a short focus type or a long focus type. It is understood that the preset threshold can be set according to actual implementation and is not limited in the embodiments of this application.

[0166] In one possible implementation, the attribute information of the first audio stream obtained by the music sink device includes the priority of the first audio stream. In this case, the music sink device may determine the audio focus type of the first audio stream based on the priority of the first audio stream. Specifically, if the priority of the first audio stream is high, the audio focus type of the first audio stream is determined to be a long focus type. If the priority of the first audio stream is low, the audio focus type of the first audio stream is determined to be a short focus type.

[0167] In summary, in this solution, the audio sink device determines the audio focus type of the audio stream based on the audio stream attribute information from the audio source device and / or the local audio stream environment attributes of the audio sink device, so that the determined audio focus type matches the audio duration of the audio stream or is consistent with the operating status of the audio sink device, thereby achieving a reasonable allocation of audio playback resources and improving the user experience.

[0168] In one possible implementation, the audio source device and / or the audio sink device may determine the storage space allocated for the first audio stream and / or the processing priority of the first audio stream based on the attribute information of the first audio stream. These are described below.

[0169] For example, in the audio source device, before the audio sink device sends the first audio stream, it first caches the first audio stream in a sending queue and waits for transmission. The audio source device can then allocate a reasonable amount of cache space for the first audio stream based on the duration of the first audio stream (i.e., the first duration described above).

[0170] In another implementation, the sound source device can also determine the sending order of the first audio stream based on the first duration. For example, if the first duration is less than a threshold (referred to as threshold 3), indicating that the number of audio frames that need to be buffered for the first audio stream is small, the first audio stream can be sent first. If the first duration is greater than or equal to the threshold 3, indicating that the number of audio frames that need to be buffered for the first audio stream is large, if it is sent first, it will affect the sending of other business information. In this case, the first audio stream can be sent normally according to the queuing order of the sending queue. It can be understood that the threshold 3 can be set according to the actual implementation, and the implementation method of this application does not limit it.

[0171] For example, in existing implementations of a music sink device, the buffer allocated to an audio stream is typically a fixed empirical value, which generally has a large margin. If the duration of the received audio stream is short, allocating this fixed buffer for storage would waste storage resources. In this solution, the music sink device can obtain the first duration of the first audio stream and can therefore allocate a buffer for the first audio stream based on the actual duration, thereby saving storage resources. If the first duration is less than a threshold (referred to as threshold 4), the music sink device can allocate storage space for the first audio stream sufficient to store the audio stream of the first duration. It is understood that threshold 4 can be set based on actual implementation and is not limited in the present embodiments.

[0172] In another possible implementation, if the first duration is greater than or equal to the aforementioned threshold 4, the audio sink device may allocate a smaller storage space (referred to as the first storage space) for the first audio stream. The duration of the audio stream that can be stored in the first storage space is less than the first duration, but the first storage space can be used to cyclically store unused audio streams in the first audio stream. For example, the first audio stream is gradually sent to the audio sink device in the form of a stream. The audio sink device can receive the first audio stream while storing the received portion of the audio stream in the first storage space, while simultaneously retrieving and using (e.g., playing) the audio stream from the first storage space. Already used audio streams can be released from the first storage space to make room for storing newly received portions of the audio stream.

[0173] In another possible implementation, the audio sink device may learn the first type of the first duration of the first audio stream and may therefore allocate a buffer for the first audio stream based on the first type. For example, if the first type is a short audio duration type, the audio sink device may allocate storage space for the first audio stream sufficient to store the audio stream of the first duration. If the first type is a long audio duration type, the audio sink device may allocate a smaller storage space for the first audio stream. For details, please refer to the description in the previous paragraph and will not be repeated here.

[0174] In another possible implementation, the above-mentioned audio host device can also determine whether to give priority to (for example, play) the above-mentioned first audio stream based on the above-mentioned first duration or the above-mentioned first type. For example, if the above-mentioned first duration is less than the threshold value 5 or the above-mentioned first type is a short audio duration type, it can be determined that the first audio stream is given priority (for example, played). Conversely, if the above-mentioned first duration is greater than or equal to the threshold value 5 or the above-mentioned first type is a long audio duration type, the first audio stream can be used (for example, played) after the current audio stream is completed. It can be understood that the above-mentioned threshold value 5 can be set according to actual implementation and is not limited in the implementation mode of this application.

[0175] It should be understood that the above description is only an example and does not constitute a limitation to the embodiments of the present application.

[0176] In another possible implementation, the present application provides another audio control method, which can be exemplified in FIG7 . The method includes but is not limited to the following steps:

[0177] S701: The audio sink device allocates an audio focus to the first audio stream in the form of a short focus.

[0178] In one possible implementation, after receiving an audio stream transmission request for a first audio stream from a sound source device, the music sink device may allocate audio focus to the first audio stream in the form of a short focus. Specifically, the sound source device sends the audio stream transmission request to the music sink device, and the music sink device may receive the audio stream transmission request. After receiving the audio stream transmission request, the music sink device may be informed that the sound source device is about to send an audio stream (i.e., the first audio stream) to the music sink device. The application in the music sink device to which the first audio stream belongs may then request audio focus for the first audio stream. Specifically, a short focus type of audio focus may be requested for the first audio stream. The music sink device may allocate audio focus to the application to which the first audio stream belongs in the form of a short focus. After receiving the first audio stream, the music sink device may use (e.g., play) the first audio stream based on the short focus type of audio focus.

[0179] In this embodiment of the present application, the audio stream transmission request does not indicate attribute information of the first audio stream. For example, the audio stream transmission request does not indicate the first duration of the first audio stream and the first type of the first audio stream duration, nor does it indicate the priority of the first audio stream. For other information about the audio stream transmission request, please refer to the corresponding description in S501 of Figure 5 above, which will not be repeated here.

[0180] In another possible implementation, the music sink device may proactively send an audio stream transmission change event for the first audio stream to the sound source device to request the sound source device to send the first audio stream. Furthermore, the music sink device may allocate audio focus to the first audio stream in the form of a short focus before sending the audio stream transmission change event to the sound source device. Specifically, the application to which the first audio stream belongs in the music sink device may request an audio focus for the first audio stream. Specifically, an audio focus of the short focus type may be requested for the first audio stream. The music sink device may allocate audio focus to the application to which the first audio stream belongs in the form of a short focus. Then, after receiving the first audio stream, the music sink device may use (e.g., play) the first audio stream based on the audio focus of the short focus type.

[0181] For example, after the audio channel is opened and the audio sink device is ready to receive the audio stream (for example, by applying for audio focus, etc.), the audio sink device may proactively send an audio stream transmission change event of the first audio stream to the audio source device.

[0182] S702: The audio sink device determines that the duration that the first audio stream occupies the audio focus is greater than a threshold.

[0183] In a specific implementation, the above-mentioned audio sink device receives a first audio stream from a sound source device. And uses (for example, plays) the first audio stream based on the short focus type audio focus of the above-mentioned application. After the audio sink device plays the above-mentioned first audio stream based on the short focus type audio focus, it can detect the duration of time that the first audio stream (or the application to which the first audio stream belongs) occupies the audio focus. For example, a timer can be set. When the duration of the timer reaches a preset duration threshold, it can be determined that the duration of time that the first audio stream occupies the audio focus is greater than the threshold.

[0184] S703: The audio sink device changes the audio focus type of the first audio stream from short focus to long focus.

[0185] After the audio sink device determines that the duration of the first audio stream occupying the audio focus exceeds a threshold, it indicates that the duration of the first audio stream is long and the short focus type requested for it is unreasonable. In this case, the audio sink device may change the audio focus type of the first audio stream from short focus to long focus so that the first audio stream can continue to be used (e.g., played).

[0186] It is understood that when the audio sink device allocates short-focus audio focus to the application belonging to the first audio stream, it may not release the information of other applications in the audio focus management stack. Instead, it may add the information of the application belonging to the first audio stream to the audio focus management stack as the top element. In other words, the application belonging to the first audio stream obtains audio focus. When the audio sink device changes the short-focus to long-focus, it may remove the element from the audio focus management stack, pushing the application belonging to the first audio stream into the stack to obtain audio focus, while other applications permanently lose audio focus.

[0187] In another possible implementation, after the above-mentioned audio host device uses (for example, plays) the first audio stream based on the audio focus of the above-mentioned short focus type, if the duration that the first audio stream occupies the audio focus is still less than the above-mentioned preset duration threshold until the first audio stream is used (for example, played) until the first audio stream is completed, the above-mentioned audio focus type change operation will not be triggered.

[0188] For ease of understanding, please refer to Figure 7A for example. Assume that the audio focus management stack of a music sink device includes information about Application 1, Application 2, and Application 3. The durations of the audio streams of Application 1, Application 2, and Application 3 are Duration 1, Duration 2, and Duration 3, respectively. The current top element in the stack is Application 3, meaning that Application 3 holds the audio focus. Assume that the application to which the first audio stream belongs is Application 4. Application 4 first requests a short focus type of audio focus. Then, Application 3, the top element in the stack, loses audio focus, and Application 4 is pushed into the stack, taking up the short focus type. After Application 4 takes up the audio focus, the music sink device can play the first audio stream based on the short focus type. A timer can be set from the time Application 4 takes up the audio focus. When the timer reaches a preset duration threshold, it can be determined that Application 4 (or the first audio stream) has occupied the audio focus for a duration greater than the threshold. In this case, Application 4 can instead request a long focus type. In this case, all elements in the audio focus management stack (Application 1, Application 2, and Application 3) are popped, and Application 4 is pushed onto the stack to occupy the audio focus. Applications 1, 2, and 3 permanently lose focus. If Application 4 (or the first audio stream) occupies the audio focus for less than a threshold (i.e., before the timer reaches the preset duration threshold), and the first audio stream has finished playing, Application 4 releases the audio focus and is popped off the stack. The new top element, Application 3, regains focus.

[0189] In an embodiment of the present application, the audio host device dynamically applies for a corresponding type of audio focus for the audio stream based on the duration of the audio focus occupied by the audio stream, so that the type of audio focus applied for matches the audio duration of the audio stream, thereby achieving a reasonable allocation of audio playback resources and improving the user experience.

[0190] The above mainly introduces the audio control method provided in the embodiment of the present application. It is understandable that, in order to realize the corresponding functions mentioned above, each control unit or device includes a hardware structure and / or software module corresponding to the execution of each function. In combination with the units and steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

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

[0192] In the case of dividing each functional module according to each function, an embodiment of the present application also provides an apparatus for implementing any of the above methods, for example, providing an apparatus including units (or means) for implementing each step in any of the above methods.

[0193] For example, please refer to FIG8 , which is a schematic diagram of the structure of a music sink device 800 provided in an embodiment of the present application. The music sink device 800 may include a receiving unit 801 and a processing unit 802.

[0194] The receiving unit 801 is configured to receive attribute information of a first audio stream from an audio source device. The receiving unit 801 can be configured to implement the receiving operation of S502 in FIG. 5 , for example.

[0195] The processing unit 802 is configured to determine the audio focus type of the first audio stream based on the attribute information, where the audio focus type is a long focus type or a short focus type. The processing unit 802 can, for example, be configured to implement the audio focus type determination operation in S503 in FIG5 .

[0196] In a possible implementation, the attribute information indicates one or more of the following: a first duration of the first audio stream, a first type of the first duration, or a priority of the first audio stream.

[0197] In one possible implementation, the attribute information indicates a first type of a first duration of the first audio stream. The music sink device 800 further includes a sending unit configured to send first information to the sound source device before the receiving unit 801 receives the attribute information of the first audio stream from the sound source device. The first information includes the duration of one or more audio streams stored in the music sink device 800, and the duration of the one or more audio streams is used to determine the first type.

[0198] In a possible implementation, the sending unit is specifically configured to send a local audio stream attribute reading response message to the audio source device, where the local audio stream attribute reading response message includes the first information.

[0199] In a possible implementation, the duration of the one or more audio streams is stored in an audio focus management stack of the audio sink device 800 .

[0200] In one possible implementation, the attribute information indicates a first type of a first duration of the first audio stream; when the first type is a short audio duration type, the audio focus type of the first audio stream is a short focus type; or, when the first type is a long audio duration type, the audio focus type of the first audio stream is a long focus type.

[0201] In one possible implementation, the attribute information indicates a first duration of the first audio stream; when the first duration is less than a first threshold, the audio focus type of the first audio stream is a short focus type; or, when the first duration is greater than the first threshold, the audio focus type of the first audio stream is a short focus type.

[0202] In a possible implementation manner, the receiving unit 801 is specifically configured to:

[0203] The attribute information of the first audio stream is received from the audio source device during the audio stream configuration or reconfiguration phase; or the attribute information of the first audio stream is received from the audio source device during the audio stream transmission phase.

[0204] In a possible implementation, the processing unit 802 is further configured to determine a storage space allocated to the first audio stream and / or a processing priority of the first audio stream based on the attribute information.

[0205] In one possible implementation, the processing unit 802 is specifically used to: allocate a first storage space for the first audio stream when the attribute information indicates that the first duration of the first audio stream is greater than a second threshold; the duration of the audio stream that can be stored in the first storage space is less than the first duration, and the first storage space is used to cyclically store unused audio streams in the first audio stream.

[0206] The specific operations and beneficial effects of each unit in the audio sink device 800 shown in FIG8 can be found in the corresponding descriptions of FIG5 and its possible embodiments, and will not be repeated here.

[0207] For example, please refer to FIG9 , which is a schematic diagram of the structure of a music sink device 900 provided in an embodiment of the present application. The music sink device 900 may include a processing unit 901 . In particular:

[0208] Processing unit 901 is configured to allocate audio focus to the first audio stream in the form of a short focus based on the audio stream transmission request; determine that the duration that the first audio stream occupies the audio focus is greater than a threshold; and change the audio focus type of the first audio stream from short focus to long focus. Processing unit 901 can, for example, be configured to implement operations S701 to S703 in FIG. 7 .

[0209] In a possible implementation, the audio stream transmission request does not indicate attribute information of the first audio stream.

[0210] In one possible implementation, the audio sink device further includes a receiving unit configured to receive an audio stream transmission request for the first audio stream from the audio source device before the processing unit allocates audio focus to the first audio stream in the form of a short focus; the audio stream transmission request does not indicate attribute information of the first audio stream.

[0211] In a possible implementation, the audio sink device further includes a sending unit configured to send an audio stream transmission change event of the first audio stream to the audio source device after the processing unit assigns the audio focus to the first audio stream in the form of a short focus.

[0212] The specific operations and beneficial effects of each unit in the audio sink device 900 shown in FIG. 9 can be found in the corresponding descriptions in FIG. 7 and its possible embodiments, and will not be repeated here.

[0213] For example, please refer to FIG10 , which is a schematic diagram of the structure of a sound source device 1000 provided in an embodiment of the present application. The sound source device 1000 may include a processing unit 1001 and a sending unit 1002.

[0214] The processing unit 1001 is configured to obtain attribute information of a first audio stream.

[0215] The sending unit 1002 is configured to send the audio stream transmission request to the audio sink device; the attribute information is used to determine the audio focus type of the first audio stream. The sending unit 1002 can be used to implement the sending operation of S501 in Figure 5 above.

[0216] In a possible implementation, the attribute information indicates one or more of the following: a first duration of the first audio stream, a first type of the first duration, or a priority of the first audio stream.

[0217] In one possible implementation, the attribute information indicates a first type of a first duration of the first audio stream; the audio source device 1000 further includes a receiving unit configured to receive first information from the audio sink device before the processing unit 1001 obtains the attribute information of the first audio stream; the first information includes the duration of one or more audio streams stored in the audio sink device;

[0218] The processing unit 1001 is further configured to determine a second duration based on the durations of the one or more audio streams; and determine the first type based on the second duration and the first duration.

[0219] In one possible implementation, when the first duration is less than the second duration, the first type is a short audio duration type; or, when the first duration is greater than the second duration, the first type is a long audio duration type.

[0220] In one possible implementation, before obtaining the attribute information of the first audio stream, the processing unit 1001 is further used to determine the attribute information of the first audio stream based on the associated information of the application to which the first audio stream belongs; the associated information of the application includes the audio play list, audio playback mode or historical playback data of the application.

[0221] In a possible implementation, the processing unit 1001 is further configured to, after acquiring the attribute information of the first audio stream, determine, based on the attribute information, a storage space allocated to the first audio stream and / or a processing priority of the first audio stream.

[0222] The specific operations and beneficial effects of each unit in the sound source device 1000 shown in FIG. 10 can be found in the corresponding descriptions in FIG. 5 and its possible embodiments, and will not be repeated here.

[0223] For example, see Figure 11, which is a schematic diagram of the physical structure of a possible audio sink device provided in this application. Audio sink device 1100 includes a processor 1101, a memory 1102, and a communication interface 1103. Processor 1101, communication interface 1103, and memory 1102 may be interconnected or connected via a bus 1104.

[0224] Exemplarily, the memory 1102 is used to store computer programs and data of the audio sink device 1100. The memory 1102 may include, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or portable compact disc read-only memory (CD-ROM).

[0225] The software or program codes required for all or part of the functions of the music sink device in the above method embodiment may be stored in the memory 1102 .

[0226] In one possible implementation, if the software or program code required for some functions is stored in the memory 1102, the processor 1101, in addition to calling the program code in the memory 1102 to implement some functions, can also cooperate with other components (such as the communication interface 1103) to jointly complete other functions described in the method embodiment (such as the function of receiving or sending data).

[0227] There may be multiple communication interfaces 1103 for supporting the audio sink device 1100 to communicate, such as receiving or sending data or messages.

[0228] Exemplarily, the processor 1101 may be a circuit having data processing capabilities. In one implementation, the processor may be a circuit having instruction reading and execution capabilities, such as a central processing unit (CPU), a microprocessor, a graphics processing unit (GPU) (which can be understood as a microprocessor), or a digital signal processor (DSP). In another implementation, the processor may implement certain functions through the logical relationship of a hardware circuit, and the logical relationship of the hardware circuit is fixed or reconfigurable, such as a hardware circuit implemented by a processor as an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), such as a field programmable gate array (FPGA). In a reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the hardware circuit configuration can be understood as the process of the processor loading instructions to implement the functions of some or all of the above units. In addition, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as a neural network processing unit (NPU), a tensor processing unit (TPU), a deep learning processing unit (DPU), etc. Alternatively, the processor 1101 can be a combination of at least two of these processor types, etc.

[0229] The processor 1101 may be configured to read the program stored in the memory 1102 and execute the operations performed by the audio sink device in FIG. 5 or FIG. 7 and possible embodiments thereof.

[0230] The specific operations and beneficial effects of each unit in the audio sink device 1100 shown in FIG11 can be found in the corresponding descriptions of FIG5 or FIG7 and their possible embodiments, and will not be repeated here.

[0231] For example, referring to FIG12 , which is a schematic diagram illustrating a possible physical structure of a sound source device provided herein, the sound source device 1200 includes a processor 1201 , a memory 1202 , and a communication interface 1203 . The processor 1201 , the communication interface 1203 , and the memory 1202 may be interconnected or connected via a bus 1204 .

[0232] Exemplarily, the memory 1202 is used to store computer programs and data of the audio source device 1200. The memory 1202 may include, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or portable read-only memory (CD-ROM).

[0233] The software or program codes required for all or part of the functions of the audio source device in the above method embodiment may be stored in the memory 1202 .

[0234] In one possible implementation, if the software or program code required for some functions is stored in the memory 1202, the processor 1201, in addition to calling the program code in the memory 1202 to implement some functions, can also cooperate with other components (such as the communication interface 1203) to jointly complete other functions described in the method embodiment (such as the function of receiving or sending data).

[0235] There may be multiple communication interfaces 1203 for supporting the sound source device 1200 to communicate, such as receiving or sending data or messages.

[0236] For example, the specific implementation of the processor 1201 can be exemplified by referring to the description of the processor 1101 in FIG. 11 above, which will not be repeated here.

[0237] The processor 1201 may be configured to read the program stored in the memory 1202 and execute the operations performed by the audio source device in FIG. 5 or FIG. 7 and possible embodiments thereof.

[0238] The specific operations and beneficial effects of each unit in the sound source device 1200 shown in FIG12 can be found in the corresponding descriptions in FIG5 or FIG7 and their possible embodiments, and will not be repeated here.

[0239] An embodiment of the present application further provides a computer-readable storage medium storing a computer program or computer instructions, which is executed by a processor to implement the method implemented by the audio sink device in any of Figures 5 or 7 and their possible implementations.

[0240] An embodiment of the present application further provides a computer-readable storage medium storing a computer program or computer instructions, which is executed by a processor to implement the method implemented by the sound source device in any of the above-mentioned Figures 5 or 7 and their possible implementations.

[0241] The embodiments of the present application further provide a computer program product. When the computer program product is read and executed by a computer, the method implemented by the music sink device in FIG. 5 or FIG. 7 and any of its possible implementations will be executed.

[0242] The embodiment of the present application further provides a computer program product. When the computer program product is read and executed by a computer, the method implemented by the sound source device in any of the above-mentioned FIG. 5 or FIG. 7 and its possible implementations will be executed.

[0243] In summary, in this solution, the audio sink device determines the audio focus type of the audio stream based on the audio stream attribute information from the audio source device. This determines the audio focus type and matches the audio duration of the audio stream, thereby achieving a reasonable allocation of audio service resources (such as playback resources) and improving the user experience.

[0244] In this application, the terms "first," "second," and the like are used to distinguish between identical or similar items having substantially the same function or effect. It should be understood that "first," "second," and "nth" do not have a logical or temporal dependency, nor do they limit the quantity or order of execution. It should also be understood that although the following description uses the terms "first," "second," and the like to describe various elements, these elements should not be limited by these terms. These terms are simply used to distinguish one element from another.

[0245] It should also be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0246] It will also be understood that the term “comprise” (also known as “includes,” “including,” “comprises,” and / or “comprising”) when used in this specification specifies the presence of stated features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0247] It should also be understood that references throughout this specification to "one embodiment," "an embodiment," or "one possible implementation" mean that specific features, structures, or characteristics associated with that embodiment or implementation are included in at least one embodiment of the present application. Therefore, the appearance of "in one embodiment," "in an embodiment," or "one possible implementation" throughout this specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0248] 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 them. 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 or all of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. An audio control method, characterized in that: The method comprises: The audio sink device receives attribute information of the first audio stream from the audio source device; The music sink device determines an audio focus type of the first audio stream based on the attribute information, where the audio focus type is a long focus type or a short focus type.

2. The method according to claim 1, characterized in that The attribute information indicates one or more of the following: a first duration of the first audio stream, a first type of the first duration, or a priority of the first audio stream.

3. The method according to claim 1 or 2, characterized in that The attribute information indicates a first type of a first duration of the first audio stream. Before the music sink device receives the attribute information of the first audio stream from the music source device, the audio sink device further includes: The music sink device sends first information to the music source device; the first information includes the duration of one or more audio streams stored in the music sink device, and the duration of the one or more audio streams is used to determine the first type.

4. The method according to claim 3, characterized in that The music sink device sending first information to the music source device includes: The music sink device sends a local audio stream attribute read response message to the music source device, where the local audio stream attribute read response message includes the first information.

5. The method according to claim 3 or 4, characterized in that The duration of the one or more audio streams is stored in an audio focus management stack of the music sink device.

6. The method according to any one of claims 1 to 5, characterized in that The attribute information indicates a first type of a first duration of the first audio stream; In the case where the first type is a short audio duration type, the audio focus type of the first audio stream is a short focus type; Alternatively, in a case where the first type is a long audio duration type, the audio focus type of the first audio stream is a long focus type.

7. The method according to any one of claims 1 to 5, characterized in that The attribute information indicates a first duration of the first audio stream; When the first duration is less than a first threshold, the audio focus type of the first audio stream is a short focus type; Alternatively, when the first duration is greater than the first threshold, the audio focus type of the first audio stream is a short focus type.

8. The method according to any one of claims 1 to 7, characterized in that The audio sink device receives attribute information of a first audio stream from a sound source device, including: The audio sink device receives the attribute information of the first audio stream from the audio source device during the audio stream configuration or reconfiguration phase; or The audio sink device receives attribute information of the first audio stream from the audio source device during an audio stream transmission phase.

9. The method according to any one of claims 1 to 8, characterized in that The method further comprises: The music sink device determines a storage space to allocate to the first audio stream and / or a processing priority of the first audio stream based on the attribute information.

10. The method according to claim 9, characterized in that The audio sink device determines, based on the attribute information, a storage space to allocate for the first audio stream, including: When the attribute information indicates that a first duration of the first audio stream is greater than a second threshold, the audio host device allocates a first storage space for the first audio stream; the duration of the audio stream that can be stored in the first storage space is less than the first duration, and the first storage space is used to cyclically store unused audio streams in the first audio stream.

11. An audio control method, characterized in that: The method comprises: The audio sink device allocates the audio focus to the first audio stream in the form of a short focus; Determining, by the music sink device, that a duration for which the first audio stream occupies the audio focus is greater than a threshold; The audio sink device changes the audio focus type of the first audio stream from short focus to long focus.

12. The method according to claim 11, characterized in that Before the audio sink device allocates the audio focus to the first audio stream in the form of a short focus, the audio sink device further includes: The audio sink device receives an audio stream transmission request for the first audio stream from the audio source device; the audio stream transmission request does not indicate attribute information of the first audio stream, and the attribute information is used to determine a type of the audio focus.

13. The method according to claim 11 or 12, characterized in that After the audio sink device allocates the audio focus to the first audio stream in the form of a short focus, the further step includes: The music sink device sends an audio stream transmission change event of the first audio stream to the sound source device.

14. An audio control method, characterized in that: The method comprises: The audio source device obtains attribute information of the first audio stream; The audio source device sends the attribute information to the audio sink device; the attribute information is used to determine the audio focus type of the first audio stream, and the audio focus type is a long focus type or a short focus type.

15. The method according to claim 14, characterized in that The attribute information indicates one or more of the following: a first duration of the first audio stream, a first type of the first duration, or a priority of the first audio stream.

16. The method according to claim 14 or 15, characterized in that The attribute information indicates a first type of a first duration of the first audio stream; before the audio source device obtains the attribute information of the first audio stream, the method further includes: The audio source device receives first information from the audio sink device; the first information includes a duration of one or more audio streams stored in the audio sink device; The audio source device determines a second duration based on the duration of the one or more audio streams; The sound source device determines the first type based on the second duration and the first duration.

17. The method according to claim 16, characterized in that When the first duration is less than the second duration, the first type is a short audio duration type; Alternatively, when the first duration is greater than the second duration, the first type is a long audio duration type.

18. The method according to any one of claims 14 to 17, characterized in that: The sound source device acquiring the attribute information of the first audio stream includes: The audio source device determines attribute information of the first audio stream based on associated information of an application to which the first audio stream belongs; the associated information of the application includes an audio play list, an audio play mode, or historical play data of the application.

19. The method according to any one of claims 14 to 18, characterized in that: After the sound source device obtains the attribute information of the first audio stream, the method further includes: The sound source device determines a storage space to be allocated to the first audio stream and / or a processing priority of the first audio stream based on the attribute information.

20. A music sink device, characterized in that: The music sink device comprises: a receiving unit, configured to receive attribute information of a first audio stream from an audio source device; A processing unit is configured to determine an audio focus type of the first audio stream based on the attribute information, where the audio focus type is a long focus type or a short focus type.

21. The audio sink device according to claim 20, wherein: The attribute information indicates one or more of the following: a first duration of the first audio stream, a first type of the first duration, or a priority of the first audio stream.

22. The audio sink device according to claim 20 or 21, characterized in that: The attribute information indicates a first type of a first duration of the first audio stream. The music sink device further includes a sending unit configured to send first information to the sound source device before the receiving unit receives the attribute information of the first audio stream from the sound source device. The first information includes the duration of one or more audio streams stored in the music sink device, and the duration of the one or more audio streams is used to determine the first type.

23. The audio sink device according to claim 22, wherein: The sending unit is specifically configured to: A local audio stream attribute read response message is sent to the sound source device, where the local audio stream attribute read response message includes the first information.

24. The audio sink device according to claim 22 or 23, characterized in that: The duration of the one or more audio streams is stored in an audio focus management stack of the music sink device.

25. The audio sink device according to any one of claims 20 to 24, characterized in that: The attribute information indicates a first type of a first duration of the first audio stream; In the case where the first type is a short audio duration type, the audio focus type of the first audio stream is a short focus type; Alternatively, in a case where the first type is a long audio duration type, the audio focus type of the first audio stream is a long focus type.

26. The audio sink device according to any one of claims 20 to 24, characterized in that: The attribute information indicates a first duration of the first audio stream; When the first duration is less than a first threshold, the audio focus type of the first audio stream is a short focus type; Alternatively, when the first duration is greater than the first threshold, the audio focus type of the first audio stream is a short focus type.

27. The audio sink device according to any one of claims 20 to 26, characterized in that: The receiving unit is specifically configured to: receiving attribute information of the first audio stream from the audio source device during the audio stream configuration or reconfiguration phase; or In the audio stream transmission phase, attribute information of the first audio stream is received from the audio source device.

28. The audio sink device according to any one of claims 20 to 27, characterized in that: The processing unit is further configured to: A storage space allocated to the first audio stream and / or a processing priority of the first audio stream is determined based on the attribute information.

29. The audio sink device according to claim 28, wherein: The processing unit is specifically configured to: When the attribute information indicates that the first duration of the first audio stream is greater than a second threshold, a first storage space is allocated for the first audio stream; the duration of the audio stream that can be stored in the first storage space is less than the first duration, and the first storage space is used to cyclically store unused audio streams in the first audio stream.

30. A sound sink device, characterized in that: The music sink device includes a processing unit configured to: Allocate audio focus to the first audio stream in the form of short focus; Determining that a duration for which the first audio stream occupies the audio focus is greater than a threshold; The audio focus type of the first audio stream is changed from short focus to long focus.

31. The audio sink device according to claim 30, characterized in that The audio sink device further includes a receiving unit configured to receive an audio stream transmission request for the first audio stream from the audio source device before the processing unit assigns the audio focus to the first audio stream in the form of a short focus; The audio stream transmission request does not indicate attribute information of the first audio stream, where the attribute information is used to determine the type of the audio focus.

32. The audio sink device according to claim 30 or 31, characterized in that: The audio sink device further includes a sending unit configured to send an audio stream transmission change event of the first audio stream to the audio source device after the processing unit assigns the audio focus to the first audio stream in the form of a short focus.

33. A sound source device, characterized in that: The sound source device comprises: a processing unit, configured to obtain attribute information of the first audio stream; A sending unit is configured to send the attribute information to a music sink device; the attribute information is used to determine an audio focus type of the first audio stream, where the audio focus type is a long focus type or a short focus type.

34. The sound source device according to claim 33, characterized in that The attribute information indicates one or more of the following: a first duration of the first audio stream, a first type of the first duration, or a priority of the first audio stream.

35. The sound source device according to claim 33 or 34, characterized in that: The attribute information indicates a first type of a first duration of the first audio stream; the audio source device further includes a receiving unit configured to receive first information from a music sink device before the processing unit obtains the attribute information of the first audio stream; the first information includes a duration of one or more audio streams stored in the music sink device; The processing unit is further configured to: determine a second duration based on the duration of the one or more audio streams; The first type is determined based on the second duration and the first duration.

36. The sound source device according to claim 35, characterized in that When the first duration is less than the second duration, the first type is a short audio duration type; Alternatively, when the first duration is greater than the second duration, the first type is a long audio duration type.

37. The sound source device according to any one of claims 33 to 36, characterized in that: The processing unit is specifically configured to: The attribute information of the first audio stream is determined based on the associated information of the application to which the first audio stream belongs; the associated information of the application includes the audio play list, audio play mode or historical play data of the application.

38. The sound source device according to any one of claims 33 to 37, characterized in that: The processing unit is further configured to, after acquiring attribute information of the first audio stream, determine, based on the attribute information, a storage space allocated to the first audio stream and / or a processing priority of the first audio stream.

39. An audio communication system, characterized in that The system includes a music sink device and a music source device, wherein the music sink device is used to implement the method according to any one of claims 1 to 13, and the music source device is used to implement the method according to any one of claims 14 to 19.

40. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program or computer instructions, and the computer program or computer instructions are executed by a processor to implement the method according to any one of claims 1 to 10; Alternatively, the computer program or computer instructions are executed by a processor to implement the method according to any one of claims 11 to 13; Alternatively, the computer program or computer instructions are executed by a processor to implement the method according to any one of claims 14 to 19.

41. A computer program product, characterized in that When the computer program product is executed by a processor, the method according to any one of claims 1 to 10 will be implemented; Alternatively, when the computer program product is executed by a processor, the method according to any one of claims 11 to 13 will be implemented; Alternatively, when the computer program product is executed by a processor, the method according to any one of claims 14 to 19 will be implemented.