Volume adjustment methods, electronic devices and media
By recording and modifying the volume of the first audio at the application framework layer of the terminal device, the problem of unstable playback of the first audio when the user adjusts the second audio is solved, and stable volume adjustment and improved user experience are achieved under cascade sound effects.
Patent Information
- Application Number
- CN202311872017.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2043-12-29
AI Technical Summary
When the terminal device plays the first audio, the user adjusting the volume of the second audio will cause differences in the playback of the first audio, affecting the user experience. Especially in the cascade sound effect, the ADSP chip cannot distinguish the audio type, resulting in the volume change affecting the stability of the first audio.
The volume of the first audio is recorded through the application framework layer and modified to be less than or equal to the volume of the adjusted second audio. The second audio is processed using volume gain to avoid noise and physical volume breakthrough of the speaker, ensuring the playback stability of the first audio.
This effectively avoids the impact of the second audio adjustment on the playback stability of the first audio, improves the user experience, ensures that the user can recognize the second audio, and simplifies the adjustment process.
Smart Images

Figure CN117931116B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a volume adjustment method and an electronic device. Background Technology
[0002] Currently, when a terminal device plays the first audio through its speaker, the user can access the device's settings application to adjust the volume of the second audio. In response to this adjustment, the terminal device plays both the first and second audio through its speaker. That is, the user can adjust the volume of the second audio on the terminal device while the first audio is playing. For example, if the terminal device is playing music (the first audio) through its speaker, and the user adjusts the volume of the incoming call ringtone, the music continues to play while the user adjusts the ringtone volume, and the terminal device will play a ringtone at the volume level adjusted by the user.
[0003] However, when users adjust the volume of the second audio, it causes a difference in the playback of the first audio, affecting the user experience. Summary of the Invention
[0004] The present application provides a volume adjustment method, electronic device, and medium in which, when the user adjusts the volume of the second audio while the first audio is playing, the stability of the first audio playback is not affected.
[0005] To achieve the above objectives, this application adopts the following technical solution:
[0006] In a first aspect, this application provides a volume adjustment method applied to a terminal device, comprising: playing a first audio from a first application of the terminal device at a first volume, while a second audio from a second application is not played. The first application and the second application are different; for example, the first application is music, and the second application is a ringtone.
[0007] The system continuously plays the first audio. Upon receiving a trigger operation from the user to change the volume of the second audio from the second volume to the third volume, the system modifies the volume of the first audio from the first volume to the fourth volume, which is adjusted based on the third volume. At the second moment, while the terminal device is playing the first audio, the user can adjust the volume of the second audio in the second application. That is, the user will perform the operation of changing the volume of the second audio from the second volume to the third volume. The third volume can be greater than or less than the second volume; this application does not impose any limitation on this.
[0008] When the first volume is greater than the third volume, the third volume will affect the stability of the first audio playback. This application can avoid the influence of the third volume on the stability of the first audio playback by modifying the first volume to a fourth volume that is adjusted based on the third volume.
[0009] The system continuously plays a first audio file and then plays a second audio file; the volume of the first audio file is a fourth volume; the volume of the second audio file is a third volume. This application avoids the impact of the third volume on the stability of the first audio playback by modifying the volume of the first audio file to the fourth volume before playback. The fourth volume can be the same as or lower than the third volume; this application does not impose any specific limitations. Furthermore, by modifying the volume of the first audio file to the fourth volume, the problem of users having difficulty recognizing the second audio file due to the first audio file being louder than the third audio file can be avoided, thus improving the user experience.
[0010] In one possible implementation, the method further includes: recording a first volume based on the user's trigger operation, and restoring the volume of the first audio from the fourth volume to the recorded first volume after the second audio has finished playing. By recording the volume of the first audio as the first volume when the user performs the trigger operation, it is convenient to restore the volume of the first audio from the fourth volume to the first volume after the second audio has finished playing or after the user has adjusted the second audio. In other words, after the second audio has finished playing, the first audio returns to its original volume without requiring manual restoration by the user, which improves the user experience.
[0011] In one possible implementation, the method further includes: the application framework layer of the terminal device determines whether the third volume is lower than the first volume; if the third volume is not lower than the first volume, the volume of the first audio is the first volume; if the third volume is lower than the first volume, the volume of the first audio is changed from the first volume to the fourth volume.
[0012] When the third volume is greater than the first volume, the third volume has little impact on the first volume. In this case, the volume of the first audio can remain unchanged, allowing for a faster response to user operations and playback of the second audio. At the same time, since the first volume is less than the third volume, the first volume will not affect the user's recognition and adjustment of the second audio, thus improving the user experience.
[0013] In one possible implementation, before playing the second audio, the hardware layer of the terminal device obtains the volume gain corresponding to the third volume, then processes the third volume using the volume gain to obtain the processed third volume, and plays the second audio with the processed third volume.
[0014] By using volume gain to process the third volume, the second audio at the third volume can be made clearer, improving the user experience.
[0015] In one possible implementation, receiving a trigger operation from the user to set the volume of the second audio from a second volume to a third volume includes: displaying a first interface in response to a first operation by the user on a settings application; the first interface includes a first control; the first control is used to adjust the volume of the second audio in the second application; wherein, prior to a second moment, the volume of the second audio is the second volume; receiving a second operation by the user on the first control; the second operation is used to set the volume of the second audio to the third volume.
[0016] In this way, the terminal device can allow users to set the volume of the second application to the third volume through the human-computer interaction interface, which is simple, convenient, and helps to improve the user experience.
[0017] In one possible implementation, receiving a trigger operation from the user to set the volume of the second audio from a second volume to a third volume includes: displaying a second interface in response to a third operation by the user on a volume adjustment button; the second interface includes a second control and a third control; the second control is used to adjust the volume of the first audio in the first application; the third control is used to adjust the volume of the second audio in the second application; the third operation is used to set the volume of the first audio to a fourth volume; wherein, before the second moment, the volume of the first audio is the first volume and the volume of the second audio is the second volume; receiving a fourth operation by the user on the third control; the fourth operation is used to set the volume of the second audio to a third volume.
[0018] In this way, the terminal device can allow users to set the volume of the second application to the third volume through the human-computer interaction interface, which is simple, convenient, and helps to improve the user experience.
[0019] In one possible implementation, before playing the first audio from the first application of the terminal device, the method further includes: the application framework layer of the terminal device processing the first audio from the first application to obtain processed first audio; the advanced digital signal processor (ADSP) module of the terminal device processing the processed first audio to obtain reprocessed first audio; and playing the first audio from the first application of the terminal device includes: playing the reprocessed first audio through the speaker of the terminal device.
[0020] The application framework layer of the terminal device can deploy an audio processing method, such as DTS audio, to process the audio in the first application. The advanced digital signal processing (ADSP) module of the terminal device can deploy another audio processing method, such as Histen audio, to process the processed audio again, resulting in a further processed audio; and then play the further processed audio through the terminal device's speakers. Both the application framework layer and the ADSP module of the terminal device process audio, belonging to a cascaded audio effect scenario. This application is applicable to cascaded audio effect scenarios and is beneficial for improving volume stability in such scenarios.
[0021] In one possible implementation, before playing the second audio, the process further includes: the application framework layer of the terminal device obtaining the second audio from the second application; the application framework layer passing the second audio to the hardware layer of the terminal device; and playing the second audio, including: playing the second audio through the speaker of the hardware layer.
[0022] In one possible implementation, the volume value of the fourth volume is the same as the volume value of the third volume. This application modifies the volume of the first audio audio from the first volume to the third volume, ensuring that the first volume does not affect the user's recognition and adjustment of the second audio audio, thus improving the user experience.
[0023] In a second aspect, this application provides an electronic device, including: a processor and a memory; wherein one or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the electronic device performs the volume adjustment method of the first aspect.
[0024] Thirdly, this application provides a computer storage medium including computer instructions, which, when executed on an electronic device, cause the electronic device to perform the volume adjustment method as described in the first aspect.
[0025] Fourthly, embodiments of this application provide a computer program product, which includes a computer program that, when run, causes a computer to perform the method executed by a terminal device as described in any possible implementation of the first aspect.
[0026] Fifthly, this application provides a chip or chip system including at least one processor and a communication interface. The communication interface and the at least one processor are interconnected via a circuit. The at least one processor is used to run computer programs or instructions to execute the methods performed by the terminal device as described in any possible implementation of the first aspect. The communication interface in the chip can be an input / output interface, pins, or circuits, etc.
[0027] It should be understood that the second to fifth aspects of this application correspond to the technical solutions of the first aspect of this application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation are similar, and will not be repeated here. Attached Figure Description
[0028] Figure 1a This is a schematic diagram illustrating the adjustment of the volume of a second audio file while playing a first audio file, as provided in an embodiment of this application.
[0029] Figure 1b A schematic diagram of an audio stream provided for related technologies;
[0030] Figure 2 This is a schematic diagram of the software structure of a terminal device provided in an embodiment of this application;
[0031] Figure 3 A schematic diagram of module interaction for a volume adjustment method provided in an embodiment of this application;
[0032] Figure 4a A schematic diagram illustrating volume adjustment provided in an embodiment of this application;
[0033] Figure 4b A schematic diagram illustrating another volume adjustment method provided in an embodiment of this application;
[0034] Figure 4c A schematic diagram illustrating another volume adjustment method provided in this application embodiment;
[0035] Figure 4d A schematic diagram illustrating yet another volume adjustment method provided in this application embodiment;
[0036] Figure 5 This is a schematic diagram of the hardware structure of a terminal device provided in an embodiment of this application;
[0037] Figure 6 A schematic flowchart illustrating a volume adjustment method provided in an embodiment of this application;
[0038] Figure 7 This is a schematic diagram of a volume adjustment method provided in an embodiment of this application. Detailed Implementation
[0039] Currently, when a terminal device is playing the first audio file, the user can adjust the volume of the second audio file without interrupting the playback of the first audio file. For example, Figure 1a This diagram illustrates how to adjust the volume of a second audio file while playing the first audio file. (For example...) Figure 1aAs shown, the terminal device can be a mobile phone. The mobile phone is currently playing audio 1, and the volume of audio 1 is 13, which is also the volume of "music, video, and game" at 13. The user can adjust the volume of "incoming calls, messages, and notifications" from 10 to 1 by dragging the control 100. The control 100 is used to change the volume of "incoming calls, messages, and notifications," and the control 100 can display the volume value of "incoming calls, messages, and notifications."
[0040] In one example, if the phone is currently playing audio 1 through its speaker, and the volume of "Music, Video, Game" is 13 (meaning the volume of audio 1 is 13), and the user adjusts the volume of "Incoming Call, Message, Notification" from 10 to 1 (or from 2 to 1, or from 1 to 3) using control 100, the phone responds to the user's operation by simultaneously playing audio 2 corresponding to "Incoming Call, Message, Notification" through the speaker while playing audio 1. The user's adjustment of the volume of "Incoming Call, Message, Notification" will cause differences in the playback of audio 1, such as noise during playback, or a "buzzing" sound when audio 1 is played at its maximum volume (e.g., 16), affecting the user experience.
[0041] The inventors discovered that when a terminal device plays the first audio through a speaker, the user adjusts the volume of the second audio on the terminal device. The reason why the playback of the first audio will be different is that the change in the volume of the second audio will cause a change in the volume of the first audio.
[0042] Terminal devices often employ cascaded audio effects. For example, the application framework layer of a terminal device might employ one audio processing method, while the ADSP chip in the hardware layer might employ another. Since the audio processing method deployed by the ADSP chip is at the lowest level of the terminal device's software architecture, it cannot access more information. This prevents the ADSP chip from distinguishing the volume of the first audio track from that of the second audio track. When the user adjusts the volume of the second audio track, it also affects the volume of the first audio track, leading to discrepancies in the playback of the first audio track, such as the generation of noise. If the volume of the first audio track being played is at maximum, a buzzing sound may also occur, negatively impacting the user experience.
[0043] For example, such as Figure 1bAs shown, assuming the audio includes three types: music, ringtone, and alarm, when deploying cascaded audio effects on the terminal device, the playback streams are not differentiated in the software structure. That is, all three audio types (music, ringtone, and alarm) are sent to the HAL layer (Hardware Abstraction Layer) in Audio Track format. The HAL layer outputs all three audio types in audio_stream_out format. Therefore, when adjusting the audio of any application, the volume index corresponding to the changed volume is sent to the ADSP module to obtain the volume gain. The volume gain determined by the ADSP module based on the volume index will apply to the volume of each audio type. For example, when the terminal device is playing music, if the user adjusts the ring volume, the terminal device detects the change in ring volume and sends the volume index corresponding to the changed volume to the ADSP module. The ADSP module determines the volume gain based on the volume index, and this volume gain will apply to both the music volume and the ring volume.
[0044] It should be understood that when the user adjusts the volume of the second audio audio to a low level, the terminal device's ADSP chip determines the volume gain based on the changed volume and uses this volume gain to process the adjusted second audio audio volume so that the user can hear it clearly even at a low volume. Specifically, the lower the volume of the second audio audio, the greater the volume gain generated by the ADSP chip.
[0045] However, since the ADSP chip cannot distinguish between the volume of the first audio and the volume of the second audio, when the user adjusts the volume of the second audio, the volume gain generated by the ADSP chip will be simultaneously applied to the volume of the first audio. If the volume of the first audio is high at this time, the large volume gain mixed on the high volume will cause noise when the first audio is played. If the volume of the first audio is at its maximum value, it may exceed the physical volume of the speaker, thus producing a "humming" sound, which may further damage the speaker and affect the user experience.
[0046] In view of this, embodiments of this application provide a volume adjustment method and related apparatus. When a user adjusts the volume of a second audio during the playback of a first audio, the application framework layer records the volume of the first audio and modifies the volume of the first audio to be less than or equal to the adjusted volume of the second audio (referring to the fourth volume). This allows the ADSP module to process the audio using volume gain at a level less than or equal to the adjusted volume of the second audio, avoiding noise or exceeding the physical volume of the speaker. Consequently, the playback of the first audio will not be affected by any discrepancies, thereby reducing the impact of changes in the volume of the second audio on the stability of the playback of the first audio and improving the user experience.
[0047] Furthermore, since the volume of the second audio may be lower than the volume of the first audio when the user adjusts the volume, it may be difficult for the user to distinguish the second audio, affecting the user's ability to adjust the second audio. Therefore, in this application, by modifying the volume of the first audio to be less than or equal to the adjusted volume of the second audio, the user can be able to identify the second audio, thus improving the user experience.
[0048] To better understand the methods provided in the embodiments of this application, the software structure of the terminal device will first be described.
[0049] For example, Figure 2 This is a schematic diagram of the software structure of a terminal device provided in an embodiment of this application.
[0050] It should be noted that terminal devices run operating systems. Examples include Apple's iOS, Google's Android, and Microsoft's Windows. Applications can be installed and run on these operating systems. These operating systems can employ layered architectures, event-driven architectures, microkernel architectures, microservice architectures, or cloud architectures.
[0051] Combination Figure 2 As shown, this application uses the layered architecture of the Android system as an example to illustrate the software structure of an electronic device. The layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the hardware abstraction layer (HAL), and the kernel layer. Below this four-layer structure, the electronic device also includes a hardware layer.
[0052] The application layer can include a series of application packages. The application layer runs applications by calling the application programming interface (API) provided by the application framework layer. For example... Figure 2As shown, the application package may include applications such as music, calls, video, alarm clock, settings, and playback control. The playback control application allows users to adjust the volume of a first audio source and a second audio source on their terminal device. The settings application also allows users to adjust the volume of the first and second audio sources on their terminal device. The first audio source includes, but is not limited to, sounds from music, video, calls, and alarm clock applications, while the second audio source includes, but is not limited to, sounds from music, video, alarm clock, and call applications.
[0053] It should be noted that the first and second audio can be any two of the following sounds: auxiliary prompt tone (AUDIO_STREAM_ACCESSIBILITY), alarm clock (AUDIO_STREAM_ALARM), Bluetooth SCO channel (telephone) (AUDIO_STREAM_BLUETOOTH_SCO), key tone (dialing) (AUDIO_STREAM_DTMF), forced audio (camera taking pictures, screenshots) (AUDIO_STREAM_ENFORCED_AUDIBLE), media tone (AUDIO_STREAM_MUSIC), notification tone (AUDIO_STREAM_NOTIFICATION), ringtone (AUDIO_STREAM_RING), system tone (touch prompt tone, lock screen) (AUDIO_STREAM_SYSTEM), smart voice broadcast (AUDIO_STREAM_TTS), and call (AUDIO_STREAM_VOICE_CALL), but are not limited to these.
[0054] The application framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. The framework layer includes some predefined functions.
[0055] like Figure 2As shown, the application framework layer may include a Java layer and a native layer. The Java layer provides the Java programming framework, and the native layer provides the C or C++ programming framework. The Java layer may include an audio acquisition module 1, an audio system module 1, and an audio management module. The native layer includes an audio acquisition module 2, an audio system module 2, an audio policy management module, an audio delivery module, and a volume delivery module. The audio delivery module includes DTS sound effects (referred to as the first sound effect), and the audio policy management module includes a volume recording module and a volume modification module. It should be noted that the inclusion of DTS sound effects in the audio delivery module is merely an example, and this application embodiment does not limit the specific sound effect processing methods included in the audio delivery module.
[0056] Audio acquisition module 1 is used to acquire the audio (first audio) being played from at least one application such as music, video, game, or call, and transmit it to audio acquisition module 2. Audio acquisition module 2 is used to send the received audio to audio delivery module. Audio delivery module is used to process the audio using a first sound effect to obtain processed audio (processed first audio), and also to transmit the status of the processed audio to the audio policy management module, and to send the processed audio to the hardware layer ADSP module. ADSP module is used to process the processed audio according to the XSITEN sound effect, and play the reprocessed audio (reprocessed first audio) through the speaker.
[0057] The audio acquisition module 1 is further configured to acquire audio to be played from other applications (second audio), which is the audio whose volume the user wants to adjust, and to pass the audio to be played to the audio acquisition module 2. The audio acquisition module 2 is further configured to send the audio to be played to the audio delivery module. The audio delivery module is further configured to process the audio to be played using a first sound effect to obtain processed audio to be played (processed second audio), and to pass the processed audio to be played to the audio strategy module. It is also configured to send the processed audio to be played to the hardware layer ADSP module. The ADSP module is used to process the processed audio to be played (reprocessed second audio) according to the XSITEN sound effect, and to play the reprocessed audio to be played through a speaker.
[0058] When no audio is playing on the terminal device (e.g., the first audio track), the audio management module retrieves the playback volume corresponding to the first audio track when the user clicks to play it. The audio recording module also transmits the playback volume to audio system module 1. Audio system module 1 retrieves the playback volume from the audio management module and transmits it to audio system module 2. Audio system module 2 retrieves the playback volume from audio system module 1 and transmits it to the volume delivery module. The volume delivery module transmits the playback volume to the volume adjustment module. The volume adjustment module sends the playback volume down to the ADSP module through the kernel layer. The ADSP module plays the first audio track through the speaker at the specified playback volume.
[0059] When playing any audio (e.g., the first audio) on a terminal device, the audio management module retrieves the adjusted volume of other applications when the user adjusts their volume. This adjusted volume can be simply referred to as the changed volume. For example, if a user changes the ringtone from 13 to 1, then volume 1 is the changed volume. The audio management module also transmits the changed volume to audio system module 1. Audio system module 1 retrieves the changed volume from the audio management module and transmits it to audio system module 2. Audio system module 2 retrieves the changed volume from audio system module 1 and transmits it to the audio recording module in the audio strategy module. The volume recording module records the volume of the audio being played in audio system module 2 (the reprocessed first audio played through the speaker) when the user enters the interface for adjusting the volume of other applications, or when the user adjusts the volume of other applications via voice assistant or adjustment buttons, and also records the changed volume. The volume of the playing audio can be simply referred to as the playback volume. The volume recording module transmits both the playback volume and the changed volume to the volume modification module. The volume modification module obtains the playback volume and the changed volume from the volume recording module, and modifies the playback volume to be less than or equal to the changed volume. The volume modification module also sends the changed volume to the volume delivery module. The volume delivery module then passes the changed volume to the volume adjustment module. The volume adjustment module obtains the changed volume from the volume modification module and sends it to the ADSP module through the kernel layer. In other words, modifying the playback volume to be less than or equal to the changed volume before passing it to the volume adjustment module avoids discrepancies in the playback of the currently playing audio, thus preventing the second audio from affecting the stability of the first audio playback and improving the user experience.
[0060] It should be noted that after the volume of the first audio is changed from the current playback volume to a volume less than or equal to the changed volume, the modified volume of the first audio will not be sent to the volume delivery module through the volume modification module. Instead, the volume of the first audio in the ADSP module will be modified directly through the program code to avoid the volume gain being re-acquired by the ADSP module after the modified volume of the first audio is sent.
[0061] The purpose of the HAL layer is to abstract hardware, providing a unified interface for upper-layer applications to query hardware devices, or to provide data storage services for upper-layer applications. For example... Figure 2 As shown, the HAL layer may include an audio output module. The audio output module is used to obtain DTS-processed audio from the audio delivery module, and also to obtain the processed volume change and the audio to be played from the audio delivery module when the processed audio is played through a speaker. For example, the audio output module can obtain the volume and audio of a first audio from the audio delivery module, and can also obtain the changed volume and audio of a second audio.
[0062] The kernel layer is the layer between hardware and software. For example... Figure 2 As shown, this kernel layer may include at least a display driver. The kernel layer also contains a module that receives DTS-processed audio from the audio output module, and further receives the adjusted volume and the audio to be played from the audio output module when the processed audio is played through the speakers. This module... Figure 2 As not shown in the figure, this application does not limit this module in the embodiments.
[0063] like Figure 2 As shown, the hardware layer may include an ADSP module, a speaker, and a display screen. The ADSP module can be deployed within an ADSP chip. This ADSP module includes XSITEN audio effects, which is the name of an audio processing method and can represent Histen audio effects, but this embodiment is not limited to this. The ADSP module is used to obtain a first audio signal processed by DTS audio effects from the kernel layer, and also to obtain a changed volume and a second audio signal from the kernel layer when the speaker plays the reprocessed first audio signal. The ADSP module is also used to further process the second audio signal processed by DTS audio effects using XSITEN audio effects to obtain a reprocessed second audio signal, and then play the reprocessed second audio signal through the speaker.
[0064] The ADSP module is also used to obtain the volume gain corresponding to the changed volume (the volume of the second audio), and to process the volumes of the first and second audio based on the volume gain. That is, the playback volume is processed according to the volume gain, ensuring the playback volume is less than or equal to the changed volume. For example, if the playback volume is 13, the changed volume is 2, and the volume gain is k, the playback volume can be modified from 13 to 1 (or 2) through program code, and the modified playback volume of 1 (or 2) is processed according to the volume gain k, resulting in a processed playback volume of 1+k (or 2+k). By modifying the playback volume to be less than or equal to the changed volume during volume gain processing, noise or exceeding the speaker's physical volume during playback of the first audio can be avoided, improving the user experience. Furthermore, modifying the playback volume to be less than or equal to the changed volume helps users identify the second audio, facilitating subsequent volume adjustment of the second audio.
[0065] It should be noted that the speaker can play two sounds simultaneously. That is, while the speaker is playing the first audio, it can play the second audio while the first audio is being played. The process of playing the first and second audio simultaneously is not specifically limited here.
[0066] It should be noted that cascaded audio effects refer to processing audio using at least two audio processing methods.
[0067] For example, the application framework layer of the terminal device includes a first audio processing method, and the ADSP chip in the hardware layer of the terminal device deploys a second audio processing method. The second audio processing method can compensate for the deficiencies of the first audio processing method. When the terminal device detects audio, it can process the audio using the first audio processing method in the application framework layer to obtain processed audio, and can further process the processed audio using the second audio processing method in the hardware layer to obtain further processed audio. The first and second audio processing methods can be any two of the following three audio processing methods: DTS audio, Dolby audio, and Histen audio.
[0068] DTS audio is a high-quality digital audio coding technology that compresses multi-channel audio data into a single digital stream. This provides audio performance exceeding CD standards in movies, games, and other media, resulting in a superior sound experience for users. DTS encoding technology offers higher dynamic range, higher compression ratios, and more channel switching, thus providing a better audio experience.
[0069] Dolby sound refers to Dolby Pro Logic surround sound. It can synthesize four-channel stereo sound into two channels during recording using specific encoding methods. That is, the original four signals of left channel (L), right channel (R), center channel (C), and surround channel (S) are encoded and synthesized into LT and RT composite two-channel signals. During playback, the decoder restores the encoded two-channel composite signals LT and RT into four independent signals of left, right, center, and surround, which are amplified and then input to the left speaker, right speaker, center speaker, and surround speaker, respectively.
[0070] Histen audio effects utilize the latest and most advanced audio processing algorithms, combined with psychoacoustic and auditory perception models, to maximize the performance of audio systems on various mobile devices, restoring the texture and clarity of high-quality sound. Through three-dimensional (3D) sound field technology, it expands the spatial and directional sense of sound, providing users with a perfect heavenly sound quality experience.
[0071] This application describes three audio processing methods: DTS audio, Dolby audio, and Histen audio. However, this application does not limit itself to these three audio processing methods.
[0072] It should be noted that although the embodiments of this application are illustrated using the Android system as an example, the basic principles are also applicable to electronic devices based on operating systems such as iOS and Windows.
[0073] The following combination Figure 3 Regarding the above Figure 2 The specific interactions between the modules will be explained.
[0074] Figure 3 This is a schematic diagram illustrating the module interaction of a volume adjustment method provided in an embodiment of this application. This method can be applied to the above-described... Figure 1a The scenario shown is not limited to the examples described in this application. Figure 3 As shown, the method may include the following steps:
[0075] S301: The audio acquisition module 1 of the application framework layer detects the first audio, and the audio management module of the application framework layer detects the first volume corresponding to the first audio.
[0076] When a user plays sound through applications such as music, video, games, voice calls, or mobile phone calls, the audio acquisition module 1 can detect that the stream type of the music audio, video audio, game audio, voice call audio, or mobile phone call audio is stream type 1. The music audio, video audio, game audio, voice call audio, or mobile phone call audio can be simply referred to as Audio 1 (first audio). During the audio transmission process, the audio acquisition module can also transmit Audio 1 and stream type 1.
[0077] For example, the audio acquisition module 1 can detect the audio 1 and stream type 1 of music, video, game, voice call or mobile phone call through the start() interface.
[0078] When a user plays sound through applications such as music, video, games, voice calls, or mobile phone calls, the audio management module can detect the playback volume (i.e., the first volume) of the music audio, video audio, game audio, voice call audio, or mobile phone call audio detected by the user. The playback volume can be simply referred to as volume 1.
[0079] S302: Audio acquisition module 1 passes audio 1 and stream type 1 to audio acquisition module 2 in the application framework layer. Correspondingly, audio acquisition module 2 obtains audio 1 from audio acquisition module 1. Audio management module passes volume 1 to audio system module 1 in the application framework layer. Correspondingly, audio system module 1 obtains volume 1 from audio management module.
[0080] For example, the audio acquisition module 2 can obtain audio 1 and stream type 1 from the audio acquisition module 1 through the start() interface.
[0081] S303: Audio acquisition module 2 passes audio 1 and stream type 1 to audio delivery module in application framework layer. Correspondingly, audio delivery module obtains audio 1 and stream type 1 from audio acquisition module 2. Audio system module 1 passes volume 1 to audio system module 2 in application framework layer. Correspondingly, audio system module 2 obtains volume 1 from audio system module 1.
[0082] For example, the audio delivery module can obtain audio 1 and stream type 1 from the audio acquisition module 2 through the openoutput() interface.
[0083] S304: The audio delivery module processes audio 1 through the first sound effect to obtain processed audio 1; the audio system module 2 sends volume 1 to the volume delivery module.
[0084] The audio delivery module can process audio 1 using the deployed audio method to obtain processed audio 1. The audio method can be any one of DTS, Dolby, and Histen audio effects, but is not limited to the aforementioned three audio effects.
[0085] S305: The audio delivery module transmits the processed audio 1 to the audio output module of the HAL layer. Correspondingly, the audio output module obtains the processed audio 1 from the audio delivery module. The volume delivery module transmits the volume 1 to the volume adjustment module of the HAL layer. Correspondingly, the volume adjustment module obtains the volume 1 from the audio delivery module.
[0086] For example, the audio output module can obtain the processed audio 1 from the audio delivery module through the adev_set_parameters() interface.
[0087] S306: The audio output module transmits the processed audio 1 through the kernel layer to the ADSP module in the hardware layer. Correspondingly, the ADSP module obtains the processed audio 1 from the audio output module.
[0088] S307: The volume control module passes volume 1 through the kernel layer to the ADSP module in the hardware layer. Correspondingly, the ADSP module obtains volume 1 from the volume control module.
[0089] S308: The ADSP module processes the processed audio 1 again using the XSITEN sound effect to obtain the processed audio 1; the ADSP module determines the volume gain 1 corresponding to volume 1 based on volume 1, and processes volume 1 using volume gain 1 to obtain the processed volume 1.
[0090] S309: The ADSP module plays the reprocessed audio 1 through the speaker at the processed volume 1.
[0091] S310: The audio management module in the application frame layer detected that the volume settings of other applications on the terminal device have changed.
[0092] When the terminal device plays audio 1 through the speaker, the user can, as follows: Figure 1a The settings interface shown changes the volume of the incoming call ringtone; that is, the volume of the incoming call ringtone changes. In another example, users can adjust the volume of other applications via a voice assistant or the volume control buttons on their device.
[0093] For example, such as Figure 4a A diagram illustrating volume adjustment is shown. (For example...) Figure 4a As shown, the terminal device is a mobile phone. In response to the user selecting the sound and vibration option in the settings, a sound and vibration interface can be displayed, for example... Figure 4a As shown in the interface, the sound and vibration interface includes controls 401, 402, 403, 404, and 405. Control 401 is used to set the volume of incoming calls, messages, and notifications; control 402 is used to set the alarm volume; control 403 is used to set the volume of music, videos, and games; control 404 is used to set the call volume; and control 405 is used to set the volume of smart voice control. Users can adjust the call volume, and the phone can detect this adjustment and, in response, detect a change in the call volume.
[0094] For example, such as Figure 4bThis illustrates another volume adjustment method. (For example...) Figure 4b As shown, the terminal device is a tablet. In response to a user pulling down from the top of the tablet, a control center interface can be displayed, for example... Figure 4b As shown in the interface, the control center interface includes card 410, control 411, control 412, and control 413. Card 410 is used to display the playback status of the application's audio, such as music or video playback status. Control 411 is used to set the volume of the currently playing audio. Control 412 is used to set the volume of incoming calls, messages, and notifications. Control 413 is used to set the alarm clock volume. Users can adjust the alarm clock volume, and the tablet can detect this user action and, in response, detect a change in call volume.
[0095] For example, such as Figure 4c This illustrates another method of volume adjustment. (For example...) Figure 4b As shown, the terminal device is a mobile phone. In response to the user pressing the volume control button (the phone's physical volume button), a quick adjustment interface can be displayed, for example... Figure 4c As shown in the interface, the quick adjustment interface includes controls 421, 422, 423, 424, and 425. Control 421 is used to set the volume of media, such as the volume of audio played by a speaker; control 422 is used to set the volume of an application playing audio, such as the volume of a music app; control 423 is used to set the volume of the incoming call ringtone; control 424 is used to set the volume of notifications; and control 425 is used to set the volume of the alarm clock. Users can press the volume adjustment buttons. In response, the phone displays the quick adjustment interface, allowing users to further adjust the incoming call ringtone volume. The phone detects this adjustment and detects the change in ringtone volume.
[0096] For example, such as Figure 4d This illustrates yet another method of volume adjustment. (For example...) Figure 4d As shown, the terminal device is a smart speaker. In response to a user's voice command to "adjust the alarm volume to 1," a virtual interface can be displayed on the backend. This virtual interface is not shown to the user. For example... Figure 4d As shown in the smart speaker, the smart speaker can play audio and, in response to the user's voice command "adjust the alarm volume to 1", detects a change in the alarm volume.
[0097] The audio management module responds to user actions such as adjusting the volume of other applications or adjusting the volume of other applications via voice assistants or volume control buttons on terminal devices. It can detect changes in the volume of other applications and obtain the changed volume.
[0098] It should be noted that, in this embodiment, the audio corresponding to the volume change can be simply referred to as Audio 2. For example, if a user adjusts the volume of an incoming call ringtone, that is, the volume of the incoming call ringtone changes, then the preview audio corresponding to the incoming call ringtone is Audio 2. The audio management module can also transmit Stream Type 2 if it detects a change in the volume settings of other applications on the terminal device. In this embodiment, the application currently playing Audio 1 is taken as music, and other applications are used as examples of incoming call ringtones for illustration.
[0099] S311: The audio management module transmits the changed volume (i.e., the adjusted volume of the second audio) to the audio system module 1. Correspondingly, the audio system module 1 obtains the changed volume from the audio management module.
[0100] It should be noted that while the user is adjusting the volume of other applications, the audio acquisition module 1 can also detect the audio 2 to be played and pass the acquired audio 2 to the audio acquisition module 2. Correspondingly, the audio acquisition module 2 receives audio 2 from the audio acquisition module 1. The audio acquisition module 2 is also used to pass audio 2 to the audio delivery module. Correspondingly, the audio delivery module is used to process audio 2 using the first sound effect to obtain the processed audio 2.
[0101] S312: Audio system module 1 transmits the changed volume to audio system module 2, and correspondingly, audio system module 2 receives the changed volume from audio system module 1.
[0102] For example, audio system module 2 can obtain the changed volume from audio system module 1 through the setStreamVolumeindex() interface.
[0103] S313: Audio system module 2 transmits the changed volume to the volume recording module in the audio policy management module of the application framework layer. Correspondingly, the volume recording module obtains the changed volume from audio system module 2.
[0104] For example, the audio system module 2 can first obtain the service of the volume recording module through the get_audiopplicy_service() interface, and then pass the changed volume and stream type to the volume recording module through the setStreamVolumeindex() interface.
[0105] S314: The volume recording module in the audio policy management module determines whether the terminal device has entered the volume adjustment state and obtains the volume 1 of audio 1 from the audio system module 2.
[0106] It should be noted that volume adjustment state refers to the state in which the user enters the volume adjustment interface, or the state in which the user adjusts the volume. For example, the sound and vibration interface, control center interface, quick adjustment interface, voice operation, etc. mentioned in the above examples all belong to the volume adjustment state.
[0107] The first volume, volume 1, or playback volume all indicate the volume of audio 1. For example, audio 1 can be music from a music application, and the volume 1 of audio 1 can be 13.
[0108] S315: The volume recording module is also used to pass the volume 1 and the changed volume to the volume modification module in the audio policy management module. Correspondingly, the volume modification module obtains the volume 1 and the changed volume of audio 1 from the volume recording module.
[0109] S316: The volume modification module modifies volume 1 to the changed volume, thus obtaining the modified volume 1.
[0110] For example, assuming the volume value of volume 1 is 13 and the changed volume value is 1, the volume modification module can modify the volume value of audio 1's volume 1 to 1.
[0111] It should be understood that since the modified volume 1 is the same as the changed volume value, it only needs to be sent once to obtain the volume gain, and there is no need to send it repeatedly.
[0112] It should be understood that by synchronizing the volume of Audio 1 from Volume 1 to the changed volume, when the ADSP module at the hardware layer processes the volume of Audio 1, it processes it according to the changed volume of Audio 1, thus avoiding the volume difference of Audio 1 caused by the volume gain of the changed volume, such as generating noise, or generating a "buzzing" sound when the volume of Audio 1 is at its maximum value.
[0113] It should be noted that if the volume value of volume 1 is less than or equal to the changed volume, the first volume does not need to be modified. That is, the subsequent steps are not performed, and the changed volume can be directly sent to the volume adjustment module.
[0114] It should be noted that the embodiments in this application are only examples of changing the volume of audio 1 from volume 1 to the changed volume. In other implementations, the volume of audio 1 can also be changed from volume 1 to a volume lower than the changed volume.
[0115] In some possible implementations, the volume of Audio 1 can be adjusted to a value lower than Volume 1, and the volume of Audio 1 can be asynchronously modified to the changed volume.
[0116] As one implementation method, the volume of audio 1 can be adjusted to be lower than the changed volume. For example, if the changed volume is 2, the volume of audio 1 can be modified to 1. In this implementation method, by modifying the volume of audio 1 to be lower than the changed volume, on the one hand, the change in volume can avoid the impact on the stability of the volume of audio 1, and on the other hand, it can enable the user to distinguish and identify audio 2, making it convenient for the user to readjust the volume of audio 2 later.
[0117] As another implementation, the volume gain of the changed volume can be estimated to obtain the estimated gain. Then, it is determined whether the volume of audio 1 with the estimated gain superimposed exceeds the physical volume of the speaker. If it does, the volume of audio 1 is adjusted and the aforementioned judgment operation is repeated until the volume of audio 1 with the estimated gain superimposed does not exceed the physical volume of the speaker. The modified volume value corresponding to not exceeding the physical volume of the speaker is then used as the volume of audio 1. On the one hand, this can avoid the impact of the changed volume on the stability of audio 1. On the other hand, it can reduce the adjustment range of the volume of audio 1, so that audio 1 is played at a volume close to that selected by the user, thereby improving the user experience.
[0118] S317: The volume modification module sends the changed volume to the volume delivery module.
[0119] S318: The volume delivery module transmits the changed volume to the volume adjustment module in the HAL layer.
[0120] S319: The volume adjustment module sends the changed volume to the ADSP module, and correspondingly, the ADSP module receives the changed volume from the volume adjustment module.
[0121] S320: The audio delivery module sends the processed audio 2 to the audio output module, and the corresponding audio output module receives the processed audio 2.
[0122] Processed audio 2 refers to the audio obtained by the audio delivery module processing audio 2 using the first sound effect.
[0123] That is, in this embodiment of the application, the changed volume is sent to the ADSP module of the hardware layer to obtain the volume gain.
[0124] S321: The audio output module transmits the processed audio 2 to the ADSP module in the hardware layer. Correspondingly, the ADSP module obtains the processed audio 2 from the audio output module.
[0125] Steps S319 and S321 can be executed simultaneously, and will not be described in detail here.
[0126] S322: The ADSP module is used to determine the corresponding volume gain based on the changed volume.
[0127] It's important to note that volume gain refers to adjusting the amplitude of an audio signal to control its loudness. Volume gain can make audio louder or softer. It's typically used to adjust the overall volume level of an audio signal, such as adjusting the volume of music. Audio processing, on the other hand, involves various manipulations of an audio signal to alter its sonic characteristics. Audio processing can include equalizers, reverb, compression, delay, and other effects. It can change the timbre, spatiality, and dynamic range of an audio signal to enhance its expressiveness and listening experience. Audio processing is commonly used in audio editing, music production, and film post-production. In short, volume gain adjusts the overall volume level of an audio signal, while audio processing involves various manipulations of the audio signal to change its sonic characteristics.
[0128] Volume gain refers to the process of amplifying an audio signal. In audio processing, volume gain is used to adjust the volume level of an audio signal to make it more suitable for a specific application scenario or device. By increasing the amplitude of the audio signal, volume gain can improve the loudness and audibility of the audio. Volume gain is typically used to adjust the overall volume of audio to make it clearer, easier to hear, or more suitable for a specific playback device or environment. Volume gain can be adjusted at the hardware or software level, depending on the application scenario and device requirements. In the embodiments of this application, volume gain can be adjusted at the software level. The magnitude of the volume gain depends on the volume level; that is, the higher the volume, the lower the volume gain, and vice versa.
[0129] S323: Use volume gain to process the modified volume 1 and the changed volume to obtain the processed volume 1 and the processed changed volume.
[0130] It should be understood that since Volume 1 is modified to the changed volume, the processed Volume 1 has the same value as the processed changed volume. The changed volume refers to the changed volume after volume gain processing.
[0131] S324: The ADSP module uses the XSITEN sound effect to process the processed audio 2 again, resulting in the reprocessed audio 2.
[0132] S325: The ADSP module plays audio 1 and audio 2 simultaneously according to the processed volume changes.
[0133] It should be understood that, in this embodiment, since the processed volume 1 is the same as the processed changed volume, the reprocessed audio 1 and the reprocessed audio 2 are played at the same volume. The specific playback implementation process is not specifically limited here.
[0134] In some possible implementations, the volume modification module in the application framework layer can also determine whether the user has stopped adjusting the volume of the second audio. For example, stopping the adjustment of the volume of the second audio includes, but is not limited to, the user exiting the above-mentioned... Figures 4a to 4d When the volume is adjusted, the user turns off the phone screen, or the second audio file finishes playing, the application framework layer will adjust the volume of the first audio file from the changed volume back to the original volume. At this point, the speaker will play the first audio file at the original volume.
[0135] In this embodiment of the application, the first volume of the first audio is modified to the changed volume of the second audio, and the sound effect gain is added according to the changed volume to obtain the processed first volume. That is, the first volume of the first audio is processed according to the changed volume and the volume gain. Since the changed volume is less than the first volume, mixing the volume gain on the basis of the changed volume will not cause the first volume to be different, thus avoiding the influence of the changed volume on the first volume and improving the user experience.
[0136] It should be noted that the module names involved in the embodiments of this application can all be defined as other names, as long as they can achieve the function of each module, and no specific restrictions are placed on the module names.
[0137] The above describes the method provided by the embodiments of this application from the perspective of the interaction of various modules in the terminal device. The following will describe in detail the method provided by the embodiments of this application from the perspective of the terminal device.
[0138] To better understand the volume adjustment method provided in the embodiments of this application, the hardware structure of the terminal device will be described first.
[0139] In one example, the terminal device can be a device with cascaded audio effects, including but not limited to mobile phones, tablets, laptops, wearable electronic devices, and smart devices that can play audio (such as smart speakers, smart TVs, and smart refrigerators). This application does not impose any special restrictions on the specific form of the aforementioned terminal devices.
[0140] In this embodiment, the structure of the terminal device can be as follows: Figure 5 As shown, the terminal device may include a processor 510, an audio module 520, a display screen 530, and internal memory 540. The audio module 520 includes a speaker 521.
[0141] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0142] The processor 510 may include one or more processing units, such as a graphics processing unit (GPU), a controller, a video codec, a digital signal processor (DSP), and / or a neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors 510. In this embodiment, the processor 510 can execute the volume adjustment method provided in this embodiment.
[0143] The terminal device implements display functions through a GPU, a display screen 530, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 530 and the application processor. The GPU performs mathematical and geometric calculations and is used for graphics rendering. The processor 510 may include one or more GPUs, which execute program instructions to generate or modify display information. In this embodiment, the terminal device can display the above-mentioned information through a GPU, a display screen 530, and an application processor. Figure 1a The functions of the interface shown.
[0144] The display screen 530 is used to display images, videos, etc. The display screen 530 includes a display panel. In some embodiments, the terminal device may include one or N display screens 530, where N is a positive integer greater than 1.
[0145] The terminal device can implement audio functions through the audio module 520, speaker 521, and application processor, such as music playback and recording.
[0146] The audio module 520 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 520 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 520 may be located in the processor 510, or some functional modules of the audio module 520 may be located in the processor 510. The speaker 521, also called a "loudspeaker," is used to convert audio electrical signals into sound signals. The terminal device can listen to music or make hands-free calls through the speaker 521.
[0147] The internal memory 540 can be used to store computer executable program code, which includes instructions. The internal memory 540 may include a program storage area and a data storage area. In this embodiment, the internal memory 540 can store code for implementing the volume adjustment method provided in this embodiment.
[0148] The hardware structure of the terminal device has been described above. Further, Figure 6 A flowchart illustrating a volume adjustment method is provided, which can be applied to the above. Figure 5 The terminal device shown is not limited to this embodiment. Figure 6 As shown, the volume adjustment method provided in this application embodiment may include the following steps:
[0149] S601: Play the first audio of the first application of the terminal device; the volume of the first audio is the first volume; the second audio of the second application is not played.
[0150] The first application can be as described above. Figure 2 The application layer includes applications such as music, video, games, or calls, but the embodiments of this application are not limited to these. The volume of the first audio is a first volume, indicating that the terminal device is playing the first audio of the first application at a first volume. The second application can be as described above. Figure 2 The settings and playback controls shown are not limited to these. The first volume is the same as the playback volume described in the above embodiments, and will not be repeated here.
[0151] The process of the terminal device playing the first audio can be as described above. Figure 3 Steps S301 to S309 in the process will not be described again here.
[0152] S602: Continuously play the first audio, receive a trigger operation from the user to set the volume of the second audio from the second volume to the third volume, and modify the volume of the first audio from the first volume to the fourth volume; the fourth volume is adjusted based on the third volume.
[0153] Triggering operation refers to the operation described above. Figures 4a to 4d The user actions shown are not limited to these. The trigger action is used to indicate that the user changes the volume of the second application from the second volume to the third volume, for example, changing the volume of the second application from 13 to 1.
[0154] The third volume differs from the second volume, indicating that the third volume may be greater than or less than the second volume. If the third volume is less than the first volume, the volume of the first audio needs to be changed from the first volume to a volume less than or equal to the third volume (i.e., the fourth volume) to avoid the third volume affecting the stability of the first audio playback and to allow users to identify the second audio, thus improving the user experience. In one implementation, if the third volume is greater than or equal to the first volume, the volume of the first audio does not need to be changed from the first volume to the fourth volume, and step S603 can be executed directly. That is, when the third volume is greater than or equal to the first volume, it indicates that the third volume does not affect the stability of the first audio playback, so the volume of the first audio does not need to be adjusted.
[0155] It should be noted that the third volume is the same as the modified volume involved in the aforementioned embodiments, and will not be described again here.
[0156] S603: Continuously play the first audio and play the second audio; the volume of the first audio is the fourth volume, and the volume of the second audio is the third volume.
[0157] Since the volume of the first audio is changed from the first volume to the third volume at the third moment, when the volume of the first audio is processed using volume gain, it is processed according to the third volume. That is, the hardware layer only has the third volume identifier to ensure the stability of the volume of the first audio after processing, and when the first volume is at its maximum value, it will not exceed the physical volume of the speaker.
[0158] In addition, when the first audio and the second audio are played simultaneously, the fourth volume is less than or equal to the third volume, avoiding the problem that the user may have difficulty recognizing the second audio if the volume of the first audio is greater than that of the second audio.
[0159] The continuous playback of the first audio and the playback of the second audio indicate that the terminal device is playing the second audio while continuously playing the first audio.
[0160] In one implementation, the method further includes: recording a first volume at the application framework layer of the terminal device; and after the second audio is played, restoring the volume of the first audio from the fourth volume to the recorded first volume.
[0161] In one implementation, the method further includes: the application framework layer of the terminal device determining whether the third volume is lower than the first volume; if the third volume is not lower than the first volume, then the volume of the first audio is the first volume; if the third volume is lower than the first volume, then the volume of the first audio is changed from the first volume to the fourth volume.
[0162] It should be understood that when the third volume is greater than or equal to the first volume, the volume gain of the third volume will not affect the first volume, that is, the first volume will not change. Conversely, the volume gain of the third volume will affect the first volume, causing a difference in the volume of the first volume.
[0163] Based on the above embodiments, such as Figure 7 As shown in the illustration, this application also provides a scenario diagram of a volume adjustment method. Taking a mobile phone as an example, the first audio is music, and the second audio is a ringtone. The volume of the first audio is 13, the volume of the second audio is 10, and the volume of the second audio after the change is 2. This method, applied to a terminal device, may include:
[0164] S701: Determine whether the user has entered the volume adjustment state; if yes, proceed to step S702; if no, play the first audio normally at the first volume.
[0165] For example, the volume adjustment state can be when the user enters the settings interface, or when the user wakes up the smart voice, or when the user presses the volume button, without being specifically limited here.
[0166] S702: Records the first volume of the first audio signal.
[0167] For example, suppose a user enters the settings page and clicks on Sound and Vibration in the settings. This means the user has entered the volume setting state. At this time, it is necessary to record the volume of the music being played as 13, that is, the first volume is 13.
[0168] S703: In response to the user's operation of adjusting the second audio, obtain the volume of the second audio that the user adjusted, that is, the changed volume.
[0169] For example, a user can change the incoming call ringtone from 10 to 2, and the changed volume will be 2.
[0170] S704: Modify the volume of the first audio signal from the first volume to a volume less than or equal to the changed volume.
[0171] For example, the music volume is changed from 13 to 2.
[0172] S705: Sends the processed volume change to the ADSP module of the volume layer.
[0173] S706: The ADSP module obtains the volume gain corresponding to the changed volume, and uses the volume gain to process the volume of the modified first audio and the changed volume of the second audio.
[0174] The volume of the first audio track after modification is the changed volume; that is, the volume of the first audio track is now the same as the volume of the second audio track.
[0175] For example, assuming the obtained volume gain is k, the volume of the first audio is modified to be 2 and the volume of the second audio is modified to be 2 using the volume gain k. The volume of the first audio after processing is 2+k, and the volume of the modified audio after processing is 2+k.
[0176] S707: Plays the second audio through the speaker at a processed volume change, and plays the first audio at a processed volume change less than or equal to the volume change.
[0177] It should be understood that once the user has finished adjusting the volume of the second audio, the volume of the first audio can be restored to the first volume.
[0178] The technical solution of this embodiment, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments. The aforementioned storage medium includes various media capable of storing program code, such as flash memory, portable hard disk, read-only memory, random access memory, magnetic disk, or optical disk.
[0179] The terms "first," "second," and "third," etc., used in this application specification, claims, and drawings are used to distinguish different objects, not to limit a specific order.
[0180] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0181] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A volume adjustment method, characterized in that, Applied to a terminal device, the method includes: Play a first audio from a first application on the terminal device; the volume of the first audio is a first volume, and the second audio from a second application on the terminal device is not played; the first audio is music, and the second audio is an incoming call ringtone; The system continuously plays the first audio. In response to a user's trigger operation to set the volume of the second audio from a second volume to a third volume, it determines whether the third volume is less than the first volume. If the third volume is not less than the first volume, the volume of the first audio is the first volume. If the third volume is less than the first volume, the volume of the first audio is modified from the first volume to a fourth volume, and the first volume is recorded based on the trigger operation. The fourth volume is adjusted based on the third volume. The volume value of the fourth volume is less than or equal to the volume value of the third volume. The hardware layer of the terminal device obtains the volume gain corresponding to the third volume. The hardware layer uses the volume gain to process the third volume and the fourth volume to obtain the processed third volume and the processed fourth volume; The first audio is played continuously, and the second audio is played at the processed third volume; the volume of the first audio is the processed fourth volume, and the volume of the second audio is the processed third volume; After the second audio has finished playing, the volume of the first audio is restored from the fourth volume to the recorded first volume.
2. The method according to claim 1, characterized in that, Determining whether the third volume is less than the first volume includes: The application framework layer of the terminal device determines whether the third volume is lower than the first volume.
3. The method according to claim 1, characterized in that, The trigger operation in response to the user setting the volume of the second audio from a second volume to a third volume includes: In response to the user's first operation on the settings application, a first interface is displayed; the first interface includes a first control; the first control is used to adjust the volume of the second audio in the second application; wherein, before the second moment, the volume of the second audio is the second volume; The system receives a second operation from the user on the first control; the second operation is used to set the volume of the second audio to a third volume.
4. The method according to claim 1, characterized in that, The trigger operation in response to the user setting the volume of the second audio from a second volume to a third volume includes: In response to the user's third operation on the volume adjustment button, a second interface is displayed; the second interface includes a second control and a third control; the second control is used to adjust the volume of the first audio of the first application; the third control is used to adjust the volume of the second audio of the second application; the third operation is used to set the volume of the first audio to a fourth volume; wherein, before the second moment, the volume of the first audio is the first volume, and the volume of the second audio is the second volume; The system receives a fourth operation from the user on the third control; the fourth operation is used to set the volume of the second audio to the third volume.
5. The method according to any one of claims 1-4, characterized in that, Before playing the first audio from the first application of the terminal device, the method further includes: The application framework layer of the terminal device processes the first audio in the first application to obtain the processed first audio. The advanced digital signal processor (ADSP) module of the terminal device processes the processed first audio to obtain a further processed first audio. Playing the first audio of the first application of the terminal device includes: playing the reprocessed first audio through the speaker of the terminal device.
6. The method according to any one of claims 1-4, characterized in that, Before playing the second audio, it also includes: The application framework layer of the terminal device obtains the second audio from the second application; The application framework layer transmits the second audio to the hardware layer of the terminal device; Playing the second audio includes: playing the second audio through the speaker of the hardware layer.
7. An electronic device, characterized in that, include: Processor and memory; The memory stores one or more computer programs, the one or more computer programs including instructions; when the instructions are executed by the processor, the electronic device performs the volume adjustment method as described in any one of claims 1-6.
8. A computer storage medium, characterized in that, Includes computer instructions, which, when executed on an electronic device, cause the electronic device to perform the volume adjustment method as described in any one of claims 1-6.
Citation Information
Patent Citations
Display equipment and volume adjusting method
CN113448529A
Volume adjusting method and related device
CN116737104A