Volume adjustment method, device and storage medium
By comparing and adjusting the frame-level amplitude of audio data, the problem of inconsistency in volume in electronic devices is solved, and the adaptive adjustment and smooth transition of volume are achieved, improving the effect of volume adjustment and user experience.
Patent Information
- Application Number
- CN202011226479.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-04
- Publication Date
- 2024-11-05
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
There are huge differences in the sound played by electronic devices at the same volume, which leads to the inability to hear clearly or excessively high sound sources, and lacks adaptive adjustment methods for volume adjustment.
By obtaining the audio data to be played, dividing it into multi-frame sampled data, comparing the amplitude of each frame of data with the preset range, adjusting data beyond or below the range to the appropriate range, and smoothly adjusting the amplitude of adjacent data according to the preset rules.
It realizes smooth transition adjustment of volume, avoids the influence of playback effects, and improves the stability and user experience of volume adjustment.
Smart Images

Figure CN114442990B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of volume processing, and in particular to a volume adjustment method, device and storage medium. Background Art
[0002] In the related art, sound playback is a very important function of electronic devices. However, due to different sound sources, when electronic devices are at the same amplification ratio, that is, at the same volume, the sounds played by the electronic devices are very different. When the volume of the electronic device is fixed, some sound sources cannot be heard clearly, but the sound played by some sound sources is very loud. Providing a method for adaptively adjusting the volume is an urgent problem to be solved. Summary of the invention
[0003] In order to overcome the problems existing in the related art, the present disclosure provides a volume adjustment method, device and storage medium.
[0004] According to a first aspect of an embodiment of the present disclosure, a volume adjustment method is provided, which is applied to an electronic device, and includes:
[0005] Acquire first audio data of an audio file to be played;
[0006] Dividing the first audio data into a plurality of second audio data;
[0007] Sampling each second audio data among the plurality of second audio data to obtain N frames of sampled data, where N is a positive integer greater than or equal to 1;
[0008] Compare the amplitude of each frame of sampled data in the N frames of sampled data with a preset amplitude range, and determine sampled data whose amplitude exceeds or is lower than the preset amplitude range;
[0009] Determine the second audio data where the sampling data whose amplitude exceeds or is lower than the preset amplitude range is located;
[0010] Determine an adjustment amplitude for reducing or increasing the amplitude of each frame of audio data in the determined second audio data to within the preset amplitude range;
[0011] adjusting the amplitude of each frame of audio data in the determined second audio data according to the adjustment amplitude;
[0012] According to the adjustment amplitude, the amplitude of each frame of audio data in the determined plurality of adjacent second audio data is adjusted according to a preset rule.
[0013] The step of adjusting the amplitude of each frame of audio data in the plurality of adjacent second audio data of the determined second audio data according to a preset rule according to the adjustment amplitude includes:
[0014] According to the adjustment amplitude, the amplitude of each frame of audio data in the first m second audio data of the determined second audio data is decreased or increased according to the first preset adjustment amplitude difference, where m is a positive integer greater than or equal to 1.
[0015] The step of adjusting the amplitude of each frame of audio data in the plurality of adjacent second audio data of the determined second audio data according to a preset rule according to the adjustment amplitude includes:
[0016] According to the adjustment amplitude, the amplitude of each frame of audio data in the determined last n second audio data is decreased or increased according to the second preset adjustment amplitude difference, where n is a positive integer greater than or equal to 1.
[0017] Wherein, the adjustment method further comprises:
[0018] When the determined plurality of adjacent second audio data includes a plurality of sampling data exceeding or below the preset amplitude range, determining the second audio data where the sampling data with the largest amplitude exceeding or below the preset amplitude range is located;
[0019] The second audio data that exceeds or falls below the sampling data with the largest amplitude is taken as the determined second audio data.
[0020] The step of reducing or increasing the amplitude of each frame of audio data in the determined second audio data to an adjustment amplitude within the preset amplitude range includes:
[0021] Determine the maximum amplitude value of each frame of audio data in the determined second audio data;
[0022] The adjusted amplitude of the determined second audio data is determined according to the determined amplitude maximum value.
[0023] Wherein, the durations of the multiple second audio data are equal.
[0024] According to a second aspect of an embodiment of the present disclosure, there is provided a volume adjustment device, comprising:
[0025] An acquisition module is configured to acquire first audio data of an audio file to be played;
[0026] A division module, configured to divide the first audio data into a plurality of second audio data;
[0027] A sampling module is configured to sample each of the plurality of second audio data to obtain N frames of sampled data, where N is a positive integer greater than or equal to 1;
[0028] A determination module is configured to compare the amplitude of each frame of sampled data in the N frames of sampled data with a preset amplitude range, and determine sampled data whose amplitude exceeds or is lower than the preset amplitude range;
[0029] The determination module is configured to determine the second audio data where the sampling data whose amplitude exceeds or is lower than the preset amplitude range is located;
[0030] The determination module is configured to determine an adjustment amplitude for reducing or increasing the amplitude of each frame of audio data in the determined second audio data to within the preset amplitude range;
[0031] an adjustment module, configured to adjust the amplitude of each frame of audio data in the determined second audio data according to the adjustment amplitude;
[0032] The adjustment module is configured to adjust the amplitude of each frame of audio data in the determined plurality of adjacent second audio data according to the adjustment amplitude and a preset rule.
[0033] Wherein, the adjustment module is configured as follows:
[0034] According to the adjustment amplitude, the amplitude of each frame of audio data in the first m second audio data of the determined second audio data is decreased or increased according to the first preset adjustment amplitude difference, where m is a positive integer greater than or equal to 1.
[0035] Wherein, the adjustment module is configured as follows:
[0036] According to the adjustment amplitude, the amplitude of each frame of audio data in the determined last n second audio data is decreased or increased according to the second preset adjustment amplitude difference, where n is a positive integer greater than or equal to 1.
[0037] Wherein, the determination module is configured as follows:
[0038] When the determined plurality of adjacent second audio data includes a plurality of sampling data exceeding or below the preset amplitude range, determining the second audio data where the sampling data with the largest amplitude exceeding or below the preset amplitude range is located;
[0039] The second audio data that exceeds or falls below the sampling data with the largest amplitude is taken as the determined second audio data.
[0040] Wherein, the determination module is configured as follows:
[0041] Determine the maximum amplitude value of each frame of audio data in the determined second audio data;
[0042] The adjusted amplitude of the determined second audio data is determined according to the determined amplitude maximum value.
[0043] Wherein, the durations of the multiple second audio data are equal.
[0044] According to a third aspect of an embodiment of the present disclosure, there is provided a volume adjustment device, comprising:
[0045] processor;
[0046] a memory for storing processor-executable instructions;
[0047] Wherein, the processor is configured to:
[0048] Acquire first audio data of an audio file to be played;
[0049] Dividing the first audio data into a plurality of second audio data;
[0050] Sampling each second audio data among the plurality of second audio data to obtain N frames of sampled data, where N is a positive integer greater than or equal to 1;
[0051] Compare the amplitude of each frame of sampled data in the N frames of sampled data with a preset amplitude range, and determine sampled data whose amplitude exceeds or is lower than the preset amplitude range;
[0052] Determine the second audio data where the sampling data whose amplitude exceeds or is lower than the preset amplitude range is located;
[0053] Determine an adjustment amplitude for reducing or increasing the amplitude of each frame of audio data in the determined second audio data to within the preset amplitude range;
[0054] adjusting the amplitude of each frame of audio data in the determined second audio data according to the adjustment amplitude;
[0055] According to the adjustment amplitude, the amplitude of each frame of audio data in the determined plurality of adjacent second audio data is adjusted according to a preset rule.
[0056] According to a first aspect of an embodiment of the present disclosure, a non-transitory computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of a mobile terminal, the mobile terminal is enabled to perform a volume adjustment method, the method comprising:
[0057] Acquire first audio data of an audio file to be played;
[0058] Dividing the first audio data into a plurality of second audio data;
[0059] Sampling each second audio data among the plurality of second audio data to obtain N frames of sampled data, where N is a positive integer greater than or equal to 1;
[0060] Compare the amplitude of each frame of sampled data in the N frames of sampled data with a preset amplitude range, and determine sampled data whose amplitude exceeds or is lower than the preset amplitude range;
[0061] Determine the second audio data where the sampling data whose amplitude exceeds or is lower than the preset amplitude range is located;
[0062] Determine an adjustment amplitude for reducing or increasing the amplitude of each frame of audio data in the determined second audio data to within the preset amplitude range;
[0063] adjusting the amplitude of each frame of audio data in the determined second audio data according to the adjustment amplitude;
[0064] According to the adjustment amplitude, the amplitude of each frame of audio data in the determined plurality of adjacent second audio data is adjusted according to a preset rule.
[0065] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: in the audio adjustment method provided by the present disclosure, in order to avoid the influence of the playback effect caused by the amplitude adjustment of the second audio data where the sampling data whose amplitude exceeds or is lower than the preset amplitude range is located, after the second audio data where the sampling data whose amplitude exceeds or is lower than the preset amplitude range is located is determined and its amplitude is adjusted, the adjacent multiple second audio data are adjusted accordingly, that is, the amplitudes of the adjacent multiple second audio data are adjusted according to the adjustment amplitude and in accordance with preset rules, so that the amplitude adjustment of the second audio data where the sampling data whose amplitude exceeds or is lower than the preset amplitude range is located is smoothly transitioned.
[0066] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0068] Figure 1 is a flow chart of a volume adjustment method according to an exemplary embodiment;
[0069] Figure 2 It shows that Figure 1 In step S18, according to the adjustment amplitude, the amplitude of each frame of audio data in the determined plurality of adjacent second audio data is adjusted according to a preset rule;
[0070] Figure 3 It shows that Figure 1 In step S18, according to the adjustment amplitude, the amplitude of each frame of audio data in the determined plurality of adjacent second audio data is adjusted according to a preset rule;
[0071] Figure 4 is a flow chart of a volume adjustment method according to an exemplary embodiment;
[0072] Figure 5 It shows that Figure 1 In step S16, a flow chart of a method for determining an adjustment amplitude of reducing or increasing the amplitude of each frame of audio data in the determined second audio data to within a preset amplitude range;
[0073] Figure 6 A schematic diagram of amplitude adjustment of audio data to be played provided by the present disclosure is shown;
[0074] Figure 7 is a block diagram of a volume adjustment device according to an exemplary embodiment;
[0075] Figure 8 It is a block diagram of a device for adjusting volume according to an exemplary embodiment (general structure of a mobile terminal). DETAILED DESCRIPTION
[0076] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0077] A method for adjusting volume is provided in an embodiment of the present disclosure. Figure 1 FIG. 1 is a flow chart of a volume adjustment method according to an exemplary embodiment. Figure 1 As shown, the volume adjustment method is used in an electronic device, comprising the following steps:
[0078] In step S11, first audio data of an audio file to be played is obtained;
[0079] In step S12, the first audio data is divided into a plurality of second audio data;
[0080] In step S13, each second audio data in the plurality of second audio data is sampled to obtain N frames of sampled data, where N is a positive integer greater than or equal to 1;
[0081] In step S14, the amplitude of each frame of sampled data in the N frames of sampled data is compared with a preset amplitude range to determine sampled data whose amplitude exceeds or is lower than the preset amplitude range;
[0082] In step S15, second audio data including sampled data having an amplitude exceeding or lower than a preset amplitude range is determined;
[0083] In step S16, determining an adjustment amplitude for reducing or increasing the amplitude of each frame of audio data in the determined second audio data to within a preset amplitude range;
[0084] In step S17, the amplitude of each frame of audio data in the determined second audio data is adjusted according to the adjustment amplitude;
[0085] In step S18, the amplitude of each frame of audio data in the determined plurality of adjacent second audio data is adjusted according to the adjustment amplitude and a preset rule.
[0086] The method provided by the present disclosure is applied to electronic devices, such as mobile phones, tablet computers, etc. The volume adjustment method provided by the present disclosure obtains the first audio data to be played in advance, and divides the obtained first audio data to be played into a plurality of second audio data, and the duration of the plurality of second audio data may be equal or unequal. Each second audio data is sampled to obtain N frames of sampled data, where N is a positive integer greater than or equal to 1. When sampling each second audio data, one frame of sampled data may be sampled for each second audio data, or multiple frames of sampled data may be sampled.
[0087] The amplitude of each frame of sampled data in the N frames of sampled data is compared with a preset amplitude range to obtain sampled data whose amplitude exceeds or is lower than the preset amplitude range, determine the second audio data where the sampled data whose amplitude exceeds or is lower than the preset amplitude range is located, and determine the adjustment amplitude of the second audio data where the sampled data whose amplitude exceeds or is lower than the preset amplitude range is located, and adjust the amplitude of each frame of audio data in the second audio data according to the adjustment amplitude, that is, the amplitude of each frame of audio data is increased or decreased by the amplitude of the determined adjustment amplitude. Then, according to the adjustment amplitude, adjust the amplitude of each frame of audio data in the plurality of adjacent second audio data of the second audio data.
[0088] In the audio adjustment method provided by the present disclosure, in order to avoid the influence of the playback effect caused by the amplitude adjustment of the second audio data where the sampling data with an amplitude exceeding or lower than the preset amplitude range is located, after the second audio data where the sampling data with an amplitude exceeding or lower than the preset amplitude range is located is determined and its amplitude is adjusted, the adjacent multiple second audio data are adjusted accordingly, that is, the amplitudes of the adjacent multiple second audio data are adjusted according to the adjustment amplitude and according to the preset rules, so that the amplitude adjustment of the second audio data where the sampling data with an amplitude exceeding or lower than the preset amplitude range is smoothly transitioned.
[0089] The present disclosure provides a method for adjusting the volume. Figure 2 As shown, Figure 2 It shows that Figure 1 In step S18, according to the adjustment amplitude, the amplitude of each frame of audio data in the adjacent plurality of second audio data of the determined second audio data is adjusted according to a preset rule.
[0090] In step S181, according to the adjustment amplitude and the first preset adjustment amplitude difference, the amplitude of each frame of audio data in the determined first m second audio data is decreased or increased, where m is a positive integer greater than or equal to 1.
[0091] In the volume adjustment method provided by the present disclosure, the amplitude of each frame of audio data in the first m second audio data of the determined second audio data is sequentially decreased or increased according to the first preset adjustment amplitude difference. Taking the decrease as an example, the amplitude of each frame of audio data of the first second audio data before the determined second audio data minus the adjustment amplitude minus one first preset adjustment amplitude difference is obtained to obtain the adjusted amplitude of each frame of audio data of the first second audio data, the amplitude of each frame of audio data of the second second audio data before the determined second audio data minus the adjustment amplitude minus two first preset adjustment amplitude differences is obtained to obtain the adjusted amplitude of each frame of audio data of the second second audio data, and so on, the amplitude of each frame of audio data of the mth second audio data before the determined second audio data minus the adjustment amplitude minus m first preset adjustment amplitude differences is obtained to obtain the adjusted amplitude of each frame of audio data of the mth second audio data.
[0092] By adjusting the amplitude of the corresponding audio data in a decreasing or increasing manner, the amplitude of the audio data to be played can be adjusted more smoothly.
[0093] The present disclosure provides a method for adjusting the volume. Figure 3 As shown, Figure 3 It shows that Figure 1In step S18, according to the adjustment amplitude, the amplitude of each frame of audio data in the adjacent plurality of second audio data of the determined second audio data is adjusted according to a preset rule.
[0094] In step S182, according to the adjustment amplitude and the second preset adjustment amplitude difference, the amplitude of each frame of audio data in the determined last n second audio data is decreased or increased, where n is a positive integer greater than or equal to 1.
[0095] In the volume adjustment method provided by the present disclosure, the amplitude of each frame of audio data in the last n second audio data of the determined second audio data is sequentially decreased or increased according to the second preset adjustment amplitude difference. Taking the decrease as an example, the amplitude of each frame of audio data of the first second audio data after the determined second audio data minus the adjustment amplitude minus one second preset adjustment amplitude difference is obtained to obtain the adjusted amplitude of each frame of audio data of the first second audio data, the amplitude of each frame of audio data of the second second audio data after the determined second audio data minus the adjustment amplitude minus two second preset adjustment amplitude differences is obtained to obtain the adjusted amplitude of each frame of audio data of the second second audio data, and so on, the amplitude of each frame of audio data of the nth second audio data after the determined second audio data minus the adjustment amplitude minus n second preset adjustment amplitude differences is obtained to obtain the adjusted amplitude of each frame of audio data of the nth second audio data.
[0096] In the volume adjustment method provided in the present disclosure, the amplitude of each frame of audio data in the last n second audio data of the determined second audio data is sequentially decreased or increased according to the second preset adjustment amplitude difference. This can be used alone or together with the amplitude of each frame of audio data in the first m second audio data of the determined second audio data is sequentially decreased or increased according to the first preset adjustment amplitude difference, so as to effectively alleviate the impact of volume adjustment on the playback effect.
[0097] A method for adjusting volume is provided in an embodiment of the present disclosure. Figure 4 The present invention is a flow chart of a volume adjustment method according to an exemplary embodiment, comprising the following steps:
[0098] In step S19, when the determined adjacent plurality of second audio data include a plurality of sampling data exceeding or falling below a preset amplitude range, the second audio data including the sampling data with the largest amplitude exceeding or falling below the preset amplitude range is determined;
[0099] In step S20, the second audio data where the determined sampling data with the maximum amplitude exceeding or falling below the determined second audio data is located is taken as the determined second audio data.
[0100] In the volume adjustment method provided in the present disclosure, when a plurality of adjacent second audio data of the determined second audio data includes a plurality of sampling data exceeding or falling below a preset amplitude range, the second audio data where the sampling data with the largest amplitude exceeding or falling below the preset amplitude range is located can be used as the determined second audio data.
[0101] When the amplitude of each sampling data among N sampling data of multiple second audio data exceeds or is lower than the preset amplitude range, the second audio data where the sampling data with the largest amplitude exceeding or lower than the preset amplitude range among the N sampling data of the multiple second audio data is located is used as the determined second audio data.
[0102] By using the second audio data containing the sampling data with the largest amplitude exceeding or below the preset amplitude range as the determined second audio data, the volume of the first audio data to be played can be effectively adjusted to improve the user experience.
[0103] The present disclosure provides a method for adjusting the volume. Figure 5 As shown, Figure 5 It shows that Figure 1 In step S16, a method flow chart for determining an adjustment amplitude for reducing or increasing the amplitude of each frame of audio data in the determined second audio data to within a preset amplitude range:
[0104] In step S161, the maximum amplitude value of each frame of audio data in the determined second audio data is determined;
[0105] In step S162, the adjusted amplitude of the determined second audio data is determined according to the determined maximum amplitude value.
[0106] After determining the determined second audio data, the maximum amplitude value can be determined according to the amplitude of each frame of audio data in the second audio data. According to the maximum amplitude value, the amplitude adjustment value of the second audio data is determined. For example, if the maximum amplitude value in the second audio data is 130 decibels, the preset amplitude range is 80-120 decibels. In order to adjust the audio data with the largest amplitude in the second audio data to within the preset amplitude range, the minimum adjustment amplitude is 10 decibels, so the adjustment amplitude can be set to 10 decibels, of course, it can also be 15 decibels or 20 decibels, etc., as long as the audio data with the largest amplitude in the second audio data can be adjusted to within the preset amplitude range and other frames of audio data can be appropriately adjusted.
[0107] Figure 6 A schematic diagram of amplitude adjustment of audio data to be played provided by the present disclosure is shown. Figure 6In the embodiment, the amplitude of each frame of audio data in the first m second audio data of the determined second audio data is reduced as an example for explanation. The first audio data is divided into 7 second audio data, second audio data 301 to second audio data 307. The 7 second audio data are sampled. One frame of sampled data is sampled in each second audio data to obtain 7 frames of sampled data, and the amplitudes of the 7 frames of sampled data are respectively: the amplitude of the sampled data of the second audio data 301 is 100 decibels, the amplitude of the sampled data of the second audio data 302 is 110 decibels, the amplitude of the sampled data of the second audio data 303 is 120 decibels, the amplitude of the sampled data of the second audio data 304 is 110 decibels, the amplitude of the sampled data of the second audio data 305 is 100 decibels, the amplitude of the sampled data of the second audio data 306 is 130 decibels, and the amplitude of the sampled data of the second audio data 307 is 100 decibels. If the preset amplitude range is 80-120 decibels, then it is determined that the amplitude of the sampled data of the second audio data 306 exceeds the preset amplitude range, and the second amplitude of the second audio data 306 is not determined. According to the amplitude of each frame of audio data in the second audio data 306, the maximum amplitude value is determined, for example, the maximum amplitude is the amplitude of the sampled data of 130 decibels. In order to adjust the audio data of each frame of the second audio data 306 to within the preset amplitude range, the minimum adjustment amplitude is 10 decibels, so the adjustment amplitude can be determined to be 10 decibels. The amplitude of each frame of audio data in the second audio data 306 is reduced by 10 decibels. If the m value is set to 5, that is, the amplitude of 5 second audio data is adjusted forward, the first preset adjustment amplitude difference can be set to 2 decibels, then the adjustment amplitude of each frame of audio data in the second audio data 305 is 8 decibels, the adjustment amplitude of each frame of audio data in the second audio data 304 is 6 decibels, the adjustment amplitude of each frame of audio data in the second audio data 303 is 4 decibels, the adjustment amplitude of each frame of audio data in the second audio data 302 is 2 decibels, and the second audio data 301 does not need to be adjusted.
[0108] If the 7 second audio data include a plurality of sampling data exceeding the preset amplitude range, for example, if the amplitude of the sampling data of the second audio data 304 is 125 decibels, it also exceeds the preset amplitude range of 80-120 decibels. The amplitude of the sampling data of the second audio data 306 is 130 decibels, and the second audio data 306 is the second audio data where the sampling data with the largest amplitude exceeds the preset amplitude. Therefore, the second audio data 306 is still used as the determined second audio data, and the amplitude adjustment of the subsequent audio data is performed based on the second audio data 306.
[0109] Through such an adjustment method, the volume of the audio data to be played can be adjusted smoothly.
[0110] In an exemplary embodiment of the present disclosure, a volume adjustment device is provided. Figure 7 As shown, Figure 7 is a block diagram of a volume adjustment device according to an exemplary embodiment. Figure 7 The device includes an acquisition module 701, a division module 702, a sampling module 703, a determination module 704, and an adjustment module 705.
[0111] The acquisition module 701 is configured to acquire first audio data of an audio file to be played;
[0112] A division module 702 is configured to divide the first audio data into a plurality of second audio data;
[0113] The sampling module 703 is configured to sample each second audio data of the plurality of second audio data to obtain N frames of sampled data, where N is a positive integer greater than or equal to 1;
[0114] The determination module 704 is configured to compare the amplitude of each frame of sampled data in the N frames of sampled data with a preset amplitude range, and determine sampled data whose amplitude exceeds or is lower than the preset amplitude range;
[0115] The determination module 704 is configured to determine the second audio data where the sampling data whose amplitude exceeds or is lower than the preset amplitude range is located;
[0116] The determination module 704 is configured to determine an adjustment amplitude for reducing or increasing the amplitude of each frame of audio data in the determined second audio data to within the preset amplitude range;
[0117] An adjustment module 705 is configured to adjust the amplitude of each frame of audio data in the determined second audio data according to the adjustment amplitude;
[0118] The adjustment module 705 is configured to adjust the amplitude of each frame of audio data in the determined plurality of adjacent second audio data according to the adjustment amplitude and a preset rule.
[0119] Wherein, the adjustment module 704 is configured to:
[0120] According to the adjustment amplitude, the amplitude of each frame of audio data in the first m second audio data of the determined second audio data is decreased or increased according to the first preset adjustment amplitude difference, where m is a positive integer greater than or equal to 1.
[0121] Wherein, the adjustment module 704 is configured to:
[0122] According to the adjustment amplitude, the amplitude of each frame of audio data in the determined last n second audio data is decreased or increased according to the second preset adjustment amplitude difference, where n is a positive integer greater than or equal to 1.
[0123] Wherein, the determination module 705 is configured to:
[0124] When the determined plurality of adjacent second audio data includes a plurality of sampling data exceeding or below the preset amplitude range, determining the second audio data where the sampling data with the largest amplitude exceeding or below the preset amplitude range is located;
[0125] The second audio data that exceeds or falls below the sampling data with the largest amplitude is taken as the determined second audio data.
[0126] Wherein, the determination module 705 is configured to:
[0127] Determine the maximum amplitude value of each frame of audio data in the determined second audio data;
[0128] The adjusted amplitude of the determined second audio data is determined according to the determined amplitude maximum value.
[0129] Wherein, the durations of the multiple second audio data are equal.
[0130] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0131] Figure 8 8 is a block diagram of a volume adjustment device 800 according to an exemplary embodiment. For example, the device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0132] Reference Figure 8 , the device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0133] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0134] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0135] The power component 806 provides power to the various components of the device 800. The power component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.
[0136] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0137] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0138] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0139] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, and the sensor assembly 814 can also detect the position change of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800, and the temperature change of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0140] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0141] In an exemplary embodiment, the apparatus 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.
[0142] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 820 of the device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0143] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of a mobile terminal, enables the mobile terminal to execute a method for predicting sales volume of goods, the method comprising:
[0144] Acquire first audio data of an audio file to be played;
[0145] Dividing the first audio data into a plurality of second audio data;
[0146] Sampling each second audio data among the plurality of second audio data to obtain N frames of sampled data, where N is a positive integer greater than or equal to 1;
[0147] Compare the amplitude of each frame of sampled data in the N frames of sampled data with a preset amplitude range, and determine sampled data whose amplitude exceeds or is lower than the preset amplitude range;
[0148] Determine the second audio data where the sampling data whose amplitude exceeds or is lower than the preset amplitude range is located;
[0149] Determine an adjustment amplitude for reducing or increasing the amplitude of each frame of audio data in the determined second audio data to within the preset amplitude range;
[0150] adjusting the amplitude of each frame of audio data in the determined second audio data according to the adjustment amplitude;
[0151] According to the adjustment amplitude, the amplitude of each frame of audio data in the determined plurality of adjacent second audio data is adjusted according to a preset rule.
[0152] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0153] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A volume adjustment method, applied to an electronic device, characterized in that: include: Acquire first audio data of an audio file to be played; Dividing the first audio data into a plurality of second audio data; Sampling each second audio data among the plurality of second audio data to obtain N frames of sampled data, where N is a positive integer greater than or equal to 1; Compare the amplitude of each frame of sampled data in the N frames of sampled data with a preset amplitude range, and determine sampled data whose amplitude exceeds or is lower than the preset amplitude range; Determine the second audio data where the sampling data whose amplitude exceeds or is lower than the preset amplitude range is located; Determine an adjustment amplitude for reducing or increasing the amplitude of each frame of audio data in the determined second audio data to within the preset amplitude range; adjusting the amplitude of each frame of audio data in the determined second audio data according to the adjustment amplitude; According to the adjustment amplitude, adjusting the amplitude of each frame of audio data in the plurality of adjacent second audio data of the determined second audio data according to a preset rule; The step of adjusting the amplitude of each frame of audio data in the plurality of adjacent second audio data of the determined second audio data according to a preset rule according to the adjustment amplitude includes: According to the adjustment amplitude, the amplitude of each frame of audio data in the first m second audio data of the determined second audio data is decreased or increased according to the first preset adjustment amplitude difference, where m is a positive integer greater than or equal to 1; According to the adjustment amplitude, the amplitude of each frame of audio data in the determined last n second audio data is decreased or increased according to the second preset adjustment amplitude difference, where n is a positive integer greater than or equal to 1.
2. The volume adjustment method according to claim 1, characterized in that: The adjustment method further comprises: When the determined plurality of adjacent second audio data includes a plurality of sampling data exceeding or below the preset amplitude range, determining the second audio data where the sampling data with the largest amplitude exceeding or below the preset amplitude range is located; The second audio data that exceeds or falls below the sampling data with the largest amplitude is taken as the determined second audio data.
3. The volume adjustment method according to claim 1, characterized in that: The step of determining to reduce or increase the amplitude of each frame of audio data in the determined second audio data to an adjustment amplitude within the preset amplitude range comprises: Determine the maximum amplitude value of each frame of audio data in the determined second audio data; The adjusted amplitude of the determined second audio data is determined according to the determined amplitude maximum value.
4. The volume adjustment method according to claim 1, characterized in that: The durations of the plurality of second audio data are equal.
5. A volume adjustment device, characterized in that: include: An acquisition module is configured to acquire first audio data of an audio file to be played; A division module, configured to divide the first audio data into a plurality of second audio data; A sampling module is configured to sample each of the plurality of second audio data to obtain N frames of sampled data, where N is a positive integer greater than or equal to 1; A determination module is configured to compare the amplitude of each frame of sampled data in the N frames of sampled data with a preset amplitude range, and determine sampled data whose amplitude exceeds or is lower than the preset amplitude range; The determination module is configured to determine the second audio data where the sampling data whose amplitude exceeds or is lower than the preset amplitude range is located; The determination module is configured to determine an adjustment amplitude for reducing or increasing the amplitude of each frame of audio data in the determined second audio data to within the preset amplitude range; an adjustment module, configured to adjust the amplitude of each frame of audio data in the determined second audio data according to the adjustment amplitude; The adjustment module is configured to adjust the amplitude of each frame of audio data in the plurality of adjacent second audio data of the determined second audio data according to the adjustment amplitude and a preset rule; The adjustment module is configured to: According to the adjustment amplitude, the amplitude of each frame of audio data in the first m second audio data of the determined second audio data is decreased or increased according to the first preset adjustment amplitude difference, where m is a positive integer greater than or equal to 1; According to the adjustment amplitude, the amplitude of each frame of audio data in the determined last n second audio data is decreased or increased according to the second preset adjustment amplitude difference, where n is a positive integer greater than or equal to 1.
6. The volume adjustment device according to claim 5, characterized in that: The determination module is configured to: When the determined plurality of adjacent second audio data includes a plurality of sampling data exceeding or below the preset amplitude range, determining the second audio data where the sampling data with the largest amplitude exceeding or below the preset amplitude range is located; The second audio data that exceeds or falls below the sampling data with the largest amplitude is taken as the determined second audio data.
7. The volume adjustment device according to claim 5, characterized in that: The determination module is configured to: Determine the maximum amplitude value of each frame of audio data in the determined second audio data; The adjusted amplitude of the determined second audio data is determined according to the determined amplitude maximum value.
8. The volume adjustment device according to claim 5, characterized in that: The durations of the plurality of second audio data are equal.
9. A volume adjustment device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to: Acquire first audio data of an audio file to be played; Dividing the first audio data into a plurality of second audio data; Sampling each second audio data among the plurality of second audio data to obtain N frames of sampled data, where N is a positive integer greater than or equal to 1; Compare the amplitude of each frame of sampled data in the N frames of sampled data with a preset amplitude range, and determine sampled data whose amplitude exceeds or is lower than the preset amplitude range; Determine the second audio data where the sampling data whose amplitude exceeds or is lower than the preset amplitude range is located; Determine an adjustment amplitude for reducing or increasing the amplitude of each frame of audio data in the determined second audio data to within the preset amplitude range; adjusting the amplitude of each frame of audio data in the determined second audio data according to the adjustment amplitude; According to the adjustment amplitude, adjusting the amplitude of each frame of audio data in the plurality of adjacent second audio data of the determined second audio data according to a preset rule; The step of adjusting the amplitude of each frame of audio data in the plurality of adjacent second audio data of the determined second audio data according to a preset rule according to the adjustment amplitude includes: According to the adjustment amplitude, the amplitude of each frame of audio data in the first m second audio data of the determined second audio data is decreased or increased according to the first preset adjustment amplitude difference, where m is a positive integer greater than or equal to 1; According to the adjustment amplitude, the amplitude of each frame of audio data in the determined last n second audio data is decreased or increased according to the second preset adjustment amplitude difference, where n is a positive integer greater than or equal to 1.
10. A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of a mobile terminal, enables the mobile terminal to perform a volume adjustment method, the method comprising: Acquire first audio data of an audio file to be played; Dividing the first audio data into a plurality of second audio data; Sampling each second audio data among the plurality of second audio data to obtain N frames of sampled data, where N is a positive integer greater than or equal to 1; Compare the amplitude of each frame of sampled data in the N frames of sampled data with a preset amplitude range, and determine sampled data whose amplitude exceeds or is lower than the preset amplitude range; Determine the second audio data where the sampling data whose amplitude exceeds or is lower than the preset amplitude range is located; Determine an adjustment amplitude for reducing or increasing the amplitude of each frame of audio data in the determined second audio data to within the preset amplitude range; adjusting the amplitude of each frame of audio data in the determined second audio data according to the adjustment amplitude; According to the adjustment amplitude, adjusting the amplitude of each frame of audio data in the plurality of adjacent second audio data of the determined second audio data according to a preset rule; The step of adjusting the amplitude of each frame of audio data in the plurality of adjacent second audio data of the determined second audio data according to a preset rule according to the adjustment amplitude includes: According to the adjustment amplitude, the amplitude of each frame of audio data in the first m second audio data of the determined second audio data is decreased or increased according to the first preset adjustment amplitude difference, where m is a positive integer greater than or equal to 1; According to the adjustment amplitude, the amplitude of each frame of audio data in the determined last n second audio data is decreased or increased according to the second preset adjustment amplitude difference, where n is a positive integer greater than or equal to 1.
Citation Information
Patent Citations
Volume adjustment method and device, terminal equipment and storage medium
CN107436751A
Volume regulation method and device, terminal device and storage medium
CN107483734A
Audio output method and terminal
CN110058837A
Audio processing method and device, electronic equipment and storage medium
CN110312146A
Audio smoothing method and device, computer equipment and storage medium
CN110491366A
