Volume adjustment method, electronic equipment and computer readable storage medium

By determining the focus application in the electronic device and constructing a key-value pair to calculate the target volume, the problem that users cannot adjust the volume of multiple audio streams individually is solved. The volume of the focus application can be adjusted individually to meet the user's personalized volume needs.

CN120835113APending Publication Date: 2025-10-24HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510012583.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-19
Publication Date
2025-10-24

AI Technical Summary

Technical Problem

When an electronic device plays multiple audio streams of the same audio stream type simultaneously, the user cannot adjust the volume of any one of the audio streams individually, resulting in an inability to adjust the volume according to personalized needs.

Method used

By determining the focus application, building a key-value pair to calculate the target volume based on the audio stream type, audio output device, and volume adjustment operation input by the user, the volume of the focus application can be adjusted separately, and the audio data is mixed and output through the mixer.

Benefits of technology

This allows you to adjust the volume of a specific application individually when multiple audio streams are playing simultaneously, meeting the user's personalized volume needs and avoiding affecting the volume settings of other applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120835113A_ABST
    Figure CN120835113A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a volume adjustment method, electronic equipment and a computer readable storage medium, and the method comprises the steps: responding to a volume adjustment operation input by a user, and displaying a first interface which comprises an interface of a first application and an interface of a second application, the first application and the second application are two applications which play audios at the same time, and determining the original volume of the audios output by the first application in response to a volume adjustment operation input by a user; according to the volume adjustment operation, determining the relative adjustment volume of the output audio of the focus application; determining a target volume according to the original volume and the relative adjustment volume; and adjusting the volume of the output audio of the focus application to the target volume. When the electronic equipment outputs a plurality of audio streams of the same audio stream type at the same time and receives the volume adjustment operation of the user, the target volume of the focus application can be jointly determined according to the audio stream type, the audio output equipment and the focus application, and the volume of the output audio of the focus application is adjusted based on the determined target volume. Therefore, the volume of the audio stream output by a certain application can be independently adjusted.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is based on the invention with the application number 202410473723.7, the application date is April 19, 2024, and the invention name is "a volume adjustment method, electronic device and computer readable storage medium". TECHNICAL FIELD

[0002] The present application relates to the technical field of terminal, in particular to a volume adjustment method, electronic device and computer readable storage medium. BACKGROUND

[0003] The electronic device can play the audio of different application programs based on the form of the audio stream. Specifically, when an application program outputs an audio stream, the audio system of the electronic device can output the decoded audio stream to the audio system engine (AudioFlinger) through the audio track corresponding to the application program. The AudioFlinger can load the original volume corresponding to the audio stream type according to the audio stream type of the audio stream, and the possible audio output devices such as the speaker and the earpiece of the electronic device can play the audio of the application program based on the original volume loaded by the AudioFlinger.

[0004] During the process of playing audio by the electronic device, the user can adjust the playing volume of the electronic device. Specifically, the adjustment of the playing volume of the electronic device is mainly based on the audio stream type.

[0005] When the electronic device plays multiple audio streams of the same audio stream type at the same time, the user often has no way to adjust the volume of a certain audio stream, that is, the multiple audio streams of the same audio stream type can only be uniformly adjusted in volume, and cannot be adjusted to different volumes according to the user's needs. SUMMARY

[0006] The embodiments of the present application provide a volume adjustment method, an electronic device and a computer readable storage medium, which can realize the independent adjustment of the volume of the audio stream output by an application.

[0007] In a first aspect, a volume adjustment method is provided, which includes: determining a focus application in response to a volume adjustment operation input by a user; determining an original volume of the audio output by the focus application according to the audio stream type of the audio output by the focus application and the audio output device; determining a relative adjustment volume of the audio output by the focus application according to the volume adjustment operation; determining a target volume according to the original volume and the relative adjustment volume; and adjusting the volume of the audio output by the focus application to the target volume.

[0008] Herein, the user can set the focus application according to the usage habit. For example, the application running in the foreground can be set as the focus application, or for the case of running multiple applications in split screen, the application of the focus window can be set as the focus application.

[0009] Herein, the volume adjustment operation can be the user pressing the mechanical volume button or the user sliding the volume progress bar.

[0010] The user can place the application whose volume needs to be adjusted in the running scene of the focus application, and then by inputting the volume adjustment operation, the user can only adjust the play volume of the focus application, without affecting the play volume of other applications, thereby realizing the individual adjustment of the volume of the audio stream output by the application.

[0011] In this way, in the case that the electronic device simultaneously outputs multiple audio streams of the same audio stream type and receives the volume adjustment operation of the user, the target volume of the focus application can be determined according to the audio stream type, the audio output device and the focus application, and the volume of the output audio of the focus application is adjusted based on the determined target volume, thereby realizing the individual adjustment of the volume of the audio stream output by the application.

[0012] In a possible implementation, determining the target volume according to the original volume and the relative adjustment volume includes: obtaining an application identifier of the focus application; constructing a key-value pair of the relative adjustment volume of the focus application by taking the application identifier as the key and the relative adjustment volume as the value; and calculating the target volume according to the key-value pair of the relative adjustment volume in the original volume.

[0013] Herein, the application identifier of the focus application can be an application package name.

[0014] The original volume is determined according to the audio stream type and the audio output device of the audio output by the focus application, and the key-value pair with the package name of the motion health app as the key and the relative adjustment volume (i.e., the volume level that needs to be adjusted corresponding to the volume adjustment operation) as the value is increased according to the volume adjustment operation input by the user. The key-value pair corresponding to the focus application and the volume adjustment operation input by the user is created according to the following conditions: the current application is running in the foreground or is running under the focus window, the electronic device receives the volume adjustment operation of the mechanical volume button pressed by the user or the volume adjustment operation through the sliding volume progress bar. Assuming that the volume level of the original volume corresponding to the media stream and the speaker is 8 levels after the electronic device is turned on. At this time, when the focus application is in the foreground and the user presses the volume increase area of the mechanical volume button once, the electronic device will store 1 in the value of the key-value pair with the package name of the focus application as the key, that is, the value of the key-value pair with the package name of the focus application as the key is 1, and the volume level of the output audio of the focus application in the current scene is adjusted to 9 levels, that is, the original volume level 8 levels plus the value. If at this time, the user presses the volume decrease area of the mechanical volume button twice in succession, the relative adjustment volume becomes 1-1-1=-1, that is, the value of the key-value pair with the package name of the focus application as the key becomes-1, and the volume level of the output audio of the focus application in the current scene is adjusted to 7 levels.

[0015] In this way, the volume of the output audio of the focus application can be adjusted individually through the key-value pair, and the implementation process can be simplified.

[0016] In a possible implementation, after determining the focus application in response to the volume adjustment operation input by the user, the method further includes:

[0017] If the focus application is not an application in the first set and / or the focus application is an application in the second set, the target volume of the output audio of all audio output applications is determined according to the audio stream type of the audio output by the electronic device, the audio output device, and the volume adjustment operation; wherein the first set is a set of application programs supporting independent volume adjustment, and the second set is a set of application programs not supporting independent volume adjustment.

[0018] The volume of the output audio of all audio output applications is adjusted to the target volume.

[0019] Here, the user can add, in the application management option in the system settings application, an application program set that can support independent volume adjustment (i.e. white list, hereinafter referred to as the first set) and an application program set that does not support independent volume adjustment (i.e. black list, hereinafter referred to as the second set) for the user, the application programs in the first set can realize independent volume adjustment by the volume adjustment method provided by the embodiments of the present application, and the application programs in the second set still realize volume adjustment in the original volume adjustment manner (i.e. realize volume adjustment in the manner of adjusting the volume according to the audio stream type and the audio output device).

[0020] In some embodiments, the first set and the second set described above can further limit the application program output audio stream type. For example, the game scenario involves multiple audio streams such as voice call, game background music, and game skill sound effect, and requires personalized volume adjustment, so this part of the scene in the game application can be added to the first set, and the message notification sound of the game application does not require personalized volume adjustment, so the related scene of the message notification sound in the game application can be added to the second set.

[0021] Of course, the user can also select other ways to set the first set, for example, adding the application to the first set through the application setting interface.

[0022] It can be understood that the first set described above is a set of application programs that support independent volume adjustment, and the second set described above is a set of application programs that do not support independent volume adjustment.

[0023] In this way, by setting the first set that supports independent volume adjustment and / or the second set that does not support independent volume adjustment, and selecting the corresponding volume adjustment strategy according to whether the focus application belongs to the first set or the second set, the application that needs to be adjusted individually can be adjusted more accurately, which is more in line with the user's adjustment demand.

[0024] In a possible implementation, the user can place the application program that needs to be adjusted in the running scene of the focus application, and then by inputting the volume adjustment operation, only the playback volume of the focus application can be adjusted, without affecting the playback volume of other application programs, so as to realize the method of adjusting the volume of the audio stream output by the application, which further includes initializing the key-value pair of the relative adjustment volume after the electronic device is restarted.

