Hearing protection methods, devices, and media during hands-free mode switching

By monitoring the speaker volume with a distance sensor and using the Ramp algorithm to control the volume, the problem of sudden volume increase when switching to hands-free mode on mobile devices is solved, thus achieving hearing protection.

CN117278668BActive Publication Date: 2026-05-26SHANGHAI LONGCHEER INTELLIGENCE TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI LONGCHEER INTELLIGENCE TECHNOLOGY CO LTD
Filing Date
2023-09-19
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

When mobile devices such as smartphones switch from handheld mode to hands-free mode, the speaker volume suddenly increases, which can damage the user's hearing.

Method used

The system uses a distance sensor to monitor whether the voice playback device is obstructed. If it is obstructed, the playback volume in speaker mode is reduced, and the volume is gradually restored using a ramp algorithm to control the playback volume of the voice playback device in speaker mode.

Benefits of technology

When switching to hands-free mode, the speaker volume should not suddenly increase to protect the user's hearing. Gradual volume adjustment should be provided to ensure that the user's ears have time to adapt.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117278668B_ABST
    Figure CN117278668B_ABST
Patent Text Reader

Abstract

This invention provides a hearing protection method and device during the handheld hands-free mode switching process. The invention enables a brief reduction in the gain of the playback volume of the voice playback device in speaker mode when the device is obstructed; and allows the playback volume to automatically and gradually recover. Thus, when a mobile device is accidentally switched from handheld mode to hands-free mode, the playback volume of the voice playback device in speaker mode can be limited to prevent excessive volume and ensure that the playback volume in hands-free mode does not suddenly increase. The volume can be gradually increased to give the user's ears time to adjust.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method and device for hearing protection during the handheld hands-free mode switching process. Background Technology

[0002] When mobile phones, tablets, and other devices feature dual speakers, the earpiece also functions as a speaker. Typically, Qualcomm and MediaTek platforms are used. Other platforms, such as Spreadtrum, cannot meet the SOp 0289 certification requirements for stereo projects. This is because the Spreadtrum platform does not support switching between hands-free and handheld modes without ending the call during live or software calls. Forcing a switch would cause the earpiece's volume to suddenly increase, potentially damaging the user's hearing. Summary of the Invention

[0003] One object of the present invention is to provide a hearing protection method and device during the handheld hands-free mode switching process.

[0004] According to one aspect of the present invention, a method for hearing protection during handheld hands-free mode switching is provided, the method comprising:

[0005] When the mobile device detects a switch from handheld call mode to hands-free call mode, it converts the voice playback device on the mobile device from earpiece function to speaker function, and uses the mobile device's proximity sensor to detect whether the voice playback device is obstructed.

[0006] If the audio playback device is detected to be obstructed, the playback volume of the audio playback device in speaker mode will be reduced.

[0007] Gradually restore the playback volume of the voice playback device in speaker mode.

[0008] Furthermore, in the above method, reducing the playback volume of the voice playback device in speaker mode includes:

[0009] Start a thread to run the Ramp algorithm module stored in the system's XML file;

[0010] Read the volume adjustment percentage parameter from the Ramp algorithm module;

[0011] Calculate the target volume level to which the volume needs to be reduced based on the read volume adjustment percentage parameter;

[0012] The target volume value is sent to the HAL layer of the mobile device;

[0013] The HAL layer provides interfaces for the mobile device's firmware layer to call;

[0014] The target volume value is sent from the FW firmware layer to the DSP digital signal processing module, i.e., the Kernel layer, of the mobile device.

[0015] The DSP digital signal processing module controls the playback volume of the voice playback device in speaker mode based on the target volume value.

[0016] Furthermore, in the above method, reading the volume adjustment percentage parameter from the Ramp algorithm module includes:

[0017] Depending on the type of mobile device and the usage scenario, the corresponding volume adjustment percentage parameter is read from the Ramp algorithm module.

[0018] Furthermore, in the above method, monitoring whether the voice playback device is obstructed via the distance sensor of the mobile device includes:

