Sound effect switching method and device, electronic equipment and storage medium

By identifying the main application in an electronic device and switching to the sound effects of the target application scenario, the problem of inaccurate sound effect switching in multiple application scenarios is solved, improving the accuracy of sound effect switching and user experience.

CN121501239APending Publication Date: 2026-02-10CHENGDU AWINIC MICROELECTRONICS TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511725081.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-21
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Existing technologies cannot accurately identify and switch to the corresponding sound effects in many audio application scenarios, resulting in inaccurate sound effect switching.

Method used

By identifying the main application in the electronic device and based on the main application's scene recognition services and preset lists or resource usage, the sound effects are switched to the target application scene.

Benefits of technology

It enables accurate switching of sound effects in multiple application scenarios, improving user experience and audio playback quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121501239A_ABST
    Figure CN121501239A_ABST
Patent Text Reader

Abstract

The invention provides a sound effect switching method and device, electronic equipment and a storage medium, and the method comprises the steps: determining a main application from at least two applications under the condition that the at least two applications on the electronic equipment use audios, for example, when a foreground application exists in the at least two applications, determining the main application as the foreground application, and when the foreground application does not exist in the at least two applications, determining the main application as the foreground application; then, the target application scene corresponding to the main application is determined, the application scene of audio playing is accurately determined, then the current sound effect of the electronic equipment is switched to the sound effect of the target application scene, and accurate switching of the sound effect is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of audio processing technology, and in particular to a sound effect switching method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the development of multimedia and electronic devices, a superior audio experience has become a hot demand in the consumer electronics market. To provide better audio effects and overcome hardware limitations, audio algorithms can be added to the audio playback chain.

[0003] To enrich audio effects, multiple sets of audio algorithm parameters are typically preset in the audio system. Different audio algorithm parameters correspond to different audio playback application scenarios, such as music, movies, games, and vocals. Different audio algorithm parameters produce different audio effects in these scenarios. Currently, intelligent sound effect switching can automatically identify the audio playback application scenario and switch to the corresponding sound effect. This is usually achieved by recording the correspondence between applications and audio playback application scenarios through a preset list. When a user uses different applications, the system finds the corresponding application scenario in the preset list and sets the audio algorithm parameters for that scenario to the algorithm, thus switching the sound effect.

[0004] However, when there are multiple applications playing audio, it is impossible to accurately determine the application scenario for audio playback, and therefore impossible to accurately switch sound effects. Summary of the Invention

[0005] In view of the above, embodiments of this application provide a sound effect switching method, apparatus, electronic device, and storage medium to at least solve or alleviate the above problems.

[0006] According to a first aspect of the embodiments of this application, a sound effect switching method is provided, applied to an electronic device. The method includes: if at least two applications use audio, determining a main application from the at least two applications, wherein if there is a foreground application among the at least two applications, the main application is the foreground application; determining a target application scenario corresponding to the main application; and switching the current sound effect of the electronic device to the sound effect of the target application scenario.

[0007] According to a second aspect of the embodiments of this application, a sound effect switching device is provided. The device includes: an application determination module, configured to determine a main application from at least two applications if at least two applications use audio, wherein if at least two applications include a foreground application, the main application is the foreground application; a scene determination module, configured to determine a target application scene corresponding to the main application; and a sound effect switching module, configured to switch the current sound effect of the electronic device to the sound effect of the target application scene.

[0008] According to a third aspect of the present application, an electronic device is provided, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, memory, and communication interface communicate with each other via the communication bus; the memory is used to store at least one executable instruction, which causes the processor to perform an operation corresponding to the method described in the first aspect.

[0009] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the method described in the first aspect.

[0010] According to the sound effect switching scheme provided in the embodiments of this application, when there are at least two applications using audio on an electronic device, a main application is determined from the at least two applications. For example, when there is a foreground application among the at least two applications, the main application is determined to be the foreground application. Then, the target application scenario corresponding to the main application is determined, and the application scenario for audio playback is accurately determined. Then, the current sound effect of the electronic device is switched to the sound effect of the target application scenario, thus achieving accurate sound effect switching. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings.

[0012] Figure 1 This is a structural diagram of an electronic device provided in an exemplary embodiment of this application; Figure 2 This is a software architecture diagram on an electronic device provided in an exemplary embodiment of this application; Figure 3 This is a flowchart of a sound effect switching method provided in an exemplary embodiment of this application; Figure 4 This is a schematic diagram of an interactive window of an application provided in an exemplary embodiment of this application; Figure 5 This is a flowchart of a sound effect switching method provided in another exemplary embodiment of this application; Figure 6 This is a flowchart of a sound effect switching method provided in another exemplary embodiment of this application; Figure 7 This is a flowchart of a sound effect switching method provided in another exemplary embodiment of this application; Figure 8 This is a schematic diagram of a sound effect switching device provided in an exemplary embodiment of this application. Detailed Implementation

[0013] The present application is described below based on embodiments, but it is not limited to these embodiments. In the detailed description of the present application below, certain specific details are described in detail. Those skilled in the art can fully understand the present application without these details. To avoid obscuring the essence of the present application, well-known methods, processes, and flows are not described in detail. Furthermore, the accompanying drawings are not necessarily drawn to scale.