[0025] In a possible implementation, the electronic device runs an application program in the foreground, and in response to the volume adjustment operation input by the user, determines the focus application, including:

[0026] When the audio stream type of the audio output by the application program running in the foreground of the electronic device is the same as the audio stream type of the audio output by the application program running in the background of the electronic device, the application program running in the foreground is determined as the focus application.

[0027] In a possible implementation, the electronic device runs multiple application programs in the foreground, and in response to a volume adjustment operation input by a user, the focus application is determined, including:

[0028] When the audio stream types of the audios output by the multiple application programs running in the foreground of the electronic device are the same, the application program corresponding to the focus window is determined as the focus application.

[0029] In a possible implementation, after the volume of the audio output by the focus application is adjusted to the target volume, the method further includes:

[0030] After the adjusted audio output by the focus application is mixed with the audios output by the other application programs of the same type, the mixed audio data is output to the audio output device.

[0031] In a possible implementation, after the adjusted audio output by the focus application is mixed with the audios output by the other application programs of the same type, the mixed audio data is output to the audio output device, including:

[0032] All the audio data is mixed in a mixer;

[0033] An audio driver corresponding to the audio output device is invoked to drive the audio output device to output the mixed audio data.

[0034] In a second aspect, an embodiment of the present application provides an electronic device, one or more processors, and a memory, the memory being coupled to the one or more processors, the memory being configured to store computer program code, the computer program code including computer instructions, and the one or more processors being configured to invoke the computer instructions to cause the electronic device to perform the method of any one of the first aspect.

[0035] In a third aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium including instructions, when the instructions are run on an electronic device, causing the electronic device to perform the method of any one of the first aspect.

[0036] In a fourth aspect, an embodiment of the present application provides a chip system, the chip system being applied to an electronic device, the chip system including one or more processors, the one or more processors being configured to invoke computer instructions to cause the electronic device to perform the method of any one of the first aspect.

[0037] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when running on an electronic device, causes the electronic device to perform the method of any one of the above first aspect.

[0038] It can be understood that the beneficial effects of the above second aspect to fifth aspect can be referred to the related description in the above first aspect, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS

[0039] Figure 1 An exemplary process for determining an original volume;

[0040] Figure 2 An exemplary application scenario;

[0041] Figure 3 Another exemplary application scenario;

[0042] Figure 4 An exemplary hardware structure of an electronic device provided by an embodiment of the present application;

[0043] Figure 5 An exemplary software architecture of an electronic device provided by an embodiment of the present application;

[0044] Figure 6 An exemplary graphical user interface involved in some application scenarios provided by an embodiment of the present application;

[0045] Figure 7 An exemplary graphical user interface involved in some other application scenarios provided by an embodiment of the present application;

[0046] Figure 8 An exemplary determination of a focus window in a split-screen display of an electronic device provided by an embodiment of the present application;

[0047] Figure 9 An exemplary implementation flow of a volume adjustment method provided by an embodiment of the present application;

[0048] Figure 10 An exemplary process for determining a target volume in a volume adjustment method provided by an embodiment of the present application;

[0049] Figure 11 An exemplary implementation flow of another volume adjustment method provided by an embodiment of the present application;

[0050] Figure 12 An exemplary process for determining a target volume provided by an embodiment of the present application;

[0051] Figure 13 An exemplary implementation flow of still another volume adjustment method provided by an embodiment of the present application;

[0052] Figure 14 An implementation flowchart of another volume adjustment method provided by an embodiment of the present application is shown in FIG. 6.

[0053] Figure 15 A structure diagram of a chip provided by an embodiment of the present application is shown in FIG. 7. DETAILED DESCRIPTION

[0054] In the embodiments of the present application, the terms "first", "second", and the like are used to distinguish between items or objects that have substantially the same function and effect. For example, the first chip and the second chip are merely used to distinguish between different chips, and do not limit the order. Those skilled in the art can understand that the terms "first", "second", and the like do not limit the number and execution order, and the terms "first", "second", and the like do not necessarily mean different.

[0055] It should be noted that in the embodiments of the present application, the words "exemplary" or "for example" are used to mean serving as an example, instance, or illustration. Any embodiment or design scheme described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or advantageous than other embodiments or design schemes. Rather, the use of the words "exemplary" or "for example" is intended to present the relevant concept in a specific manner.

[0056] In the embodiments of the present application, "at least one" means one or more, and "multiple" means two or more. The "and / or" describes the association relationship between the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent the following three cases: A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects. "At least one of the following" or the like means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, or c can represent a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c can be single or multiple.

[0057] The electronic device can play audio of different applications based on a form of an audio stream. Specifically, when an application outputs an audio stream, an audio (Audio) system of the electronic device can output the decoded audio stream to an AudioFlinger through an audio track corresponding to the application, the AudioFlinger can load an original volume corresponding to an audio stream type of the audio stream according to the audio stream type of the audio stream, and a speaker, an earpiece, or the like, which is a possible audio output device of the electronic device, can play audio of the application based on the original volume loaded by the AudioFlinger.

[0058] Specifically, the application outputting the audio stream can be classified into different audio stream types. For example, the audio stream types can include a STREAM_VOICE_CALL, a STREAM_RING, a STREAM_MUSIC, a STREAM_NOTIFICATION, and the like.

[0059] It can be understood that the audio stream of each audio stream type can correspond to a play volume, and the play volume of the audio stream of each audio stream type can be set by a user, and the electronic device can determine the play volume of the audio stream according to the audio stream type of the application outputting the audio stream.

[0060] For example, it is assumed that the play volume of the audio stream of the electronic device is set to 15 volume levels in total, in which a volume level of 0 corresponds to "mute", and a volume level of 15 is the highest volume level, and the volume level of the audio stream of different audio stream types can be different, for example, the volume level of the audio stream of the STREAM_MUSIC is 8, the volume level of the audio stream of the STREAM_VOICE_CALL is 10, and the volume level of the audio stream of the STREAM_RING is 12, that is, when the electronic device plays the audio stream of the audio stream type of the STREAM_MUSIC, the volume level of the play volume is 8, when the electronic device plays the audio stream of the audio stream type of the STREAM_VOICE_CALL, the volume level of the play volume is 10, and when the electronic device plays the audio stream of the audio stream type of the STREAM_RING, the volume level of the play volume is 12.

[0061] In addition, there can be a volume difference at the level of the audio output device when the audio stream is output, that is, the audio stream of the same audio stream type can use different volumes when output by different audio output devices.

[0062] For example, as Figure 1As shown, taking the media stream of the audio stream type as an example, in a scenario of playing audio using a loudspeaker, the original volume of the audio output by the loudspeaker of the electronic device can be volume 1, in a scenario of playing audio using a wired earphone, the original volume of the audio output by the wired earphone can be volume 2, and in a scenario of playing audio using a wireless earphone, the original volume of the audio output by the wireless earphone can be volume 3, where the volume 1, the volume 2 and the volume 3 can be the same or different.

[0063] For example, Table 1 shows a table of correspondence between different audio stream types and original volumes of different audio output devices.

[0064] Table 1:

[0065]

[0066] It can be understood that the above table of correspondence between original volumes is only an example, and the original volumes can be set according to actual application requirements, which are not limited in the present application.

[0067] It can be understood that different audio stream types can correspond to different application scenarios, that is, the audio stream of one audio stream type can be from different application programs.

[0068] For example, the incoming call ringtone of voice call of the instant messaging application and the incoming call ringtone of the call application (i.e. system incoming call) both belong to the ringtone stream, the audio stream generated when the user uses the instant messaging application to call and the audio stream generated when the user uses the call application to call both belong to the call stream, the game background sound played by the game application, the song played by the music playing application and the audio stream generated when the video is played by the video playing application all belong to the media stream.

[0069] In addition, one application program can output audio streams of different audio stream types, for example, the audio stream output when playing a video using the instant messaging application belongs to the media stream, and the audio stream output when using the instant messaging application to make a voice call or a video call belongs to the call stream.

[0070] Multiple different application programs (application, App) on the electronic device can simultaneously output multiple different audio streams, for example, when the user is exercising, the user can use the sports health application to play a sports training video, at this time the electronic device can play the audio corresponding to the sports training video, and at the same time, the user likes to play dynamic music during exercise, and can use the music playing application to play the dynamic music that the user likes, that is, the electronic device outputs the audio stream corresponding to the sports training video at the same time, and also synchronously outputs the audio stream played by the music playing application.

[0071] When multiple different audio streams are output simultaneously on an electronic device, the multiple different audio streams can be mixed by an audio system engine AudioFlinger, and the mixed audio data can be output to an audio hardware abstraction layer (Audio HAL). The Audio HAL can receive the mixed audio data, and select an audio driver of an audio output device. The Audio HAL can further access a driver corresponding to the audio output device, so as to drive a loudspeaker, an earpiece, or other audio output device of the electronic device to simultaneously play sounds of the multiple applications, or drive a connected external audio output device, such as a wired earphone or a wireless earphone, to simultaneously play sounds of the multiple applications.

[0072] During audio playback of the electronic device, a user can adjust a playback volume of the electronic device. Specifically, adjustment of the playback volume of the electronic device is mainly based on an audio stream type.

[0073] For example, when a user uses a loudspeaker of the electronic device to play an audio stream of a video application, it is assumed that a volume level of a playback volume corresponding to the media stream is level 8. At this time, a call is connected, the video application is paused, and the user uses an earpiece to listen to a sound of a user at the other end. The audio stream type of the sound of the user at the other end played by the earpiece at this time belongs to a call stream, and it is assumed that a volume level of a playback volume corresponding to the call stream is level 10. Therefore, the volume level of the sound of the user at the other end output by the earpiece at this time is level 10. If the user feels that the sound of the user at the other end is a little small, the user can press a volume increase area of a mechanical volume button to increase the volume. It can be understood that the user can increase a volume level by one level each time the user presses the volume increase area of the mechanical volume button. Taking the original volume level of the sound of the user at the other end played by the earpiece as level 10 as an example, if the user presses the volume increase area of the mechanical volume button twice during the call, the volume level of the sound of the user at the other end played by the earpiece becomes level 12. After the user ends the call, the electronic device can restore the original video application to play, and the volume level of the sound output by the electronic device video application at this time is still the original level 8.

[0074] From the above example, it can be known that each type of audio stream can correspond to a volume level, and the volume levels corresponding to different types of audio streams do not affect each other. The user can adjust the volume level of each type of audio stream, and when the user adjusts the volume level of one type of audio stream, the volume level of another type of audio stream is not changed.

[0075] However, when the electronic device plays multiple audio streams of the same audio stream type simultaneously, the user often has no way to adjust the volume of one of the audio streams individually, i.e., the multiple audio streams of the same audio stream type can only be adjusted uniformly, and cannot be adjusted to different volumes as needed by the user.

[0076] The following describes the problem that, when multiple audio streams of the same audio stream type are played simultaneously in the volume adjustment process of the electronic device, only the volume of the multiple audio streams can be adjusted uniformly, and the volume of the audio output by one application cannot be adjusted individually, in combination with possible scenarios.

[0077] Please refer to Figure 2 , Figure 2 A possible scenario is shown.

[0078] In one possible scenario, the user can use the front and background applications of the mobile phone to play audio simultaneously, as shown in Figure 2 . As shown in (a) of Figure 2 , the user uses a sports health application to play a follow-up video of a spinning class, and can adjust the riding speed and climbing gradient according to the prompts of the follow-up video, and at the same time, the user uses a music playing application to play the music that the user likes, so as to stimulate the user's sports enthusiasm. The user can run the music playing application in the system background (the icon 23 of the music playing application can be displayed above the display interface of (a) of Figure 2 ), and the main interface of the electronic device can display the application interface of the sports health application. When the user wants to increase the volume of the music, the user can press the volume increasing area 211 of the mechanical volume button 21 to increase the volume, as shown in (b) of Figure 2 . When the user presses the volume increasing area 211 of the mechanical volume button 21, the display interface of the mobile phone can display a volume adjustment area 22, the volume adjustment area 22 can include a media stream volume progress bar 221 and volume adjustment thumbnails 222 of other audio types, the user can determine the current volume level through the volume progress bar 221, and the user can also slide the volume progress bar 221 to adjust the volume.

[0079] Since the audio stream type of the audio stream corresponding to the follow-up video played by the sports health application is media stream, and the audio stream type of the song played by the music playing application is also media stream, when the user presses the volume increasing area 211 of the mechanical volume button 21 to increase the volume of the song played by the music playing application, or slides the volume progress bar 221 to increase the volume of the song played by the music playing application, the sound of the follow-up video played by the sports health application will also increase, while the user only wants to increase the sound of the music, and the sound of the follow-up video does not need to be changed, that is, the user expects the effect that the playing volume of the background music is large and the user only needs to hear the instructions (riding speed adjustment instructions, climbing slope adjustment instructions, rest instructions, etc.) clearly.

[0080] As can be seen from the above examples, the user cannot adjust the volume of the video played by the sports health application alone, nor can the user adjust the volume of the song played by the music application alone, and the user cannot achieve the desired effect.

[0081] Please refer to Figure 3 , Figure 3 shows a possible scenario.

[0082] In another possible scenario, the user can use the phone split screen to play audio in two applications at the same time, as shown in Figure 3 . As shown in (a) of Figure 3 , the first split screen 31 of the user's phone displays the video playing interface of the video playing application, and the second split screen 32 displays the display interface of the video played in the instant messaging application. When the user wants to reduce the volume of the video played by the video playing application, the user can press the volume decreasing area 212 of the mechanical volume button 21 to reduce the volume, as shown in (b) of Figure 3 . When the user presses the volume decreasing area 212 of the mechanical volume button 21, the display interface of the phone can be the volume adjustment area 22, which can include the media stream volume progress bar 221 and other audio type volume adjustment thumbnails 222. The user can determine the current volume by the volume progress bar 221, and the user can also slide the volume progress bar 221 to adjust the volume.

[0083] Since the audio stream type of the audio stream corresponding to the video played by the video playing application is a media stream, the audio stream type of the audio stream corresponding to the video played by the instant chat application is also a media stream, therefore, when the user presses the volume reduction area 212 of the mechanical volume button 21 to reduce the volume of the video played by the video playing application, or reduces the volume of the video played by the video playing application by sliding the volume progress bar 221, the volume of the video played by the instant chat application will also be reduced, and the user only wants to reduce the volume of the video played by the video playing application, but does not like to change the volume of the video played by the instant chat application, so that the user can clearly hear the sound of the video played by the instant chat application without pausing the video played by the video playing application.

[0084] It can be understood that the above-mentioned volume progress bar 221 is Figure 2 or Figure 3 the volume progress bar corresponding to the media stream in the scene shown in the figure.

[0085] As can be seen from the above examples, the user cannot individually adjust the volume of the video played by the video playing application, nor can the user individually adjust the volume of the video played by the instant chat application, that is, the user cannot achieve the desired effect.

[0086] It should be noted that the simultaneous playing of multiple audio streams of the same audio stream type can also be other scenarios, for example, for a mobile phone supporting multi-window display functions such as floating window and picture-in-picture, two application programs can also be run simultaneously through picture-in-picture, floating window, etc., and audio streams of the same audio stream type can also be played simultaneously.

[0087] It should be further noted that the above-mentioned way of adjusting the volume by the mechanical volume button of the electronic device is also only an example, and the user can also select the way of adjusting the volume according to the actual application scenario, for example. For a vehicle-mounted device that can adjust the playing volume by voice, the user can input the voice command to adjust the volume to achieve the adjustment of the volume.

[0088] It can be understood that if the electronic device is connected to an external audio output device, for example, a wireless earphone or a wired earphone, based on the current volume adjustment method of adjusting the volume according to the audio stream type, the volume of multiple audio streams of the same audio stream type output to the wireless earphone or the wired earphone can only be uniformly adjusted, and cannot be individually adjusted.

[0089] It can be understood that the above-mentioned examples are also only explained by the volume adjustment process of multiple audio streams of the media stream played simultaneously, when the electronic device simultaneously outputs multiple audio streams of the call stream, or simultaneously outputs multiple audio streams of the notification stream, the volume can also only be uniformly adjusted, that is, when the electronic device simultaneously outputs multiple audio streams of the same audio stream type, the user cannot individually adjust the volume of the audio stream output by an application.

[0090] Based on this, the embodiment of the present application provides a volume adjustment method, in the case that an electronic device simultaneously outputs multiple audio streams of the same audio stream type, and receives a volume adjustment operation of a user, the target volume of the focus application can be determined according to the audio stream type, the audio output device and the focus application, the volume of the output audio of the focus application is adjusted based on the determined target volume, thereby realizing the volume adjustment of the audio stream output by a certain application.

[0091] The volume adjustment method provided by the embodiment of the present application will be described in detail below. In the following description, specific details such as specific system structures, techniques, etc. are presented for the purpose of explanation, but not for the purpose of limitation, so as to thoroughly understand the embodiment of the present application.

[0092] In some embodiments, the execution subject of the above-mentioned volume adjustment method can be an electronic device. The above-mentioned electronic device can also be referred to as a terminal, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. The electronic device can be a mobile phone, a smart television, a wearable device (such as a smart bracelet, a smart watch, smart glasses, etc.), a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) electronic device, an augmented reality (AR) electronic device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in transportation safety, a wireless terminal in smart city, a cloud server, etc. capable of performing the generation task of the training plan. The embodiment of the present application does not limit the specific technology and specific device form adopted by the electronic device.

[0093] In order to better understand the embodiment of the present application, the structure of the electronic device of the embodiment of the present application is introduced as follows:

[0094] Figure 4 The structure schematic diagram of the electronic device 100 is shown. As shown in the figure, the electronic device 100 includes a processor 101, a memory 102, a power supply 103, a communication interface 104, a display 105, a sensor 106, an input device 107, and the like. Figure 4As shown, the electronic device 100 can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headset jack 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0095] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or fewer components than shown, or combine certain components, or split certain components, or different arrangement of components. The components shown can be implemented in hardware, software, or a combination of software and hardware.

