WO2019033939A1 - 音量调节方法、装置、终端设备及存储介质 - Google Patents

音量调节方法、装置、终端设备及存储介质 Download PDF

Info

Publication number
WO2019033939A1
WO2019033939A1 PCT/CN2018/098646 CN2018098646W WO2019033939A1 WO 2019033939 A1 WO2019033939 A1 WO 2019033939A1 CN 2018098646 W CN2018098646 W CN 2018098646W WO 2019033939 A1 WO2019033939 A1 WO 2019033939A1
Authority
WO
WIPO (PCT)
Prior art keywords
amplitude
determining
adjustment coefficient
average
sound source
Prior art date
Application number
PCT/CN2018/098646
Other languages
English (en)
French (fr)
Inventor
严锋贵
许钊铵
甘高亭
郑志勇
杨海
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2019033939A1 publication Critical patent/WO2019033939A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/16Sound input; Sound output
    • G06F3/165Management of the audio stream, e.g. setting of volume, audio stream path

Definitions

  • the embodiments of the present application relate to computer technologies, 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, playing games, and the like using terminal devices.
  • the terminal device is playing audio and video, the adjustment of the volume level is flawed and needs to be improved.
  • the application provides a volume adjustment method, device, terminal device and storage medium, which can improve the volume adjustment efficiency and reduce the power consumption of the terminal device.
  • the embodiment of the present application provides a volume adjustment method, including: acquiring audio information of a preset length of the sound source when detecting that the terminal device performs sound source playback; determining a maximum amplitude and the audio information. An average amplitude; an amplitude adjustment coefficient is determined according to the maximum amplitude and the average amplitude; and an amplitude of the sound source is adjusted according to the amplitude adjustment coefficient.
  • the embodiment of the present application further provides a volume adjustment apparatus, including: an acquisition module, configured to acquire audio information of a preset length of the sound source when detecting that the terminal device performs sound source playback; and an amplitude determination module, Provided to determine a maximum amplitude and an average amplitude in the audio information; an adjustment coefficient determining module configured to determine an amplitude adjustment coefficient according to the maximum amplitude and the average amplitude; and an adjustment module configured to determine according to the amplitude adjustment coefficient The amplitude of the source is adjusted.
  • an acquisition module configured to acquire audio information of a preset length of the sound source when detecting that the terminal device performs sound source playback
  • an amplitude determination module Provided to determine a maximum amplitude and an average amplitude in the audio information
  • an adjustment coefficient determining module configured to determine an amplitude adjustment coefficient according to the maximum amplitude and the average amplitude
  • an adjustment module configured to determine according to the amplitude adjustment coefficient The amplitude of the source is adjusted.
  • an embodiment of the present application further provides a terminal device, including: a processor, a memory, and a computer program stored on the memory and operable on the processor, where the processor executes the computer program, such as The volume adjustment method described in the embodiment of the present application.
  • the embodiment of the present application further provides a storage medium including a terminal device executable instruction, where the terminal device executable instruction is configured to perform volume adjustment according to an embodiment of the present application when executed by a terminal device processor. method.
  • FIG. 1 is a flowchart of a volume adjustment method provided by an embodiment of the present application.
  • FIG. 3 is a flowchart of another volume adjustment method provided by an embodiment of the present application.
  • FIG. 5 is a flowchart of another volume adjustment method provided by an embodiment of the present application.
  • FIG. 6 is a flowchart of another volume adjustment method provided by an embodiment of the present application.
  • FIG. 7 is a structural block diagram of a volume adjustment apparatus according to an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
  • FIG. 1 is a flowchart of a volume adjustment method according to an embodiment of the present application. This embodiment is applicable to a situation in which a terminal device adjusts a volume when playing a sound source.
  • the method may be performed by a terminal device provided by an embodiment of the present application.
  • the volume adjustment device of the terminal device may be implemented by using at least one of software and hardware.
  • the solution provided in this embodiment includes step S101, step S102, and step S103.
  • step S101 when the terminal device detects the sound source playing, the audio information of the preset length of the sound source is acquired.
  • 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. Among them, it mainly includes the steps of acquiring, decoding and outputting the sound source file.
  • the obtained audio 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; after the audio source file is obtained, the audio source file is loaded into the memory buffer; The audio source file loaded into the memory buffer is decoded. Before the decoding starts, if the audio file contains video data, the audio data and the video data are separated, 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 audio playback according to the analog audio signal.
  • the sound source playing event it is determined that the terminal device starts to play the sound source, wherein the trigger event may be that the detected play button displayed in the touch screen is pressed, or the terminal device is detected.
  • a playback device such as a speaker starts playing a sound, it is determined that the terminal device performs sound source playback.
  • the preset length 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, wherein the preset length may be 3s, 5s, or 10s.
  • the original file of the currently played sound source may also be acquired, and the audio information of the preset length 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 S102 a maximum amplitude and an average amplitude in the audio information are determined.
  • 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, wherein the amplitude information may be composed of a plurality of amplitude values. In an embodiment, taking 3s as an example, in the sound source played in the 3s duration, corresponding to each amplitude value in the obtained audio information, each amplitude value obtained is recorded, and the maximum amplitude and the average amplitude of all amplitudes are determined. .
  • the acquiring the audio information of the sound source includes: acquiring the audio information of the preset length of the sound source, comprising: acquiring audio frame information of a preset length of the sound source; and correspondingly, determining the preset length
  • the maximum amplitude and the average amplitude in the audio information include determining a maximum amplitude and an average amplitude in the preset length of audio information based on the audio frame information.
  • the sound source file is parsed to obtain an audio frame sequence, and each frame of the preset length audio information is determined to determine a corresponding amplitude, thereby determining a maximum amplitude and an average amplitude.
  • step S103 an amplitude adjustment coefficient is determined according to the maximum amplitude and the average amplitude, and an amplitude of the sound source is adjusted according to the amplitude adjustment coefficient.
  • the fixed amplitude adjustment coefficients may be determined according to the maximum amplitude and the average amplitude, or different amplitude adjustment coefficients may be determined, and then allocated according to the magnitude of the specific sound source amplitude for amplitude adjustment.
  • the data representing the amplitude information in the obtained audio data may be modified by parsing the sound source file, and then the package is modified after being modified, and buffered to the corresponding sound source file and The amplitude of the sound source is correspondingly increased during playback; or, during 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 coefficient to change the amplitude.
  • the size which in turn adjusts the volume of the source. Therefore, 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 audio content is adjusted to improve the adjustment efficiency.
  • the amplitude of each frame of the sound source is adjusted. For example, different amplitude adjustment coefficients are assigned to the different amplitude amplitudes of each frame during the adjustment process to perform corresponding adjustment.
  • the specific correspondence may be as follows:
  • the gain is not adjusted; when the amplitude is less than -3 db and greater than -10 db, the amplitude is a high amplitude region, and its distribution gain coefficient is 1.5.
  • the amplitude is less than -10 db and greater than -50 db, it is a medium amplitude region, and is assigned an amplitude coefficient of 2 to significantly increase the amplitude of the amplitude of the portion.
  • the determining the amplitude adjustment coefficient according to the maximum amplitude and the average amplitude comprises: if the difference between the maximum amplitude and the average amplitude satisfies a preset condition, according to the maximum amplitude and The average amplitude determines the amplitude adjustment factor.
  • the difference between the maximum amplitude and the average amplitude is large (for example, 0.2 db)
  • the higher amplitude is adjusted to lower the volume.
  • the difference between the maximum amplitude and the average amplitude does not satisfy the preset condition, that is, the phase difference is not large, the amplitude of the sound source is not adjusted.
  • determining the amplitude adjustment coefficient according to the maximum amplitude and the average amplitude includes: according to the maximum amplitude and Determining the difference of the average amplitude determines a first amplitude adjustment coefficient; correspondingly, adjusting the amplitude of the sound source according to the amplitude adjustment coefficient comprises: according to the first amplitude adjustment coefficient, being greater than the sound source The amplitude of a predetermined threshold is adjusted.
  • the technical solution includes step S201, step S202, and step S203.
  • step S201 when detecting that the terminal device performs sound source playing, the audio information of the preset length of the sound source is acquired.
  • step S202 a maximum amplitude and an average amplitude in the audio information are determined.
  • a first amplitude adjustment coefficient is determined according to the difference between the maximum amplitude and the average amplitude, and an amplitude greater than the first preset threshold in the sound source is adjusted according to the first amplitude adjustment coefficient.
  • determining the relationship of the first amplitude adjustment coefficient according to the difference between the maximum amplitude and the average amplitude is as follows:
  • the first predetermined amplitude threshold may be -2 db, that is, the amplitude of the amplitude greater than the first amplitude threshold is multiplied by a corresponding adjustment coefficient to perform amplitude attenuation to reduce the volume. Therefore, the portion of the sound source with a large amplitude is reasonably attenuated to avoid the sudden hearing, and the sound source is improved.
  • FIG. 3 is a flowchart of another volume adjustment method according to an embodiment of the present application.
  • the method further includes: determining, according to the average amplitude, a second amplitude adjustment coefficient; and correspondingly, adjusting the amplitude of the sound source according to the amplitude adjustment coefficient further comprises: small to the sound source according to the second amplitude adjustment coefficient Adjusting at a second preset threshold and greater than a third preset threshold, the second preset threshold being less than the first preset threshold.
  • step S301, step S302, step S303, and step S304 are included.
  • step S301 when the terminal device detects the sound source playing, the audio information of the preset length of the sound source is acquired.
  • step S302 a maximum amplitude and an average amplitude in the audio information are determined.
  • step S303 a first amplitude adjustment coefficient is determined according to the difference between the maximum amplitude and the average amplitude, and an amplitude greater than the first preset threshold in the sound source is adjusted according to the first amplitude adjustment coefficient.
  • a second amplitude adjustment coefficient is determined according to the average amplitude, and an amplitude of the sound source that is smaller than a second preset threshold and greater than a third preset threshold is adjusted according to the second amplitude adjustment coefficient.
  • the second preset threshold is smaller than the first preset threshold.
  • the second amplitude adjustment factor is determined based on the average amplitude. In an embodiment, the correspondence between the average amplitude and the second amplitude adjustment factor is as follows:
  • the second preset threshold may be -30 db
  • the third preset amplitude threshold may be -50 db.
  • the corresponding adjustment coefficient is determined according to the magnitude of the average amplitude of the sound source, and the larger the average amplitude is, the higher the adjustment coefficient is, and the amplitude of the condition (less than the second preset threshold and greater than the third preset threshold) is met.
  • the adjustment coefficient is adjusted to increase the volume of the lower volume portion of the sound source, improve the play effect during the playback of the sound source, and avoid the manual volume adjustment by the user, thereby improving the volume adjustment efficiency.
  • the method before determining the amplitude adjustment coefficient according to the maximum amplitude and the average amplitude, the method further includes: determining the The terminal device plays the impedance value of the device; correspondingly, determining the amplitude adjustment coefficient according to the maximum amplitude and the average amplitude comprises: determining an amplitude adjustment coefficient according to the impedance value, the maximum amplitude, and the average amplitude. Steps S401 to S406 are included as shown.
  • step S401 when the terminal device detects the sound source playing, the audio information of the preset length of the sound source is acquired.
  • step S402 a maximum amplitude and an average amplitude in the audio information are determined.
  • step S403 the impedance value of the terminal device playback device is determined.
  • 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.
  • a first amplitude adjustment coefficient is determined according to the impedance value, the maximum amplitude, and the average amplitude.
  • the first amplitude adjustment coefficient is jointly determined in conjunction with the impedance values of the terminal device playback device determined in step S403.
  • the greater the impedance value the greater the corresponding determined first amplitude adjustment factor.
  • the corresponding first amplitude adjustment coefficient may be 1.2 times the amplitude adjustment coefficient determined only by the maximum amplitude and the average amplitude. The final determined amplitude adjustment factor.
  • step S405 an amplitude greater than the first preset threshold in the sound source is adjusted according to the first amplitude adjustment coefficient.
  • a second amplitude adjustment coefficient is determined according to the average amplitude, and an amplitude of the sound source that is smaller than a second preset threshold and greater than a third preset threshold is adjusted according to the second amplitude adjustment coefficient.
  • the impedance value of the playback device is introduced as one of the parameters for determining the amplitude adjustment coefficient, which can prevent the playback device from increasing the impedance value with the increase of the playing time and then the normal playing process.
  • the volume of the volume affects the situation, so that the adjusted volume is more in line with the user's needs, and the volume adjustment effect is improved.
  • FIG. 5 is a flowchart of another volume adjustment method according to an embodiment of the present application.
  • the method before determining the amplitude adjustment coefficient according to the maximum amplitude and the average amplitude, the method further includes: determining the And determining, by the terminal device, a noise value of the device; correspondingly, determining the amplitude adjustment coefficient according to the maximum amplitude and the average amplitude comprises: determining an amplitude adjustment coefficient according to the noise value, the maximum amplitude, and the average amplitude. Steps S501 through S506 are included as shown.
  • step S501 when detecting that the terminal device performs sound source playback, the audio information of the preset length of the sound source is acquired.
  • step S502 a maximum amplitude and an average amplitude in the audio information are determined.
  • step S503 a noise value of the environment in which the terminal device is currently located is determined.
  • the noise of the current environment can be collected by the microphone installed by the terminal device to determine a corresponding noise value.
  • a first amplitude adjustment coefficient is determined according to the noise value, the maximum amplitude, and the average amplitude.
  • the first amplitude adjustment coefficient is jointly determined in conjunction with the noise value of the environment in which the terminal device is currently determined in step S503.
  • the greater the noise value the greater the corresponding determined first amplitude adjustment factor.
  • the corresponding first amplitude adjustment coefficient may be only the maximum amplitude and the average amplitude.
  • the determined amplitude adjustment coefficient is 1.2 times as the final determined amplitude adjustment coefficient. It should be noted that the impedance value, the noise value, the maximum amplitude of the sound source, and the average amplitude may also be used together to determine the amplitude adjustment coefficient of the sound source.
  • step S505 an amplitude greater than the first preset threshold in the sound source is adjusted according to the first amplitude adjustment coefficient.
  • a second amplitude adjustment coefficient is determined according to the average amplitude, and an amplitude of the sound source that is smaller than a second preset threshold and greater than a third preset threshold is adjusted according to the second amplitude adjustment coefficient.
  • the influence of noise on the volume of the terminal device is considered, and the determined noise value is taken as one of the parameters for determining the amplitude adjustment coefficient, so that the adjusted volume is more in line with the user's demand. Improve the volume adjustment effect.
  • FIG. 6 is a flowchart of another volume adjustment method according to an embodiment of the present application.
  • the method further includes: adjusting according to the amplitude The coefficient determines corresponding volume adjustment information; and the current volume of the terminal device is adjusted according to the volume adjustment information. Steps S601 through S604 are included as shown.
  • step S601 when the terminal device detects the sound source playing, the audio information of the preset length of the sound source is acquired.
  • step S602 a maximum amplitude and an average amplitude in the audio information are determined.
  • step S603 an amplitude adjustment coefficient is determined according to the maximum amplitude and the average amplitude, and the amplitude of the sound source is adjusted according to the amplitude adjustment coefficient.
  • step S604 corresponding volume adjustment information is determined according to the amplitude adjustment coefficient, and the current volume of the terminal device is adjusted according to the volume adjustment information.
  • the corresponding volume adjustment information is determined based on the amplitude adjustment factor. In an embodiment, when the amplitude adjustment coefficient is greater than 1, the corresponding volume increase information is determined, and when the amplitude adjustment coefficient is less than 1, the corresponding volume decrease information is determined.
  • the volume increase or volume decrease information is a corresponding target volume value.
  • the terminal device is divided into 18 adjustable levels from mute to maximum volume, and each level corresponds to a volume value, and the target volume value corresponding to the volume reduction information may be 3 or 4, and the volume is increased.
  • the target volume value corresponding to the information may be 14 or 15. When the determined sound source amplitude is too small, the volume value is correspondingly increased to 14 or 15.
  • the corresponding volume value is correspondingly Reduce to 3 or 4.
  • the information that the volume is increased or the volume is decreased is a corresponding volume change value.
  • the terminal device is divided into 18 adjustable levels from mute to maximum volume, and each level corresponds to a volume value, and the volume change information and the volume change information corresponding to the volume change information are 3, for example, The volume value of the current terminal device is 10.
  • the volume information needs to be increased, the sound volume is increased by 3 on the basis of the current volume value, and the sound is played by using the 13th volume.
  • the current volume value is On the basis of the reduction of 3, the sound of the seventh level is used for sound playback.
  • the method before adjusting the volume of the terminal device, the method further includes: determining a play time of the sound source.
  • the play time is greater than the preset time, for example, the play time is 30s, the volume increase information is used according to the volume. Or the manner in which the volume change value in the volume reduction information adjusts the current volume value of the terminal device, thereby improving the volume adjustment efficiency and reducing the power consumption of the terminal device.
  • adaptively adjusting the playing volume of the terminal device can enhance the adjustment effect, so that the volume during the sound source playing is more moderate and meets the user's needs.
  • FIG. 7 is a structural block diagram of a volume adjustment apparatus according to an embodiment of the present application.
  • the apparatus is configured to perform the volume adjustment method provided by the foregoing embodiment, and has a function module corresponding to the execution method.
  • the apparatus includes an acquisition module 101, an amplitude determination module 102, an adjustment coefficient determination module 103, and an adjustment module 104.
  • the obtaining module 101 is configured to acquire audio information of a preset length of the sound source when detecting that the terminal device performs sound source playing.
  • the amplitude determination module 102 is arranged to determine a maximum amplitude and an average amplitude in the audio information.
  • the adjustment coefficient determination module 103 is configured to determine an amplitude adjustment coefficient based on the maximum amplitude and the average amplitude.
  • the adjustment module 104 is configured to adjust the amplitude of the sound source according to the amplitude adjustment coefficient.
  • the technical solution provided by the embodiment when detecting that the terminal device performs sound source playing, acquiring audio information of a preset length of the sound source, determining a maximum amplitude and an average amplitude in the audio information, according to the maximum amplitude and the The average amplitude determines an amplitude adjustment coefficient, and the amplitude of the sound source is adjusted according to the amplitude adjustment coefficient.
  • This solution can improve the volume adjustment efficiency and reduce the power consumption of the terminal device.
  • the adjustment coefficient determining module 103 is further configured to: if the difference between the maximum amplitude and the average amplitude meets a preset condition, determine an amplitude adjustment coefficient according to the maximum amplitude and the average amplitude .
  • the adjustment coefficient determining module 103 is configured to: determine a first amplitude adjustment coefficient according to a difference between the maximum amplitude and the average amplitude;
  • the adjustment module 104 is configured to adjust an amplitude of the sound source that is greater than a first preset threshold according to the first amplitude adjustment coefficient.
  • the adjustment coefficient determining module 103 is further configured to: after determining the first amplitude adjustment coefficient according to the difference between the maximum amplitude and the average amplitude, determining the second amplitude according to the average amplitude
  • the adjustment module 104 is further configured to: adjust, according to the second amplitude adjustment coefficient, an amplitude of the sound source that is smaller than a second preset threshold and greater than a third preset threshold, the second preset The threshold is less than the first preset threshold.
  • the adjustment coefficient determining module 103 is further configured to: before determining the amplitude adjustment coefficient according to the maximum amplitude and the average amplitude, determining an impedance value of the terminal device playing device, according to the The impedance value, the maximum amplitude, and the average amplitude determine an amplitude adjustment factor.
  • the adjustment coefficient determining module 103 is further configured to: before determining the amplitude adjustment coefficient according to the maximum amplitude and the average amplitude, determining a noise value of an environment in which the terminal device is currently located, according to The noise value, the maximum amplitude, and the average amplitude determine an amplitude adjustment factor.
  • the adjustment module 104 is further configured to: after adjusting the amplitude of the sound source according to the amplitude adjustment coefficient, determine corresponding volume adjustment information according to the amplitude adjustment coefficient; The information adjusts the current volume of the terminal device.
  • FIG. 8 is a schematic structural diagram of another 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 illustrated terminal device 200 is merely one example of a terminal device, and the terminal device 200 may have more or fewer components than those shown in the figures, and two or more components may be combined. Or it can have different component configurations.
  • the various components shown in the figures can be implemented in hardware, software, or a combination of hardware and software, including at least one of signal processing and application specific integrated circuits.
  • the terminal device for rights management of a multi-open application provided in this embodiment is described in detail below.
  • the terminal device takes a smart phone as an example.
  • the memory 201 may be accessed by the CPU 202, the peripheral interface 203, etc., and the memory 201 may include a high speed random access memory, and may 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 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 for controlling 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 (press buttons, rocker buttons, etc.) ), dial, slide switch, joystick, click wheel.
  • the input controller 2092 can be connected 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, 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 can be operated.
  • the icon of the game, the icon of the network to the corresponding network, and the like.
  • the device may also 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 mainly configured to establish communication between the mobile phone and the wireless network (ie, the network side), and implement data reception and transmission between the mobile phone and the wireless network. For example, sending and receiving short messages, emails, and the like.
  • 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 performs the electromagnetic signal with the communication network and other devices. Communication.
  • RF circuitry 205 may include known circuitry configured to perform 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, a codec CODER-DECoder (CODEC) chipset, Subscriber Identity Module (SIM), etc.
  • CDDEC codec CODER-DECoder
  • the audio circuit 206 is primarily configured 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 application, and have a corresponding function module for performing the method.
  • a corresponding function module for performing the method.
  • the embodiment of the present application further provides a storage medium including terminal device executable instructions, where the terminal device executable instructions are configured to perform a volume adjustment method when executed by a terminal device processor, the method comprising: when detecting the terminal Obtaining audio information of a preset length of the sound source when the device performs sound source playback; determining a maximum amplitude and an average amplitude in the audio information; determining an amplitude adjustment coefficient according to the maximum amplitude and the average amplitude; The adjustment factor adjusts the amplitude of the source.
  • the determining the amplitude adjustment coefficient according to the maximum amplitude and the average amplitude comprises: if the difference between the maximum amplitude and the average amplitude satisfies a preset condition, according to the maximum amplitude and The average amplitude determines the amplitude adjustment factor.
  • the determining the amplitude adjustment coefficient according to the maximum amplitude and the average amplitude comprises: determining a first amplitude adjustment coefficient according to a difference between the maximum amplitude and the average amplitude; correspondingly, the basis
  • the adjusting the amplitude of the sound source by the amplitude adjustment coefficient comprises: adjusting an amplitude of the sound source that is greater than a first predetermined threshold according to the first amplitude adjustment coefficient.
  • the Adjusting the amplitude of the sound source according to the amplitude adjustment coefficient further includes: adjusting, according to the second amplitude adjustment coefficient, an amplitude of the sound source that is smaller than a second preset threshold and greater than a third preset threshold, The second preset threshold is less than the first preset threshold.
  • the method before determining the amplitude adjustment coefficient according to the maximum amplitude and the average amplitude, the method further includes: determining an impedance value of the terminal device playing device; correspondingly, according to the maximum amplitude sum
  • the average amplitude determining the amplitude adjustment coefficient includes determining an amplitude adjustment coefficient based on the impedance value, the maximum amplitude, and the average amplitude.
  • the method before determining the amplitude adjustment coefficient according to the maximum amplitude and the average amplitude, the method further includes: determining a noise value of an environment in which the terminal device is currently located; correspondingly, according to the maximum Amplitude and the average amplitude determining the amplitude adjustment coefficient includes determining an amplitude adjustment coefficient based on the noise value, the maximum amplitude, and the average amplitude.
  • the method further includes: determining corresponding volume adjustment information according to the amplitude adjustment coefficient; and the terminal device according to the volume adjustment information The current volume is adjusted.
  • Storage media any type of storage device or storage device.
  • the term "storage medium” is intended to include: 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 a dynamic random access memory ( Dynamic Random Access Memory (DRAM), Double Data Rate Random Access Memory (DDR RAM), Static Random Access Memory (SRAM), Dynamic Data Memory (Extended Data Output Random Access Memory, EDO RAM) ), Rambus Random Access Memory (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 elements, and the like.
  • DRAM Dynamic Random Access Memory
  • DDR RAM Double Data Rate Random Access Memory
  • SRAM Static Random Access Memory
  • EDO RAM Extended Data Output Random Access Memory
  • Rambus RAM Rambus Random Access Memory
  • 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, a computer program) executable by one or more processors.
  • a storage medium containing computer executable instructions are not limited to the volume adjustment method operation as described above, and may also be executed in the volume adjustment method provided by any embodiment of the present application. Related operations.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Circuit For Audible Band Transducer (AREA)