[0014] Please refer to Figure 1 This illustrates a schematic diagram of the structure of an electronic device provided in an exemplary embodiment of this application. Figure 1 As shown, the electronic device may include: a processor 101, a display screen 102, a memory 103, a sound card 104, and a graphics processing unit (GPU) 105.

[0015] The processor 101, display screen 102, memory 103, sound card 104, and graphics processor 105 can communicate with each other via a communication bus.

[0016] The processor 101 is responsible for executing the instructions of various software programs. These software programs include a sound effect settings interface, an automatic scene recognition service, audio algorithms, etc. The software programs may include applications that use audio, other system applications, and third-party applications. Specifically, the processor 101 can execute the relevant steps in the sound effect switching method provided in this application embodiment.

[0017] Processor 101 may be a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application. The electronic device may include one or more processors of the same type, such as one or more CPUs; or it may include processors of different types, such as one or more CPUs and one or more ASICs.

[0018] The display screen 102, which is connected to the processor 101, is used to display the sound effect settings interface. Users can manually switch to any fixed sound effect through the sound effect settings interface, or set it to intelligent sound effect mode.

[0019] The memory 103, connected to the processor 101, is used to store programs and various parameters. The processor 101 executes the audio algorithm program. When a sound effect switch occurs, the audio algorithm loads the audio algorithm parameters corresponding to the scene from the memory 103 and uses the audio algorithm parameters to process the audio data.

[0020] The memory 103 may include high-speed random access memory (RAM), may include read-only memory (ROM), and may also include non-volatile memory, such as at least one disk storage device.

[0021] Sound card 104 transmits data to processor 101 via a hardware interface. Sound card 104 sends audio data to processor 101 for processing. Sound card 104 also receives processed audio data from processor 101. Processor 101 sends instructions to sound card 104 via a driver to control audio playback, recording, and processing.

[0022] The sound card 104 is also connected to a headphone jack 106, a speaker 107, and a microphone 108. The sound card 104 can play audio through headphones via the headphone jack 106. The sound card 104 can play audio aloud via the speaker 107. The sound card 104 can record audio via the microphone 108.

[0023] The graphics processor 105 is dedicated to handling graphics and image-related calculations, such as 2D graphics rendering, 3D image rendering, and video processing.

[0024] It should be noted that the operating systems running on electronic devices include, but are not limited to, Android, Linux, Windows, HarmonyOS, iOS, and macOS.

[0025] The electronic device may also include other hardware units, and the embodiments of this application do not limit the specific implementation of the electronic device. For example, the electronic device includes, but is not limited to: mobile phones, tablets, laptops, and desktop computers.

[0026] Please refer to Figure 2 This illustration shows a schematic diagram of the software architecture on an electronic device provided in an exemplary embodiment of this application. The electronic device includes: an application layer 201, a system background service layer 202, a system framework layer 203, a kernel layer 204, and a hardware layer 205.

[0027] The topmost application layer 201 includes various applications that use audio functionality, such as audio application 11, audio application 12, and audio application 13. Audio applications can be music software, speech recognition applications, recorders, etc.

[0028] The application layer 201 also includes an interactive interface, such as a sound effect settings interface 14. This sound effect settings interface 14 is used to set sound effects. For example, a user can manually set the electronic device's sound effect to any fixed sound effect through the sound effect settings interface 14, or set the electronic device to use a smart sound effect mode. When the electronic device uses the smart sound effect mode, the electronic device executes the steps in the sound effect switching method provided in the embodiments of this application. This sound effect settings interface can also be used to adjust the equalizer and control the volume.

[0029] The next layer below the application layer 201 is the system background service layer 202. The system background service layer 202 provides system-level services and functions to support the audio processing needs of the application service layer 201. The services provided by the system background service layer 202 include scene recognition service 21, which automatically identifies the application scene of the audio when the electronic device uses the smart sound effect mode. The process of automatically identifying the application scene of the audio includes determining the main application from multiple applications using audio, and determining the target application scene corresponding to the main application.

[0030] The system backend service layer 202 also provides other backend services such as system service 22, system service 23, and system service 24. System services may include audio processing, data synchronization, and account management.

[0031] The next layer below the system backend service layer 202 is the system framework layer 203. The system framework layer 203 provides the core framework and algorithms for audio processing, as well as interfaces between the system and third-party programs. Audio algorithm 31 runs in the system framework layer 203. For example, when the system framework layer 203 receives a target application scenario from the system backend service layer 202, the audio algorithm 31 running in the system framework layer 203 loads the audio algorithm parameters corresponding to the target application scenario. Subsequent audio algorithm 31 processes audio data based on the loaded audio algorithm parameters.

[0032] The system framework layer 203 also provides system programs 32, third-party programs 33, and third-party programs 34. System program 32 may be an audio processing program, such as an audio codec or audio synthesis program. Third-party programs are audio processing programs provided by third-party developers, which can extend the system's audio processing capabilities.

[0033] The next layer below system program 32 is kernel layer 204. Kernel layer 204 provides low-level drivers and support for audio processing. For example, kernel layer 204 provides audio driver 41, audio driver 42, other drivers 43, and other drivers 44. Audio driver 41 may be an audio codec driver, responsible for the compression and decompression of audio data. Audio driver 42 may be an audio amplifier (Amp) driver, used to control the amplification of audio signals. Other drivers may be drivers related to audio processing, such as drivers for audio input / output devices.

[0034] The next layer below kernel layer 204 is hardware layer 205. Hardware layer 205 includes various audio processing hardware. For example, hardware layer 205 includes audio codec 51, audio amplifier 52, other hardware 53, and other hardware 54. Other hardware may include microphones, speakers, and audio interfaces, etc.

[0035] This application provides a sound effect switching method, applied to... Figure 1 and Figure 2 The following embodiments of the electronic device illustrate the method for switching sound effects.

[0036] Please refer to Figure 3 This illustrates a sound effect switching method provided in an exemplary embodiment of this application, the method comprising: Step 301: If at least two applications use audio, determine the main application from the at least two applications.

[0037] In this context, if at least two applications are in the foreground, the primary application is considered the foreground application. For example, if an electronic device is running multiple audio-using applications, it sequentially checks whether each application is in the foreground until a unique foreground application is identified from among the multiple applications; then, the primary application is determined to be the foreground application. Electronic devices can determine whether an application is in the foreground based on factors such as user interaction, visibility, system resource allocation, and task priority. For instance, if an application is one that the user is currently interacting with, then that application is a foreground application; that is, a foreground application can be the application the user is currently interacting with. Alternatively, if an application is visible on the user interface, then that application is a foreground application; or, if an application is allocated the most system resources, then that application is a foreground application; or, if an application has the highest task priority, then that application is a foreground application.

[0038] Optionally, for each application with audio functionality, the electronic device has a preset application priority, which is a pre-set priority for sound effects in the application's usage scenario. In determining the primary application, the priority of each application in at least two applications is first obtained. The application with the highest priority is then determined from these two applications. If there are at least two applications with the highest priority, the foreground application is identified from among these, and the primary application is determined to be the foreground application. There is also a case where there is only one application with the highest priority; if there is only one application with the highest priority, the primary application is determined to be the application with the highest priority.

[0039] For example, the priority of scene sound effects used in the above applications is either preset by the scene recognition service provider or set by the user.

[0040] The above describes the scenario where a foreground application exists among the highest-priority applications. There is also a scenario where no foreground application exists among the highest-priority applications. In this case, the electronic device can determine the primary application based on volume. Optionally, if there are at least two highest-priority applications and no foreground application exists among the highest-priority applications, the volume of each application among the highest-priority applications is obtained; the primary application is determined to be the application with the highest volume among the highest-priority applications.

[0041] In one possible implementation, after identifying the foreground application, the system further determines whether the foreground application can be used as the main application based on the audio playback status of the foreground application.

[0042] Optionally, the electronic device identifies the foreground application from at least two applications. If the audio playback of the foreground application is not paused and not muted, the main application is determined to be the foreground application. That is, after identifying the foreground application from at least two applications, the audio playback status of the foreground application is also obtained. If the audio playback status of the foreground application is not paused and not muted, the main application is determined to be the foreground application.

[0043] Optionally, the electronic device identifies the foreground application from at least two applications. If the audio playback of the foreground application is paused or muted, it obtains the recorded target application identifier, which is the identifier of the target application using the current sound effect and is recorded when switching to the current sound effect. Based on the target application identifier, it obtains the audio playback status of the target application. If the audio playback status of the target application is paused or muted, it identifies the audio playback status of other applications, which refers to applications other than the target application among at least two applications. If there is an application whose audio playback status is not paused and not muted, it determines that the main application is the other application whose audio playback status is not paused and not muted.

[0044] In another possible implementation, the primary application can be determined by its priority. For example, for multiple applications with audio functionality, each application has its own priority, and different applications have different priorities. If at least two applications use audio, the priority of each of these at least two applications is obtained, and the primary application is determined as the application with the highest priority.

[0045] In another possible implementation, the main application can be determined by its volume. For example, if at least two applications use audio, the volume of each of those applications can be obtained, and the main application can be determined as the one with the highest volume.

[0046] In another possible implementation, the application can be determined by the display hierarchy of its interactive window. For example, if at least two applications use audio, the display hierarchy of each of these applications is obtained; based on the application's display hierarchy, the application with its interactive window at the top of the list is identified; and the main application is determined to be the application with its interactive window at the top. Figure 4 As shown, the electronic device display screen 401 displays an interactive window 402 for application A and an interactive window 403 for application B. Application A and application B use audio simultaneously. It is determined that the interactive window of application A is on top of the interactive window of application B, that is, it is determined that the interactive window of application A is on top, and the main application is determined to be application A.

[0047] Step 302: Determine the target application scenario corresponding to the main application.

