Audio focus management method and apparatus, storage medium, and electronic device
By releasing the focus of unplayed audio in the Android system, the problem of low-priority applications having difficulty acquiring audio focus is solved, thus improving the efficiency of audio focus utilization.
Patent Information
- Application Number
- CN202211285943.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-20
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2042-10-20
AI Technical Summary
In Android systems, existing audio focus management methods are not conducive to lower-priority applications gaining audio focus.
By determining the playback status information of the application occupying audio focus and releasing audio focus when it is not playing, the likelihood of lower-priority applications acquiring audio focus is increased.
It improves the efficiency of audio focus usage, ensuring that lower-priority applications can acquire audio focus in a timely manner to meet their audio playback needs.
Smart Images

Figure CN115658000B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of audio playing, and more particularly, to an audio focus management method and device, a storage medium, and an electronic device. BACKGROUND
[0002] In current operating systems such as an Android system, there are often multiple application programs using audio playing. In order to ensure that multiple application programs perform audio playing in an orderly manner, audio focus needs to be managed. In related technologies, when audio focus is managed, audio focus is often allocated according to the priority of an application program, which is not conducive to an application program with a lower priority obtaining audio focus. SUMMARY
[0003] The present disclosure provides an audio focus management method, device, computer-readable storage medium, and electronic device to solve the problem that existing audio focus management methods are not conducive to an application program with a lower priority obtaining audio focus.
[0004] In a first aspect, an audio focus management method is provided, specifically including the following steps:
[0005] In response to a first audio focus request sent by a first application program, determining a first request result corresponding to the first audio focus request;
[0006] In response to the first request result indicating that the first application program has not obtained audio focus, determining playing state information of a second application program occupying audio focus;
[0007] In response to a third application program existing in the second application program, the playing state information of the third application program indicating that audio focus is in an unplaying state, releasing audio focus of the third application program; and determining a second request result corresponding to the first audio focus request.
[0008] In a second aspect, an audio focus management device is provided, specifically including the following modules:
[0009] A request processing module is configured to, in response to a first audio focus request sent by a first application program, determine a first request result corresponding to the first audio focus request;
[0010] A program determining module is configured to, in response to the first request result indicating that the first application program has not obtained audio focus, determine playing state information of a second application program occupying audio focus;
[0011] The focus processing module is configured to release an audio focus of a third application in the second application in response to the third application existing in the second application, the playing state information of the third application indicating that the audio focus is in a non-playing state, and determine a second request result corresponding to the first audio focus request.
[0012] In a third aspect, a computer-readable storage medium is provided, and the storage medium stores a computer program for executing the audio focus management method.
[0013] In a fourth aspect, an electronic device is provided, and the electronic device comprises:
[0014] a processor;
[0015] a memory for storing executable instructions of the processor;
[0016] the processor is configured to read the executable instructions from the memory and execute the instructions to implement the audio focus management method.
[0017] Compared with the prior art, the audio focus management method, the device, the computer-readable storage medium and the electronic device provided by the present disclosure have at least the following beneficial effects:
[0018] The technical solution provided by the present disclosure comprises the following beneficial effects: In the technical solution provided by the present disclosure, when the first request result indicates that the first application does not obtain the audio focus, the first request result is not taken as the final result, but the playing state of the second application is determined in time to release the audio focus of the third application in the non-playing state, which increases the possibility of the first application applying for the audio focus and improves the use efficiency of the audio focus. BRIEF DESCRIPTION OF DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the present disclosure, the drawings needed in the description of the present disclosure will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative labor under the premise of the drawings.
[0020] Figure 1 FIG. 1 is a flowchart of an audio focus management method according to an example embodiment of the present disclosure. Figure 1 ;
[0021] Figure 2 FIG. 2 is a flowchart of an audio focus management method according to an example embodiment of the present disclosure. Figure 2 ;
[0022] Figure 3 FIG. 3 is a flowchart of an audio focus management method according to an example embodiment of the present disclosure. Figure 3 ;
[0023] Figure 4 FIG. 4 is a structural diagram of an audio focus management device according to an example embodiment of the present disclosure.
[0024] Figure 5 FIG. 5 is a structural diagram of an electronic device according to an example embodiment of the present disclosure. DETAILED DESCRIPTION
[0025] The technical solutions in the present disclosure will be described clearly and completely below in conjunction with the drawings in the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the embodiments of the present disclosure.
[0026] Exemplary method
[0027] Figure 1 FIG. 1 is a flowchart of an audio focus management method according to an example embodiment of the present disclosure. The audio focus management method can be applied to a terminal installed with an Android operating system, and further can be applied to an audio focus management and control module in the terminal. Specifically, the terminal includes but is not limited to electronic devices such as smart phones, desktop computers, tablet computers, notebook computers, car machines, etc. The method specifically includes the following steps:
[0028] In step S11, a first request result corresponding to a first audio focus request is determined in response to the first audio focus request sent by a first application.
[0029] The first application is an application that is currently applying for an audio focus. Specifically, the first application can be a music application, a short video application, a news application, an instant messaging application, etc. The first audio focus request is a request sent by the first application to apply for an audio focus. The first request result is a response result obtained by processing the first audio focus request.
[0030] In a possible application scenario, a user opens a music application in a terminal interaction page and clicks a play button. At this time, the first application sends a first audio focus request to the audio focus control module, and the audio focus control module processes the first audio focus request and determines a first request result corresponding to the first audio focus request.
[0031] In some embodiments, the step S11 comprises:
[0032] Step S111, determining first identification information carried by the first audio focus request; and determining second identification information corresponding to the second application.
[0033] The second application is an application that occupies the audio focus at the current moment, that is, the second application applies for the audio focus to the audio focus control model before the first application, and the second application obtains the audio focus. The identification information is used to distinguish different applications, and the identification information is unique. Different applications correspond to different identification information. The first identification information is identification information corresponding to the first application, and the second identification information is identification information corresponding to the second application.
[0034] In this step, after receiving the first audio focus request, the first identification information carried by the first audio focus request is determined. According to the first identification information, it can be determined that the first audio focus request is sent by the first application. The second identification information corresponding to the second application currently occupying the audio focus is determined.
[0035] Step S112, in response to the priority corresponding to the first identification information being less than or equal to the priority corresponding to the second identification information, determining a first request result indicating that the first application does not obtain the audio focus.
[0036] In the step, priorities corresponding to different identification information are set in advance, and priority levels of different priorities are determined. After the first identification information and the second identification information are determined, the priority corresponding to the first identification information and the priority corresponding to the second identification information are further determined, and the priority corresponding to the first identification information is compared with the priority corresponding to the second identification information. If it is determined that the priority corresponding to the first identification information is less than the priority corresponding to the second identification information, that is, the priority of the second application program is high and the priority of the first application program is low, the first application program with low priority does not obtain the audio focus, and thus the first request result indicating that the first application program does not obtain the audio focus is determined. If it is determined that the priority corresponding to the first identification information is equal to the priority corresponding to the second identification information, in the case of the same priority, the first application program that applies for the audio focus later cannot preempt the audio focus currently occupied by the second application program that applies for the audio focus first, and thus the first request result indicating that the first application program does not obtain the audio focus is determined.
[0037] Specifically, the number of the second application programs can be at least one. In the case that the number of the second application programs is at least two, the second identification information corresponding to each second application program is determined, the priority corresponding to each second identification information is further determined, the priority corresponding to the first identification information is compared with each second identification information, and if the priority corresponding to the first identification information is less than or equal to the priority corresponding to each second identification information, the first request result indicating that the first application program does not obtain the audio focus is determined.
[0038] In the embodiment, the application programs are distinguished by using the identification information, so that the priorities corresponding to different application programs are accurately determined, and the allocation object of the audio focus in the first application program and the second application program is determined, and the accurate first request result is determined.
[0039] In some embodiments, the method further includes:
[0040] In step S113, in response to the priority corresponding to the first identification information being greater than the priority corresponding to the second identification information, a first request result indicating that the first application program obtains the audio focus is determined.
[0041] In this step, the priority corresponding to the first identification information is compared with the priority corresponding to the second identification information. If it is determined that the priority corresponding to the first identification information is greater than the priority corresponding to the second identification information, that is, the priority of the second application program is low and the priority of the first application program is high, the first application program with high priority can obtain the audio focus. It should be noted that if there is no second application program occupying the audio focus or there is an audio focus that is not occupied, the first request result indicating that the first application program obtains the audio focus can also be determined.
[0042] Correspondingly, the method further includes: step S114, in response to the first request result indicating that the first application program obtains the audio focus, controlling the first application program to play audio.
[0043] In this step, when the first request result indicates that the first application program obtains the audio focus, the first application program can use the obtained audio focus to play audio, meeting the user's demand for audio playing by the first application program.
[0044] For example, the priority levels of the application program A and the application program B are determined to be two levels, and the priority levels of the application program C and the application program D are determined to be one level. The one level priority is greater than the two level priority. The identification information of the application program A is a, the identification information of the application program B is b, the identification information of the application program C is c, and the identification information of the application program D is d.
[0045] In one possible case, the first identification information is a, and it is determined that the second identification information is b and c. That is, the priority two level corresponding to the first identification information a is equal to the priority two level corresponding to the second identification information b, and the priority two level corresponding to the first identification information a is less than the priority one level corresponding to the second identification information c. Therefore, at this time, the first request result indicating that the application program A corresponding to the first identification information a cannot obtain the audio focus.
[0046] In one possible case, the first identification information is d, and it is determined that the second identification information is b. That is, the priority one level corresponding to the first identification information d is greater than the priority two level corresponding to the second identification information b. Therefore, at this time, the application program D corresponding to the first identification information d obtains the audio focus, and the application program D plays audio by using the obtained audio focus. At the same time, the application program B corresponding to the second identification information b loses the audio focus and stops playing.
[0047] Step S12, in response to the first request result indicating that the first application program does not obtain the audio focus, determining the playing state information of the second application program occupying the audio focus.
[0048] In this step, when the first request result indicates that the first application program does not acquire the audio focus, the first request result is not taken as the final result, but the playing state information of the second application program occupying the audio focus is further determined, which is used to indicate whether the audio focus of the second application program is in the playing state. That is, the playing state information has two possible conditions, one is that the playing state information indicates that the audio focus is in the playing state, and the other is that the playing state is in the non-playing state.
[0049] As shown in Figure 2 In some embodiments, the method further includes:
[0050] Step S14, in response to the second audio focus request sent by the second application program, determining a third request result corresponding to the second audio focus request.
[0051] Step S15, in response to the third request result indicating that the second application program acquires the audio focus, saving request information carried by the second audio focus request, the request information including first interface information.
[0052] In this embodiment, before the audio focus control module receives the first audio focus request sent by the first application program, the audio focus control module receives the second audio focus request sent by the second application program, and the audio focus control module makes a decision to determine a third request result corresponding to the second audio focus. In the case that the third request result indicates that the second application program acquires the audio focus, that is, in the case of application success, the request information carried by the second audio focus request is saved, and the request information includes the first interface information. The first interface information is the interface information used to determine the playing state information of the second application program.
[0053] Specifically, the request information includes but is not limited to three parts, the first part is the audio information of the application program itself, such as identification information; the second part is the interface that can acquire the playing state of the application program itself, that is, the first interface information; the third part is the interface provided by the application program for the audio focus control module to notify the application program to process, wherein the interface for notifying the application program to process is used for the information interaction between the audio focus control module and the application program, such as controlling the application program to play audio and stop playing audio through the interface for notifying the application program to process. It should be noted that not only the request information carried by the second audio focus request sent by the second application program includes the contents of the above three parts, but also the request information carried by the audio focus request sent by any application program includes the contents of the above three parts.
[0054] In some embodiments, the step S12 includes:
[0055] Step S121, determining the first interface information corresponding to the second application program.
[0056] Step S122, determining the playing state information of the second application based on the first interface information.
[0057] In the embodiment, when it is needed to determine the playing state information corresponding to the second application, the first interface information corresponding to the second application is used to determine accurately. That is, in the embodiment, the second application is allowed to provide the first interface information for determining the playing state of itself to the audio focus control module, and the audio focus control module can use the first interface information to determine whether the audio focus is playing audio in the second application, which is beneficial to accurately determining whether the third application exists in the second application subsequently.
[0058] Step S13, in response to the fact that the third application exists in the second application and the playing state information of the third application indicates that the audio focus is in the non-playing state, releasing the audio focus of the third application; and determining the second request result corresponding to the first audio focus request.
[0059] In the step, after the playing state information of the second application is determined, it is determined whether the playing state information indicates that the audio focus is in the non-playing state. If yes, the third application exists in the second application, and the audio focus of the third application is an abnormal focus. Because the third application currently occupies the audio focus, but the occupied audio focus is in the non-playing state, if the audio focus of the third application is not released, the application with a low priority may not be able to obtain the audio focus for a long time. Based on the above consideration, the audio focus of the third application is released, that is, the audio focus control module recovers the abnormal focus. After the audio focus of the third application is released, the second request result corresponding to the first audio focus request is determined. Thus, the first application which has not obtained the audio focus is provided with the possibility of effectively obtaining the audio focus, and the use efficiency of the audio focus is improved.
[0060] Specifically, when there are at least two second applications, the playing state information of each second application is determined. If there are at least two third applications in the second application, the audio focus of each third application is released.
[0061] In some embodiments, after the third application is released, the first application does not need to send the first audio focus request again, and the audio focus control module can determine the second request result corresponding to the first audio focus request according to the first audio focus request sent by the first application in step 11.
[0062] In some embodiments, the step S13 of determining the second request result corresponding to the first audio focus request includes:
[0063] Step S131, determine the second interface information carried by the first audio focus request.
[0064] The second interface information is provided by the first application program and is an interface for the audio focus control module to process a notification.
[0065] In this step, the first application program sends the first audio focus request with the second interface information, and after releasing the audio focus of the third application program, the second interface information carried by the first audio focus request is determined.
[0066] Step S132, based on the second interface information, control the first application program to send the first audio focus request again.
[0067] In this step, the second interface information is used to send notification information to the first application program, notifying the first application program to send the first audio focus request again, i.e., the first application program re-applies for the focus.
[0068] Step S133, in response to the first audio focus request sent by the first application program again, determine the second request result corresponding to the first audio focus request.
[0069] In this step, after receiving the first audio focus request sent by the first application program again, the first audio focus request sent again is processed, and the second request result corresponding to the first audio focus request is determined.
[0070] Specifically, the second request result can still have two possible cases: one is that the second request result indicates that the first application program obtains the audio focus, i.e., the application is successful, such as assigning the audio focus released by the third application program to the first application program; the other is that the second request result indicates that the second application program does not obtain the audio focus, i.e., the application is rejected, such as the audio focus released by the third application program is occupied by other application programs, and the priority of the other application programs is higher than that of the first application program.
[0071] Further, the method further comprises: in response to the second request result indicating that the first application program obtains the audio focus, controlling the first application program to play audio. In this embodiment, by determining the playing state information of the second application program occupying the audio focus, when there is a third application program whose audio focus is in a non-playing state, the first application program can effectively apply for the audio focus, and the first application program can play audio by using the audio focus, thereby facilitating the application program with low priority to obtain the audio focus and improving the use efficiency of the audio focus.
[0072] Further, the method further comprises: in response to the second request result indicating that the first application program does not acquire the audio focus, controlling the first application program to stop playing audio. When the second request result indicates that the first application program does not acquire the audio focus, the second request result is taken as the final determination result, the first application program does not acquire the audio focus, and the first application program cannot play audio by using the audio focus, so the process of controlling the first application program to stop playing audio is performed.
[0073] In some embodiments, the method further comprises:
[0074] Step S16, in response to the third application program not existing in the second application program, controlling the first application program to stop playing audio. In this embodiment, when each second application program occupies the audio focus in the playing state, there is no audio focus that can be released, so the first application program is controlled to stop playing audio, and the orderly playing of the audio of each second application program is ensured.
[0075] In the above embodiment, after receiving the first audio focus request sent by the first application program, the first audio focus request is processed to determine the first request result corresponding to the first audio focus request; in the case that the first request result indicates that the first application program does not acquire the audio focus, the second application program occupying the audio focus is determined, and the playing state information of the second application program is further determined; in the case that there is a third application program in the second application program whose audio focus is in the non-playing state, the audio focus of the third application program is released, and the second request result corresponding to the first audio focus request is determined. In the technical solution provided in the present disclosure, in the case that the first request result indicates that the first application program does not acquire the audio focus, the first request result is not taken as the final result, but the playing state of the second application program is determined in time to release the audio focus of the third application program in the non-playing state in time, increase the possibility of the first application program applying for the audio focus, and improve the use efficiency of the audio focus.
[0076] Figure 3 is a flowchart of an audio focus management method provided by an exemplary embodiment of the present disclosure, and specifically comprises the following steps:
[0077] Step S301, the second application program sends a second audio focus request to the audio focus management module to apply for the audio focus.
[0078] Step S302, the audio focus management module makes a decision, that is, in response to the second audio focus request sent by the second application program, determines the third request result corresponding to the second audio focus request.
[0079] Step S303, in response to the third request result indicating that the second application program acquires the audio focus, i.e. the application is successful, the request information carried by the second audio focus request is saved. Of course, in response to the third request result indicating that the second application program acquires the audio focus, the second application program can also be controlled to play audio.
[0080] Step S304, the first application program sends a first audio focus request to the audio focus control module to apply for the audio focus.
[0081] Step S305, the audio focus control module decides, i.e. in response to the first audio focus request sent by the first application program, determines the first request result corresponding to the first audio focus request.
[0082] Step S306, in response to the first request result indicating that the first application program acquires the audio focus, i.e. the application is successful, the first application program is controlled to play audio. Of course, in response to the first request result indicating that the first application program acquires the audio focus, the request information carried by the first audio focus request can also be saved.
[0083] Step S307, in response to the first request result indicating that the first application program does not acquire the audio focus, i.e. the application fails, the audio focus control module detects the abnormal focus. The abnormal focus is the audio focus corresponding to the third application program. Specifically, the abnormal focus is detected by determining the playing state information of the second application program occupying the audio.
[0084] Step S308, in response to the absence of abnormal focus, i.e. the absence of the third application program in the second application program, the first application program is controlled to stop playing audio.
[0085] Step S309, in response to the presence of abnormal focus, the audio focus control module recovers the abnormal focus, i.e. releases the audio focus of the third application program.
[0086] Step S310, the first application program re-applies for the focus, and the audio focus control module decides to determine the second request result. If the second request result indicates that the first application program acquires the audio focus, i.e. the application is successful, the first application program is controlled to play audio in step S306; if the second request result indicates that the first application program does not acquire the audio focus, i.e. the application fails, the first application program is controlled to stop playing audio in step S308.
[0087] In the above embodiment, in a case where the first request result indicates that the first application program does not acquire the audio focus, the first request result is not taken as a final result, the playing state information of the second application program is determined, and the audio focus of the third application program in a non-playing state is released in time, so that the third application program in a fault state does not occupy the audio focus for a long time, the possibility of the first application program applying for the audio focus is increased, and the use efficiency of the audio focus is improved.
[0088] Exemplary apparatus
[0089] Based on the same idea as the method embodiments of the present disclosure, as shown in Figure 4 The present disclosure also provides an audio focus management apparatus, which specifically includes the following modules:
[0090] The request processing module 41 is configured to determine a first request result corresponding to a first audio focus request in response to the first audio focus request sent by the first application program.
[0091] The program determining module 42 is configured to determine playing state information of a second application program occupying the audio focus in response to the first request result indicating that the first application program does not acquire the audio focus.
[0092] The focus processing module 43 is configured to release the audio focus of a third application program in the second application program in response to the playing state information of the third application program indicating that the audio focus is in a non-playing state, and determine a second request result corresponding to the first audio focus request.
[0093] In some embodiments, the program determining module includes:
[0094] The information determining unit is configured to determine first interface information corresponding to the second application program.
[0095] The state determining unit is configured to determine the playing state information of the second application program based on the first interface information.
[0096] In some embodiments, the request processing module is further configured to determine a third request result corresponding to a second audio focus request in response to the second audio focus request sent by the second application program, and save request information carried by the second audio focus request in response to the third request result indicating that the second application program acquires the audio focus, the request information including first interface information.
[0097] In some embodiments, the request processing module includes:
[0098] An identity determining unit is configured to determine first identity information carried by the first audio focus request; and determine second identity information corresponding to the second application program;
[0099] A result determining unit is configured to determine a first request result indicating that the first application program does not acquire the audio focus, in response to a priority corresponding to the first identity information being less than or equal to a priority corresponding to the second identity information.
[0100] In some embodiments, the result determining unit is further configured to determine a first request result indicating that the first application program acquires the audio focus, in response to the priority corresponding to the first identity information being greater than the priority corresponding to the second identity information.
[0101] The apparatus further includes a playing control module configured to control the first application program to play audio, in response to the first request result indicating that the first application program acquires the audio focus.
[0102] In some embodiments, the focus processing module:
[0103] An interface determining unit is configured to determine second interface information carried by the first audio focus request.
[0104] A request control unit is configured to control the first application program to resend the first audio focus request based on the second interface information.
[0105] A request processing unit is configured to determine a second request result corresponding to the first audio focus request, in response to the first audio focus request resending by the first application program.
[0106] In some embodiments, the focus processing module is further configured to control the first application program to stop playing audio, in response to the third application program not existing in the second application program.
[0107] In some embodiments, the apparatus further includes:
[0108] A playing control module configured to control the first application program to play audio, in response to the second request result indicating that the first application program acquires the audio focus.
[0109] In some embodiments, the apparatus further includes:
[0110] A playing control module configured to control the first application program to stop playing audio, in response to the second request result indicating that the first application program does not acquire the audio focus.
[0111] Exemplary electronic device
[0112] Figure 5 FIG. 1 illustrates a block diagram of an electronic device according to an embodiment of the disclosure.
[0113] As Figure 5 shown, the electronic device 50 includes one or more processors 51 and a memory 52.
[0114] The processor 51 can be a central processing unit (CPU) or other form of processing unit having data processing and / or instruction executing capabilities, and can control other components in the electronic device 50 to perform desired functions.
[0115] The memory 52 can include one or more computer program products that can include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory, for example, can include random access memory (RAM), cache memory, and / or the like. The non-volatile memory, for example, can include read-only memory (ROM), hard disk, flash memory, and / or the like. One or more computer program instructions can be stored on the computer-readable storage media, and the processor 51 can run the program instructions to implement the audio focus management method of various embodiments of the disclosure described above and / or other desired functions.
[0116] In one example, the electronic device 50 can further include an input device 53 and an output device 54, which are interconnected through a bus system and / or other form of connection mechanism (not shown).
[0117] Of course, for simplicity, Figure 5 only some of the components in the electronic device 50 related to the disclosure are shown in the figure, and components such as buses, input / output interfaces, and the like are omitted. In addition, the electronic device 50 can also include any other appropriate components according to specific application cases.
[0118] Exemplary computer program product and computer readable storage medium
[0119] In addition to the above method and device, an embodiment of the disclosure can also be a computer program product, which includes computer program instructions that, when run by a processor, cause the processor to perform the steps in the audio focus management method according to various embodiments of the disclosure described in the above “Exemplary Method” section of the specification.
[0120] The computer program product can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the owner's computing device, partly on the owner's device, as a stand-alone software package, partly on the owner's computing device and partly on a remote computing device or entirely on the remote computing device or server. The embodiments of methods described in this specification can be implemented in software and / or firmware. The software implementation can be in a computer readable medium such as a non-transitory computer readable medium including a disc storage, a flash drive or any other suitable non-transitory computer readable medium. The various embodiments of methods described in this specification can be implemented in software and / or firmware. The software implementation can be in a computer readable medium such as a non-transitory computer readable medium including a disc storage, a flash drive or any other suitable non-transitory computer readable medium.
[0121] Furthermore, embodiments of the present disclosure can also be a computer readable storage medium, having stored thereon computer program instructions which, when executed by a processor, cause the processor to carry out the steps described in the above "Exemplary Method" section of the present specification for the audio focus management method according to various embodiments of the present disclosure.
[0122] The computer readable storage medium can be any combination of one or more computer readable media. The computer readable medium can be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include an electrical connection having one or more wires, a portable disc, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0123] The above describes the basic principles of the present disclosure in combination with specific embodiments, but it should be noted that the advantages, benefits, effects and the like mentioned in the present disclosure are only examples and are not limiting, and these advantages, benefits, effects and the like cannot be considered as necessary for each embodiment of the present disclosure. In addition, the above specific details of the invention are only for the purpose of example and understanding, and are not limiting, and the above details do not limit the present disclosure to the above specific details.
[0124] The block diagrams of devices, apparatuses, devices, and systems disclosed herein are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.
[0125] It should also be noted that in the apparatus, devices, and methods of this disclosure, the components or steps can be disassembled and / or recombined. These disassemblies and / or recombinations should be considered as equivalent solutions to this disclosure.
[0126] The above description of aspects of the invention is provided to enable any person skilled in the art to make or use this disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of this disclosure. Therefore, this disclosure is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features of the invention herein.
[0127] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this disclosure to the forms of the invention herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.
Claims
1. An audio focus management method, characterized by, Specifically comprising the following steps: In response to a first audio focus request sent by a first application, determining a first request result corresponding to the first audio focus request; In response to the first request result indicating that the first application does not obtain the audio focus, determining playing state information of a second application occupying the audio focus; In response to the third application existing in the second application and the playing state information of the third application indicating that the audio focus is in a non-playing state, releasing the audio focus of the third application; and determining a second request result corresponding to the first audio focus request.
2. The method of claim 1, wherein the determining the playing state information of the second application occupying the audio focus comprises: determining first interface information corresponding to the second application; based on the first interface information, determining the playing state information of the second application.
3. The method of claim 2, wherein before the determining the playing state information of the second application occupying the audio focus, the method further comprises: in response to a second audio focus request sent by the second application, determining a third request result corresponding to the second audio focus request; in response to the third request result indicating that the second application obtains the audio focus, saving request information carried by the second audio focus request, the request information comprising the first interface information.
4. The method of claim 1, wherein the determining the first request result corresponding to the first audio focus request comprises: determining first identification information carried by the first audio focus request; and determining second identification information corresponding to the second application; in response to a priority corresponding to the first identification information being less than or equal to a priority corresponding to the second identification information, determining the first request result indicating that the first application does not obtain the audio focus.
5. The method of claim 4, further comprising: in response to the priority corresponding to the first identification information being greater than the priority corresponding to the second identification information, determining the first request result indicating that the first application obtains the audio focus; in response to the first request result indicating that the first application obtains the audio focus, controlling the first application to play audio.
6. The method of claim 1, wherein the determining the second request result corresponding to the first audio focus request comprises: determining second interface information carried by the first audio focus request; based on the second interface information, controlling the first application to send the first audio focus request again; in response to the first audio focus request sent by the first application again, determining the second request result corresponding to the first audio focus request.
7. The method of claim 1, further comprising: in response to the third application not existing in the second application, controlling the first application to stop playing audio.
8. The method of any one of claims 1-7, further comprising: in response to the second request result indicating that the first application obtains the audio focus, controlling the first application to play audio; and / or, in response to the second request result indicating that the first application does not obtain the audio focus, controlling the first application to stop playing audio.
9. An audio focus management apparatus, characterized by comprising: Specifically comprising the following modules: The request processing module is configured to determine a first request result corresponding to the first audio focus request in response to the first audio focus request sent by the first application program; The program determining module is configured to determine the playing state information of a second application program occupying the audio focus in response to the first request result indicating that the first application program does not acquire the audio focus; The focus processing module is configured to release the audio focus of a third application program in response to the third application program existing in the second application program and the playing state information of the third application program indicating that the audio focus is in a non-playing state; and determine a second request result corresponding to the first audio focus request.
10. A computer readable storage medium, the storage medium storing a computer program, the computer program being used to execute the audio focus management method in any one of claims 1-8.
11. An electronic device, the electronic device comprising: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement the audio focus management method in any one of claims 1-8.
Citation Information
Patent Citations
Audio focus control method and system of vehicle-mounted system and vehicle-mounted system
CN109996099A
Vehicle-mounted audio playing control method, device and equipment and storage medium
CN112235063A
Application program sound control implementation method and electronic equipment
CN113721880A