WO2019033942A1 - Volume adjustment method and apparatus, terminal device, and storage medium - Google Patents

Volume adjustment method and apparatus, terminal device, and storage medium Download PDF

Info

Publication number
WO2019033942A1
WO2019033942A1 PCT/CN2018/098653 CN2018098653W WO2019033942A1 WO 2019033942 A1 WO2019033942 A1 WO 2019033942A1 CN 2018098653 W CN2018098653 W CN 2018098653W WO 2019033942 A1 WO2019033942 A1 WO 2019033942A1
Authority
WO
WIPO (PCT)
Prior art keywords
amplitude
audio
amplitude adjustment
adjustment coefficient
information
Prior art date
Application number
PCT/CN2018/098653
Other languages
French (fr)
Chinese (zh)
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 WO2019033942A1 publication Critical patent/WO2019033942A1/en

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3206Monitoring of events, devices or parameters that trigger a change in power modality
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/325Power saving in peripheral device

Definitions

  • Embodiments of the present disclosure relate to the field of 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, 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 embodiment of the present disclosure further provides a volume adjustment apparatus, including:
  • the amplitude determining module is configured to determine, according to the audio information, a plurality of audio amplitudes respectively corresponding to the plurality of preset time segments;
  • the adjustment coefficient determining module is configured to: when the first amplitude adjustment coefficient corresponding to the first audio amplitude and the second amplitude adjustment coefficient corresponding to the adjacent second audio amplitude are different, the first amplitude adjustment coefficient and the first Adding a preset number of sub-amplitude adjustment coefficients between the two amplitude adjustment coefficients, wherein the preset number of sub-amplitude adjustment coefficients are sequentially increased between the first amplitude adjustment coefficient and the second amplitude adjustment coefficient or Decrement in turn;
  • the adjustment module is configured to adjust, according to the preset number of sub-amplitude adjustment coefficients, a preset number of audio frames from a start frame, wherein the start frame is an amplitude adjustment coefficient adjusted by the first amplitude The first audio frame when the coefficient changes to the second 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 flowchart of a volume adjustment method according to another embodiment of the present disclosure.
  • FIG. 6 is a flowchart of a volume adjustment method according to another embodiment of the present disclosure.
  • FIG. 7 is a structural block diagram of a volume adjustment apparatus according to another embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram of a terminal device according to another embodiment of the present disclosure.
  • FIG. 1 is a flowchart of a volume adjustment method according to an embodiment of the present disclosure. This embodiment can be applied to the case where the volume is adjusted when the terminal device plays the sound source.
  • the volume adjustment method can be performed by the terminal device provided by this embodiment, and 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 the memory buffer, and the sound source file loaded into the memory buffer is decoded.
  • the audio file contains video data at the same time, separation of audio data and 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 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 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 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 the audio information of the sound source includes: acquiring audio frame information of the sound source; determining the audio amplitude corresponding to the audio information according to the audio information, comprising: determining, according to the audio frame information, The audio amplitude of each frame of the audio frame information.
  • the sound source file is parsed to obtain an audio frame sequence, and the amplitude corresponding to each frame is determined according to each frame of the audio frame sequence.
  • Step 103 Determine an amplitude adjustment coefficient corresponding to the audio amplitude, divide the amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients, and adjust the audio amplitude according to the sub-amplitude adjustment coefficient.
  • a large amplitude adjustment factor is assigned to the low amplitude audio amplitude, and a high amplitude audio amplitude is correspondingly assigned a smaller amplitude adjustment factor.
  • the amplitude adjustment coefficient is 1.2 for an amplitude amplitude of less than -3 decibels (db) and greater than -10 db, and the amplitude adjustment coefficient is 2 for an audio amplitude having an amplitude of less than -10 db and greater than -50 db.
  • the dividing the amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients comprises: when detecting that an amplitude adjustment coefficient corresponding to different audio amplitudes satisfies a preset condition, dividing the amplitude adjustment coefficient into A preset number of sub-amplitude adjustment factors.
  • the sub-amplitude adjustment coefficients are obtained by linear or non-linear division of the amplitude adjustment coefficients.
  • the preset condition may be that the amplitude adjustment coefficients of the adjacent audio amplitudes are different.
  • the amplitude adjustment coefficient is changed from the amplitude adjustment coefficient 1 of the previous audio amplitude to (the amplitude of the latter audio amplitude).
  • the adjustment coefficient is 2, or the amplitude adjustment coefficient is changed from 2 to 1.2, etc., a preset number of sub-amplitude adjustment coefficients can be added between the two amplitude adjustment coefficients corresponding to the adjacent two audio amplitudes.
  • each n (for example, n is greater than 1 and less than or equal to 20) frame audio frames may be corresponding to one sub-amplitude adjustment coefficient, and the amplitude of each audio frame is sequentially performed. Adjustment.
  • the sub-amplitude adjustment coefficient corresponding to the 1-20th audio frame at the start of the change is 1.28
  • the sub-amplitude adjustment coefficient corresponding to the 21-40th audio frame is 1.36, and so on.
  • the audio frame is completed with the sub-amplitude adjustment coefficient to adjust the transition period of the audio frame, and the amplitude adjustment coefficient 2 can be adjusted from the 281-frame audio frame to avoid obvious hearing acuity. problem.
  • the process of adjusting the audio amplitude may be: parsing the audio file, modifying the data representing the amplitude information in the obtained audio data, and then performing the encapsulation after the modification, when buffering to the corresponding audio source.
  • the audio amplitude is correspondingly increased; or, in the decoding process of the sound source playing, the audio amplitude is obtained by analyzing the obtained digital audio signal, and the amplitude data is multiplied by the corresponding amplitude adjustment coefficient.
  • the volume of the source may be: parsing the audio file, modifying the data representing the amplitude information in the obtained audio data, and then performing the encapsulation after the modification, when buffering to the corresponding audio source.
  • the solution provided in this embodiment realizes that the volume of the sound source is adjusted without changing the original volume of the terminal device system, and the adjustment process can reduce the playback load before the sound source file does not enter the buffer. It can adjust the sound source content in the buffer to improve the adjustment efficiency, thereby improving the volume adjustment efficiency, reducing the power consumption of the terminal device, and adjusting the audio amplitude of the preset number of audio frames by using the sub-amplitude adjustment coefficient. The problem of sudden hearing caused by the jump of the amplitude adjustment coefficient is avoided, and the user experience is improved.
  • FIG. 2 is a flowchart of a volume adjustment method according to another embodiment of the present disclosure. As shown in FIG. 2, the volume adjustment method provided in this embodiment includes the following steps.
  • Step 110 Acquire audio information of the sound source when detecting that the terminal device performs sound source playback.
  • Step 120 Determine, according to the audio information, a plurality of audio amplitudes respectively corresponding to the plurality of preset time segments.
  • determining, according to the audio information, a plurality of audio amplitudes corresponding to the plurality of preset time segments respectively including:
  • the average amplitude between the at least two audio amplitudes is determined as the audio amplitude corresponding to each of the predetermined time periods.
  • every 10s is a preset time period
  • the digital audio signal decoded by the audio decoder can be sampled 5 times in the first 10s to obtain 5 audio amplitudes, and the average between 5 audio amplitudes is calculated.
  • the amplitude, the average amplitude is taken as the first 10s corresponding audio amplitude
  • the digital audio signal decoded by the audio decoder is sampled 5 times in the second 10s to obtain 5 audio amplitudes, and 5 audio amplitudes are calculated.
  • the average amplitude between the two is used as the audio amplitude corresponding to the second 10s, thereby obtaining a plurality of audio amplitudes corresponding to the plurality of preset time periods.
  • determining, according to the audio information, a plurality of audio amplitudes corresponding to the plurality of preset time segments respectively including:
  • the audio amplitude is determined once according to the audio information every predetermined period of time.
  • every 10 s is a preset time period
  • the digital audio signal decoded by the audio decoder can be sampled once every 10 s to obtain an audio amplitude, and the sampled audio amplitude is taken as the audio amplitude corresponding to the previous 10 s.
  • determining, according to the audio information, a plurality of audio amplitudes corresponding to the plurality of preset time segments respectively including:
  • each frame of the audio information corresponds to a preset time period, for example, each 26s is a preset time period, and the audio amplitude corresponding to each frame of the audio information may be determined according to the audio information. Thereby, a plurality of audio amplitudes corresponding to the plurality of preset time periods are respectively obtained.
  • Step 130 When the first amplitude adjustment coefficient corresponding to the first audio amplitude and the second amplitude adjustment coefficient corresponding to the adjacent second audio amplitude are different, the first amplitude adjustment coefficient and the second amplitude adjustment coefficient A preset number of sub-amplitude adjustment coefficients are added therebetween, wherein the preset number of sub-amplitude adjustment coefficients are sequentially incremented or sequentially decremented between the first amplitude adjustment coefficient and the second amplitude adjustment coefficient.
  • the preset number of sub-amplitude adjustment coefficients are obtained by equally spaced between the first amplitude adjustment coefficient and the second amplitude adjustment coefficient.
  • the preset number of sub-amplitude adjustment coefficients may be obtained by non-equal spacing between the first amplitude adjustment coefficient and the second amplitude adjustment coefficient.
  • each of the plurality of audio amplitudes corresponds to an amplitude adjustment coefficient
  • each of the amplitude adjustment coefficients is determined according to a magnitude of an amplitude of the corresponding audio amplitude.
  • the plurality of audio amplitudes include an audio amplitude A, an audio amplitude B, and an audio amplitude C
  • an amplitude adjustment coefficient 1 is allocated for an audio amplitude having an amplitude greater than -3 db or less than -50 db, which is an amplitude smaller than -10 db and greater than -50 db.
  • the audio amplitude distribution amplitude adjustment coefficient 2 is an amplitude adjustment coefficient of 1.5 for an amplitude of an amplitude smaller than -3 db and greater than -10 db. If the audio amplitude A is greater than -3 db, the amplitude adjustment coefficient corresponding to the audio amplitude A is 1, if the audio When the amplitude B is smaller than -10 db and larger than -50 db, the amplitude adjustment coefficient corresponding to the audio amplitude B is 2.
  • each of the plurality of audio amplitudes corresponds to an amplitude adjustment coefficient
  • each of the amplitude adjustment coefficients is determined according to at least one of an amplitude of the corresponding audio amplitude and at least one of the following information. : an impedance value of the playback device of the terminal device and a noise value of an environment in which the terminal is located.
  • an impedance value of the playback device of the terminal device and a noise value of an environment in which the terminal is located.
  • the amplitude adjustment coefficient is adjusted, and the adjusted amplitude adjustment coefficient is determined as an amplitude adjustment coefficient corresponding to the audio amplitude.
  • each of the plurality of audio amplitudes corresponds to an amplitude adjustment coefficient
  • each of the amplitude adjustment coefficients is based on volume information of the terminal device and a corresponding amplitude of the audio amplitude.
  • the volume information includes volume value information, volume increase information, or volume decrease information.
  • a plurality of amplitude adjustment coefficients for example, three, may be determined according to the volume information, and which amplitude adjustment coefficient corresponding to each of the three amplitude adjustment coefficients is determined according to the amplitude magnitude of each audio amplitude, and thus may be determined according to each audio.
  • the amplitude magnitude of the amplitude and the volume information of the terminal device determine an amplitude adjustment factor corresponding to each audio amplitude.
  • the impedance value of the playback device of the terminal device and/or the location of the terminal may also be The noise value of the environment corresponds to the amplitude adjustment coefficient of each audio amplitude, and the adjusted amplitude adjustment coefficient is used as the amplitude adjustment coefficient corresponding to the audio amplitude, and further, according to the amplitude of each audio amplitude, the volume information of the terminal device, and the following At least one of the information determines an amplitude adjustment coefficient corresponding to each audio amplitude: an impedance value of the playback device of the terminal device and a noise value of the environment in which the terminal is located.
  • Step 140 Adjust a preset number of audio frames starting from a start frame according to the preset number of sub-amplitude adjustment coefficients.
  • the start frame is a first audio frame when the amplitude adjustment coefficient is changed from the first amplitude adjustment coefficient to the second amplitude adjustment coefficient.
  • the preset number of audio frames includes: a first group of audio frames to an Mth group of audio frames; and the preset number of sub-amplitude adjustment coefficients includes: a first sub-increment or decrement The amplitude adjustment coefficient to the Nth sub-amplitude adjustment coefficient, wherein M and N are both positive integers greater than or equal to 1, and M is greater than or equal to N.
  • Adjusting, according to the preset number of sub-amplitude adjustment coefficients, a preset number of audio frames from a start frame comprising: sequentially using the first sub-amplitude adjustment coefficient to the N-th sub-amplitude adjustment coefficient pair
  • the first set of audio frames is adjusted to the Nth group of audio frames.
  • the audio amplitude A corresponding to the preset time period a, the audio amplitude B corresponding to the preset time period b, and the audio amplitude C corresponding to the preset time period c are acquired, and the audio amplitude is determined in step 130.
  • the amplitude adjustment coefficient corresponding to A is i
  • the amplitude adjustment coefficient corresponding to the audio amplitude B is j
  • the amplitude adjustment coefficient corresponding to the audio amplitude B is k.
  • the amplitude adjustment coefficient i is used to start from the first frame audio frame in the audio information.
  • the audio amplitude of the audio frame is adjusted until the start time of the preset time period b is reached, for example, the amplitude adjustment coefficient i has been used to adjust the 1-100th frame audio frame, if the amplitude adjustment coefficient corresponding to the audio amplitude B j is the same as the amplitude adjustment coefficient i corresponding to the audio amplitude A, and then continues to use the amplitude adjustment coefficient i (ie, the amplitude adjustment coefficient j) to adjust the audio amplitude of the audio frame from the 101st frame audio frame until the preset time period is reached.
  • the start time of c for example, the amplitude adjustment coefficient i has been used to adjust the 101-300 frame audio frame, if the audio amplitude C corresponds to the amplitude adjustment coefficient k and the audio amplitude B pair
  • the amplitude adjustment coefficient j is different. For example, if k is smaller than j, 10 sub-amplitude adjustment coefficients are added between the amplitude adjustment coefficient j and the amplitude adjustment coefficient k, and the 10 sub-amplitude adjustment coefficients are respectively successively decreasing k1, k2, ...
  • the volume of the sound source is adjusted without changing the original volume of the terminal device system, thereby improving the efficiency of the volume adjustment, reducing the power consumption of the terminal device, and using the sub-amplitude adjustment coefficient to the preset number.
  • the audio frame is adjusted to avoid the sudden hearing problem caused by the jump of the amplitude adjustment coefficient and improve the user experience.
  • FIG. 3 is a flowchart of a volume adjustment method according to another embodiment of the present disclosure.
  • the determining an amplitude adjustment coefficient corresponding to the audio amplitude comprises: determining an amplitude adjustment coefficient corresponding to the audio amplitude according to a magnitude of the audio amplitude.
  • the technical solution provided by this embodiment is as follows:
  • 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 Determine an amplitude adjustment coefficient corresponding to the audio amplitude according to the amplitude of the audio amplitude.
  • the average amplitude of the audio amplitude of the preset length may be determined by acquiring an audio amplitude of a preset length, and then determining an amplitude adjustment coefficient corresponding to the audio amplitude of the preset length according to the average amplitude.
  • the amplitude adjustment coefficient corresponding to the average amplitude can be determined by a pre-stored mapping relationship table, as shown in Table 1 below:
  • Average amplitude Amplitude adjustment factor Greater than -3db or less than -50db 1 Less than -10db and greater than -50db 2 Less than -3db and greater than -10db 1.5
  • the audio amplitude is not adjusted; when the amplitude is less than -3 db and greater than -10 db, the amplitude belongs to the high amplitude region, and the amplitude distribution coefficient is 1.5 for the amplitude.
  • the amplitude adjustment coefficient is 2 for the amplitude to significantly increase the amplitude of the medium amplitude region.
  • Step 340 The amplitude adjustment coefficient is divided into a preset number of sub-amplitude adjustment coefficients, and the audio amplitude is adjusted according to the sub-amplitude adjustment coefficient. That is, as can be seen from the above example, a plurality of sub-amplitude adjustment coefficients are added between two adjacent amplitude adjustment coefficients that generate a jump, and the amplitude adjustment coefficient used to adjust the amplitude of the audio frame is changed stepwise.
  • the sub-amplitude adjustment factor adjusts the preset number of audio frames step by step.
  • the amplitude of the noise is reduced while the sound is broken, and on the basis of this, the difference of the adjacent audio amplitudes is further After the amplitude adjustment coefficient is subdivided, the preset number of audio frames in the audio amplitude is adjusted step by step, which can make the sound in the sound source playing sound reasonable and the sense of hearing smooth.
  • FIG. 4 is a flowchart of a volume adjustment method according to another embodiment of the present disclosure.
  • the determining an amplitude adjustment coefficient corresponding to the audio amplitude comprises: determining an amplitude adjustment coefficient corresponding to the audio amplitude according to an amplitude magnitude of the audio amplitude and volume information of the terminal device.
  • the volume information includes volume value information, volume increase information, or volume reduction information. As shown in FIG. 4, the technical solution provided in this embodiment includes the following steps.
  • 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 Determine an amplitude adjustment coefficient corresponding to the audio amplitude according to the amplitude magnitude of the audio amplitude and the volume information of the terminal device.
  • 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, an amplitude adjustment coefficient corresponding to the audio amplitude 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 terminal device; 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 factor corresponding to the audio amplitude is determined based on the current volume value, as shown in Table 2:
  • the amplitude adjustment coefficient corresponding to the audio amplitude is determined according to the current volume increase information or volume reduction information, as shown in Table 3:
  • the amplitude adjustment coefficient may be jointly determined according to the volume increase information or the volume reduction information in combination with the volume value of the terminal device to achieve adjustment of the audio amplitude.
  • a plurality of amplitude adjustment coefficients may be determined according to volume information of the terminal device, for example, determining a first amplitude adjustment coefficient, a second amplitude adjustment coefficient, and a third amplitude adjustment coefficient according to volume information of the terminal device, where An 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, and then according to the amplitude of the audio amplitude, which of the three amplitude adjustment coefficients is corresponding to each audio amplitude, for example, And an audio amplitude that is greater than the first preset threshold or less than the third preset threshold, the first amplitude adjustment coefficient is allocated, and the second amplitude adjustment coefficient is allocated to the audio amplitude that is less than or equal to the first preset threshold and greater than the second preset threshold.
  • a third amplitude adjustment coefficient is allocated to the audio amplitude that is less than or equal to the second preset threshold and greater than the third preset threshold, where the first preset threshold is greater than the second preset threshold, and the second preset threshold is greater than the third preset threshold And if the amplitude of the amplitude of the audio amplitude is less than the third preset threshold, determining the audio amplitude corresponding to A first amplitude adjustment factor is an amplitude adjustment coefficient.
  • determining an amplitude adjustment coefficient corresponding to the audio amplitude may be: assigning a first amplitude adjustment coefficient to an audio amplitude greater than a first preset threshold or less than a third preset threshold, being less than or equal to the first a second amplitude adjustment coefficient is allocated to the audio amplitude of the preset threshold and greater than the second preset threshold, and the third amplitude adjustment coefficient is allocated to the audio amplitude that is less than or equal to the second preset threshold and greater than the third preset threshold, where 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 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 factor is one (ie, no adjustment is made)
  • the second amplitude adjustment factor is 1.4
  • the third amplitude adjustment factor is 1.8.
  • the amplitude of the audio is not adjusted, which avoids the breakage caused by the excessive amplitude adjustment, and avoids the over-correction.
  • the noise is enhanced by the small noise, and the volume adjustment method is further optimized.
  • Step 304 The amplitude adjustment coefficient is divided into a preset number of sub-amplitude adjustment coefficients, and the audio amplitude is adjusted according to the sub-amplitude adjustment coefficient.
  • FIG. 5 is a flowchart of a volume adjustment method according to another embodiment of the present disclosure.
  • the method further includes: adjusting the amplitude adjustment coefficient according to an impedance value of the playback device of the terminal device;
  • the dividing the coefficient into a preset number of sub-amplitude adjustment coefficients comprises: dividing the adjusted amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients.
  • the volume adjustment method provided in this embodiment includes the following steps.
  • 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 Determine an amplitude adjustment coefficient corresponding to the audio amplitude, and adjust the amplitude adjustment coefficient according to the 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.
  • the greater the impedance value the greater the adjustment to the amplitude adjustment factor. For example, assuming that the nominal impedance value of the playback device is x and the impedance value obtained by the detection is 1.2x, the amplitude adjustment coefficient is multiplied by 1.2 as the adjusted amplitude based on the determined amplitude adjustment coefficient. Adjustment coefficient.
  • Step 404 Divide the adjusted amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients, and adjust the audio amplitude according to the sub-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.
  • FIG. 6 is a flowchart of a volume adjustment method according to another embodiment of the present disclosure.
  • the method further includes: adjusting the amplitude adjustment coefficient according to a noise value of an environment in which the terminal device is located; and dividing the amplitude adjustment coefficient Adjusting the coefficient for the preset number of sub-amplitudes includes dividing the adjusted amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients.
  • the technical solution provided by this embodiment is as follows:
  • Step 501 Acquire audio information of the audio source when detecting that the terminal device performs sound source playback.
  • Step 502 Determine an audio amplitude corresponding to the audio information according to the audio information.
  • Step 503 Determine an amplitude adjustment coefficient corresponding to the audio amplitude, and adjust the amplitude adjustment coefficient according to a noise value of an environment in which the terminal device is located.
  • the noise of the environment in which the terminal device is currently located may be collected by a microphone installed in the terminal device to determine a corresponding noise value.
  • the larger the noise value the larger the adjustment of the corresponding amplitude adjustment coefficient. For example, if the noise value of the terminal device in a quiet environment is y, and the terminal device is in an outdoor or noisy environment, the noise value of the environment in which the terminal device is determined is 1.5 y, and the corresponding amplitude adjustment coefficient is determined. In addition, the amplitude adjustment coefficient is multiplied by 1.5 as the adjusted amplitude adjustment coefficient. It should be noted that the amplitude adjustment coefficient of the sound source may be jointly determined according to the impedance value, the noise value, and the magnitude of the audio amplitude.
  • Step 504 The adjusted amplitude adjustment coefficient is divided into a preset number of sub-amplitude adjustment coefficients, and the audio amplitude is adjusted according to the sub-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. Further improved the volume adjustment effect.
  • FIG. 7 is a structural block diagram of a volume adjustment apparatus according to an embodiment of the present disclosure.
  • the device 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 volume adjustment device 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 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 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 101 is configured to: acquire audio frame information of the sound source; correspondingly, the amplitude determining module is configured to: determine each of the audio frame information according to the audio frame information. The audio amplitude of a frame of audio frames.
  • the sound source file is parsed to obtain an audio frame sequence, and the amplitude corresponding to each frame is determined according to each frame of the audio frame sequence.
  • the adjustment coefficient determining module 30 is configured to determine an amplitude adjustment coefficient corresponding to the audio amplitude, and divide the amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients.
  • a large amplitude adjustment factor is assigned to the low amplitude audio amplitude, and a high amplitude audio amplitude is correspondingly assigned a smaller adjustment factor.
  • the amplitude adjustment coefficient of the audio amplitude distribution is less than -3 db and greater than -10 db, and the amplitude adjustment coefficient is 2 for the audio amplitude of amplitudes less than -10 db and greater than -50 db.
  • the adjustment coefficient determining module 30 is configured to divide the amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients by detecting that an amplitude adjustment coefficient corresponding to different audio amplitudes meets a preset condition. The amplitude adjustment coefficient is divided into a preset number of sub-amplitude adjustment coefficients.
  • the sub-amplitude adjustment coefficients are obtained by linear or non-linear division of the amplitude adjustment coefficients.
  • the preset condition may be that the amplitude adjustment coefficients of the adjacent audio amplitudes are inconsistent, for example, the amplitude adjustment coefficient is changed from the amplitude adjustment coefficient 1 of the previous audio amplitude to the amplitude adjustment coefficient 2 of the latter audio amplitude, or The amplitude adjustment coefficient is changed from 2 to 1.2.
  • a preset number of sub-amplitude adjustment coefficients may be added between two amplitude adjustment coefficients corresponding to two adjacent audio amplitudes.
  • each n (for example, n is greater than 1 and less than or equal to 20) frame audio frames may correspond to one sub-amplitude adjustment coefficient, and the amplitude of each frame of the audio frame is sequentially Make adjustments.
  • the sub-amplitude adjustment coefficient corresponding to the 1-20th audio frame at the start of the change is 1.28
  • the sub-amplitude adjustment coefficient corresponding to the 21-40th audio frame is 1.36, and so on. .
  • the adjustment module 40 is configured to adjust the audio amplitude according to the sub-amplitude adjustment coefficient.
  • the process of adjusting the audio amplitude may be: parsing the audio file, modifying the data representing the amplitude information in the obtained audio data, and then performing the encapsulation after the modification, when buffering to the corresponding audio source.
  • the audio amplitude is correspondingly increased; or, in the decoding process of the sound source playing, the audio amplitude is obtained by analyzing the obtained digital audio signal, and the amplitude data is multiplied by the corresponding amplitude adjustment coefficient.
  • the volume of the source may be: parsing the audio file, modifying the data representing the amplitude information in the obtained audio data, and then performing the encapsulation after the modification, when buffering to the corresponding audio source.
  • the solution provided in this embodiment implements adjusting the volume of the sound source without changing the original volume of the terminal device system.
  • the adjustment process may reduce the playback load before the audio source file does not enter the buffer, or may be directed to
  • the content of the sound source in the buffer is adjusted to improve the adjustment efficiency, thereby improving the volume adjustment efficiency, reducing the power consumption of the terminal device, and adjusting the audio amplitude of the preset number of audio frames by using the sub-amplitude adjustment coefficient, thereby avoiding The problem of sudden hearing caused by the jump of the amplitude adjustment coefficient improves the user experience.
  • the adjustment coefficient determining module 30 is configured to divide the amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients by:
  • the adjustment module 40 is configured to:
  • the adjustment coefficient determination module 30 is configured to determine an amplitude adjustment coefficient corresponding to the audio amplitude by:
  • An amplitude adjustment coefficient corresponding to the audio amplitude is determined according to the amplitude magnitude of the audio amplitude.
  • the adjustment coefficient determination module 30 is configured to determine an amplitude adjustment coefficient corresponding to the audio amplitude by:
  • volume information includes volume value information, volume increase information, or volume reduction information.
  • the adjustment coefficient determination module 30 is further configured to:
  • the adjustment coefficient determining module 30 is configured to divide the amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients by dividing the adjusted amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients.
  • FIG. 7 is a structural block diagram of a volume adjustment apparatus according to an embodiment of the present disclosure.
  • the device 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 volume adjustment device includes an acquisition module 10, an amplitude determination module 20, an adjustment coefficient determination module 30, and an adjustment module 40.
  • the acquiring module 10 is configured to acquire audio information of the audio source when detecting that the terminal device performs sound source playing.
  • the amplitude determining module 20 is configured to determine, according to the audio information, a plurality of audio amplitudes respectively corresponding to the plurality of preset time segments;
  • the adjustment coefficient determining module 30 is configured to: when the first amplitude adjustment coefficient corresponding to the first audio amplitude and the second amplitude adjustment coefficient corresponding to the adjacent second audio amplitude are different, the first amplitude adjustment coefficient and the Adding a preset number of sub-amplitude adjustment coefficients between the second amplitude adjustment coefficients, wherein the preset number of sub-amplitude adjustment coefficients are sequentially incremented between the first amplitude adjustment coefficient and the second amplitude adjustment coefficient Or decreasing in turn;
  • the adjusting module 40 is configured to adjust, according to the preset number of sub-amplitude adjustment coefficients, a preset number of audio frames from a start frame, wherein the start frame is an amplitude adjustment coefficient by the first amplitude The first audio frame when the adjustment coefficient changes to the second amplitude adjustment coefficient.
  • the acquiring module 10 is configured to: sample the audio information at least twice in each of the preset time periods to obtain at least two audios corresponding to each of the preset time periods. An amplitude; determining an average amplitude between the at least two audio amplitudes corresponding to each of the preset time periods as an audio amplitude corresponding to each of the preset time periods.
  • the obtaining module 10 is configured to determine an audio amplitude according to the audio information every the preset time period.
  • the acquiring module 10 is configured to: determine, according to the audio information, an audio amplitude corresponding to each frame of the audio information, where each frame of the audio frame corresponds to one of the pre- Set the time period.
  • the preset number of audio frames includes: a first group of audio frames to an Mth group of audio frames; and the preset number of sub-amplitude adjustment coefficients includes: a first sub-increment or decrement The amplitude adjustment coefficient to the Nth sub-amplitude adjustment coefficient, wherein M and N are both positive integers greater than or equal to 1, and M is greater than or equal to N; the adjustment module 40 is configured to: sequentially use the first sub-amplitude Adjusting coefficients to the Nth sub-amplitude adjustment coefficient to adjust the first set of audio frames to the Nth set of audio frames.
  • the preset number of sub-amplitude adjustment coefficients are obtained by equally spaced between the first amplitude adjustment coefficient and the second amplitude adjustment coefficient.
  • each of the plurality of audio amplitudes corresponds to an amplitude adjustment coefficient
  • each of the amplitude adjustment coefficients is determined according to a magnitude of an amplitude of the corresponding audio amplitude.
  • each of the plurality of audio amplitudes corresponds to an amplitude adjustment coefficient
  • each of the amplitude adjustment coefficients is based on volume information of the terminal device and a corresponding amplitude of the audio amplitude.
  • the volume information includes volume value information, volume increase information, or volume decrease information.
  • each of the plurality of audio amplitudes corresponds to an amplitude adjustment coefficient
  • each of the amplitude adjustment coefficients is determined according to at least one of an amplitude of the corresponding audio amplitude and at least one of the following information.
  • each of the plurality of audio amplitudes corresponds to an amplitude adjustment coefficient, and each of the amplitude adjustment coefficients is Determining, according to the volume information of the terminal device, the amplitude magnitude of the corresponding audio amplitude, and at least one of the following: an impedance value of the playback device of the terminal device and a noise value of an environment in which the terminal is located, where
  • the volume information includes volume value information, volume increase information, or volume decrease information.
  • FIG. 8 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, a radio frequency (RF) circuit 205, an audio circuit 206, a speaker 211, a power management chip 208, and an input/output (I/O) subsystem 209.
  • Touch screen 212, other input/control devices 210, and external port 204 are communicated via one or more communication buses or signal lines 207.
  • the terminal device 200 illustrated in FIG. 8 is merely an example of a terminal device, and the terminal device 200 may have more or fewer components than those illustrated in FIG. 8, and two or more components may be combined, or Can have different component configurations.
  • the various components shown in Figure 8 can 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 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 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 or Rocker button, 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 and 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 and 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 dividing the amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients comprises:
  • the adjusting the audio amplitude according to the sub-amplitude adjustment coefficient comprises:
  • Adjusting the audio amplitude of the preset number of audio frames of the sound source step by step according to the sub-amplitude adjustment coefficient.
  • the determining an amplitude adjustment coefficient corresponding to the audio amplitude comprises:
  • An amplitude adjustment coefficient corresponding to the audio amplitude is determined according to the magnitude of the amplitude of the audio amplitude.
  • the determining an amplitude adjustment coefficient corresponding to the audio amplitude comprises:
  • volume information includes volume value information, volume increase information, or volume reduction information.
  • the method further includes:
  • the dividing the amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients comprises:
  • the adjusted amplitude adjustment coefficient is divided into a preset number of sub-amplitude adjustment coefficients.
  • Storage media any of a variety of types of memory devices or storage devices.
  • 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 Random Access Memory (DRAM), Double Data Rate Random Access Memory (DDR RAM), Static Random Access Memory (SRAM), Extended Data Output Random 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)
  • 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