[0048] The electronic device stores a preset list that records the correspondence between applications and application scenarios. The electronic device then determines the target application scenario corresponding to the main application from this preset list. For example, if the operating system uses identifiers to mark applications and application scenarios, the electronic device can determine the scenario identifier of the target application scenario corresponding to the application identifier of the main application from the preset list.

[0049] Optionally, the application scenarios include, but are not limited to, at least one of the following: movie scenarios, meeting scenarios, voice scenarios, music scenarios, game scenarios, call scenarios, and video scenarios. Among them, the sound effects in movie scenarios are more immersive and spatial; the sound effects in music scenarios have stronger bass; and the sound effects in voice / meeting scenarios make voices more prominent and dialogues clearer.

[0050] Optionally, if no application scenario corresponding to the main application is matched in the preset list, the resource usage of the main application on the electronic device is obtained; based on the resource usage, the target application scenario corresponding to the main application is determined. The aforementioned resource usage includes the application's usage of the electronic device's hardware resources.

[0051] The electronic device first determines the main application's usage of the graphics processor. If the resource usage is the main application using the graphics processor's encoding and decoding functions, then the target application scenario is determined to be a movie scene.

[0052] If the main application is not using the graphics processor's encoding / decoding functions, then the main application's hardware resource utilization rate is obtained. If the hardware resource utilization rate is greater than a threshold, the target application scenario is determined to be a game scenario; if the hardware resource utilization rate is less than the threshold, the target application scenario is determined to be a music scenario. The hardware resource utilization rate includes at least one of the following: CPU utilization rate, graphics processor utilization rate, and memory utilization rate.

[0053] Step 303: Switch the current sound effect of the electronic device to the sound effect of the target application scenario.

[0054] Electronic devices store audio algorithm parameters corresponding to various application scenarios. Once the target application scenario is determined, the electronic device loads the audio algorithm parameters for that scenario to process the audio data and switch sound effects.

[0055] For example, such as Figure 5 It illustrates the parameter configuration and data processing flow after sound effect switching, which includes: Step 501: Enable Smart Sound Effects Mode.

[0056] Step 502: Identify the scene.

[0057] With the intelligent sound effect mode enabled, if at least two applications using audio are identified, the main application is determined from these two applications, and the target application scenario corresponding to the main application is determined, thus realizing the identification of the application scenario.

[0058] Step 503, set up the scene.

[0059] After determining the target application scenario corresponding to the main application, the scenario for the audio algorithm is set as the target application scenario.

[0060] Step 504: Load the corresponding parameters using the audio algorithm.

[0061] If the audio algorithm's scenario is set as the target application scenario, the electronic device loads the audio algorithm parameters for the target application scenario from the storage medium 60. For example, if the target application scenario is a music scenario, the audio algorithm loads the audio algorithm parameters 61 for the music scenario from the storage medium 60; if the target application scenario is a movie scenario, the audio algorithm loads the audio algorithm parameters 62 for the movie scenario from the storage medium 60; if the target application scenario is a game scenario, the audio algorithm loads the audio algorithm parameters 63 for the game scenario from the storage medium 60; and if the target application scenario is a human voice scenario, the audio algorithm loads the audio algorithm parameters 64 for the human voice scenario from the storage medium 60.

[0062] The audio algorithm parameters stored on storage medium 60 can be expanded in any way as application scenarios increase. The audio algorithm can load audio algorithm parameters from multiple application scenarios, directly using the audio algorithm parameters from different application scenarios when switching sound effects; alternatively, it can load the audio algorithm parameters from the changed application scenario only when a sound effect switch occurs. During operation, the audio algorithm can switch audio algorithm parameters at any time to change the way audio data is processed, ultimately altering the sound effect.

[0063] Step 505: Process the data using the loaded parameters.

[0064] After switching sound effects and loading the parameters corresponding to the switched sound effects, the electronic device uses the loaded parameters to process the audio data and obtain the processed audio data.

[0065] Step 506: Pass the audio data to the lower-level software.

[0066] The electronic device transmits the processed audio data to the lower-level software for audio playback based on the processed audio data.

[0067] In summary, the sound effect switching method provided in this embodiment determines a primary application from at least two applications using audio on an electronic device. For example, if there is a foreground application among the at least two applications, the primary application is determined as the foreground application. Then, the target application scenario corresponding to the primary application is determined, accurately identifying the application scenario for audio playback. Subsequently, the current sound effect of the electronic device is switched to the sound effect of the target application scenario, thus achieving accurate sound effect switching.

[0068] In another possible implementation, there is a situation where the main application cannot be determined. The handling methods include the following two: • The electronic device identifies the foreground application from at least two applications. If the audio playback of the foreground application is paused or muted, the recorded target application identifier is obtained, and the audio playback status of the target application is obtained based on the target application identifier. If the audio playback status of the target application is not paused and not muted, the current sound effect is continued to be used.

[0069] • The electronic device identifies the foreground application from at least two applications. If the audio playback of the foreground application is paused or muted, the recorded target application identifier is obtained, and the audio playback status of the target application is obtained based on the target application identifier. If the audio playback status of the target application is paused or muted, the audio playback status of other applications is identified. If there are at least two other applications whose audio playback status is not paused and not muted, the current sound effect is switched to the sound effect of the general scene.

