Multimedia file playing method and its device

By calculating the target gain value, the volume value of the multimedia file is automatically adjusted, which solves the problem of unstable volume during switching and improves user convenience.

CN114879929BActive Publication Date: 2025-06-03VIVO MOBILE COMM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210372666.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-11
Publication Date
2025-06-03
Estimated Expiration
2042-04-11

AI Technical Summary

Technical Problem

When users switch multimedia files, the volume is unstable and needs to be adjusted manually, resulting in a decrease in the convenience of playing multimedia files.

Method used

By obtaining the volume value of the multimedia file, calculating the target gain value based on the reference volume value and the initial gain value, and automatically adjusting the volume value so that it is within the dynamic range centered on the reference volume value.

Benefits of technology

When switching multimedia files, the volume value is automatically adjusted, reducing user manual operations, and improving the convenience of playing multimedia files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114879929B_ABST
    Figure CN114879929B_ABST
Patent Text Reader

Abstract

The present application provides a method and apparatus for playing a multimedia file, belonging to the technical field of audio and video processing. The method includes: obtaining a first volume value corresponding to a target multimedia file to be played; determining a target gain value corresponding to the target multimedia file based on a preset reference volume value, a preset initial gain value, and the first volume value; adjusting the first volume value based on the target gain value to obtain a second volume value; and playing the target multimedia file based on the second volume value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the technical field of audio - video processing, and particularly relates to a method and apparatus for playing multimedia files. Background Art

[0002] With the popularization of intelligent devices, more and more users use electronic devices for entertainment activities such as listening to music, watching movies, or swiping short videos.

[0003] However, when users use electronic devices to play multimedia files, the volume information corresponding to each multimedia file is different. After the user switches multimedia files, the volume of the next played multimedia file may be too high or too low, resulting in an unstable volume value of the played multimedia file. This requires the user to manually adjust the volume through relatively cumbersome operations, thereby reducing the convenience of using electronic devices to play multimedia files. Summary of the Invention

[0004] The purpose of the embodiments of this application is to provide a method and apparatus for playing multimedia files, which can solve the problem that it is not convenient for users to play multimedia files using electronic devices.

[0005] In a first aspect, the embodiments of this application provide a method for playing multimedia files, and the method includes:

[0006] Obtain a first volume value corresponding to a target multimedia file to be played;

[0007] Based on a preset reference volume value, a preset initial gain value, and the first volume value, determine a target gain value corresponding to the target multimedia file;

[0008] Adjust the first volume value corresponding to the target multimedia file based on the target gain value to obtain a second volume value; the second volume value is within a dynamic range centered on the reference volume value;

[0009] Play the target multimedia file based on the second volume value.

[0010] In a second aspect, the embodiments of this application provide a multimedia file playing apparatus, and the apparatus includes:

[0011] An obtaining module, configured to obtain a first volume value corresponding to a target multimedia file to be played;

[0012] A determining module, configured to determine a target gain value corresponding to the target multimedia file based on a preset reference volume value, a preset initial gain value, and the first volume value;

[0013] An adjustment module, configured to adjust a first volume value corresponding to the target multimedia file based on the target gain value to obtain a second volume value; the second volume value is within a dynamic range centered on the reference volume value;

[0014] A playback module, configured to play the target multimedia file based on the second volume value.

[0015] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored on the memory and executable on the processor. When the program or instruction is executed by the processor, the steps of the method described in the first aspect are implemented.

[0016] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0017] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is configured to run a program or instruction to implement the method described in the first aspect.

[0018] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.

[0019] In the embodiments of the present application, a first volume value corresponding to a target multimedia file to be played is obtained; based on a preset reference volume value, a preset initial gain value, and the first volume value, a target gain value corresponding to the target multimedia file is determined; wherein, the above-mentioned reference volume value is used to determine the dynamic range where the adjusted volume value is located. Then, the target gain value is used to adjust the first volume value to obtain a second volume value, and the second volume value is within a dynamic range centered on the reference volume value. It should be understood that the above-mentioned second volume value is the volume value of the switched multimedia file, so as to ensure that the volume value of the multimedia file in the playing state is in a stable state during the process of switching multimedia files. In this way, during the process of switching multimedia files, the user does not need to manually adjust the volume corresponding to the multimedia file, reducing the operations of the user during the process of playing multimedia files and improving the convenience of the user in playing multimedia files. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 is a flowchart of a multimedia file playback method provided by an embodiment of the present application;

[0021] Figure 2It is one of the application scenario diagrams of the multimedia file playing method provided by the embodiments of the present application;

[0022] Figure 3a It is the voice time-domain waveform diagram of the multimedia file playing method provided by the embodiments of the present application;