[0019] When the distance sensor of the mobile device detects that the distance between the object in front of the voice playback device and the earpiece is less than a preset threshold, it is determined that the voice playback device is blocked.

[0020] According to another aspect of the present invention, a hearing protection device is also provided during the handheld hands-free mode switching process, wherein the device comprises:

[0021] A monitoring device is used to switch the voice playback device on the mobile device from earpiece function to speaker function when a switch from handheld call mode to hands-free call mode is detected, and to monitor whether the voice playback device is obstructed by the mobile device's proximity sensor.

[0022] A control device is used to reduce the playback volume of the voice playback device in speaker function when it is detected that the voice playback device is blocked; and gradually restore the playback volume of the voice playback device in speaker function.

[0023] Furthermore, in the aforementioned device, the control unit is used to start a thread to run the Ramp algorithm module stored in the XML file in the system; read the volume adjustment percentage parameter from the Ramp algorithm module; calculate the target volume value to be reduced based on the read volume adjustment percentage parameter; send the target volume value to the HAL layer of the mobile device; the HAL layer provides an interface for the FW firmware layer of the mobile device to call; the FW firmware layer sends the target volume value to the DSP digital signal processing module, i.e., the Kernel layer, of the mobile device; the DSP digital signal processing module controls the playback volume of the voice playback device in speaker mode based on the target volume value.

[0024] Furthermore, in the aforementioned device, the control unit is used to read the corresponding volume adjustment percentage parameter from the Ramp algorithm module according to the different types of mobile devices and usage scenarios.

[0025] Furthermore, in the aforementioned device, the monitoring device is used to determine that the voice playback device is obstructed when the distance sensor of the mobile device detects that the distance between the object in front of the voice playback device and the voice playback device is less than a preset threshold.

[0026] According to another aspect of the present invention, a computing-based device is also provided, comprising:

[0027] Processor; and

[0028] A memory configured to store computer-executable instructions, which, when executed, cause the processor to:

[0029] When the mobile device detects a switch from handheld call mode to hands-free call mode, it uses the device's proximity sensor to monitor whether the earpiece is obstructed.

[0030] If the earpiece is detected to be blocked, the volume of the call mode switching prompt on the earpiece will be reduced.

[0031] After a preset time period, the playback volume of the earpiece will gradually be restored.

[0032] According to another aspect of the present invention, a computer-readable storage medium is also provided, having stored thereon computer-executable instructions, wherein when executed by a processor, the computer-executable instructions cause the processor to:

[0033] When the mobile device detects a switch from handheld call mode to hands-free call mode, it uses the device's proximity sensor to monitor whether the earpiece is obstructed.

[0034] If the earpiece is detected to be blocked, the volume of the call mode switching prompt on the earpiece will be reduced.

[0035] After a preset time period, the playback volume of the earpiece will gradually be restored.

[0036] Compared to existing technologies, this invention achieves a function that temporarily reduces the gain of the voice playback device in speaker mode when the device is obstructed; and it also allows the playback volume of the voice playback device in speaker mode to automatically and gradually recover. Thus, when a mobile device is accidentally switched from handheld mode to hands-free mode, this invention can limit the playback volume of the voice playback device in speaker mode to prevent excessive volume and ensure that the playback volume in hands-free mode does not suddenly increase. The volume can be gradually increased to give the user's ears time to adjust. Furthermore, when the earpiece of a mobile device such as a phone is pressed against the ear, the device can detect and automatically reduce the playback volume of the voice playback device in speaker mode during hands-free mode switching, such as reducing the gain by 20dB, so that the playback volume will not damage the user's hearing. Attached Figure Description

[0037] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:

[0038] Figure 1 A schematic diagram illustrating a hearing protection method during hands-free mode switching according to an embodiment of the present invention is shown.

[0039] Figure 2 A flowchart illustrating a hearing protection method during hands-free mode switching according to an embodiment of the present invention is shown.

[0040] The same or similar reference numerals in the accompanying drawings represent the same or similar parts. Detailed Implementation

[0041] The present invention will now be described in further detail with reference to the accompanying drawings.

