WO2019033941A1 - 音量调节方法、装置、终端设备及存储介质 - Google Patents
音量调节方法、装置、终端设备及存储介质 Download PDFInfo
- Publication number
- WO2019033941A1 WO2019033941A1 PCT/CN2018/098651 CN2018098651W WO2019033941A1 WO 2019033941 A1 WO2019033941 A1 WO 2019033941A1 CN 2018098651 W CN2018098651 W CN 2018098651W WO 2019033941 A1 WO2019033941 A1 WO 2019033941A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- amplitude
- audio
- information
- adjustment coefficient
- volume
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/16—Sound input; Sound output
- G06F3/165—Management of the audio stream, e.g. setting of volume, audio stream path
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F1/00—Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
- G06F1/26—Power supply means, e.g. regulation thereof
- G06F1/32—Means for saving power
- G06F1/3203—Power management, i.e. event-based initiation of a power-saving mode
- G06F1/3234—Power saving characterised by the action undertaken
- G06F1/325—Power saving in peripheral device
Definitions
- the present disclosure relates to the field of computer technology, for example, to a volume adjustment method, apparatus, terminal device, and storage medium.
- terminal devices With the increasing popularity of terminal devices, more and more users use terminal devices to perform various functions to meet their own needs, such as reading text, watching videos, listening to music, and playing games using terminal devices.
- terminal device is playing audio and video, the adjustment of the volume level is flawed and needs to be improved.
- the disclosure provides a volume adjustment method, device, terminal device and storage medium, which improves the volume adjustment efficiency and reduces the power consumption of the terminal device.
- Embodiments of the present disclosure provide a volume adjustment method, including:
- the audio amplitude is adjusted according to the amplitude adjustment coefficient.
- the embodiment of the present disclosure further provides a volume adjustment apparatus, including:
- An amplitude determining module configured to determine an audio amplitude corresponding to the audio information according to the audio information
- the adjustment coefficient determining module is configured to obtain volume information of the terminal device, and determine an amplitude adjustment coefficient corresponding to the volume information according to the volume information;
- the adjustment module is configured to adjust the audio amplitude according to the amplitude adjustment coefficient.
- An embodiment of the present disclosure further provides a terminal device, including: a processor, a memory, and a computer program stored on the memory and executable on the processor, the processor executing the computer program to implement an embodiment of the present disclosure The volume adjustment method described.
- Embodiments of the present disclosure also provide a storage medium including terminal device executable instructions for performing a volume adjustment method according to an embodiment of the present disclosure when executed by a terminal device processor.
- the technical solution provided by the embodiment of the present disclosure improves the volume adjustment efficiency and reduces the power consumption of the terminal device.
- FIG. 1 is a flowchart of a volume adjustment method according to an embodiment of the present disclosure
- FIG. 2 is a flowchart of a volume adjustment method according to another embodiment of the present disclosure.
- FIG. 3 is a flowchart of a volume adjustment method according to another embodiment of the present disclosure.
- FIG. 4 is a flowchart of a volume adjustment method according to another embodiment of the present disclosure.
- FIG. 5 is a structural block diagram of a volume adjustment apparatus according to an embodiment of the present disclosure.
- FIG. 6 is a schematic structural diagram of a terminal device according to an embodiment of the present disclosure.
- FIG. 1 is a flowchart of a method for adjusting a volume according to an embodiment of the present disclosure.
- the present embodiment is applicable to a situation in which a terminal device performs volume adjustment when playing a sound source.
- the method may be performed by a terminal device provided by an embodiment of the present disclosure.
- the volume adjustment device of the terminal device can be implemented by using software and/or hardware. As shown in FIG. 1 , the volume adjustment method provided in this embodiment includes the following steps.
- Step 101 Acquire audio information of the sound source when detecting that the terminal device performs sound source playback.
- the terminal device can play the sound source through the installed third-party application or the audio and video playback software that comes with the system.
- the playing of the sound source mainly includes the steps of acquiring, decoding, and outputting the sound source file.
- the obtained sound source file may be a multicast stream received through a network, or may be an audio and video file stored locally by the terminal device.
- the sound source file is loaded into a memory buffer, and the sound source file loaded into the memory buffer is decoded. Before the decoding starts, if the sound source file contains video data at the same time, separation of the audio data and the video data is required, and the separated audio data is input to the audio decoder.
- the audio decoder is mainly used for reading audio data in the memory buffer, obtaining a digital audio signal, and converting the digital audio signal into an analog audio signal, and the playing device of the terminal device performs the analog audio signal according to the analog audio signal. Audio Player.
- the triggering event may be that the playing button displayed in the touch screen is detected to be pressed, or may be determined to determine that the terminal device performs sound source playing when the playing device of the terminal device detects that the sound starts playing.
- the audio information of the sound source is acquired.
- the digital audio signal decoded by the audio decoder may be sampled to determine audio information corresponding to the audio source.
- the original file of the currently played sound source may also be acquired, and the audio information corresponding to the sound source is determined by parsing the original file.
- the audio information of the sound source can be obtained through the android.media.MediaRecorder class or the android.media.AudioRecord class.
- Step 102 Determine an audio amplitude corresponding to the audio information according to the audio information.
- Amplitude refers to the maximum distance from the original position during the vibration of the object.
- the loudness of the sound heard by the human ear is related to the amplitude of the sound source. The louder the amplitude, the stronger the loudness.
- the digital audio signal decoded by the audio decoder may be sampled to obtain amplitude information within a preset time period T.
- the amplitude information may be composed of a plurality of amplitude values, and the amplitude curves of the sound sources played during the preset time period T may be correspondingly determined according to the obtained plurality of amplitude values.
- the audio information of the audio source can be obtained by using the android.media.MediaRecorder class or the android.media.AudioRecord class to obtain the amplitude of the audio amplitude corresponding to the audio information.
- the amplitude of the audio amplitude corresponding to the audio information may be obtained by parsing the original file.
- the amplitude is determined every preset time (eg, 1 second (s), 3 s, or 10 s), or the amplitude of each frame of the audio information is determined in real time.
- the acquiring the audio information of the sound source includes: acquiring audio frame information of the sound source; and correspondingly, determining an audio amplitude corresponding to the audio information according to the audio information, including: according to the audio The frame information determines an audio amplitude of each frame of the audio frame information.
- the sound source file is parsed to obtain an audio frame sequence, and the audio amplitude corresponding to each frame is determined according to each frame of the audio frame sequence.
- Step 103 Obtain volume information of the terminal device, determine an amplitude adjustment coefficient corresponding to the volume information according to the volume information, and adjust the audio amplitude according to the amplitude adjustment coefficient.
- the acquired volume information may be one or more of current volume value information, volume increase information, and volume decrease information of the terminal device. Determining, according to the volume information, the amplitude adjustment coefficient corresponding to the volume information may be determined according to one or more of current volume value information, volume increase information, and volume decrease information in the volume information.
- the terminal device is divided into 18 adjustable levels from mute to maximum volume, and each level corresponds to a volume value.
- the volume can be acquired by the volume management component of the system (get volume)
- the method obtains the current volume value of the system; when the user increases or decreases the volume through the adjustment button or the touch screen of the terminal device, it is determined whether the volume of the current terminal device is increased or decreased.
- the amplitude adjustment coefficient corresponding to the volume information is determined according to the current volume value, as shown in Table 1:
- the amplitude adjustment coefficient corresponding to the volume information is determined according to the current volume increase information or volume reduction information, as shown in Table 2:
- the amplitude adjustment coefficient may be jointly determined according to the volume increase information or the volume decrease information in combination with the volume value of the current terminal to implement adjustment on the audio amplitude.
- the amplitudes of the audio amplitudes to be adjusted are respectively assigned different amplitudes according to the amplitudes of the audio amplitudes of different amplitudes.
- the adjustment factor is shown in Table 3:
- Audio amplitude Amplitude adjustment factor Less than -10db and greater than -50db 2 Less than -3db and greater than -10db 1.5
- the audio amplitude belongs to the high amplitude region, and the amplitude adjustment coefficient is 1.5 for the audio amplitude, and the amplitude of the audio amplitude is smaller than
- -10 db is greater than -50 db
- the audio amplitude belongs to the mid-amplitude region, and the amplitude of the audio amplitude is assigned an amplitude adjustment coefficient of 2 to significantly increase the amplitude of the mid-amplitude region.
- the determined amplitude adjustment coefficient is reasonably allocated according to different amplitudes to obtain a suitable output volume, so that the user's sense of hearing is better, and the volume adjustment efficiency is improved.
- the amplitude distribution according to the amplitude of the audio amplitude is an amplitude amplitude of different amplitudes.
- the different amplitude adjustment coefficients include: assigning a first amplitude adjustment coefficient to the audio amplitude whose amplitude is greater than the first preset threshold or less than the third preset threshold, and the amplitude is less than or equal to the first preset threshold and greater than the second preset.
- the audio amplitude of the threshold is assigned a second amplitude adjustment coefficient
- the third amplitude adjustment coefficient is allocated to the audio amplitude whose amplitude magnitude is less than or equal to the second preset threshold and greater than the third preset threshold, wherein the first amplitude adjustment coefficient is smaller than The second amplitude adjustment coefficient is smaller than the third amplitude adjustment coefficient.
- the first preset threshold may be -3 db
- the second preset threshold may be -10 db
- the third preset threshold may be -50 db
- the first amplitude adjustment coefficient is 1 (ie, no adjustment is performed)
- the second amplitude adjustment coefficient is 1.4
- the third amplitude adjustment coefficient is 1.8.
- amplitude adjustment is not performed for an audio amplitude having an excessively large amplitude (for example, greater than -3 db) or an amplitude being too small (for example, less than -50 db), thereby avoiding breakage caused by excessive amplitude adjustment.
- the problem of noise enhancement caused by the increase of too small noise is avoided, and the volume adjustment method is further optimized.
- adjusting the audio amplitude according to the amplitude adjustment coefficient comprises: adjusting an audio amplitude of each frame of the audio frame according to the amplitude adjustment coefficient.
- the data representing the amplitude information in the obtained audio data may be modified by parsing the sound source file containing the audio information, and then the package is modified after the modification.
- the audio amplitude is correspondingly modified when buffered to the corresponding sound source file and played; or, in the decoding process of the sound source playing, the amplitude data is obtained by analyzing the obtained digital audio signal, and the amplitude data is multiplied by The corresponding adjustment factor is used to change the amplitude and thus adjust the volume of the sound source.
- the implementation of the embodiment provides that the volume of the sound source is adjusted without changing the original volume of the terminal device system, and the adjustment process may reduce the playback load before the sound source file does not enter the buffer, or It adjusts the content of the sound source in the buffer to improve the adjustment efficiency, thereby improving the volume adjustment efficiency and reducing the power consumption of the terminal device.
- FIG. 2 is a flowchart of a volume adjustment method according to another embodiment of the present disclosure.
- the method before the assigning different amplitude adjustment coefficients according to the amplitudes of the amplitudes of the audio amplitudes of different amplitudes, the method further includes: determining that the audio amplitude corresponding to the audio information meets the preset frequency Allocating different amplitude adjustment coefficients according to amplitude amplitudes in the audio amplitudes for different amplitude magnitudes of audio amplitudes: assigning a first amplitude adjustment coefficient to the audio amplitudes satisfying the preset frequencies;
- the audio amplitude of the preset frequency is the first amplitude adjustment coefficient that is allocated to the audio amplitude whose amplitude is greater than the first preset threshold or less than the third preset threshold, and the amplitude is less than or equal to the first preset threshold and greater than
- the audio amplitude of the second preset threshold is assigned a second amplitude adjustment coefficient, and the third amplitude adjustment coefficient
- Step 310 Acquire audio information of the sound source when detecting that the terminal device performs sound source playing.
- Step 320 Determine an audio amplitude corresponding to the audio information according to the audio information.
- Step 330 Acquire volume information of the terminal device, and determine three amplitude adjustment coefficients corresponding to the volume information according to the volume information.
- the determined three amplitude adjustment coefficients are a first amplitude adjustment coefficient, a second amplitude adjustment coefficient, and a third amplitude adjustment coefficient, respectively.
- the first amplitude adjustment coefficient is smaller than the second amplitude adjustment coefficient
- the second amplitude adjustment coefficient is smaller than the third amplitude adjustment coefficient.
- the first amplitude adjustment coefficient is 1 (ie, no adjustment is made)
- the second amplitude adjustment coefficient is 1.4
- the third amplitude adjustment coefficient is 1.8.
- Step 340 Determine an audio amplitude that satisfies a preset frequency in the audio information, and allocate a first amplitude adjustment coefficient to the audio amplitude that satisfies the preset frequency.
- the first amplitude adjustment factor may be 1, ie, the magnitude of the audio amplitude is not adjusted.
- the preset frequency may be 300 Hz (hz), that is, when an audio amplitude of a fixed frequency of 300 hz is detected in the audio information, the audio amplitude is used as noise, and the amplitude of the audio is not amplitude-adjusted to Avoid the problem of synchronously amplifying the noise, and at the same time, further improve the volume adjustment efficiency.
- Step 350 For an audio amplitude that does not satisfy the preset frequency, assign the first amplitude adjustment coefficient to an audio amplitude whose amplitude is greater than a first preset threshold or less than a third preset threshold, and the amplitude is less than or equal to the first
- the audio amplitude of the preset threshold and greater than the second preset threshold is assigned a second amplitude adjustment coefficient, and the third amplitude adjustment coefficient is allocated for the audio amplitude whose amplitude is less than or equal to the second preset threshold and greater than the third preset threshold.
- the first preset threshold is greater than the second preset threshold, and the second preset threshold is greater than the third preset threshold.
- the first preset threshold is -3db
- the second preset threshold is -10db
- the third preset threshold is -50db.
- the volume adjustment efficiency is further improved.
- FIG. 3 is a flowchart of a volume adjustment method according to another embodiment of the present disclosure.
- the method before determining the amplitude adjustment coefficient corresponding to the volume information according to the volume information, the method further includes: determining an impedance value of the playing device of the terminal device; determining the volume according to the volume information
- the amplitude adjustment coefficient corresponding to the information includes: determining an amplitude adjustment coefficient corresponding to the volume information according to the impedance value and the volume information.
- the solution provided in this embodiment includes:
- Step 301 Acquire audio information of the sound source when detecting that the terminal device performs sound source playing.
- Step 302 Determine an audio amplitude corresponding to the audio information according to the audio information.
- Step 303 Acquire volume information of the terminal device and determine an impedance value of the playback device of the terminal device.
- the impedance value of the playback device (eg, speaker) installed in the terminal device may be detected by the power amplifier chip, or the impedance of the playback device may be physically detected.
- Step 304 Determine an amplitude adjustment coefficient corresponding to the volume information according to the impedance value and the volume information.
- the amplitude adjustment coefficient is determined together with the impedance values of the playback device of the terminal device determined in step 303.
- the larger the impedance value the larger the amplitude adjustment coefficient determined by the impedance value and the volume information.
- the corresponding amplitude adjustment coefficient determined by the impedance value and the volume information may be determined only by the volume information.
- the amplitude adjustment coefficient is 1.2 times as the final determined amplitude adjustment coefficient.
- the impedance value of the playback device is introduced as one of the parameters for determining the amplitude adjustment coefficient, thereby avoiding the increase of the playing device with the playing time, and the impedance value is getting higher and higher, resulting in normal
- the volume of the playback process has an impact problem, so that the adjusted volume is better in accordance with the user's needs, further improving the volume adjustment effect.
- Step 305 Adjust the audio amplitude according to the amplitude adjustment coefficient.
- FIG. 4 is a flowchart of a volume adjustment method according to another embodiment of the present disclosure.
- the method before determining the amplitude adjustment coefficient corresponding to the audio amplitude according to the volume information, the method further includes: determining a noise value of an environment in which the terminal device is currently located; the determining according to the volume information
- the amplitude adjustment coefficient corresponding to the volume information includes: determining an amplitude adjustment coefficient corresponding to the volume information according to the noise value and the volume information.
- the solution provided in this embodiment includes:
- Step 401 Acquire audio information of the sound source when detecting that the terminal device performs sound source playback.
- Step 402 Determine an audio amplitude corresponding to the audio information according to the audio information.
- Step 403 Obtain volume information of the terminal device and determine a noise value of the environment in which the terminal device is currently located.
- the noise of the current environment can be collected by a microphone installed by the terminal device to determine a corresponding noise value.
- Step 404 Determine an amplitude adjustment coefficient corresponding to the volume information according to the noise value and the volume information.
- the noise value of the terminal device in a quiet environment is y
- the determined noise value is 1.5 y when the terminal device is in an outdoor or noisy environment
- the corresponding amplitude adjustment determined by the noise value and the volume information is performed.
- the coefficient may be 1.5 times the amplitude adjustment coefficient determined only by the volume information.
- the amplitude adjustment coefficient may also be determined jointly based on the impedance value, the noise value, and the volume information.
- Step 405 Adjust the audio amplitude according to the amplitude adjustment coefficient.
- FIG. 5 is a structural block diagram of a volume adjustment apparatus according to an embodiment of the present disclosure.
- the apparatus is configured to perform the volume adjustment method provided by the foregoing embodiment, and has a function module and a beneficial effect corresponding to the execution method.
- the apparatus includes an acquisition module 10, an amplitude determination module 20, an adjustment coefficient determination module 30, and an adjustment module 40.
- the obtaining module 10 is configured to acquire audio information of the sound source when detecting that the terminal device performs sound source playing.
- the terminal device can play the sound source through the installed third-party application or the audio and video playback software that comes with the system.
- the playing of the sound source mainly includes the steps of acquiring, decoding, and outputting the sound source file.
- the obtained sound source file may be a multicast stream received through a network, or may be an audio and video file stored locally by the terminal device.
- the sound source file is loaded into the memory buffer, and the sound source file loaded into the memory buffer is decoded. Before the decoding starts, if the sound source file contains video data at the same time, separation of the audio data and the video data is required, and the separated audio data is input to the audio decoder.
- the audio decoder is mainly used for reading audio data in the memory buffer, obtaining a digital audio signal, and converting the digital audio signal into an analog audio signal, and the playing device of the terminal device performs the audio signal according to the analog audio signal. Audio Player.
- the triggering event may be that the playing button displayed in the touch screen is detected to be pressed, or may be determined to determine that the terminal device performs sound source playing when the playing device of the terminal device detects that the sound starts playing.
- the audio information of the sound source is acquired.
- the digital audio signal decoded by the audio decoder may be sampled to determine audio information corresponding to the audio source.
- the original file of the currently played sound source may also be acquired, and the audio information corresponding to the sound source is determined by parsing the original file.
- the audio information of the audio source can be obtained through the android.media.MediaRecorder class or the android.media.AudioRecord class.
- the amplitude determining module 20 is configured to determine an audio amplitude corresponding to the audio information according to the audio information.
- Amplitude refers to the maximum distance from the original position during the vibration of the object.
- the loudness of the sound heard by the human ear is related to the amplitude of the sound source. The louder the amplitude, the stronger the loudness.
- the digital audio signal decoded by the audio decoder may be sampled to obtain amplitude information within a preset time period T.
- the amplitude information may be composed of a plurality of amplitude values, and the amplitude curves of the sound sources played during the preset time period T may be correspondingly determined according to the obtained plurality of amplitude values.
- the audio information of the audio source can be obtained by using the android.media.MediaRecorder class or the android.media.AudioRecord class to obtain the amplitude corresponding to the audio information.
- the amplitude of the audio information may be obtained by parsing the original file.
- the amplitude when detecting the sound source playing, the amplitude is determined once every preset time (eg, 1 s, 3 s, or 10 s), or the amplitude of each frame of the audio information of the audio information is determined in real time.
- the acquiring module 10 is configured to: when detecting that the terminal device performs sound source playing, acquire audio frame information of the sound source; the amplitude determining module 20 is configured to: according to the audio frame information The audio amplitude of each frame of the audio frame information is determined.
- the sound source file is parsed to obtain an audio frame sequence, and the corresponding audio amplitude is determined according to each frame of the audio frame sequence.
- the adjustment coefficient determining module 30 is configured to acquire volume information of the terminal device, and determine an amplitude adjustment coefficient corresponding to the audio amplitude according to the volume information.
- the adjustment module 40 is configured to adjust the audio amplitude according to the amplitude adjustment coefficient.
- the acquired volume information may be one or more of current volume value information, volume increase information, and volume decrease information of the terminal device.
- determining the amplitude adjustment coefficient corresponding to the volume information according to the volume information may be determined according to one or more of current volume value information, volume increase information, and volume decrease information in the volume information.
- the terminal device is divided into 18 adjustable levels from mute to maximum volume, and each level corresponds to a volume value.
- the system can be obtained by the get volume method of the volume management component of the system.
- the current volume value when the user adjusts the volume or decreases the adjustment through the adjustment button or the touch screen of the terminal device, it is determined whether the volume of the current terminal device is increased or decreased.
- the amplitude adjustment factor corresponding to the volume information is determined based on the current volume value.
- the amplitude adjustment coefficient corresponding to the volume information is determined according to the current volume increase information or volume reduction information.
- the amplitude adjustment factor may also be determined in conjunction with the volume increase information or volume reduction information in conjunction with the volume value of the current terminal to effect adjustment of the audio amplitude.
- the adjustment coefficient determining module 30 is configured to determine an amplitude adjustment coefficient corresponding to the volume information by determining at least two amplitude adjustment coefficients corresponding to the volume information according to the volume information;
- the module 40 is configured to assign different amplitude adjustment coefficients to the audio amplitudes of different amplitude sizes according to the amplitude of the audio amplitude, and adjust the audio amplitude of the corresponding amplitude according to the allocated amplitude adjustment coefficients.
- two amplitude adjustment coefficients corresponding to the volume information such as 1.5 and 2 are determined according to the volume information, different amplitude adjustments are assigned to the audio amplitudes of different amplitudes according to the magnitude of the audio amplitude to be adjusted. coefficient.
- the audio amplitude of the amplitude of the audio amplitude when the amplitude of the amplitude of the audio amplitude is less than -3 db and greater than -10 db, the audio amplitude belongs to a high amplitude region, and the amplitude of the audio amplitude is assigned an amplitude adjustment coefficient of 1.5, when the amplitude of the audio amplitude is less than -10 db and When it is larger than -50 db, the audio amplitude belongs to the medium amplitude region, and the amplitude adjustment coefficient is 2 for the audio amplitude to significantly increase the amplitude of the medium amplitude region.
- the determined amplitude adjustment coefficient is reasonably allocated according to different amplitudes to obtain a suitable output volume, so that the user's sense of hearing is more improved, and the volume adjustment efficiency is improved.
- the adjustment module 40 is configured to be based on the amplitude of the audio amplitude according to the following manner. Audio amplitudes of different amplitudes are assigned different amplitude adjustment coefficients: a first amplitude adjustment coefficient is allocated for an audio amplitude whose amplitude is larger than a first preset threshold or smaller than a third preset threshold, and the amplitude is less than or equal to a first preset threshold.
- the second amplitude adjustment coefficient is allocated to the audio amplitude that is greater than the second preset threshold
- the third amplitude adjustment coefficient is allocated to the audio amplitude whose amplitude is less than or equal to the second preset threshold and greater than the third preset threshold.
- An amplitude adjustment coefficient is smaller than the second amplitude adjustment coefficient
- the second amplitude adjustment coefficient is smaller than the third amplitude adjustment coefficient.
- the first preset threshold may be -3db
- the second preset threshold may be -10db
- the third preset threshold may be -50db
- the first amplitude adjustment coefficient is 1 (ie, no The adjustment is made)
- the second amplitude adjustment coefficient is 1.4
- the third amplitude adjustment coefficient is 1.8.
- amplitude adjustment is not performed for an audio amplitude having an excessively large amplitude (for example, greater than -3 db) or an amplitude being too small (for example, less than -50 db), thereby avoiding breakage caused by excessive amplitude adjustment.
- the problem of noise enhancement caused by the increase of too small noise is avoided, and the volume adjustment method is further optimized.
- the adjustment module 40 is configured to adjust an audio amplitude of each frame of the audio frame according to the amplitude adjustment coefficient.
- the data representing the amplitude information in the obtained audio data may be modified by parsing the sound source file containing the audio information, and then the package is modified after the modification.
- the audio amplitude is correspondingly modified when buffered to the corresponding sound source file and played; or, in the decoding process of the sound source playing, the amplitude data is obtained by analyzing the obtained digital audio signal, and the amplitude data is multiplied by The corresponding adjustment factor is used to change the amplitude and thus adjust the volume of the sound source.
- the volume of the sound source is adjusted without changing the original volume of the terminal device system, and the adjustment process may reduce the playback load before the sound source file does not enter the buffer, or may be in the buffer.
- the sound source content is adjusted to improve the adjustment efficiency, thereby improving the volume adjustment efficiency and reducing the power consumption of the terminal device.
- the technical solution provided by the embodiment when detecting that the terminal device performs sound source playing, acquires audio information of the sound source; determines an audio amplitude corresponding to the audio information according to the audio information; and acquires volume information of the terminal device, according to The volume information determines an amplitude adjustment coefficient corresponding to the volume information; and the audio amplitude is adjusted according to the amplitude adjustment coefficient.
- the solution improves the volume adjustment efficiency and reduces the power consumption of the terminal device.
- the adjustment factor determination module 30 is configured to:
- the amplitude adjustment coefficient corresponding to the volume information is determined according to the current volume value information, the volume increase information, or the volume decrease information of the terminal device.
- the adjustment factor determination module 30 is configured to:
- the adjustment module 40 is configured to:
- Different amplitude adjustment coefficients are assigned to the audio amplitudes of different amplitude magnitudes according to the magnitude of the amplitude in the audio amplitude, and the allocated amplitude adjustment coefficients adjust the audio amplitudes corresponding to the amplitude magnitudes.
- the adjustment module 40 is configured to be different according to the amplitude of the audio amplitude according to the following manner.
- the amplitude of the audio amplitude is assigned different amplitude adjustment factors:
- the amplitude determining module 20 is further configured to:
- the audio amplitudes corresponding to the preset frequencies are determined among the audio amplitudes corresponding to the audio information.
- the adjusting module 40 is configured to allocate different amplitude adjustment coefficients according to amplitude amplitudes in the audio amplitudes to different amplitude magnitudes by assigning a first amplitude adjustment coefficient to the audio amplitude satisfying the preset frequency. And for the audio amplitude that does not satisfy the preset frequency, the first amplitude adjustment coefficient is allocated for an audio amplitude whose amplitude is greater than a first preset threshold or less than a third preset threshold, and the amplitude is less than or equal to the first pre-
- the second amplitude adjustment coefficient is allocated to the audio amplitude of the threshold and greater than the second preset threshold, and the third amplitude adjustment coefficient is allocated to the audio amplitude whose amplitude is less than or equal to the second preset threshold and greater than the third preset threshold;
- the first preset threshold is greater than the second preset threshold, the second preset threshold is greater than the third preset threshold, and the first amplitude adjustment coefficient is smaller than the second amplitude adjustment coefficient,
- the adjustment coefficient determining module 30 is further configured to determine an impedance value of the playing device of the terminal device before determining the amplitude adjusting coefficient corresponding to the volume information according to the volume information;
- the adjustment coefficient determining module 30 is configured to determine an amplitude adjustment coefficient corresponding to the volume information by determining an amplitude adjustment coefficient corresponding to the volume information according to the impedance value and the volume information.
- the adjustment coefficient determining module 30 is further configured to: before determining the amplitude adjustment coefficient corresponding to the volume information according to the volume information, determining a noise value of an environment in which the terminal device is currently located; The adjustment coefficient determining module 30 is configured to determine an amplitude adjustment coefficient corresponding to the volume information by determining an amplitude adjustment coefficient corresponding to the volume information according to the noise value and the volume information.
- the volume information includes: current volume value information of the terminal device and one of the following two information: volume increase information and volume decrease information.
- FIG. 6 is a schematic structural diagram of a terminal device according to an embodiment of the present disclosure.
- the terminal device 200 includes: a memory 201, a central processing unit (CPU) 202, a peripheral interface 203, and a radio frequency. (Radio Frequency, RF) circuit 205, audio circuit 206, speaker 211, power management chip 208, input/output (I/O) subsystem 209, touch screen 212, other input/control devices 210, and external port 204, these components pass One or more communication buses or signal lines 207 are in communication.
- RF Radio Frequency
- the terminal device 200 illustrated in FIG. 6 is merely an example of a terminal device, and the terminal device 200 may have more or fewer components than those illustrated in FIG. 6, and two or more components may be combined, or Can have different component configurations.
- the various components shown in FIG. 6 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
- the terminal device 200 provided in this embodiment is described below.
- the terminal device 200 takes a smart phone as an example.
- the memory 201 can be accessed by the CPU 202 and the peripheral interface 203, etc., and the memory 201 can include a high speed random access memory, and can also include a nonvolatile memory such as one or more magnetic disk storage devices, flash memory devices. Or other volatile solid-state storage devices.
- Peripheral interface 203 which can connect the input and output peripherals of the device to CPU 202 and memory 201.
- the I/O subsystem 209 which can connect input peripherals and output peripherals on the device, such as touch screen 212 and other input/control devices 210, to peripheral interface 203.
- the I/O subsystem 209 can include a display controller 2091 and one or more input controllers 2092 that are configured to control other input/control devices 210.
- one or more input controllers 2092 receive electrical signals from other input/control devices 210 or transmit electrical signals to other input/control devices 210, and other input/control devices 210 may include physical buttons (pressing buttons or rocker buttons, etc.) ), dial, slide switch, joystick or click on the wheel.
- the input controller 2092 can be coupled to any of the following: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.
- the touch screen 212 is an input interface and an output interface between the user terminal and the user, and displays the visual output to the user.
- the visual output may include graphics, text, icons, videos, and the like.
- Display controller 2091 in I/O subsystem 209 receives electrical signals from touch screen 212 or transmits electrical signals to touch screen 212.
- the touch screen 212 detects the contact on the touch screen 212, and the display controller 2091 converts the detected contact into an interaction with the user interface object displayed on the touch screen 212, that is, realizes human-computer interaction, and the user interface object displayed on the touch screen 212 may be Run the game's icons or icons that are networked to the appropriate network.
- the terminal device 200 may further include a light mouse, which is a touch sensitive surface that does not display a visual output, or an extension of a touch sensitive surface formed by the touch screen.
- the RF circuit 205 is configured to establish communication between the mobile phone and the wireless network (ie, the network side) to implement data reception and transmission between the mobile phone and the wireless network. For example, sending and receiving short messages or emails.
- the RF circuit 205 receives and transmits an RF signal, also referred to as an electromagnetic signal, and the RF circuit 205 converts the electrical signal into an electromagnetic signal or converts the electromagnetic signal into an electrical signal, and through the electromagnetic signal and communication network And other devices to communicate.
- the RF circuit 205 may include known circuitry for performing these functions, including but not limited to an antenna system, an RF transceiver, one or more amplifiers, a tuner, one or more oscillators, a digital signal processor, Coder-CODEter (CODEC) chipset and Subscriber Identity Module (SIM) and so on.
- CDDEC Coder-CODEter
- SIM Subscriber Identity Module
- the audio circuit 206 is arranged to receive audio data from the peripheral interface 203, convert the audio data into an electrical signal, and transmit the electrical signal to the speaker 211.
- the speaker 211 is arranged to restore the voice signal received by the mobile phone from the wireless network through the RF circuit 205 to sound and play the sound to the user.
- the power management chip 208 is configured to provide power and power management for the hardware connected to the CPU 202, the I/O subsystem, and the peripheral interface.
- the volume adjustment device and the terminal device of the terminal device provided in the foregoing embodiments may perform the volume adjustment method of the terminal device provided by any embodiment of the present disclosure, and have corresponding function modules and beneficial effects for performing the method.
- the volume adjustment method of the terminal device provided by any embodiment of the present disclosure may perform the volume adjustment method of the terminal device provided by any embodiment of the present disclosure, and have corresponding function modules and beneficial effects for performing the method.
- Embodiments of the present disclosure also provide a storage medium including terminal device executable instructions for performing a volume adjustment method when executed by a terminal device processor, the method comprising:
- the determining, according to the volume information, an amplitude adjustment coefficient corresponding to the volume information including:
- determining the amplitude adjustment coefficient corresponding to the volume information according to the volume information comprises: determining at least two amplitude adjustment coefficients corresponding to the volume information according to the volume information.
- the adjusting the audio amplitude according to the amplitude adjustment coefficient comprises:
- Different amplitude adjustment coefficients are assigned to the amplitudes of the amplitudes of the audio amplitudes according to the amplitudes of the amplitudes, and the audio amplitudes of the corresponding amplitudes are adjusted according to the allocated amplitude adjustment coefficients.
- the magnitude of the amplitude according to the audio amplitude is an audio amplitude of the different amplitude magnitude.
- Assigning different amplitude adjustment factors includes:
- the method further includes: determining an audio amplitude of the audio information that satisfies a preset frequency; and assigning different amplitude adjustment coefficients to the audio amplitudes of different amplitudes according to the amplitude of the audio amplitudes, including : assigning a first amplitude adjustment coefficient to the audio amplitude that satisfies the preset frequency; and for an audio amplitude that does not satisfy the preset frequency, the audio amplitude distribution that is greater than the first preset threshold or smaller than the third preset threshold
- the first amplitude adjustment coefficient is an audio amplitude distribution second amplitude adjustment coefficient whose amplitude magnitude is less than or equal to the first preset threshold and greater than the second preset threshold, and the amplitude
- the third amplitude adjustment coefficient is allocated to the audio amplitude of the three preset thresholds; wherein the first preset threshold is greater than the a second preset threshold, the second preset threshold is greater than the third preset threshold, the first amplitude adjustment coefficient is smaller than the second amplitude adjustment coefficient, and the second amplitude adjustment coefficient is smaller than the third amplitude Adjustment coefficient. .
- the method before determining the amplitude adjustment coefficient corresponding to the volume information according to the volume information, the method further includes: determining an impedance value of the playback device of the terminal device; determining, according to the volume information
- the amplitude adjustment coefficient corresponding to the volume information includes: determining an amplitude adjustment coefficient corresponding to the volume information according to the impedance value and the volume information.
- the method before determining the amplitude adjustment coefficient corresponding to the volume information according to the volume information, the method further includes: determining a noise value of an environment in which the terminal device is currently located; and determining, according to the volume information
- the amplitude adjustment coefficient corresponding to the volume information includes: determining an amplitude adjustment coefficient corresponding to the volume information according to the noise value and the volume information.
- the volume information includes: current volume value information of the terminal device and one of the following two information: volume increase information and volume decrease information.
- the acquiring the audio information of the sound source includes: acquiring audio frame information of the sound source; and determining, according to the audio information, an audio amplitude corresponding to the audio information, including: according to the audio The frame information determines an audio amplitude of each frame of the audio frame information; the adjusting the audio amplitude according to the amplitude adjustment coefficient, comprising: performing audio frames for each frame according to the amplitude adjustment coefficient The audio amplitude is adjusted.
- Storage medium any one or more types of memory devices or storage devices.
- the term “storage medium” includes: a mounting medium such as a Compact Disc Read-Only Memory (CD-ROM), a floppy disk or a tape device; a computer system memory or a random access memory such as dynamic random access. Memory (Dynamic Random Access Memory, DRAM), Double Data Rate Random Access Memory (DDR RAM), Static Random Access Memory (SRAM), Extended Data Output Random Access Extended Data Output Random Access Memory (EDO RAM), Rambus RAM, etc.; non-volatile memory such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory components, etc. .
- the storage medium may also include other types of memory or a combination thereof.
- the storage medium may be located in a first computer system in which the program is executed, or may be located in a different second computer system, the second computer system being coupled to the first computer system via a network, such as the Internet.
- the second computer system can provide program instructions to the first computer for execution.
- the term "storage medium" can include two or more storage media that can reside in different locations (eg, in different computer systems connected through a network).
- a storage medium may store program instructions (eg, embodied as a computer program) executable by one or more processors.
- a storage medium containing computer executable instructions, the computer executable instructions are not limited to the volume adjustment method as described above, and may also perform related operations in the volume adjustment method provided by any embodiment of the present disclosure. .
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- General Health & Medical Sciences (AREA)
- Human Computer Interaction (AREA)
- Circuit For Audible Band Transducer (AREA)
Abstract
一种音量调节方法、装置、终端设备及存储介质。该方法包括当检测到终端设备进行音源播放时,获取所述音源的音频信息;依据所述音频信息确定所述音频信息对应的音频振幅;获取终端设备的音量信息,依据所述音量信息确定所述音量信息对应的振幅调整系数;依据所述振幅调整系数对所述音频振幅进行调整。
Description
本公开要求申请日为2017年08月18日、申请号为201710711385.6、名称为“音量调节方法、装置、终端设备及存储介质”的中国专利申请的优先权,该申请的全部内容通过引用结合在本公开中。
本公开涉及计算机技术领域,例如涉及一种音量调节方法、装置、终端设备及存储介质。
随着终端设备普及程度的提高,越来越多的用户使用终端设备执行各种各样的功能以满足自身需求,如使用终端设备阅读文字、观看视频、听音乐以及玩游戏等。然而,当终端设备在播放音视频时,音量大小的调节存在缺陷,需要改进。
发明内容
本公开提供了一种音量调节方法、装置、终端设备及存储介质,提高了音量调节效率,降低了终端设备的功耗。
本公开实施例提供了一种音量调节方法,包括:
当检测到终端设备进行音源播放时,获取所述音源的音频信息;
依据所述音频信息确定所述音频信息对应的音频振幅;
获取所述终端设备的音量信息,依据所述音量信息确定所述音量信息对应的振幅调整系数;
依据所述振幅调整系数对所述音频振幅进行调整。
本公开实施例还提供了一种音量调节装置,包括:
获取模块,设置为当检测到终端设备进行音源播放时,获取所述音源的音频信息;
振幅确定模块,设置为依据所述音频信息确定所述音频信息对应的音频振幅;
调整系数确定模块,设置为获取所述终端设备的音量信息,依据所述音量信息确定所述音量信息对应的振幅调整系数;
调整模块,设置为依据所述振幅调整系数对所述音频振幅进行调整。
本公开实施例还提供了一种终端设备,包括:处理器、存储器以及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如本公开实施例所述的音量调节方法。
本公开实施例还提供了一种包含终端设备可执行指令的存储介质,所述终端设备可执行指令在由终端设备处理器执行时用于执行本公开实施例所述的音量调节方法。
本公开实施例提供的技术方案提高了音量调节效率,降低了终端设备的功耗。
图1是本公开一实施例提供的一种音量调节方法的流程图;
图2是本公开另一实施例提供的一种音量调节方法的流程图;
图3是本公开另一实施例提供的一种音量调节方法的流程图;
图4是本公开另一实施例提供的一种音量调节方法的流程图;
图5是本公开一实施例提供的一种音量调节装置的结构框图;
图6是本公开一实施例提供的一种终端设备的结构示意图。
下面结合附图和实施例对本公开作说明。可以理解的是,此处所描述的具体实施例用于解释本公开,而非对本公开的限定。另外,为了便于描述,附图中仅示出了与本公开相关的部分而非全部结构。
图1是本公开一实施例提供的一种音量调节方法的流程图,本实施例可适用于终端设备在播放音源时进行音量调节的情况,该方法可以由本公开实施例提供的终端设备来执行,该终端设备的音量调节装置可采用软件和/或硬件的方式实现,如图1所示,本实施例提供的音量调节方法包括如下步骤。
步骤101、当检测到终端设备进行音源播放时,获取所述音源的音频信息。
终端设备可通过安装的第三方应用程序或***自带的音视频播放软件进行音源的播放。在一实施例中,音源的播放主要包括音源文件的获取、解码和输出等步骤。在一实施例中,获取到的音源文件可以是通过网络接收到的组播流,还可以是终端设备本地存储的音视频文件。在一实施例中,获取到该音源文件后将该音源文件加载到内存缓冲区中,并对加载到内存缓冲区的音源文件进行解码。在解码开始之前,如果该音源文件同时包含有视频数据,需要进行音频数据和视频数据的分离,将分离后的音频数据输入至音频解码器。在一实施例中,音频解码器主要用于读取内存缓冲区中的音频数据,得到数字音频信号, 并将该数字音频信号转换为模拟音频信号,终端设备的播放器件根据该模拟音频信号进行音频播放。在一个实施例中,当监听到音源播放事件被触发时,确定终端设备开始播放音源。在一实施例中,该触发事件可以是检测到触摸屏中显示的播放按钮被按下,还可以是检测到终端设备的播放器件如喇叭开始播放声音时,确定终端设备进行音源播放。
当检测到终端设备进行音源播放时,获取所述音源的音频信息。在一个实施例中,可对音频解码器解码得到的数字音频信号进行取样,确定该音源对应的音频信息。在另一实施例中,还可以获取当前播放的音源的原始文件,通过对该原始文件的解析确定音源对应的音频信息。在另一实施例中,以安卓(Android)***为例,可通过android.media.MediaRecorder类或android.media.AudioRecord类获取音源的音频信息。
步骤102、依据所述音频信息确定所述音频信息对应的音频振幅。
振幅指物体震动过程中偏离原来位置的最大距离,人耳听到的声音的响度与音源的振幅相关,振幅越大响度越强。在一个实施例中,可对音频解码器解码得到的数字音频信号进行取样,获取预设时间段T内的振幅信息。在一实施例中,该振幅信息可由多个振幅值组成,依据得到的多个振幅值可相应的确定在该预设时间段T内播放的音源的振幅曲线。在另一实施例中,以Android***为例,可通过android.media.MediaRecorder类或android.media.AudioRecord类获取音源的音频信息后得到音频信息对应音频振幅的振幅大小。在另一实施例中,当步骤101获取到的音频信息为音源对应的原始文件时,可通过对原始文件进行解析以得到音频信息对应的音频振幅的振幅大小。
在一个实施例中,当检测到音源播放时,每隔预设时间(如1秒(s)、3s或10s)确定一次振幅,或者实时地对音频信息的每一帧音频帧的振幅进行确定。在一实施例中,所述获取所述音源的音频信息包括:获取所述音源的音频帧信息;相应的,依据所述音频信息确定所述音频信息对应的音频振幅,包括:依据所述音频帧信息确定所述音频帧信息中每一帧音频帧的音频振幅。在一实施例中,当检测到音源播放时,对音源文件进行解析得到音频帧序列,根据音频帧序列的每一帧确定每一帧对应的音频振幅。
步骤103、获取终端设备的音量信息,依据所述音量信息确定所述音量信息对应的振幅调整系数,依据所述振幅调整系数对所述音频振幅进行调整。
在一个实施例中,该获取的音量信息可以是终端设备当前的音量值信息、音量增加信息和音量减小信息中的一种或多种。依据所述音量信息确定所述音量信息对应的振幅调整系数可以是依据音量信息中的当前的音量值信息、音量增加信息和音量减小信息中的一种或多种进行确定。
在一实施例中,终端设备由静音到最大音量总共分为18个可调等级,每个等级对应一个音量值,当终端设备播放音源时,可通过***的音量管理组件的获取音量(get volume)方法得到***的当前音量值;当用户通过终端设备的调节按钮或者触摸屏进行音量增大或减小调节时,相应的确定当前终端设备的音量是增大还是减小。在一个实施例中,依据当前的音量值确定所述音量信息对应的振幅调整系数,如表1所示:
表1
音量值 | 振幅调整系数 |
5 | 0.5 |
10 | 1.5 |
15 | 2 |
在另一个实施例中,依据当前的音量增加信息或音量减小信息确定所述音量信息对应的振幅调整系数,如表2所示:
表2
音量值 | 振幅调整系数 |
增加 | 1.5 |
减小 | 0.8 |
在另一个实施例中,还可根据音量增加信息或音量减小信息结合当前终端的音量值共同确定振幅调整系数以对音频振幅实现调整。
在一个实施例中,所述依据所述音量信息确定所述音量信息对应的振幅调整系数,包括:依据所述音量信息确定所述音量信息对应的至少两个振幅调整系数;所述依据所述振幅调整系数对所述音频振幅进行调整包括:依据所述音频振幅的振幅大小为不同振幅大小的音频振幅分配不同的振幅调整系数,并根据所分配的振幅调整系数调整对应振幅大小的音频振幅。在一实施例中,如依据音量信息确定出了音量信息对应的两个振幅调节系数,如1.5和2,则依据需要调节的音频振幅的振幅大小分别为不同振幅大小的音频振幅分配不同的振幅调节系数,如表3所示:
表3
音频振幅 | 振幅调整系数 |
小于-10db且大于-50db | 2 |
小于-3db且大于-10db | 1.5 |
如表3所示,当音频振幅的振幅大小小于-3分贝(db)且大于-10db时,音频振幅属于高振幅区,为该音频振幅分配振幅调整系数为1.5,当音频振幅的振 幅大小小于-10db且大于-50db时,音频振幅属于中振幅区,为该音频振幅分配振幅调整系数为2,以显著提高中振幅区的振幅大小。由上述内容可知,当检测到终端设备播放音源时,依据不同振幅大小合理分配确定出的振幅调整系数,以得到合适的输出音量,使得用户的听感更佳,提高了音量调节效率。
在另一个实施例中,当依据所述音量信息确定的所述音量信息对应的振幅调整系数的数目为3个时,所述依据所述音频振幅中的振幅大小为不同振幅大小的音频振幅分配不同的振幅调整系数包括:为振幅大小大于第一预设阈值或小于第三预设阈值的音频振幅分配第一振幅调整系数,为振幅大小小于或等于第一预设阈值且大于第二预设阈值的音频振幅分配第二振幅调整系数,为振幅大小小于或等于第二预设阈值且大于第三预设阈值的音频振幅分配第三振幅调整系数,其中,所述第一振幅调整系数小于所述第二振幅调整系数,所述第二振幅调整系数小于所述第三振幅调整系数。在一实施例中,该第一预设阈值可以是-3db,第二预设阈值可以是-10db,第三预设阈值可以是-50db,第一振幅调整系数为1(即不进行调整),第二振幅调整系数为1.4,第三振幅调整系数为1.8。在一实施例中,对于振幅过大(例如,大于-3db)或振幅过小(例如,小于-50db)的音频振幅不进行振幅调节,避免了对过大振幅调节后造成的破音,也避免了对过小的噪音进行调高带来的杂音增强的问题,进一步优化了音量调节方法。
在一个实施例中,依据所述振幅调整系数对所述音频振幅进行调整,包括:依据所述振幅调整系数对所述每一帧音频帧的音频振幅进行调整。
在一个实施例中,在对音频振幅进行调整的过程中,可通过对包含音频信息的音源文件进行解析,对得到的音频数据中的表征振幅信息的数据进行修改,修改完毕后再进行封装,当缓冲到对应的音源文件并被播放时音频振幅相应的已被修改;还可以是,在音源播放的解码过程中,通过对得到的数字音频信号进行分析得到振幅数据,将该振幅数据乘以对应的调节系数以改变振幅大小,进而对音源的音量进行调节。
由此,本实施例提供的实现了在不改变终端设备***原有音量的前提下对音源音量的大小进行了调节,调节过程可以在音源文件未进入缓冲区前,以减少播放负载,也可以是针对缓冲区中的音源内容进行调节以提高调节效率,从而提高了音量调节效率,降低了终端设备的功耗。
图2是本公开另一实施例提供的一种音量调节方法的流程图。在一实施例中,在所述依据所述音频振幅中的振幅大小为不同振幅大小的音频振幅分配不同的振幅调整系数之前,还包括:确定所述音频信息对应的音频振幅中满足预设频率的音频振幅;所述依据所述音频振幅中的振幅大小为不同振幅大小的音 频振幅分配不同的振幅调整系数包括:为所述满足预设频率的音频振幅分配第一振幅调整系数;对于不满足所述预设频率的音频振幅,为振幅大小大于第一预设阈值或小于第三预设阈值的音频振幅分配所述第一振幅调整系数,为振幅大小小于或等于第一预设阈值且大于第二预设阈值的音频振幅分配第二振幅调整系数,为振幅大小小于或等于第二预设阈值且大于第三预设阈值的音频振幅分配第三振幅调整系数。如图2所示,本实施例提供的音量调节方法包括如下步骤。
步骤310、当检测到终端设备进行音源播放时,获取所述音源的音频信息。
步骤320、依据所述音频信息确定所述音频信息对应的音频振幅。步骤330、获取所述终端设备的音量信息,依据所述音量信息确定所述音量信息对应的三个振幅调整系数。
在一实施例中,确定的三个振幅调整系数分别为第一振幅调整系数、第二振幅调整系数和第三振幅调整系数。在一实施例中,第一振幅调整系数小于第二振幅调整系数,第二振幅调整系数小于第三振幅调整系数。例如,第一振幅调整系数为1(即不进行调整),第二振幅调整系数为1.4,第三振幅调整系数为1.8。
步骤340、确定所述音频信息中满足预设频率的音频振幅,为所述满足预设频率的音频振幅分配第一振幅调整系数。
在一实施例中,该第一振幅调整系数可以是1,即不对音频振幅的大小进行调节。在一实施例中,该预设频率可以是300赫兹(hz),即当检测到音频信息中存在固定频率300hz的音频振幅,则将该音频振幅作为噪音,不对该音频振幅进行振幅调整,以避免将噪音同步放大的问题,同时,也进一步提高了音量调节效率。
步骤350、对于不满足所述预设频率的音频振幅,为振幅大小大于第一预设阈值或小于第三预设阈值的音频振幅分配所述第一振幅调整系数,为振幅大小小于或等于第一预设阈值且大于第二预设阈值的音频振幅分配第二振幅调整系数,为振幅大小小于或等于第二预设阈值且大于第三预设阈值的音频振幅分配第三振幅调整系数。
在一实施例中,第一预设阈值大于第二预设阈值,第二预设阈值大于第三预设阈值。例如,第一预设阈值为-3db,第二预设阈值为-10db,第三预设阈值为-50db。
由此,本实施例通过为满足预设频率的音频振幅分配第一振幅调整系数,可以避免将噪音同步放大的问题,同时,进一步提高了音量调节效率。
图3是本公开另一实施例提供的一种音量调节方法的流程图。在一实施例 中,在所述依据所述音量信息确定所述音量信息对应的振幅调整系数之前,还包括:确定终端设备的播放器件的阻抗值;所述依据所述音量信息确定所述音量信息对应的振幅调整系数包括:依据所述阻抗值、所述音量信息确定所述音量信息对应的振幅调整系数。如图3所示,本实施例提供的方案,包括:
步骤301、当检测到终端设备进行音源播放时,获取所述音源的音频信息。
步骤302、依据所述音频信息确定所述音频信息对应的音频振幅。
步骤303、获取终端设备的音量信息并确定所述终端设备的播放器件的阻抗值。
在一个实施例中,可通过功放芯片检测终端设备中安装的播放器件(如:扬声器)的阻抗值,还可以是通过物理方式检测播放器件的阻抗。
步骤304、依据所述阻抗值和所述音量信息确定所述音量信息对应的振幅调整系数。
在一个实施例中,在上述依据音量信息确定振幅调整系数的基础上,进一步结合步骤303确定的终端设备的播放器件的阻抗值共同确定振幅调节系数。在一实施例中,该阻抗值越大,对应的由阻抗值和音量信息共同确定的振幅调节系数越大。在一实施例中,假设播放器件的标称阻抗值为x,通过检测得到的阻抗值为1.2x,则相应的由阻抗值和音量信息共同确定的振幅调整系数可以是仅通过音量信息确定的振幅调整系数的1.2倍,以作为最终确定的振幅调整系数。
由上述可知,在对音源的振幅进行调节过程中,引入播放器件的阻抗值作为确定振幅调节系数的参量之一,避免了播放器件随播放时长的增加,阻抗值越来越高,导致对正常播放过程中的音量大小产生影响的问题,使得调节后的音量大小更佳符合用户需求,进一步提高了音量调节效果。
步骤305、依据所述振幅调整系数对所述音频振幅进行调整。
图4是本公开另一实施例提供的一种音量调节方法的流程图。在一实施例中,在所述依据所述音量信息确定所述音频振幅对应的振幅调整系数之前,还包括:确定所述终端设备当前所处环境的噪声值;所述依据所述音量信息确定所述音量信息对应的振幅调整系数包括:依据所述噪声值和所述音量信息确定所述音量信息对应的振幅调整系数。如图4所示,本实施例提供的方案,包括:
步骤401、当检测到终端设备进行音源播放时,获取所述音源的音频信息。
步骤402、依据所述音频信息确定所述音频信息对应的音频振幅。
步骤403、获取终端设备的音量信息并确定所述终端设备当前所处环境的噪声值。
在一个实施例中,可通过终端设备安装的麦克风采集当前所处环境的噪音 以确定对应的噪声值。
步骤404、依据所述噪声值和所述音量信息确定所述音量信息对应的振幅调整系数。
在一实施例中,假设终端设备在安静环境下的噪声值为y,终端设备处于户外或嘈杂环境中时,确定的噪声值为1.5y,则相应的由噪声值和音量信息确定的振幅调整系数可以是仅通过音量信息确定的振幅调节系数的1.5倍。在一实施例中,还可依据阻抗值、噪声值和音量信息共同确定振幅调整系数。
由上论述可知,在对音频振幅进行调节的过程中,考虑了噪声对终端设备音量的影响,将确定的噪声值作为确定振幅调整系数的参量之一,使得调节后的音量大小更佳符合用户需求,进一步提高了音量调节效果。
步骤405、依据所述振幅调整系数对所述音频振幅进行调整。
图5是本公开一实施例提供的一种音量调节装置的结构框图,该装置用于执行上述实施例提供的音量调节方法,具备执行方法相应的功能模块和有益效果。如图5所示,该装置包括:获取模块10、振幅确定模块20、调整系数确定模块30和调整模块40。
在一实施例中,获取模块10,设置为当检测到终端设备进行音源播放时,获取所述音源的音频信息。
终端设备可通过安装的第三方应用程序或***自带的音视频播放软件进行音源的播放。在一实施例中,音源的播放主要包括音源文件的获取、解码和输出等步骤。在一实施例中,获取到的音源文件可以是通过网络接收到的组播流,还可以是终端设备本地存储的音视频文件。获取到该音源文件后将该音源文件加载到内存缓冲区中,并对加载到内存缓冲区的音源文件进行解码。在解码开始之前,如果该音源文件同时包含有视频数据,需要进行音频数据和视频数据的分离,将分离后的音频数据输入至音频解码器。在一实施例中,音频解码器主要用于读取内存缓冲区中的音频数据,得到数字音频信号,并将该数字音频信号转换为模拟音频信号,终端设备的播放器件根据该模拟音频信号进行音频播放。在一个实施例中,当监听到音源播放事件被触发时,确定终端设备开始播放音源。在一实施例中,该触发事件可以是检测到触摸屏中显示的播放按钮被按下,还可以是检测到终端设备的播放器件如喇叭开始播放声音时,确定终端设备进行音源播放。
当检测到终端设备进行音源播放时,获取所述音源的音频信息。在一个实施例中,可对音频解码器解码得到的数字音频信号进行取样,确定该音源对应的音频信息。在另一实施例中,还可以获取当前播放的音源的原始文件,通过对该原始文件的解析确定音源对应的音频信息。在另一实施例中,以Android ***为例,可通过android.media.MediaRecorder类或android.media.AudioRecord类获取音源的音频信息。
振幅确定模块20,设置为依据所述音频信息确定所述音频信息对应的音频振幅。
振幅指物体震动过程中偏离原来位置的最大距离,人耳听到的声音的响度与音源的振幅相关,振幅越大响度越强。在一个实施例中,可对音频解码器解码得到的数字音频信号进行取样,获取预设时间段T内的振幅信息。在一实施例中,该振幅信息可由多个振幅值组成,依据得到的多个振幅值可相应的确定在该预设时间段T内播放的音源的振幅曲线。在另一实施例中,以Android***为例,可通过android.media.MediaRecorder类或android.media.AudioRecord类获取音源的音频信息后得到音频信息对应的振幅大小。在另一实施例中,当获取到的音频信息为音源对应的原始文件时,可通过对原始文件进行解析以得到音频信息对应的振幅大小。
在一个实施例中,当检测音源播放时,每隔预设时间(如1s、3s或10s)确定一次振幅,或者实时地对音频信息的每一帧音频帧的振幅进行确定。在一实施例中,所述获取模块10是设置为:当检测到终端设备进行音源播放时,获取所述音源的音频帧信息;所述振幅确定模块20是设置为:依据所述音频帧信息确定所述音频帧信息的每一帧音频帧的音频振幅。在一实施例中,当检测到音源播放时,对音源文件进行解析得到音频帧序列,根据音频帧序列的每一帧确定对应的音频振幅。
调整系数确定模块30,设置为获取终端设备的音量信息,依据所述音量信息确定音频振幅对应的振幅调整系数。
调整模块40,设置为依据所述振幅调整系数对所述音频振幅进行调整。
在一个实施例中,该获取的音量信息可以是终端设备当前的音量值信息、音量增加信息和音量减小信息中的一种或多种。相应的,依据所述音量信息确定所述音量信息对应的振幅调整系数可以是依据音量信息中的当前的音量值信息、音量增加信息和音量减小信息中的一种或多种进行确定。
在一实施例中,终端设备由静音到最大音量总共分为18个可调等级,每个等级对应一个音量值,当终端设备播放音源时,可通过***的音量管理组件的get volume方法得到***的当前音量值;当用户通过终端设备的调节按钮或者触摸屏进行音量增大或减小调节时,相应的确定当前终端设备的音量是增大还是减小。在一个实施例中,依据当前的音量值确定音量信息对应的振幅调整系数。在一个实施例中,依据当前的音量增加信息或音量减小信息确定音量信息对应的振幅调节系数。在一个实施例中,还可根据音量增加信息或音量减小信息结 合当前终端的音量值共同确定振幅调整系数以对音频振幅实现调整。
在一个实施例中,所述调整系数确定模块30是设置为通过如下方式确定音量信息对应的振幅调整系数:依据所述音量信息确定所述音量信息对应的至少两个振幅调整系数;所述调整模块40是设置为:依据所述音频振幅中的振幅大小为不同振幅大小的音频振幅分配不同的振幅调整系数,并根据所分配的振幅调整系数调整对应振幅大小的音频振幅。在一实施例中,如依据音量信息确定出了音量信息对应的两个振幅调节系数,如1.5和2,则依据需要调节的音频振幅的大小分别为不同振幅大小的音频振幅分配不同的振幅调节系数。在一实施例中,当音频振幅的振幅大小小于-3db且大于-10db时,该音频振幅属于高振幅区,为该音频振幅分配振幅调整系数为1.5,当音频振幅的振幅大小小于-10db且大于-50db时,该音频振幅属于中振幅区,为该音频振幅分配振幅调整系数为,2以显著提高中振幅区的振幅大小。由上述内容可知,当检测到终端设备播放音源时,依据不同振幅大小合理分配确定出的振幅调整系数,以得到合适的输出音量,使得用户的听感更加,提高了音量调节效率。
在另一个实施例中,当依据所述音量信息确定的音量信息对应的振幅调整系数的数目为3个时,所述调整模块40是设置为通过如下方式依据所述音频振幅中的振幅大小为不同振幅大小的音频振幅分配不同的振幅调整系数:为振幅大小大于第一预设阈值或小于第三预设阈值的音频振幅分配第一振幅调整系数,为振幅大小小于或等于第一预设阈值且大于第二预设阈值的音频振幅分配第二振幅调整系数,为振幅大小小于或等于第二预设阈值且大于第三预设阈值的音频振幅分配第三振幅调整系数,其中,所述第一振幅调整系数小于所述第二振幅调整系数,所述第二振幅调整系数小于所述第三振幅调整系数。在一实施例中,该第一预设阈值可以是-3db,第二预设阈值可以是-10db,第三预设阈值可以是-50db,相应的,第一振幅调整系数为1(即不进行调整),第二振幅调整系数为1.4,第三振幅调整系数为1.8。在一实施例中,对于振幅过大(例如,大于-3db)或振幅过小(例如,小于-50db)的音频振幅不进行振幅调节,避免了对过大振幅调节后造成的破音,也避免了对过小的噪音进行调高带来的杂音增强的问题,进一步优化了音量调节方法。
在一个实施例中,所述调整模块40是设置为:依据所述振幅调整系数对所述每一帧音频帧的音频振幅进行调整。
在一个实施例中,在对音频振幅进行调整的过程中,可通过对包含音频信息的音源文件进行解析,对得到的音频数据中的表征振幅信息的数据进行修改,修改完毕后再进行封装,当缓冲到对应的音源文件并被播放时音频振幅相应的已被修改;还可以是,在音源播放的解码过程中,通过对得到的数字音频信号 进行分析得到振幅数据,将该振幅数据乘以对应的调节系数以改变振幅大小,进而对音源的音量进行调节。
由此,实现了在不改变终端设备***原有音量的前提下对音源音量的大小进行了调节,调节过程可以在音源文件未进入缓冲区前,以减少播放负载,也可以是针对缓冲区中的音源内容进行调节以提高调节效率,从而提高了音量调节效率,降低了终端设备的功耗。
本实施例提供的技术方案,当检测到终端设备进行音源播放时,获取所述音源的音频信息;依据所述音频信息确定和所述音频信息对应的音频振幅;获取终端设备的音量信息,依据所述音量信息确定音量信息对应的振幅调整系数;依据所述振幅调整系数对所述音频振幅进行调整。本方案提高了音量调节效率,降低了终端设备的功耗。
在一个实施例中,所述调整系数确定模块30是设置为:
依据终端设备当前的音量值信息、音量增加信息或音量减小信息确定音量信息对应的振幅调整系数。
在一个实施例中,所述调整系数确定模块30是设置为:
依据所述音量信息确定音量信息对应的至少两个振幅调整系数;
所述调整模块40是设置为:
依据所述音频振幅中的振幅大小为不同振幅大小的音频振幅分配不同的振幅调整系数,并所分配的振幅调整系数调整对应振幅大小的音频振幅。
在一个实施例中,当依据所述音量信息确定的音量信息对应的振幅调整系数的数目为3个时,所述调整模块40是设置为通过如下方式依据所述音频振幅中的振幅大小为不同振幅大小的音频振幅分配不同的振幅调整系数:
为大于第一预设阈值或小于第三预设阈值的音频振幅分配第一振幅调整系数,为小于或等于第一预设阈值且大于第二预设阈值的音频振幅分配第二振幅调整系数,为小于或等于第二预设阈值且大于第三预设阈值的音频振幅分配第三振幅调整系数,其中,所述第一预设阈值大于所述第二预设阈值,所述第二预设阈值大于所述第三预设阈值,所述第一振幅调整系数小于所述第二振幅调整系数,所述第二振幅调整系数小于所述第三振幅调整系数。
在一个实施例中,当依据所述音量信息确定的音量信息对应的振幅调整系数的数目为3个时,所述振幅确定模块20还设置为:
在所述依据所述音频振幅中的振幅大小为振幅大小不同的音频振幅分配不同的振幅调整系数之前,确定所述音频信息对应的音频振幅中满足预设频率的音频振幅。
所述调整模块40是设置为通过如下方式依据所述音频振幅中的振幅大小为 不同振幅大小的音频振幅分配不同的振幅调整系数:为所述满足预设频率的音频振幅分配第一振幅调整系数;对于不满足所述预设频率的音频振幅,为振幅大小大于第一预设阈值或小于第三预设阈值的音频振幅分配所述第一振幅调整系数,为振幅大小小于或等于第一预设阈值且大于第二预设阈值的音频振幅分配第二振幅调整系数,为振幅大小小于或等于第二预设阈值且大于第三预设阈值的音频振幅分配第三振幅调整系数;其中,所述第一预设阈值大于所述第二预设阈值,所述第二预设阈值大于所述第三预设阈值,所述第一振幅调整系数小于所述第二振幅调整系数,所述第二振幅调整系数小于所述第三振幅调整系数。
在一个实施例中,所述调整系数确定模块30还设置为:在所述依据所述音量信息确定所述音量信息对应的振幅调整系数之前,确定所述终端设备的播放器件的阻抗值;所述调整系数确定模块30是设置为通过如下方式确定所述音量信息对应的振幅调整系数:依据所述阻抗值和所述音量信息确定所述音量信息对应的振幅调整系数。
在一个实施例中,所述调整系数确定模块30还设置为:在所述依据所述音量信息确定所述音量信息对应的振幅调整系数之前,确定所述终端设备当前所处环境的噪声值;所述调整系数确定模块30是设置为通过如下方式确定所述音量信息对应的振幅调整系数:依据所述噪声值和所述音量信息确定所述音量信息对应的振幅调整系数。
在一实施例中,音量信息包括:所述终端设备当前的音量值信息以及以下两个信息之一:音量增加信息和音量减小信息。
本实施例在上述多个实施例的基础上提供了一种终端设备,该终端设备可以包括本公开提供的音量调节装置。图6是本公开一实施例提供的一种终端设备的结构示意图,如图6所示,该终端设备200包括:存储器201、处理器(Central Processing Unit,CPU)202、外设接口203、射频(Radio Frequency,RF)电路205、音频电路206、扬声器211、电源管理芯片208、输入/输出(I/O)子***209、触摸屏212、其他输入/控制设备210以及外部端口204,这些部件通过一个或多个通信总线或信号线207来通信。
图6示出的终端设备200仅仅是终端设备的一个范例,并且终端设备200可以具有比图6中所示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图6中所示出的多种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。
下面就本实施例提供的终端设备200进行描述,该终端设备200以智能手 机为例。
存储器201,所述存储器201可以被CPU202以及外设接口203等访问,所述存储器201可以包括高速随机存取存储器,还可以包括非易失性存储器,例如一个或多个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
外设接口203,所述外设接口203可以将设备的输入和输出外设连接到CPU202和存储器201。
I/O子***209,所述I/O子***209可以将设备上的输入外设和输出外设,例如触摸屏212和其他输入/控制设备210,连接到外设接口203。I/O子***209可以包括显示控制器2091和设置为控制其他输入/控制设备210的一个或多个输入控制器2092。其中,一个或多个输入控制器2092从其他输入/控制设备210接收电信号或者向其他输入/控制设备210发送电信号,其他输入/控制设备210可以包括物理按钮(按压按钮或摇臂按钮等)、拨号盘、滑动开关、操纵杆或点击滚轮。在一实施例中,输入控制器2092可以与以下任一个连接:键盘、红外端口、USB接口以及诸如鼠标的指示设备。
触摸屏212,所述触摸屏212是用户终端与用户之间的输入接口和输出接口,将可视输出显示给用户,可视输出可以包括图形、文本、图标以及视频等。
I/O子***209中的显示控制器2091从触摸屏212接收电信号或者向触摸屏212发送电信号。触摸屏212检测触摸屏212上的接触,显示控制器2091将检测到的接触转换为与显示在触摸屏212上的用户界面对象的交互,即实现人机交互,显示在触摸屏212上的用户界面对象可以是运行游戏的图标或联网到相应网络的图标等。在一实施例中,终端设备200还可以包括光鼠,光鼠是不显示可视输出的触摸敏感表面,或者是由触摸屏形成的触摸敏感表面的延伸。
RF电路205,设置为建立手机与无线网络(即网络侧)的通信,实现手机与无线网络的数据接收和发送。例如收发短信息或电子邮件等。在一实施例中,RF电路205接收并发送RF信号,RF信号也称为电磁信号,RF电路205将电信号转换为电磁信号或将电磁信号转换为电信号,并且通过该电磁信号与通信网络以及其他设备进行通信。RF电路205可以包括用于执行这些功能的已知电路,RF电路205包括但不限于天线***、RF收发机、一个或多个放大器、调谐器、一个或多个振荡器、数字信号处理器、编译码器(COder-DECoder,CODEC)芯片组以及用户标识模块(Subscriber Identity Module,SIM)等等。
音频电路206,设置为从外设接口203接收音频数据,将该音频数据转换为电信号,并且将该电信号发送给扬声器211。
扬声器211,设置为将手机通过RF电路205从无线网络接收的语音信号,还原为声音并向用户播放该声音。
电源管理芯片208,设置为为CPU202、I/O子***及外设接口所连接的硬件进行供电及电源管理。
上述实施例中提供的终端设备的音量调节装置及终端设备可执行本公开任意实施例所提供的终端设备的音量调节方法,具备执行该方法相应的功能模块和有益效果。未在上述实施例中详尽描述的技术细节,可参见本公开任意实施例所提供的终端设备的音量调节方法。
本公开实施例还提供一种包含终端设备可执行指令的存储介质,所述终端设备可执行指令在由终端设备处理器执行时用于执行一种音量调节方法,该方法包括:
当检测到终端设备进行音源播放时,获取所述音源的音频信息;依据所述音频信息确定所述音频信息对应的音频振幅;获取终端设备的音量信息,依据所述音量信息确定所述音量信息对应的振幅调整系数;依据所述振幅调整系数对所述音频振幅进行调整。
在一个实施例中,所述依据所述音量信息确定所述音量信息对应的振幅调整系数,包括:
依据所述终端设备当前的音量值信息、音量增加信息或音量减小信息确定所述音量信息对应的振幅调整系数。
在一个实施例中,所述依据所述音量信息确定所述音量信息对应的振幅调整系数,包括:依据所述音量信息确定所述音量信息对应的至少两个振幅调整系数。
所述依据所述振幅调整系数对所述音频振幅进行调整包括:
依据所述音频振幅中的振幅大小为不同振幅大小的音频振幅分配不同的振幅调整系数,并根据所分配的振幅调整系数调整对应振幅大小的音频振幅。
在一个实施例中,当依据所述音量信息确定的所述音量信息对应的振幅调整系数的数目为3个时,所述依据所述音频振幅中的振幅大小为所述不同振幅大小的音频振幅分配不同的振幅调整系数包括:
为振幅大小大于第一预设阈值或小于第三预设阈值的音频振幅分配第一振幅调整系数,为振幅大小小于或等于第一预设阈值且大于第二预设阈值的音频振幅分配第二振幅调整系数,为振幅大小小于或等于第二预设阈值且大于第三预设阈值的音频振幅分配第三振幅调整系数,其中,所述第一预设阈值大于所述第二预设阈值,所述第二预设阈值大于所述第三预设阈值,所述第一振幅调整系数小于所述第二振幅调整系数,所述第二振幅调整系数小于所述第三振幅调整系数。
在一个实施例中,当依据所述音量信息确定的所述音量信息对应的振幅调 整系数的数目为3个时,在所述依据所述音频振幅中的振幅大小为不同振幅大小的音频振幅分配不同的振幅调整系数之前,还包括:确定所述音频信息中满足预设频率的音频振幅;所述依据所述音频振幅中的振幅大小为不同振幅大小的音频振幅分配不同的振幅调整系数,包括:为所述满足预设频率的音频振幅分配第一振幅调整系数;对于不满足所述预设频率的音频振幅,为振幅大小大于第一预设阈值或小于第三预设阈值的音频振幅分配所述第一振幅调整系数,为振幅大小小于或等于第一预设阈值且大于第二预设阈值的音频振幅分配第二振幅调整系数,为振幅大小小于或等于第二预设阈值且大于第三预设阈值的音频振幅分配第三振幅调整系数;其中,所述第一预设阈值大于所述第二预设阈值,所述第二预设阈值大于所述第三预设阈值,所述第一振幅调整系数小于所述第二振幅调整系数,所述第二振幅调整系数小于所述第三振幅调整系数。。
在一个实施例中,在所述依据所述音量信息确定所述音量信息对应的振幅调整系数之前,还包括:确定所述终端设备的播放器件的阻抗值;所述依据所述音量信息确定所述音量信息对应的振幅调整系数包括:依据所述阻抗值和所述音量信息确定所述音量信息对应的振幅调整系数。
在一个施例中,在所述依据所述音量信息确定所述音量信息对应的振幅调整系数之前,还包括:确定所述终端设备当前所处环境的噪声值;所述依据所述音量信息确定所述音量信息对应的振幅调整系数包括:依据所述噪声值和所述音量信息确定所述音量信息对应的振幅调整系数。
在一实施例中,所述音量信息包括:所述终端设备当前的音量值信息以及以下两个信息之一:音量增加信息和音量减小信息。
在一实施例中,所述获取所述音源的音频信息,包括:获取所述音源的音频帧信息;所述依据所述音频信息确定所述音频信息对应的音频振幅,包括:依据所述音频帧信息确定所述音频帧信息的每一帧音频帧的音频振幅;所述依据所述振幅调整系数对所述音频振幅进行调整,包括:依据所述振幅调整系数对所述每一帧音频帧的音频振幅进行调整。
存储介质——任何的一种或多种类型的存储器设备或存储设备。术语“存储介质”包括:安装介质,例如紧凑型光盘只读储存器(Compact Disc Read-Only Memory,CD-ROM)、软盘或磁带装置;计算机***存储器或随机存取存储器,诸如动态随机存取存储器(Dynamic Random Access Memory,DRAM)、双倍数据速率随机存取存储器(Double Data Rate Random Access Memory,DDR RAM)、静态随机存取存储器(Static Random Access Memory,SRAM)、扩展数据输出随机存取存储器(Extended Data Output Random Access Memory,EDO RAM),兰巴斯(Rambus)RAM等;非易失性存储器,诸如闪存、磁介质(例如硬盘或光存 储);寄存器或其它相似类型的存储器元件等。存储介质可以还包括其它类型的存储器或其组合。另外,存储介质可以位于程序在其中被执行的第一计算机***中,或者可以位于不同的第二计算机***中,第二计算机***通过网络(诸如因特网)连接到第一计算机***。第二计算机***可以提供程序指令给第一计算机用于执行。术语“存储介质”可以包括可以驻留在不同位置中(例如在通过网络连接的不同计算机***中)的两个或更多存储介质。存储介质可以存储可由一个或多个处理器执行的程序指令(例如具体实现为计算机程序)。
本公开实施例所提供的一种包含计算机可执行指令的存储介质,计算机可执行指令不限于如上所述的音量调节方法,还可以执行本公开任意实施例所提供的音量调节方法中的相关操作。
上述仅为本公开的实施例及所运用技术原理。
Claims (20)
- 一种音量调节方法,包括:当检测到终端设备进行音源播放时,获取所述音源的音频信息;依据所述音频信息确定所述音频信息对应的音频振幅;获取所述终端设备的音量信息,依据所述音量信息确定所述音量信息对应的振幅调整系数;依据所述振幅调整系数对所述音频振幅进行调整。
- 根据权利要求1所述的方法,其中,所述音量信息包括:所述终端设备当前的音量值信息、音量增加信息或音量减小信息。
- 根据权利要求2所述的方法,其中,所述依据所述音量信息确定所述音量信息对应的振幅调整系数,包括:依据所述音量信息确定所述音量信息对应的至少两个振幅调整系数;所述依据所述振幅调整系数对所述音频振幅进行调整,包括:依据所述音频振幅中的振幅大小为不同振幅大小的音频振幅分配不同的振幅调整系数,并根据所分配的振幅调整系数调整对应振幅大小的音频振幅。
- 根据权利要求3所述的方法,其中,当依据所述音量信息确定的所述音量信息对应的振幅调整系数的数目为3个时,所述依据所述音频振幅中的振幅大小为所述不同振幅大小的音频振幅分配不同的振幅调整系数,包括:为振幅大小大于第一预设阈值或小于第三预设阈值的音频振幅分配第一振幅调整系数,为振幅大小小于或等于第一预设阈值且大于第二预设阈值的音频振幅分配第二振幅调整系数,为振幅大小小于或等于第二预设阈值且大于第三预设阈值的音频振幅分配第三振幅调整系数;其中,所述第一预设阈值大于所述第二预设阈值,所述第二预设阈值大于所述第三预设阈值,所述第一振幅调整系数小于所述第二振幅调整系数,所述第二振幅调整系数小于所述第三振幅调整系数。
- 根据权利要求3所述的方法,其中,当依据所述音量信息确定的所述音量信息对应的振幅调整系数的数目为3个时,在所述依据所述音频振幅中的振幅大小为不同振幅大小的音频振幅分配不同的振幅调整系数之前,还包括:确定所述音频信息对应的音频振幅中满足预设频率的音频振幅;所述依据所述音频振幅中的振幅的大小为不同振幅大小的音频振幅分配不同的振幅调整系数,包括:为所述满足预设频率的音频振幅分配第一振幅调整系数;对于不满足所述预设频率的音频振幅,为振幅大小大于第一预设阈值或小于第三预设阈值的音频振幅分配所述第一振幅调整系数,为振幅大小小于或等于第一预设阈值且大于第二预设阈值的音频振幅分配第二振幅调整系数,为振幅大小小于或等于第二预设阈值且大于第三预设阈值的音频振幅分配第三振幅调整系数;其中,所述第一预设阈值大于所述第二预设阈值,所述第二预设阈值大于所述第三预设阈值,所述第一振幅调整系数小于所述第二振幅调整系数,所述第二振幅调整系数小于所述第三振幅调整系数。
- 根据权利要求1-5任一项所述的方法,其中,在所述依据所述音量信息确定所述音量信息对应的振幅调整系数之前,还包括:确定所述终端设备的播放器件的阻抗值;所述依据所述音量信息确定所述音量信息对应的振幅调整系数,包括:依据所述阻抗值和所述音量信息确定所述音量信息对应的振幅调整系数。
- 根据权利要求1-5任一项所述的方法,其中,在所述依据所述音量信息确定所述音量信息对应的振幅调整系数之前,还包括:确定所述终端设备当前所处环境的噪声值;所述依据所述音量信息确定所述音量信息对应的振幅调整系数,包括:依据所述噪声值和所述音量信息确定所述音量信息对应的振幅调整系数。
- 根据权利要求1所述的方法,其中,所述音量信息包括:所述终端设备当前的音量值信息以及以下两个信息之一:音量增加信息和音量减小信息。
- 根据权利要求1所述的方法,其中,所述获取所述音源的音频信息,包括:获取所述音源的音频帧信息;所述依据所述音频信息确定所述音频信息对应的音频振幅,包括:依据所述音频帧信息确定所述音频帧信息的每一帧音频帧的音频振幅;所述依据所述振幅调整系数对所述音频振幅进行调整,包括:依据所述振幅调整系数对所述每一帧音频帧的音频振幅进行调整。
- 一种音量调节装置,包括:获取模块,设置为当检测到终端设备进行音源播放时,获取所述音源的音频信息;振幅确定模块,设置为依据所述音频信息确定所述音频信息对应的音频振 幅;调整系数确定模块,设置为获取所述终端设备的音量信息,依据所述音量信息确定所述音频信息对应的振幅调整系数;调整模块,设置为依据所述振幅调整系数对所述音频振幅进行调整。
- 根据权利要求10所述的装置,其中,所述音量信息包括:所述终端设备当前的音量值信息、音量增加信息或音量减小信息。
- 根据权利要求11所述的装置,其中,所述调整系数确定模块是设置为通过如下方式确定所述音量信息对应的振幅调整系数:依据所述音量信息确定所述音量信息对应的至少两个振幅调整系数;所述调整模块是设置为依据所述音频振幅中的振幅大小为不同振幅大小的音频振幅分配不同的振幅调整系数,并根据所分配的振幅调整系数调整对应振幅大小的音频振幅。
- 根据权利要求12所述的装置,其中,当依据所述音量信息确定的所述音量信息对应的振幅调整系数的数目为3个时,所述调整模块是设置为通过如下方式依据所述音频振幅中的振幅大小为不同振幅大小的音频振幅分配不同的振幅调整系数:为振幅大小大于第一预设阈值或小于第三预设阈值的音频振幅分配第一振幅调整系数,为振幅大小小于或等于第一预设阈值且大于第二预设阈值的音频振幅分配第二振幅调整系数,为振幅大小小于或等于第二预设阈值且大于第三预设阈值的音频振幅分配第三振幅调整系数,其中,所述第一预设阈值大于所述第二预设阈值,所述第二预设阈值大于所述第三预设阈值,所述第一振幅调整系数小于所述第二振幅调整系数,所述第二振幅调整系数小于所述第三振幅调整系数。
- 根据权利要求12所述的装置,其中,当依据所述音量信息确定的所述音量信息对应的振幅调整系数的数目为3个时,所述振幅确定模块还设置为:确定所述音频信息对应的音频振幅中满足预设频率的音频振幅;所述调整模块是设置为通过如下方式依据所述音频振幅中的振幅大小为不同振幅大小的音频振幅分配不同的振幅调整系数:为所述满足预设频率的音频振幅分配第一振幅调整系数;对于不满足所述预设频率的音频振幅,为振幅大小大于第一预设阈值或小于第三预设阈值的音频振幅分配所述第一振幅调整系数,为振幅大小小于或等 于第一预设阈值且大于第二预设阈值的音频振幅分配第二振幅调整系数,为振幅大小小于或等于第二预设阈值且大于第三预设阈值的音频振幅分配第三振幅调整系数;其中,所述第一预设阈值大于所述第二预设阈值,所述第二预设阈值大于所述第三预设阈值,所述第一振幅调整系数小于所述第二振幅调整系数,所述第二振幅调整系数小于所述第三振幅调整系数。
- 根据权利要求10-14任一项所述的装置,其中,所述调整系数确定模块还设置为:在所述依据所述音量信息确定所述音量信息对应的振幅调整系数之前,确定所述终端设备的播放器件的阻抗值;所述调整系数确定模块是设置为通过如下方式确定所述音量信息对应的振幅调整系数:依据所述阻抗值和所述音量信息确定所述音量信息对应的振幅调整系数。
- 根据权利要求10-14任一项所述的装置,其中,所述调整系数确定模块还设置为:在所述依据所述音量信息确定所述音量信息对应的振幅调整系数之前,确定所述终端设备当前所处环境的噪声值;所述调整系数确定模块是设置为通过如下方式确定所述音量信息对应的振幅调整系数:依据所述噪声值和所述音量信息确定所述音量信息对应的振幅调整系数。
- 根据权利要求10所述的装置,其中,所述音量信息包括:所述终端设备当前的音量值信息以及以下两个信息之一:音量增加信息和音量减小信息。
- 根据权利要求10所述的装置,其中,所述获取模块是设置为当检测到终端设备进行音源播放时,获取所述音源的音频帧信息;所述振幅确定模块是设置为依据所述音频帧信息确定所述音频帧信息的每一帧音频帧的音频振幅;所述调整模块是设置为依据所述振幅调整系数对所述每一帧音频帧的音频振幅进行调整。
- 一种终端设备,包括:处理器、存储器以及存储在存储器上并可在处 理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1-9任一项所述的音量调节方法。
- 一种包含终端设备可执行指令的存储介质,其特征在于,所述终端设备可执行指令在由终端设备处理器执行时用于执行如权利要求1-9任一项所述的音量调节方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710711385.6A CN107479852B (zh) | 2017-08-18 | 2017-08-18 | 音量调节方法、装置、终端设备及存储介质 |
CN201710711385.6 | 2017-08-18 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019033941A1 true WO2019033941A1 (zh) | 2019-02-21 |
Family
ID=60601622
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/098651 WO2019033941A1 (zh) | 2017-08-18 | 2018-08-03 | 音量调节方法、装置、终端设备及存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN107479852B (zh) |
WO (1) | WO2019033941A1 (zh) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107479852B (zh) * | 2017-08-18 | 2019-08-30 | Oppo广东移动通信有限公司 | 音量调节方法、装置、终端设备及存储介质 |
CN108829370B (zh) * | 2018-05-31 | 2020-01-21 | 百度在线网络技术(北京)有限公司 | 有声资源播放方法、装置、计算机设备及存储介质 |
CN113824835A (zh) * | 2021-10-25 | 2021-12-21 | Oppo广东移动通信有限公司 | 音量控制方法及装置、电子设备及存储介质 |
CN117687595B (zh) * | 2024-01-30 | 2024-05-28 | 知鱼智联科技股份有限公司 | 一种基于物联网的音量调整方法及装置 |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1770626A (zh) * | 2004-11-06 | 2006-05-10 | 腾讯科技(深圳)有限公司 | 一种音量限制方法和*** |
US20080228473A1 (en) * | 2007-02-09 | 2008-09-18 | Ari Associates, Inc. | Method and apparatus for adjusting hearing intelligibility in mobile phones |
CN101729034A (zh) * | 2008-10-31 | 2010-06-09 | 美商富迪科技股份有限公司 | 语音处理装置、动态范围控制模块及语音振幅调整的方法 |
CN101923860A (zh) * | 2009-06-11 | 2010-12-22 | 英华达(南京)科技有限公司 | 音讯柔化***、装置与方法 |
CN104410379A (zh) * | 2014-10-29 | 2015-03-11 | 深圳市金立通信设备有限公司 | 一种音量调节方法 |
US20150098589A1 (en) * | 2013-10-08 | 2015-04-09 | Qnx Software Systems Limited | System and method for dynamically mixing audio signals |
CN107479852A (zh) * | 2017-08-18 | 2017-12-15 | 广东欧珀移动通信有限公司 | 音量调节方法、装置、终端设备及存储介质 |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007228411A (ja) * | 2006-02-24 | 2007-09-06 | Funai Electric Co Ltd | 音響機器及びテレビジョン受像機 |
CN103746668A (zh) * | 2013-12-31 | 2014-04-23 | 上海斐讯数据通信技术有限公司 | 音量控制方法及*** |
CN105185396B (zh) * | 2015-07-28 | 2018-03-20 | 小米科技有限责任公司 | 一种播放音频信号的方法和装置 |
CN106024007B (zh) * | 2016-06-21 | 2019-10-15 | 维沃移动通信有限公司 | 一种声音处理方法及移动终端 |
CN106453940B (zh) * | 2016-11-07 | 2019-10-25 | 武汉斗鱼网络科技有限公司 | 一种调整音量的方法及装置 |
CN106775563A (zh) * | 2016-12-13 | 2017-05-31 | 珠海市魅族科技有限公司 | 音量调节的方法及装置 |
CN106878866B (zh) * | 2017-03-03 | 2020-01-10 | Oppo广东移动通信有限公司 | 音频信号处理方法、装置及终端 |
-
2017
- 2017-08-18 CN CN201710711385.6A patent/CN107479852B/zh active Active
-
2018
- 2018-08-03 WO PCT/CN2018/098651 patent/WO2019033941A1/zh active Application Filing
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1770626A (zh) * | 2004-11-06 | 2006-05-10 | 腾讯科技(深圳)有限公司 | 一种音量限制方法和*** |
US20080228473A1 (en) * | 2007-02-09 | 2008-09-18 | Ari Associates, Inc. | Method and apparatus for adjusting hearing intelligibility in mobile phones |
CN101729034A (zh) * | 2008-10-31 | 2010-06-09 | 美商富迪科技股份有限公司 | 语音处理装置、动态范围控制模块及语音振幅调整的方法 |
CN101923860A (zh) * | 2009-06-11 | 2010-12-22 | 英华达(南京)科技有限公司 | 音讯柔化***、装置与方法 |
US20150098589A1 (en) * | 2013-10-08 | 2015-04-09 | Qnx Software Systems Limited | System and method for dynamically mixing audio signals |
CN104410379A (zh) * | 2014-10-29 | 2015-03-11 | 深圳市金立通信设备有限公司 | 一种音量调节方法 |
CN107479852A (zh) * | 2017-08-18 | 2017-12-15 | 广东欧珀移动通信有限公司 | 音量调节方法、装置、终端设备及存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN107479852B (zh) | 2019-08-30 |
CN107479852A (zh) | 2017-12-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11251763B2 (en) | Audio signal adjustment method, storage medium, and terminal | |
US10440464B2 (en) | Method and apparatus for adjusting volume, terminal device and storage medium | |
US11201598B2 (en) | Volume adjusting method and mobile terminal | |
CN110799936B (zh) | 音量调节方法、装置、终端设备及存储介质 | |
CN107465824B (zh) | 音量调节方法、装置、移动终端及存储介质 | |
CN107526570B (zh) | 音量调节方法、装置、终端设备及存储介质 | |
CN107566618B (zh) | 音量调节方法、装置、终端设备及存储介质 | |
WO2019033941A1 (zh) | 音量调节方法、装置、终端设备及存储介质 | |
WO2019033942A1 (zh) | 音量调节方法、装置、终端设备及存储介质 | |
WO2017215657A1 (zh) | 音效处理方法及终端设备 | |
WO2019033987A1 (zh) | 提示方法、装置、存储介质及终端 | |
US10027299B2 (en) | Volume control | |
CN107483734B (zh) | 音量调节方法、装置、终端设备及存储介质 | |
CN111508510A (zh) | 音频处理方法、装置、存储介质及电子设备 | |
CN107506168B (zh) | 音量调节方法、装置、终端设备及存储介质 | |
WO2019033939A1 (zh) | 音量调节方法、装置、终端设备及存储介质 | |
CN106293607B (zh) | 自动切换音频输出模式的方法及*** | |
CN107506170A (zh) | 音量调节方法、装置、终端设备及存储介质 | |
WO2019033439A1 (zh) | 音量调节方法、装置、存储介质及移动终端 | |
CN107506169A (zh) | 音量调节方法、装置、终端设备及存储介质 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18846860 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18846860 Country of ref document: EP Kind code of ref document: A1 |