[0096] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units can be independent devices, or can be integrated in one or more processors.

[0097] The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching and executing instructions.

[0098] In some embodiments, the processor 110 is implemented by a system on chip (SOC), i.e., the processor 110 mentioned in some embodiments of the present application can specifically refer to an SOC chip.

[0099] The processor 110 can also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can save instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instructions or data again, it can be called from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thus improving the efficiency of the system.

[0100] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0101] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is illustrative and does not constitute a structural limitation of the electronic device 100. In some other embodiments of the present application, the electronic device 100 can also use different interface connection methods or combinations of multiple interface connection methods in the above embodiments.

[0102] In some embodiments, the antenna 1 and the mobile communication module 150 of the electronic device are coupled, and the antenna 2 and the wireless communication module 160 are coupled, so that the electronic device can communicate with a network and other devices through wireless communication technology. The wireless communication technology can include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), bluetooth (BT), global navigation satellite system (GNSS), wireless local area network (WLAN), near field communication (NFC), and / or infrared (IR) technology, etc. The GNSS can include global positioning system (GPS), global navigation satellite system (GLONASS), beidu navigation satellite system (BDS), quasi-zenith satellite system (QZSS), and / or satellite based augmentation systems (SBAS).

[0103] The electronic device 100 implements an audio function through a speaker 170A, a receiver 170B, a microphone 170C, a headphone interface 170D, and an application processor, etc. For example, music playing, audio collection, recording, etc.

[0104] The speaker 170A, also called "loudspeaker", is used to convert an audio electrical signal into an acoustic signal. The electronic device 100 can listen to music or listen to a hands-free call, etc. through the speaker 170A.

[0105] The receiver 170B, also known as the "earpiece", is used to convert the audio electrical signal into a sound signal. When the electronic device 100 answers the phone or voice message, the receiver 170B can be held close to the ear to listen to the voice.

[0106] For example, the earpiece of the electronic device can simultaneously play the voice of the other teammates from the game application and the voice of the opposite user in the voice call process from the WeChat application.

[0107] The microphone 170C, also known as the "microphone", "sound collector", is used to convert the sound signal into an electrical signal. When making a call or sending a voice message, the user can speak into the microphone 170C by holding the mouth close to the microphone 170C, and input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C.

[0108] In other embodiments, the electronic device 100 can be provided with two microphones 170C, in addition to collecting sound signals, it can also realize the noise reduction function.

[0109] In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C, to realize the collection of sound signals, noise reduction, and also to identify the source of the sound, to realize the directional recording function, etc.

[0110] For example, in addition to listening to the voice of the other teammates from the game application and the voice of the opposite family member in the voice call process from the WeChat application through the earpiece, the microphone 170C can also obtain the sound signal of the user and convert it into an electrical signal, and transmit it to the opposite device.

[0111] The earphone interface 170D is used to connect the wired earphone. The earphone interface 170D can be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0112] For example, the audio system of the electronic device 100 can select the appropriate output device or playback device according to the type of audio stream output by each application. In the case where the user connects the wired earphone through the earphone interface 170D, the media stream (STREAM_MUSIC) will only be output to the wired earphone through the earphone interface 170D, and if a call is incoming at this time, the phone ring (STREAM_RING) will be output to the wired earphone and the loudspeaker 170A through the earphone interface 170D at the same time, which will not be described here.

[0113] The electronic device 100 implements a display function through a GPU, a display screen 194, and an application processor, etc. The GPU is a microprocessor for image processing, connecting the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs that execute program instructions to generate or change display information.

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

[0115] The pressure sensor 180A is used to sense a pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194. There are many types of pressure sensors 180A, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, etc. The capacitive pressure sensor can include at least two parallel plates with conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device determines the intensity of the pressure according to the change in capacitance. When a touch operation is applied to the display screen 194, the electronic device detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device can also calculate the position of the touch according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation instructions. For example, when a touch operation with a touch operation intensity less than a first pressure threshold is applied to a short message application icon, an instruction to view short messages is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold is applied to the short message application icon, an instruction to create a new short message is executed.

[0116] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. For example, the motion posture when the user moves can be acquired based on the gyroscope sensor 180B. The gyroscope sensor 180B can also be used for navigation, a motion sensing game scenario, etc.