[0023] Figure 3b It is the voice detection result diagram of the multimedia file playing method provided by the embodiments of the present application;

[0024] Figure 3c It is the voice spectrogram of the multimedia file playing method provided by the embodiments of the present application;

[0025] Figure 4 It is the second application scenario diagram of the multimedia file playing method provided by the embodiments of the present application;

[0026] Figure 5 It is the first application flow chart of the multimedia file playing method provided by the embodiments of the present application;

[0027] Figure 6 It is the second application flow chart of the multimedia file playing method provided by the embodiments of the present application;

[0028] Figure 7 It is the structure diagram of the multimedia file playing device provided by the embodiments of the present application;

[0029] Figure 8 It is the structure diagram of the electronic device provided by the embodiments of the present application;

[0030] Figure 9 It is the hardware structure diagram of the electronic device provided by the embodiments of the present application. Detailed implementation manners

[0031] Next, the technical solutions in the embodiments of the present application will be clearly described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.

[0032] The terms "first", "second", etc. in the description and claims of this application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of this application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same category, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the description and claims means at least one of the connected objects, and the character " / ", generally represents an "or" relationship between the associated objects before and after.

[0033] The following will, with reference to the accompanying drawings, through specific embodiments and their application scenarios, elaborate in detail on the multimedia file playback method provided by the embodiments of this application.

[0034] Please refer to Figure 1 , Figure 1 which is a flowchart of the multimedia file playback method provided by the embodiments of this application. The multimedia file playback method provided by the embodiments of this application includes the following steps:

[0035] S101, obtain a first volume value corresponding to a target multimedia file to be played.

[0036] It should be understood that the multimedia file playback method provided by the embodiments of this application can be applied to a video application or an audio-video application installed on an electronic device, and no specific limitation is made here.

[0037] Taking the multimedia file playback method applied to a short video application as an example, as Figure 2 shown, a touch switch for "real-time volume adjustment" can be added to the settings interface of the short video application. If the touch switch is in the on state, the multimedia file playback method provided by the embodiments of this application is used to play the video file.

[0038] In this step, when the multimedia file playback method is applied to a video application, the above-mentioned target multimedia file is a video file to be played. Optionally, the audio signal corresponding to the video file can be framed every 10 to 20 milliseconds, and short-time processing is performed on each frame of the audio signal to ensure the stability and real-time performance of the audio signal. Among them, the above-mentioned short-time processing includes the operation steps of framing, windowing, and Fourier transform of the audio signal.

[0039] In this step, the above-mentioned first volume value can be the volume value corresponding to the audio signal including human voices in the target multimedia file. Optionally, a Voice Activaty Detection (VAD) algorithm can be used to extract the human voice part in the audio signal corresponding to the target multimedia file.

[0040] For ease of understanding, please refer to Figures 3a to 3c , Figure 3a which shows the speech time-domain waveform diagram of the audio signal corresponding to the target multimedia file. By using the VAD algorithm to extract the human voice part in the audio signal corresponding to the target multimedia file, the audio signal corresponding to the first volume value can be obtained. Marking the human voice part in the above audio signal as 1 and the non-human voice part as 0, the Figure 3b shown speech detection result diagram and Figure 3c shown speech spectrogram can be obtained.

[0041] S102. Based on a preset reference volume value, a preset initial gain value, and the first volume value, determine the target gain value corresponding to the target multimedia file.

[0042] In this step, the video application can play a video file, receive an instruction from the user to adjust the volume of the video file, and determine the adjusted volume of the video file as the above-mentioned reference volume value.

[0043] Optionally, as Figure 4 shown, a pop-up window is displayed on the setting interface of the video application, and the content of the pop-up window is "Confirm that this volume is the standard playback volume?" If a touch instruction for the "OK" control is received, the adjusted volume of the video file is determined as the above-mentioned reference volume value.

[0044] An alternative implementation is that it is possible to receive the volume value input by the user through a touch operation or other types of operations, and determine this volume value as the reference volume value.

[0045] The above initial gain value is the relevant parameter value for the video application to perform gain on the first volume value. It should be understood that since the first volume value corresponding to each multimedia file may be different, the volume value corresponding to the multimedia file obtained by performing gain on the first volume value using the initial gain value may also be different.

[0046] In this step, based on the above first volume value, preset reference volume value, and preset initial gain value, the target gain value corresponding to the target multimedia file can be determined. For the specific implementation manner of how to determine the target gain value, please refer to the subsequent embodiments.

[0047] S103. Adjust the first volume value based on the target gain value to obtain a second volume value.

[0048] As described above, the audio signal corresponding to the target multimedia file is taken as one frame every 10 to 20 milliseconds. In this step, as Figure 5As shown, the target gain value corresponding to each frame of the audio signal can be calculated, and the automatic gain control (AGC) algorithm and the target gain value are used to perform gain on the corresponding audio signal to adjust the first volume value corresponding to the target multimedia file to obtain the second volume value. Among them, Figure 5 "a piece of data" in