[0070] In other words, after each sound effect switch, the electronic device records the identifier of the application using the new sound effect. Subsequently, during the automatic sound effect switching process, if a foreground application is detected and its audio playback is paused or muted, the recorded target application identifier can be retrieved. Based on the target application identifier, the audio playback status of the target application can be obtained, and then it can be determined whether to continue using the current sound effect based on the target application's audio playback status. If the current sound effect is no longer used, a new main application needs to be identified from other applications; if a new main application cannot be identified from other applications, the current sound effect is directly switched to the sound effect of the general scene.

[0071] The sound effect switching method provided in this application embodiment can determine the applicable application scenario when the main application of at least two applications cannot be determined, thus ensuring the effect of audio playback.

[0072] In another possible implementation, if two applications use audio, the microphone usage status of the electronic device is obtained before determining the primary application. If the microphone of the electronic device is being used, the current sound effect is switched to the sound effect of the human voice scene. If the microphone of the electronic device is not being used, the step of determining the primary application from at least two applications in step 301 above is performed.

[0073] The sound effect switching method provided in this embodiment prioritizes the use of sound effects for human voice scenarios when using a microphone, which ensures that the human voice is realistic and clear, and improves the user communication experience in user dialogue scenarios.

[0074] In another possible implementation, the electronic device also has a blacklist of applications with audio functionality; before determining the main application, applications on the blacklist are removed from at least two applications that use audio, thus preventing some applications that do not need to use sound effects from occupying audio processing resources.

[0075] In the sound effect switching method provided in this application embodiment, the application scenario determination method of the main application includes two types: direct determination and indirect determination. Please refer to... Figure 6 This illustrates another exemplary embodiment of the sound effect switching method provided in this application. This method achieves sound effect switching by implementing the main application's judgment in two ways. The method includes: Step 601: Enable Smart Sound Effects Mode.

[0076] The smart sound effect mode was enabled on the electronic device.

[0077] Step 602: Identify the main application among the applications that use audio.

[0078] The electronic device performs the main application determination steps described in the above embodiments to determine the main application from at least two applications using audio.

[0079] Step 603: Search the preset list.

[0080] After determining the main application, the electronic device searches for the corresponding application scenario in a preset list. If the target application scenario corresponding to the main application is found in the preset list, a direct judgment is made, and steps 604 to 606 are executed. If the target application scenario corresponding to the main application is not found in the preset list, an indirect judgment is made, and steps 607 to 610 are executed.

[0081] Step 604: There exists a target application scenario corresponding to the main application.

[0082] The electronic device retrieves the main application from the preset list and obtains the target application scenario corresponding to the main application.

[0083] Step 605: Set the audio algorithm parameters corresponding to the target application scenario to the audio algorithm.

[0084] Electronic devices load audio algorithm parameters corresponding to the target application scenario through audio algorithms and set to use the audio algorithm parameters corresponding to the target application scenario.

[0085] Step 606: Switch the sound effects for the target application scene.

[0086] The audio algorithm of an electronic device processes audio data using audio algorithm parameters corresponding to the target application scenario, that is, it switches to the sound effect of the target application scenario.

[0087] Step 607: There is no target application scenario corresponding to the main application.

[0088] If the electronic device determines that there is no target application scenario corresponding to the main application in the preset category, then proceed to step 608.

[0089] Step 608: Determine the application scenario of the main application.

[0090] Electronic devices determine the application scenario of the main application. For example, the electronic device obtains the resource usage of the main application; based on the resource usage, it determines the target application scenario corresponding to the main application. The aforementioned resource usage includes the application's usage of the electronic device's hardware resources.

[0091] The electronic device first determines the main application's usage of the graphics processing unit (GPU). If the main application is using the GPU's encoding / decoding functions, the target application scenario is determined to be a movie scenario. If the main application is not using the GPU's encoding / decoding functions, the hardware resource utilization rate of the main application is obtained. If the hardware resource utilization rate is greater than a threshold, the target application scenario is determined to be a game scenario; if the hardware resource utilization rate is less than the threshold, the target application scenario is determined to be a music scenario. The hardware resource utilization rate includes at least one of the following: CPU utilization rate, GPU utilization rate, and memory utilization rate.

[0092] If the resource usage of an electronic device indicates that the main application is using the microphone, then the target application scenario is determined to be a voice-based scenario. In other words, if the main application uses the microphone, it is considered to be a conferencing / call application, leaning towards a voice-based scenario.

[0093] If none of the above conditions apply, then the main application is determined to be a music application, leaning towards a music scenario, and the target application scenario is determined to be a music scenario.

[0094] Step 609: Set the audio algorithm parameters corresponding to the application scenario of the main application to the audio algorithm.

[0095] Electronic devices load audio algorithm parameters corresponding to the application scenario of the main application through audio algorithms, and set the audio algorithm parameters corresponding to the application scenario of the main application to be used.