A volume adjustment method and apparatus, a terminal device, and a storage medium. The method comprises: upon detecting that a terminal device is playing back a sound source, obtaining audio information of the sound source; according to the audio information, determining a plurality of audio amplitudes respectively corresponding to a plurality of preset time periods; when a first amplitude adjustment coefficient corresponding to a first audio amplitude and a second amplitude adjustment coefficient corresponding to an adjacent second audio amplitude are different, adding a preset number of sub-amplitude adjustment coefficients between the first amplitude adjustment coefficient and the second amplitude adjustment coefficient; according to the preset number of sub-amplitude adjustment coefficients, adjusting a preset number of audio frames starting from a start frame, the start frame being the first audio frame when the amplitude adjustment coefficient changes from the first amplitude adjustment coefficient to the second amplitude adjustment coefficient.

Description

音量调节方法、装置、终端设备及存储介质Volume adjustment method, device, terminal device and storage medium
本公开要求申请日为2017年08月18日、申请号为201710711586.6、名称为“音量调节方法、装置、终端设备及存储介质”的中国专利申请的优先权,该申请的全部内容通过引用结合在本公开中。The present application claims the priority of the Chinese patent application entitled "Volume Adjustment Method, Apparatus, Terminal Equipment, and Storage Medium" on August 18, 2017, the application number is 201710711586.6, the entire contents of which are incorporated by reference. In the present disclosure.
技术领域Technical field
本公开实施例涉及计算机技术领域,例如涉及一种音量调节方法、装置、终端设备及存储介质。Embodiments of the present disclosure relate to the field of computer technologies, for example, to a volume adjustment method, apparatus, terminal device, and storage medium.
背景技术Background technique
随着终端设备普及程度的提高,越来越多的用户使用终端设备执行各种各样的功能以满足自身需求,如使用终端设备阅读文字、观看视频、听音乐以及玩游戏等。然而,当终端设备在播放音视频时,音量大小的调节存在缺陷,需要改进。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. However, when the terminal device is playing audio and video, the adjustment of the volume level is flawed and needs to be improved.
发明内容Summary of the invention
本公开提供了一种音量调节方法、装置、终端设备及存储介质,提高了音量调节效率,降低了终端设备的功耗。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:
当检测到终端设备进行音源播放时,获取所述音源的音频信息;Obtaining audio information of the sound source when detecting that the terminal device performs sound source playing;
依据所述音频信息确定多个预设时间段分别对应的多个音频振幅;Determining, according to the audio information, a plurality of audio amplitudes respectively corresponding to the plurality of preset time segments;
当第一音频振幅对应的第一振幅调整系数和相邻的第二音频振幅对应的第二振幅调整系数不一样时,在所述第一振幅调整系数和所述第二振幅调整系数之间增加预设数目的子振幅调整系数,其中,所述预设数目的子振幅调整系数是在所述第一振幅调整系数和所述第二振幅调整系数之间依次递增或依次递减的。When the first amplitude adjustment coefficient corresponding to the first audio amplitude and the second amplitude adjustment coefficient corresponding to the adjacent second audio amplitude are different, increasing between the first amplitude adjustment coefficient and the second amplitude adjustment coefficient a preset number of sub-amplitude adjustment coefficients, wherein the preset number of sub-amplitude adjustment coefficients are sequentially incremented or sequentially decremented between the first amplitude adjustment coefficient and the second amplitude adjustment coefficient.
本公开实施例还提供了一种音量调节装置,包括:The embodiment of the present disclosure further provides a volume adjustment apparatus, including:
获取模块,设置为当检测到终端设备进行音源播放时,获取所述音源的音频信息;Obtaining a module, configured to acquire audio information of the sound source when detecting that the terminal device performs sound source playing;
振幅确定模块,设置为依据所述音频信息确定多个预设时间段分别对应的多个音频振幅;The amplitude determining module is configured to determine, according to the audio information, a plurality of audio amplitudes respectively corresponding to the plurality of preset time segments;
调整系数确定模块,设置为当第一音频振幅对应的第一振幅调整系数和相邻的第二音频振幅对应的第二振幅调整系数不一样时,在所述第一振幅调整系数和所述第二振幅调整系数之间增加预设数目的子振幅调整系数,其中,所述预设数目的子振幅调整系数是在所述第一振幅调整系数和所述第二振幅调整系 数之间依次递增或依次递减的;The adjustment coefficient determining module is configured to: when the first amplitude adjustment coefficient corresponding to the first audio amplitude and the second amplitude adjustment coefficient corresponding to the adjacent second audio amplitude are different, the first amplitude adjustment coefficient and the first Adding a preset number of sub-amplitude adjustment coefficients between the two amplitude adjustment coefficients, wherein the preset number of sub-amplitude adjustment coefficients are sequentially increased between the first amplitude adjustment coefficient and the second amplitude adjustment coefficient or Decrement in turn;
调节模块,设置为依据所述预设数目的子振幅调整系数对从起始帧开始的预设数量的音频帧进行调整,其中,所述起始帧为振幅调整系数由所述第一振幅调整系数变化为所述第二振幅调整系数时的首个音频帧。The adjustment module is configured to adjust, according to the preset number of sub-amplitude adjustment coefficients, a preset number of audio frames from a start frame, wherein the start frame is an amplitude adjustment coefficient adjusted by the first amplitude The first audio frame when the coefficient changes to the second 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.
附图说明DRAWINGS
图1是本公开一实施例提供的一种音量调节方法的流程图;FIG. 1 is a flowchart of a volume adjustment method according to an embodiment of the present disclosure;
图2是本公开另一实施例提供的一种音量调节方法的流程图;2 is a flowchart of a volume adjustment method according to another embodiment of the present disclosure;
图3是本公开另一实施例提供的一种音量调节方法的流程图;3 is a flowchart of a volume adjustment method according to another embodiment of the present disclosure;
图4是本公开另一实施例提供的一种音量调节方法的流程图;4 is a flowchart of a volume adjustment method according to another embodiment of the present disclosure;
图5是本公开另一实施例提供的一种音量调节方法的流程图;FIG. 5 is a flowchart of a volume adjustment method according to another embodiment of the present disclosure;
图6是本公开另一实施例提供的一种音量调节方法的流程图FIG. 6 is a flowchart of a volume adjustment method according to another embodiment of the present disclosure.
图7是本公开另一实施例提供的一种音量调节装置的结构框图;FIG. 7 is a structural block diagram of a volume adjustment apparatus according to another embodiment of the present disclosure;
图8是本公开另一实施例提供的一种终端设备的结构示意图。FIG. 8 is a schematic structural diagram of a terminal device according to another embodiment of the present disclosure.
具体实施方式Detailed ways
下面结合附图和实施例对本公开作说明。此处所描述的具体实施例用于解释本公开,而非对本公开的限定。另外,为了便于描述,附图中仅示出了与本公开相关的部分而非全部结构。The present disclosure will be described below in conjunction with the accompanying drawings and embodiments. The specific embodiments described herein are intended to be illustrative of the present disclosure and are not intended to be limiting. In addition, for the convenience of description, only some but not all of the structures related to the present disclosure are shown in the drawings.
图1是本公开一实施例提供的一种音量调节方法的流程图。本实施例可适用于在终端设备播放音源时,对音量进行调节的情况。该音量调节方法可以由本实施例提供的终端设备来执行,该终端设备的音量调节装置可采用软件和/或硬件的方式实现。如图1所示,本实施例提供的音量调节方法包括如下步骤。FIG. 1 is a flowchart of a volume adjustment method according to an embodiment of the present disclosure. This embodiment can be applied to the case where the volume is adjusted when the terminal device plays the sound source. The volume adjustment method can be performed by the terminal device provided by this embodiment, and 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.
步骤101、当检测到终端设备进行音源播放时,获取所述音源的音频信息。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. In an embodiment, the playing of the sound source mainly includes the steps of acquiring, decoding, and outputting the sound source file. In an embodiment, 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. After the sound source file is obtained, 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 audio file contains video data at the same time, separation of audio data and video data is required, and the separated audio data is input to the audio decoder. In an embodiment, 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. In one embodiment, when it is detected that the sound source play event is triggered, it is determined that the terminal device starts playing the sound source. In an embodiment, 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.
当检测到终端设备进行音源播放时,获取所述音源的音频信息。在一个实施例中,可对音频解码器解码得到的数字音频信号进行取样,确定该音源对应的音频信息。在另一实施例中,还可以获取当前播放的音源的原始文件,通过对该原始文件的解析确定音源对应的音频信息。在另一实施例中,以安卓(Android)***为例,可通过android.media.MediaRecorder类或android.media.AudioRecord类获取音源的音频信息。When the terminal device detects the sound source playing, the audio information of the sound source is acquired. In one embodiment, the digital audio signal decoded by the audio decoder may be sampled to determine audio information corresponding to the audio source. In another embodiment, 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. In another embodiment, taking the Android system as an example, the audio information of the sound source can be obtained through the android.media.MediaRecorder class or the android.media.AudioRecord class.
步骤102、依据所述音频信息确定所述音频信息对应的音频振幅。Step 102: Determine an audio amplitude corresponding to the audio information according to the audio information.
振幅指物体震动过程中偏离原来位置的最大距离,人耳听到的声音的响度与音源的振幅相关,振幅越大响度越强。在一个实施例中,可对音频解码器解码得到的数字音频信号进行取样,获取预设时间段T内的振幅信息。在一实施例中,该振幅信息可由多个振幅值组成,依据得到的多个振幅值可相应的确定在该预设时间段T内播放的音源的振幅曲线。在另一实施例中,以Android***为例,可通过android.media.MediaRecorder类或android.media.AudioRecord类获取音源的音频信息后得到音频信息对应的音频振幅的振幅大小。在另一实施例中,当步骤101获取到的音频信息为音源对应的原始文件时,可通过对原始文件进行解析以得到音频信息对应的音频振幅的振幅大小。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. In one embodiment, the digital audio signal decoded by the audio decoder may be sampled to obtain amplitude information within a preset time period T. In an embodiment, 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. In another embodiment, taking the Android system as an example, the audio information of the audio source can be obtained by the android.media.MediaRecorder class or the android.media.AudioRecord class to obtain the amplitude of the audio amplitude corresponding to the audio information. In another embodiment, when the audio information acquired in step 101 is the original file corresponding to the sound source, the amplitude of the audio amplitude corresponding to the audio information may be obtained by parsing the original file.
在一个实施例中,当检测音源播放时,每隔预设时间(如1s、3s或10s)确定一次振幅,或者实时地对音频信息的每一帧音频帧的振幅进行确定。在一实施例中,所述获取所述音源的音频信息包括:获取所述音源的音频帧信息;依据所述音频信息确定所述音频信息对应的音频振幅包括:依据所述音频帧信息确定所述音频帧信息中每一帧音频帧的音频振幅。在一实施例中,当检测到音源播放时,对音源文件进行解析得到音频帧序列,根据音频帧序列的每一帧确定每一帧对应的振幅。In one embodiment, 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. In an embodiment, the acquiring the audio information of the sound source includes: acquiring audio frame information of the sound source; determining the audio amplitude corresponding to the audio information according to the audio information, comprising: determining, according to the audio frame information, The audio amplitude of each frame of the audio frame information. In an embodiment, when the sound source is detected, the sound source file is parsed to obtain an audio frame sequence, and the amplitude corresponding to each frame is determined according to each frame of the audio frame sequence.
步骤103、确定和所述音频振幅对应的振幅调整系数,将所述振幅调整系数划分为预设数目的子振幅调整系数,依据所述子振幅调整系数对所述音频振幅进行调整。Step 103: Determine an amplitude adjustment coefficient corresponding to the audio amplitude, divide the amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients, and adjust the audio amplitude according to the sub-amplitude adjustment coefficient.
在一个实施例中,为提高音源中低振幅区域的音量,对低振幅的音频振幅分配较大的振幅调整系数,高振幅的音频振幅相应的分配一较小的振幅调整系数。例如,对振幅大小小于-3分贝(db)且大于-10db音频振幅分配振幅调整系数为1.2,对振幅大小小于-10db且大于-50db的音频振幅分配振幅调整系数为2。 此时,在音源播放过程中,如果前一段音频振幅的振幅调整系数为1.2,而过渡到相邻的下一段音频振幅需要振幅调整系数为2的话,进行调整后的音频振幅会存在明显的听感突兀的问题,这是由振幅调整系数的跳跃带来的。In one embodiment, to increase the volume of the low amplitude region of the sound source, a large amplitude adjustment factor is assigned to the low amplitude audio amplitude, and a high amplitude audio amplitude is correspondingly assigned a smaller amplitude adjustment factor. For example, the amplitude adjustment coefficient is 1.2 for an amplitude amplitude of less than -3 decibels (db) and greater than -10 db, and the amplitude adjustment coefficient is 2 for an audio amplitude having an amplitude of less than -10 db and greater than -50 db. At this time, during the sound source playing, if the amplitude adjustment coefficient of the previous audio amplitude is 1.2, and the amplitude of the adjustment to the adjacent next audio amplitude requires an amplitude adjustment coefficient of 2, the adjusted audio amplitude will be clearly heard. A sudden problem, which is caused by the jump of the amplitude adjustment factor.
在一实施例中,所述将所述振幅调整系数划分为预设数目的子振幅调整系数包括:检测到不同音频振幅对应的振幅调整系数满足预设条件时,将所述振幅调整系数划分为预设数目的子振幅调整系数。在一实施例中,所述子振幅调整系数为依据所述振幅调整系数线性或非线性划分得到。In an embodiment, the dividing the amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients comprises: when detecting that an amplitude adjustment coefficient corresponding to different audio amplitudes satisfies a preset condition, dividing the amplitude adjustment coefficient into A preset number of sub-amplitude adjustment factors. In an embodiment, the sub-amplitude adjustment coefficients are obtained by linear or non-linear division of the amplitude adjustment coefficients.
在一实施例中,该预设条件可以是相邻的音频振幅的振幅调整系数不一样,例如振幅调整系数由前一音频振幅的振幅调整系数1变成(跳跃为)后一音频振幅的振幅调整系数2,或振幅调整系数由2变成1.2等此时,可以在相邻的两个音频振幅对应的两个振幅调整系数之间增加预设数目的子振幅调整系数。例如,当确定出的相邻音频振幅的振幅调整系数为1.2和2时,可在1.2到2之间再增加9个子振幅调整系数,即从1.2开始依次递增相同或不同的数值得到:1.28、1.36、1.42、...、1.92。在调节过程中,在振幅调整系数从1.2到2的过渡阶段,可将每n(例如,n大于1小于等于20)帧音频帧对应一个子振幅调整系数,依次对每一音频帧的振幅进行调整。例如,振幅调整系数由1.2改变为2时,改变开始时的第1-20帧音频帧对应的子振幅调整系数为1.28,第21-40帧音频帧对应的子振幅调整系数为1.36,依次类推。在该实施例中,假设振幅调整系数为1.2的前100帧音频帧已调整完成,从第101帧开始需要使用振幅调整系数2来调整,那么每20帧对应一级子振幅调整系数的话,从101帧开始的180帧,即到第280帧音频帧完成用子振幅调整系数调整音频帧的过渡阶段,从第281帧音频帧开始可以使用振幅调整系数2来调整,从而避免明显的听感突兀问题。In an embodiment, the preset condition may be that the amplitude adjustment coefficients of the adjacent audio amplitudes are different. For example, the amplitude adjustment coefficient is changed from the amplitude adjustment coefficient 1 of the previous audio amplitude to (the amplitude of the latter audio amplitude). When the adjustment coefficient is 2, or the amplitude adjustment coefficient is changed from 2 to 1.2, etc., a preset number of sub-amplitude adjustment coefficients can be added between the two amplitude adjustment coefficients corresponding to the adjacent two audio amplitudes. For example, when the amplitude adjustment coefficients of the determined adjacent audio amplitudes are 1.2 and 2, an additional 9 sub-amplitude adjustment coefficients may be added between 1.2 and 2, that is, the same or different values are sequentially incremented from 1.2 to obtain: 1.28, 1.36, 1.42, ..., 1.92. During the adjustment process, in the transition phase of the amplitude adjustment coefficient from 1.2 to 2, each n (for example, n is greater than 1 and less than or equal to 20) frame audio frames may be corresponding to one sub-amplitude adjustment coefficient, and the amplitude of each audio frame is sequentially performed. Adjustment. For example, when the amplitude adjustment coefficient is changed from 1.2 to 2, the sub-amplitude adjustment coefficient corresponding to the 1-20th audio frame at the start of the change is 1.28, and the sub-amplitude adjustment coefficient corresponding to the 21-40th audio frame is 1.36, and so on. . In this embodiment, it is assumed that the first 100 frames of audio frames whose amplitude adjustment coefficient is 1.2 have been adjusted, and the amplitude adjustment coefficient 2 needs to be adjusted from the 101st frame. Then, if every 20 frames corresponds to the first-level sub-amplitude adjustment coefficient, 180 frames from the beginning of 101 frames, that is, to the 280th frame, the audio frame is completed with the sub-amplitude adjustment coefficient to adjust the transition period of the audio frame, and the amplitude adjustment coefficient 2 can be adjusted from the 281-frame audio frame to avoid obvious hearing acuity. problem.
在一实施例中,对音频振幅进行调整的过程可以是:对音源文件进行解析,对得到的音频数据中的表征振幅信息的数据进行修改,修改完毕后再进行封装,当缓冲到对应的音源文件并被播放时音频振幅相应的已被增大;还可以是,在音源播放的解码过程中,通过对得到的数字音频信号进行分析得到音频振幅,将该振幅数据乘以对应的振幅调整系数以改变振幅大小,进而对音源的音量进行调节。In an embodiment, the process of adjusting the audio amplitude may be: parsing the audio file, modifying the data representing the amplitude information in the obtained audio data, and then performing the encapsulation after the modification, when buffering to the corresponding audio source. When the file is played, the audio amplitude is correspondingly increased; or, in the decoding process of the sound source playing, the audio amplitude is obtained by analyzing the obtained digital audio signal, and the amplitude data is multiplied by the corresponding amplitude adjustment coefficient. To change the amplitude, adjust the volume of the source.
由此,本实施例提供的方案实现了在不改变终端设备***原有音量的前提下对音源音量的大小进行了调节,调节过程可以在音源文件未进入缓冲区前,以减少播放负载,也可以是针对缓冲区中的音源内容进行调节以提高调节效率,从而提高了音量调节效率,降低了终端设备的功耗,且通过使用子振幅调整系数对预设数量的音频帧的音频振幅进行调整,避免了由振幅调整系数的跳跃带来的听感突兀的问题,提高了用户体验。Therefore, the solution provided in this embodiment realizes that the volume of the sound source is adjusted without changing the original volume of the terminal device system, and the adjustment process can reduce the playback load before the sound source file does not enter the buffer. It can adjust the sound source content in the buffer to improve the adjustment efficiency, thereby improving the volume adjustment efficiency, reducing the power consumption of the terminal device, and adjusting the audio amplitude of the preset number of audio frames by using the sub-amplitude adjustment coefficient. The problem of sudden hearing caused by the jump of the amplitude adjustment coefficient is avoided, and the user experience is improved.
图2是本公开另一实施例提供的一种音量调节方法的流程图。如图2所示,本实施例提供的音量调节方法包括如下步骤。FIG. 2 is a flowchart of a volume adjustment method according to another embodiment of the present disclosure. As shown in FIG. 2, the volume adjustment method provided in this embodiment includes the following steps.
步骤110、当检测到终端设备进行音源播放时,获取所述音源的音频信息。Step 110: Acquire audio information of the sound source when detecting that the terminal device performs sound source playback.
步骤120、依据所述音频信息确定多个预设时间段分别对应的多个音频振 幅。Step 120: Determine, according to the audio information, a plurality of audio amplitudes respectively corresponding to the plurality of preset time segments.
在一实施例中,依据所述音频信息确定多个预设时间段分别对应的多个音频振幅,包括:In an embodiment, determining, according to the audio information, a plurality of audio amplitudes corresponding to the plurality of preset time segments respectively, including:
在每个所述预设时间段内对所述音频信息进行至少两次取样获取每个所述预设时间段对应的至少两个音频振幅;将每个所述预设时间段各自对应的所述至少两个音频振幅之间的平均振幅确定为每个所述预设时间段对应的音频振幅。Performing at least two samplings on the audio information for each of the preset time periods to obtain at least two audio amplitudes corresponding to each of the preset time periods; The average amplitude between the at least two audio amplitudes is determined as the audio amplitude corresponding to each of the predetermined time periods.
例如,每10s为一个预设时间段,则可在第一个10s内对音频解码器解码得到的数字音频信号进行5次取样,得到5个音频振幅,并计算5个音频振幅之间的平均振幅,将该平均振幅作为第一个10s对应的音频振幅,在第二个10s内对音频解码器解码得到的数字音频信号进行5次取样,得到5个音频振幅,并计算5个音频振幅之间的平均振幅,将该平均振幅作为第二个10s对应的音频振幅,由此,可得到多个预设时间段分别对应的多个音频振幅。For example, every 10s is a preset time period, and the digital audio signal decoded by the audio decoder can be sampled 5 times in the first 10s to obtain 5 audio amplitudes, and the average between 5 audio amplitudes is calculated. The amplitude, the average amplitude is taken as the first 10s corresponding audio amplitude, and the digital audio signal decoded by the audio decoder is sampled 5 times in the second 10s to obtain 5 audio amplitudes, and 5 audio amplitudes are calculated. The average amplitude between the two is used as the audio amplitude corresponding to the second 10s, thereby obtaining a plurality of audio amplitudes corresponding to the plurality of preset time periods.
在一实施例中,依据所述音频信息确定多个预设时间段分别对应的多个音频振幅,包括:In an embodiment, determining, according to the audio information, a plurality of audio amplitudes corresponding to the plurality of preset time segments respectively, including:
每隔所述预设时间段依据所述音频信息确定一次音频振幅。The audio amplitude is determined once according to the audio information every predetermined period of time.
例如,每10s为一个预设时间段,可每隔10s对音频解码器解码得到的数字音频信号进行一次取样得到一个音频振幅,并将取样得到的音频振幅作为前一个10s对应的音频振幅。For example, every 10 s is a preset time period, and the digital audio signal decoded by the audio decoder can be sampled once every 10 s to obtain an audio amplitude, and the sampled audio amplitude is taken as the audio amplitude corresponding to the previous 10 s.
在一实施例中,依据所述音频信息确定多个预设时间段分别对应的多个音频振幅,包括:In an embodiment, determining, according to the audio information, a plurality of audio amplitudes corresponding to the plurality of preset time segments respectively, including:
依据所述音频信息确定所述音频信息的每一帧音频帧对应的音频振幅,其中,所述每一帧音频帧对应一个所述预设时间段。Determining, according to the audio information, an audio amplitude corresponding to each frame of the audio information, wherein each frame of the audio frame corresponds to one of the preset time periods.
在一实施例中,音频信息的每一帧音频帧对应一个预设时间段,例如每26s为一个预设时间段,则可依据音频信息确定音频信息的每一帧音频帧对应的音频振幅,由此得到多个预设时间段分别对应的多个音频振幅。In an embodiment, each frame of the audio information corresponds to a preset time period, for example, each 26s is a preset time period, and the audio amplitude corresponding to each frame of the audio information may be determined according to the audio information. Thereby, a plurality of audio amplitudes corresponding to the plurality of preset time periods are respectively obtained.
步骤130、当第一音频振幅对应的第一振幅调整系数和相邻的第二音频振幅对应的第二振幅调整系数不一样时,在所述第一振幅调整系数和所述第二振幅调整系数之间增加预设数目的子振幅调整系数,其中,所述预设数目的子振幅调整系数是在所述第一振幅调整系数和所述第二振幅调整系数之间依次递增或依次递减的。Step 130: When the first amplitude adjustment coefficient corresponding to the first audio amplitude and the second amplitude adjustment coefficient corresponding to the adjacent second audio amplitude are different, the first amplitude adjustment coefficient and the second amplitude adjustment coefficient A preset number of sub-amplitude adjustment coefficients are added therebetween, wherein the preset number of sub-amplitude adjustment coefficients are sequentially incremented or sequentially decremented between the first amplitude adjustment coefficient and the second amplitude adjustment coefficient.
在一实施例中,预设数目的子振幅调整系数为在所述第一振幅调整系数和所述第二振幅调整系数之间进行等间距划分得到。In an embodiment, the preset number of sub-amplitude adjustment coefficients are obtained by equally spaced between the first amplitude adjustment coefficient and the second amplitude adjustment coefficient.
在一实施例中,预设数目的子振幅调整系数可通过在第一振幅调整系数和第二振幅调整系数之间进行非等间距划分得到。In an embodiment, the preset number of sub-amplitude adjustment coefficients may be obtained by non-equal spacing between the first amplitude adjustment coefficient and the second amplitude adjustment coefficient.
在一实施例中,所述多个音频振幅中的每一个音频振幅对应一个振幅调整系数,每个所述振幅调整系数为依据对应的所述音频振幅的振幅大小确定的。例如,多个音频振幅包括音频振幅A、音频振幅B和音频振幅C,并为振幅大 小大于-3db或小于-50db的音频振幅分配振幅调整系数1,为振幅大小小于-10db且大于-50db的音频振幅分配振幅调整系数2,为振幅大小小于-3db且大于-10db的音频振幅分配振幅调整系数1.5,则如果音频振幅A大于-3db,则音频振幅A对应的振幅调整系数为1,如果音频振幅B小于-10db且大于-50db,则音频振幅B对应的振幅调整系数为2。In an embodiment, each of the plurality of audio amplitudes corresponds to an amplitude adjustment coefficient, and each of the amplitude adjustment coefficients is determined according to a magnitude of an amplitude of the corresponding audio amplitude. For example, the plurality of audio amplitudes include an audio amplitude A, an audio amplitude B, and an audio amplitude C, and an amplitude adjustment coefficient 1 is allocated for an audio amplitude having an amplitude greater than -3 db or less than -50 db, which is an amplitude smaller than -10 db and greater than -50 db. The audio amplitude distribution amplitude adjustment coefficient 2 is an amplitude adjustment coefficient of 1.5 for an amplitude of an amplitude smaller than -3 db and greater than -10 db. If the audio amplitude A is greater than -3 db, the amplitude adjustment coefficient corresponding to the audio amplitude A is 1, if the audio When the amplitude B is smaller than -10 db and larger than -50 db, the amplitude adjustment coefficient corresponding to the audio amplitude B is 2.
在一实施例中,所述多个音频振幅中的每一个音频振幅对应一个振幅调整系数,每个所述振幅调整系数为依据对应的所述音频振幅的振幅大小以及以下信息至少之一确定的:所述终端设备的播放器件的阻抗值以及所述终端所处环境的噪声值。例如,在根据每个音频振幅的振幅大小确定每个音频振幅对应的振幅调整系数之后,可根据终端设备的播放器件的阻抗值和\或终端所处环境的噪声值对每个音频振幅对应的振幅调整系数进行调整,并将调整后的振幅调整系数确定为该音频振幅对应的振幅调整系数。In an embodiment, each of the plurality of audio amplitudes corresponds to an amplitude adjustment coefficient, and each of the amplitude adjustment coefficients is determined according to at least one of an amplitude of the corresponding audio amplitude and at least one of the following information. : an impedance value of the playback device of the terminal device and a noise value of an environment in which the terminal is located. For example, after determining the amplitude adjustment coefficient corresponding to each audio amplitude according to the amplitude magnitude of each audio amplitude, it may correspond to each audio amplitude according to the impedance value of the playback device of the terminal device and/or the noise value of the environment in which the terminal is located. The amplitude adjustment coefficient is adjusted, and the adjusted amplitude adjustment coefficient is determined as an amplitude adjustment coefficient corresponding to the audio amplitude.
在一实施例中,所述多个音频振幅中的每一个音频振幅对应一个振幅调整系数,每个所述振幅调整系数为依据所述终端设备的音量信息和对应的所述音频振幅的振幅大小,其中,所述音量信息包括音量值信息、音量增加信息或音量减小信息。例如,可根据音量信息确定多个振幅调整系数,例如3个,并依据每个音频振幅的振幅大小确定每个音频振幅对应3个振幅调整系数中的哪个振幅调整系数,进而可依据每个音频振幅的振幅大小和终端设备的音量信息确定每个音频振幅对应的振幅调整系数。In an embodiment, each of the plurality of audio amplitudes corresponds to an amplitude adjustment coefficient, and each of the amplitude adjustment coefficients is based on volume information of the terminal device and a corresponding amplitude of the audio amplitude. The volume information includes volume value information, volume increase information, or volume decrease information. For example, a plurality of amplitude adjustment coefficients, for example, three, may be determined according to the volume information, and which amplitude adjustment coefficient corresponding to each of the three amplitude adjustment coefficients is determined according to the amplitude magnitude of each audio amplitude, and thus may be determined according to each audio. The amplitude magnitude of the amplitude and the volume information of the terminal device determine an amplitude adjustment factor corresponding to each audio amplitude.
在一实施例中,在依据每个音频振幅的振幅大小和终端设备的音量信息确定每个音频振幅对应的振幅调整系数之后,还可根据终端设备的播放器件的阻抗值和\或终端所处环境的噪声值对每个音频振幅对应的振幅调整系数,并将调整后的振幅调整系数作为该音频振幅对应的振幅调整系数,进而依据每个音频振幅的振幅大小、终端设备的音量信息以及以下信息至少之一确定每个音频振幅对应的振幅调整系数:终端设备的播放器件的阻抗值以及终端所处环境的噪声值。In an embodiment, after determining the amplitude adjustment coefficient corresponding to each audio amplitude according to the amplitude magnitude of each audio amplitude and the volume information of the terminal device, the impedance value of the playback device of the terminal device and/or the location of the terminal may also be The noise value of the environment corresponds to the amplitude adjustment coefficient of each audio amplitude, and the adjusted amplitude adjustment coefficient is used as the amplitude adjustment coefficient corresponding to the audio amplitude, and further, according to the amplitude of each audio amplitude, the volume information of the terminal device, and the following At least one of the information determines an amplitude adjustment coefficient corresponding to each audio amplitude: an impedance value of the playback device of the terminal device and a noise value of the environment in which the terminal is located.
步骤140、依据所述预设数目的子振幅调整系数对从起始帧开始的预设数量的音频帧进行调整。Step 140: Adjust a preset number of audio frames starting from a start frame according to the preset number of sub-amplitude adjustment coefficients.
在一实施例中,所述起始帧为振幅调整系数由所述第一振幅调整系数变化为所述第二振幅调整系数时的首个音频帧。In an embodiment, the start frame is a first audio frame when the amplitude adjustment coefficient is changed from the first amplitude adjustment coefficient to the second amplitude adjustment coefficient.
在一实施例中,所述预设数量的音频帧,包括:第一组音频帧至第M组音频帧;所述预设数目的子振幅调整系数,包括:依次递增或递减的第一子振幅调整系数至第N子振幅调整系数,其中,M和N均为大于或等于1的正整数,且M大于或等于N。In an embodiment, the preset number of audio frames includes: a first group of audio frames to an Mth group of audio frames; and the preset number of sub-amplitude adjustment coefficients includes: a first sub-increment or decrement The amplitude adjustment coefficient to the Nth sub-amplitude adjustment coefficient, wherein M and N are both positive integers greater than or equal to 1, and M is greater than or equal to N.
依据所述预设数目的子振幅调整系数对从起始帧开始的预设数量的音频帧进行调整,包括:依次使用所述第一子振幅调整系数至所述第N子振幅调整系数对所述第一组音频帧至所述第N组音频帧进行调整。Adjusting, according to the preset number of sub-amplitude adjustment coefficients, a preset number of audio frames from a start frame, comprising: sequentially using the first sub-amplitude adjustment coefficient to the N-th sub-amplitude adjustment coefficient pair The first set of audio frames is adjusted to the Nth group of audio frames.
例如,在步骤120中获取了预设时间段a对应的音频振幅A、预设时间段b 对应的音频振幅B以及预设时间段c对应的音频振幅C,并在步骤130中确定了音频振幅A对应的振幅调整系数为i,音频振幅B对应的振幅调整系数为j,音频振幅B对应的振幅调整系数为k,则首先使用振幅调整系数i对从音频信息中的第一帧音频帧开始的音频帧的音频振幅进行调整,直至到达预设时间段b的起始时间,例如此时已使用振幅调整系数i对第1-100帧音频帧进行调整,如果音频振幅B对应的振幅调整系数j和音频振幅A对应的振幅调整系数i相同,则继续使用振幅调整系数i(即振幅调整系数j)对从第101帧音频帧开始的音频帧的音频振幅进行调整,直至到达预设时间段c的起始时间,例如此时已使用振幅调整系数i对第101-300帧音频帧进行调整,如果音频振幅C对应的振幅调整系数k和音频振幅B对应的振幅调整系数j不相同,例如k小于j,则在振幅调整系数j和振幅调整系数k之间增加10个子振幅调整系数,10个子振幅调整系数分别为依次递减的k1,k2,...,k10,则从第301帧音频帧开始,每10帧音频帧对应一个子振幅调整系数,并使用子振幅调整系数k1对第301-310帧音频帧进行调整,使用振幅调整系数k2对第311-320帧音频帧进行调整,直至使用振幅调整系数k10对第391-400帧音频帧进行调整,然后从401帧音频帧开始使用振幅调整系数k进行调整。For example, in step 120, the audio amplitude A corresponding to the preset time period a, the audio amplitude B corresponding to the preset time period b, and the audio amplitude C corresponding to the preset time period c are acquired, and the audio amplitude is determined in step 130. The amplitude adjustment coefficient corresponding to A is i, the amplitude adjustment coefficient corresponding to the audio amplitude B is j, and the amplitude adjustment coefficient corresponding to the audio amplitude B is k. First, the amplitude adjustment coefficient i is used to start from the first frame audio frame in the audio information. The audio amplitude of the audio frame is adjusted until the start time of the preset time period b is reached, for example, the amplitude adjustment coefficient i has been used to adjust the 1-100th frame audio frame, if the amplitude adjustment coefficient corresponding to the audio amplitude B j is the same as the amplitude adjustment coefficient i corresponding to the audio amplitude A, and then continues to use the amplitude adjustment coefficient i (ie, the amplitude adjustment coefficient j) to adjust the audio amplitude of the audio frame from the 101st frame audio frame until the preset time period is reached. The start time of c, for example, the amplitude adjustment coefficient i has been used to adjust the 101-300 frame audio frame, if the audio amplitude C corresponds to the amplitude adjustment coefficient k and the audio amplitude B pair The amplitude adjustment coefficient j is different. For example, if k is smaller than j, 10 sub-amplitude adjustment coefficients are added between the amplitude adjustment coefficient j and the amplitude adjustment coefficient k, and the 10 sub-amplitude adjustment coefficients are respectively successively decreasing k1, k2, ... , k10, starting from the 301st frame audio frame, each 10 frames of audio frames corresponding to a sub-amplitude adjustment coefficient, and using the sub-amplitude adjustment coefficient k1 to adjust the 301-310 frame audio frame, using the amplitude adjustment coefficient k2 for the 311th - 320 frames of audio frames are adjusted until the 391-400-frame audio frame is adjusted using the amplitude adjustment factor k10, and then adjusted from the 401-frame audio frame using the amplitude adjustment coefficient k.
由此,在不改变终端设备***原有音量的前提下对音源音量的大小进行了调节,提高了音量调节的效率,降低了终端设备的功耗,且通过使用子振幅调整系数对预设数量的音频帧进行调整,可避免由振幅调整系数的跳跃带来的听感突兀的问题,提高用户体验。Thereby, the volume of the sound source is adjusted without changing the original volume of the terminal device system, thereby improving the efficiency of the volume adjustment, reducing the power consumption of the terminal device, and using the sub-amplitude adjustment coefficient to the preset number. The audio frame is adjusted to avoid the sudden hearing problem caused by the jump of the amplitude adjustment coefficient and improve the user experience.
图3是本公开另一实施例提供的一种音量调节方法的流程图。在一实施例中,所述确定和所述音频振幅对应的振幅调整系数包括:依据所述音频振幅的大小确定和所述音频振幅对应的振幅调整系数。如图3所示,本实施例提供的技术方案如下:FIG. 3 is a flowchart of a volume adjustment method according to another embodiment of the present disclosure. In an embodiment, the determining an amplitude adjustment coefficient corresponding to the audio amplitude comprises: determining an amplitude adjustment coefficient corresponding to the audio amplitude according to a magnitude of the audio amplitude. As shown in FIG. 3, the technical solution provided by this embodiment is as follows:
步骤310、当检测到终端设备进行音源播放时,获取所述音源的音频信息。Step 310: Acquire audio information of the sound source when detecting that the terminal device performs sound source playing.
步骤320、依据所述音频信息确定所述音频信息对应的音频振幅。Step 320: Determine an audio amplitude corresponding to the audio information according to the audio information.
步骤330、依据所述音频振幅的振幅大小确定和所述音频振幅对应的振幅调整系数。Step 330: Determine an amplitude adjustment coefficient corresponding to the audio amplitude according to the amplitude of the audio amplitude.
在一个实施例中,可通过获取预设长度的音频振幅确定该预设长度的音频振幅的平均振幅大小,进而依据该平均振幅大小确定该预设长度的音频振幅对应的振幅调整系数。在一实施例中,可通过预存的映射关系表确定平均振幅对应的振幅调整系数,如下表1所示:In an embodiment, the average amplitude of the audio amplitude of the preset length may be determined by acquiring an audio amplitude of a preset length, and then determining an amplitude adjustment coefficient corresponding to the audio amplitude of the preset length according to the average amplitude. In an embodiment, the amplitude adjustment coefficient corresponding to the average amplitude can be determined by a pre-stored mapping relationship table, as shown in Table 1 below:
表1Table 1
平均振幅Average amplitude 振幅调整系数Amplitude adjustment factor
大于-3db或小于-50dbGreater than -3db or less than -50db 11
小于-10db且大于-50dbLess than -10db and greater than -50db 22
小于-3db且大于-10dbLess than -3db and greater than -10db 1.51.5
如表1所示,当平均振幅大于-3db或小于-50db时,不对音频振幅进行调节;当振幅小于-3db且大于-10db时,振幅属于高振幅区,为该振幅分配振幅调整系数为1.5,当振幅小于-10db且大于-50db时,属于中振幅区,为该振幅分配振幅调整系数为2,以显著提高中振幅区的振幅大小。As shown in Table 1, when the average amplitude is greater than -3 db or less than -50 db, the audio amplitude is not adjusted; when the amplitude is less than -3 db and greater than -10 db, the amplitude belongs to the high amplitude region, and the amplitude distribution coefficient is 1.5 for the amplitude. When the amplitude is less than -10 db and greater than -50 db, it belongs to the middle amplitude region, and the amplitude adjustment coefficient is 2 for the amplitude to significantly increase the amplitude of the medium amplitude region.
步骤340、将所述振幅调整系数划分为预设数目的子振幅调整系数,依据所述子振幅调整系数对所述音频振幅进行调整。即,通过上述举例可知,将产生跳跃的两个相邻振幅调整系数之间增加多个子振幅调整系数,并在对音频帧的振幅进行调整所需使用的振幅调整系数发生改变时,逐级使用子振幅调整系数对预设数量的音频帧进行逐级调整。Step 340: The amplitude adjustment coefficient is divided into a preset number of sub-amplitude adjustment coefficients, and the audio amplitude is adjusted according to the sub-amplitude adjustment coefficient. That is, as can be seen from the above example, a plurality of sub-amplitude adjustment coefficients are added between two adjacent amplitude adjustment coefficients that generate a jump, and the amplitude adjustment coefficient used to adjust the amplitude of the audio frame is changed stepwise. The sub-amplitude adjustment factor adjusts the preset number of audio frames step by step.
由上述可知,通过对不同振幅大小的音频振幅分配不同的振幅调整系数,避免了破音的同时,降低了对噪音的振幅提升;而且在此基础上,进一步对相邻的音频振幅对应的不同的振幅调整系数进行细分后,对音频振幅中预设数量音频帧进行逐级调整,可以使得音源播放过程中的声音大小合理,听感平滑。It can be seen from the above that by assigning different amplitude adjustment coefficients to the amplitudes of the audio of different amplitudes, the amplitude of the noise is reduced while the sound is broken, and on the basis of this, the difference of the adjacent audio amplitudes is further After the amplitude adjustment coefficient is subdivided, the preset number of audio frames in the audio amplitude is adjusted step by step, which can make the sound in the sound source playing sound reasonable and the sense of hearing smooth.
图4是本公开另一实施例提供的一种音量调节方法的流程图。在一实施例中,所述确定和所述音频振幅对应的振幅调整系数包括:依据所述音频振幅的振幅大小和终端设备的音量信息确定和所述音频振幅对应的振幅调整系数。在一实施例中,所述音量信息包括音量值信息、音量增加信息或音量减小信息。如图4所示,本实施例提供的技术方案包括如下步骤。FIG. 4 is a flowchart of a volume adjustment method according to another embodiment of the present disclosure. In an embodiment, the determining an amplitude adjustment coefficient corresponding to the audio amplitude comprises: determining an amplitude adjustment coefficient corresponding to the audio amplitude according to an amplitude magnitude of the audio amplitude and volume information of the terminal device. In an embodiment, the volume information includes volume value information, volume increase information, or volume reduction information. As shown in FIG. 4, the technical solution provided in this embodiment includes the following steps.
步骤301、当检测到终端设备进行音源播放时,获取所述音源的音频信息。Step 301: Acquire audio information of the sound source when detecting that the terminal device performs sound source playing.
步骤302、依据所述音频信息确定所述音频信息对应的音频振幅。Step 302: Determine an audio amplitude corresponding to the audio information according to the audio information.
步骤303、依据所述音频振幅的振幅大小和终端设备的音量信息确定和所述音频振幅对应的振幅调整系数。Step 303: Determine an amplitude adjustment coefficient corresponding to the audio amplitude according to the amplitude magnitude of the audio amplitude and the volume information of the terminal device.
在一个实施例中,该获取的音量信息可以是终端设备当前的音量值信息、音量增加信息和音量减小信息中的一种或多种。依据所述音量信息确定和所述音频振幅对应的振幅调整系数可以是依据音量信息中的当前的音量值信息、音量增加信息和音量减小信息中的一种或多种进行确定。In an embodiment, 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, an amplitude adjustment coefficient corresponding to the audio amplitude may be determined according to one or more of current volume value information, volume increase information, and volume decrease information in the volume information.
在一实施例中,终端设备由静音到最大音量总共分为18个可调等级,每个等级对应一个音量值,当终端设备播放音源时,可通过***的音量管理组件的获取音量(get volume)方法得到终端设备的当前音量值;当用户通过终端设备的调节按钮或者触摸屏进行音量增大或减小调节时,相应的确定当前终端设备的音量是增大还是减小。在一个实施例中,依据当前的音量值确定和音频振幅对应的振幅调整系数,如表2所示:In an embodiment, the terminal device is divided into 18 adjustable levels from mute to maximum volume, and each level corresponds to a volume value. When the terminal device plays the sound source, the volume can be acquired by the volume management component of the system (get volume) The method obtains the current volume value of the terminal device; 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. In one embodiment, the amplitude adjustment factor corresponding to the audio amplitude is determined based on the current volume value, as shown in Table 2:
表2Table 2
音量值Volume value 振幅调整系数Amplitude adjustment factor
55 0.50.5
1010 1.51.5
1515 22
在另一个实施例中,依据当前的音量增加信息或音量减小信息确定和音频振幅对应的振幅调整系数,如表3所示:In another embodiment, the amplitude adjustment coefficient corresponding to the audio amplitude is determined according to the current volume increase information or volume reduction information, as shown in Table 3:
表3table 3
音量值变化Volume value change 振幅调整系数Amplitude adjustment factor
增加increase 1.51.5
减小Decrease 0.80.8
在另一个实施例中,还可根据音量增加信息或音量减小信息结合终端设备的音量值共同确定振幅调整系数以对音频振幅实现调整。In another embodiment, the amplitude adjustment coefficient may be jointly determined according to the volume increase information or the volume reduction information in combination with the volume value of the terminal device to achieve adjustment of the audio amplitude.
在一实施例中,可依据终端设备的音量信息确定多个振幅调整系数,例如依据终端设备的音量信息确定了第一振幅调整系数、第二振幅调整系数和第三振幅调整系数,其中,第一振幅调整系数小于第二振幅调整系数,第二振幅调整系数小于第三振幅调整系数,然后依据音频振幅的振幅大小确定每个音频振幅对应三个振幅调整系数中的哪个振幅调整系数,例如为大于第一预设阈值或小于第三预设阈值的音频振幅分配第一振幅调整系数,为小于或等于第一预设阈值且大于第二预设阈值的音频振幅分配第二振幅调整系数,为小于或等于第二预设阈值且大于第三预设阈值的音频振幅分配第三振幅调整系数,其中,第一预设阈值大于第二预设阈值,第二预设阈值大于第三预设阈值,则如果某一音频振幅的振幅大小小于第三预设阈值,则确定该音频振幅对应的振幅调整系数为第一振幅调整系数。In an embodiment, a plurality of amplitude adjustment coefficients may be determined according to volume information of the terminal device, for example, determining a first amplitude adjustment coefficient, a second amplitude adjustment coefficient, and a third amplitude adjustment coefficient according to volume information of the terminal device, where An 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, and then according to the amplitude of the audio amplitude, which of the three amplitude adjustment coefficients is corresponding to each audio amplitude, for example, And an audio amplitude that is greater than the first preset threshold or less than the third preset threshold, the first amplitude adjustment coefficient is allocated, and the second amplitude adjustment coefficient is allocated to the audio amplitude that is less than or equal to the first preset threshold and greater than the second preset threshold. And a third amplitude adjustment coefficient is allocated to the audio amplitude that is less than or equal to the second preset threshold and greater than the third preset threshold, where the first preset threshold is greater than the second preset threshold, and the second preset threshold is greater than the third preset threshold And if the amplitude of the amplitude of the audio amplitude is less than the third preset threshold, determining the audio amplitude corresponding to A first amplitude adjustment factor is an amplitude adjustment coefficient.
在一实施例中,确定和所述音频振幅对应的振幅调整系数方式可以是:为大于第一预设阈值或小于第三预设阈值的音频振幅分配第一振幅调整系数,为小于或等于第一预设阈值且大于第二预设阈值的音频振幅分配第二振幅调整系数,为小于或等于第二预设阈值且大于第三预设阈值的音频振幅分配第三振幅调整系数,其中,所述第一振幅调整系数小于所述第二振幅调整系数,所述第二振幅调整系数小于所述第三振幅调整系数。在一实施例中,该第一预设阈值可以是-3db,第二预设阈值可以是-10db,第三预设阈值可以是-50db。在一实施例中,第一振幅调整系数为1(即不进行调整),第二振幅调整系数为1.4,第三振幅调整系数为1.8。其中,对于振幅过大(例如,大于-3db)或振幅过小(例如,小于-50db)的音频振幅不进行振幅调节,避免了对过大振幅调节后造成的破音,也避免了对过小的噪音进行调高带来的杂音增强的问题,进一步优化了音量调节方法。In an embodiment, determining an amplitude adjustment coefficient corresponding to the audio amplitude may be: assigning a first amplitude adjustment coefficient to an audio amplitude greater than a first preset threshold or less than a third preset threshold, being less than or equal to the first a second amplitude adjustment coefficient is allocated to the audio amplitude of the preset threshold and greater than the second preset threshold, and the third amplitude adjustment coefficient is allocated to the audio amplitude that is less than or equal to the second preset threshold and greater than the third preset threshold, where 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. In an embodiment, the first preset threshold may be -3 db, the second preset threshold may be -10 db, and the third preset threshold may be -50 db. In one embodiment, the first amplitude adjustment factor is one (ie, no adjustment is made), the second amplitude adjustment factor is 1.4, and the third amplitude adjustment factor is 1.8. Among them, for the amplitude of the amplitude is too large (for example, greater than -3db) or the amplitude is too small (for example, less than -50db), the amplitude of the audio is not adjusted, which avoids the breakage caused by the excessive amplitude adjustment, and avoids the over-correction. The noise is enhanced by the small noise, and the volume adjustment method is further optimized.
步骤304、将所述振幅调整系数划分为预设数目的子振幅调整系数,依据所述子振幅调整系数对所述音频振幅进行调整。Step 304: The amplitude adjustment coefficient is divided into a preset number of sub-amplitude adjustment coefficients, and the audio amplitude is adjusted according to the sub-amplitude adjustment coefficient.
图5是本公开另一实施例提供的一种音量调节方法的流程图。在一实施例中,在确定和所述音频振幅对应的振幅调整系数之后,还包括:依据所述终端设备的播放器件的阻抗值对所述振幅调整系数进行调整;所述将所述振幅调整系数划分为预设数目的子振幅调整系数包括:将调整后的振幅调整系数划分为 预设数目的子振幅调整系数。如图5所示,本实施例提供的音量调节方法包括如下步骤。FIG. 5 is a flowchart of a volume adjustment method according to another embodiment of the present disclosure. In an embodiment, after determining the amplitude adjustment coefficient corresponding to the audio amplitude, the method further includes: adjusting the amplitude adjustment coefficient according to an impedance value of the playback device of the terminal device; The dividing the coefficient into a preset number of sub-amplitude adjustment coefficients comprises: dividing the adjusted amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients. As shown in FIG. 5, the volume adjustment method provided in this embodiment includes the following steps.
步骤401、当检测到终端设备进行音源播放时,获取所述音源的音频信息。Step 401: Acquire audio information of the sound source when detecting that the terminal device performs sound source playback.
步骤402、依据所述音频信息确定所述音频信息对应的音频振幅。Step 402: Determine an audio amplitude corresponding to the audio information according to the audio information.
步骤403、确定和所述音频振幅对应的振幅调整系数,依据所述终端设备的播放器件的阻抗值所述振幅调整系数进行调整。Step 403: Determine an amplitude adjustment coefficient corresponding to the audio amplitude, and adjust the amplitude adjustment coefficient according to the impedance value of the playback device of the terminal device.
在一个实施例中,可通过功放芯片检测终端设备中安装的播放器件(如:扬声器)的阻抗值,还可以是通过物理方式检测播放器件的阻抗。在一实施例中,该阻抗值越大,对应的对振幅调整系数的调整越大。例如,假设播放器件的标称阻抗值为x,通过检测得到的阻抗值为1.2x,则相应的在确定出的振幅调整系数的基础上,将该振幅调整系数乘以1.2作为调整后的振幅调整系数。In one embodiment, 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. In an embodiment, the greater the impedance value, the greater the adjustment to the amplitude adjustment factor. For example, assuming that the nominal impedance value of the playback device is x and the impedance value obtained by the detection is 1.2x, the amplitude adjustment coefficient is multiplied by 1.2 as the adjusted amplitude based on the determined amplitude adjustment coefficient. Adjustment coefficient.
步骤404、将调整后的振幅调整系数划分为预设数目的子振幅调整系数,依据所述子振幅调整系数对所述音频振幅进行调整。Step 404: Divide the adjusted amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients, and adjust the audio amplitude according to the sub-amplitude adjustment coefficient.
由上述可知,在对音源的振幅进行调节过程中,引入播放器件的阻抗值作为确定振幅调整系数的参量之一,避免了播放器件随播放时长的增加,阻抗值越来越高,导致对正常播放过程中的音量大小产生影响的问题,使得调节后的音量大小更佳符合用户需求,进一步提高了音量调节效果。It can be seen from the above that in the process of adjusting the amplitude of the sound source, 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.
图6是本公开另一实施例提供的一种音量调节方法的流程图。在一实施例中,在确定和所述音频振幅对应的振幅调整系数之后,还包括:依据终端设备所处环境的噪声值对所述振幅调整系数进行调整;所述将所述振幅调整系数划分为预设数目的子振幅调整系数包括:将调整后的振幅调整系数划分为预设数目的子振幅调整系数。如图6所示,本实施例提供的技术方案如下:FIG. 6 is a flowchart of a volume adjustment method according to another embodiment of the present disclosure. In an embodiment, after determining the amplitude adjustment coefficient corresponding to the audio amplitude, the method further includes: adjusting the amplitude adjustment coefficient according to a noise value of an environment in which the terminal device is located; and dividing the amplitude adjustment coefficient Adjusting the coefficient for the preset number of sub-amplitudes includes dividing the adjusted amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients. As shown in FIG. 6, the technical solution provided by this embodiment is as follows:
步骤501、当检测到终端设备进行音源播放时,获取所述音源的音频信息。Step 501: Acquire audio information of the audio source when detecting that the terminal device performs sound source playback.
步骤502、依据所述音频信息确定所述音频信息对应的音频振幅。Step 502: Determine an audio amplitude corresponding to the audio information according to the audio information.
步骤503、确定和所述音频振幅对应的振幅调整系数,依据终端设备所处环境的噪声值对所述振幅调整系数进行调整。Step 503: Determine an amplitude adjustment coefficient corresponding to the audio amplitude, and adjust the amplitude adjustment coefficient according to a noise value of an environment in which the terminal device is located.
在一个实施例中,可通过终端设备安装的麦克风采集终端设备当前所处环境的噪音以确定对应的噪声值。在一实施例中,该噪声值越大,对应的对振幅调整系数的调整越大。例如,假设终端设备在安静环境下的噪声值为y,终端设备处于户外或嘈杂环境中时,确定的终端设备所处环境的噪声值为1.5y,则相应的在确定出的振幅调整系数的基础上,将该振幅调整系数乘以1.5作为调整后的振幅调整系数。需要说明的是,还可依据阻抗值、噪声值以及音频振幅的大小共同确定音源的振幅调整系数。In one embodiment, the noise of the environment in which the terminal device is currently located may be collected by a microphone installed in the terminal device to determine a corresponding noise value. In an embodiment, the larger the noise value, the larger the adjustment of the corresponding amplitude adjustment coefficient. For example, if the noise value of the terminal device in a quiet environment is y, and the terminal device is in an outdoor or noisy environment, the noise value of the environment in which the terminal device is determined is 1.5 y, and the corresponding amplitude adjustment coefficient is determined. In addition, the amplitude adjustment coefficient is multiplied by 1.5 as the adjusted amplitude adjustment coefficient. It should be noted that the amplitude adjustment coefficient of the sound source may be jointly determined according to the impedance value, the noise value, and the magnitude of the audio amplitude.
步骤504、将调整后的振幅调整系数划分为预设数目的子振幅调整系数,依据所述子振幅调整系数对所述音频振幅进行调整。Step 504: The adjusted amplitude adjustment coefficient is divided into a preset number of sub-amplitude adjustment coefficients, and the audio amplitude is adjusted according to the sub-amplitude adjustment coefficient.
由上述可知,在对音源的振幅进行调节过程中,考虑了噪声对终端设备音量的影响,将确定的噪声值作为确定振幅调整系数的参量之一,使得调节后的音量大小更加符合用户需求,进一步提高了音量调节效果。It can be seen from the above that in the process of adjusting the amplitude of the sound source, 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. Further improved the volume adjustment effect.
图7是本公开一实施例提供的一种音量调节装置的结构框图。该装置用于执行上述实施例提供的音量调节方法,具备执行方法相应的功能模块和有益效果。如图7所示,该音量调节装置包括:获取模块10、振幅确定模块20、调整系数确定模块30和调节模块40。FIG. 7 is a structural block diagram of a volume adjustment apparatus according to an embodiment of the present disclosure. The device 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. As shown in FIG. 7, the volume adjustment device includes an acquisition module 10, an amplitude determination module 20, an adjustment coefficient determination module 30, and an adjustment module 40.
在一实施例中,获取模块10,设置为当检测到终端设备进行音源播放时,获取所述音源的音频信息。In an embodiment, 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. In an embodiment, the playing of the sound source mainly includes the steps of acquiring, decoding, and outputting the sound source file. In an embodiment, 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. In an embodiment, after the sound source file is acquired, the sound source 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. In an embodiment, 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. In one embodiment, when it is detected that the sound source play event is triggered, it is determined that the terminal device starts playing the sound source. In an embodiment, 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.
当检测到终端设备进行音源播放时,获取所述音源的音频信息。在一个实施例中,可对音频解码器解码得到的数字音频信号进行取样,确定该音源对应的音频信息。在另一实施例中,还可以获取当前播放的音源的原始文件,通过对该原始文件的解析确定音源对应的音频信息。在另一实施例中,以Android***为例,可通过android.media.MediaRecorder类或android.media.AudioRecord类获取音源的音频信息。When the terminal device detects the sound source playing, the audio information of the sound source is acquired. In one embodiment, the digital audio signal decoded by the audio decoder may be sampled to determine audio information corresponding to the audio source. In another embodiment, 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. In another embodiment, taking the Android system as an example, the audio information of the audio source can be obtained through the android.media.MediaRecorder class or the android.media.AudioRecord class.
振幅确定模块20,设置为依据所述音频信息确定所述音频信息对应的音频振幅。The amplitude determining module 20 is configured to determine an audio amplitude corresponding to the audio information according to the audio information.
振幅指物体震动过程中偏离原来位置的最大距离,人耳听到的声音的响度与音源的振幅相关,振幅越大响度越强。在一个实施例中,可对音频解码器解码得到的数字音频信号进行取样,获取预设时间段T内的振幅信息。在一实施例中,该振幅信息可由多个振幅值组成,依据得到的多个振幅值可相应的确定在该预设时间段T内播放的音源的振幅曲线。在另一实施例中,以Android***为例,可通过android.media.MediaRecorder类或android.media.AudioRecord类获取音源的音频信息后得到音频信息对应的音频振幅的振幅大小。在另一实施例中,当获取到的音频信息为音源对应的原始文件时,可通过对原始文件进行解析以得到音频信息对应的音频振幅的振幅大小。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. In one embodiment, the digital audio signal decoded by the audio decoder may be sampled to obtain amplitude information within a preset time period T. In an embodiment, 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. In another embodiment, taking the Android system as an example, the audio information of the audio source can be obtained by the android.media.MediaRecorder class or the android.media.AudioRecord class to obtain the amplitude of the audio amplitude corresponding to the audio information. In another embodiment, when the acquired audio information is the original file corresponding to the sound source, the amplitude of the audio amplitude corresponding to the audio information may be obtained by parsing the original file.
在一个实施例中,当检测音源播放时,每隔预设时间(如1s、3s或10s)确定一次振幅,或者实时地对音频信息的每一帧音频帧的振幅进行确定。在一实 施例中,所述获取模块101是设置为:获取所述音源的音频帧信息;相应的,所述振幅确定模块是设置为:依据所述音频帧信息确定所述音频帧信息的每一帧音频帧的音频振幅。在一实施例中,当检测到音源播放时,对音源文件进行解析得到音频帧序列,根据音频帧序列的每一帧确定每一帧对应的振幅。In one embodiment, 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. In an embodiment, the acquiring module 101 is configured to: acquire audio frame information of the sound source; correspondingly, the amplitude determining module is configured to: determine each of the audio frame information according to the audio frame information. The audio amplitude of a frame of audio frames. In an embodiment, when the sound source is detected, the sound source file is parsed to obtain an audio frame sequence, and the amplitude corresponding to each frame is determined according to each frame of the audio frame sequence.
调整系数确定模块30,设置为确定和所述音频振幅对应的振幅调整系数,并将所述振幅调整系数划分为预设数目的子振幅调整系数。The adjustment coefficient determining module 30 is configured to determine an amplitude adjustment coefficient corresponding to the audio amplitude, and divide the amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients.
在一个实施例中,为提高音源中低振幅区域的音量,对低振幅的音频振幅分配较大的振幅调整系数,高振幅的音频振幅相应的分配一较小的调整系数。例如,对振幅大小小于-3db且大于-10db音频振幅分配振幅调整系数为1.2,对振幅大小小于-10db且大于-50db的音频振幅分配振幅调整系数为2。此时,在音源播放过程中,如果前一段音频振幅的振幅调整系数为1.2,而过渡到相邻的下一段音频振幅需要振幅调整系数为2的话,进行调整后的音频振幅会存在明显的听感突兀的问题,这是由振幅调整系数跳跃带来的。在一实施例中,所述调整系数确定模块30是设置为通过如下方式将所述振幅调整系数划分为预设数目的子振幅调整系数:检测到不同音频振幅对应的振幅调整系数满足预设条件时,将所述振幅调整系数划分为预设数目的子振幅调整系数。在一实施例中,所述子振幅调整系数为依据所述振幅调整系数线性或非线性划分得到。在一实施例中,该预设条件可以是相邻的音频振幅的振幅调整系数不一致,例如振幅调整系数由前一音频振幅的振幅调整系数1变成后一音频振幅的振幅调整系数2,或振幅调整系数由2变成1.2等。此时,可以在相邻的两个音频振幅对应的两个振幅调整系数之间增加预设数目的子振幅调整系数,在一实施例中,当确定出的相邻音频振幅对应的音频振幅的振幅调整系数分别为1.2和2时,可在1.2到2之间再增加9个等级,即从1.2开始依次递增相同或不同的数值得到:1.28、1.36、1.42、...、1.92。在调节过程中,在振幅调整系数从1.2到2的过渡阶段,可将每n(例如,n大于1小于等于20)帧音频帧对应一个子振幅调整系数,依次对每一帧音频帧的振幅进行调整。例如,振幅调整系数由1.2改变为2时,改变开始时的第1-20帧音频帧对应的子振幅调整系数为1.28,第21-40帧音频帧对应的子振幅调整系数为1.36,依次类推。In one embodiment, to increase the volume of the low amplitude region of the sound source, a large amplitude adjustment factor is assigned to the low amplitude audio amplitude, and a high amplitude audio amplitude is correspondingly assigned a smaller adjustment factor. For example, the amplitude adjustment coefficient of the audio amplitude distribution is less than -3 db and greater than -10 db, and the amplitude adjustment coefficient is 2 for the audio amplitude of amplitudes less than -10 db and greater than -50 db. At this time, during the sound source playing, if the amplitude adjustment coefficient of the previous audio amplitude is 1.2, and the amplitude of the adjustment to the adjacent next audio amplitude requires an amplitude adjustment coefficient of 2, the adjusted audio amplitude will be clearly heard. The problem is abrupt, which is caused by the jump of the amplitude adjustment factor. In an embodiment, the adjustment coefficient determining module 30 is configured to divide the amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients by detecting that an amplitude adjustment coefficient corresponding to different audio amplitudes meets a preset condition. The amplitude adjustment coefficient is divided into a preset number of sub-amplitude adjustment coefficients. In an embodiment, the sub-amplitude adjustment coefficients are obtained by linear or non-linear division of the amplitude adjustment coefficients. In an embodiment, the preset condition may be that the amplitude adjustment coefficients of the adjacent audio amplitudes are inconsistent, for example, the amplitude adjustment coefficient is changed from the amplitude adjustment coefficient 1 of the previous audio amplitude to the amplitude adjustment coefficient 2 of the latter audio amplitude, or The amplitude adjustment coefficient is changed from 2 to 1.2. At this time, a preset number of sub-amplitude adjustment coefficients may be added between two amplitude adjustment coefficients corresponding to two adjacent audio amplitudes. In an embodiment, when determining the audio amplitude corresponding to the adjacent audio amplitude When the amplitude adjustment coefficients are 1.2 and 2, respectively, 9 levels can be added between 1.2 and 2, that is, the same or different values are incremented from 1.2: 1.28, 1.36, 1.42, ..., 1.92. In the adjustment process, in the transition phase of the amplitude adjustment coefficient from 1.2 to 2, each n (for example, n is greater than 1 and less than or equal to 20) frame audio frames may correspond to one sub-amplitude adjustment coefficient, and the amplitude of each frame of the audio frame is sequentially Make adjustments. For example, when the amplitude adjustment coefficient is changed from 1.2 to 2, the sub-amplitude adjustment coefficient corresponding to the 1-20th audio frame at the start of the change is 1.28, and the sub-amplitude adjustment coefficient corresponding to the 21-40th audio frame is 1.36, and so on. .
调节模块40,设置为依据所述子振幅调整系数对所述音频振幅进行调整。The adjustment module 40 is configured to adjust the audio amplitude according to the sub-amplitude adjustment coefficient.
在一实施例中,对音频振幅进行调整的过程可以是:对音源文件进行解析,对得到的音频数据中的表征振幅信息的数据进行修改,修改完毕后再进行封装,当缓冲到对应的音源文件并被播放时音频振幅相应的已被增大;还可以是,在音源播放的解码过程中,通过对得到的数字音频信号进行分析得到音频振幅,将该振幅数据乘以对应的振幅调整系数以改变振幅大小,进而对音源的音量进行调节。In an embodiment, the process of adjusting the audio amplitude may be: parsing the audio file, modifying the data representing the amplitude information in the obtained audio data, and then performing the encapsulation after the modification, when buffering to the corresponding audio source. When the file is played, the audio amplitude is correspondingly increased; or, in the decoding process of the sound source playing, the audio amplitude is obtained by analyzing the obtained digital audio signal, and the amplitude data is multiplied by the corresponding amplitude adjustment coefficient. To change the amplitude, adjust the volume of the source.
本实施例提供的方案实现了在不改变终端设备***原有音量的前提下对音源音量的大小进行了调节,调节过程可以在音源文件未进入缓冲区前,以减少播放负载,也可以是针对缓冲区中的音源内容进行调节以提高调节效率,从而 提高了音量调节效率,降低了终端设备的功耗,且通过使用子振幅调整系数对预设数量的音频帧的音频振幅进行调整,避免了由振幅调整系数的跳跃带来的听感突兀的问题,提高了用户体验。The solution provided in this embodiment implements adjusting the volume of the sound source without changing the original volume of the terminal device system. The adjustment process may reduce the playback load before the audio source file does not enter the buffer, or may be directed to The content of the sound source in the buffer is adjusted to improve the adjustment efficiency, thereby improving the volume adjustment efficiency, reducing the power consumption of the terminal device, and adjusting the audio amplitude of the preset number of audio frames by using the sub-amplitude adjustment coefficient, thereby avoiding The problem of sudden hearing caused by the jump of the amplitude adjustment coefficient improves the user experience.
在一实施例中,所述调整系数确定模块30是设置为通过如下方式将所述振幅调整系数划分为预设数目的子振幅调整系数:In an embodiment, the adjustment coefficient determining module 30 is configured to divide the amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients by:
检测到不同音频振幅对应的振幅调整系数满足预设条件时,将所述振幅调整系数划分为预设数目的子振幅调整系数,其中,所述子振幅调整系数为依据所述振幅调整系数线性或非线性划分得到。When detecting that the amplitude adjustment coefficient corresponding to different audio amplitudes satisfies a preset condition, dividing the amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients, wherein the sub-amplitude adjustment coefficient is linear according to the amplitude adjustment coefficient or Nonlinear division is obtained.
在一实施例中,所述调节模块40是设置为:In an embodiment, the adjustment module 40 is configured to:
依据所述子振幅调整系数对所述音频信息中的预设数量的音频帧的音频振幅进行逐级调整。Adjusting the audio amplitude of the preset number of audio frames in the audio information step by step according to the sub-amplitude adjustment coefficient.
在一实施例中,所述调整系数确定模块30是设置为通过如下方式确定和所述音频振幅对应的振幅调整系数:In an embodiment, the adjustment coefficient determination module 30 is configured to determine an amplitude adjustment coefficient corresponding to the audio amplitude by:
依据所述音频振幅的振幅大小确定和所述音频振幅对应的振幅调整系数。An amplitude adjustment coefficient corresponding to the audio amplitude is determined according to the amplitude magnitude of the audio amplitude.
在一实施例中,所述调整系数确定模块30是设置为通过如下方式确定和所述音频振幅对应的振幅调整系数:In an embodiment, the adjustment coefficient determination module 30 is configured to determine an amplitude adjustment coefficient corresponding to the audio amplitude by:
依据所述音频振幅的振幅大小和终端设备的音量信息确定和所述音频振幅对应的振幅调整系数,其中,所述音量信息包括音量值信息、音量增加信息或音量减小信息。And determining, according to the amplitude magnitude of the audio amplitude and the volume information of the terminal device, an amplitude adjustment coefficient corresponding to the audio amplitude, wherein the volume information includes volume value information, volume increase information, or volume reduction information.
在一实施例中,所述调整系数确定模块30还设置为:In an embodiment, the adjustment coefficient determination module 30 is further configured to:
在确定和所述音频振幅对应的振幅调整系数之后,依据所述终端设备的播放器件的阻抗值和/或所述终端设备所处环境的噪声值对所述振幅调整系数进行调整;After determining an amplitude adjustment coefficient corresponding to the audio amplitude, adjusting the amplitude adjustment coefficient according to an impedance value of the playback device of the terminal device and/or a noise value of an environment in which the terminal device is located;
所述调整系数确定模块30是设置为通过如下方式将振幅调整系数划分为预设数目的子振幅调整系数:将调整后的振幅调整系数划分为预设数目的子振幅调整系数。The adjustment coefficient determining module 30 is configured to divide the amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients by dividing the adjusted amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients.
请继续参照图7。图7是本公开一实施例提供的一种音量调节装置的结构框图。该装置用于执行上述实施例提供的音量调节方法,具备执行方法相应的功能模块和有益效果。如图7所示,该音量调节装置包括:获取模块10、振幅确定模块20、调整系数确定模块30和调节模块40。Please continue to refer to Figure 7. FIG. 7 is a structural block diagram of a volume adjustment apparatus according to an embodiment of the present disclosure. The device 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. As shown in FIG. 7, the volume adjustment device includes an acquisition module 10, an amplitude determination module 20, an adjustment coefficient determination module 30, and an adjustment module 40.
其中,获取模块10,设置为当检测到终端设备进行音源播放时,获取所述音源的音频信息;The acquiring module 10 is configured to acquire audio information of the audio source when detecting that the terminal device performs sound source playing.
振幅确定模块20,设置为依据所述音频信息确定多个预设时间段分别对应的多个音频振幅;The amplitude determining module 20 is configured to determine, according to the audio information, a plurality of audio amplitudes respectively corresponding to the plurality of preset time segments;
调整系数确定模块30,设置为当第一音频振幅对应的第一振幅调整系数和相邻的第二音频振幅对应的第二振幅调整系数不一样时,在所述第一振幅调整系数和所述第二振幅调整系数之间增加预设数目的子振幅调整系数,其中,所 述预设数目的子振幅调整系数是在所述第一振幅调整系数和所述第二振幅调整系数之间依次递增或依次递减的;The adjustment coefficient determining module 30 is configured to: when the first amplitude adjustment coefficient corresponding to the first audio amplitude and the second amplitude adjustment coefficient corresponding to the adjacent second audio amplitude are different, the first amplitude adjustment coefficient and the Adding a preset number of sub-amplitude adjustment coefficients between the second amplitude adjustment coefficients, wherein the preset number of sub-amplitude adjustment coefficients are sequentially incremented between the first amplitude adjustment coefficient and the second amplitude adjustment coefficient Or decreasing in turn;
调节模块40,设置为依据所述预设数目的子振幅调整系数对从起始帧开始的预设数量的音频帧进行调整,其中,所述起始帧为振幅调整系数由所述第一振幅调整系数变化为所述第二振幅调整系数时的首个音频帧。The adjusting module 40 is configured to adjust, according to the preset number of sub-amplitude adjustment coefficients, a preset number of audio frames from a start frame, wherein the start frame is an amplitude adjustment coefficient by the first amplitude The first audio frame when the adjustment coefficient changes to the second amplitude adjustment coefficient.
在一实施例中,所述获取模块10是设置为:在每个所述预设时间段内对所述音频信息进行至少两次取样获取每个所述预设时间段对应的至少两个音频振幅;将每个所述预设时间段各自对应的所述至少两个音频振幅之间的平均振幅确定为每个所述预设时间段对应的音频振幅。In an embodiment, the acquiring module 10 is configured to: sample the audio information at least twice in each of the preset time periods to obtain at least two audios corresponding to each of the preset time periods. An amplitude; determining an average amplitude between the at least two audio amplitudes corresponding to each of the preset time periods as an audio amplitude corresponding to each of the preset time periods.
在一实施例中,,所述获取模块10是设置为:每隔所述预设时间段依据所述音频信息确定一次音频振幅。In an embodiment, the obtaining module 10 is configured to determine an audio amplitude according to the audio information every the preset time period.
在一实施例中,所述获取模块10是设置为:依据所述音频信息确定所述音频信息的每一帧音频帧对应的音频振幅,其中,所述每一帧音频帧对应一个所述预设时间段。In an embodiment, the acquiring module 10 is configured to: determine, according to the audio information, an audio amplitude corresponding to each frame of the audio information, where each frame of the audio frame corresponds to one of the pre- Set the time period.
在一实施例中,所述预设数量的音频帧,包括:第一组音频帧至第M组音频帧;所述预设数目的子振幅调整系数,包括:依次递增或递减的第一子振幅调整系数至第N子振幅调整系数,其中,M和N均为大于或等于1的正整数,且M大于或等于N;所述调整模块40是设置为:依次使用所述第一子振幅调整系数至所述第N子振幅调整系数对所述第一组音频帧至所述第N组音频帧进行调整。In an embodiment, the preset number of audio frames includes: a first group of audio frames to an Mth group of audio frames; and the preset number of sub-amplitude adjustment coefficients includes: a first sub-increment or decrement The amplitude adjustment coefficient to the Nth sub-amplitude adjustment coefficient, wherein M and N are both positive integers greater than or equal to 1, and M is greater than or equal to N; the adjustment module 40 is configured to: sequentially use the first sub-amplitude Adjusting coefficients to the Nth sub-amplitude adjustment coefficient to adjust the first set of audio frames to the Nth set of audio frames.
在一实施例中,所述预设数目的子振幅调整系数为在所述第一振幅调整系数和所述第二振幅调整系数之间进行等间距划分得到。In an embodiment, the preset number of sub-amplitude adjustment coefficients are obtained by equally spaced between the first amplitude adjustment coefficient and the second amplitude adjustment coefficient.
在一实施例中,所述多个音频振幅中的每一个音频振幅对应一个振幅调整系数,每个所述振幅调整系数为依据对应的所述音频振幅的振幅大小确定的。In an embodiment, each of the plurality of audio amplitudes corresponds to an amplitude adjustment coefficient, and each of the amplitude adjustment coefficients is determined according to a magnitude of an amplitude of the corresponding audio amplitude.
在一实施例中,所述多个音频振幅中的每一个音频振幅对应一个振幅调整系数,每个所述振幅调整系数为依据所述终端设备的音量信息和对应的所述音频振幅的振幅大小,其中,所述音量信息包括音量值信息、音量增加信息或音量减小信息。In an embodiment, each of the plurality of audio amplitudes corresponds to an amplitude adjustment coefficient, and each of the amplitude adjustment coefficients is based on volume information of the terminal device and a corresponding amplitude of the audio amplitude. The volume information includes volume value information, volume increase information, or volume decrease information.
在一实施例中,所述多个音频振幅中的每一个音频振幅对应一个振幅调整系数,每个所述振幅调整系数为依据对应的所述音频振幅的振幅大小以及以下信息至少之一确定的:所述终端设备的播放器件的阻抗值以及所述终端所处环境的噪声值;或者,所述多个音频振幅中的每一个音频振幅对应一个振幅调整系数,每个所述振幅调整系数为依据所述终端设备的音量信息、对应的所述音频振幅的振幅大小和以及以下信息至少之一确定的:所述终端设备的播放器件的阻抗值以及所述终端所处环境的噪声值,其中,所述音量信息包括音量值信息、音量增加信息或音量减小信息。In an embodiment, each of the plurality of audio amplitudes corresponds to an amplitude adjustment coefficient, and each of the amplitude adjustment coefficients is determined according to at least one of an amplitude of the corresponding audio amplitude and at least one of the following information. : an impedance value of the playback device of the terminal device and a noise value of an environment in which the terminal is located; or each of the plurality of audio amplitudes corresponds to an amplitude adjustment coefficient, and each of the amplitude adjustment coefficients is Determining, according to the volume information of the terminal device, the amplitude magnitude of the corresponding audio amplitude, and at least one of the following: an impedance value of the playback device of the terminal device and a noise value of an environment in which the terminal is located, where The volume information includes volume value information, volume increase information, or volume decrease information.
本实施例在上述多个实施例的基础上提供了一种终端设备,图8是本公开一实施例提供的一种终端设备的结构示意图,如图8所示,该终端设备200包 括:存储器201、处理器(Central Processing Unit,CPU)202、外设接口203、射频(Radio Frequency,RF)电路205、音频电路206、扬声器211、电源管理芯片208、输入/输出(I/O)子***209、触摸屏212、其他输入/控制设备210以及外部端口204,这些部件通过一个或多个通信总线或信号线207来通信。The present embodiment provides a terminal device based on the foregoing multiple embodiments. FIG. 8 is a schematic structural diagram of a terminal device according to an embodiment of the present disclosure. As shown in FIG. 8, the terminal device 200 includes: a memory. 201, a central processing unit (CPU) 202, a peripheral interface 203, a radio frequency (RF) circuit 205, an audio circuit 206, a speaker 211, a power management chip 208, and an input/output (I/O) subsystem 209. Touch screen 212, other input/control devices 210, and external port 204 are communicated via one or more communication buses or signal lines 207.
图8示出的终端设备200仅仅是终端设备的一个范例,并且终端设备200可以具有比图8中所示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图8中所示出的多种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。The terminal device 200 illustrated in FIG. 8 is merely an example of a terminal device, and the terminal device 200 may have more or fewer components than those illustrated in FIG. 8, and two or more components may be combined, or Can have different component configurations. The various components shown in Figure 8 can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
下面就本实施例提供的终端设备200进行描述,该终端设备200以智能手机为例。The following describes the terminal device 200 provided in this embodiment. The terminal device 200 takes a smart phone as an example.
存储器201,所述存储器201可以被CPU202以及外设接口203等访问,所述存储器201可以包括高速随机存取存储器,还可以包括非易失性存储器,例如一个或多个磁盘存储器件、闪存器件、或其他易失性固态存储器件。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.
外设接口203,所述外设接口203可以将设备的输入和输出外设连接到CPU202和存储器201。 Peripheral interface 203, which can connect the input and output peripherals of the device to CPU 202 and memory 201.
I/O子***209,所述I/O子***209可以将设备上的输入外设和输出外设,例如触摸屏212和其他输入/控制设备210,连接到外设接口203。I/O子***209可以包括显示控制器2091和用于控制其他输入/控制设备210的一个或多个输入控制器2092。在一实施例中,一个或多个输入控制器2092从其他输入/控制设备210接收电信号或者向其他输入/控制设备210发送电信号,其他输入/控制设备210可以包括物理按钮(按压按钮或摇臂按钮等)、拨号盘、滑动开关、操纵杆或点击滚轮。在一实施例中,输入控制器2092可以与以下任一个连接:键盘、红外端口、USB接口以及诸如鼠标的指示设备。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 for controlling other input/control devices 210. In one embodiment, 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 or Rocker button, etc.), dial, slide switch, joystick or click on the wheel. In an embodiment, 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.
触摸屏212,所述触摸屏212是用户终端与用户之间的输入接口和输出接口,将可视输出显示给用户,可视输出可以包括图形、文本、图标以及视频等。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.
I/O子***209中的显示控制器2091从触摸屏212接收电信号或者向触摸屏212发送电信号。触摸屏212检测触摸屏212上的接触,显示控制器2091将检测到的接触转换为与显示在触摸屏212上的用户界面对象的交互,即实现人机交互,显示在触摸屏212上的用户界面对象可以是运行游戏的图标和联网到相应网络的图标等。在一实施例中,终端设备200还可以包括光鼠,光鼠是不显示可视输出的触摸敏感表面,或者是由触摸屏形成的触摸敏感表面的延伸。 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 and icons that are networked to the appropriate network. In an embodiment, 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.
RF电路205,设置为建立手机与无线网络(即网络侧)的通信,实现手机与无线网络的数据接收和发送。例如收发短信息和电子邮件等。在一实施例中,RF电路205接收并发送RF信号,RF信号也称为电磁信号,RF电路205将电信号转换为电磁信号或将电磁信号转换为电信号,并且通过该电磁信号与通信网络以及其他设备进行通信。RF电路205可以包括用于执行这些功能的已知电路,RF电路205包括但不限于天线***、RF收发机、一个或多个放大器、调 谐器、一个或多个振荡器、数字信号处理器、编译码器(COder-DECoder,CODEC)芯片组以及用户标识模块(Subscriber Identity Module,SIM)等等。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 and emails. In an embodiment, 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.
音频电路206,设置为从外设接口203接收音频数据,将该音频数据转换为电信号,并且将该电信号发送给扬声器211。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.
扬声器211,设置为将手机通过RF电路205从无线网络接收的语音信号,还原为声音并向用户播放该声音。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.
电源管理芯片208,设置为为CPU202、I/O子***及外设接口所连接的硬件进行供电及电源管理。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. For the technical details that are not described in detail in the above embodiments, reference may be made to the volume adjustment method of the terminal device provided by any embodiment of the present disclosure.
本公开实施例还提供一种包含终端设备可执行指令的存储介质,所述终端设备可执行指令在由终端设备处理器执行时用于执行一种音量调节方法,该方法包括: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:
当检测到终端设备进行音源播放时,获取所述音源的音频信息;Obtaining audio information of the sound source when detecting that the terminal device performs sound source playing;
依据所述音频信息确定所述音频信息对应的音频振幅;Determining an audio amplitude corresponding to the audio information according to the audio information;
确定和所述音频振幅对应的振幅调整系数,将所述振幅调整系数划分为预设数目的子振幅调整系数,依据所述子振幅调整系数对所述音频振幅进行调整。And determining an amplitude adjustment coefficient corresponding to the audio amplitude, dividing the amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients, and adjusting the audio amplitude according to the sub-amplitude adjustment coefficient.
在一实施例中,所述将所述振幅调整系数划分为预设数目的子振幅调整系数包括:In an embodiment, the dividing the amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients comprises:
检测到不同音频振幅对应的振幅调整系数满足预设条件时,将所述振幅调整系数划分为预设数目的子振幅调整系数,其中,所述子振幅调整系数为依据所述振幅调整系数线性或非线性划分得到。When detecting that the amplitude adjustment coefficient corresponding to different audio amplitudes satisfies a preset condition, dividing the amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients, wherein the sub-amplitude adjustment coefficient is linear according to the amplitude adjustment coefficient or Nonlinear division is obtained.
在一实施例中,所述依据所述子振幅调整系数对所述音频振幅进行调整包括:In an embodiment, the adjusting the audio amplitude according to the sub-amplitude adjustment coefficient comprises:
依据所述子振幅调整系数对所述音源的预设数量的音频帧的音频振幅进行逐级调整。Adjusting the audio amplitude of the preset number of audio frames of the sound source step by step according to the sub-amplitude adjustment coefficient.
在一实施例中,所述确定和所述音频振幅对应的振幅调整系数包括:In an embodiment, the determining an amplitude adjustment coefficient corresponding to the audio amplitude comprises:
依据所述音频振幅的振幅大小确定和音频振幅对应的振幅调整系数。An amplitude adjustment coefficient corresponding to the audio amplitude is determined according to the magnitude of the amplitude of the audio amplitude.
在一实施例中,所述确定和所述音频振幅对应的振幅调整系数包括:In an embodiment, the determining an amplitude adjustment coefficient corresponding to the audio amplitude comprises:
依据所述音频振幅的振幅大小和终端设备的音量信息确定和所述音频振幅对应的振幅调整系数,其中,所述音量信息包括音量值信息、音量增加信息或音量减小信息。And determining, according to the amplitude magnitude of the audio amplitude and the volume information of the terminal device, an amplitude adjustment coefficient corresponding to the audio amplitude, wherein the volume information includes volume value information, volume increase information, or volume reduction information.
在一实施例中,在确定和所述音频振幅对应的振幅调整系数之后,还包括:In an embodiment, after determining the amplitude adjustment coefficient corresponding to the audio amplitude, the method further includes:
依据终端设备的播放器件的阻抗值和/或终端设备所处环境的噪声值对所述振幅调整系数进行调整;Adjusting the amplitude adjustment coefficient according to the impedance value of the playback device of the terminal device and/or the noise value of the environment in which the terminal device is located;
相应的,所述将所述振幅调整系数划分为预设数目的子振幅调整系数包括:Correspondingly, the dividing the amplitude adjustment coefficient into a preset number of sub-amplitude adjustment coefficients comprises:
将调整后的振幅调整系数划分为预设数目的子振幅调整系数。The adjusted amplitude adjustment coefficient is divided into a preset number of sub-amplitude adjustment coefficients.
存储介质——任何的各种类型的存储器设备或存储设备。术语“存储介质”旨在包括:安装介质,例如紧凑型光盘只读储存器(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等;非易失性存储器,诸如闪存、磁介质(例如硬盘或光存储);寄存器或其它相似类型的存储器元件等。存储介质可以还包括其它类型的存储器或其组合。另外,存储介质可以位于程序在其中被执行的第一计算机***中,或者可以位于不同的第二计算机***中,第二计算机***通过网络(诸如因特网)连接到第一计算机***。第二计算机***可以提供程序指令给第一计算机用于执行。术语“存储介质”可以包括可以驻留在不同位置中(例如在通过网络连接的不同计算机***中)的两个或更多存储介质。存储介质可以存储可由一个或多个处理器执行的程序指令(例如具体实现为计算机程序)。Storage media - any of a variety of types of memory devices or storage devices. 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 Random Random Access Memory (DRAM), Double Data Rate Random Access Memory (DDR RAM), Static Random Access Memory (SRAM), Extended Data Output Random 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. Additionally, 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. .
上述仅为本公开的较佳实施例及所运用技术原理。The above are only the preferred embodiments of the present disclosure and the technical principles applied thereto.

Claims (20)

  1. 一种音量调节方法,包括:A volume adjustment method includes:
    当检测到终端设备进行音源播放时,获取所述音源的音频信息;Obtaining audio information of the sound source when detecting that the terminal device performs sound source playing;
    依据所述音频信息确定多个预设时间段分别对应的多个音频振幅;Determining, according to the audio information, a plurality of audio amplitudes respectively corresponding to the plurality of preset time segments;
    当第一音频振幅对应的第一振幅调整系数和相邻的第二音频振幅对应的第二振幅调整系数不一样时,在所述第一振幅调整系数和所述第二振幅调整系数之间增加预设数目的子振幅调整系数,其中,所述预设数目的子振幅调整系数是在所述第一振幅调整系数和所述第二振幅调整系数之间依次递增或依次递减的;When the first amplitude adjustment coefficient corresponding to the first audio amplitude and the second amplitude adjustment coefficient corresponding to the adjacent second audio amplitude are different, increasing between the first amplitude adjustment coefficient and the second amplitude adjustment coefficient a preset number of sub-amplitude adjustment coefficients, wherein the preset number of sub-amplitude adjustment coefficients are sequentially incremented or sequentially decremented between the first amplitude adjustment coefficient and the second amplitude adjustment coefficient;
    依据所述预设数目的子振幅调整系数对从起始帧开始的预设数量的音频帧进行调整,其中,所述起始帧为振幅调整系数由所述第一振幅调整系数变化为所述第二振幅调整系数时的首个音频帧。Adjusting, according to the preset number of sub-amplitude adjustment coefficients, a preset number of audio frames from a start frame, wherein the start frame is an amplitude adjustment coefficient changed from the first amplitude adjustment coefficient to the The first audio frame at the second amplitude adjustment factor.
  2. 根据权利要求1所述的方法,其中,所述依据所述音频信息确定多个预设时间段分别对应的多个音频振幅,包括:The method of claim 1, wherein the determining, according to the audio information, a plurality of audio amplitudes corresponding to the plurality of preset time segments respectively comprises:
    在每个所述预设时间段内对所述音频信息进行至少两次取样获取每个所述预设时间段对应的至少两个音频振幅;Performing at least two samplings on the audio information in each of the preset time periods to obtain at least two audio amplitudes corresponding to each of the preset time periods;
    将每个所述预设时间段各自对应的所述至少两个音频振幅之间的平均振幅确定为每个所述预设时间段对应的音频振幅。The average amplitude between the at least two audio amplitudes corresponding to each of the preset time periods is determined as the audio amplitude corresponding to each of the preset time periods.
  3. 根据权利要求1所述的方法,其中,所述依据所述音频信息确定多个预设时间段分别对应的多个音频振幅,包括:The method of claim 1, wherein the determining, according to the audio information, a plurality of audio amplitudes corresponding to the plurality of preset time segments respectively comprises:
    每隔所述预设时间段依据所述音频信息确定一次音频振幅。The audio amplitude is determined once according to the audio information every predetermined period of time.
  4. 根据权利要求1所述的方法,其中,所述依据所述音频信息确定多个预设时间段分别对应的多个音频振幅,包括:The method of claim 1, wherein the determining, according to the audio information, a plurality of audio amplitudes corresponding to the plurality of preset time segments respectively comprises:
    依据所述音频信息确定所述音频信息的每一帧音频帧对应的音频振幅,其中,所述每一帧音频帧对应一个所述预设时间段。Determining, according to the audio information, an audio amplitude corresponding to each frame of the audio information, wherein each frame of the audio frame corresponds to one of the preset time periods.
  5. 根据权利要求1-4任一项所述的方法,其中,所述预设数量的音频帧,包括:第一组音频帧至第M组音频帧;所述预设数目的子振幅调整系数,包括:依次递增或递减的第一子振幅调整系数至第N子振幅调整系数,其中,M和N均为大于或等于1的正整数,且M大于或等于N;The method according to any one of claims 1 to 4, wherein the preset number of audio frames comprises: a first group of audio frames to an Mth group of audio frames; the preset number of sub-amplitude adjustment coefficients, The method includes: a first sub-amplitude adjustment coefficient sequentially increasing or decreasing to a N-th sub-amplitude adjustment coefficient, wherein M and N are both positive integers greater than or equal to 1, and M is greater than or equal to N;
    所述依据所述预设数目的子振幅调整系数对从起始帧开始的预设数量的音频帧进行调整,包括:And adjusting, according to the preset number of sub-amplitude adjustment coefficients, a preset number of audio frames starting from a start frame, including:
    依次使用所述第一子振幅调整系数至所述第N子振幅调整系数对所述第一组音频帧至所述第N组音频帧进行调整。And adjusting the first group of audio frames to the group N audio frames by using the first sub-amplitude adjustment coefficient to the N-th sub-amplitude adjustment coefficient.
  6. 根据权利要求1-5任一项所述的方法,其中,所述预设数目的子振幅调整系数为在所述第一振幅调整系数和所述第二振幅调整系数之间进行等间距划分得到。The method according to any one of claims 1 to 5, wherein the predetermined number of sub-amplitude adjustment coefficients are equally spaced between the first amplitude adjustment coefficient and the second amplitude adjustment coefficient .
  7. 根据权利要求1-6所述的方法,其中,所述多个音频振幅中的每一个音 频振幅对应一个振幅调整系数,每个所述振幅调整系数为依据对应的所述音频振幅的振幅大小确定的。The method according to any one of claims 1-6, wherein each of the plurality of audio amplitudes corresponds to an amplitude adjustment coefficient, each of the amplitude adjustment coefficients being determined according to a magnitude of a corresponding amplitude of the audio amplitude of.
  8. 根据权利要求1-6任一项所述的方法,其中,所述多个音频振幅中的每一个音频振幅对应一个振幅调整系数,每个所述振幅调整系数为依据所述终端设备的音量信息和对应的所述音频振幅的振幅大小,其中,所述音量信息包括音量值信息、音量增加信息或音量减小信息。The method according to any one of claims 1 to 6, wherein each of the plurality of audio amplitudes corresponds to an amplitude adjustment coefficient, and each of the amplitude adjustment coefficients is based on volume information of the terminal device And a corresponding amplitude magnitude of the audio amplitude, wherein the volume information includes volume value information, volume increase information, or volume decrease information.
  9. 根据权利要求1-6任一项所述的方法,其中,所述多个音频振幅中的每一个音频振幅对应一个振幅调整系数,每个所述振幅调整系数为依据对应的所述音频振幅的振幅大小以及以下信息至少之一确定的:所述终端设备的播放器件的阻抗值以及所述终端所处环境的噪声值;The method according to any one of claims 1 to 6, wherein each of the plurality of audio amplitudes corresponds to an amplitude adjustment coefficient, and each of the amplitude adjustment coefficients is based on the corresponding audio amplitude The magnitude of the amplitude and at least one of the following information are determined: an impedance value of the playback device of the terminal device and a noise value of an environment in which the terminal is located;
    或者,所述多个音频振幅中的每一个音频振幅对应一个振幅调整系数,每个所述振幅调整系数为依据所述终端设备的音量信息、对应的所述音频振幅的振幅大小和以及以下信息至少之一确定的:所述终端设备的播放器件的阻抗值以及所述终端所处环境的噪声值,其中,所述音量信息包括音量值信息、音量增加信息或音量减小信息。Alternatively, each of the plurality of audio amplitudes corresponds to an amplitude adjustment coefficient, and each of the amplitude adjustment coefficients is based on volume information of the terminal device, a corresponding amplitude of the audio amplitude, and the following information. And determining at least one of: an impedance value of the playback device of the terminal device and a noise value of an environment in which the terminal is located, wherein the volume information includes volume value information, volume increase information, or volume decrease information.
  10. 一种音量调节装置,包括:A volume adjustment device includes:
    获取模块,设置为当检测到终端设备进行音源播放时,获取所述音源的音频信息;Obtaining a module, configured to acquire audio information of the sound source when detecting that the terminal device performs sound source playing;
    振幅确定模块,设置为依据所述音频信息确定多个预设时间段分别对应的多个音频振幅;The amplitude determining module is configured to determine, according to the audio information, a plurality of audio amplitudes respectively corresponding to the plurality of preset time segments;
    调整系数确定模块,设置为当第一音频振幅对应的第一振幅调整系数和相邻的第二音频振幅对应的第二振幅调整系数不一样时,在所述第一振幅调整系数和所述第二振幅调整系数之间增加预设数目的子振幅调整系数,其中,所述预设数目的子振幅调整系数是在所述第一振幅调整系数和所述第二振幅调整系数之间依次递增或依次递减的;The adjustment coefficient determining module is configured to: when the first amplitude adjustment coefficient corresponding to the first audio amplitude and the second amplitude adjustment coefficient corresponding to the adjacent second audio amplitude are different, the first amplitude adjustment coefficient and the first Adding a preset number of sub-amplitude adjustment coefficients between the two amplitude adjustment coefficients, wherein the preset number of sub-amplitude adjustment coefficients are sequentially increased between the first amplitude adjustment coefficient and the second amplitude adjustment coefficient or Decrement in turn;
    调节模块,设置为依据所述预设数目的子振幅调整系数对从起始帧开始的预设数量的音频帧进行调整,其中,所述起始帧为振幅调整系数由所述第一振幅调整系数变化为所述第二振幅调整系数时的首个音频帧。The adjustment module is configured to adjust, according to the preset number of sub-amplitude adjustment coefficients, a preset number of audio frames from a start frame, wherein the start frame is an amplitude adjustment coefficient adjusted by the first amplitude The first audio frame when the coefficient changes to the second amplitude adjustment coefficient.
  11. 根据权利要求10所述的装置,其中,所述获取模块是设置为:The apparatus of claim 10 wherein said obtaining module is configured to:
    在每个所述预设时间段内对所述音频信息进行至少两次取样获取每个所述预设时间段对应的至少两个音频振幅;Performing at least two samplings on the audio information in each of the preset time periods to obtain at least two audio amplitudes corresponding to each of the preset time periods;
    将每个所述预设时间段各自对应的所述至少两个音频振幅之间的平均振幅确定为每个所述预设时间段对应的音频振幅。The average amplitude between the at least two audio amplitudes corresponding to each of the preset time periods is determined as the audio amplitude corresponding to each of the preset time periods.
  12. 根据权利要求10所述的装置,其中,所述获取模块是设置为:The apparatus of claim 10 wherein said obtaining module is configured to:
    每隔所述预设时间段依据所述音频信息确定一次音频振幅。The audio amplitude is determined once according to the audio information every predetermined period of time.
  13. 根据权利要求10所述的装置,其中,所述获取模块是设置为:The apparatus of claim 10 wherein said obtaining module is configured to:
    依据所述音频信息确定所述音频信息的每一帧音频帧对应的音频振幅,其中,所述每一帧音频帧对应一个所述预设时间段。Determining, according to the audio information, an audio amplitude corresponding to each frame of the audio information, wherein each frame of the audio frame corresponds to one of the preset time periods.
  14. 根据权利要求10-13任一项所述的装置,其中,所述预设数量的音频帧,包括:第一组音频帧至第M组音频帧;所述预设数目的子振幅调整系数,包括:依次递增或递减的第一子振幅调整系数至第N子振幅调整系数,其中,M和N均为大于或等于1的正整数,且M大于或等于N;The apparatus according to any one of claims 10-13, wherein the preset number of audio frames comprises: a first group of audio frames to an Mth group of audio frames; the preset number of sub-amplitude adjustment coefficients, The method includes: a first sub-amplitude adjustment coefficient sequentially increasing or decreasing to a N-th sub-amplitude adjustment coefficient, wherein M and N are both positive integers greater than or equal to 1, and M is greater than or equal to N;
    所述调整模块是设置为:依次使用所述第一子振幅调整系数至所述第N子振幅调整系数对所述第一组音频帧至所述第N组音频帧进行调整。The adjusting module is configured to: adjust the first group of audio frames to the Nth group of audio frames by using the first sub-amplitude adjustment coefficient to the Nth sub-amplitude adjustment coefficient in sequence.
  15. 根据权利要求10-14任一项所述的装置,其中,所述预设数目的子振幅调整系数为在所述第一振幅调整系数和所述第二振幅调整系数之间进行等间距划分得到。The apparatus according to any one of claims 10-14, wherein the predetermined number of sub-amplitude adjustment coefficients are equally spaced between the first amplitude adjustment coefficient and the second amplitude adjustment coefficient .
  16. 根据权利要求10-15任一项所述的装置,其中,所述多个音频振幅中的每一个音频振幅对应一个振幅调整系数,每个所述振幅调整系数为依据对应的所述音频振幅的振幅大小确定的。The apparatus according to any one of claims 10-15, wherein each of the plurality of audio amplitudes corresponds to an amplitude adjustment coefficient, each of the amplitude adjustment coefficients being based on the corresponding audio amplitude The amplitude is determined by the magnitude.
  17. 根据权利要求10-15任一项所述的装置,其中,所述多个音频振幅中的每一个音频振幅对应一个振幅调整系数,每个所述振幅调整系数为依据所述终端设备的音量信息和对应的所述音频振幅的振幅大小,其中,所述音量信息包括音量值信息、音量增加信息或音量减小信息。The apparatus according to any one of claims 10-15, wherein each of the plurality of audio amplitudes corresponds to an amplitude adjustment coefficient, and each of the amplitude adjustment coefficients is based on volume information of the terminal device And a corresponding amplitude magnitude of the audio amplitude, wherein the volume information includes volume value information, volume increase information, or volume decrease information.
  18. 根据权利要求10-15任一项所述的装置,其中,所述多个音频振幅中的每一个音频振幅对应一个振幅调整系数,每个所述振幅调整系数为依据对应的所述音频振幅的振幅大小以及以下信息至少之一确定的:所述终端设备的播放器件的阻抗值以及所述终端所处环境的噪声值;The apparatus according to any one of claims 10-15, wherein each of the plurality of audio amplitudes corresponds to an amplitude adjustment coefficient, each of the amplitude adjustment coefficients being based on the corresponding audio amplitude The magnitude of the amplitude and at least one of the following information are determined: an impedance value of the playback device of the terminal device and a noise value of an environment in which the terminal is located;
    或者,所述多个音频振幅中的每一个音频振幅对应一个振幅调整系数,每个所述振幅调整系数为依据所述终端设备的音量信息、对应的所述音频振幅的振幅大小和以及以下信息至少之一确定的:所述终端设备的播放器件的阻抗值以及所述终端所处环境的噪声值,其中,所述音量信息包括音量值信息、音量增加信息或音量减小信息。Alternatively, each of the plurality of audio amplitudes corresponds to an amplitude adjustment coefficient, and each of the amplitude adjustment coefficients is based on volume information of the terminal device, a corresponding amplitude of the audio amplitude, and the following information. And determining at least one of: an impedance value of the playback device of the terminal device and a noise value of an environment in which the terminal is located, wherein the volume information includes volume value information, volume increase information, or volume decrease information.
  19. 一种终端设备,包括:处理器、存储器以及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如权利要求1-9任一项所述的音量调节方法。A terminal device comprising: a processor, a memory, and a computer program stored on the memory and operable on the processor, the processor executing the computer program to implement the method of any one of claims 1-9 Volume adjustment method.
  20. 一种包含终端设备可执行指令的存储介质,所述终端设备可执行指令在由终端设备处理器执行时用于执行如权利要求1-9任一项所述的音量调节方法。A storage medium comprising terminal device executable instructions for performing the volume adjustment method of any one of claims 1-9 when executed by a terminal device processor.
PCT/CN2018/098653 2017-08-18 2018-08-03 Volume adjustment method and apparatus, terminal device, and storage medium WO2019033942A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710711586.6A CN107436751A (en) 2017-08-18 2017-08-18 volume adjusting method, device, terminal device and storage medium
CN201710711586.6 2017-08-18

Publications (1)

Publication Number Publication Date
WO2019033942A1 true WO2019033942A1 (en) 2019-02-21

Family

ID=60461052

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/098653 WO2019033942A1 (en) 2017-08-18 2018-08-03 Volume adjustment method and apparatus, terminal device, and storage medium

Country Status (2)

Country Link
CN (1) CN107436751A (en)
WO (1) WO2019033942A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107436751A (en) * 2017-08-18 2017-12-05 广东欧珀移动通信有限公司 volume adjusting method, device, terminal device and storage medium
CN109147816B (en) * 2018-06-05 2021-08-24 安克创新科技股份有限公司 Method and equipment for adjusting volume of music
CN110457002B (en) * 2019-07-03 2023-07-25 平安科技(深圳)有限公司 Multimedia file processing method, device and computer storage medium
CN114442990A (en) * 2020-11-04 2022-05-06 北京小米移动软件有限公司 Volume adjusting method and device and storage medium
CN112558916B (en) * 2020-12-24 2024-01-05 阿波罗智联(北京)科技有限公司 Audio adjustment method, device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101478589A (en) * 2009-01-23 2009-07-08 深圳华为通信技术有限公司 Communication terminal and audio gain parameter regulation method
CN101729034A (en) * 2008-10-31 2010-06-09 美商富迪科技股份有限公司 Speech processing apparatus, dynamic range control module, and method for amplitude adjustment for a speech signal
CN101923860A (en) * 2009-06-11 2010-12-22 英华达(南京)科技有限公司 Audio softening system, device and method
US20150043751A1 (en) * 2013-08-06 2015-02-12 Apple Inc. Volume Adjustment Based on User-Defined Curve
US20150098589A1 (en) * 2013-10-08 2015-04-09 Qnx Software Systems Limited System and method for dynamically mixing audio signals
CN107436751A (en) * 2017-08-18 2017-12-05 广东欧珀移动通信有限公司 volume adjusting method, device, terminal device and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103237258A (en) * 2013-03-29 2013-08-07 天脉聚源(北京)传媒科技有限公司 System and method for automatically adjusting video volume
US9794669B2 (en) * 2014-02-11 2017-10-17 Mediatek Inc. Devices and methods for headphone speaker impedance detection
CN106101408A (en) * 2016-06-08 2016-11-09 维沃移动通信有限公司 A kind of mobile terminal and method for regulation of sound volume thereof
CN106775563A (en) * 2016-12-13 2017-05-31 珠海市魅族科技有限公司 The method and device of volume adjusting

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101729034A (en) * 2008-10-31 2010-06-09 美商富迪科技股份有限公司 Speech processing apparatus, dynamic range control module, and method for amplitude adjustment for a speech signal
CN101478589A (en) * 2009-01-23 2009-07-08 深圳华为通信技术有限公司 Communication terminal and audio gain parameter regulation method
CN101923860A (en) * 2009-06-11 2010-12-22 英华达(南京)科技有限公司 Audio softening system, device and method
US20150043751A1 (en) * 2013-08-06 2015-02-12 Apple Inc. Volume Adjustment Based on User-Defined Curve
US20150098589A1 (en) * 2013-10-08 2015-04-09 Qnx Software Systems Limited System and method for dynamically mixing audio signals
CN107436751A (en) * 2017-08-18 2017-12-05 广东欧珀移动通信有限公司 volume adjusting method, device, terminal device and storage medium

Also Published As

Publication number Publication date
CN107436751A (en) 2017-12-05

Similar Documents

Publication Publication Date Title
WO2019033942A1 (en) Volume adjustment method and apparatus, terminal device, and storage medium
WO2019033943A1 (en) Volume adjusting method and device, mobile terminal and storage medium
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
CN107526570B (en) Volume adjusting method and device, terminal equipment and storage medium
CN110799936B (en) Volume adjusting method, volume adjusting device, terminal equipment and storage medium
CN107566618B (en) Volume adjusting method and device, terminal equipment and storage medium
US20100232626A1 (en) Intelligent clip mixing
WO2019033941A1 (en) Volume adjustment method and apparatus, terminal device, and storage medium
JP2019501563A (en) Object-based audio signal balancing method
CN107483734B (en) Volume adjusting method and device, terminal equipment and storage medium
CN107506168B (en) Volume adjusting method and device, terminal equipment and storage medium
WO2019033939A1 (en) Volume adjustment method and apparatus, terminal device, and storage medium
US10277186B2 (en) Calibration method and computer readable recording medium
CN106293607B (en) Method and system for automatically switching audio output modes
CN110753919B (en) Volume adjusting method and device, storage medium and mobile terminal
CN107506170A (en) volume adjusting method, device, terminal device and storage medium
CN107506169A (en) volume adjusting method, device, terminal device and storage medium
CN116627377A (en) Audio processing method, device, electronic equipment and storage medium

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

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

Country of ref document: EP

Kind code of ref document: A1