Abstract

本申请实施例公开了一种音量调节方法、装置、终端设备及存储介质,该方法包括当检测到终端设备进行音源播放时,获取所述音源的预设长度的音频信息,确定所述音频信息中的最大振幅和平均振幅,依据所述最大振幅和所述平均振幅确定振幅调节系数,依据所述振幅调节系数对所述音源的振幅进行调节。

Description

音量调节方法、装置、终端设备及存储介质
本申请要求在2017年08月18日提交中国专利局、申请号为201710711364.4的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及计算机技术,例如涉及一种音量调节方法、装置、终端设备及存储介质。
背景技术
随着终端设备普及程度的提高,越来越多的用户使用终端设备执行各种各样的功能以满足自身需求,如使用终端设备阅读文字、观看视频、听音乐、玩游戏等。当终端设备在播放音视频时,音量大小的调节存在缺陷,需要改进。
发明内容
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。
本申请提供了一种音量调节方法、装置、终端设备及存储介质,可以提高音量调节效率,降低终端设备的功耗。
第一方面,本申请实施例提供了一种音量调节方法,包括:当检测到终端设备进行音源播放时,获取所述音源的预设长度的音频信息;确定所述音频信息中的最大振幅和平均振幅;依据所述最大振幅和所述平均振幅确定振幅调节系数;依据所述振幅调节系数对所述音源的振幅进行调节。
第二方面,本申请实施例还提供了一种音量调节装置,包括:获取模块,设置为当检测到终端设备进行音源播放时,获取所述音源的预设长度的音频信息;振幅确定模块,设置为确定所述音频信息中的最大振幅和平均振幅;调节系数确定模块,设置为依据所述最大振幅和所述平均振幅确定振幅调节系数;调节模块,设置为依据所述振幅调节系数对所述音源的振幅进行调节。
第三方面,本申请实施例还提供了一种终端设备,包括:处理器、存储器 以及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如本申请实施例所述的音量调节方法。
第四方面,本申请实施例还提供了一种包含终端设备可执行指令的存储介质,所述终端设备可执行指令在由终端设备处理器执行时设置为执行本申请实施例所述的音量调节方法。
在阅读并理解了附图和详细描述后,可以明白其他方面。
附图说明
图1是本申请实施例提供的一种音量调节方法的流程图;
图2是本申请实施例提供的另一种音量调节方法的流程图;
图3是本申请实施例提供的另一种音量调节方法的流程图;
图4是本申请实施例提供的另一种音量调节方法的流程图;
图5是本申请实施例提供的另一种音量调节方法的流程图;
图6是本申请实施例提供的另一种音量调节方法的流程图;
图7是本申请实施例提供的一种音量调节装置的结构框图;
图8是本申请实施例提供的一种终端设备的结构示意图。
具体实施方式
下面结合附图和实施例对本申请作详细说明。可以理解的是,此处所描述的实施例用于解释本申请,而非对本申请的限定。图1是本申请实施例提供的一种音量调节方法的流程图,本实施例可适用于终端设备播放音源时对其音量进行调节的情况,该方法可以由本申请实施例提供的终端设备来执行,该终端设备的音量调节装置可采用软件和硬件中至少一种的方式实现,如图1所示,本实施例提供的方案包括步骤S101,步骤S102以及步骤S103。
在步骤S101中,当检测到终端设备进行音源播放时,获取所述音源的预设长度的音频信息。
终端设备可通过安装的第三方应用程序或系统自带的音视频播放软件进行音源的播放。其中,主要包括音源文件的获取、解码和输出等步骤。在一实施例中,获取到的音源文件可以是通过网络接收到的组播流,还可以是终端设备本地存储的音视频文件;获取到该音源文件后将其加载到内存缓冲区中;对加 载到内存缓冲区的音源文件进行解码,在解码开始之前,如果该音源文件同时包含有视频数据,需要进行音频数据和视频数据的分离,将分离后的音频数据输入至音频解码器,其中,音频解码器主要用于读取内存缓冲区中的音频数据,得到数字音频信号,并将该数字音频信号转换为模拟音频信号,终端设备的播放器件根据该模拟音频信号进行音频播放。在一实施例中,当监听到音源播放事件被触发时,确定终端设备开始播放音源,其中,该触发事件可以是检测到的触摸屏中显示的播放按钮被按下,还可以是检测到终端设备的播放器件如喇叭开始播放声音时,确定终端设备进行音源播放。
当检测到终端设备进行音源播放时,获取所述音源的预设长度的音频信息。在一实施例中,可对音频解码器解码得到的数字音频信号进行取样,确定该音源对应的音频信息,其中预设长度可以是3s、5s或10s等。在另一实施例中,还可以获取当前播放的音源的原始文件,通过对该原始文件的解析确定音源对应的预设长度的音频信息。在另一实施例中,以安卓(Android)系统为例,可通过android.media.MediaRecorder类或android.media.AudioRecord类获取音源的音频信息。
在步骤S102中,确定所述音频信息中的最大振幅和平均振幅。
振幅指物体震动过程中偏离原来位置的最大距离,人耳听到的声音的响度与音源的振幅相关,振幅越大响度越强。在一实施例中,可对音频解码器解码得到的数字音频信号进行取样,得到振幅信息,其中,该振幅信息可有多个振幅值组成。在一实施例中,以3s为例,3s时长内播放的音源中,对应得到的音频信息中的多个振幅值,记录获取的每个振幅值,确定其中的最大振幅以及所有振幅的平均振幅。
在另一实施例中,当检测音源播放时,每隔预设时间(如1s、3s或10s)确定一次预设长度的音频信息,或者实时的,对音频信息的每一帧的振幅进行确定。例如,所述获取所述音源的音频信息包括:所述获取所述音源的预设长度的音频信息包括:获取所述音源的预设长度的音频帧信息;相应的,确定所述预设长度的音频信息中的最大振幅和平均振幅包括:依据所述音频帧信息确定所述预设长度的音频信息中的最大振幅和平均振幅。在一实施例中,当检测到音源播放时,对音源文件进行解析得到音频帧序列,确定预设长度的音频信息下每一帧确定对应的振幅,进而确定最大振幅和平均振幅。
在步骤S103中,依据所述最大振幅和所述平均振幅确定振幅调节系数,依据所述振幅调节系数对所述音源的振幅进行调节。
在一实施例中,可根据最大振幅和平均振幅确定固定的振幅调节系数,或者确定不同的振幅调节系数,再根据具体的音源振幅的大小进行分配以进行振幅调节。在对音源的振幅进行调节的过程中,可通过对音源文件进行解析,对得到的音频数据中的表征振幅信息的数据进行修改,修改完毕后再进行封装,当缓冲到对应的音源文件并被播放时音源的振幅相应的已被增大;还可以是,在音源播放的解码过程中,通过对得到的数字音频信号进行分析得到振幅数据,将该振幅数据乘以对应的调节系数以改变振幅大小,进而对音源的音量进行调节。由此,实现了不改变终端设备系统原有音量的前提下对音源音量的大小进行了调节,调节过程可以在音源文件未进入缓冲区前,以减少播放负载,也可以是针对缓冲区中的音源内容进行调节以提高调节效率。
在另一实施例中,对音源的每一帧的振幅大小进行调节。例如,调节过程中针对每一帧的振幅大小的不同分配不同的振幅调节系数以进行对应调节,在一实施例中,具体对应关系可以如下表所示:
表1
振幅 调节系数
大于-3db或小于-50db 1
小于-10db且大于-50db 2
小于-3db且大于-10db 1.5
如表1所示,当音频帧的振幅大于-3db或小于-50db时,不对其增益进行调节;当振幅小于-3db且大于-10db时,振幅为高振幅区,为其分配增益系数为1.5,当振幅小于-10db且大于-50db时,为中振幅区,为其分配振幅系数为2以显著提高该部分振幅的振幅大小。
在一实施例中,所述依据所述最大振幅和所述平均振幅确定振幅调节系数包括:如果所述最大振幅和所述平均振幅的差值满足预设条件,则依据所述最大振幅和所述平均振幅确定振幅调节系数。在一实施例中,当最大振幅和平均振幅差值较大时(如0.2db),为了避免播放到较大振幅的音源时音量较大,对较高的振幅进行调节以的降低音量。在一实施例中,若最大振幅和平均振幅之差不满足预设条件,即相差不大,则不对音源的振幅进行调节。
图2是本申请实施例提供的另一种音量调节方法的流程图,在一实施例中,所述依据所述最大振幅和所述平均振幅确定振幅调节系数包括:依据所述最大振幅和所述平均振幅的差值确定第一振幅调节系数;相应的,所述依据所述振幅调节系数对所述音源的振幅进行调节包括:依据所述第一振幅调节系数,对所述音源中大于第一预设阈值的振幅进行调节。如图2所示,技术方案包括步骤S201,步骤S202以及步骤S203。
在步骤S201中,当检测到终端设备进行音源播放时,获取所述音源的预设长度的音频信息。
在步骤S202中,确定所述音频信息中的最大振幅和平均振幅。
在步骤S203中,依据所述最大振幅和所述平均振幅的差值确定第一振幅调节系数,依据所述第一振幅调节系数,对所述音源中大于第一预设阈值的振幅进行调节。在一实施例中,依据最大振幅和平均振幅的差值确定第一振幅调节系数的关系如下表:
表2
最大振幅和平均振幅的差值 调节系数
大于0.4db 0.4
大于0.3db且小于0.4db 0.6
大于0.2db且小于0.3db 0.8
其中,该第一预设振幅阈值可以是-2db,即将大于第一振幅阈值的振幅大小乘以对应的调节系数以进行振幅衰减降低音量。由此,对音源中振幅较大的部分进行合理衰减以避免听感突兀,提高了音源的播放效果。
图3是本申请实施例提供的另一种音量调节方法的流程图,在一实施例中,在所述依据所述最大振幅和所述平均振幅的差值确定第一振幅调节系数之后,还包括:依据所述平均振幅确定第二振幅调节系数;相应的,所述依据所述振幅调节系数对所述音源的振幅进行调节还包括:依据所述第二振幅调节系数,对所述音源中小于第二预设阈值且大于第三预设阈值的振幅进行调节,所述第二预设阈值小于第一预设阈值。如图所示包括步骤S301,步骤S302,步骤S303以及步骤S304。
在步骤S301中,当检测到终端设备进行音源播放时,获取所述音源的预设长度的音频信息。
在步骤S302中,确定所述音频信息中的最大振幅和平均振幅。
在步骤S303中,依据所述最大振幅和所述平均振幅的差值确定第一振幅调节系数,依据所述第一振幅调节系数,对所述音源中大于第一预设阈值的振幅进行调节。
在步骤S304中,依据所述平均振幅确定第二振幅调节系数,依据所述第二振幅调节系数,对所述音源中小于第二预设阈值且大于第三预设阈值的振幅进行调节。
其中,所述第二预设阈值小于第一预设阈值。在一实施例中,依据所述平均振幅确定第二振幅调节系数。在一实施例中,平均振幅和第二振幅调节系数的对应关系如下表:
表3
平均振幅 调节系数
-25db 1.2
-20db 1.5
-15db 1.8
在一实施例中,该第二预设阈值可以是-30db,第三预设振幅阈值可以是-50db。当确定出的音源振幅小于第二预设阈值且大于第三预设阈值时,按照表3对应的调节系数对满足条件的振幅进行调节。
由上述可知,依据音源的平均振幅的大小确定对应的调节系数,平均振幅越大对应的调节系数越高,对满足条件的(小于第二预设阈值且大于第三预设阈值)的振幅按照该调节系数进行调节,将音源中较低的音量部分进行音量的提高,改善音源播放播放过程中播放效果,避免用户手动进行音量调节,可以提高音量调节效率。
图4是本申请实施例提供的另一种音量调节方法的流程图,在一实施例中,在所述依据所述最大振幅和所述平均振幅确定振幅调节系数之前,还包括:确定所述终端设备播放器件的阻抗值;相应的,所述依据所述最大振幅和所述平均振幅确定振幅调节系数包括:依据所述阻抗值、所述最大振幅和所述平均振幅确定振幅调节系数。如图所示包括步骤S401至步骤S406。
在步骤S401中,当检测到终端设备进行音源播放时,获取所述音源的预设长度的音频信息。
在步骤S402中,确定所述音频信息中的最大振幅和平均振幅。
在步骤S403中,确定所述终端设备播放器件的阻抗值。
在在一实施例中,可通过功放芯片检测终端设备中安装的播放器件(如:扬声器)的阻抗值,还可以是通过物理方式检测播放器件的阻抗。
在步骤S404中,依据所述阻抗值、所述最大振幅和所述平均振幅确定第一振幅调节系数。
在一实施例中,在上述实施例中依据最大振幅和平均振幅的基础上,结合步骤S403确定的终端设备播放器件的阻抗值共同确定第一振幅调节系数。在一实施例中,该阻抗值越大对应的共同确定的第一振幅调节系数越大。例如,假设播放器件的标称阻抗值为x,通过检测得到的阻抗值为1.2x,则相应的第一振幅调整系数可以是仅通过最大振幅和平均振幅确定的振幅调节系数的1.2倍以作为最终确定的振幅调节系数。
在步骤S405中,依据所述第一振幅调节系数,对所述音源中大于第一预设阈值的振幅进行调节。
在步骤S406中,依据所述平均振幅确定第二振幅调节系数,依据所述第二振幅调节系数,对所述音源中小于第二预设阈值且大于第三预设阈值的振幅进行调节。
由上述可知,在对音源的振幅进行调节过程中,引入播放器件的阻抗值作为确定振幅调节系数的参量之一,可以避免播放器件随播放时长的增加阻抗值越来越高进而对正常播放过程中的音量大小产生影响的情况,使得调节后的音量大小更加符合用户需求,提高音量调节效果。
图5是本申请实施例提供的另一种音量调节方法的流程图,在一实施例中,在所述依据所述最大振幅和所述平均振幅确定振幅调节系数之前,还包括:确定所述终端设备播放器件的噪声值;相应的,所述依据所述最大振幅和所述平均振幅确定振幅调节系数包括:依据所述噪声值、所述最大振幅和所述平均振幅确定振幅调节系数。如图所示包括步骤S501至步骤S506。
在步骤S501中,当检测到终端设备进行音源播放时,获取所述音源的预设长度的音频信息。
在步骤S502中,确定所述音频信息中的最大振幅和平均振幅。
在步骤S503中,确定所述终端设备当前所处环境的噪声值。
在一实施例中,可通过终端设备安装的麦克风采集当前所处环境的噪音以确定对应的噪声值。
在步骤S504中,依据所述噪声值、所述最大振幅和所述平均振幅确定第一振幅调节系数。
在一实施例中,在上述实施例中依据最大振幅和平均振幅的基础上,结合步骤S503确定的终端设备当前所处环境的噪声值共同确定第一振幅调节系数。在一实施例中,该噪声值越大对应的共同确定的第一振幅调节系数越大。例如,假设终端设备在安静环境下的噪声值为y,终端设备处于户外或嘈杂环境中时,确定的噪声值为1.2y,则相应的第一振幅调整系数可以是仅通过最大振幅和平均振幅确定的振幅调节系数的1.2倍以作为最终确定的振幅调节系数。需要说明的是,还可将阻抗值、噪声值、音源的最大振幅和平均振幅共同确定音源的振幅调节系数。
在步骤S505中,依据所述第一振幅调节系数,对所述音源中大于第一预设阈值的振幅进行调节。
在步骤S506中,依据所述平均振幅确定第二振幅调节系数,依据所述第二振幅调节系数,对所述音源中小于第二预设阈值且大于第三预设阈值的振幅进行调节。
由上述可知,在对音源的振幅进行调节过程中,考虑了噪声对终端设备音量的影响,将确定的噪声值作为确定振幅调节系数的参量之一,使得调节后的音量大小更加符合用户需求,提高音量调节效果。
图6是本申请实施例提供的另一种音量调节方法的流程图,在一实施例中,在依据所述振幅调节系数对所述音源的振幅进行调节之后,还包括:依据所述振幅调节系数确定对应的音量调节信息;依据所述音量调节信息对所述终端设备当前的音量进行调节。如图所示包括步骤S601至步骤S604。
在步骤S601中,当检测到终端设备进行音源播放时,获取所述音源的预设长度的音频信息。
在步骤S602中,确定所述音频信息中的最大振幅和平均振幅。
在步骤S603中,依据所述最大振幅和所述平均振幅确定振幅调节系数,依据所述振幅调节系数对所述音源的振幅进行调节。
在步骤S604中,依据所述振幅调节系数确定对应的音量调节信息,依据所 述音量调节信息对所述终端设备当前的音量进行调节。
在一实施例中,根据振幅调节系数确定对应的音量调节信息。在一实施例中,当振幅调节系数大于1时,则确定对应的音量增大信息,当振幅调节系数小于1时,则确定对应的音量减小信息。例如,在一实施例中,该音量增大或音量减小的信息为对应的目标音量值。在一实施例中,终端设备由静音到最大音量总共分为18个可调等级,每个等级对应一个音量值,该音量减小信息对应的目标音量值可以是3或4,该音量增大信息对应的目标音量值可以是14或15,当确定出的音源振幅偏小时,则相应的将音量值增大至14或15,当确定出的音源振幅偏大时,则相应的将音量值减小至3或4。在另一实施例中,该音量增大或音量减小的信息为对应的音量改变值。在一实施例中,终端设备由静音到最大音量总共分为18个可调等级,每个等级对应一个音量值,该音量增大信息和音量减小信息对应的音量改变值为3,例如,当前终端设备的音量值为10,当需要增大音量信息时,则在当前音量值的基础上增加3即采用第13级音量进行声音播放,当需要减小音量信息时,则在当前音量值的基础上减小3即采用第7级音量进行声音播放。在一实施例中,在对终端设备的音量进行调节之前,还包括:确定该音源的播放时间,当播放时间大于预设时间时,如播放时间为30s,则采用依据所述音量增大信息或音量减小信息中的音量改变值对所述终端设备当前的音量值进行调节的方式,由此提高音量调节效率,降低终端设备的能耗。
由此,在对音源的振幅进行调节的基础上,适应性的对终端设备的播放音量进行调节,可以增强调节效果,使得音源播放过程中的音量更加适中,符合用户需求。
图7是本申请实施例提供的一种音量调节装置的结构框图,该装置设置为执行上述实施例提供的音量调节方法,具备执行方法相应的功能模块。如图7所示,该装置包括:获取模块101、振幅确定模块102、调节系数确定模块103和调节模块104。
其中,获取模块101,设置为当检测到终端设备进行音源播放时,获取所述音源的预设长度的音频信息。
振幅确定模块102,设置为确定所述音频信息中的最大振幅和平均振幅。
调节系数确定模块103,设置为依据所述最大振幅和所述平均振幅确定振幅调节系数。
调节模块104,设置为依据所述振幅调节系数对所述音源的振幅进行调节。
本实施例提供的技术方案,当检测到终端设备进行音源播放时,获取所述音源的预设长度的音频信息,确定所述音频信息中的最大振幅和平均振幅,依据所述最大振幅和所述平均振幅确定振幅调节系数,依据所述振幅调节系数对所述音源的振幅进行调节。本方案可以提高音量调节效率,降低终端设备的功耗。
在一实施例中,所述调节系数确定模块103还设置为:如果所述最大振幅和所述平均振幅的差值满足预设条件,则依据所述最大振幅和所述平均振幅确定振幅调节系数。
在一实施例中,所述调节系数确定模块103设置为:依据所述最大振幅和所述平均振幅的差值确定第一振幅调节系数;
相应的,所述调节模块104设置为:依据所述第一振幅调节系数,对所述音源中大于第一预设阈值的振幅进行调节。
在一实施例中,所述调节系数确定模块103还设置为:在所述依据所述最大振幅和所述平均振幅的差值确定第一振幅调节系数之后,依据所述平均振幅确定第二振幅调节系数;所述调节模块104还设置为:依据所述第二振幅调节系数,对所述音源中小于第二预设阈值且大于第三预设阈值的振幅进行调节,所述第二预设阈值小于第一预设阈值。
在一实施例中,所述调节系数确定模块103还设置为:在所述依据所述最大振幅和所述平均振幅确定振幅调节系数之前,确定所述终端设备播放器件的阻抗值,依据所述阻抗值、所述最大振幅和所述平均振幅确定振幅调节系数。
在一实施例中,所述调节系数确定模块103还设置为:在所述依据所述最大振幅和所述平均振幅确定振幅调节系数之前确定所述终端设备当前所处环境的噪声值,依据所述噪声值、所述最大振幅和所述平均振幅确定振幅调节系数。
在一实施例中,所述调节模块104还设置为:在依据所述振幅调节系数对所述音源的振幅进行调节之后,依据所述振幅调节系数确定对应的音量调节信息;依据所述音量调节信息对所述终端设备当前的音量进行调节。
本实施例在上述实施例的基础上提供了一种终端设备,该终端设备可以包括本申请提供的音量调节装置。图8是本申请实施例提供的另一种终端设备的结构示意图,如图8所示,该终端设备200包括:存储器201、处理器(Central  Processing Unit,CPU)202、外设接口203、射频(Radio Frequency,RF)电路205、音频电路206、扬声器211、电源管理芯片208、输入/输出(I/O)子系统209、触摸屏212、其他输入/控制设备210以及外部端口204,这些部件通过一个或多个通信总线或信号线207来通信。
应该理解的是,图示终端设备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检测触摸屏上的接触,显示控制器2091将检测到的接触转换为与显示在触摸屏212上的用户界面对象的交互,即实现人机交互,显示在触摸屏212上的用户界面对象可以是运行游戏的图标、联网到相应 网络的图标等。值得说明的是,设备还可以包括光鼠,光鼠是不显示可视输出的触摸敏感表面,或者是由触摸屏形成的触摸敏感表面的延伸。
RF电路205,主要设置为建立手机与无线网络(即网络侧)的通信,实现手机与无线网络的数据接收和发送。例如收发短信息、电子邮件等。例如,RF电路205接收并发送RF信号,RF信号也称为电磁信号,RF电路205将电信号转换为电磁信号或将电磁信号转换为电信号,并且通过该电磁信号与通信网络以及其他设备进行通信。RF电路205可以包括设置为执行这些功能的已知电路,其包括但不限于天线系统、RF收发机、一个或多个放大器、调谐器、一个或多个振荡器、数字信号处理器、编译码器(COder-DECoder,CODEC)芯片组、用户标识模块(Subscriber Identity Module,SIM)等等。
音频电路206,主要设置为从外设接口203接收音频数据,将该音频数据转换为电信号,并且将该电信号发送给扬声器211。
扬声器211,设置为将手机通过RF电路205从无线网络接收的语音信号,还原为声音并向用户播放该声音。
电源管理芯片208,设置为为CPU202、I/O子系统及外设接口所连接的硬件进行供电及电源管理。
上述实施例中提供的终端设备的音量调节装置及终端设备可执行本申请任意实施例所提供的终端设备的音量调节方法,具备执行该方法相应的功能模块。未在上述实施例中详尽描述的技术细节,可参见本申请任意实施例所提供的终端设备的音量调节方法。
本申请实施例还提供一种包含终端设备可执行指令的存储介质,所述终端设备可执行指令在由终端设备处理器执行时设置为执行一种音量调节方法,该方法包括:当检测到终端设备进行音源播放时,获取所述音源的预设长度的音频信息;确定所述音频信息中的最大振幅和平均振幅;依据所述最大振幅和所述平均振幅确定振幅调节系数;依据所述振幅调节系数对所述音源的振幅进行调节。
在一实施例中,所述依据所述最大振幅和所述平均振幅确定振幅调节系数包括:如果所述最大振幅和所述平均振幅的差值满足预设条件,则依据所述最大振幅和所述平均振幅确定振幅调节系数。
在一实施例中,所述依据所述最大振幅和所述平均振幅确定振幅调节系数 包括:依据所述最大振幅和所述平均振幅的差值确定第一振幅调节系数;相应的,所述依据所述振幅调节系数对所述音源的振幅进行调节包括:依据所述第一振幅调节系数,对所述音源中大于第一预设阈值的振幅进行调节。
在一实施例中,在所述依据所述最大振幅和所述平均振幅的差值确定第一振幅调节系数之后,还包括:依据所述平均振幅确定第二振幅调节系数;相应的,所述依据所述振幅调节系数对所述音源的振幅进行调节还包括:依据所述第二振幅调节系数,对所述音源中小于第二预设阈值且大于第三预设阈值的振幅进行调节,所述第二预设阈值小于第一预设阈值。
在一实施例中,在所述依据所述最大振幅和所述平均振幅确定振幅调节系数之前,还包括:确定所述终端设备播放器件的阻抗值;相应的,所述依据所述最大振幅和所述平均振幅确定振幅调节系数包括:依据所述阻抗值、所述最大振幅和所述平均振幅确定振幅调节系数。
在一实施例中,在所述依据所述最大振幅和所述平均振幅确定振幅调节系数之前,还包括:确定所述终端设备当前所处环境的噪声值;相应的,所述依据所述最大振幅和所述平均振幅确定振幅调节系数包括:依据所述噪声值、所述最大振幅和所述平均振幅确定振幅调节系数。
在一实施例中,在依据所述振幅调节系数对所述音源的振幅进行调节之后,还包括:依据所述振幅调节系数确定对应的音量调节信息;依据所述音量调节信息对所述终端设备当前的音量进行调节。
存储介质——任何类型的存储器设备或存储设备。术语“存储介质”旨在包括:安装介质,例如只读光盘(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 Random Access Memory,Rambus RAM)等;非易失性存储器,诸如闪存、磁介质(例如硬盘或光存储);寄存器或其它相似类型的存储器元件等。存储介质可以还包括其它类型的存储器或其组合。另外,存储介质可以位于程序在其中被执行的第一计算机系统中,或者可以位于不同的第二计算机系统中,第二计算机系统通 过网络(诸如因特网)连接到第一计算机系统。第二计算机系统可以提供程序指令给第一计算机用于执行。术语“存储介质”可以包括可以驻留在不同位置中(例如在通过网络连接的不同计算机系统中)的两个或更多存储介质。存储介质可以存储可由一个或多个处理器执行的程序指令(例如为计算机程序)。
本申请实施例所提供的一种包含计算机可执行指令的存储介质,其计算机可执行指令不限于如上所述的音量调节方法操作,还可以执行本申请任意实施例所提供的音量调节方法中的相关操作。