[0096] Step 610: Switch the sound effects for the main application's application scene.

[0097] The audio algorithm of an electronic device processes audio data using the audio algorithm parameters corresponding to the application scenario of the main application, that is, switching to the sound effect of the target application scenario.

[0098] In summary, the sound effect switching method provided in this embodiment can accurately determine the application scenario of the main application through a preset list, and can also identify the application scenario of the main application through indirect judgment logic, so that sound effect switching can be achieved even when the main application is not in the preset list, thereby improving the user experience.

[0099] Please refer to Figure 7The diagram illustrates a flowchart of a sound effect switching method provided in another exemplary embodiment of this application, which is applied to an electronic device and includes: Step 701, Begin.

[0100] Step 702: Determine whether the microphone is activated and in use.

[0101] If the microphone is activated and in use, it means the user is using a calling software, so proceed to step 703; if the microphone is not activated, proceed to step 704.

[0102] Step 703: Switch the current sound effect to the sound effect of the human voice scene.

[0103] Switching to the sound effects for human voice scenes can highlight human voices, making them clearer, and end the intelligent scene judgment process.

[0104] Step 704: Obtain the foreground application.

[0105] The foreground application is the application that the user is currently paying attention to, the focus of the user's attention, and the application that the user is interacting with.

[0106] Step 705: Determine whether the foreground application is using the audio playback function and is not paused or muted.

[0107] That is, determine whether the audio playback of the foreground application is not paused and not muted. If yes, proceed to step 706; otherwise, proceed to step 712.

[0108] Step 706: Determine that the main application is the foreground application.

[0109] Step 707: Obtain the target application identifier of the main application.

[0110] Step 708: Determine whether there is a target scene identifier that matches the target application identifier in the preset list.

[0111] The target scenario identifier is used to identify the target application scenario, and can also be used to identify the configuration corresponding to the target application scenario. The configuration corresponding to the target application scenario includes the audio algorithm parameters configured for the target application scenario. The target scenario identifier is used to retrieve the audio algorithm parameters configured for the target application scenario from the storage medium. If they exist, proceed to step 709; otherwise, proceed to step 719.

[0112] Step 709: Obtain the audio algorithm parameters corresponding to the target scene identifier.

[0113] The audio algorithm parameters for each scene are pre-configured in the storage medium, and the audio algorithm parameters corresponding to the target scene identifier are obtained from the storage medium.

[0114] Step 710: Switch sound effects based on the audio algorithm parameters corresponding to the target scene identifier.

[0115] For example, based on the audio algorithm parameters corresponding to the human voice scene identifier, switch the current sound effect to the human voice scene sound effect; or, based on the audio algorithm parameters corresponding to the game scene identifier, switch the current sound effect to the game scene sound effect; or, based on the audio algorithm parameters corresponding to the movie scene identifier, switch the current sound effect to the movie scene sound effect.

[0116] Step 711: Record the target application identifier.

[0117] After switching sound effects, the target application identifier is recorded, which is also the application identifier of the main application, and the intelligent scene judgment process ends.

[0118] Step 712: Obtain the target application identifier of the record.

[0119] Step 713: Determine whether the audio playback of the target application corresponding to the target application identifier is not paused and not muted.

[0120] That is, determine whether the target application corresponding to the target application identifier is still using the audio playback function and is not paused or muted. If so, proceed to step 714; otherwise, proceed to step 715.

[0121] Step 714: Continue using the current sound effect.

[0122] Step 715: Enumerate all applications that are using audio in the background.

[0123] Step 716: Determine if there is only one application whose audio playback is not paused and not muted.

[0124] That is, to determine whether only one application is using the audio playback function and whether it is not paused or muted.

[0125] If yes, proceed to step 717; otherwise, proceed to step 718.

[0126] Step 717: Determine that this is the primary application.

[0127] That is, the main application is the only application whose audio playback is not paused or muted among those applications that use audio in the background.

[0128] Step 718: Switch the current sound effect to the sound effect of the general scene.

[0129] A general scene can be any scene other than a voice scene, game scene, movie scene, or music scene. Alternatively, a voice scene can be set as a general scene. A music scene can also be set as a general scene. General scenes can be configured according to user needs.

[0130] Step 719: Obtain the main application's usage of the graphics processing unit, central processing unit, and memory.

[0131] Enter the indirect scene judgment logic to obtain the main application's usage rate of the graphics processing unit, central processing unit, and memory, as well as the main application's usage of the GPU's hardware encoding and decoding functions.

[0132] Step 720: Determine whether the main application uses the hardware encoding / decoding function of the graphics processing unit.

[0133] If yes, proceed to step 721; otherwise, proceed to step 723.

[0134] Step 721: Switch the current sound effect to the sound effect of the movie scene.

[0135] After switching the sound effects, proceed to step 722.

[0136] Step 722: Record the application identifier of the main application.

[0137] After recording the application identifier of the main application, the intelligent scene judgment process ends.

[0138] Step 723: Determine whether the main application's usage of the graphics processing unit, central processing unit, and memory exceeds the threshold.