[0049] can be understood as one frame of the audio signal, "gain coefficient" can be understood as the target gain value, and "peak value" can be understood as the maximum volume value after gain on the first volume value.

[0050] It should be understood that in order to ensure the stability of the volume value, the above second volume value is within the dynamic range centered on the reference volume value. Specifically, the first volume value can be adjusted by the target gain value to obtain the second volume value, and the second volume value is made to be within the dynamic range centered on the reference volume value.

[0051] S104, play the target multimedia file based on the second volume value.

[0052] In this step, after adjusting the first volume value corresponding to the target multimedia file, play the target multimedia file according to the second volume value, so as to achieve the effect of automatically adjusting the volume during the playback of the multimedia file.

[0053] In the embodiment of the present application, the first volume value corresponding to the target multimedia file to be played is obtained; based on the preset reference volume value, the preset initial gain value and the first volume value, the target gain value corresponding to the target multimedia file is determined; among them, the above reference volume value is used to determine the dynamic range where the adjusted volume value is located. Furthermore, the first volume value is adjusted by using the target gain value to obtain the second volume value, and the second volume value is made to be within the dynamic range centered on the reference volume value. It should be understood that the above second volume value is the volume value of the switched multimedia file, so as to ensure that the volume value of the multimedia file in the playing state is in a stable state during the switching of the multimedia file. In this way, during the switching of the multimedia file, the user does not need to manually adjust the volume corresponding to the multimedia file, reducing the operations of the user during the playback of the multimedia file and improving the convenience of the user in playing the multimedia file.

[0054] Next, the technical solution for determining the target gain value corresponding to the target multimedia file is specifically described:

[0055] Optionally, determining the target gain value corresponding to the target multimedia file based on the preset reference volume value, the preset initial gain value, and the first volume value includes:

[0056] Determine a first gain parameter value according to the first volume value and the reference volume value;

[0057] Determine the target gain value corresponding to the target multimedia file according to the first gain parameter value, the first volume value, the reference volume value, and the preset initial gain value.

[0058] The above first gain parameter value is used to characterize the adjustment speed of the first volume value. In this embodiment, the first gain parameter value can be determined according to the first volume value and the reference volume value. For the specific technical solution of how to determine the first gain parameter value, please refer to the subsequent embodiments.

[0059] After obtaining the first gain parameter, the first gain parameter value, the first volume value, the reference volume value, and the preset initial gain value can be substituted into the improved gain calculation formula to calculate the target gain value corresponding to the target multimedia file. For the specific technical solution of how to determine the target gain value, please refer to the subsequent embodiments.

[0060] Next, the technical solution for determining the first gain parameter value will be specifically described:

[0061] Optionally, determining the first gain parameter value according to the first volume value and the reference volume value includes:

[0062] Calculate a first difference between a first value and a second value;

[0063] Determine the gain duration according to the numerical range of the first difference;

[0064] Determine the maximum value of a third value and a preset fourth value as the first gain parameter value.

[0065] The above first value is the logarithmic function value corresponding to the first volume value, and the above second value is the logarithmic function value corresponding to the reference volume value. Specifically, the first difference between the first value and the second value can be determined by the following formula:

[0066] H = log(x(n)) - log(y 0 (n))

[0067] where H is the first difference, x(n) is the first volume value, log(x(n)) is the first value, y 0 (n) is the reference volume value, and log(y 0 (n)) is the second value.

[0068] After calculating the first difference between the first value and the second value, the gain duration can be determined based on the numerical range in which the first difference lies, where the gain duration is used to characterize the duration during which the first volume value is increased during the process of adjusting the first volume value.

[0069] In this embodiment, a fourth value is also preset. The fourth value is an empirical value. After determining the gain duration, the maximum value between the third value and the preset fourth value is determined as the first gain parameter value. Among them, the third value is used to characterize the preset multiple of the gain duration. Optionally, the preset multiple can be 4 times, and the fourth value can be 1. In this case, the first gain parameter value can be determined by the following formula:

[0070] a = max(4t, 1)

[0071] Among them, a is the first gain parameter box, t is the gain duration, 4t is the third value, and 1 is the fourth value.

[0072] Optionally, determining the gain duration according to the numerical range of the first difference includes:

[0073] In the case where the first difference is less than the first preset threshold, the gain duration is determined to be the first preset duration;

[0074] In the case where the first difference is greater than or equal to the first preset threshold and less than or equal to the second preset threshold, the gain duration is determined to be the second preset duration;

[0075] In the case where the first difference is greater than the second preset threshold, the gain duration is determined to be the third preset duration.