Claims (20)

  1. 一种音量调节方法,包括:
    当检测到终端设备进行音源播放时,获取所述音源的预设长度的音频信息;
    确定所述音频信息中的最大振幅和平均振幅;
    依据所述最大振幅和所述平均振幅确定振幅调节系数;
    依据所述振幅调节系数对所述音源的振幅进行调节。
  2. 根据权利要求1所述的方法,其中,所述依据所述最大振幅和所述平均振幅确定振幅调节系数包括:
    如果所述最大振幅和所述平均振幅的差值满足预设条件,则依据所述最大振幅和所述平均振幅确定振幅调节系数。
  3. 根据权利要求1所述的方法,其中,所述依据所述最大振幅和所述平均振幅确定振幅调节系数包括:
    依据所述最大振幅和所述平均振幅的差值确定第一振幅调节系数;以及
    所述依据所述振幅调节系数对所述音源的振幅进行调节包括:
    依据所述第一振幅调节系数,对所述音源中大于第一预设阈值的振幅进行调节。
  4. 根据权利要求3所述的方法,在所述依据所述最大振幅和所述平均振幅的差值确定第一振幅调节系数之后,还包括:
    依据所述平均振幅确定第二振幅调节系数;
    所述依据所述振幅调节系数对所述音源的振幅进行调节还包括:
    依据所述第二振幅调节系数,对所述音源中小于第二预设阈值且大于第三预设阈值的振幅进行调节,所述第二预设阈值小于第一预设阈值。
  5. 根据权利要求1-4中任一项所述的方法,在所述依据所述最大振幅和所述平均振幅确定振幅调节系数之前,还包括:
    确定所述终端设备播放器件的阻抗值;
    所述依据所述最大振幅和所述平均振幅确定振幅调节系数包括:
    依据所述阻抗值、所述最大振幅和所述平均振幅确定振幅调节系数。
  6. 根据权利要求1-4中任一项所述的方法,在所述依据所述最大振幅和所述平均振幅确定振幅调节系数之前,还包括:
    确定所述终端设备当前所处环境的噪声值;
    所述依据所述最大振幅和所述平均振幅确定振幅调节系数包括:
    依据所述噪声值、所述最大振幅和所述平均振幅确定振幅调节系数。
  7. 根据权利要求1-4中任一项所述的方法,在依据所述振幅调节系数对所 述音源的振幅进行调节之后,还包括:
    依据所述振幅调节系数确定对应的音量调节信息;
    依据所述音量调节信息对所述终端设备当前的音量进行调节。
  8. 根据权利要求1所述的方法,其中,所述获取所述音源的预设长度的音频信息包括:
    获取所述音源的预设长度的音频帧信息;以及
    所述确定所述音频信息中的最大振幅和平均振幅包括:
    依据所述音频帧信息确定所述预设长度的音频信息中的最大振幅和平均振幅。
  9. 根据权利要求1所述的方法,其中,所述依据所述最大振幅和所述平均振幅确定振幅调节系数包括:
    根据所述最大振幅和所述平均振幅确定固定的振幅调节系数,或者确定不同的振幅调节系数。
  10. 一种音量调节装置,包括:
    获取模块,设置为当检测到终端设备进行音源播放时,获取所述音源的预设长度的音频信息;
    振幅确定模块,设置为确定所述音频信息中的最大振幅和平均振幅;
    调节系数确定模块,设置为依据所述最大振幅和所述平均振幅确定振幅调节系数;
    调节模块,设置为依据所述振幅调节系数对所述音源的振幅进行调节。
  11. 根据权利要求10所述的装置,所述调节系数确定模块还设置为:
    如果所述最大振幅和所述平均振幅的差值满足预设条件,则依据所述最大振幅和所述平均振幅确定振幅调节系数。
  12. 根据权利要求10所述的装置,所述调节系数模块设置为:
    依据所述最大振幅和所述平均振幅的差值确定第一振幅调节系数;以及
    所述调节模块设置为:依据所述第一振幅调节系数,对所述音源中大于第一预设阈值的振幅进行调节。
  13. 根据权利要求10所述的装置,所述调节系数确定模块还设置为:在所述依据所述最大振幅和所述平均振幅的差值确定第一振幅调节系数之后,依据所述平均振幅确定第二振幅调节系数;
    所述调节模块还设置为:依据所述第二振幅调节系数,对所述音源中小于第二预设阈值且大于第三预设阈值的振幅进行调节,所述第二预设阈值小于第 一预设阈值。
  14. 根据权10-13中任一项所述的装置,所述调节系数确定模块还设置为:
    在所述依据所述最大振幅和所述平均振幅确定振幅调节系数之前,确定所述终端设备播放器件的阻抗值,依据所述阻抗值、所述最大振幅和所述平均振幅确定振幅调节系数。
  15. 根据权10-13中任一项所述的装置,所述调节系数确定模块还设置为:
    在所述依据所述最大振幅和所述平均振幅确定振幅调节系数之前确定所述终端设备当前所处环境的噪声值,依据所述噪声值、所述最大振幅和所述平均振幅确定振幅调节系数。
  16. 根据权10-13中任一项所述的装置,所述调节模块还设置为:
    在依据所述振幅调节系数对所述音源的振幅进行调节之后,依据所述振幅调节系数确定对应的音量调节信息;依据所述音量调节信息对所述终端设备当前的音量进行调节。
  17. 根据权利要求10所述的装置,其中,所述获取模块设置为:
    获取所述音源的预设长度的音频帧信息;以及
    所述确定所述音频信息中的最大振幅和平均振幅包括:
    依据所述音频帧信息确定所述预设长度的音频信息中的最大振幅和平均振幅。
  18. 根据权利要求10所述的装置,其中,所述调节系数确定模块设置为:
    根据所述最大振幅和所述平均振幅确定固定的振幅调节系数,或者确定不同的振幅调节系数。
  19. 一种终端设备,包括:处理器、存储器以及存储在存储器上并可在处理器上运行的计算机程序,其中所述处理器执行所述计算机程序时实现如权利要求1-9中任一项所述的音量调节方法。
  20. 一种包含终端设备可执行指令的存储介质,所述终端设备可执行指令设置为在由终端设备处理器执行时执行如权利要求1-9中任一项所述的音量调节方法。