[0117] The acceleration sensor 180E can detect the magnitude of acceleration of the electronic device 100 in each direction (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. The acceleration sensor 180E can also be used to identify the posture of the electronic device, and can be applied to switching between landscape and portrait modes, a pedometer, etc.

[0118] The keys 190 include a power-on key, a volume key, etc. The keys 190 can be mechanical keys or touch keys. The electronic device 100 can receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.

[0119] For example, in the embodiments of the present application, the keys 190 can include mechanical volume keys on the side frame of a mobile phone, or other touch volume adjustment keys.

[0120] Optionally, the user can trigger the volume adjustment process by pressing the mechanical volume keys on the side frame of the mobile phone. For example, when it is detected that the user presses the volume increase area (i.e., the area for increasing the volume) on the mechanical volume keys (or presses the volume decrease area (i.e., the area for decreasing the volume) on the mechanical volume keys, the electronic device can automatically display a volume adjustment window on the current interface, and can display a volume progress bar. The user can determine the current volume by the volume progress bar, or can adjust the volume by sliding the volume progress bar.

[0121] The electronic device 100 with the above hardware structure can use a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture, etc. The software structure of the electronic device 100 is exemplarily described in the embodiments of the present application by taking an Android system with a layered architecture as an example.

[0122] Figure 5 The software structure of the electronic device 100 in the embodiments of the present application is shown in the following block diagram.

[0123] The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. It should be noted that, Figure 5The audio system architecture diagram of the Android system of the electronic device shown, it should be understood that the audio system architecture can be divided into four layers, from top to bottom, the application layer, the application framework layer, the audio hardware abstraction layer (Audio HAL) and the kernel layer.

[0124] In the embodiments of the present application, the audio system based on the Android system is referred to as the audio (Audio) system, which can be responsible for functions such as audio data collection and output, audio stream control, audio device management, and volume adjustment.

[0125] The application layer can include a series of application packages. As shown in the application layer can include camera, gallery, calendar, call, map, music, sports health, Bluetooth, video, instant chat, reading and other applications. Figure 5

[0126] It should be understood that each application capable of outputting audio can construct an audio track in the application framework, that is, each application has its corresponding audio track, and after constructing the corresponding audio track in each application, the application can write audio data to the corresponding audio track, and each audio track can further output the decoded audio stream to the audio system engine (AudioFlinger).

[0127] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications of the application layer. The application framework layer includes some pre-defined functions. In the embodiments of the present application, the application framework layer can include a media player (MediaPlayer) interface class, a sound pool (SoundPool) interface class, an Audio Track interface class, and an audio server (Audio server).

[0128] When the audio system is started, the Audio server can load the AudioFlinger. During audio playback, the Audio server can call and initialize the AudioFlinger and the audio policy service (Audio Policy Service) respectively.

[0129] ​It should be understood that the Audio Policy Service and the AudioFlinger are two basic services of the audio system. The Audio Policy Service is a policy maker of the audio system, responsible for policy choices of audio device switching, volume adjustment policies, etc. For example, the Audio Policy Service can play a role of routing, and has the right to decide where an audio stream generated by an AudioTrack is finally transmitted to.

[0130] The AudioFlinger is an audio system player, responsible for managing input audio stream devices, managing output audio stream devices, and switching audio modes, loading audio parameters, processing and transmitting audio stream data, etc. In the process of initialization of the AudioFlinger, the original volume parameters of the Audio system can be obtained, for example, the volume levels corresponding to the call stream, ring tone stream, notification stream, media stream, etc. listed in Table 1.

[0131] It should be understood that in the process of initialization of the Audio Policy Service, the audio configuration in the settings can be parsed, and the deployment of the entire audio system can be completed by using the interface provided by the AudioFlinger, thereby providing bottom support for the upper-layer application to use the audio device.

[0132] It should also be understood that the Audio Policy Service is the place where the AudioFlinger is really called. The Audio Policy Service can call the functions in the AudioFlinger through the Binder mechanism, that is, call the AudioFlinger interface.

[0133] For example, in the embodiment of the present application, when an application program starts audio stream output, the audio data included in the audio stream can be identified as a certain type of audio stream, and the decoded audio stream data is output to the AudioFlinger through the Audio Track corresponding to the application program. The AudioFlinger can load the original volume corresponding to the audio stream type and the audio output device according to the audio stream type and the audio output device. In the case of receiving a user volume adjustment instruction, the AudioFlinger can determine the original volume according to the audio stream type and the audio output device, and determine the relative volume according to the focus application and the user volume adjustment instruction, and finally determine the target volume of the focus application, load the target volume for output.

[0134] Optionally, the AudioFlinger can further include an Audio Mixer, the Audio Mixer of the AudioFlinger can mix the audio streams output by the plurality of different applications, and output the mixed audio data by the AudioFlinger.

[0135] In the embodiments of the present application, the AudioFlinger can determine the target volume of the focus application and load the target volume of the focus application, the output volume of the non-focus application remains unchanged, and then mix the audio data, and output the mixed audio data by the AudioFlinger, thereby realizing the effect of adjusting the volume of the focus application alone.

[0136] In the embodiments of the present application, the Audio HAL can be responsible for interaction with the audio output device, and the Audio HAL can be directly called by the AudioFlinger, including an audio hardware abstraction layer implementation.

[0137] The kernel layer is a layer between hardware and software. The kernel layer at least includes display drivers, camera drivers, audio drivers, and sensor drivers.

[0138] For example, the Audio HAL can receive the mixed audio data and select an audio output device. Further, the Audio HAL accesses the driver program corresponding to the audio output device in the kernel layer, so as to drive the audio output device to play the audio of the plurality of applications at the same time.

[0139] In addition, the Audio system can further include an audio output device of the electronic device 100, and the audio output device can be called by the corresponding driver program in the kernel layer. The speaker, earpiece, and other hardware devices of the electronic device play based on the volume loaded by the AudioFlinger.

[0140] The kernel layer is a layer between hardware and software. The kernel layer at least includes audio drivers and the like.

[0141] For example, as shown in Figure 5 The Audio HAL in the embodiments of the present application can be responsible for interaction with the audio output device, and the AudioFlinger can directly call the Audio HAL. The Audio HAL can select the audio output device of the audio stream of the audio stream type, and access the driver program of the audio output device in the kernel layer, so as to drive the audio output device to play according to the volume corresponding to the audio stream type and the audio output device loaded by the AudioFlinger.

[0142] The audio output device of the electronic device 100 can include Figure 4The loudspeaker 170A, the receiver 170B, a player capable of playing audio such as a wired earphone connected through an earphone interface 170D, a wireless earphone connected through a wireless connection, and the like shown in FIG. 1 are not limited in the embodiments of the present application.

[0143] The volume adjustment method provided by the embodiments of the present application will be described below by way of a plurality of exemplary embodiments with reference to the accompanying drawings. The methods in the following embodiments can be implemented in an electronic device having the hardware structure and the software architecture described above. The hardware structure diagram of the electronic device can be as shown in FIG. 1, and the software structure block diagram of the electronic device can be as shown in FIG. 2, but the embodiments of the present application are not limited thereto. For ease of description, the electronic device in the embodiments of the present application is taken as a mobile phone as shown in FIG. 1. Figure 4 Figure 5 Figure 4

[0144] Figure 6 is a schematic diagram of an image user interface involved in an application scenario for adjusting the volume provided by the embodiments of the present application.

[0145] Exemplarily, as shown in FIG. 3(a), the mobile phone is currently running a sports health application in the foreground, and a follow-up video of a spinning class is played through the sports health application, and the mobile phone displays a follow-up video playing interface as shown in FIG. 3(a). Figure 6 Figure 6 Figure 6

[0146] Suppose that the user feels that the sound of the song is too small during the exercise and wants to increase the playing volume of the song, but expects the prompt sound of the follow-up video to remain unchanged, and suppose that the user sets the application running in the foreground as the focus application, the user can place the music playing application in the foreground running by inputting an application window display operation, and the above application window display application can be an up-swipe operation in the screen of the mobile phone. After the mobile phone receives the up-swipe operation input by the user, a display interface as shown in FIG. 3(b) can be displayed. Figure 6 Figure 6 Figure 6 ​​​​​​​​(c) in FIG. 6, i.e. the music playing application is running in the foreground, the user can adjust the volume of the song played by the music playing application by pressing the mechanical volume button on the side of the phone, specifically, the phone displays the interface as shown in (d) in FIG. 6 in response to the user pressing the mechanical volume button 21 on the side of the phone, i.e. the phone displays the volume adjustment area 22 in the display interface of the phone, the volume adjustment area 22 can include the volume progress bar 223 of the music playing application and the volume adjustment thumbnail 222 of other audio types. Figure 6

[0147] It can be understood that the volume progress bar 223 is the volume progress bar of the music playing application in the scenario shown in (d) in FIG. 6. Figure 6

[0148] It can be understood that the user can increase the volume of the song played by the music playing application by pressing the volume increasing area 211 of the mechanical volume button 21.

[0149] For example, the user can increase the volume of the song played by the music playing application by one volume level each time the user presses the volume increasing area 211 of the mechanical volume button 21, assuming that the volume level of the song played by the music playing application and the volume level of the video played by the sports health application are both level 8 before the volume is adjusted, after the user presses the volume increasing area 211 of the mechanical volume button 21 twice, the volume level of the song played by the music playing application can be adjusted to level 10, and the volume level of the video played by the sports health application is still level 8, i.e. this embodiment can only adjust the volume of the audio stream output by the music playing application.

[0150] It can be understood that the user can also adjust the volume of the song played by the music playing application by long-pressing the volume increasing area 211 of the mechanical volume button 21, and the phone can determine the volume level to be increased according to the duration of the user pressing the volume increasing area 211 of the mechanical volume button 21.

[0151] It can be understood that the user can also adjust the volume of the song played by the music playing application through the volume progress bar 223 of the music playing application, and the phone can determine the volume of the song played by the music playing application according to the progress of the user dragging the volume progress bar 223 of the music playing application.

[0152] For another example, assuming that the application running in the foreground of the phone is the music playing application, the user does not need to put the music playing application in the foreground, when the user needs to increase the volume of the song played by the music playing application, the user only needs to press the volume increasing area 211 of the mechanical volume button 21 to achieve the technical effect of only increasing the volume of the song played by the music playing application while keeping the volume of the follow-up video played by the sports health application unchanged. ​​

[0153] Figure 7 is another example of the image user interface provided by the embodiments of the present application in the application scenario of adjusting the volume.

[0154] As shown in Figure 7 , the user uses the mobile phone to split the screen and simultaneously run two application programs in the foreground, as shown in Figure 7 (a), the first split screen 31 of the mobile phone displays the video playing interface of the video playing application, and the second split screen 32 displays the playing interface of the video played in the instant messaging application, that is, in the scenario shown in Figure 7 (a), the speaker of the mobile phone simultaneously plays the sound of the video played by the video playing application and the sound of the video played by the instant messaging application.

[0155] Suppose the user wants to reduce the volume of the video played by the video playing application, and the user sets to run multiple application programs in the foreground, and the application running in the first split screen is the focus application, then the user can directly press the volume reduction area 212 of the mechanical volume button 21 on the side of the mobile phone, and the volume of the video played by the video playing application can be adjusted. Specifically, the mobile phone displays the interface shown in Figure 7 (b) in response to the user pressing the mechanical volume button 21 on the side of the mobile phone, that is, the volume adjustment area 22 is displayed in the display interface of the mobile phone, and the volume adjustment area 22 can include the volume progress bar 224 of the video playing application and the volume adjustment thumbnail 222 of other audio types.

[0156] It can be understood that the above-mentioned volume progress bar 224 is the volume progress bar corresponding to the video playing application in the scenario shown in Figure 7 .

[0157] It can be understood that the user can reduce the volume of the video played by the video playing application by pressing the volume reduction area 212 of the mechanical volume button 21.

[0158] As an example, the user can reduce the volume of the video played by the video playing application by one volume level each time the user presses the volume reduction area 212 of the mechanical volume button 21. Suppose the volume level of the video played by the video playing application and the volume level of the video played by the instant messaging application are both 6 levels before adjusting the volume, after the user presses the volume reduction area 212 of the mechanical volume button 21 for 6 times, the volume level of the video played by the video playing application is adjusted to 0 level, while the volume of the video played by the instant messaging application remains unchanged at 6 levels.

[0159] Assume that the user feels that the volume of the video played by the instant messaging application is still a little low, and wants to increase the volume level to 8, then the user can press and hold the application interface of the instant messaging application and drag the instant messaging application to the display area of ​​the first split screen, as shown in the following figure. Figure 7 As shown in (c) of FIG, the first split screen 31 of the mobile phone displays the playback interface of the video in the instant messaging application, and the second split screen 32 displays the video playback interface of the video playback application. Then the user can press the volume increase area 211 of the mechanical volume button 21 on the side of the mobile phone again to make the display interface of the mobile phone jump to the following figure: Figure 7 The interface shown in (d) in the figure, that is, the volume adjustment area 22 is displayed again in the display interface of the mobile phone. At this time, the user can press the volume increase area 211 of the mechanical volume button 21 twice to adjust the volume of the video played by the instant messaging application to the volume corresponding to volume level 8, or the user can drag the volume progress bar 225 of the instant messaging application in the volume adjustment area 22 to the corresponding position of volume level 8, thereby adjusting the volume of the video played by the instant messaging application to the volume corresponding to volume level 8.

[0160] It is understandable that the volume progress bar 225 is Figure 8 The volume progress bar corresponding to the instant messaging application in the scenario shown.

[0161] It should be noted that the mobile phone can not only run two applications at the same time, but also run more than two applications at the same time. The mobile phone can display the running interfaces of multiple applications on the display interface at the same time through split screen, floating ball, picture-in-picture, etc. This application does not impose specific restrictions on this.

[0162] It can be understood that the above embodiments are only illustrative of the example of a speaker as an audio output device. The audio output device can also be a wireless headset, a wired headset, a wireless speaker, a wired speaker and other devices, and this application does not make specific limitations on this.

[0163] It should be noted that, in the embodiment of the present application, the user can set the focus application according to the user's usage habits. The following is an exemplary description of the process of setting the focus application:

[0164] Case 1: When only one application is running in the electronic device, it can be determined that the application is the focus application.

[0165] Case 2: When there are multiple applications running simultaneously in the foreground and background in the electronic device, and the multiple applications output audio streams of the same audio stream type at the same time, but there is only one application running in the foreground, the application running in the foreground can be set as the focus application.

[0166] Case 3: When multiple application split screens exist on the electronic device, and multiple applications output audio streams of the same audio stream type at the same time, the application running in the focus window can be set as the focus application.

[0167] It should be noted that after the application split screen of the electronic device, one of the windows can be determined as the focus window. For example, as shown in (a) of FIG. 8, in the case of an up-down split screen, the upper split screen window can be determined as the focus window, i.e., the application running in the upper split screen window 81 is the focus application. For another example, as shown in (b) of FIG. 8, in the case of a left-right split screen, the left split screen window 84 can be determined as the focus window, i.e., the application running in the left split screen window is the focus application. For another example, as shown in (c) of FIG. 8, in the case of a three-split screen, the middle split screen window 86 can be determined as the focus window, i.e., the application running in the middle split screen window is the focus application. Figure 8 Figure 8 Figures 6 to 8

[0168] It can be understood that the above-mentioned split screen mode is only an example, and the user can divide the display screen of the mobile phone into multiple split screen windows according to the actual application demand, and the position of the split screen window and the distribution format of the split screen window can be set according to the actual demand. The application does not make specific limitations on this, and as for which split screen window is set as the focus window, it can be set according to the user's usage habit, and the application also does not make specific limitations on this.

[0169] Case 4: When one application program is running in the foreground of the electronic device, and another application program is running in the form of a floating ball, and different application programs output audio streams of the same audio stream type at the same time, the application program running in the foreground displayed in the home screen can be set as the focus application.

[0170] It can be understood that the background of the electronic device can also run other application programs, and the audio stream type of the audio stream output by the application program can also be the same as the audio stream type of the audio stream output by the above-mentioned two application programs. For this case, after receiving the volume adjustment operation, the electronic device will only adjust the play volume of the focus application, i.e., adjust the play volume of the application program running in the foreground displayed in the home screen, and the play volume of the application program running in the form of a floating ball and the application program running in the background will remain unchanged.

[0171] It should be noted that the above-mentioned four cases are only for explaining how to set the focus application, not limiting. In other cases, for example, in the case of running different application programs in the "picture-in-picture", the application program running in the center window of the picture can be determined as the focus application, and for another example, the user can also determine the application program running in the floating ball as the focus application.

[0172] ​​​In the above process, the user can place the application whose volume needs to be adjusted in the running scene of the focus application, and then adjust the playback volume of the focus application by inputting the volume adjustment operation without affecting the playback volume of other applications, thereby achieving the volume adjustment of the output audio stream of a certain application separately.

[0173] For different application scenarios, the above embodiments are combined with Figure 9 , the implementation process and possible implementation methods of adjusting the volume are introduced from the user interaction level. The following will introduce the underlying implementation process of the volume adjustment method provided in the embodiment of the present application from the underlying implementation strategy level.

[0174] See also Figure 9 , Figure 6 A flow chart of a volume adjustment method according to an embodiment of the present invention is provided. Figure 6 Taking the scenario shown as an example where a sports and health application is running in the foreground and a music player application is running in the background, the speaker of the mobile phone simultaneously outputs the audio stream of the sports and health application and the audio stream of the music player application.

[0175] S901: The sports health application at the application layer outputs an audio stream, the audio stream type of the audio stream is marked as a media stream, and the audio output device of the audio stream is marked as a speaker.

[0176] S902: The music playing application at the application layer outputs an audio stream, the audio stream type of the audio stream is marked as a media stream, and the audio output device of the audio stream is marked as a speaker.

[0177] In specific applications, sports and health applications and music playback applications at the application layer can specify that the audio stream type corresponding to the audio data contained in the output audio is "media stream" through Attribute.usage.

[0178] S903: The sports and health application calls the API of the sports and health application and creates an Audio Track corresponding to the sports and health application in the application framework layer.

[0179] The Audio Track corresponding to the sports and health application can output the decoded media stream corresponding to the sports and health application.

[0180] S904: The music player application calls the API of the music player application and creates an Audio Track corresponding to the music player application in the application framework layer.

[0181] The Audio Track corresponding to the music playback application outputs the decoded media stream corresponding to the music playback application.

[0182] S905: The Audio Track corresponding to the sports health application and the Audio Track corresponding to the music playing application call AudioFlinger of the Audio system, and transmit the decoded audio data to AudioFlinger, so that AudioFlinger loads the corresponding volume according to the media stream and the audio output device, that is, the original volume of the audio stream output by the sports health application and the original volume of the audio stream output by the music playing application.

[0183] S906: The application layer receives the volume adjustment operation of the user, and issues a key event to the application framework layer.

[0184] In a specific application, the volume adjustment operation input by the user can refer to the related description in the scenario shown in Figure 7 or Figure 6 , which will not be repeated here.

[0185] In a specific application, the key event can include the type of the key and the related content such as the pressing duration, the pressing times, etc.

[0186] S907: After receiving the key event, AudioFlinger determines the volume adjustment instruction according to the key event, and determines the relative adjustment volume of the audio stream output by the music playing application according to the volume adjustment instruction and the application identifier of the music playing application.

[0187] Here, the user can pre-set the music playing application as the focus application, that is, the music playing application can be set as the foreground running. The music playing application can be set as the foreground running by referring to the operation of Figure 10 .

[0188] In a specific application, the music adjustment instruction, that is, the related instruction for determining the volume adjustment mode and the adjusted volume level of the music playing application, corresponds to the key event. That is, if the user presses the volume increase area of the mechanical volume key once, it can be determined that the volume adjustment mode is to increase the volume, and the adjusted volume level is level 1. At this time, the volume adjustment instruction is to increase the original volume of the music playing application by one volume level.

[0189] S908: According to the original volume of the audio stream output by the music playing application and the relative adjustment volume of the audio stream output by the music playing application, the target volume of the audio stream output by the music playing application is determined.

[0190] In a specific application, the target volume (FinalVolumeIndex) of the audio stream output by the music playing application can be the sum of the original volume and the relative adjustment volume.

[0191] For example, please refer to Figure 10 , Figure 10The determination process of the target volume in the volume adjusting method provided by the embodiment of the application is shown.

[0192] As shown in Figure 11 , the original volume is determined according to the audio stream type corresponding to the audio stream output by the music playing application and the audio output device of the audio stream, the relative adjusting volume is determined according to the volume adjusting instruction, and the target volume is determined according to the original volume and the relative adjusting volume.

[0193] S909: The AudioFlinger acquires the audio data included in the audio stream after audio decoding of each of the music playing application and the sports health application, mixes the audio data of the sports health application and the music playing application in the Audio Mixer of the AudioFlinger, and outputs the mixed audio data (audio data) by the AudioFlinger.

[0194] S910: The corresponding audio output device is selected by the Audio HAL layer, and the mixed audio data is output by the corresponding audio output device through the audio driver in the kernel layer.

[0195] In a specific application, after the above process, the mobile phone can output the audio data of the sports health application and the audio data of the music playing application at the same time, and the volume of the audio data of the music playing application is the volume adjusted according to the volume adjusting operation input by the user.

[0196] Through the method provided by the embodiment of the application, when the electronic device outputs multiple audio streams of the same audio stream type at the same time and receives the volume adjusting operation of the user, the target volume of the focus application can be determined according to the audio stream type, the audio output device and the focus application, and the volume of the output audio of the focus application is adjusted based on the determined target volume, so as to realize the individual adjustment of the volume of the audio stream output by the application, and to be more in line with the playback requirements of the user.

[0197] The underlying implementation process of the application is described above, and the specific implementation process of the volume adjusting method provided by the embodiment of the application will be described below.

[0198] Please refer to Figure 11 , Figure 12 A schematic flowchart of another implementation manner of the volume adjusting method provided by the embodiment of the application is shown.

[0199] S1101: In response to the volume adjusting operation of the user, the application identifier of the focus application is acquired.

[0200] In a specific application, the volume adjusting operation is used to adjust the volume of the audio played by the electronic device.

[0201] It should be noted that when the user inputs the volume adjustment operation, the audio output device is simultaneously outputting multiple audio streams of the same audio stream type.

[0202] For the relevant description of the above-mentioned focus application, please refer to the relevant description of the focus application setting process, which will not be repeated in this application.

[0203] The application identifier of the focus application may specifically be an application package name, that is, an APK package name.

[0204] S1102: Determine the original volume of the audio output by the focus application according to the audio stream type and audio output device of the audio output by the focus application.

[0205] S1103: Determine a relative adjustment volume of the audio output by the focus application according to the volume adjustment operation.

[0206] In an embodiment of the present application, in the process of adjusting the volume of the output audio of an application, in addition to considering the audio stream type and audio output device of the output audio, the dimension of application type is additionally added, that is, the target volume of a certain application is determined by comprehensively considering the audio stream type, audio output device and application type.

[0207] For example, Figure 13 As shown, taking the audio stream type as media stream as an example, assuming that the audio output device is a speaker, the playback volume (i.e., the original volume) corresponding to the speaker and the media stream can be determined first, and when the focus application is video playback application 1, the relative adjustment volume can be determined based on the volume adjustment operation input by the user, so that the target volume of the audio stream output by video playback application 1 can be finally determined to be volume 4; for another example, if the audio stream type is media stream and the audio output device is a wireless headset, the playback volume (i.e., the original volume) corresponding to the wireless headset and the media stream can be determined first, and when the focus application is music playback application 2, the relative adjustment volume can be determined based on the volume adjustment operation input by the user, so that the target volume of the audio stream output by music playback application 2 can be finally determined to be volume 5; for another example, if the audio stream type is media stream and the audio output device is a wired headset, the playback volume (i.e., the original volume) corresponding to the wired headset and the media stream can be determined first, and when the focus application is instant messaging application 3, the relative adjustment volume can be determined based on the volume adjustment operation input by the user, so that the target volume of the audio stream output by instant messaging application 3 can be finally determined to be volume 6.

[0208] S1104: Determine a target volume of the audio output by the focus application according to the original volume and the relatively adjusted volume of the audio output by the focus application.

[0209] In an embodiment of the present application, the above S1104 may specifically include the following steps:

[0210] a key-value pair of the focus application is constructed by taking the application identifier of the focus application as the key and taking the relative adjustment volume as the value;

[0211] The target volume is calculated according to the key-value pair of the relative adjustment volume on the original volume.

[0212] S1105: The volume of the audio output by the focus application is adjusted to the target volume.

[0213] For example, we take the sports health application as the focus application, and the specific implementation of the self-volume of the sports health application is described as follows:

[0214] The audio stream type and the audio output device of the audio output by the sports health application are used to determine the original volume. According to the volume adjustment operation input by the user, a key-value pair is added, in which the package name of the sports health application is taken as the key, and the relative adjustment volume (i.e., the volume level that needs to be adjusted corresponding to the volume adjustment operation) is taken as the value. The key-value pair is created according to the following conditions: the current application is running in the foreground or is running in the focus window, the electronic device receives the mechanical volume button pressed by the user to adjust the volume, or the volume adjustment operation is performed by sliding the volume progress bar. Assuming that the volume level of the original volume corresponding to the media stream and the loudspeaker is 8 levels after the electronic device is started. At this time, when the sports health application is in the foreground, the user presses the volume increase area of the mechanical volume button once, the electronic device will store 1 in the value of the key-value pair with the package name of the sports health application as the key, that is, the value of the key-value pair with the package name of the sports health application as the key is 1, and the volume level of the output audio of the sports health application in the current scene is adjusted to 9 levels, that is, the original volume level 8 levels plus the value. If at this time, the user presses the volume decrease area of the mechanical volume button twice in succession, the relative adjustment volume becomes 1-1-1=-1, that is, the value of the key-value pair with the package name of the sports health application as the key becomes-1, and the volume level of the output audio of the sports health application in the current scene is adjusted to 7 levels.

[0215] In a specific application, the key-value pair can be issued by using the AudioManager.setParameter() function, so as to realize the volume adjustment of the focus application.

[0216] In an embodiment of the present application, after the electronic device is restarted, the key-value pair of the application identifier and the relative adjustment volume is initialized, that is, the value of the key-value pair is restored to 0.

[0217] It can be seen from the above that the volume adjusting method provided in the embodiments of the present application can determine the target volume of the focus application according to the audio stream type, the audio output device and the focus application when the electronic device simultaneously outputs multiple audio streams of the same audio stream type and receives the volume adjusting operation of the user, and adjust the volume of the output audio of the focus application based on the determined target volume, thereby realizing the individual adjustment of the volume of the audio stream output by the application.

[0218] In some embodiments of the present application, the user can also set the white list and the black list according to the needs.

[0219] Specifically, the user can add, in the application management option in the system setting application, an application program set (i.e., the white list, referred to as the first set hereinafter) that can support independent volume adjustment and an application program set (i.e., the black list, referred to as the second set hereinafter) that does not support independent volume adjustment, and the application programs in the first set can realize the individual adjustment of the volume by using the volume adjusting method provided in the embodiments of the present application, while the application programs in the second set still realize the volume adjustment by using the original volume adjusting method (i.e., the volume adjustment is realized by using the audio stream type and the audio output device to adjust the volume).

[0220] In some embodiments, the first set and the second set can further limit the audio stream type of the application programs. For example, the game scenario involves multiple audio streams such as voice call, game background music and game skill sound effect, and thus personalized volume adjustment is required, and thus the part of the game application scenario can be added to the first set, while the message notification sound of the game application does not require personalized volume adjustment, and thus the related scenario of the message notification sound of the game application can be added to the second set.

[0221] Of course, the user can also select other ways to set the first set, for example, adding the application to the first set through the setting interface of the application program.

[0222] It can be understood that the first set is an application program set that supports independent volume adjustment, and the second set is an application program set that does not support independent volume adjustment.

[0223] Please refer to Figure 14 In some embodiments of the present application, the volume adjusting method can include the following steps:

[0224] S1301: In response to the volume adjusting operation of the user, the application identifier of the focus application is acquired.

[0225] The implementation of S1301 can refer to the related description of S1101, which will not be repeated here.

[0226] S1302: Determine whether the focus application is an application in the first set according to the application identifier of the focus application. If yes, perform S1303, otherwise perform S1307.

[0227] In a specific application, the electronic device can determine the application identifier of the application in the first set, compare the application identifier of the focus application with the application identifier of the application in the first set, and then determine whether the focus application is an application in the first set.

[0228] S1303: Determine the original volume of the focus application outputting audio according to the audio stream type and the audio output device of the focus application outputting audio.

[0229] S1304: Determine the relative adjustment volume of the focus application outputting audio according to the volume adjustment operation.

[0230] S1305: Determine the target volume of the focus application outputting audio according to the original volume and the relative adjustment volume of the focus application outputting audio.

[0231] S1306: Adjust the volume of the focus application outputting audio to the target volume.

[0232] The implementation of S1303 to S1306 can refer to the related description of S1102 to S1105, which will not be repeated here.

[0233] S1307: Determine the target volume of all audio output applications outputting audio according to the audio stream type, the audio output device, and the volume adjustment operation.

[0234] S1308: Adjust the volume of all audio output applications outputting audio to the target volume.

[0235] In a specific application, since the focus application does not belong to the first set, i.e., it is not an application in the first set, the volume will be adjusted according to the existing volume adjustment scheme, i.e., after determining the original volume based on the two dimensions of the audio stream type and the audio output device, determining the adjustment level of the volume based on the volume adjustment operation input by the user, and then determining the target volume of all audio output applications outputting audio.

[0236] It can be understood that all the above audio output applications refer to corresponding applications of multiple audios of the same audio stream type output simultaneously in the current scene. If a certain application running in the background does not output any audio in the current scene, the volume adjustment operation will not do anything to the application. For example, assuming that in the current scene, a total of 3 applications are running in the foreground and the background, among which application 1 and application 2 output audio, and the audio stream types of the output audios are the same, and application 3 does not output audio, then in the current scene, all audio output applications include application 1 and application 2.

[0237] As can be seen from the above, the volume adjustment method provided by the embodiments of the application can set a first set supporting independent volume adjustment, and in the case that the focus application is an application in the first set, the output volume of the focus application is adjusted individually, and in the case that the focus application is not in the first set, the original volume adjustment method is adopted to adjust the volume of all audio output applications, which can more accurately adjust the application that needs to be adjusted individually, and is more in line with the adjustment needs of the user.

[0238] Please refer to Figure 15 In some embodiments, the volume adjustment method can include the following steps:

[0239] S1401: In response to a volume adjustment operation of a user, an application identifier of a focus application is acquired.

[0240] The implementation of S1401 can refer to the related description of S1101, which is not repeated here.

[0241] S1402: Whether the focus application is an application in the second set is determined according to the application identifier of the focus application, if not, S1403 is executed, and if yes, S1408 is executed.

[0242] In a specific application, the electronic device can determine the application identifiers of the applications in the first set, compare the application identifier of the focus application with the application identifiers of the applications in the first set, and then determine whether the focus application is an application in the first set.

[0243] S1403: Whether the focus application is an application in the first set is determined according to the application identifier of the focus application, if yes, S1404 is executed, otherwise S1408 is executed.

[0244] S1404: The original volume of the output audio of the focus application is determined according to the audio stream type of the output audio of the focus application and the audio output device.

[0245] S1405: The relative adjustment volume of the output audio of the focus application is determined according to the volume adjustment operation.

[0246] S1406: Determine the target volume of the focus application output audio according to the original volume of the focus application output audio and the relative adjusted volume.

[0247] S1407: Adjust the volume of the focus application output audio to the target volume.

[0248] The implementation of S1404 to S1408 can refer to the related description of S1102 to S1105, which will not be repeated here.

[0249] S1408: Determine the target volume of all audio output applications output audio according to the audio stream type, audio output device and volume adjustment operation of the output audio.

[0250] S1409: Adjust the volume of all audio output applications output audio to the target volume.

[0251] In a specific application, since the focus application belongs to the second set, that is, the application in the second set, or does not belong to the first set, that is, the application not in the first set, the electronic device will determine the original volume based on the two dimensions of audio stream type and audio output device, determine the adjustment level of the volume based on the volume adjustment operation input by the user, and then determine the target volume of all audio output applications output audio.

[0252] It can be understood that all the above audio output applications refer to the corresponding application programs that output multiple audios of the same audio stream type in the current scene. If an application program running in the background does not output any audio in the current scene, the volume adjustment operation will not perform any operation on the application program.

[0253] As can be seen from the above, the volume adjustment method provided by the embodiments of the present application can more accurately adjust the application that needs to be individually adjusted in volume by setting the second set that does not support independent volume adjustment and adjusting the volume of all audio output applications by the original volume adjustment method when the focus application is the application in the second set, which is more in line with the user's adjustment demand.

[0254] The above mainly introduces the scheme provided by the embodiments of the present application from the method aspect. In order to realize the above functions, it contains the hardware structure and / or software module corresponding to the execution of each function. The person skilled in the art should easily realize that, in combination with the method steps of each example described in the embodiments provided herein, the present application can be realized in the form of hardware or the combination of hardware and computer software. Whether a certain function is realized in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. The person skilled in the art can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0255] The embodiments of the present application can divide the functional modules of the device for the audio channel switching method according to the above method examples. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated in one processing module. The above integrated module can be realized in the form of hardware or software functional module. It should be noted that the division of the modules in the embodiments of the present application is illustrative, and is only a logical function division. There can be another division way in actual implementation.

[0256] Figure 15 A structure schematic diagram of a chip provided by the embodiments of the present application is shown in the figure. ​ As shown in the figure, the chip 1500 includes one or two or more (including two) processors 1501, a communication line 1502, a communication interface 1503 and a memory 1504.

[0257] In some embodiments, the memory 1504 stores the following elements: executable modules or data structures, or their subset, or their expanded set.

[0258] The method described in the embodiments of the present application can be applied to the processor 1501 or implemented by the processor 1501. The processor 1501 can be an integrated circuit chip having a signal processing capability. In the implementation process, each step of the method executed by the first device or the second device can be completed by the integrated logic circuit or the instruction in the form of software in the processor 1501. The processor 1501 described above can be a general processor (for example, a microprocessor or a conventional processor), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The processor 1501 can implement or execute the methods, steps and logic block diagrams provided in the embodiments of the present application.

[0259] The steps of the method provided in the embodiments of the present application can be directly embodied as hardware code processing executed by a code processor, or executed by a combination of hardware and software modules in the code processor. Among them, the software module can be located in a storage medium mature in the art such as a random access memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable read-only memory (EEPROM). The storage medium is located in the storage 1504, and the processor 1501 reads the information in the storage 1504 and completes the steps of the above method in combination with the hardware.

[0260] The processor 1501, the storage 1504 and the communication interface 1503 can communicate through the communication line 1502.

[0261] In the above embodiments, the instructions stored in the storage for the processor to execute can be implemented in the form of a computer program product. Among them, the computer program product can be written in the storage in advance, or downloaded and installed in the storage in the form of software.

[0262] The embodiments of the present application further provide a computer program product including one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL) or wireless (such as infrared, wireless, microwave, etc.)) mode. The computer-readable storage medium can be any available medium that can be stored by the computer or integrated into a server, data center, etc. data storage device including one or more available media. For example, the available media can include magnetic media (such as floppy disk, hard disk or magnetic tape), optical media (such as digital versatile disc (DVD)), or semiconductor media (such as solid state disk (SSD)) and the like.