[0076] In this embodiment, a first preset threshold and a second preset threshold are preset, and the gain duration is determined based on the magnitude relationship among the first difference, the first preset threshold, and the second preset threshold.

[0077] The above first preset threshold, second preset threshold, first preset duration, second preset duration, and third preset duration are all empirical values. Optionally, the first preset threshold is 5, the second preset threshold is 20, the first preset duration is 4 seconds, the second preset duration is 1 second, and the third preset duration is 0.5 millimeters. In this case, the gain duration can be determined by the following formula:

[0078] t = 4s, 5 > H

[0079] t = 1s, 20 ≥ H ≥ 5

[0080] t = 0.5ms, H > 20

[0081] Among them, t is the gain duration and H is the first difference.

[0082] It should be understood that the above first preset threshold, second preset threshold, first preset duration, second preset duration, and third preset duration can also be other values, which are not specifically limited herein.

[0083] Optionally, determining the target gain value corresponding to the target multimedia file according to the first gain parameter value, the first volume value, the reference volume value, and the preset initial gain value includes:

[0084] Performing a multiplication operation on the first gain parameter value and a fifth value to obtain a sixth value;

[0085] Determining the sum value between the sixth value and the logarithmic function value corresponding to the initial gain value as an eighth value;

[0086] Performing an inverse logarithmic function operation on the eighth value to obtain the target gain value.

[0087] The existing gain calculation formula is:

[0088]

[0089] where A(n + 1) is the target gain value, a is the first gain parameter value, A 0 is the preset expected gain, A in is the signal amplitude, and A(n) is the initial gain value.

[0090] It should be understood that in the process of calculating the target gain value using the existing gain calculation formula, multiple multiplication operations are required, resulting in a relatively long operation time for calculating the target gain value.

[0091] In this embodiment, the fifth value is the difference between the logarithmic function value corresponding to the reference volume value and a seventh value, the seventh value is the logarithmic function value corresponding to the target absolute value, and the target absolute value is the absolute value of the multiplication result of the initial gain value and the first volume value. The eighth value is the logarithmic function value corresponding to the target gain value.

[0092] Specifically, the following improved gain calculation formula can be used to obtain the eighth value:

[0093] log(A(n + 1)) = log(A(n)) + a[log(y 0 (n)) - log(|A(n)x(n)|)]

[0094] where log(A(n + 1)) is the eighth value, log(A(n)) is the logarithmic function value corresponding to the initial gain value, a[log(y 0(n)) - log(|A(n)x(n)|)] is the sixth value, a is the first gain parameter value, |A(n)x(n)| is the target absolute value, log(|A(n)x(n)|) is the seventh value, log(y 0 (n)) - log(|A(n)x(n)|) is the fifth value.

[0095] As described above, the eighth value is the logarithmic function value corresponding to the target gain value. After obtaining the eighth value, an inverse logarithmic function operation is performed on the eighth value to obtain the target gain value.

[0096] In this embodiment, through the above calculation method, the multiplication steps in the process of calculating the target gain value are reduced, thereby reducing the operation time for calculating the target gain value.

[0097] Optionally, adjusting the first volume value based on the target gain value to obtain a second volume value includes:

[0098] Calculating a second difference between the logarithmic function value corresponding to the target volume value and the fourth value;

[0099] Determining the absolute value of the second difference as the second gain parameter value;

[0100] In the case where the second gain parameter value is less than the third preset threshold, the target gain value is used to adjust the first volume value corresponding to the target multimedia file to obtain a second volume value.

[0101] An alternative implementation is to calculate a second gain parameter value corresponding to the target multimedia file, which is used to represent the adjustment range of the first volume value. In the case where the second gain parameter value is less than the third preset threshold, it means that the adjustment of the first volume value is within a reasonable dynamic range, and then the target gain value is used to adjust the first volume value corresponding to the target multimedia file to obtain a second volume value.

[0102] Specifically, the second difference between the logarithmic function value corresponding to the target volume value and the fourth value. The above target volume value is the volume value after adjusting the first volume value using the target gain value, that is, the second volume value; the above fourth value is the logarithmic function value corresponding to the reference volume value; the absolute value of the second difference is determined as the second gain parameter value. The following formula can be referred to:

[0103] b = |log(y(n)) - log(y 0 (n))|

[0104] where b is the second gain parameter value, log(y(n)) is the logarithmic function value corresponding to the target volume value, log(y 0 (n)) is the fourth value.

[0105] Optionally, since the human ear is more sensitive to intermediate frequency signals between 2 kHz and 5 kHz, and less sensitive to low frequency signals from 0 to 2 kHz and high frequency signals from 5 kHz to 8 kHz, different third preset thresholds can be set in different frequency bands to reduce the hardware cost of the electronic device and improve the effect of the gain algorithm.