PCT/CN2018/098646 2017-08-18 2018-08-03 音量调节方法、装置、终端设备及存储介质 WO2019033939A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710711364.4 2017-08-18
CN201710711364.4A CN107479851B (zh) 2017-08-18 2017-08-18 音量调节方法、装置、终端设备及存储介质

Publications (1)

Publication Number Publication Date
WO2019033939A1 true WO2019033939A1 (zh) 2019-02-21

Family

ID=60601641

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/098646 WO2019033939A1 (zh) 2017-08-18 2018-08-03 音量调节方法、装置、终端设备及存储介质

Country Status (2)

Country Link
CN (1) CN107479851B (zh)
WO (1) WO2019033939A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107479851B (zh) * 2017-08-18 2019-07-16 Oppo广东移动通信有限公司 音量调节方法、装置、终端设备及存储介质
CN109547848B (zh) 2018-11-23 2021-02-12 北京达佳互联信息技术有限公司 响度调整方法、装置、电子设备以及存储介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020159608A1 (en) * 2001-02-27 2002-10-31 International Business Machines Corporation Audio device characterization for accurate predictable volume control
US20070180980A1 (en) * 2006-02-07 2007-08-09 Lg Electronics Inc. Method and apparatus for estimating tempo based on inter-onset interval count
CN101714855A (zh) * 2009-11-19 2010-05-26 无敌科技(西安)有限公司 自动调整音量系统及其方法
CN104486668A (zh) * 2014-11-20 2015-04-01 深圳市金立通信设备有限公司 一种音量调节方法
CN105612576A (zh) * 2013-10-14 2016-05-25 高通股份有限公司 限制有源噪声消除输出
CN106448690A (zh) * 2016-10-20 2017-02-22 广州视源电子科技股份有限公司 一种音频信号的自动增益控制方法和装置
CN107479851A (zh) * 2017-08-18 2017-12-15 广东欧珀移动通信有限公司 音量调节方法、装置、终端设备及存储介质

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007228411A (ja) * 2006-02-24 2007-09-06 Funai Electric Co Ltd 音響機器及びテレビジョン受像機
CN101997498A (zh) * 2009-08-27 2011-03-30 北京宏景捷讯网络技术股份有限公司 音量调节方法和装置
CN103746668A (zh) * 2013-12-31 2014-04-23 上海斐讯数据通信技术有限公司 音量控制方法及系统
CN104410379B (zh) * 2014-10-29 2019-05-14 深圳市金立通信设备有限公司 一种音量调节方法
CN105185396B (zh) * 2015-07-28 2018-03-20 小米科技有限责任公司 一种播放音频信号的方法和装置
CN106126164B (zh) * 2016-06-16 2019-05-17 Oppo广东移动通信有限公司 一种音效处理方法及终端设备
CN106024007B (zh) * 2016-06-21 2019-10-15 维沃移动通信有限公司 一种声音处理方法及移动终端
CN106101929A (zh) * 2016-06-30 2016-11-09 维沃移动通信有限公司 一种保护人耳听力方法及移动终端
CN106775563A (zh) * 2016-12-13 2017-05-31 珠海市魅族科技有限公司 音量调节的方法及装置
CN106878866B (zh) * 2017-03-03 2020-01-10 Oppo广东移动通信有限公司 音频信号处理方法、装置及终端

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020159608A1 (en) * 2001-02-27 2002-10-31 International Business Machines Corporation Audio device characterization for accurate predictable volume control
US20070180980A1 (en) * 2006-02-07 2007-08-09 Lg Electronics Inc. Method and apparatus for estimating tempo based on inter-onset interval count
CN101714855A (zh) * 2009-11-19 2010-05-26 无敌科技(西安)有限公司 自动调整音量系统及其方法
CN105612576A (zh) * 2013-10-14 2016-05-25 高通股份有限公司 限制有源噪声消除输出
CN104486668A (zh) * 2014-11-20 2015-04-01 深圳市金立通信设备有限公司 一种音量调节方法
CN106448690A (zh) * 2016-10-20 2017-02-22 广州视源电子科技股份有限公司 一种音频信号的自动增益控制方法和装置
CN107479851A (zh) * 2017-08-18 2017-12-15 广东欧珀移动通信有限公司 音量调节方法、装置、终端设备及存储介质