[0263] The embodiments of the present application further provide a computer-readable storage medium. The methods described in the above embodiments can be implemented in whole or in part by software, hardware, firmware or any combination thereof. The computer-readable medium can include computer storage medium and communication medium, and can also include any medium that can transfer computer programs from one place to another. The storage medium can be any target medium accessible by a computer.

[0264] As a possible design, the computer-readable medium can include compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM or other optical disk storage; the computer-readable medium can include magnetic disk storage or other magnetic disk storage devices. Moreover, any connection line can also be appropriately referred to as a computer-readable medium. For example, if software is transmitted from a website, server or other remote source using coaxial cable, optical fiber cable, twisted pair, DSL or wireless technology (such as infrared, radio and microwave), the coaxial cable, optical fiber cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of the medium. As used herein, the disk and the optical disk include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, wherein the disk is usually reproduced in a magnetic manner, and the optical disk is optically reproduced by laser.

[0265] The combination of the above should also be included in the scope of the computer readable medium. The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method of adjusting volume, characterized by, The method comprises: displaying a first interface, the first interface comprising interfaces of a first application and a second application, the first application and the second application being two applications playing audio simultaneously; determining an original volume of audio output by the first application in response to a volume adjustment operation input by a user; determining a relative adjustment volume of audio output by the first application according to the volume adjustment operation; determining a target volume according to the original volume and the relative adjustment volume, and adjusting the volume of audio output by the first application to the target volume.