[0106] R = 1, 0 KHz < f < 2 KHz

[0107] R = 0.5, 2 KHz ≤ f ≤ 5 KHz

[0108] R = 0.8, 5 KHz < f < 8 KHz

[0109] Wherein, R is the third preset threshold, and f is the frequency band of the audio signal.

[0110] As shown in the above formula, for low frequency signals from 0 to 2 KHz, the third preset threshold is set to 1; for intermediate frequency signals from 2 kHz to 5 kHz, the third preset threshold is set to 0.5; for high frequency signals from 5 kHz to 8 kHz, the third preset threshold is set to 0.8.

[0111] In this embodiment, by calculating the second gain parameter value, when the second gain parameter value is less than the third preset threshold, the target gain value is used to adjust the first volume value corresponding to the target multimedia file, so as to avoid the adjustment of the first volume value exceeding the reasonable dynamic range, thereby improving the accuracy of adjusting the first volume value.

[0112] Another optional implementation manner is to directly use the target gain value to adjust the first volume value corresponding to the target multimedia file after determining the target gain value.

[0113] For the convenience of understanding the overall technical solution, please refer to Figure 6 .

[0114] As Figure 6 shown, detect whether the touch switch of "real-time volume adjustment" is turned on on the short video platform; when the touch switch is turned on, set the reference volume value; perform short-time processing on the target multimedia file to ensure the real-time nature of the voice. Further, extract the human voice part in the audio signal corresponding to the target multimedia file through the VAD algorithm; and determine the first gain parameter value corresponding to the target multimedia file and the third preset threshold characterizing the dynamic range of adjusting the first volume value; determine the target gain value and use the AGC algorithm in combination with the target gain value to perform gain on the first volume value; when the second gain parameter value is less than the third preset threshold, use the target gain value to replace the initial gain value to perform gain on the first volume value.

[0115] The following will combine the accompanying drawings and, through specific embodiments and their application scenarios, provide a detailed description of the multimedia file playback device provided by the embodiments of the present application.

[0116] As Figure 7 shown, the multimedia file playback device 700 includes:

[0117] An acquisition module 701, configured to acquire a first volume value corresponding to a target multimedia file to be played;

[0118] A determination module 702, configured to determine a target gain value corresponding to the target multimedia file based on a preset reference volume value, a preset initial gain value, and the first volume value;

[0119] An adjustment module 703, configured to adjust the first volume value based on the target gain value to obtain a second volume value;

[0120] A playback module 704, configured to play the target multimedia file based on the second volume value.

[0121] Optionally, the determination module 702 is specifically configured to:

[0122] Determine a first gain parameter value according to the first volume value and the reference volume value;

[0123] Determine the target gain value corresponding to the target multimedia file according to the first gain parameter value, the first volume value, the reference volume value, and a preset initial gain value.

[0124] Optionally, the determination module 702 is further specifically configured to:

[0125] Calculate a first difference between a first numerical value and a second numerical value;

[0126] Determine the gain duration according to the numerical range of the first difference;

[0127] Determine the maximum value between a third numerical value and a preset fourth numerical value as the first gain parameter value.

[0128] Optionally, the determination module 702 is further specifically configured to:

[0129] When the first difference is less than a first preset threshold, determine that the gain duration is a first preset duration;

[0130] When the first difference is greater than or equal to the first preset threshold and less than or equal to a second preset threshold, determine that the gain duration is a second preset duration;

[0131] When the first difference is greater than the second preset threshold, determine that the gain duration is a third preset duration.

[0132] Optionally, the determining module 702 is further specifically configured to:

[0133] Perform a multiplication operation on the first gain parameter value and the fifth numerical value to obtain a sixth numerical value;

[0134] Determine the sum value between the sixth numerical value and the logarithmic function value corresponding to the initial gain value as the eighth numerical value;

[0135] Perform an inverse logarithmic function operation on the eighth numerical value to obtain the target gain value.

[0136] Optionally, the adjusting module 703 is specifically configured to:

[0137] Calculate a second difference between the logarithmic function value corresponding to the target volume value and the fourth numerical value;

[0138] Determine the absolute value of the second difference as the second gain parameter value;

[0139] In the case where the second gain parameter value is less than a third preset threshold, use the target gain value to adjust the first volume value corresponding to the target multimedia file to obtain a second volume value.