[0042] In a typical configuration of this application, the terminal, the device of the service network, and the trusted party all include one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0043] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0044] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include non-transitory computer-readable media, such as modulated data signals and carrier waves.

[0045] This invention provides a hearing protection method during hands-free mode switching, the method comprising:

[0046] Step S1: When the mobile device detects a switch from handheld call mode to hands-free call mode, the voice playback device on the mobile device is switched from earpiece function to speaker function. The proximity sensor of the mobile device is used to detect whether the voice playback device is obstructed.

[0047] Here, the mobile device can be a mobile device such as a mobile phone or tablet;

[0048] In handheld call mode, voice is output through the earpiece function of the voice playback device; while in hands-free call mode, voice is output through the speaker function of the voice playback device.

[0049] The voice playback device of the present invention can be disposed on the upper part of a mobile device, for example, the top of the front of a mobile phone, and when in handheld call mode, the voice playback device is placed near the ear.

[0050] The voice playback device of the present invention has both earpiece and speaker functions, which can meet the different needs of handheld and hands-free calling modes. The earpiece and speaker functions of the voice playback device of the present invention can be implemented by software and / or hardware, for example, the earpiece and speaker hardware can be integrated into the same voice playback device.

[0051] In addition, the mobile device of the present invention can also employ dual speakers. In addition to setting one speaker in the voice playback device at the top of the mobile device, another speaker can be set at the bottom or side of the mobile device to obtain better voice output effect.

[0052] The voice call device can register a PSenser distance sensor and a listener when the system starts up. The listener monitors changes in the PSenser status and detects whether the earpiece is blocked. When the earpiece is blocked, it means that the user's ear may be close to the voice playback device. At this time, the prompt tone needs to be lowered to avoid damaging the ear.

[0053] Step S2: If the voice playback device is detected to be blocked, reduce the playback volume of the voice playback device in speaker mode.

[0054] To avoid excessive volume from the speakerphone when switching from handheld to hands-free calling, the prompt volume can be reduced to prevent ear damage.

[0055] Step S3: Gradually restore the playback volume of the voice playback device in speaker function.

[0056] Here, when the hands-free call mode is switched on, the user's ear is usually farther from the voice playback device than the preset safe distance. At this time, the playback volume of the voice playback device in speaker mode can be gradually restored. For example, after a preset time, the playback volume of the voice playback device in speaker mode can be gradually restored; or after a preset time, the playback volume of the voice playback device in speaker mode can be gradually restored to ensure that the user can use the mobile device normally for hands-free calls.

[0057] This invention enables a brief reduction in gain when the audio playback device is obstructed, allowing the playback volume in speaker mode to automatically and gradually recover. Thus, when a mobile device is accidentally switched from handheld mode to hands-free mode, this invention limits the playback volume in speaker mode to prevent excessive volume and ensure the volume doesn't suddenly increase, allowing the user's ears time to adjust. Furthermore, when the earpiece of a mobile device is pressed against the ear, the device can detect this and automatically reduce the playback volume in speaker mode during hands-free mode switching, such as reducing the gain by 20dB, to prevent hearing damage.

[0058] like Figure 1 As shown, in one embodiment of the hearing protection method during the hands-free mode switching process of the present invention, step S2, reducing the playback volume of the voice playback device in speaker mode, includes:

[0059] Step S21, AudioServic and AudioPolicyManager: Start a Thread to run the Ramp algorithm module stored in the system's XML file;

[0060] Here, when the service starts, it can parse the Ramp algorithm module stored in the XML file in the system and start a Thread to run the Ramp algorithm module;

[0061] A Ramp algorithm module can be implemented at the framework layer. This module mainly performs adjustable gain control and can be called in most scenarios.

[0062] The ramp interface can be called using the start(AudioPolicyManager *apm, audio_ramp_scene_t scene) function. The ramp algorithm module contains structure parameters that control variables such as ramp slope (the normal level at which the volume gradually increases over a fixed time).

[0063] Step S22, RampThread: Read the volume adjustment percentage parameter from the Ramp algorithm module;

[0064] Step S23, RampThread: Calculate the target volume value to be reduced based on the read volume adjustment percentage parameter;