2. The method of claim 1, wherein, The first application is a focus application, and the determining of the original volume of audio output by the first application in response to the volume adjustment operation input by the user comprises: in a split-screen scenario, determining a focus window according to the split-screen scenario in response to the volume adjustment operation input by the user, and determining an application running in the focus window as the focus application; determining the original volume of audio output by the focus application according to an audio stream type of the audio output by the focus application and an audio output device.

3. The method of claim 2, wherein, The determining of the target volume according to the original volume and the relative adjustment volume comprises: obtaining an application identifier of the focus application; constructing a key-value pair of the relative adjustment volume of the focus application by taking the application identifier as the key and the relative adjustment volume as the value; calculating the target volume according to the key-value pair of the relative adjustment volume and the original volume.

4. The method according to any one of claims 1 to 3, characterized in that, After determining the focus application in response to the volume adjustment operation input by the user, the method further comprises: if the focus application is not an application in a first set and / or the focus application is an application in a second set, determining a target volume of audio output by all audio output applications according to an audio stream type of the audio output by the electronic device, an audio output device, and the volume adjustment operation; wherein the first set is a set of application programs supporting independent volume adjustment, and the second set is a set of application programs not supporting independent volume adjustment; adjusting the volume of audio output by all the audio output application programs to the target volume.