[0140] In an embodiment of the present application, obtain a first volume value corresponding to a target multimedia file to be played; based on a preset reference volume value, a preset initial gain value, and the first volume value, determine a target gain value corresponding to the target multimedia file; wherein, the above-mentioned reference volume value is used to determine the dynamic range in which the adjusted volume value is located. Furthermore, use the target gain value to adjust the first volume value to obtain a second volume value, and make the second volume value within the dynamic range centered on the reference volume value. It should be understood that the above-mentioned second volume value is the volume value of the switched multimedia file, so as to ensure that the volume value of the multimedia file in the playing state is in a stable state during the process of switching multimedia files. In this way, during the process of switching multimedia files, the user does not need to manually adjust the volume corresponding to the multimedia file, reducing the operations of the user during the process of playing multimedia files and improving the convenience of the user in playing multimedia files.

[0141] The multimedia file playback device in the embodiments of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices other than terminals. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a handheld computer, an in-vehicle electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. It can also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc. The embodiments of the present application do not make specific limitations.

[0142] The multimedia file playback device in the embodiments of the present application can be a device with an operating system. The operating system can be the Android operating system, the iOS operating system, or other possible operating systems. The embodiments of the present application do not make specific limitations.

[0143] The multimedia file playback device provided in the embodiments of the present application can implement Figure 1 each process implemented by the method embodiments. To avoid repetition, it will not be elaborated here.

[0144] Optionally, as Figure 8 shown, the embodiments of the present application further provide an electronic device 800, including a processor 801, a memory 802, a program or instruction stored on the memory 802 and executable on the processor 801. When the program or instruction is executed by the processor 801, it implements each process of the above-mentioned multimedia file playback method embodiment and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.

[0145] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.

[0146] Figure 8 Schematic diagram of the hardware structure of an electronic device for implementing the embodiments of the present application.

[0147] The electronic device 900 includes, but is not limited to, components such as a radio frequency unit 901, a network module 902, an audio output unit 903, an input unit 904, a sensor 905, a display unit 906, a user input unit 907, an interface unit 909, a memory 909, and a processor 910.

[0148] Those skilled in the art can understand that the electronic device 900 may further include a power source (such as a battery) for supplying power to each component. The power source can be logically connected to the processor 910 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. Figure 9 The structure of the electronic device shown does not limit the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0149] Among them, the input unit 904 is further configured to obtain a first volume value corresponding to a target multimedia file to be played;

[0150] The processor 910 is further configured to determine a target gain value corresponding to the target multimedia file based on a preset reference volume value, a preset initial gain value, and the first volume value;

[0151] Adjust the first volume value based on the target gain value to obtain a second volume value;

[0152] The display unit 906 is further configured to play the target multimedia file based on a preset reference volume value, a preset initial gain value, and the first volume value.

[0153] Among them, the processor 910 is further configured to determine a first gain parameter value according to the first volume value and the reference volume value;

[0154] Determine the target gain value corresponding to the target multimedia file according to the first gain parameter value, the first volume value, the reference volume value, and the preset initial gain value.

[0155] Among them, the processor 910 is further configured to calculate a first difference between a first numerical value and a second numerical value;

[0156] Determine the gain duration according to the numerical range of the first difference;

[0157] Determine the maximum value of a third numerical value and a preset fourth numerical value as the first gain parameter value.

[0158] Among them, the processor 910 is further configured to determine that the gain duration is a first preset duration when the first difference is less than a first preset threshold;

[0159] When the first difference is greater than or equal to the first preset threshold and less than or equal to the second preset threshold, determine that the gain duration is the second preset duration;

[0160] When the first difference is greater than the second preset threshold, determine that the gain duration is the third preset duration.

[0161] Wherein, the processor 910 is further configured to perform a multiplication operation on the first gain parameter value and the fifth numerical value to obtain a sixth numerical value;

[0162] Determine the sum value between the sixth numerical value and the logarithmic function value corresponding to the initial gain value as the eighth numerical value;

[0163] Perform an inverse logarithmic function operation on the eighth numerical value to obtain the target gain value.

[0164] Wherein, the processor 910 is further configured to calculate a second difference between the logarithmic function value corresponding to the target volume value and the fourth numerical value;

[0165] Determine the absolute value of the second difference as the second gain parameter value;

[0166] When the second gain parameter value is less than the third preset threshold, use the target gain value to adjust the first volume value corresponding to the target multimedia file to obtain a second volume value.

[0167] In the embodiments of the present application, obtain the first volume value corresponding to the target multimedia file to be played; determine the target gain value corresponding to the target multimedia file based on the preset reference volume value, the preset initial gain value, and the first volume value; wherein, the above-mentioned reference volume value is used to determine the dynamic range in which the adjusted volume value is located. Then use the target gain value to adjust the first volume value to obtain a second volume value, and make the second volume value within the dynamic range centered on the reference volume value. It should be understood that the above-mentioned second volume value is the volume value of the switched multimedia file, so as to ensure that the volume value of the multimedia file in the playing state is in a stable state during the process of switching multimedia files. In this way, during the process of switching multimedia files, the user does not need to manually adjust the volume corresponding to the multimedia file, reducing the operations of the user during the process of playing multimedia files and improving the convenience of the user in playing multimedia files.