[0065] Here, the specific volume gain value to be attenuated can be calculated based on the volume adjustment percentage parameter in the Ramp algorithm module.

[0066] Step S24, AudioFlinger: Sends the target volume value to the HAL layer of the mobile device;

[0067] Here, the ramp part of the call status needs to be modified in the DSP part. The AudioFlinger can send volume parameters to the HAL, and the DSP will control the Voice / Voip / VoWiFi volume according to the target volume value sent by the HAL layer.

[0068] Step S25, HAL: The HAL layer provides an interface for the mobile device's FW firmware layer to call;

[0069] Step S26, Kernel: The FW firmware layer sends the target volume value to the DSP digital signal processing module of the mobile device, i.e., the Kernel layer.

[0070] Step S26, DSP: The DSP digital signal processing module controls the playback volume of the voice playback device in speaker mode based on the target volume value.

[0071] In one embodiment of the hearing protection method during the hands-free mode switching process of the present invention, step S22, reading the volume adjustment percentage parameter from the Ramp algorithm module, includes:

[0072] Depending on the type of mobile device and the usage scenario, the corresponding volume adjustment percentage parameter is read from the Ramp algorithm module.

[0073] Here, the usage scenarios could be, for example, switching to speakerphone during a call, switching to speakerphone while listening to music, etc.

[0074] Different types of mobile devices and usage scenarios allow for setting different volume adjustment percentage parameters to ensure that the volume is reduced more accurately and to make the user's ears more comfortable.

[0075] In one embodiment of the hearing protection method during hands-free mode switching of the present invention, step S1, monitoring whether the voice playback device is blocked by the distance sensor of the mobile device, includes:

[0076] When the distance sensor of the mobile device detects that the distance between the object in front of the voice playback device and the voice playback device is less than a preset threshold, it is determined that the voice playback device is blocked.

[0077] Here, the present invention realizes the function that the playback volume of the voice playback device in speaker function needs to be reduced for a short time when the distance sensor is blocked; and realizes that if the distance sensor is triggered or blocked for more than 5 seconds, the playback volume of the voice playback device in speaker function can be automatically and gradually restored.

[0078] like Figure 2 As shown, when the user's ear or palm is ≤2cm close to the phone's proximity sensor (p-sensor), the p-sensor is triggered and a synchronized timer is started (processTypeEventdistance = 5.000000). The system client can set two needramp modes:

[0079] 1. need ramp = true;

[0080] 2. Set the 5-second delay to need ramp = false.

[0081] When a mobile device receives a notification indicating a switch from handheld to hands-free calling, the system checks if the "need ramp" mode is true. A "Y" indicates true, and the original sound gain is maintained. A "N" indicates false, and the notification sound gain is reduced to 6dB. This prevents sudden notification sounds from damaging hearing and protects the user's hearing.

[0082] According to another aspect of the present invention, a hearing protection device during hands-free mode switching is also provided, wherein the device comprises:

[0083] The monitoring device is used to detect when switching from a handheld call mode to a hands-free call mode, and to switch the voice playback device on the mobile device from earpiece function to speaker function, and to monitor whether the voice playback device is blocked by the mobile device's proximity sensor.

[0084] A control device is used to reduce the playback volume of the voice playback device in speaker function when it is detected that the voice playback device is blocked; and gradually restore the playback volume of the voice playback device in speaker function.

[0085] Furthermore, in the aforementioned device, the control unit is used to start a thread to run the Ramp algorithm module stored in the XML file in the system; read the volume adjustment percentage parameter from the Ramp algorithm module; calculate the target volume value to be reduced based on the read volume adjustment percentage parameter; send the target volume value to the HAL layer of the mobile device; the HAL layer provides an interface for the FW firmware layer of the mobile device to call; the FW firmware layer sends the target volume value to the DSP digital signal processing module, i.e., the Kernel layer, of the mobile device; the DSP digital signal processing module controls the playback volume of the voice playback device in speaker mode based on the target volume value.