[0139] The electronic device has set utilization thresholds for the GPU, CPU, and memory. If at least one of the GPU, CPU, and memory exceeds its corresponding utilization threshold, proceed to step 724; otherwise, proceed to step 725.

[0140] For example, if at least one of the following conditions is met, step 724 will be executed: the GPU utilization rate exceeds the first utilization rate threshold. The CPU utilization rate exceeded the second utilization rate threshold; the memory utilization rate exceeded the third utilization rate threshold.

[0141] Step 724: Switch the current sound effect to the sound effect of the game scene.

[0142] After switching the sound effects, proceed to step 722.

[0143] Step 725: Switch the current sound effect to the sound effect of the music scene.

[0144] After switching the sound effects, proceed to step 722.

[0145] In the sound effect switching method provided in this embodiment, when multiple audio-using applications exist simultaneously on an electronic device, and these applications are all in a preset list, a series of judgment logics can be used to select a primary application from among the multiple applications. Then, the application scenario corresponding to the primary target application can be selected from the preset list. This causes the audio algorithm to load the algorithm parameters for the corresponding scenario and switch the sound effect to match the primary application. When the primary application is not in the preset list, a series of judgment logics can be used to indirectly determine the application's usage scenario and switch the sound effect to that scenario. For multi-purpose applications, such as browsers that can both watch movies and listen to music, a fixed scenario for the application does not need to be set. Instead, the actual usage scenario of the application can be indirectly determined by the application's resource usage on the electronic device, and the corresponding sound effect can be switched, improving the user experience.

[0146] Please refer to Figure 8 The diagram illustrates a block diagram of a sound effect switching device provided in an exemplary embodiment of this application, the device comprising: Application determination module 801 is used to determine the main application from at least two applications if at least two applications use audio, wherein if there is a foreground application among the at least two applications, the main application is the foreground application; The scenario determination module 802 is used to determine the target application scenario corresponding to the main application. The sound effect switching module 803 is used to switch the current sound effect of the electronic device to the sound effect of the target application scenario.

[0147] In one possible implementation, the application determination module 801 is used to obtain the priority of each application in at least two applications, the priority being a pre-set priority of the application usage scenario sound effect; determine the application with the highest priority from the at least two applications; if there are at least two applications with the highest priority, identify the foreground application from the applications with the highest priority; and determine the main application as the foreground application.

[0148] In one possible implementation, the application determination module 801 is used to determine the main application as the application with the highest priority if there is an application with the highest priority.

[0149] In one possible implementation, the application determination module 801 is used to obtain the volume of each application among the highest priority applications if there are at least two highest priority applications and there is no foreground application among the highest priority applications; and determine the main application as the application with the largest volume among the highest priority applications.

[0150] In one possible implementation, the application determination module 801 is used to identify the foreground application from at least two applications; if the audio playback of the foreground application is not paused and not muted, the main application is determined to be the foreground application.

[0151] In one possible implementation, the application determination module 801 is used to: if the audio playback of the foreground application is paused or muted, obtain a recorded target application identifier, where the target application identifier is the identifier of the target application using the current sound effect, and the target application identifier is recorded when switching to the current sound effect; obtain the audio playback status of the target application based on the target application identifier; if the audio playback status of the target application is paused or muted, identify the audio playback status of other applications, where other applications refer to applications other than the target application among at least two applications; if there is an other application whose audio playback status is not paused and not muted, determine that the main application is another application whose audio playback status is not paused and not muted.

[0152] In one possible implementation, the scenario determination module 802 is used to obtain the resource usage of the main application on the electronic device if no application scenario corresponding to the main application is matched in the preset list; and to determine the target application scenario corresponding to the main application based on the resource usage.

[0153] In one possible implementation, the scene determination module 802 is used to determine the target application scene as a movie scene if the resource usage is mainly due to the application using the encoding and decoding function of the graphics processor.

[0154] In one possible implementation, the scene determination module 802 is used to obtain the hardware resource utilization rate of the main application if the main application does not use the encoding and decoding function of the graphics processor; if the hardware resource utilization rate is greater than the utilization rate threshold, the target application scene is determined to be a game scene; if the hardware resource utilization rate is less than the utilization rate threshold, the target application scene is determined to be a music scene.

[0155] In one possible implementation, the sound effect switching module 803 is used to switch the current sound effect to the sound effect of a human voice scene if the microphone of the electronic device is being used.

[0156] This application also provides an electronic device, which includes a processor, a memory, a communication interface, and a communication bus. The processor, memory, and communication interface communicate with each other through the communication bus. The memory stores at least one executable instruction, which causes the processor to perform the operation corresponding to the method described in any of the foregoing method embodiments.

[0157] This application also provides a computer storage medium storing a computer program thereon, which, when executed by a processor, implements the method described in any of the foregoing method embodiments. The computer storage medium includes, but is not limited to, compact disc read-only memory (CD-ROM), random access memory (RAM), floppy disk, hard disk, or magneto-optical disk.

[0158] This application also provides a computer program product, including computer instructions that instruct a computing device to perform an operation corresponding to any of the sound effect switching methods in the above-described multiple method embodiments.