[0168] It should be understood that in the embodiments of the present application, the input unit 904 may include a Graphics Processing Unit (GPU) 9041 and a microphone 9042. The GPU 9041 processes the image data of static pictures or videos obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 906 may include a display panel 9061, and the display panel 9071 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 907 includes at least one of a touch panel 9071 and other input devices 9072. The touch panel 9071 is also referred to as a touch screen. The touch panel 9071 may include two parts: a touch detection device and a touch controller. The other input devices 9072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, power on / off keys, etc.), a trackball, a mouse, and a joystick, which will not be elaborated here.

[0169] The memory 909 can be used to store software programs and various data. The memory 909 mainly includes a first storage area for storing programs or instructions and a second storage area for storing data. Among them, the first storage area can store an operating system, applications or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 909 may include a volatile memory or a non-volatile memory, or the memory 909 may include both a volatile memory and a non-volatile memory. Among them, the non-volatile memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash memory. The volatile memory may be a Random Access Memory (RAM), a Static RAM (SRAM), a Dynamic RAM (DRAM), a Synchronous DRAM (SDRAM), a Double Data Rate SDRAM (DDR SDRAM), an Enhanced SDRAM (ESDRAM), a Synch link DRAM (SLDRAM), or a Direct Rambus RAM (DRRAM). The memory 909 in the embodiments of the present application includes, but is not limited to, these and any other suitable types of memories.

[0170] The processor 910 may include one or more processing units; optionally, the processor 910 integrates an application processor and a modem processor. Among them, the application processor mainly processes operations related to the operating system, user interface, application programs, etc., and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above-mentioned modem processor may not be integrated into the processor 910 either.

[0171] The embodiment of the present application further provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it implements each process of the above-mentioned embodiment of the multimedia file playing method and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.

[0172] Among them, the processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disc, etc.

[0173] The embodiment of the present application further provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run a program or instruction to implement each process of the above-mentioned embodiment of the multimedia file playing method and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.

[0174] It should be understood that the chip mentioned in the embodiment of the present application may also be referred to as a system-on-chip, system chip, chip system, or system-on-chip, etc.

[0175] The embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement each process of the above-mentioned embodiment of the multimedia file playing method and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.

[0176] It should be noted that in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or device. Without more limitations, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including such element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, but may also include performing functions in a substantially simultaneous manner or in the reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, the features described with reference to certain examples may be combined in other examples.

[0177] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described example methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to enable a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present application.

[0178] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Those of ordinary skill in the art, under the inspiration of the present application and without departing from the purpose of the present application and the scope protected by the claims, can also make many forms, all of which fall within the protection scope of the present application.

Claims

1. A method for playing a multimedia file, characterized in that, comprising: obtaining a first volume value corresponding to a target multimedia file to be played; determining a target gain value corresponding to the target multimedia file based on a preset reference volume value, a preset initial gain value, and the first volume value; adjusting the first volume value based on the target gain value to obtain a second volume value; the second volume value is within a dynamic range centered on the reference volume value; playing the target multimedia file based on the second volume value; the adjusting the first volume value based on the target gain value to obtain a second volume value includes: calculating a second difference between a logarithmic function value corresponding to a target volume value and a fourth value; the target volume value is a volume value obtained by adjusting the first volume value using the target gain value, and the fourth value is a logarithmic function value corresponding to the reference volume value; determining the absolute value of the second difference as a second gain parameter value; the second gain parameter value is used to characterize the range of adjustment of the first volume value; when the second gain parameter value is less than a third preset threshold, adjusting the first volume value corresponding to the target multimedia file using the target gain value to obtain a second volume value.

2. The method according to claim 1, characterized in that, the determining a target gain value corresponding to the target multimedia file based on a preset reference volume value, a preset initial gain value, and the first volume value includes: determining a first gain parameter value according to the first volume value and the reference volume value; the first gain parameter value is used to characterize the speed of adjusting the first volume value; determining the target gain value corresponding to the target multimedia file according to the first gain parameter value, the first volume value, the reference volume value, and a preset initial gain value.

3. The method according to claim 2, characterized in that, the determining a first gain parameter value according to the first volume value and the reference volume value includes: calculating a first difference between a first value and a second value; the first value is a logarithmic function value corresponding to the first volume value, and the second value is a logarithmic function value corresponding to the reference volume value; determining a gain duration according to the numerical range of the first difference; determining the maximum value of a third value and a preset fourth value as the first gain parameter value; wherein, the third value is used to characterize a preset multiple of the gain duration.