Also Published As

Publication number Publication date
CN107479851B (zh) 2019-07-16
CN107479851A (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
CN107526570B (zh) 音量调节方法、装置、终端设备及存储介质
CN107465824B (zh) 音量调节方法、装置、移动终端及存储介质
CN107566618B (zh) 音量调节方法、装置、终端设备及存储介质
US11201598B2 (en) Volume adjusting method and mobile terminal
CN110799936B (zh) 音量调节方法、装置、终端设备及存储介质
WO2017215657A1 (zh) 音效处理方法及终端设备
WO2019033942A1 (zh) 音量调节方法、装置、终端设备及存储介质
US10027299B2 (en) Volume control
WO2019033941A1 (zh) 音量调节方法、装置、终端设备及存储介质
CN107506168B (zh) 音量调节方法、装置、终端设备及存储介质
CN107483734B (zh) 音量调节方法、装置、终端设备及存储介质
WO2019033939A1 (zh) 音量调节方法、装置、终端设备及存储介质
CN106293607B (zh) 自动切换音频输出模式的方法及系统
WO2019033439A1 (zh) 音量调节方法、装置、存储介质及移动终端
CN107506170A (zh) 音量调节方法、装置、终端设备及存储介质
WO2019033938A1 (zh) 音量调节方法、装置、存储介质及移动终端
WO2019033435A1 (zh) 音量调节方法、装置、移动终端及存储介质
CN107506169A (zh) 音量调节方法、装置、终端设备及存储介质
CN117061946A (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: 18846433

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: 18846433

Country of ref document: EP

Kind code of ref document: A1