Volume adjustment method and system, electronic equipment and storage medium
By analyzing the amplitude of the audio file and adjusting the volume of the vehicle control system, the problem of sudden volume changes during audio file switching is solved, improving user experience and driving safety.
Patent Information
- Application Number
- CN202411099660.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-08-12
AI Technical Summary
The volume of the vehicle control system suddenly changes when switching audio files, affecting the user experience, and the existing volume adjustment method requires manual operation to distract driving attention and affect safety.
By obtaining the amplitude of the audio file to be played, analyzing and forming an amplitude set, determining whether the current volume meets the adjustment conditions, and adjusting the player's control volume to maintain a suitable comfortable listening range.
It effectively avoids the problem of sudden increase or decrease in volume, improves user experience, and enhances driving safety.
Smart Images

Figure CN119088332A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicle-mounted media playback, and in particular to a volume adjustment method, system, electronic equipment and storage medium. Background Art
[0002] At present, the vehicle itself has an in-vehicle entertainment system, and the audio of the vehicle entertainment system can be played through the in-vehicle player. With the continuous development of vehicle entertainment and intelligence, various audio-visual needs of users can be met in various ways, such as connecting external terminals such as mobile phones to the vehicle control system, and outputting the audio on the external terminal through the in-vehicle player to meet the audio-visual needs of users. However, when the audio on the external terminal is output through the in-vehicle player, the volume of the audio is usually affected by the volume of the vehicle control terminal and the external terminal. For example, the mobile phone usually sounds comfortable when the volume is medium, but when it is connected to the vehicle control system through Bluetooth and played on the in-vehicle player according to the volume of the mobile phone, the sound will become lower, and when the user turns up the volume and accidentally switches to other audio files, the sound will suddenly become louder, and the experience is extremely poor. In addition, the current volume adjustment method usually requires the user to adjust it manually, which not only increases the complexity of the operation, but also may distract the user's attention during driving, affecting driving safety. Summary of the invention
[0003] The object of the present invention is to provide a volume adjustment method, system, electronic device and storage medium to solve the technical problem that the volume of a vehicle control system changes suddenly when switching audio files, affecting the user experience.
[0004] To achieve the above objectives and other related objectives, in a first aspect, the present invention provides a volume adjustment method, comprising:
[0005] Get the audio file to be played;
[0006] Parsing the audio file to be played, and extracting the amplitude of the audio file to be played;
[0007] Determine whether the amplitude of the audio file to be played and the current volume of the player both meet the adjustment conditions;
[0008] If so, adjusting the control volume of the player;
[0009] The to-be-played audio file is played based on the adjusted player.
[0010] In an example of the present invention, the amplitude is an audio amplitude, and parsing the audio file to be played to extract the amplitude of the audio file to be played includes:
[0011] intercepting multiple audio clips of the audio file to be played;
[0012] Acquire frequency domain information of the multiple audio clips;
[0013] The amplitude corresponding to each frequency in the frequency domain information is used as an audio amplitude of the audio file to be played to form an amplitude set.
[0014] In an example of the present invention, determining whether the amplitude of the audio file to be played and the current volume of the player both meet the adjustment conditions includes:
[0015] Calculating an average value of the amplitude set, and comparing the average value of the amplitude set with a preset first amplitude;
[0016] Determine whether the average value of the amplitude set is greater than the first amplitude, and whether the current volume of the player is greater than a preset first playback volume;
[0017] If so, it is necessary to adjust the control volume of the player;
[0018] If not, based on the preset second amplitude and the preset second playback volume, it is determined whether the control volume of the player needs to be adjusted.
[0019] In an example of the present invention, judging whether it is necessary to adjust the control volume of the player based on a preset second amplitude and a preset second playback volume includes:
[0020] Determine whether the average value of the amplitude set is smaller than the second amplitude, and whether the current volume of the player is smaller than the second playback volume;
[0021] If so, it is necessary to adjust the control volume of the player;
[0022] If not, the control volume of the player remains unchanged.
[0023] In an example of the present invention, the volume adjustment method further includes: when it is determined that the amplitude of the audio file to be played and the current volume of the player are different and meet the adjustment condition, playing the audio file to be played based on the player.
[0024] In an example of the present invention, adjusting the control volume of the player includes:
[0025] For each audio amplitude in the amplitude set: comparing the current audio amplitude with a preset third amplitude to obtain a comparison result between the current audio amplitude and the third amplitude; wherein the comparison result includes whether the current audio amplitude is greater than, less than or equal to the third amplitude;
[0026] The comparison results of the amplitudes of the audio signals are counted, and the control volume of the player is adjusted accordingly based on the comparison results.
[0027] In an example of the present invention, the comparison results of the amplitudes of the audio signals are counted, and the control volume of the player is adjusted accordingly based on the comparison results, including:
[0028] In the amplitude set, the number of audio frequencies whose amplitude is greater than the third amplitude is taken as a first number, and the number of audio frequencies whose amplitude is less than the third amplitude is taken as a second number;
[0029] determining whether the first number is greater than the second number;
[0030] If yes, reducing the control volume of the player according to a first preset ratio;
[0031] If not, the control volume of the player is increased according to a second preset ratio.
[0032] In a second aspect, the present invention provides a volume adjustment system, the volume adjustment system comprising:
[0033] An acquisition module is used to acquire the audio file to be played;
[0034] An analysis module, used for analyzing the audio file to be played and extracting the amplitude of the audio file to be played;
[0035] A judging module, used to judge whether the amplitude of the audio file to be played and the current volume of the player both meet the adjustment conditions;
[0036] An adjustment module, used for adjusting the control volume of the player;
[0037] A playing module is used to play the audio file to be played based on the adjusted player.
[0038] In a third aspect, the present invention provides an electronic device, the electronic device comprising:
[0039] at least one processor; and,
[0040] a memory communicatively coupled to the at least one processor;
[0041] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the steps of the above-mentioned volume adjustment method.
[0042] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above-mentioned volume adjustment method when executed by a processor.
[0043] The present invention provides a volume adjustment method, system, electronic device and storage medium. The volume adjustment method firstly parses an acquired audio file to be played to extract its amplitude, and judges whether the control volume of the player needs to be adjusted by judging whether the amplitude of the audio file to be played and the current volume of the player both meet the adjustment conditions. If both meet the adjustment conditions, the control volume of the player is adjusted, and the audio file to be played is played based on the adjusted player, so as to prevent the playback volume of the player from suddenly increasing or decreasing when the vehicle control system switches the audio file, so that the playback volume of the player is always maintained in a comfortable hearing range suitable for human ears, thereby effectively improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The features and advantages of the present invention will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present invention in any way. In the accompanying drawings:
[0045] Figure 1 A flow chart of steps of a volume adjustment method according to an embodiment of the present invention;
[0046] Figure 2 This is a flow chart of step S2 in one embodiment of the present invention;
[0047] Figure 3 This is a flow chart of step S3 in one embodiment of the present invention;
[0048] Figure 4 This is a flow chart of step S34 in one embodiment of the present invention;
[0049] Figure 5 This is a flow chart of step S4 in one embodiment of the present invention;
[0050] Figure 6 This is a flow chart of step S42 in one embodiment of the present invention;
[0051] Figure 7 A structural block diagram of a volume adjustment system in one embodiment of the present invention;
[0052] Figure 8 The figure is a schematic diagram of the device structure of the hardware operating environment involved in the volume adjustment method in one embodiment of the present invention.
[0053] Component number description:
[0054] 100, volume adjustment system; 110, acquisition module; 120, analysis module; 130, judgment module; 140, adjustment module; 150, playback module. DETAILED DESCRIPTION
[0055] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0056] It should be noted that the illustrations provided in this embodiment are only used to illustrate the basic concept of the present invention in a schematic manner. Therefore, the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0057] With the popularization of intelligent cars, the acoustic boundaries in car cabins are also changing rapidly. Most cars are equipped with multimedia systems, equipped with audio and display screens, so that users can listen to music and watch videos in the car, which greatly improves the user experience. However, when the user switches the playback content in the car cabin, due to the different audio amplitudes of different audio files, there will be a problem of sudden increase or decrease in volume when switching audio files, which seriously affects the user experience. And the current adjustment method generally adopts the method of manually adjusting the playback volume, such as tuning knob adjustment or touch screen adjustment, but manual adjustment will distract the user's attention and affect driving safety.
[0058] In order to solve the above technical problems, the present invention provides a volume adjustment method. When the playback volume of a player needs to be adjusted, the control volume of the player is adjusted accordingly to avoid the playback volume of the player suddenly increasing or decreasing when switching audio files, so that the playback volume of the player is always maintained in a comfortable listening range suitable for the human ear, thereby effectively improving the user experience and enhancing driving safety.
[0059] Figure 1 The present invention is a flow chart of a volume adjustment method shown in an exemplary embodiment of the present invention. The method is applied to a vehicle control system. The vehicle control system executes the volume adjustment method to adjust the control volume of a player to ensure that the playback volume of the player is always within a comfortable hearing range for the human ear.
[0060] See also Figure 1 , the volume adjustment method comprises the following steps:
[0061] S1. Obtain the audio file to be played;
[0062] S2, parsing the audio file to be played, and extracting the amplitude of the audio file to be played;
[0063] S3, determining whether the amplitude of the audio file to be played and the current volume of the player both meet the adjustment conditions;
[0064] S4, if yes, adjust the control volume of the player;
[0065] S5. Play the audio file to be played based on the adjusted player.
[0066] In step S1, the audio file to be played that is about to be switched can be an audio file sent by an external terminal (for example, a mobile phone, a tablet computer, etc.) to the vehicle control system, or it can be an audio file sent by a user to the vehicle control system by touching the touch screen of the vehicle control system. The connection method between the external terminal and the vehicle control system includes but is not limited to Bluetooth, USB, AUX and HDMI interfaces. The audio file to be played can be sent by an entertainment application (Applacation, App), such as music software, video software, game software, radio software, etc.; it can also be sent by a non-entertainment application, such as system software, navigation software, etc., and the types of entertainment applications and non-entertainment applications are not limited here. Exemplarily, the audio file to be played is a song.
[0067] See also Figure 2 In some embodiments, the amplitude is an audio amplitude. In step S2, the audio file to be played is parsed to extract the amplitude of the audio file to be played, including the following steps:
[0068] S21, intercepting multiple audio clips of the audio file to be played;
[0069] In some embodiments, the audio file to be played is first read using an audio processing library. Exemplarily, the audio processing library is AudioTrack&AudioRecord, MediaRecorder&MediaPlayer, etc. Specifically, multiple audio clips of the audio file to be played are intercepted at a certain time interval, and the interval time of each sampling and the amount of data of each sampling are adaptively adjusted according to actual needs. Exemplarily, the time interval of each sampling is 10ms, and the total duration of multiple audio clips is 150ms;
[0070] S22, obtaining frequency domain information of multiple audio clips;
[0071] In some embodiments, the time domain signals of multiple audios can be converted into frequency domain signals by fast Fourier transform, short-time Fourier transform, etc. to obtain their frequency domain information; the frequency domain information of multiple audio clips can also be obtained by wavelet transform or Hilbert-Huang transform analysis. In this embodiment, fast Fourier transform is used to convert the time domain information of multiple audio clips into frequency domain information. Furthermore, in order to reduce the spectrum leakage effect, before fast Fourier transform is performed on the audio clips, a window function, such as a Hamming window or a Hanning window, is applied to the multiple audio clips. Exemplarily, a visualization audio tool is used to perform fast Fourier transform on the multiple audio clips processed by the window function to complete the conversion of audio information from time domain to frequency domain, and the amplitude corresponding to each frequency is calculated based on the frequency domain information obtained by the transformation. For example, visualization audio tools include AudioVisualizeView, Visualizer class, etc.;
[0072] S23: Taking the amplitude corresponding to each frequency in the frequency domain information as an audio amplitude of the audio file to be played, to form an amplitude set.
[0073] In some embodiments, all audio amplitudes in the amplitude set are arranged in a certain order, for example, in order from low to high frequency.
[0074] See also Figure 3 In step S3, it is determined whether the amplitude of the audio file to be played and the current volume of the player both meet the adjustment conditions, including the following steps:
[0075] S31, calculating an average value of the amplitude set, and comparing the average value of the amplitude set with a preset first amplitude;
[0076] S32, determining whether the average value of the amplitude set is greater than the first amplitude, and whether the current volume of the player is greater than a preset first playback volume;
[0077] S33: If yes, the volume of the player needs to be adjusted;
[0078] S34: If not, based on the preset second amplitude and the preset second playback volume, determine whether the control volume of the player needs to be adjusted.
[0079] See also Figure 4 In some embodiments, in step S34, based on the preset second amplitude and the preset second playback volume, determining whether the control volume of the player needs to be adjusted includes the following steps:
[0080] S341, determining whether the average value of the amplitude set is less than the second amplitude, and whether the current volume of the player is less than the second playback volume;
[0081] S342: If yes, the control volume of the player needs to be adjusted;
[0082] S343: If not, keep the control volume of the player unchanged.
[0083] The current volume of the player is the volume at which the current player plays the audio file into the car. If the average value of the amplitude set and the current volume of the player both meet the adjustment conditions, the control volume of the player needs to be adjusted. If any one of the average value of the amplitude set and the current volume of the player does not meet the adjustment conditions, the control volume of the player does not need to be adjusted. For example, if the average value of the amplitude set is greater than the first amplitude, but the current volume of the player is between the first playback volume and the second playback volume, the control volume of the player does not need to be adjusted. In the present invention, the first amplitude, the second amplitude, the first playback volume and the second playback volume are adaptively adjusted according to actual needs.
[0084] In the present invention, the player can be any type of audio media player controlled by the vehicle control system on the vehicle, for example, it can be a Moving Picture Experts Group Audio Layer 3 (MP3) player, or other media players configured to play back audio recordings such as musical works.
[0085] See also Figure 5 In some embodiments, in step S4, adjusting the control volume of the player includes the following steps:
[0086] S41, for each audio amplitude in the amplitude set: compare the current audio amplitude with a preset third amplitude to obtain a comparison result between the current audio amplitude and the third amplitude; wherein the comparison result includes whether the current audio amplitude is greater than, less than or equal to the third amplitude;
[0087] S42, counting the comparison results of the amplitudes of the various audio frequencies, and adjusting the control volume of the player accordingly based on the comparison results.
[0088] See also Figure 6 In some embodiments, in step S42, the comparison results of the audio amplitudes are counted, and the control volume of the player is adjusted accordingly based on the comparison results, including the following steps:
[0089] S421, in the amplitude set, the number of audio frequencies whose amplitude is greater than the third amplitude is taken as a first number, and the number of audio frequencies whose amplitude is less than the third amplitude is taken as a second number;
[0090] S422, determining whether the first quantity is greater than the second quantity;
[0091] S423: If yes, reducing the control volume of the player according to a first preset ratio;
[0092] The first preset ratio is adaptively adjusted according to actual needs. For example, the first preset ratio is 30% of the maximum value of the player control volume. For example, if the current player control volume is 70% of its maximum value, the control volume is reduced to 40% of its maximum value.
[0093] S424: If not, increase the control volume of the player according to a second preset ratio.
[0094] The second preset ratio is adaptively adjusted according to actual needs, and the second preset ratio may be equal to or different from the first preset ratio. In some embodiments, the second preset ratio is equal to the first preset ratio, for example, the second preset ratio is 30% of the maximum value of the player control volume, and the current player control volume is 30% of its maximum value, then the control volume is increased to 60% of its maximum value.
[0095] In step S5, if the control volume of the player is adjusted, the audio file to be played is played based on the adjusted player. For example, if the control volume of the current player is 40% of its maximum value, and if the control volume is increased to 70% of its maximum value based on the comparison result of the audio amplitude of the audio file to be played and the third amplitude, the audio file to be played is played based on the control volume being 70% of the maximum value.
[0096] In some embodiments, the volume adjustment further includes: S6, when it is determined that the amplitude of the audio file to be played and the current volume of the player do not meet the adjustment condition at the same time, the audio file to be played is played based on the player. For example, if the control volume of the current player is 40% of its maximum value, and the amplitude of the audio file to be played and the current volume of the player do not meet the adjustment condition at the same time, there is no need to adjust them, and the audio file to be played continues to be played based on 40% of its maximum value.
[0097] In some embodiments, the volume adjustment step also includes: when the vehicle control system is restarted, the volume initialization step of the control volume of the player. The volume initialization step includes: adjusting the control volume of the player to a preset initial volume range to prevent the sound of the vehicle control system from being too loud or too soft when the vehicle control system is restarted, affecting the user experience. Among them, the initial volume range is set based on the control volume, and the specific setting rules can be adaptively set based on actual needs. For example, the initial volume range is 5% to 20% of the maximum value of the control volume. Exemplarily, the current control volume is automatically cached when the vehicle control system is turned off, and the cached control volume is read when the vehicle control system is restarted and it is judged whether it needs to be adjusted. If the control volume is within the preset initial volume range, it does not need to be adjusted. If the control volume is not within the preset initial volume range, it needs to be adjusted. Exemplarily, if the current control volume is any volume value within the range of 5% to 20% of its maximum value when the vehicle control system is restarted, it does not need to be adjusted; if the current control volume is less than 5% of its maximum value when the vehicle control system is restarted, it is increased to 5% of its maximum value; if the current control volume is greater than 20% of its maximum volume when the vehicle control system is restarted, it is reduced to 20% of its maximum volume.
[0098] See also Figure 7 In some embodiments, the present invention provides a volume adjustment system 100, which corresponds to the volume adjustment method in the above embodiment. The volume adjustment system 100 includes an acquisition module 110, an analysis module 120, a judgment module 130, an adjustment module 140 and a playback module 150. The functional modules are described in detail as follows:
[0099] The acquisition module 110 is used to acquire the audio file to be played;
[0100] An analysis module 120 is used to analyze the audio file to be played and extract the amplitude of the audio file to be played;
[0101] A determination module 130 is used to determine whether the amplitude of the audio file to be played and the current volume of the player both meet the adjustment conditions;
[0102] The adjustment module 140 is used to adjust the control volume of the player;
[0103] The playing module 150 is used to play the audio file to be played based on the adjusted player.
[0104] In some embodiments, the parsing module 120 is specifically used to:
[0105] intercepting multiple audio clips of the audio file to be played;
[0106] Get frequency domain information of multiple audio clips;
[0107] The amplitude corresponding to each frequency in the frequency domain information is used as an audio amplitude of the audio to be played to form an amplitude set.
[0108] In some embodiments, the determination module 130 is specifically used to:
[0109] Calculating an average value of the amplitude set, and comparing the average value of the amplitude set with a preset first amplitude;
[0110] Determine whether the average value of the amplitude set is greater than the first amplitude, and whether the current volume of the player is greater than a preset first playback volume;
[0111] If so, you need to adjust the player's control volume;
[0112] If not, based on the preset second amplitude and the preset second playback volume, it is determined whether the control volume of the player needs to be adjusted.
[0113] In some embodiments, the determination module 130 is further configured to:
[0114] Determine whether the average value of the amplitude set is less than the second amplitude, and whether the current volume of the player is less than the second playback volume;
[0115] If so, you need to adjust the player's control volume;
[0116] If not, the player's control volume remains unchanged.
[0117] In one embodiment, the adjustment module 140 is specifically used to:
[0118] For each audio amplitude in the amplitude set: comparing the current audio amplitude with the third amplitude to obtain a comparison result between the current audio amplitude and the third amplitude; wherein the comparison result includes whether the current audio amplitude is greater than, less than or equal to the third amplitude;
[0119] The comparison results of the amplitudes of the various audio frequencies are counted, and the control volume of the player is adjusted accordingly based on the comparison results.
[0120] In one embodiment, the adjustment module 140 is specifically used to:
[0121] In the amplitude set, the number of audio frequencies whose amplitude is greater than the third amplitude is taken as a first number, and the number of audio frequencies whose amplitude is less than the third amplitude is taken as a second number;
[0122] Determining whether the first quantity is greater than the second quantity;
[0123] If so, reducing the control volume of the player according to a first preset ratio;
[0124] If not, the control volume of the player is increased according to a second preset ratio.
[0125] See also Figure 8 In some embodiments, the present invention provides an electronic device, which may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0126] See also Figure 8 , the electronic device may include a processing device (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage device into a random access memory (RAM). In the RAM, various programs and data required for the operation of the electronic device are also stored. The processing device, ROM, and RAM are connected to each other through a bus. The input / output (I / O) interface is also connected to the bus.
[0127] Typically, the following systems can be connected to the I / O interface: input devices including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices including, for example, a magnetic tape, a hard disk, etc.; and communication devices. The communication device can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.
[0128] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0129] In some embodiments, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:
[0130] Get the audio file to be played;
[0131] Analyze the audio file to be played and extract the amplitude of the audio file to be played;
[0132] Determine whether the amplitude of the audio file to be played and the current volume of the player both meet the adjustment conditions;
[0133] If so, adjust the player's control volume;
[0134] The audio file to be played is played based on the adjusted player.
[0135] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or computer device can refer to the relevant descriptions on the server side and the client side in the aforementioned method embodiment. To avoid repetition, they will not be described one by one here.
[0136] The computer-readable storage medium of the present invention can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate or transmit a program used by or in combination with an instruction execution system, device or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, etc., or any suitable combination of the foregoing.
[0137] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0138] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A volume adjustment method, characterized in that: include: Get the audio file to be played; Parsing the audio file to be played, and extracting the amplitude of the audio file to be played; Determine whether the amplitude of the audio file to be played and the current volume of the player both meet the adjustment conditions; If so, adjusting the control volume of the player; The to-be-played audio file is played based on the adjusted player.
2. The volume adjustment method according to claim 1, characterized in that: The amplitude is an audio amplitude, and parsing the audio file to be played to extract the amplitude of the audio file to be played includes: intercepting multiple audio clips of the audio file to be played; Acquire frequency domain information of the multiple audio clips; The amplitude corresponding to each frequency in the frequency domain information is used as an audio amplitude of the audio file to be played to form an amplitude set.
3. The volume adjustment method according to claim 2, characterized in that: Determining whether the amplitude of the audio file to be played and the current volume of the player both meet the adjustment conditions includes: Calculating an average value of the amplitude set, and comparing the average value of the amplitude set with a preset first amplitude; Determine whether the average value of the amplitude set is greater than the first amplitude, and whether the current volume of the player is greater than a preset first playback volume; If so, it is necessary to adjust the control volume of the player; If not, based on the preset second amplitude and the preset second playback volume, it is determined whether the control volume of the player needs to be adjusted.
4. The volume adjustment method according to claim 3, characterized in that: Based on a preset second amplitude and a preset second playback volume, determining whether a control volume of the player needs to be adjusted includes: Determine whether the average value of the amplitude set is smaller than the second amplitude, and whether the current volume of the player is smaller than the second playback volume; If so, it is necessary to adjust the control volume of the player; If not, the control volume of the player remains unchanged.
5. The volume adjustment method according to claim 1, characterized in that: Also includes: When it is determined that the amplitude of the audio file to be played and the current volume of the player are different and satisfy the adjustment condition, the audio file to be played is played based on the player.
6. The volume adjustment method according to claim 2, characterized in that: Adjusting the control volume of the player includes: For each audio amplitude in the amplitude set: Comparing the current audio amplitude with a preset third amplitude to obtain a comparison result between the current audio amplitude and the third amplitude; wherein the comparison result includes whether the current audio amplitude is greater than, less than or equal to the third amplitude; The comparison results of the amplitudes of the audio signals are counted, and the control volume of the player is adjusted accordingly based on the comparison results.
7. The volume adjustment method according to claim 6, characterized in that: Counting the comparison results of the amplitudes of the audio signals, and adjusting the control volume of the player accordingly based on the comparison results, including: In the amplitude set, the number of audio frequencies whose amplitude is greater than the third amplitude is taken as a first number, and the number of audio frequencies whose amplitude is less than the third amplitude is taken as a second number; determining whether the first number is greater than the second number; If yes, reducing the control volume of the player according to a first preset ratio; If not, the control volume of the player is increased according to a second preset ratio.
8. A volume adjustment system, characterized in that: include: An acquisition module is used to acquire the audio file to be played; An analysis module, used for analyzing the audio file to be played and extracting the amplitude of the audio file to be played; A judging module, used to judge whether the amplitude of the audio file to be played and the current volume of the player both meet the adjustment conditions; An adjustment module, used for adjusting the control volume of the player; A playing module is used to play the audio file to be played based on the adjusted player.
9. An electronic device, characterized in that: include; at least one processor; as well as, a memory communicatively coupled to the at least one processor; The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the steps of the volume adjustment method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the volume adjustment method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Terminal sound effect setting method and terminal
CN106126170A
Mobile terminal and loudness output adjusting method
CN107241497A
Volume adjusting method and device, terminal equipment and storage medium
CN107479852A
Volume adjustment method and device, terminal device, and storage medium
CN107566618A
Volume setting method, device, computer device and storage medium
CN109508170A