4. The method according to claim 3, characterized in that, the determining a gain duration according to the numerical range of the first difference includes: when the first difference is less than a first preset threshold, determining the gain duration as a first preset duration; when the first difference is greater than or equal to the first preset threshold and less than or equal to a second preset threshold, determining the gain duration as a second preset duration; when the first difference is greater than the second preset threshold, determining the gain duration as a third preset duration.

5. The method according to claim 2, characterized in that, Determining the target gain value corresponding to the target multimedia file according to the first gain parameter value, the first volume value, the reference volume value, and a preset initial gain value includes: Performing a multiplication operation on the first gain parameter value and a fifth numerical value to obtain a sixth numerical value; the fifth numerical value is the difference between the logarithmic function value corresponding to the reference volume value and a seventh numerical value, and the seventh numerical value is the logarithmic function value corresponding to a target absolute value, where the target absolute value is the absolute value of the multiplication result of the initial gain value and the first volume value; Determining the sum value between the sixth numerical value and the logarithmic function value corresponding to the initial gain value as an eighth numerical value; the eighth numerical value is the logarithmic function value corresponding to the target gain value; Performing an inverse logarithmic function operation on the eighth numerical value to obtain the target gain value.

6. A multimedia file playing device, characterized in that, it includes: an acquisition module, configured to acquire a first volume value corresponding to a target multimedia file to be played; a determination module, configured to determine a target gain value corresponding to the target multimedia file based on a preset reference volume value, a preset initial gain value, and the first volume value; an adjustment module, configured to adjust the first volume value corresponding to the target multimedia file based on the target gain value to obtain a second volume value; the second volume value is within a dynamic range centered on the reference volume value; a playing module, configured to play the target multimedia file based on the second volume value; The adjustment module is specifically configured to: calculate a second difference between the logarithmic function value corresponding to the target volume value and a fourth numerical value; the target volume value is the volume value obtained by adjusting the first volume value using the target gain value, and the fourth numerical value is the logarithmic function value corresponding to the reference volume value; determine the absolute value of the second difference as a second gain parameter value; the second gain parameter value is used to characterize the range of adjustment of the first volume value; when the second gain parameter value is less than a third preset threshold, use the target gain value to adjust the first volume value corresponding to the target multimedia file to obtain a second volume value.

7. The device according to claim 6, characterized in that, The determination module is specifically configured to: determine a first gain parameter value according to the first volume value and the reference volume value; the first gain parameter value is used to characterize the speed of adjusting the first volume value; determine the target gain value corresponding to the target multimedia file according to the first gain parameter value, the first volume value, the reference volume value, and a preset initial gain value.

8. The device according to claim 7, characterized in that, The determination module is further specifically configured to: calculate a first difference between a first numerical value and a second numerical value; the first numerical value is the logarithmic function value corresponding to the first volume value, and the second numerical value is the logarithmic function value corresponding to the reference volume value; determine a gain duration according to the numerical range of the first difference; determine the maximum value between a third numerical value and a preset fourth numerical value as the first gain parameter value; Wherein, the third value is used to characterize a preset multiple of the gain duration.

9. The apparatus according to claim 8, wherein, the determining module is further specifically configured to: when the first difference is less than a first preset threshold, determine that the gain duration is a first preset duration; when the first difference is greater than or equal to the first preset threshold and less than or equal to a second preset threshold, determine that the gain duration is a second preset duration; when the first difference is greater than the second preset threshold, determine that the gain duration is a third preset duration.

10. The apparatus according to claim 7, wherein, the determining module is further specifically configured to: perform a multiplication operation on the first gain parameter value and a fifth value to obtain a sixth value; the fifth value is the difference between the logarithmic function value corresponding to the reference volume value and a seventh value, and the seventh value is the logarithmic function value corresponding to the target absolute value, and the target absolute value is the absolute value of the multiplication result of the initial gain value and the first volume value; determine the sum value between the sixth value and the logarithmic function value corresponding to the initial gain value as an eighth value; the eighth value is the logarithmic function value corresponding to the target gain value; perform an inverse logarithmic function operation on the eighth value to obtain the target gain value.

11. An electronic device, wherein, it includes a processor, a memory, and a program or instruction stored on the memory and executable on the processor. When the program or instruction is executed by the processor, the steps of the multimedia file playing method according to any one of claims 1-5 are implemented.

12. A readable storage medium, wherein, a program or instruction is stored on the readable storage medium. When the program or instruction is executed by a processor, the steps of the multimedia file playing method according to any one of claims 1-5 are implemented.

Citation Information

Patent Citations

  • Volume automatic control method and circuit in digital audio field

    CN101459415A

  • Volume adjusting method and volume adjusting device

    CN105450193A