5. The method of claim 3, wherein, The method further comprises: initializing the key-value pair of the relative adjustment volume after the electronic device is restarted.

6. The method according to any one of claims 2 to 5, characterized in that, The electronic device runs a plurality of application programs in the foreground, and the determining of the original volume of audio output by the first application in response to the volume adjustment operation input by the user comprises: when the audio stream types of audio output by the plurality of application programs running in the foreground of the electronic device are the same, determining a window corresponding to a first split screen in the split screen scenario as a focus window, and determining an application program corresponding to the focus window as a focus application.

7. The method of claim 2, wherein, The determining of the original volume of audio output by the focus application according to the audio stream type of the audio output by the focus application and the audio output device further comprises: mixing the adjusted audio output by the focus application and audio output by other application programs of the same type, and outputting the mixed audio data to the audio output device.

8. The method of claim 7, wherein, The mixing of the adjusted audio output by the focus application and audio output by other application programs of the same type, and the outputting of the mixed audio data to the audio output device, comprises: mixing all audio data in a mixer; Call the audio driver corresponding to the audio output device to drive the audio output device to output the mixed audio data.

9. An electronic device, comprising: The electronic device includes a processor and a memory coupled to the processor, and the memory is configured to store a computer program, and when the processor executes the computer program, the electronic device is caused to perform the method in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium includes a computer program, and when the computer program runs on the electronic device, the electronic device is caused to perform the method in any one of claims 1 to 8.

11. A chip system, characterized in that: The chip system is applied to an electronic device, and the chip system includes one or more processors, the processor and the memory are coupled, the memory is configured to store computer program instructions, and the one or more processors are configured to call the computer instructions to cause the electronic device to perform the method in any one of claims 1 to 8.