[0159] Furthermore, it should be noted that the user-related information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to sample data used for training the model, data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0160] It should be noted that, depending on the implementation needs, the various components / steps described in the embodiments of this application can be broken down into more components / steps, or two or more components / steps or parts of the operation of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of this application.

[0161] The methods described in the embodiments of this application can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as a CD-ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or as computer code downloaded over a network that is originally stored in a remote recording medium or a non-transitory machine-readable medium and will be stored in a local recording medium. Thus, the methods described herein can be stored on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an Application Specific Integrated Circuit (ASIC) or a Field Programmable Gate Array (FPGA)). It is understood that the computer, processor, microprocessor controller, or programmable hardware includes storage components (e.g., Random Access Memory (RAM), Read-Only Memory (ROM), Flash Memory, etc.) capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods described herein. Furthermore, when a general-purpose computer accesses code used to implement the methods shown herein, the execution of the code transforms the general-purpose computer into a dedicated computer for executing the methods shown herein.

[0162] Those skilled in the art will recognize that the units and method steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this application.

[0163] The above embodiments are only used to illustrate the embodiments of this application, and are not intended to limit the embodiments of this application. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the embodiments of this application. Therefore, all equivalent technical solutions also fall within the scope of the embodiments of this application, and the patent protection scope of the embodiments of this application should be defined by the claims.

Claims

1. A sound effect switching method, characterized in that, Applied to electronic devices, the method includes: If at least two applications use audio, determine the main application from the at least two applications, wherein if there is a foreground application among the at least two applications, the main application is the foreground application; Determine the target application scenario corresponding to the main application; Switch the current sound effect of the electronic device to the sound effect of the target application scenario.

2. The method according to claim 1, characterized in that, Determining the main application from the at least two applications includes: Obtain the priority of each of the at least two applications, wherein the priority is a pre-set priority of the application usage scenario sound effects; From the at least two applications, determine the application with the highest priority; If there are at least two applications with the highest priority, identify the foreground application from among the applications with the highest priority. The main application is identified as the foreground application.

3. The method according to claim 2, characterized in that, The method further includes: If there is one application with the highest priority, then the main application is determined to be the application with the highest priority.

4. The method according to claim 2, characterized in that, The method further includes: If there are at least two applications with the highest priority, and none of the applications with the highest priority are in the foreground, obtain the volume of each application with the highest priority. The primary application is determined to be the application with the highest volume among the highest priority applications.

5. The method according to claim 1, characterized in that, Determining the main application from the at least two applications includes: Identify the foreground application from the at least two applications; If the audio playback of the foreground application is not paused and not muted, the main application is determined to be the foreground application.

6. The method according to claim 5, characterized in that, The method further includes: If the audio playback of the foreground application is paused or muted, then the recorded target application identifier is obtained. The target application identifier is the identifier of the target application using the current sound effect, and the target application identifier is recorded when switching to the current sound effect. The audio playback status of the target application is obtained based on the target application identifier; If the audio playback status of the target application is paused or muted, then the audio playback status of other applications is identified. The other applications refer to applications other than the target application among the at least two applications. If there exists another application whose audio playback is neither paused nor muted, then the main application is determined to be the other application whose audio playback is neither paused nor muted.

7. The method according to any one of claims 1 to 6, characterized in that, Determining the target application scenario corresponding to the main application includes: If no application scenario corresponding to the main application is matched in the preset list, the resource usage of the main application on the electronic device is obtained; Based on the resource usage, the target application scenario corresponding to the main application is determined.

8. The method according to claim 7, characterized in that, The step of determining the target application scenario corresponding to the main application based on the resource usage includes: If the resource usage indicates that the main application is using the graphics processor's encoding and decoding functions, then the target application scenario is determined to be a movie scenario.

9. The method according to claim 7, characterized in that, The step of determining the target application scenario corresponding to the main application based on the resource usage also includes: If the resource usage situation indicates that the main application is not using the graphics processor's encoding and decoding functions, then obtain the hardware resource usage rate of the main application. If the hardware resource utilization rate is greater than the utilization rate threshold, the target application scenario is determined to be a game scenario; if the hardware resource utilization rate is less than the utilization rate threshold, the target application scenario is determined to be a music scenario.

10. The method according to claim 1, characterized in that, The method further includes: If the microphone of the electronic device is being used, the current sound effect is switched to the sound effect of a human voice scene.

11. A sound effect switching device, characterized in that, The device includes: An application determination module is used to determine the main application from at least two applications if at least two applications use audio, wherein if there is a foreground application among the at least two applications, the main application is the foreground application; The scenario determination module is used to determine the target application scenario corresponding to the main application; The sound effect switching module is used to switch the current sound effect of the electronic device to the sound effect of the target application scenario.

12. An electronic device, characterized in that, The electronic device includes: a processor, a memory, a communication interface, and a communication bus. The processor, the memory, and the communication interface communicate with each other through the communication bus. The memory is used to store at least one executable instruction, which causes the processor to perform the operation corresponding to the method as described in any one of claims 1-10.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1-10.