CN110677774B - Volume self-adaptive adjusting method and device, computer equipment and storage medium - Google Patents
Volume self-adaptive adjusting method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN110677774B CN110677774B CN201910775252.4A CN201910775252A CN110677774B CN 110677774 B CN110677774 B CN 110677774B CN 201910775252 A CN201910775252 A CN 201910775252A CN 110677774 B CN110677774 B CN 110677774B
- Authority
- CN
- China
- Prior art keywords
- volume
- value
- audio
- played
- formula
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R3/00—Circuits for transducers, loudspeakers or microphones
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R2430/00—Signal processing covered by H04R, not provided for in its groups
- H04R2430/01—Aspects of volume control, not necessarily automatic, in sound systems
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Acoustics & Sound (AREA)
- Signal Processing (AREA)
- Circuit For Audible Band Transducer (AREA)
Abstract
The embodiment of the invention belongs to the technical field of audio processing, and relates to a volume self-adaptive adjusting method, which comprises the following steps: acquiring a preset system standard volume N for playing audio, and acquiring a current playing volume X of the currently played audio; confirming a next audio to be played and acquiring the sound source volume Y of the next audio; after a first adjusting coefficient A is calculated according to a first formula A ═ N/Y, the volume Z to be played of the next audio is calculated according to a second formula Z ═ A ═ X; and after receiving an audio switching instruction for playing the next audio, responding to the audio switching instruction to play the next audio at the volume to be played. The invention also provides a volume self-adaptive adjusting device, computer equipment and a storage medium. The invention can automatically adjust the volume in an adaptive manner aiming at the audios of different styles by taking the standard volume of the system as a reference, and avoids the situation that a user needs to repeatedly adjust the volume after switching the audios because the music styles of the audios are different, thereby improving the user experience.
Description
Technical Field
The present invention relates to the field of audio processing technologies, and in particular, to a volume adaptive adjustment method and apparatus, a computer device, and a storage medium.
Background
In daily life, when a mobile terminal is used for listening to songs, different styles of music are often encountered. In addition, the original playing volume of music of different styles is different under the same system volume, for example, the volume of pure music is generally smaller, and the volume of rock music is generally larger.
Therefore, when a user plays music and other audio, the user inevitably encounters a scene that the volume of the current audio needs to be adjusted, and especially when the user plays music with earphones, the user is surprised by the music with high volume. And when the styles of the current and later pieces of music are different greatly, the user may turn the volume of the system large when the user uses the previous piece of music, the volume of the system needs to be reduced when the user uses the next piece of music, and the volume of the system needs to be turned large when the user uses the next piece of music, so that the user can repeatedly adjust the volume of the current system, can not enjoy the music well, and great troubles are brought to the user. There is a need for a method that can adapt the volume of different styles of music.
Disclosure of Invention
The embodiment of the invention aims to adaptively adjust the volume of music with different styles and solve the problem that the audio experience is influenced because a user needs to repeatedly adjust the volume due to different music styles.
In order to solve the above technical problem, an embodiment of the present invention provides a volume adaptive adjustment method, which adopts the following technical solutions:
a volume adaptive adjustment method comprises the following steps:
acquiring a preset system standard volume N for playing audio, and acquiring a current playing volume X of the currently played audio;
before switching from the currently played audio to the next audio, confirming the next audio to be played and acquiring the sound source volume Y of the next audio;
after a first adjusting coefficient A is calculated according to a first formula A ═ N/Y, the volume Z to be played of the next audio is calculated according to a second formula Z ═ A ×;
and after receiving an audio switching instruction for playing the next audio, responding to the audio switching instruction and playing the next audio at the volume to be played.
Further, the volume adaptive adjustment method, wherein the step of obtaining a preset system standard volume N for playing audio includes:
And querying historical playing volume set by a user when different audios are played in a historical time period, and taking the average value of the historical playing volume as the value of N.
Further, before the step of obtaining the current playing volume X of the currently played audio, the volume adaptive adjustment method further includes the steps of:
comparing the value of X with a first preset value and a second preset value; wherein the second preset value is greater than the first preset value;
if the value of X is smaller than the first preset value, adjusting the value of X to the first preset value; and if the value of X is larger than the second preset value, adjusting the value of X to be the second preset value.
Further, the step of calculating the volume Z to be played of the next audio according to a second formula Z ═ a × X after calculating the first adjustment coefficient a according to a first formula a ═ N/Y further includes:
detecting whether the value of A is within a preset specific interval range, and if so, replacing the second formula with a third formula Z ═ a × (X);
and correcting the A according to a preset rule to obtain a second adjusting coefficient a, and further calculating the volume Z to be played of the next audio according to the third formula.
Further, in the method for adaptively adjusting the volume, the step of modifying the value a according to a preset rule to obtain a second adjustment coefficient a includes:
when the value of A is between 0.4 and 0.6, correcting the A according to a first regulation formula a-A x 1.5 to obtain a second regulation coefficient a;
when the value of A is between 0.6 and 0.8, correcting the A according to a second regulation formula a-A x 1.2 to obtain a second regulation coefficient a;
when the value of A is between 1.2 and 1.4, correcting the A according to a third regulation formula a-A-0.85 to obtain a second regulation coefficient a;
and when the value of A is between 1.4 and 1.6, correcting the A according to a fourth regulation formula a-A0.65 to obtain a second regulation coefficient a.
Further, after the step of further calculating the volume Z to be played of the next audio according to the third formula, the method for adaptively adjusting the volume further includes the steps of:
detecting whether the value of Z is 0.6-1.4 times of the value of N, if not, updating the value of Z according to the following rules:
if the value of Z is more than or equal to 1.4 times of the value of N, taking 1.4 times of the value of N as the value of Z;
And if the value of Z is less than 0.6 times the value of N, taking 0.6 times the value of N as the value of Z.
Further, the step of calculating the volume Z to be played of the next audio according to a second formula Z ═ a × X after calculating the first adjustment coefficient a according to a first formula a ═ N/Y further includes:
detecting the value of A, and if the value of A is less than 0.4, taking 0.4 as the value of A; and if the value of A is more than 1.6, taking 1.6 as the value of A.
In order to solve the above technical problem, an embodiment of the present invention further provides a volume adaptive adjustment apparatus, which adopts the following technical solutions:
a volume adaptive adjustment apparatus comprising:
the volume acquisition module is used for acquiring a preset system standard volume N for playing the audio and acquiring the current playing volume X of the currently played audio;
the audio confirming module is used for confirming the next audio to be played before the currently played audio is switched to the next audio, and acquiring the sound source volume Y of the next audio;
the volume calculation module is used for calculating a first adjustment coefficient A according to a first formula A ═ N/Y and then calculating the volume Z to be played of the next audio according to a second formula Z ═ A ×;
And the audio playing module is used for responding to the audio switching instruction to play the next audio at the volume to be played after receiving the audio switching instruction for playing the next audio.
In order to solve the above technical problem, an embodiment of the present invention further provides a computer device, which adopts the following technical solutions:
a computer device comprising a memory in which a computer program is stored and a processor that implements the steps of the above-described volume adaptive adjustment method when executing the computer program.
In order to solve the above technical problem, an embodiment of the present invention further provides a computer-readable storage medium, which adopts the following technical solutions:
a computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the above-mentioned volume adaptive adjustment method
Compared with the prior art, the embodiment of the invention mainly has the following beneficial effects: acquiring a preset system standard volume N for playing audio, acquiring a current playing volume X of the currently played audio, and acquiring a sound source volume Y of a next audio to be played after confirming the next audio; after a first adjusting coefficient A is calculated according to a first formula A ═ N/Y, the volume Z to be played of the next audio is calculated according to a second formula Z ═ A ×; and finally, the next audio can be played at the volume to be played, so that the situation that the user needs to repeatedly adjust the current playing volume X due to overlarge difference of the sound source volume Y caused by different music styles of the audio is avoided, and the experience of enjoying music by the user is improved.
Drawings
In order to more clearly illustrate the solution of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without inventive labor.
Fig. 1 is a schematic flowchart of a volume adaptive adjustment method according to an embodiment;
FIG. 2 is a schematic diagram illustrating an exemplary embodiment of an adaptive volume control apparatus;
fig. 3 is a schematic structural diagram of a computer device according to an embodiment.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention; the terms "comprising" and "having," and any variations thereof, in the description and claims of this invention and the description of the above figures, are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and in the claims, or in the drawings, are used for distinguishing between different objects and not necessarily for describing a particular sequential order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein may be combined with other embodiments.
In order to make the technical solutions of the present invention better understood by those skilled in the art, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.
Referring to fig. 1, a flow chart of a volume adaptive adjusting method according to an embodiment of the present invention is shown, where the volume adaptive adjusting method includes the following steps:
step 101: the method comprises the steps of obtaining a preset system standard volume N for playing audio, and obtaining a current playing volume X of the currently played audio.
Specifically, the standard volume of the system is a common volume when a user generally listens to a song or plays content such as video with audio by using a player. The current playing volume is the current system volume of the terminal device used by the user, and the terminal device may be various electronic devices supporting listening to Audio or watching video, including but not limited to a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion video Experts compressed standard Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, motion video Experts compressed standard Audio Layer 4), a laptop portable computer, a desktop computer, and the like.
In some embodiments of the present application, when the system standard volume is preset, the optimal volume when the user plays audio may be obtained by querying a historical play volume used when the user plays different audio in a historical time period, and the optimal volume is used as the system standard volume when the audio is played.
For example, if the volume used by the user to listen to the audio is 50 in one month, then 50 may be used as the system standard volume N for audio playing, and of course, if the volumes used by the user to play the audio in a history time period are all different, the average value of the history playing volume in the history time period may be taken as the system standard volume for the user to play the audio.
When it is detected that there is no record for playing audio before the user, a system standard volume can be directly obtained from the server and used as the system standard volume when the current terminal plays audio.
Generally, the most suitable volume range for listening to audio is between 45 db and 65 db, and thus the system standard volume can be set between 45 db and 65 db. Of course, the standard volume of the system can be adjusted adaptively according to individual differences of different users.
Step 102: and before switching the currently played audio to the next audio, confirming the next audio to be played and acquiring the sound source volume Y of the next audio.
In the embodiment of the present application, since the audio file carries an initial volume, that is, a sound source volume, and the sound source volume is affected by different styles of music, music can be played at different volumes on the premise that the current playing volume is not changed. For example, when the current audio is a music of the lyric type, the music of the lyric type can be played with a smaller volume because the volume of the sound source carried in the music file is smaller; if the current audio is music of a rock type, the music of the rock type can be played at a higher volume because the volume of the sound source carried in the music file is higher. If the lyric type music and the rock type music are two adjacent audio frequencies, the user needs to turn the volume down (or up) and then turn the volume up (or down), so that the user cannot enjoy the music well, and inconvenience is brought to the user.
Step 103: and after a first adjusting coefficient A is calculated according to a first formula A ═ N/Y, the volume Z to be played of the next audio is calculated according to a second formula Z ═ A ×.X.
Specifically, since the actual playing volume of the audio is affected by the current playing volume X and the sound source volume Y, after the system standard volume N is obtained, the system standard volume N is first divided by the sound source volume Y to obtain a first adjustment coefficient a, the current playing volume X is multiplied by the first adjustment coefficient a to obtain the volume Z to be played, and the value of the volume Z is used as the volume when the next audio is played.
For example, the system standard volume N is set to 35 db, the sound source volume Y of the next audio is 50 db, and when the current playing volume X is 50 db, the first adjustment coefficient a is calculated to be 0.7, and the playing volume Z of the next audio to be played is 35 db.
Step 104: and after receiving an audio switching instruction for playing the next audio, responding to the audio switching instruction and playing the next audio at the volume to be played.
According to the method and the device, when the user uses the audio playing device to play music and outputs the music through the output device, the volume of the music with different styles is adjusted through the self-adaptive volume adjusting method, and the situation that the user repeatedly adjusts the current playing volume when listening to the music is avoided.
In this embodiment, a preset system standard volume N for playing an audio is obtained, a current playing volume X of a terminal is obtained, a sound source volume Y of a next audio is extracted from a next audio file to be played, a first adjustment coefficient a is obtained through calculation according to a first formula a ═ N/Y, and then a volume Z to be played of the next audio is calculated according to a second formula Z ═ a ×; and finally, the next audio to be played can be played through the adaptive volume Z to be played, so that the playing volume of the music with different styles can be adaptively adjusted, the playing volume of the music with different styles is suitable, and good audio using experience is provided for users.
In some embodiments of the present application, in the step 101, the step of obtaining a preset system standard volume N for playing audio includes:
step 1011: and querying historical playing volume set by a user when different audios are played in a historical time period, and taking the average value of the historical playing volume as the value of N.
In this embodiment, the system standard volume N may be set in advance, and during the setting, the historical playing volume used by all the audios played by the user in a historical time period may be queried, and the average value of the historical playing volumes of different audios played in the time period is used as the value of the system standard volume N.
In some embodiments of the present application, in the step 101, before the step of obtaining the current playing volume X of the currently played audio, the volume adaptive adjusting method further includes:
step 1012; comparing the value of X with a first preset value and a second preset value; wherein the second preset value is greater than the first preset value.
Step 1013: if the value of X is smaller than the first preset value, adjusting the value of X to the first preset value; and if the value of X is larger than the second preset value, adjusting the value of X to be the second preset value.
In this embodiment, for the current playing volume X, in order to ensure that the current playing volume X is within a range suitable for playing audio and avoid adverse effects of playing audio due to too small or too large of the current playing volume X, volume intervals with boundaries respectively being a first preset value and a second preset value are preset as limitations on the current playing volume X, where the second preset value is greater than the first preset value.
The value of the current playing volume X cannot be smaller than a first preset value, and when the value of X is smaller than the first preset value, the first preset value is used as the value of the current playing volume X; and the value of the current playing volume X cannot be larger than a second preset value, and when the value of the X is larger than the second preset value, the second preset value is used as the value of the current playing volume X.
The first preset value can be set to 20 db, and the second preset value can be set to 70 db. When the sound volume is less than 20 decibels, the current playing sound volume X is too small, so that the user cannot hear clearly; above 70 db, the user may feel too loud, causing user discomfort. Of course, due to individual differences of users, adaptive adjustment can be performed for the first preset value and the second preset value.
In this embodiment of the present application, the step 103 further includes:
Step 1031: and detecting whether the value of A is within a preset specific interval range, and if so, replacing the second formula with a third formula Z-a-X.
Step 1032: and correcting the A according to a preset rule to obtain a second adjusting coefficient a, and further calculating the volume Z to be played of the next audio according to the third formula.
Further, the preset rule specifically includes: when the value of A is between 0.4 and 0.6, correcting the A according to a first regulation formula a-A x 1.5 to obtain a second regulation coefficient a;
when the value of A is between 0.6 and 0.8, correcting the A according to a second regulation formula a-A x 1.2 to obtain a second regulation coefficient a;
when the value of A is between 1.2 and 1.4, correcting the A according to a third regulation formula a-A-0.85 to obtain a second regulation coefficient a;
and when the value of A is between 1.4 and 1.6, correcting the A according to a fourth regulation formula a-A0.65 to obtain a second regulation coefficient a.
Specifically, because the system standard volume N is a fixed value, and the sound source volume Y of the next audio to be played is also a determined value when the audio is determined, the current playing volume X plays an important role in the volume Z of the next audio to be played. Therefore, under the condition of different currently played volume X, the obtained Z value may not be suitable for the volume of the next audio to be played, so that the obtained Z value may be further corrected to ensure that the Z value can be suitable for the next audio to be played.
When the set first regulation formula, the second regulation formula, the third regulation formula and the fourth regulation formula are applied, the interval that the value of A corresponding to the first regulation formula is satisfied when the first regulation formula is applied is 0.4-0.6, namely more than or equal to 0.4 and less than 0.6, and other intervals are similar and are not repeated.
When the system standard volume N is set to 35 db, the sound source volume Y of the next audio to be played is 50 db, and the current playing volume X is 50 db, the first adjustment coefficient a is calculated to be 0.7, and Z is 35 db for example. At this time, the first adjustment coefficient is between 0.6 and 0.8, so that the first adjustment coefficient A is multiplied by 1.2 to obtain a corrected second adjustment coefficient a of 0.84, and then the value a is multiplied by the value 50 of the current playing volume X to obtain Z of 42 decibels, namely 42 decibels are taken as the volume to be played of the music to be played.
In some optional implementations of this embodiment, after the step 1032, the method for adaptively adjusting a volume further includes the step of:
detecting whether the value of Z is 0.6-1.4 times of the value of N, if not, updating the value of Z according to the following rules:
if the value of Z is more than or equal to 1.4 times of the value of N, taking 1.4 times of the value of N as the value of Z;
And if the value of Z is less than 0.6 times the value of N, taking 0.6 times the value of N as the value of Z.
Specifically, for the volume Z to be played of the next audio to be played after the correction, a detection step may be performed to ensure that Z can play the next audio as the most suitable volume.
In combination with the above example, when the volume Z to be played of the next audio to be played is 42 db, the system standard volume N is 50 db, and the volume to be played is 0.84 times the system standard volume and is between 0.6 and 1.4 times the system standard volume, so that 42 db is determined as the volume to be played. If the obtained volume to be played is 28 db and the system standard volume is 50 db, then 0.6 db, that is, 30 db, of the system standard volume is required to be used as the volume to be played of the next audio to be played. If the obtained volume to be played is 75 db and the system standard volume is 50 db, 1.4 times, i.e. 70 db, of the system standard volume is required to be used as the volume to be played of the next audio to be played.
Further, the step 103 further includes: detecting the value of A, and if the value of A is less than 0.4, taking 0.4 as the value of A; and if the value of A is more than 1.6, taking 1.6 as the value of A.
When the first adjustment coefficient a exceeds 1.6, at this time, the system standard volume N exceeds the sound source volume Y of the next audio to be played too much, and it cannot be ensured that the adjusted volume can be adapted by the user, so that 1.6 can be used as the first adjustment coefficient a, and it is ensured that the corrected volume can be adapted by the user.
For example, when the system standard volume N is 45 db, the sound source volume Y of the next audio to be played is 20 db, and the current playing volume X is 20 db, the first adjustment coefficient a is 2.25 and exceeds 1.6, and if the first adjustment coefficient is directly set to 2.25, the volume Z to be played of the next audio to be played is 45 db, which may cause a user adapted to a low volume to suddenly hear a high volume, and thus the user may be frightened. However, if 1.6 is used as the first adjustment coefficient, the volume Z to be played of the next audio to be played is 32 db, which can effectively prevent the user from being surprised by suddenly hearing the audio with high volume.
In a specific implementation manner of this embodiment, a historical playing volume set when a user plays different audios within a certain period is obtained, an average value of the historical playing volume within the period is taken as a system standard volume N, a current playing volume X is obtained at the same time, a range of the current playing volume X is detected, the historical playing volume is ensured to be between a first preset value and a second preset value, a sound source volume Y of a next audio to be played is extracted at the same time, then a first adjustment coefficient a is obtained by calculating a ratio of the system standard volume N to the sound source volume Y, the first adjustment coefficient a is modified by detecting an interval range of the first adjustment coefficient a to obtain a second adjustment coefficient a, the second adjustment coefficient a is multiplied by the current playing volume X to obtain a volume Z to be played, and finally a next audio is played at the playing volume Z, so that the current playing volume X and the first adjustment coefficient a can be modified, the final volume Z to be played can be ensured to be the most suitable volume of the next audio to be played to play the audio, and the requirement of the user for enjoying the audio is met.
Referring to fig. 2, as an implementation of the method shown in fig. 1, an embodiment of a volume adaptive adjusting apparatus is provided, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 1, and the apparatus may be specifically applied to various electronic devices, and the volume adaptive adjusting apparatus 300 of the embodiment includes: a volume acquiring module 301, an audio confirming module 302, a volume calculating module 303 and an audio playing module 304.
The volume obtaining module 301, the audio confirming module 302, the volume calculating module 303 and the audio playing module 304 are electrically connected to each other.
The volume obtaining module 301 is configured to obtain a preset system standard volume N for playing an audio, and obtain a current playing volume X of a currently played audio.
Specifically, the user may independently adjust the system standard volume N through the volume obtaining module 301, or obtain the historical playing volume set when the user plays different audio frequencies within a historical time period through the volume obtaining module 301, calculate an average value of the historical playing volume within the time period, and use the average value as the system standard volume N for playing music.
The audio confirmation module 302 is configured to confirm a next audio to be played before switching from a currently played audio to a next audio, and acquire a sound source volume Y of the next audio.
Specifically, the current playing volume X may be obtained through the audio confirmation module 302, and meanwhile, the audio confirmation module 302 may further extract the sound source volume Y of the next audio from the next audio file to be played.
The volume calculating module 303 is configured to calculate a first adjustment coefficient a according to a first formula a ═ N/Y, and then calculate a volume Z to be played of the next audio according to a second formula Z ═ a ×.x.
Specifically, the volume calculating module 303 is mainly configured to calculate a volume Z to be played of a next audio to be played according to the acquired system standard volume N, the current playing volume X, and the sound source volume Y.
The audio playing module 304 is configured to, after receiving an audio switching instruction for playing the next audio, respond to the audio switching instruction to play the next audio at the volume to be played.
Specifically, after the volume Z to be played is calculated by the volume calculation module 303, the next audio can be played at the volume Z to be played through the audio playing module 304, and the volume Z to be played at this time can be well adapted to the audio of different music winds, so that the user can enjoy music well.
In this embodiment, a system standard volume is preset by the volume obtaining module 301, a current playing volume X obtained by the audio confirming module 302 and a sound source volume Y of a next audio to be played are combined, a volume Z to be played of the next audio to be played is calculated by the volume calculating module 303, and finally the next audio is played by the audio playing module 304 with the calculated volume Z to be played, so that the situation that a user can enjoy music with a proper volume and the audio experience of the user is improved because the music style of the audio is different is avoided.
In an implementation manner of the embodiment of the present application, the volume obtaining module 301 further includes: a volume adjustment sub-module 3011. The volume adjusting submodule 3011 is configured to compare the value of X with a first preset value and a second preset value; wherein the second preset value is greater than the first preset value; if the value of X is smaller than the first preset value, adjusting the value of X to the first preset value; and if the value of X is larger than the second preset value, adjusting the value of X to be the second preset value.
Specifically, since the current playing volume is not necessarily within a reasonable range, before the volume calculation module 303 performs calculation, the volume adjustment sub-module 3011 may detect the current playing volume X, and determine whether the current playing volume X is between a first preset value and a second preset value, where the first preset value and the second preset value may be adjusted by the user. If the value of the current playing volume X is smaller than a first preset value, taking the first preset value as the current playing volume X; and if the value of the current playing volume X is larger than the second preset value, taking the second preset value as the current playing volume X, so as to ensure that the current playing volume X can be in a reasonable range, and the volume Z to be played is calculated to be the volume in the reasonable range.
In a specific implementation manner of the embodiment of the present application, the volume calculating module 303 further includes: a replacement submodule 3031 and a correction submodule 3032. The replacing submodule 3031 is configured to detect whether the value of a is within a preset specific interval, and if so, replace the second formula with a third formula Z ═ a ×. And the correction submodule 3032 is configured to correct the audio signal a according to a preset rule to obtain a second adjustment coefficient a, and further calculate a volume Z to be played of the next audio according to the third formula.
Specifically, the replacing submodule 3031 is configured to detect an interval range of a first adjustment coefficient a, and modify the first adjustment coefficient a in the specific interval range according to a preset rule by the modifying submodule 3032 to obtain a second adjustment coefficient a; and multiplying the second adjusting coefficient a by the current playing volume X to obtain the volume Z to be played of the next audio to be played.
The modification submodule 3032 may further execute the following preset rules: when the value of A is between 0.4 and 0.6, correcting the A according to a first regulation formula a-A x 1.5 to obtain a second regulation coefficient a; when the value of A is between 0.6 and 0.8, correcting the A according to a second regulation formula a-A x 1.2 to obtain a second regulation coefficient a; when the value of A is between 1.2 and 1.4, correcting the A according to a third regulation formula a-A-0.85 to obtain a second regulation coefficient a; and when the value of A is between 1.4 and 1.6, correcting the A according to a fourth regulation formula a-A0.65 to obtain a second regulation coefficient a.
Further, the modification submodule 3032 is further configured to detect a value of the a, and if the value of the a is smaller than 0.4, take 0.4 as the value of the a; and if the value of A is more than 1.6, taking 1.6 as the value of A. Therefore, the first adjusting coefficient A is in a proper range, and the calculated volume Z to be played is ensured to be suitable for the current audio.
The correction submodule 3032 can correct the first adjustment coefficient a, so that the situation that the playing volume Z is too large or too small due to too large or too small of the first adjustment coefficient a is avoided, the situation that the volume Z to be played of the next audio to be played is suitable for the music style of the next audio is ensured, and good experience is brought to a user.
Further, the modification submodule 3032 is further configured to detect whether the value of Z is between 0.6 and 1.4 times the value of N, and if not, update the value of Z according to the following rule: if the value of Z is more than or equal to 1.4 times of the value of N, taking 1.4 times of the value of N as the value of Z; and if the value of Z is less than 0.6 times the value of N, taking 0.6 times the value of N as the value of Z.
In this embodiment, the system standard volume N and the current playing volume X of the currently playing audio are obtained by the volume obtaining module 301, after the audio confirming module 302 confirms the next audio to be played and obtains the sound source volume Y thereof, the current playing volume X is detected and adjusted by the volume adjusting submodule 3011, the first adjusting coefficient a and the volume Z to be played are calculated by the volume calculating module 303, the first adjusting coefficient a can be corrected by the correcting submodule 3032 during the calculation process, the volume Z to be played is calculated by the corrected second adjusting coefficient a, finally the next audio to be played is played by the audio playing module 304 with the volume Z to be played, and the finally calculated volume Z to be played is further ensured to conform to the music style of the next audio to be played by correcting the current playing volume X and the first adjusting coefficient a, therefore, comfortable playing volume is set for the audio to be played, the situation that the volume needs to be adjusted repeatedly due to different music styles of the audio is avoided, and the user can enjoy music well.
In summary, by obtaining an average value of historical playing volumes set by a user when playing different audios in a historical time period, setting the average value as a system standard volume N, obtaining a current playing volume X and a sound source volume Y of a next audio to be played, adjusting the current playing volume X, calculating a first adjustment coefficient a and a volume Z to be played according to the current playing volume X, the current playing volume Y and the system standard volume N, correcting the first adjustment coefficient a to obtain a second adjustment coefficient a, calculating a new volume Z to be played according to the second adjustment coefficient a, and finally playing the next audio to be played according to the playing volume Z, the audio volume self-adaptive adjustment is realized for different situations of different audio styles due to different sound source volumes, and the repeated adjustment operation of the volume by the user is avoided, the audio using experience of the user is improved.
In order to solve the above technical problem, an embodiment of the present invention further provides a computer device. Referring to fig. 3, fig. 3 is a block diagram of a basic structure of a computer device according to the present embodiment.
The computer device 5 comprises a memory 51, a processor 52, a network interface 53 communicatively connected to each other via a system bus. It is noted that only a computer device 5 having components 51-53 is shown, but it is understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead. As will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer equipment can carry out man-machine interaction with a user in a keyboard mode, a mouse mode, a remote controller mode, a touch panel mode or a voice control equipment mode.
The memory 51 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the storage 51 may be an internal storage unit of the computer device 5, such as a hard disk or a memory of the computer device 5. In other embodiments, the memory 51 may also be an external storage device of the computer device 5, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the computer device 5. Of course, the memory 51 may also comprise both an internal storage unit of the computer device 5 and an external storage device thereof. In this embodiment, the memory 51 is generally used for storing an operating system installed in the computer device 5 and various types of application software, such as program codes of a volume adaptive adjustment method. Further, the memory 51 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 52 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 52 is typically used to control the overall operation of the computer device 5. In this embodiment, the processor 52 is configured to execute the program code stored in the memory 51 or process data, for example, execute the program code of the method for adaptive volume adjustment.
The network interface 53 may comprise a wireless network interface or a wired network interface, and the network interface 53 is generally used for establishing communication connections between the computer device 5 and other electronic devices.
The present invention also provides another embodiment, which is a computer-readable storage medium storing a program of a volume adaptive adjustment method, which is executable by at least one processor to cause the at least one processor to perform the steps of the volume adaptive adjustment method as described above.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
It is to be understood that the above-described embodiments are merely illustrative of some, but not restrictive, of the broad invention, and that the appended drawings illustrate preferred embodiments of the invention without limiting its scope. This invention may be embodied in many different forms and, on the contrary, these embodiments are provided so that this disclosure will be thorough and complete. Although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that various changes in the embodiments and modifications can be made, and equivalents may be substituted for elements thereof. All equivalent structures made by using the contents of the specification and the attached drawings of the invention can be directly or indirectly applied to other related technical fields, and are also within the protection scope of the patent of the invention.
Claims (8)
1. A volume adaptive adjustment method is characterized by comprising the following steps:
acquiring a preset system standard volume N for playing audio, and acquiring a current playing volume X of the currently played audio;
before switching from the currently played audio to the next audio, confirming the next audio to be played and acquiring the sound source volume Y of the next audio;
After a first adjusting coefficient A is calculated according to a first formula A ═ N/Y, the volume Z to be played of the next audio is calculated according to a second formula Z ═ A ×;
after receiving an audio switching instruction for playing the next audio, responding to the audio switching instruction and playing the next audio at the volume to be played;
after the first adjustment coefficient a is calculated according to the first formula a ═ N/Y, the step of calculating the volume Z to be played of the next audio according to the second formula Z ═ a ×, further includes:
detecting whether the value of A is within an interval of 0.4-0.6, 0.6-0.8 or 1.2-1.4, and if so, replacing the second formula with a third formula Z ═ a ×;
correcting the A according to a preset rule to obtain a second adjusting coefficient a, and further calculating the volume Z to be played of the next audio according to the third formula;
wherein, the step of correcting the A according to a preset rule to obtain a second adjustment coefficient a comprises:
when the value of A is between 0.4 and 0.6, correcting the A according to a first regulation formula a-A x 1.5 to obtain a second regulation coefficient a;
when the value of A is between 0.6 and 0.8, correcting the A according to a second regulation formula a-A x 1.2 to obtain a second regulation coefficient a;
When the value of A is between 1.2 and 1.4, correcting the A according to a third regulation formula a-A-0.85 to obtain a second regulation coefficient a;
and when the value of A is between 1.4 and 1.6, correcting the A according to a fourth regulation formula a-A0.65 to obtain a second regulation coefficient a.
2. The method for adaptively adjusting the volume according to claim 1, wherein the step of obtaining a preset system standard volume N for playing audio comprises:
and querying historical playing volume set by a user when different audios are played in a historical time period, and taking the average value of the historical playing volume as the value of N.
3. The method for adaptively adjusting the volume of a video signal according to claim 1, wherein before the step of obtaining the current playing volume X of the currently playing audio, the method further comprises the steps of:
comparing the value of X with a first preset value and a second preset value; wherein the second preset value is greater than the first preset value;
if the value of X is smaller than the first preset value, adjusting the value of X to the first preset value; and if the value of X is larger than the second preset value, adjusting the value of X to be the second preset value.
4. The method for adaptively adjusting the volume according to claim 1, wherein after the step of further calculating the volume Z to be played of the next audio according to the third formula, the method further comprises the steps of:
detecting whether the value of Z is 0.6-1.4 times of the value of N, if not, updating the value of Z according to the following rules:
if the value of Z is more than or equal to 1.4 times of the value of N, taking 1.4 times of the value of N as the value of Z;
and if the value of Z is less than 0.6 times the value of N, taking 0.6 times the value of N as the value of Z.
5. The method of claim 1, wherein the step of calculating the volume Z to be played of the next audio according to a second formula Z ═ a × X after calculating the first adjustment coefficient a according to a first formula a ═ N/Y further comprises:
detecting the value of A, and if the value of A is less than 0.4, taking 0.4 as the value of A; if the value of A is larger than 1.6, taking 1.6 as the value of A.
6. An apparatus for adaptively adjusting a volume, comprising:
the volume acquisition module is used for acquiring a preset system standard volume N for playing the audio and acquiring the current playing volume X of the currently played audio;
The audio confirming module is used for confirming the next audio to be played before the currently played audio is switched to the next audio, and acquiring the sound source volume Y of the next audio;
the volume calculating module is used for calculating a first adjusting coefficient A according to a first formula A ═ N/Y and then calculating the volume Z to be played of the next audio according to a second formula Z ═ A ═ X;
the audio playing module is used for responding to the audio switching instruction to play the next audio at the volume to be played after receiving the audio switching instruction for playing the next audio;
wherein, the volume calculation module further comprises:
a replacing submodule for detecting whether the value of A is within an interval of 0.4-0.6, 0.6-0.8 or 1.2-1.4, if so, replacing the second formula with a third formula Z ═ a × X;
the correction submodule is used for correcting the audio A according to a preset rule to obtain a second adjustment coefficient a, and further calculating the volume Z to be played of the next audio according to the third formula;
wherein, the modification submodule may further execute the following preset rules: when the value of A is between 0.4 and 0.6, correcting the A according to a first regulation formula a-A x 1.5 to obtain a second regulation coefficient a; when the value of A is between 0.6 and 0.8, correcting the A according to a second regulation formula a-A x 1.2 to obtain a second regulation coefficient a; when the value of A is between 1.2 and 1.4, correcting the A according to a third regulation formula a-A-0.85 to obtain a second regulation coefficient a; and when the value of A is between 1.4 and 1.6, correcting the A according to a fourth regulation formula a-A0.65 to obtain a second regulation coefficient a.
7. A computer device comprising a memory having a computer program stored therein and a processor implementing the steps of the volume adaptive adjustment method according to any one of claims 1 to 5 when the processor executes the computer program.
8. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the volume adaptive adjustment method according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910775252.4A CN110677774B (en) | 2019-08-21 | 2019-08-21 | Volume self-adaptive adjusting method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910775252.4A CN110677774B (en) | 2019-08-21 | 2019-08-21 | Volume self-adaptive adjusting method and device, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110677774A CN110677774A (en) | 2020-01-10 |
CN110677774B true CN110677774B (en) | 2022-06-10 |
Family
ID=69075456
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910775252.4A Active CN110677774B (en) | 2019-08-21 | 2019-08-21 | Volume self-adaptive adjusting method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110677774B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112558916B (en) * | 2020-12-24 | 2024-01-05 | 阿波罗智联(北京)科技有限公司 | Audio adjustment method, device, electronic equipment and storage medium |
CN113194381B (en) * | 2021-04-28 | 2023-04-14 | 国光电器(香港)有限公司 | Volume adjusting method and device, sound equipment and storage medium |
CN113676595B (en) * | 2021-07-12 | 2023-07-21 | 杭州逗酷软件科技有限公司 | Volume adjustment method, terminal device, and computer-readable storage medium |
CN114138225A (en) * | 2021-11-03 | 2022-03-04 | 东风汽车集团股份有限公司 | Vehicle-mounted entertainment system volume self-adaption method |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105632523A (en) * | 2015-12-24 | 2016-06-01 | 魅族科技(中国)有限公司 | Method and device for regulating sound volume output value of audio data, and terminal |
CN106775563A (en) * | 2016-12-13 | 2017-05-31 | 珠海市魅族科技有限公司 | The method and device of volume adjusting |
CN107562406A (en) * | 2017-08-28 | 2018-01-09 | 维沃移动通信有限公司 | A kind of volume adjusting method, mobile terminal and computer-readable recording medium |
CN107566652A (en) * | 2017-09-20 | 2018-01-09 | 惠州Tcl移动通信有限公司 | A kind of method, mobile terminal and the storage medium of automatic regulating volume size |
CN108563418A (en) * | 2017-12-28 | 2018-09-21 | 珠海市君天电子科技有限公司 | A kind of audio volume adjusting method, device, electronic equipment and storage medium |
CN108769798A (en) * | 2018-06-01 | 2018-11-06 | 深圳市茁壮网络股份有限公司 | A kind of method of adjustment and system of volume |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW200623619A (en) * | 2004-12-30 | 2006-07-01 | Inventec Appliances Corp | Intelligent volume switching method used for multimedia |
KR101945816B1 (en) * | 2012-06-08 | 2019-02-11 | 삼성전자주식회사 | Device and method for adjusting volume in terminal |
-
2019
- 2019-08-21 CN CN201910775252.4A patent/CN110677774B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105632523A (en) * | 2015-12-24 | 2016-06-01 | 魅族科技(中国)有限公司 | Method and device for regulating sound volume output value of audio data, and terminal |
CN106775563A (en) * | 2016-12-13 | 2017-05-31 | 珠海市魅族科技有限公司 | The method and device of volume adjusting |
CN107562406A (en) * | 2017-08-28 | 2018-01-09 | 维沃移动通信有限公司 | A kind of volume adjusting method, mobile terminal and computer-readable recording medium |
CN107566652A (en) * | 2017-09-20 | 2018-01-09 | 惠州Tcl移动通信有限公司 | A kind of method, mobile terminal and the storage medium of automatic regulating volume size |
CN108563418A (en) * | 2017-12-28 | 2018-09-21 | 珠海市君天电子科技有限公司 | A kind of audio volume adjusting method, device, electronic equipment and storage medium |
CN108769798A (en) * | 2018-06-01 | 2018-11-06 | 深圳市茁壮网络股份有限公司 | A kind of method of adjustment and system of volume |
Also Published As
Publication number | Publication date |
---|---|
CN110677774A (en) | 2020-01-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110677774B (en) | Volume self-adaptive adjusting method and device, computer equipment and storage medium | |
CN110191396B (en) | Audio processing method, device, terminal and computer readable storage medium | |
US8320586B2 (en) | System and method for reducing volume spike in an electronic device | |
WO2017215657A1 (en) | Sound effect processing method, and terminal device | |
CN102693737B (en) | Volume adjusting method and device | |
CN106060261B (en) | Audio playing device and method | |
CN107465824B (en) | Volume adjusting method and device, mobile terminal and storage medium | |
CN105204761B (en) | A kind of volume adjusting method and user terminal | |
CN109982231B (en) | Information processing method, device and storage medium | |
EP4131267A1 (en) | Method, apparatus, and computer program product for including device playback preferences | |
CN105430492A (en) | Audio output control method and audio output control device | |
CN109217834A (en) | Gain adjusting method, audio frequency apparatus and readable storage medium storing program for executing | |
CN111033614B (en) | Volume adjusting method and device, mobile terminal and storage medium | |
US20230289622A1 (en) | Volume recommendation method and apparatus, device and storage medium | |
TW201944251A (en) | Volume adjustment method and apparatus, electronic device and storage medium | |
CN107566618A (en) | volume adjusting method, device, terminal device and storage medium | |
CN107436751A (en) | volume adjusting method, device, terminal device and storage medium | |
CN107682802B (en) | Method and device for debugging sound effect of audio equipment | |
CN106095379B (en) | A kind of volume adjusting method and device | |
CN110799936A (en) | Volume adjusting method and device, terminal equipment and storage medium | |
CN107483734A (en) | volume adjusting method, device, terminal device and storage medium | |
CN105516451A (en) | Sound effect adjustment method and device | |
CN105280203A (en) | Audio playing method and user equipment | |
CN106601268A (en) | Multimedia data processing method and device | |
CN107506168A (en) | volume adjusting method, device, terminal device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |