Volume adjustment method and device, electronic equipment and computer readable storage medium
By decoding the audio in the video playback client and increasing the volume value, the problem of the system's volume cannot continue to increase the volume after reaching the maximum value, and a better volume adjustment effect is achieved, which is particularly suitable for the listening needs of the elderly.
Patent Information
- Application Number
- CN202510178606.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2025-06-17
AI Technical Summary
During video playback, users cannot continue to increase the volume after the system volume reaches the maximum value, which cannot meet the hearing needs of the elderly.
By decoding the audio in the video playback client, obtaining the volume value of each audio sampling point, and increasing it when the system volume reaches the maximum value, and sending it to the system player for audio and video playback.
It realizes that the volume can still be increased when the system volume reaches its maximum value, meeting the user's demand for volume adjustment, especially the hearing needs of the elderly.
Smart Images

Figure CN120166264A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet application technologies, and particularly to a volume adjustment method, device, electronic device, and computer-readable storage medium. Background Art
[0002] Currently, during video playback, the volume that the user can hear is limited by the system volume. For example, when the user watches a video on a mobile phone, the maximum volume adjustment can only be increased to the maximum value of the system volume.
[0003] However, in actual applications, the maximum value of the system volume cannot meet the user's needs. For example, the hearing of the elderly has declined, and they still hope that the volume can be increased even when the system volume has reached its maximum value. Summary of the Invention
[0004] The purpose of the embodiments of the present invention is to provide a volume adjustment method, device, electronic device, and computer-readable storage medium to better meet the user's needs for volume adjustment. The specific technical solutions are as follows:
[0005] In the first aspect of the present invention, a volume adjustment method is first provided, which is applied to a video playback client and includes:
[0006] When it is monitored that the system volume reaches the maximum value, decode the audio of the video segment to be played to obtain the volume values of each audio sampling point, and increase the volume values of each audio sampling point, where the system volume is the volume adjusted through the software system, and the system volume reaching the maximum value means the maximum volume that the software system can control;
[0007] Send the increased volume values of each audio sampling point to the system player so that the system player plays the audio and video based on the adjusted volume values of each audio sampling point.
[0008] Optionally, increasing the volume values of each audio sampling point includes:
[0009] Adding a preset value to the volume values of each audio sampling point; or,
[0010] Amplifying the volume values of each audio sampling point by a preset multiple.
[0011] Optionally, amplifying the volume values of each audio sampling point by a preset multiple includes:
[0012] Determine the initial amplification factor;
[0013] Determine the maximum and minimum values among the volume values of each audio sampling point;
[0014] Calculate the first product of the maximum value and the initial magnification factor;
[0015] In the case where the first product is greater than the maximum volume value of the device, calculate the first ratio of the maximum volume value of the device to the maximum value, and use the first ratio as the minimum magnification factor, where the maximum volume value of the device represents the maximum volume value that the electronic device installed with the video playback client can reach, and the maximum volume value of the device is determined by the hardware performance of the electronic device itself;
[0016] Calculate the second product of the minimum value and the initial magnification factor;
[0017] In the case where the second product is not greater than the maximum volume value of the device, use the initial magnification factor as the maximum magnification factor;
[0018] Determine the magnification factors corresponding to other volume values according to the minimum magnification factor corresponding to the maximum value and the maximum magnification factor corresponding to the minimum value, where the other volume values represent the volume values of each audio sampling point except the maximum value and the minimum value;
[0019] Magnify the maximum value according to the minimum magnification factor, magnify the minimum value according to the maximum magnification factor, and magnify the other volume values according to the magnification factors corresponding to the other volume values respectively.
[0020] Optionally, the determining the magnification factors corresponding to other volume values according to the minimum magnification factor corresponding to the maximum value and the maximum magnification factor corresponding to the minimum value includes:
[0021] Create an initial paradigm, where the initial paradigm represents the relationship in which the dependent variable changes with the influence parameter as the independent variable changes;
[0022] Substitute the minimum magnification factor when the independent variable X is the maximum value and the maximum magnification factor when the independent variable is the minimum value into the initial paradigm, calculate the value of the influence parameter, and substitute the value of the influence parameter into the initial paradigm to obtain a function mapping relationship representing the change of the magnification factor with the volume;
[0023] For each other volume value, substitute the other volume value into the function mapping relationship to obtain the magnification factor corresponding to the other volume value.
[0024] Optionally, the increasing the volume values of each audio sampling point includes:
[0025] When it is determined that the current operation mode is the elderly mode, increase the volume value of each audio sampling point, where the current operation mode represents the operation mode corresponding to the target mode selection option or function option selected by the user;
[0026] Or,
[0027] When it is determined that the user attribute of the current user account represents that the current user is an elderly person, increase the volume value of each audio sampling point.
[0028] Optionally, the volume value of each audio sampling point is represented by the amplitude of the Pulse Code Modulation (PCM) data.
[0029] Optionally, when it is monitored that the system volume reaches the maximum value, the method further includes:
[0030] Display a prompt message for prompting the user that the volume can be further increased;
[0031] The increasing of the volume value of each audio sampling point includes:
[0032] In response to receiving a volume amplification instruction, increase the volume value of each audio sampling point.
[0033] In a second aspect, a volume adjustment device is provided, which is applied to a video playback client and includes:
[0034] An increasing module, configured to, when it is monitored that the system volume reaches the maximum value, decode the audio of the video segment to be played to obtain the volume value of each audio sampling point, and increase the volume value of each audio sampling point, where the system volume is the volume adjusted through the software system, and the system volume reaching the maximum value means the maximum volume that the software system can control;
[0035] A sending module, configured to send the increased volume value of each audio sampling point to the system player, so that the system player performs audio and video playback based on the adjusted volume value of each audio sampling point.
[0036] In a third aspect implemented by the present invention, an electronic device is further provided, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0037] The memory is used for storing a computer program;
[0038] The processor, when executing the program stored in the memory, implements the method steps of any one of the first aspect.
[0039] In yet another aspect of the implementation of the present invention, there is also provided a computer-readable storage medium storing a computer program therein, and when the computer program is executed by a processor, the volume adjustment method described in any one of the above is implemented.
[0040] In yet another aspect of the implementation of the present invention, there is also provided a computer program product containing instructions, and when it runs on a computer, it causes the computer to execute the volume adjustment method described in any one of the above.
[0041] In an embodiment of the present invention, when it is monitored that the system volume reaches the maximum value, the audio of the video segment to be played is decoded to obtain the volume values of each audio sampling point, and the volume values of each audio sampling point in the audio of the video segment to be played are increased. In this way, it is possible to increase the volume even when the system volume reaches the maximum by increasing the volume of the video itself, solving the limitation in the related art that the volume adjustment during video playback can only be increased up to the maximum value of the system volume at most, and being able to better meet the user's demand for volume adjustment. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art.
[0043] Figure 1 It is a flowchart of the volume adjustment method in an embodiment of the present invention;
[0044] Figure 2 It is a schematic diagram for prompting the user in an embodiment of the present invention;
[0045] Figure 3 It is a flowchart for magnifying the volume value of each audio sampling point by a preset multiple in an embodiment of the present invention;
[0046] Figure 4 It is a schematic diagram of the original volume value corresponding to a section of audio in an embodiment of the present invention;
[0047] Figure 5 It is a comparison schematic diagram of the magnified volume value corresponding to a section of audio in an embodiment of the present invention;
[0048] Figure 6 It is a magnified result schematic diagram of the magnified volume value corresponding to a section of audio in an embodiment of the present invention;
[0049] Figure 7 It is an interaction schematic diagram of the upper-layer application, the audio decoder, and the system player in an embodiment of the present invention;
[0050] Figure 8 It is a schematic diagram of the process for volume adjustment in an embodiment of the present invention;
[0051] Figure 9 is a schematic structural diagram of the volume adjustment device in an embodiment of the present invention;
[0052] Figure 10 is a schematic structural diagram of the electronic device provided by an embodiment of the present invention. Specific Embodiments
[0053] Next, the technical solutions in the embodiments of the present invention will be described with reference to the accompanying drawings in the embodiments of the present invention.
[0054] The volume adjustment method provided by the embodiment of the present invention can be applied during video playback. Specifically, the volume adjustment method provided by the embodiment of the present invention can be applied to a video playback client, for example, a video playback client installed in an electronic device (such as a mobile phone, a computer, etc.).
[0055] Figure 1 is a flowchart of the volume adjustment method provided by the embodiment of the present invention. Referring to Figure 1 , the volume adjustment method provided by the embodiment of the present invention includes:
[0056] S11, when it is monitored that the system volume reaches the maximum value, decode the audio of the video segment to be played to obtain the volume values of each audio sampling point, and increase the volume values of each audio sampling point, where the system volume is the volume adjusted through the software system, and the system volume reaching the maximum value means the maximum volume that the software system can control;
[0057] S12, send the increased volume values of each audio sampling point to the system player so that the system player plays the audio and video based on the adjusted volume values of each audio sampling point.
[0058] In the embodiment of the present invention, when it is monitored that the system volume reaches the maximum value, decode the audio of the video segment to be played to obtain the volume values of each audio sampling point, and increase the volume values of each audio sampling point in the audio of the video segment to be played. In this way, it is possible to increase the volume even when the system volume reaches the maximum by increasing the volume of the video itself, solving the limitation in the related art that the volume can only be adjusted up to the maximum value of the system volume during video playback, and better meeting the user's demand for volume adjustment.
[0059] In S11, during video playback, decoding the audio of the video segment to be played can obtain audio data, and the audio data includes the volume values of each audio sampling point.
[0060] Among them, the video segment to be played can be a video segment in the currently played video, for example, a video segment corresponding to a period of time after the current time.
[0061] The process of decoding audio can also be understood as the process of digitizing audio, or the process of digitizing sound. Audio data is the data after digitization. Specifically, the process of digitizing sound can refer to the content in related technologies.
[0062] In one implementation, the audio of the video segment to be played is decoded to obtain PCM (Pulse Code Modulation) data, and the volume is represented by the amplitude of the PCM data. That is, the volume value of each audio sampling point in the audio is the amplitude of the PCM data obtained by decoding the audio.
[0063] Specifically, when decoding the audio, that is, digitizing the audio to obtain PCM data, where the amplitude of the PCM data can represent the volume.
[0064] Among them, PCM is the representation form after an analog signal is converted into a digital signal at a fixed sampling frequency. Specifically, the method of digitizing audio by the PCM method can refer to the content of PCM in related technologies, which will not be elaborated here.
[0065] In the embodiments of the present invention, when it is monitored that the system volume reaches the maximum value, the volume values of each audio sampling point are increased, which is to increase the volume of the video itself.
[0066] In one implementation, increasing the volume value of each audio sampling point includes: adding a preset value to the volume value of each audio sampling point.
[0067] Among them, the preset value can be determined according to actual needs or experience, etc.
[0068] In another implementation, the volume values of each audio sampling point are amplified by a preset multiple.
[0069] Among them, the preset multiple can be determined according to actual needs or experience, etc.
[0070] Specifically, the volume values of each audio sampling point can be amplified by the same preset multiple. For example, the volume values of each audio sampling point are multiplied by the preset multiple respectively.
[0071] Or, different audio sampling points can also have their volume values amplified by different preset multiples. For the volume value of each audio sampling point, multiply the volume value of this audio sampling point by the preset multiple corresponding to the volume value of this audio sampling point.
[0072] Among them, the system volume refers to the volume adjusted through the software system settings. For example, the volume adjusted by the operation of increasing the volume through the buttons on a mobile phone is the system volume. Generally, the system volume is adjusted by the operating system by controlling the current of the speaker. For example, when the mobile phone detects the user's operation on the volume increase button on the mobile phone, the operating system controls the increase of the current of the speaker, so as to realize the adjustment of the system volume.
[0073] In the embodiments of the present invention, the system volume can be monitored in real time. Specifically, it can monitor the user's operation on the volume increase button on the device. If it is detected that the user adjusts the volume increase button on the device to the full scale, it means that the user adjusts the system volume to the maximum.
[0074] The maximum value of the system volume, which can also be called the system maximum volume, refers to the maximum volume multiple limited by the software system, and can also be regarded as the highest value that can be reached by pressing the volume button.
[0075] In S12, the system player refers to the playback ability provided by the operating system of the electronic device. For example, the system player is the playback ability provided by the system (such as Android, iOS) carried by the mobile phone itself. For example, the simplest application program can let the system player play a local audio file, and then loading the file, decoding the file and making the speaker sound are all completed by the system player.
[0076] In the embodiments of the present invention, the volume values of the increased audio sampling points are sent to the system player. In this way, the system player plays the audio and video based on the volume values of the increased audio sampling points.
[0077] Generally, after the video playback client decodes the audio, it sends the decoded audio data to the system player. In the embodiments of the present invention, sending the volume values of the increased audio sampling points to the system player can be understood as replacing the volume values of the unadjusted audio sampling points in the decoded audio data with the volume values of the increased audio sampling points, and sending the increased audio data to the system player. The system player plays the audio and video based on this audio data. Specifically, the process of the system player playing the audio and video based on the audio data sent by the video playback client can refer to the content in the related art.
[0078] The specific video playback client can send the increased audio data to the sound card for audio and video playback. A sound card is a computer hardware device specifically used to process and convert sound, responsible for transmitting and processing audio data between internal and external audio devices of a computer. The basic function of a sound card is to convert the original sound signals from audio input devices such as microphones, tapes, and optical discs, and output them to sound devices such as headphones, speakers (such as speakers), amplifiers, and recorders. In short, a sound card is a bridge for a computer to communicate with the external sound world.
[0079] In an optional embodiment, when it is monitored that the system volume reaches the maximum value, a prompt message can be displayed to the user, and the prompt message is used to prompt the user that the volume can continue to increase;
[0080] Thus, in response to receiving a volume amplification instruction, the volume values of each audio sampling point are increased. That is, when receiving a volume amplification instruction, the volume values of each audio sampling point are increased, that is, the volume values of each audio sampling point are increased.
[0081] In the embodiments of the present invention, the manner of displaying the prompt message is not limited, and any manner that can prompt the user is within the protection scope of the embodiments of the present invention. In one example, the user can be prompted through a pop-up window. As Figure 2 shown, a pop-up window containing the words "Press again to increase volume" as shown in 202 can be displayed on the playback interface 201. The playback interface 201 can also include options such as "Like", "Comment", "Favorite", and "Share" for the user to choose. After the user sees the pop-up window, if they need to continue increasing the volume, they can trigger a volume amplification instruction, such as pressing the volume increase button. In this case, it can be understood that the volume increase button is still pressed when the system volume has reached the maximum value. At this time, the volume values of each audio sampling point can be increased. Thus, when receiving a volume amplification instruction, the volume values of each audio sampling point are increased, and if no volume amplification instruction is received, the operation of the volume values of each audio sampling point is not executed, that is, the operation of increasing the volume of the video itself can be implemented according to the user's operation, which can better meet the user's needs.
[0082] In an optional embodiment, increasing the volume values of each audio sampling point includes: when it is determined that the current operation mode is the elderly mode, increasing the volume values of each audio sampling point; or, when it is determined that the user attribute of the current user account indicates that the current user is an elderly person, increasing the volume values of each audio sampling point.
[0083] In the actual application process, there are some situations where, although the maximum system volume is reached, such as adjusting the volume button to the maximum, there is no need to further increase the volume. For example, the volume button is accidentally adjusted to the maximum, or considering the impact of too loud volume on the ears, the user no longer wishes to increase the volume when the maximum system volume is reached.
[0084] In the embodiments of the present invention, it is found that the hearing of the elderly has declined, but the adjustment of the mobile phone volume only has the volume adjustment of the system volume. After reaching the maximum system volume (the maximum value of the system volume), the elderly generally still hope that the volume can be increased further.
[0085] Based on this, in the embodiments of the present invention, in order to more accurately match the actual needs of users, and because adjusting the volume value in the original audio may cause sound distortion, etc., in order to avoid affecting users, in the embodiments of the present invention, when it is determined that the current operation mode is the elderly mode, the volume values of each audio sampling point are increased; or, when it is determined that the user attribute of the current user account represents that the current user is an elderly person, the volume values of each audio sampling point are increased.
[0086] In one case, when the selected current operation mode is the elderly mode, it is generally considered that the user who is watching the video is an elderly person or has similar needs to the elderly. In this case, in the embodiments of the present invention, the operation of increasing the volume values of each audio sampling point is performed to achieve that when the system volume reaches the maximum, the volume can still be increased by increasing the volume of the video itself.
[0087] Among them, the current operation mode represents the operation mode corresponding to the target mode selection option or function option selected by the user.
[0088] For example, when the video playback client opens the user interaction interface, it can display mode selection options. These mode selection options are for the user to select the operation mode (such as the youth mode, the elderly mode, etc.). The user can select the mode selection option of the elderly mode from the displayed mode selection options. At this time, it can be determined that the current operation mode is the elderly mode.
[0089] Or, when the video playback client opens the user interaction interface, it can display multiple function options. The multiple function options can include the function option of "enlarging the font size". When it is detected that the function option of "enlarging the font size" is operated, it is considered that the current operation mode is the elderly mode.
[0090] In another case, when the user is watching a video through the video playback client, the user logs in using the registered user account. The user account can correspond to account information, such as membership information (such as whether it is a member, the membership level), user attributes (such as gender, age, information indicating whether it is an elderly person or a youth).
[0091] In an embodiment of the present invention, the user attributes of the current user account can be obtained first, and it can be determined whether the current user is an elderly person according to the user attributes. If it is determined that the user attributes of the current user account indicate that the current user is an elderly person, the volume values of each audio sampling point can be increased.
[0092] In order to reduce the possible sound distortion caused by adjusting the volume value in the original audio, such as preventing the sound from being overexposed, in an embodiment of the present invention, when the volume values of each audio sampling point are amplified by a preset multiple, the following method can be adopted, such as Figure 3 shown:
[0093] S31, determine the initial amplification factor.
[0094] It can be determined according to experience or actual needs, etc. For example, the initial amplification factor is determined to be 1.5, 2, 2.5, etc.
[0095] S32, determine the maximum value and the minimum value among the volume values of each audio sampling point.
[0096] S33, calculate the first product of the maximum value and the initial amplification factor.
[0097] S34, in the case where the first product is greater than the maximum volume value of the device, calculate the first ratio of the maximum volume value of the device to the maximum value, and use the first ratio as the minimum amplification factor.
[0098] The maximum volume value of the device can also be understood as the maximum volume value that the electronic device can reach. Here, the electronic device refers to the device installed with the video playback client. Generally, the maximum volume value of the device is determined by the hardware performance of the electronic device itself. For example, it is determined by the performance of the total speakers of the device.
[0099] S35, calculate the second product of the minimum value and the initial amplification factor.
[0100] S36, in the case where the second product is not greater than the maximum volume value of the device, use the initial amplification factor as the maximum amplification factor.
[0101] S37, according to the minimum amplification factor corresponding to the maximum value and the maximum amplification factor corresponding to the minimum value, determine the amplification factors corresponding to the other volume values. The other volume values refer to the volume values other than the maximum value and the minimum value among the volume values of each audio sampling point.
[0102] Generally, the operating system will not increase the system volume to the maximum volume value that the device can reach (that is, the maximum volume value of the device). That is, the maximum value reached by the system volume is generally less than the maximum volume value of the device.
[0103] In the embodiment of the present invention, when it is monitored that the system volume reaches the maximum value, the volume values of each audio sampling point in the audio of the video segment to be played are increased. And during the increasing process, it is possible to prevent the overexposure of the sound caused by the adjustment of the volume value in the original audio through the Figure 3 method shown. It can also be understood that the highest value that the speaker can reach is limited by the power of the speaker, which is a hardware limitation. In the embodiment of the present invention, the volume can still be adjusted upward after the maximum system volume adjustment multiple is reached. When the maximum power of the speaker is reached or exceeded, there will be popping sound. Therefore, the embodiment of the present invention also provides a mechanism to prevent popping sound, such as the Figure 3 method of the embodiment shown.
[0104] The embodiment of the present invention realizes the prevention of sound overexposure during the process of increasing the volume. Briefly speaking, given an initial amplification multiple, the initial amplification multiple is adjusted based on the volume value of the audio itself (the maximum and minimum volume values adjust the maximum and minimum amplification multiples), and the amplification multiples corresponding to other intermediate volume values are mapped according to the maximum and minimum amplification multiples.
[0105] In one implementation, according to the lowest amplification multiple corresponding to the maximum value and the highest amplification multiple corresponding to the minimum value, the amplification multiples corresponding to other volume values are determined, including:
[0106] Create an initial paradigm, where the initial paradigm represents the relationship that the dependent variable changes with the influence parameter as the independent variable changes; substitute the lowest amplification multiple for the dependent variable when the independent variable X is the maximum value, and substitute the highest amplification multiple for the dependent variable when the independent variable is the minimum value into the initial paradigm, calculate the value of the influence parameter, and substitute the value of the influence parameter into the initial paradigm to obtain the function mapping relationship representing the change of the amplification multiple with the volume;
[0107] For each other volume value, substitute the other volume value into the function mapping relationship to obtain the amplification multiple corresponding to the other volume value.
[0108] Among them, the function mapping relationship can be linear or non - linear.
[0109] S38, amplify the maximum value according to the lowest amplification multiple, amplify the minimum value according to the highest amplification multiple, and amplify other volume values according to the amplification multiples corresponding to the other volume values respectively.
[0110] The so-called over-explosion means that the sound exceeds the highest value that an electronic device such as a mobile phone can reach (the maximum volume value of the device). Thus, when the video playback client in the electronic device plays audio and video, it can only play at this highest value. If, during the process of magnifying the volume value of each audio sampling point by a preset multiple, only the amplitude of the PCM data, that is, the volume value, is directly doubled, it is possible that the values of some parts directly reach the highest value, resulting in sound distortion.
[0111] For example Figure 4 Show a curve of an audio segment. The abscissa of this curve is each audio sampling point, and the ordinate is the amplitude of the PCM data, that is, the volume value.
[0112] Regarding Figure 4 , if the volume value is directly magnified by 2 times, assuming the maximum value of the volume value is 630, then since some values exceed 630 after being doubled, it can only be played at 630, resulting in the curve becoming Figure 5 the curve shown. It can be seen that some wave peaks are flattened, that is, sound distortion is caused.
[0113] In order to improve Figure 5 the effect of the flattened wave peaks shown, that is, to ensure that there is no distortion after magnifying the amplitude (volume value) of the PCM data, the embodiments of the present invention use a dynamic method to calculate the magnification factor and perform volume amplification. For example Figure 6 shown, it ensures that there is no distortion after audio amplification. Among them, the dynamic method to calculate the magnification factor is also the calculation method shown above Figure 3 .
[0114] To more clearly illustrate the method shown in the embodiments of the present invention Figure 3 , the embodiments of the present invention are described in detail with the following examples.
[0115] For example, an audio segment (that is, the above-mentioned audio) is obtained, and the audio is decoded. The volume values of each audio sampling point obtained are as follows: [260, 280, 320, 310, 350, 260, 210, 290, 270, 250], specifically as Figure 4 shown.
[0116] By comparison, it is known that the highest point of the volume value (the maximum value among the volume values of each audio sampling point) is 350, and the lowest point (the minimum value among the volume values of each audio sampling point) is 210;
[0117] Assume that the maximum volume value that the device can amplify to (the maximum volume value of the device) is 630, and the desired magnification factor is 2 times (the initial magnification factor);
[0118] The highest volume value of this audio (the maximum value among the volume values of each audio sample point) is 350. It can be seen that 350 x 2 = 700, and 700 is greater than 630. Then, the highest volume value of 350 can only be amplified to 630. By division, it can be known that 350 amplified by 1.8 times is 630. Then, the lowest amplification multiple (lowest magnification) of this audio is 1.8;
[0119] While the lowest point (the minimum value among the volume values of each audio sample point) is 210, and its 2 times is 420, which does not exceed 630. Then its amplifiable multiple is 2. Through the amplification multiples corresponding to the highest point and the lowest point above, it is known that the amplification multiple of this audio is between 1.8 and 2.
[0120] At this time, a corresponding relationship is used to represent how to obtain a function that maps to the multiple from the audio. With this function, the amplification multiples of other points (260, 280, 320, 310, 260, 290, 270, 250) can be calculated. This function can be curved or straight.
[0121] For example, this multiple relationship is defined by a linear function, so that it will not have too much impact on the audio curve. The normal form of the linear curve is aX + b = Y, where X is the volume value and Y is the amplification multiple.
[0122] In addition, through the above process, it can be determined that when X is 350, the corresponding Y is 1.8, and when Y is 210, the corresponding Y is 2. Then, by substituting the known conditions into the normal form, such a system of equations can be obtained:
[0123] 350a + b = 1.8;
[0124] 210a + b = 2;
[0125] In this way, by solving the system of equations, a and b in this system of equations can be solved: a = -1 / 700, b = 2.3;
[0126] Then the normal form is: (-1 / 700)X + 2.3 = Y.
[0127] The normal form obtained here is the above-mentioned function mapping relationship.
[0128] Thus, through the equation (-1 / 700)X + 2.3 = Y, the multiples corresponding to other volume values (260, 280, 320, 310, 350, 260, 210, 290, 270, 250) can be obtained as (1.92, 1.9, 1.84, 1.86, 1.8, 1.93, 2, 1.89, 1.91, 1.94). By multiplying the volume values by the amplification factors, the amplified volume values are: (501, 532, 590, 576, 630, 501, 420, 547, 517, 486), as Figure 6 shown.
[0129] Generally speaking, before sending the PCM data of a section of audio to the sound card, analyze the PCM data of the current section of audio in the above-mentioned manner. In this way, a function can be calculated to map the amplification factors corresponding to the volume values of each video sampling point in this section of audio. The function can be linear or non-linear and can be adjusted specifically. Compared with Figure 5 , it can be seen that Figure 6 this amplified curve can also ensure the curve characteristics of the original audio, thus solving the problems of sound explosion and audio distortion.
[0130] The following uses a specific example to elaborate in detail on the volume adjustment method provided by the embodiments of the present invention.
[0131] The video playback client can specifically be a video - type APP (Application). This APP implements the volume adjustment method provided by the embodiments of the present invention.
[0132] Generally speaking, what needs to be achieved is that as a video - type APP, when playing a video, it can still increase the volume when the system volume is adjusted to the maximum by increasing the volume of the video itself.
[0133] As Figure 7 shown, the APP contains two functional modules: the upper - layer application and the audio decoder, and the audio decoder interacts with the system player.
[0134] Upper - layer application: Monitor the system volume and be responsible for the interaction work of the application;
[0135] Audio decoder: Responsible for decoding video work in the APP, controlled by the upper - layer application, and whether to increase the amplitude of the PCM data;
[0136] System player: An electronic device, such as the system player in a mobile phone, to which the decoded audio data is sent for playback.
[0137] After the audio in the video is digitized, the volume can be represented separately as the amplitude of the PCM data. This is the value in the video itself. In the embodiments of the present invention, when the video is played, after decoding the amplitude of the PCM data, a certain amount can be added to this amplitude and then sent to the sound card for playback, so that the viewer can hear the audio with a louder volume than the original video.
[0138] As Figure 8 shown, it includes: audio playback; decoding into PCM data; determining whether the current system volume is set to the maximum; if so, after adding a certain value n to the amplitude of the PCM data, where n represents the increased amplitude, the PCM data including the increased value is sent to the sound card for playback; if the current system volume is not set to the maximum, the decoded PCM data is directly sent to the sound card for playback.
[0139] After the video starts playing, monitor the user's volume adjustment behavior. When the system volume reaches the maximum, a pop-up window can be used to prompt the user. For example, use the pop-up window as shown above Figure 2 to prompt the user. After the user sees the pop-up window, if they need to continue increasing the volume, they can trigger a volume amplification instruction, such as pressing the volume increase button. In this case, it can be understood that the volume increase button is still pressed when the system volume has reached the maximum value. At this time, the volume values of each audio sampling point can be increased. In this way, when the volume amplification instruction is received, the volume values of each audio sampling point are increased, and if the volume amplification instruction is not received, the operation of the volume values of each audio sampling point is not executed, that is, the operation of increasing the volume of the video itself can be realized according to the user's operation.
[0140] Among them, the operation of monitoring the user's volume adjustment behavior and prompting the user through a pop-up window when the system volume reaches the maximum can be implemented by the above-mentioned upper-layer application module.
[0141] When it is detected that the volume increase button is still pressed when the system volume has reached the maximum value, that is, when the user triggers the above-mentioned volume amplification instruction, it can be understood that the volume increase function is enabled. After this function is enabled, before the audio data decompressed by the player engine is sent to the system player for playback, the amplitude of the decompressed PCM data is increased by a certain amount and then sent to the system player for playback.
[0142] Among them, the player engine can be the above-mentioned audio decoder, and the system player can specifically be the sound card.
[0143] As analyzed above, in the embodiments of the present invention, the volume values of each audio sampling point can be increased when it is determined that the current operation mode is the elderly mode; or, when it is determined that the user attribute of the current user account represents that the current user is an elderly person, the volume values of each audio sampling point can be increased.
[0144] That is, when the current operation mode is the elderly mode or the current user is an elderly user, the function of increasing the volume when the system volume is adjusted to the maximum is realized by increasing the volume of the video itself. In this way, the new interaction form combined with the new volume increase method brings convenience to elderly users and can improve the satisfaction of elderly users with the use of the APP.
[0145] Corresponding to the volume adjustment method provided in the above embodiment, the embodiment of the present invention further provides a volume adjustment device, which is applied to a video playback client, such as Figure 9 shown, including:
[0146] An increasing module 901, configured to decode the audio of the video segment to be played when it is monitored that the system volume reaches the maximum value, obtain the volume values of each audio sampling point, and increase the volume values of each audio sampling point, where the system volume is the volume adjusted through the software system, and the system volume reaching the maximum value means the maximum volume value that the software system can control;
[0147] A sending module 902, configured to send the increased volume values of each audio sampling point to the system player, so that the system player performs audio and video playback based on the adjusted volume values of each audio sampling point.
[0148] Optionally, the increasing module 901 is specifically configured to add a preset value to the volume value of each audio sampling point; or, magnify the volume value of each audio sampling point by a preset multiple.
[0149] Optionally, the increasing module 901 is specifically configured to determine an initial magnification factor; determine the maximum value and the minimum value among the volume values of each audio sampling point; calculate a first product of the maximum value and the initial magnification factor; in the case where the first product is greater than the maximum volume value of the device, calculate a first ratio of the maximum volume value of the device to the maximum value, and use the first ratio as the minimum magnification factor, where the maximum volume value of the device represents the maximum volume value that the electronic device installed with the video playback client can reach, and the maximum volume value of the device is determined by the hardware performance of the electronic device itself; calculate a second product of the minimum value and the initial magnification factor; in the case where the second product is not greater than the maximum volume value of the device, use the initial magnification factor as the maximum magnification factor; determine the magnification factors corresponding to other volume values according to the minimum magnification factor corresponding to the maximum value and the maximum magnification factor corresponding to the minimum value, where the other volume values represent the volume values other than the maximum value and the minimum value among the volume values of each audio sampling point; magnify the maximum value according to the minimum magnification factor, magnify the minimum value according to the maximum magnification factor, and magnify the other volume values according to the magnification factors corresponding to the other volume values respectively.
[0150] Optionally, the amplification module 901 is specifically configured to create an initial paradigm, where the initial paradigm represents the relationship in which the dependent variable changes with the influence parameter as the independent variable changes; when the independent variable X is at its maximum value, the dependent variable is at the lowest amplification factor, and when the independent variable is at its minimum value, the dependent variable is at the highest amplification factor. Substitute these values into the initial paradigm to calculate the value of the influence parameter, and then substitute the value of the influence parameter into the initial paradigm to obtain a function mapping relationship representing how the amplification factor changes with the volume. For each other volume value, substitute the other volume value into the function mapping relationship to obtain the corresponding amplification factor for that other volume value.
[0151] Optionally, the amplification module 901 is specifically configured to increase the volume value of each audio sampling point when it is determined that the current operation mode is the elderly mode, where the current operation mode represents the operation mode corresponding to the target mode selection option or function option selected by the user; or, when it is determined that the user attribute of the current user account indicates that the current user is an elderly person, increase the volume value of each audio sampling point.
[0152] Optionally, the volume value of each audio sampling point is represented by the amplitude of Pulse Code Modulation (PCM) data.
[0153] Optionally, the apparatus further includes:
[0154] A display module, configured to display a prompt message when it is monitored that the system volume reaches the maximum value, where the prompt message is used to prompt the user that the volume can be further increased;
[0155] The amplification module 901 is specifically configured to increase the volume value of each audio sampling point in response to receiving a volume amplification instruction.
[0156] An embodiment of the present invention further provides an electronic device, as Figure 10 shown, including a processor 1001, a communication interface 1002, a memory 1003, and a communication bus 1004. Among them, the processor 1001, the communication interface 1002, and the memory 1003 communicate with each other through the communication bus 1004;
[0157] The memory 1003 is used to store a computer program;
[0158] The processor 1001, when executing the program stored on the memory 1003, implements the above-mentioned volume adjustment method.
[0159] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, only a thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0160] The communication interface is used for communication between the above terminal and other devices.
[0161] The memory can include a Random Access Memory (RAM), and can also include a non-volatile memory, such as at least one disk memory. Optionally, the memory can also be at least one storage device located far from the aforementioned processor.
[0162] The above-mentioned processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0163] In another embodiment provided by the present invention, a computer-readable storage medium is also provided. A computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the volume adjustment method described in any one of the above embodiments is implemented.
[0164] In another embodiment provided by the present invention, a computer program product containing instructions is also provided. When it runs on a computer, the computer is caused to execute the volume adjustment method described in any one of the above embodiments.
[0165] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)).
[0166] It should be noted that in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including", or any other variation thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or device that includes a series of elements includes not only those elements but also other elements not expressly listed, or elements that are inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "including one..." does not exclude the presence of additional identical elements in the process, method, article, or device that includes the element.
[0167] Each embodiment in this specification is described in a related manner. The same or similar parts among the embodiments can be referred to each other, and the differences between each embodiment and other embodiments are emphasized. In particular, for the embodiments of the device, electronic device, computer-readable storage medium, and computer program product, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments.
[0168] The above are only the preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention are all included within the protection scope of the present invention.
Claims
1. A volume adjustment method, characterized in that: Applicable to video playback clients, including: When it is monitored that the system volume reaches a maximum value, the audio of the video segment to be played is decoded to obtain the volume value of each audio sampling point, and the volume value of each audio sampling point is increased, wherein the system volume is the volume adjusted by the software system setting, and the system volume reaching a maximum value indicates the maximum volume that can be controlled by the software system; The increased volume value of each audio sampling point is sent to a system player, so that the system player plays audio and video based on the adjusted volume value of each audio sampling point.
2. The method according to claim 1, characterized in that: Increasing the volume value of each audio sampling point includes: Add a preset value to the volume value of each audio sampling point; or, Amplify the volume value of each audio sampling point by a preset multiple.
3. The method according to claim 2, characterized in that The step of amplifying the volume value of each audio sampling point by a preset multiple includes: Determine the initial magnification; Determine the maximum and minimum volume values of each audio sampling point; Calculating a first product of the maximum value and the initial magnification; When the first product is greater than the maximum volume value of the device, a first ratio of the maximum volume value of the device to the maximum value is calculated, and the first ratio is used as the minimum magnification factor, wherein the maximum volume value of the device represents the maximum volume value that can be reached by the electronic device on which the video playback client is installed, and the maximum volume value of the device is determined by the hardware performance of the electronic device itself; Calculating a second product of the minimum value and the initial magnification; When the second product is not greater than the maximum volume value of the device, the initial amplification factor is used as the maximum amplification factor; Determine, according to the lowest magnification factor corresponding to the maximum value and the highest magnification factor corresponding to the minimum value, magnification factors corresponding to other volume values respectively, wherein the other volume values represent volume values of the volume values of each audio sampling point other than the maximum value and the minimum value; The maximum value is amplified according to the lowest amplification factor, the minimum value is amplified according to the highest amplification factor, and the other volume values are amplified according to the amplification factors corresponding to the other volume values.
4. The method according to claim 3, characterized in that The determining, according to the lowest magnification factor corresponding to the maximum value and the highest magnification factor corresponding to the minimum value, magnification factors corresponding to other volume values respectively includes: Creating an initial paradigm, wherein the initial paradigm represents the relationship between the dependent variable and the change of the influencing parameter due to the change of the independent variable; Substituting the independent variable X as the maximum value and the dependent variable as the minimum amplification factor into the initial normal form, and substituting the independent variable X as the minimum value and the dependent variable as the maximum amplification factor into the initial normal form, calculating the value of the influencing parameter, and substituting the value of the influencing parameter into the initial normal form to obtain a function mapping relationship representing the change of the amplification factor with the volume; For each other volume value, the other volume value is substituted into the function mapping relationship to obtain the amplification factor corresponding to the other volume value.
5. The method according to claim 1, characterized in that Increasing the volume value of each audio sampling point includes: When it is determined that the current operation mode is the elderly mode, the volume value of each audio sampling point is increased, and the current operation mode represents the operation mode corresponding to the target mode selection option or function option selected by the user; or, When it is determined that the user attribute of the current user account indicates that the current user is an elderly person, the volume value of each audio sampling point is increased.
6. The method according to claim 1, characterized in that The volume value of each audio sampling point is represented by the amplitude of pulse code modulation PCM data.
7. The method according to any one of claims 1 to 6, characterized in that: When it is detected that the system volume reaches a maximum value, the method further includes: Displaying a prompt message, wherein the prompt message is used to prompt the user that the volume can be further increased; Increasing the volume value of each audio sampling point includes: In response to receiving the volume amplification instruction, the volume value of each audio sampling point is increased.
8. A volume adjustment device, characterized in that: Applicable to video playback clients, including: an increasing module, for decoding the audio of the video segment to be played, obtaining the volume value of each audio sampling point, and increasing the volume value of each audio sampling point when the system volume reaches the maximum value, wherein the system volume is the volume adjusted by the software system setting, and the system volume reaching the maximum value indicates the maximum volume that can be controlled by the software system; The sending module is used to send the increased volume value of each audio sampling point to the system player, so that the system player plays audio and video based on the adjusted volume value of each audio sampling point.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 7 when executing a program stored in a memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 7 are implemented.