[0086] Furthermore, in the aforementioned device, the control unit is used to read the corresponding volume adjustment percentage parameter from the Ramp algorithm module according to the different types of mobile devices and usage scenarios.

[0087] Furthermore, in the aforementioned device, the monitoring device is used to determine that the voice playback device is obstructed when the distance sensor of the mobile device detects that the distance between the object in front of the voice playback device and the voice playback device is less than a preset threshold.

[0088] According to another aspect of the present invention, a computing-based device is also provided, comprising:

[0089] Processor; and

[0090] A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the following operations:

[0091] When the mobile device detects a switch from handheld call mode to hands-free call mode, it converts the voice playback device on the mobile device from earpiece function to speaker function, and uses the mobile device's proximity sensor to detect whether the voice playback device is obstructed.

[0092] If the audio playback device is detected to be obstructed, the playback volume of the audio playback device in speaker mode will be reduced.

[0093] Gradually restore the playback volume of the voice playback device in speaker mode.

[0094] According to another aspect of the present invention, a computer-readable storage medium is also provided, having stored thereon computer-executable instructions, wherein when executed by a processor, the computer-executable instructions cause the processor to perform the following operations:

[0095] When the mobile device detects a switch from handheld call mode to hands-free call mode, it converts the voice playback device on the mobile device from earpiece function to speaker function, and uses the mobile device's proximity sensor to detect whether the voice playback device is obstructed.

[0096] If the audio playback device is detected to be obstructed, the playback volume of the audio playback device in speaker mode will be reduced.

[0097] Gradually restore the playback volume of the voice playback device in speaker mode.

[0098] Compared to existing technologies, this invention enables a brief reduction in gain when the audio playback device is obstructed, allowing the playback volume in speaker mode to automatically and gradually recover. This means that when a mobile device is accidentally switched from handheld mode to hands-free mode, the invention can limit the playback volume in speaker mode to prevent excessive volume and ensure that the volume in hands-free mode does not suddenly increase. The volume can be gradually increased to give the user's ears time to adjust. Furthermore, when the earpiece of a mobile device is pressed against the ear, the device can detect this and automatically reduce the playback volume in speaker mode during hands-free mode switching, such as reducing the gain by 20dB, to prevent damage to the user's hearing.

[0099] For detailed descriptions of the various device and storage medium embodiments of the present invention, please refer to the corresponding parts of the various method embodiments, which will not be repeated here.

[0100] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

[0101] It should be noted that the present invention can be implemented in software and / or a combination of software and hardware, for example, using an application-specific integrated circuit (ASIC), a general-purpose computer, or any other similar hardware device. In one embodiment, the software program of the present invention can be executed by a processor to implement the steps or functions described above. Similarly, the software program of the present invention (including associated data structures) can be stored in a computer-readable recording medium, such as RAM memory, a magnetic or optical drive, a floppy disk, or similar devices. Furthermore, some steps or functions of the present invention can be implemented in hardware, for example, as circuitry that works with a processor to perform the various steps or functions.

[0102] Furthermore, a portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. The program instructions invoking the methods of the invention may be stored in a fixed or removable recording medium, and / or transmitted via a data stream in a broadcast or other signal-carrying medium, and / or stored in the working memory of a computer device operating according to the program instructions. Here, an embodiment of the invention includes an apparatus comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein, when the computer program instructions are executed by the processor, the apparatus is triggered to operate the methods and / or technical solutions based on the foregoing embodiments of the invention.

[0103] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the invention. Therefore, the embodiments should be considered illustrative and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims. Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in the apparatus claims may also be implemented by a single unit or device in software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any particular order.

Claims

1. A hearing protection method in a hand-off hands-free mode switching procedure, wherein, The method includes: When the mobile device detects a switch from handheld call mode to hands-free call mode, it converts the voice playback device on the mobile device from earpiece function to speaker function, and uses the mobile device's proximity sensor to detect whether the voice playback device is obstructed. If the voice playback device is detected to be obstructed, a Thread is started to run the Ramp algorithm module stored in the XML file in the system. The volume adjustment percentage parameter is read from the Ramp algorithm module, the target volume value to be reduced is calculated based on the read volume adjustment percentage parameter, and the target volume value is sent to the HAL layer. The HAL layer provides an interface for the FW firmware layer to call. The FW firmware layer sends the target volume value to the DSP digital signal processing module. The DSP digital signal processing module controls the playback volume of the voice playback device in speaker mode based on the target volume value. Gradually restore the playback volume of the voice playback device in speaker mode.

2. The method of claim 1, wherein, Read the volume adjustment percentage parameters from the Ramp algorithm module, including: Depending on the type of mobile device and the usage scenario, the corresponding volume adjustment percentage parameter is read from the Ramp algorithm module.

3. The method of claim 1, wherein, Detecting whether the voice playback device is obstructed via the proximity sensor of the mobile device includes: When the distance sensor of the mobile device detects that the distance between the object in front of the voice playback device and the earpiece is less than a preset threshold, it is determined that the voice playback device is blocked.

4. A hearing protection device in a hands-free mode switching procedure, wherein, The device includes: A monitoring device is used to switch the voice playback device on the mobile device from earpiece function to speaker function when a switch from handheld call mode to hands-free call mode is detected, and to monitor whether the voice playback device is obstructed by the mobile device's proximity sensor. The control device, when detecting that the voice playback device is obstructed, starts a thread to run the Ramp algorithm module stored in the system's XML file, reads the volume adjustment percentage parameter from the Ramp algorithm module, calculates the target volume value to be reduced based on the read volume adjustment percentage parameter, and sends the target volume value to the HAL layer. The HAL layer provides an interface for the FW firmware layer to call, and the FW firmware layer sends the target volume value to the DSP digital signal processing module. Based on the target volume value, the DSP digital signal processing module controls the playback volume of the voice playback device in speaker mode; and gradually restores the playback volume of the voice playback device in speaker function.

5. The apparatus of claim 4, wherein, The control device is used to read the corresponding volume adjustment percentage parameter from the Ramp algorithm module according to the different types of mobile devices and usage scenarios.

6. The apparatus of claim 5, wherein, The monitoring device is used to determine that the voice playback device is blocked when the distance sensor of the mobile device detects that the distance between the object in front of the voice playback device and the voice playback device is less than a preset threshold.

7. A computing-based device comprising: include: processor; as well as A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the following operations: When the mobile device detects a switch from handheld call mode to hands-free call mode, it converts the voice playback device on the mobile device from earpiece function to speaker function, and uses the mobile device's proximity sensor to detect whether the voice playback device is obstructed. If the voice playback device is detected to be obstructed, a Thread is started to run the Ramp algorithm module stored in the XML file in the system. The volume adjustment percentage parameter is read from the Ramp algorithm module, the target volume value to be reduced is calculated based on the read volume adjustment percentage parameter, and the target volume value is sent to the HAL layer. The HAL layer provides an interface for the FW firmware layer to call. The FW firmware layer sends the target volume value to the DSP digital signal processing module. The DSP digital signal processing module controls the playback volume of the voice playback device in speaker mode based on the target volume value. Gradually restore the playback volume of the voice playback device in speaker mode.

8. A computer-readable storage medium having stored thereon computer- executable instructions, wherein, When this computer-executable instruction is executed by the processor, it causes the processor to perform the following operations: When the mobile device detects a switch from handheld call mode to hands-free call mode, it converts the voice playback device on the mobile device from earpiece function to speaker function, and uses the mobile device's proximity sensor to detect whether the voice playback device is obstructed. If the voice playback device is detected to be obstructed, a Thread is started to run the Ramp algorithm module stored in the XML file in the system. The volume adjustment percentage parameter is read from the Ramp algorithm module, the target volume value to be reduced is calculated based on the read volume adjustment percentage parameter, and the target volume value is sent to the HAL layer. The HAL layer provides an interface for the FW firmware layer to call. The FW firmware layer sends the target volume value to the DSP digital signal processing module. The DSP digital signal processing module controls the playback volume of the voice playback device in speaker mode based on the target volume value. Gradually restore the playback volume of the voice playback device in speaker mode.