CN111508520A - Audio gain control method and device, broadcasting terminal and storage medium - Google Patents

Audio gain control method and device, broadcasting terminal and storage medium Download PDF

Info

Publication number
CN111508520A
CN111508520A CN202010249706.7A CN202010249706A CN111508520A CN 111508520 A CN111508520 A CN 111508520A CN 202010249706 A CN202010249706 A CN 202010249706A CN 111508520 A CN111508520 A CN 111508520A
Authority
CN
China
Prior art keywords
gain
pulse code
code modulation
modulation data
audio
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010249706.7A
Other languages
Chinese (zh)
Inventor
孙平海
石振堃
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Dexin Digital Technology Co ltd
Original Assignee
Chengdu Dexin Digital Technology Co ltd
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 Chengdu Dexin Digital Technology Co ltd filed Critical Chengdu Dexin Digital Technology Co ltd
Priority to CN202010249706.7A priority Critical patent/CN111508520A/en
Publication of CN111508520A publication Critical patent/CN111508520A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L21/00Speech or voice signal processing techniques to produce another audible or non-audible signal, e.g. visual or tactile, in order to modify its quality or its intelligibility
    • G10L21/02Speech enhancement, e.g. noise reduction or echo cancellation
    • G10L21/0316Speech enhancement, e.g. noise reduction or echo cancellation by changing the amplitude
    • G10L21/0324Details of processing therefor
    • G10L21/034Automatic adjustment
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03GCONTROL OF AMPLIFICATION
    • H03G3/00Gain control in amplifiers or frequency changers
    • H03G3/20Automatic control

Landscapes

  • Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Quality & Reliability (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (AREA)
  • Control Of Amplification And Gain Control (AREA)

Abstract

The application provides an audio gain control method, an audio gain control device, a broadcast terminal and a storage medium. The method comprises the following steps: receiving audio data sent by broadcast audio equipment; decoding the audio data to generate pulse code modulation data; adjusting the audio gain of the pulse code modulation data according to the difference value between the audio gain of the pulse code modulation data and a preset gain to generate target pulse code modulation data meeting a preset condition; and outputting the target pulse code modulation data. Compared with the prior art, the broadcasting audio equipment and the broadcasting terminal do not need to be matched in advance, and manpower and material resources are saved. In addition, the received audio data are adjusted, so that the audio finally output by the broadcasting terminal is in accordance with expectation, and the power amplifier is ensured to be in a stable state.

Description

Audio gain control method and device, broadcasting terminal and storage medium
Technical Field
The present application relates to the field of broadcast audio technologies, and in particular, to an audio gain control method and apparatus, a broadcast terminal, and a storage medium.
Background
The current emergency broadcasting system, the broadcast sound source is various, and broadcast audio equipment is also various, and different sound sources get into different broadcast audio equipment, and the gain of output is also not of uniform size, and such audio frequency is through different transmission channel to broadcast terminal, and the sound size of broadcast terminal output after decoding is also inconsistent, if sound is too little, and the user listens not clearly, brings the experience of utmost point difference for the user, if sound is too big, causes the power amplifier to burn out again easily. Therefore, in order to avoid such an influence, the present scheme must match various broadcast audio devices and broadcast terminals in the previous project implementation, but this approach takes a lot of time.
Disclosure of Invention
An object of the embodiments of the present application is to provide an audio gain control method, apparatus, broadcast terminal and storage medium, so as to solve the problem that "it takes a lot of time to match various broadcast audio devices and broadcast terminals at present".
The application is realized as follows:
in a first aspect, an embodiment of the present application provides an audio gain control method, which is applied to a broadcast terminal, and includes receiving audio data sent by a broadcast audio device; decoding the audio data to generate pulse code modulation data; adjusting the audio gain of the pulse code modulation data according to the difference value between the audio gain of the pulse code modulation data and a preset gain to generate target pulse code modulation data meeting a preset condition; and outputting the target pulse code modulation data.
In the embodiment of the application, after the broadcast terminal receives the audio data sent by the broadcast audio device and decodes the audio data, the broadcast terminal adjusts the audio gain of the pulse code modulation data according to the difference value between the audio gain of the pulse code modulation data and the preset gain, so that the generated target pulse modulation data meets the preset condition. Compared with the prior art, the broadcasting audio equipment and the broadcasting terminal do not need to be matched in advance, and manpower and material resources are saved. In addition, the received audio data are adjusted, so that the audio finally output by the broadcasting terminal is in accordance with expectation, and the power amplifier is ensured to be in a stable state.
With reference to the technical solution provided by the first aspect, in some possible implementation manners, the adjusting the audio gain of the pulse code modulation data according to a difference between the audio gain of the pulse code modulation data and a preset gain to generate target pulse code modulation data meeting a preset condition includes: dividing the pulse code modulation data into a plurality of sections of sub pulse code modulation data according to a preset time interval; obtaining the average value of the audio gain of the multi-segment sub-pulse code modulation data; and adjusting the audio gain of the multi-segment sub-pulse code modulation data according to the difference value between the average value of the audio gain of the multi-segment sub-pulse code modulation data and a preset gain, and generating target pulse code modulation data meeting preset conditions.
Because the audio gains in different time periods are different, in the embodiment of the application, the average value of the audio gains of the multi-segment sub-pulse code modulation data is obtained; and comparing the average value of the audio gain of the multi-segment sub-pulse code modulation data with the difference value of the preset gain, so that the comparison result is more accurate, and the audio gain of the multi-segment sub-pulse code modulation data is compared with the preset gain conveniently.
With reference to the technical solution provided by the first aspect, in some possible implementation manners, the obtaining an average value of audio gains of the multiple pieces of sub-pulse code modulation data includes: and acquiring the average value of the absolute values of the audio gain of the multi-segment sub-pulse code modulation data.
In the embodiment of the application, the comparison result is more accurate by obtaining the average value of the absolute values of the audio gain of the multi-segment sub-pulse code modulation data.
With reference to the technical solution provided by the first aspect, in some possible implementation manners, the preset gain includes a first preset gain and a second preset gain, and the first preset gain is greater than the second preset gain; the adjusting the audio gain of the pulse code modulation data according to the difference value between the audio gain of the pulse code modulation data and a preset gain to generate target pulse code modulation data meeting a preset condition includes: performing a difference between the audio gain of the pulse code modulation data and the first preset gain and performing a difference between the audio gain of the pulse code modulation data and the second preset gain; if the difference value of the audio gain of the pulse code modulation data minus the first preset gain is larger than zero, reducing the audio gain of the pulse code modulation data, and generating the target pulse code modulation data with the audio gain between the first preset gain and the second preset gain; and if the difference value of the audio gain of the pulse code modulation data minus the second preset gain is smaller than zero, increasing the audio gain of the pulse code modulation data, and generating the target pulse code modulation data with the audio gain between the first preset gain and the second preset gain.
In the embodiment of the present application, a first predetermined gain and a second predetermined gain are predetermined, and the first predetermined gain is greater than the second predetermined gain. If the difference value of the audio gain of the pulse code modulation data minus the first preset gain is larger than zero, reducing the audio gain of the pulse code modulation data, and generating target pulse code modulation data with the audio gain between the first preset gain and the second preset gain; and if the difference value of the audio gain of the pulse code modulation data minus the second preset gain is smaller than zero, increasing the audio gain of the pulse code modulation data, and generating target pulse code modulation data with the audio gain between the first preset gain and the second preset gain. And then guaranteed that the audio gain of the target pulse code modulation data of final output is in a reasonable scope, neither can be too little, bring very poor experience for the user, also can not too big, lead to burning out of power amplifier.
With reference to the technical solution provided by the first aspect, in some possible implementations, the reducing the audio gain of the pulse code modulation data includes: multiplying an audio gain of the pulse code modulation data by a first preset coefficient; wherein the first preset coefficient is less than 1; the increasing the audio gain of the pulse code modulation data comprises: multiplying an audio gain of the pulse code modulation data by a second preset coefficient; wherein the second predetermined coefficient is greater than 1.
In the embodiment of the application, the audio gain of the pulse code modulation data is simultaneously multiplied by a preset coefficient, so that the audio gain of the pulse code modulation data is increased in the same proportion, and the effect of the output target pulse code modulation data is ensured to be consistent with the actual effect.
With reference to the technical solution provided by the first aspect, in some possible implementation manners, the adjusting the audio gain of the pulse code modulation data according to a difference between the audio gain of the pulse code modulation data and a preset gain to generate target pulse code modulation data meeting a preset condition includes: performing difference on the audio gain of the pulse code modulation data and a preset gain; and if the difference value of the audio gain of the pulse code modulation data minus the preset gain is larger than zero, reducing the audio gain of the pulse code modulation data, and generating the target pulse code modulation data with the audio gain smaller than the preset gain.
In the embodiment of the application, the difference is made between the audio gain of the pulse code modulation data and the preset gain; and if the difference value of subtracting the preset gain from the audio gain of the pulse code modulation data is larger than zero, reducing the audio gain of the pulse code modulation data, and generating target pulse code modulation data of which the audio gain is smaller than the preset gain. And further, the audio gain of the finally output target pulse code modulation data is not too large, so that the power amplifier is not burnt.
With reference to the technical solution provided by the first aspect, in some possible implementation manners, the adjusting the audio gain of the pulse code modulation data according to a difference between the audio gain of the pulse code modulation data and a preset gain to generate target pulse code modulation data includes: performing difference on the audio gain of the pulse code modulation data and a preset gain; and if the difference value of the audio gain of the pulse code modulation data minus the preset gain is smaller than zero, increasing the audio gain of the pulse code modulation data, and generating the target pulse code modulation data with the audio gain larger than the preset gain.
In the embodiment of the application, the difference is made between the audio gain of the pulse code modulation data and the preset gain; and if the difference value of the audio gain of the pulse code modulation data minus the preset gain is smaller than zero, increasing the audio gain of the pulse code modulation data and generating the target pulse code modulation data of which the audio gain is larger than the preset gain. And further, the audio gain of the finally output target pulse code modulation data is not too small, and poor experience is brought to a user.
In a second aspect, an embodiment of the present application provides an audio gain control apparatus, which is applied to a broadcast terminal, and includes a receiving module, configured to receive audio data sent by a broadcast audio device; the decoding module is used for decoding the audio data to generate pulse code modulation data; the adjusting module is used for adjusting the audio gain of the pulse code modulation data according to the difference value between the audio gain of the pulse code modulation data and a preset gain to generate target pulse code modulation data meeting a preset condition; and the output module is used for outputting the target pulse code modulation data.
In a third aspect, an embodiment of the present application provides a broadcast terminal, including: a processor and a memory, the processor and the memory connected; the memory is used for storing programs; the processor is configured to invoke a program stored in the memory to perform a method as provided in the above-described first aspect embodiment and/or in combination with some possible implementations of the above-described first aspect embodiment.
In a fourth aspect, embodiments of the present application provide a storage medium having stored thereon a computer program, which, when executed by a processor, performs a method as provided in the above-described first aspect embodiment and/or in connection with some possible implementations of the above-described first aspect embodiment.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic structural diagram of an emergency broadcast system according to an embodiment of the present application.
Fig. 2 is a schematic structural diagram of a broadcast terminal according to an embodiment of the present application.
Fig. 3 is a flowchart illustrating steps of an audio gain control method according to an embodiment of the present disclosure.
Fig. 4 is a block diagram of an audio gain control apparatus according to an embodiment of the present disclosure.
Icon: 100-emergency broadcast system; 110-emergency broadcast platform; 120-broadcast audio equipment; 121-an adapter; 122-encoding controller; 123-a signal transmitter; 130-a broadcast terminal; 131-a processor; 132-a memory; 133-a communication module; 134-a communication bus; 135-a loudspeaker; 200-audio gain control means; 201-a receiving module; 202-a decoding module; 203-a regulation module; 204-output module.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
Because present emergency broadcasting system, the broadcast sound source is various, and broadcast audio equipment is also various, and different sound sources get into different broadcast audio equipment, and the gain of output is also not of uniform size, and such audio frequency is through different transmission channel to broadcast terminal, and the sound size of output after broadcast terminal decodes is also inconsistent, if sound is too little, the user listens not clearly, brings very poor experience for the user, if sound is too big, causes the power amplifier to burn out again easily. Therefore, in order to avoid such an influence, the present scheme must match various broadcast audio devices and broadcast terminals in the previous project implementation, but this approach takes a lot of time.
In view of the above problems, the present inventors have studied and researched to provide the following embodiments to solve the above problems.
Referring to fig. 1, an emergency broadcast system 100 according to an embodiment of the present invention includes an emergency broadcast platform 110, a broadcast audio device 120, and a broadcast terminal 130.
Wherein the emergency broadcast platform 110 is communicatively coupled to the broadcast audio device 120. The emergency broadcast platform 110 is configured to acquire a broadcast source and transmit the broadcast source to the broadcast audio device 120. The broadcast audio device 120 is configured to generate a data packet according to a broadcast source and transmit the data packet to the broadcast terminal 130 by wireless. It should be noted that, the broadcast audio device 120 and the broadcast terminal 130 are in one-way transmission.
Optionally, the broadcast audio device 120 includes an adapter 121, a coding controller 122, and a signal transmitter 123. The adapter 121 is communicatively coupled to the emergency broadcast platform 110. The encoding controller 122 is connected to the adapter 121 and the signal transmitter 123, respectively. The adapter 121 is configured to receive a broadcast source of the emergency broadcast platform 110, and send the broadcast source to the encoding controller 122. The encoding controller 122 is configured to generate a data packet according to a broadcast source, and transmit the data packet to the signal transmitter 123. The signal transmitter 123 is used to transmit the data packet to the broadcasting terminal 130 by radio.
Alternatively, the encoding controller may be an RDS (radio digital system) encoding controller. Alternatively, the emergency broadcasting system 100 may also be applied to DVBC (Digital video broadcasting) or DTMB (Digital television broadcasting). The present application is not limited thereto.
It should be noted that the above-mentioned adapter 121 is an emergency broadcast adapter, and the emergency broadcast adapter is a device for receiving, parsing and verifying a broadcast sound source, and performing transmission protocol conversion. The emergency broadcast adapter may be of the type TC-1602B or WES 270. The present application is not limited thereto.
The specific transmission process of the emergency broadcast is as follows: first, the emergency broadcast platform 110 acquires a broadcast source, and then the emergency broadcast platform sends the broadcast source to the broadcast audio device 120. The adaptor 121 in the broadcast audio device 120 receives a broadcast source of the emergency broadcast platform and transmits the broadcast source to the encoding controller 122. The encoding controller 122 generates a packet according to the received broadcast source and transmits the packet to the signal transmitter 123. Finally, the signal transmitter 123 transmits the data packet to the broadcasting terminal 130 by radio.
It is understood that fig. 1 only shows a partial structural schematic diagram of the emergency broadcast system 100, and in other possible implementations, the emergency broadcast system 100 may further include more or fewer constituent modules than the embodiment of the present application. Therefore, the structure of the emergency broadcast system 100 shown in fig. 1 should not be taken as limiting the present application.
Referring to fig. 2, an embodiment of the present invention provides a broadcast terminal 130. In the embodiment of the present application, the broadcast terminal 130 may be a radio, a car radio, a smart phone, a computer, a Personal digital assistant (PAD), and the like.
Structurally, the broadcast terminal 130 includes: a processor 131, a memory 132, a communication module 133, a communication bus 134, and a speaker 135. The communication bus 134 is used for realizing communication among the processor 131, the memory 132, the communication module 133 and the speaker 135. The communication module 133 is configured to communicatively couple with the broadcast audio device 120. The communication module 133 may be a wireless receiving module. The memory 132 is used to store programs. The processor 131 is used to call a program stored in the memory 132. Specifically, the processor 131 is configured to call a program stored in the memory 132 to implement receiving audio data sent by the broadcast audio device; decoding the audio data to generate pulse code modulation data; adjusting the audio gain of the pulse code modulation data according to the difference value between the audio gain of the pulse code modulation data and a preset gain to generate target pulse code modulation data meeting a preset condition; and outputting the target pulse code modulation data. The speaker 135 is used to play the target pulse code modulation data.
The processor 131 may be an integrated circuit chip having signal processing capabilities. The Processor 131 may also be a general-purpose Processor, for example, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a discrete gate or transistor logic device, or a discrete hardware component, which can implement or execute the methods, steps, and logic blocks disclosed in the embodiments of the present Application. Further, a general purpose processor may be a microprocessor or any conventional processor or the like.
The Memory 132 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), and an electrically Erasable Programmable Read-Only Memory (EEPROM).
It should be understood that the structure shown in fig. 2 is merely an illustration, and the broadcast terminal 130 provided in the embodiment of the present application may have fewer or more components than those in fig. 2, or may have a different configuration from that shown in fig. 2. Further, the components shown in fig. 2 may be implemented by software, hardware, or a combination thereof.
Referring to fig. 3, an embodiment of the present application provides an audio gain control method. The method is applied to the broadcasting terminal 130 as shown in fig. 2. The method comprises the following steps: step S101-step S104.
Step S101: and receiving audio data sent by the broadcast audio equipment.
Step S102: and decoding the audio data to generate pulse code modulation data.
Step S103: and adjusting the audio gain of the pulse code modulation data according to the difference value between the audio gain of the pulse code modulation data and a preset gain to generate target pulse code modulation data meeting preset conditions.
Step S104: and outputting the target pulse code modulation data.
In the embodiment of the application, after the broadcast terminal receives the audio data sent by the broadcast audio device and decodes the audio data, the broadcast terminal adjusts the audio gain of the pulse code modulation data according to the difference value between the audio gain of the pulse code modulation data and the preset gain, so that the generated target pulse modulation data meets the preset condition. Compared with the prior art, the broadcasting audio equipment and the broadcasting terminal do not need to be matched in advance, and manpower and material resources are saved. In addition, the received audio data are adjusted, so that the audio finally output by the broadcasting terminal is in accordance with expectation, and the power amplifier is ensured to be in a stable state.
The specific flow and steps of the above method are described below with reference to specific examples.
Step S101, receiving audio data sent by broadcast audio equipment.
The broadcast terminal receives the audio data sent by the broadcast audio equipment through the communication module. Wherein, the broadcast audio equipment and the broadcast terminal are in one-way transmission. That is, the audio data is transmitted from the broadcast audio equipment to the broadcast terminal.
Step S102: and decoding the audio data to generate pulse code modulation data.
After receiving the audio data, the broadcast terminal decodes the audio data to generate Pulse Code Modulation (PCM) data. Pulse code modulation is one of the coding schemes for digital communications. The main process is to sample the analog signals of voice, image, etc. at regular intervals to make them discretize, at the same time, to round the sampled values by hierarchical unit to make them be rounded and quantized, and at the same time, to express the amplitude of sampled pulse by a group of binary codes. It should be noted that, since pulse code modulation is well known in the art, the embodiments of the present application are not described in detail.
Step S103: and adjusting the audio gain of the pulse code modulation data according to the difference value between the audio gain of the pulse code modulation data and a preset gain to generate target pulse code modulation data meeting preset conditions.
Since the audio gains of different time periods are different, step S103 may optionally include splitting the pulse code modulation data into multiple segments of sub-pulse code modulation data according to a preset time interval. The average value of the audio gain of the multi-segment sub-pulse code modulation data is obtained, the audio gain of the multi-segment sub-pulse code modulation data is adjusted according to the difference value of the average value of the audio gain of the multi-segment sub-pulse code modulation data and the preset gain, and target pulse code modulation data meeting the preset conditions are generated.
In the embodiment of the present application, the predetermined time interval is 10 milliseconds. Of course, in other embodiments, the preset time interval may be 20 ms, 30 ms. The predetermined gain may be 30 db or 40 db. The present application is not limited to this.
For example, the pulse code modulation data is divided into 3 segments of sub-pulse code modulation data according to a time interval of 10 milliseconds. The audio gain of the sub-pulse code modulation data a is 20, the audio gain of the sub-pulse code modulation data B is 14, and the audio gain of the sub-pulse code modulation data C is 11. And acquiring the average value of the audio gain of the sub-pulse code modulation data A, the sub-pulse code modulation data B and the sub-pulse code modulation data C. The average 15 of the audio gains of the three is calculated. If the preset gain is 30, adjusting the audio gain of the multi-segment sub-pulse code modulation data according to the difference value between the average value of the audio gain of the sub-pulse code modulation data A, the audio gain of the sub-pulse code modulation data B and the audio gain of the sub-pulse code modulation data C and the preset gain, and generating target pulse code modulation data meeting the preset condition.
In the embodiment of the application, the average value of the audio gain of the multi-segment sub-pulse code modulation data is obtained; and comparing the average value of the audio gain of the multi-segment sub-pulse code modulation data with the difference value of the preset gain, so that the comparison result is more accurate, and the audio gain of the multi-segment sub-pulse code modulation data is compared with the preset gain conveniently.
Optionally, in order to make the comparison result of the difference between the average value of the audio gains of the multiple pieces of sub pulse code modulation data and the preset gain more accurate, when obtaining the average value of the audio gains of the multiple pieces of sub pulse code modulation data, the average value of the absolute values of the audio gains of the multiple pieces of sub pulse code modulation data is obtained.
As an optional adjustment manner, the preset gain includes a first preset gain and a second preset gain, and the first preset gain is greater than the second preset gain. The step S103 may include: and subtracting the audio gain of the pulse code modulation data from the first preset gain and subtracting the audio gain of the pulse code modulation data from the second preset gain. And if the difference value of subtracting the first preset gain from the audio gain of the pulse code modulation data is larger than zero, reducing the audio gain of the pulse code modulation data, and generating target pulse code modulation data with the audio gain between the first preset gain and the second preset gain. And if the difference value of subtracting a second preset gain from the audio gain of the pulse code modulation data is less than zero, increasing the audio gain of the pulse code modulation data, and generating target pulse code modulation data with the audio gain between the first preset gain and the second preset gain.
For example, the first predetermined gain is 55 db, and the second predetermined gain is 25 db. The audio gain of the pulse code modulation data is compared with a first preset gain and a second preset gain respectively. For example, the audio gain of the pulse code modulated data is 60 db. And subtracting the audio gain of the pulse code modulation data from the first preset gain, wherein the difference value between the audio gain of the pulse code modulation data and the first preset gain is 5, and if the difference value is greater than zero, the audio gain of the pulse code modulation data is reduced, and the target pulse code modulation data with the audio gain between the first preset gain and the second preset gain is generated. For another example, the audio gain of the pulse code modulated data is 10 db. And subtracting the audio gain of the pulse code modulation data from the first preset gain to obtain a difference value of-45, if the difference value is smaller than zero, subtracting the first preset gain from the audio gain of the pulse code modulation data to obtain a difference value of-15, if the difference value is smaller than zero, increasing the audio gain of the pulse code modulation data to obtain the target pulse code modulation data with the audio gain between the first preset gain and the second preset gain. For another example, if the audio gain of the pulse code modulation data is 40 db, the difference between the audio gain of the pulse code modulation data and the first preset gain is smaller than zero, and the difference between the audio gain of the pulse code modulation data and the second preset gain is greater than zero, the audio gain of the pulse code modulation data does not need to be adjusted.
It should be noted that the audio gain of the pcm data may be first subtracted from the first preset gain, and then the audio gain of the pcm data may be subtracted from the second preset gain. Or the audio gain of the pulse code modulation data may be subtracted from the second preset gain, and then the audio gain of the pulse code modulation data may be subtracted from the first preset gain.
Optionally, if the audio gain of the pulse code modulation data is different from the first preset gain, when the difference value obtained by subtracting the first preset gain from the audio gain of the pulse code modulation data is greater than zero, the audio gain is directly adjusted without determining the difference value between the audio gain of the pulse code modulation data and the second preset gain. If the audio gain of the pulse code modulation data is different from the second preset gain, when the difference value of the audio gain of the pulse code modulation data minus the second preset gain is smaller than zero, the audio gain is directly adjusted without judging the difference value of the audio gain of the pulse code modulation data and the first preset gain.
Optionally, reducing the audio gain of the pulse code modulated data comprises: the audio gain of the pulse code modulation data is multiplied by a first preset coefficient. Wherein the first predetermined factor is less than 1.
The first predetermined coefficient may be a decimal or a percentage, for example, the first predetermined coefficient may be 0.9, 0.8, or 80%, 70%. For example, the first predetermined coefficient may be 0.9, and the audio gain of the pcm data is 80 db, reducing the audio gain of the pcm data is to multiply the audio gain of the pcm data by 80 db by the first predetermined coefficient 0.9.
Accordingly, increasing the audio gain of pulse code modulated data comprises: the audio gain of the pulse code modulation data is multiplied by a second preset coefficient. Wherein the second predetermined coefficient is greater than 1.
The second predetermined coefficient may be a decimal or a percentage, for example, the second predetermined coefficient may be 1.1, 1.2, or 120% or 130%. For example, the second preset coefficient may be 120%, and the audio gain of the pcm data is 20 db, increasing the audio gain of the pcm data is to multiply the audio gain of the pcm data by 20 db and the second preset coefficient by 120%.
In the embodiment of the application, the audio gain of the pulse code modulation data is simultaneously multiplied by a preset coefficient, so that the audio gain of the pulse code modulation data is increased in the same proportion, and the effect of the output target pulse code modulation data is ensured to be consistent with the actual effect.
It should be noted that the adjusting process is a cyclic process, for example, if a difference between the audio gain of the pulse code modulation data and the first preset gain is greater than zero, the audio gain of the pulse code modulation data is reduced (for example, the audio gain of the pulse code modulation data is multiplied by a first preset coefficient), then the audio gain of the reduced pulse code modulation data is subtracted from the first preset gain, and if the difference between the audio gain of the reduced pulse code modulation data and the first preset gain is still greater than zero, the audio gain of the pulse code modulation data is continuously reduced until the target pulse code modulation data with the audio gain between the first preset gain and the second preset gain is generated. Similarly, the process of increasing the audio gain of the pulse code modulated data is also the same, and will not be repeated here to avoid redundancy.
Of course, in other embodiments, the audio gain of the pcm data may be reduced by a predetermined value, for example, the predetermined value is 5, and the audio gain of the pcm data is 80 db, and then the audio gain of the pcm data is reduced by subtracting the predetermined value 5 from the audio gain of the pcm data by 80 db. Correspondingly, the audio gain of the pcm data may be increased by a preset value, for example, the preset value is 10, and the audio gain of the pcm data is 25 db, and then the audio gain of the pcm data is increased by adding the preset value 10 to the audio gain of the pcm data by 20 db. The present application is not limited thereto.
In the embodiment of the present application, a first predetermined gain and a second predetermined gain are predetermined, and the first predetermined gain is greater than the second predetermined gain. If the difference value of the audio gain of the pulse code modulation data minus the first preset gain is larger than zero, reducing the audio gain of the pulse code modulation data, and generating target pulse code modulation data with the audio gain between the first preset gain and the second preset gain; and if the difference value of the audio gain of the pulse code modulation data minus the second preset gain is smaller than zero, increasing the audio gain of the pulse code modulation data, and generating target pulse code modulation data with the audio gain between the first preset gain and the second preset gain. And then guaranteed that the audio gain of the target pulse code modulation data of final output is in a reasonable scope, neither can be too little, bring very poor experience for the user, also can not too big, lead to burning out of power amplifier.
As another optional adjustment manner, the step S103 may include: performing difference on the audio gain of the pulse code modulation data and a preset gain; and if the difference value of subtracting the preset gain from the audio gain of the pulse code modulation data is larger than zero, reducing the audio gain of the pulse code modulation data, and generating the target pulse code modulation data with the audio gain smaller than the preset gain.
For example, the preset gain is 55 db, and the audio gain of the pcm data is 70 db. And comparing the audio gain of the pulse code modulation data with a preset gain respectively. That is, the audio gain of the pulse code modulation data is subtracted from the preset gain, the difference value between the audio gain of the pulse code modulation data and the first preset gain is 15, and if the difference value is greater than zero, the audio gain of the pulse code modulation data is reduced until the target pulse code modulation data with the audio gain smaller than the preset gain is generated.
It is understood that the specific process of reducing the audio gain of the pulse code modulation data can refer to the first adjustment method described above, and will not be repeated herein to avoid redundancy.
In the embodiment of the application, the difference is made between the audio gain of the pulse code modulation data and the preset gain; and if the difference value of subtracting the preset gain from the audio gain of the pulse code modulation data is larger than zero, reducing the audio gain of the pulse code modulation data, and generating target pulse code modulation data of which the audio gain is smaller than the preset gain. And further, the audio gain of the finally output target pulse code modulation data is not too large, so that the power amplifier is not burnt.
As another optional adjustment manner, the step S103 may include: performing difference on the audio gain of the pulse code modulation data and a preset gain; and if the difference value of the audio gain of the pulse code modulation data minus the preset gain is smaller than zero, increasing the audio gain of the pulse code modulation data, and generating the target pulse code modulation data with the audio gain larger than the preset gain.
For example, the preset gain is 30 db, and the audio gain of the pcm data is 20 db. And comparing the audio gain of the pulse code modulation data with a preset gain respectively. That is, the audio gain of the pulse code modulation data is subtracted from the preset gain, the difference value between the audio gain of the pulse code modulation data and the first preset gain is-10, and if the difference value is smaller than zero, the audio gain of the pulse code modulation data is increased until the target pulse code modulation data with the audio gain larger than the preset gain is generated.
It is understood that the specific process of increasing the audio gain of the pulse code modulation data can refer to the first adjustment method described above, and will not be repeated herein to avoid redundancy.
It should be noted that, if the pulse code modulation data includes multiple pieces of sub-pulse code modulation data, the adjustment of the audio gain of the multiple pieces of sub-pulse code modulation data may refer to the adjustment of the audio gain of the pulse code modulation data described above. For example, the audio gain of the pulse code modulation data is reduced by multiplying the audio gain of each segment of the sub-pulse code modulation data by a first preset coefficient.
In the embodiment of the application, the difference is made between the audio gain of the pulse code modulation data and the preset gain; and if the difference value of the audio gain of the pulse code modulation data minus the preset gain is smaller than zero, increasing the audio gain of the pulse code modulation data and generating the target pulse code modulation data of which the audio gain is larger than the preset gain. And further, the audio gain of the finally output target pulse code modulation data is not too small, and poor experience is brought to a user.
Step S104: and outputting the target pulse code modulation data.
And finally, outputting the target pulse code modulation data generated after the mediation. And playing through a loudspeaker of the broadcast terminal.
Referring to fig. 4, based on the same inventive concept, an audio gain control apparatus 200 according to an embodiment of the present application further includes a receiving module 201, a decoding module 202, an adjusting module 203, and an output module 204.
The receiving module 201 is configured to receive audio data sent by a broadcast audio device.
And the decoding module 202 is configured to decode the audio data to generate pulse code modulation data.
The adjusting module 203 is configured to adjust the audio gain of the pulse code modulation data according to a difference between the audio gain of the pulse code modulation data and a preset gain, and generate target pulse code modulation data meeting a preset condition.
And the output module 204 is configured to output the target pulse code modulation data.
Optionally, the adjusting module 203 is further configured to split the pulse code modulation data into multiple segments of sub-pulse code modulation data according to a preset time interval; obtaining the average value of the audio gain of the multi-segment sub-pulse code modulation data; and adjusting the audio gain of the multi-segment sub-pulse code modulation data according to the difference value between the average value of the audio gain of the multi-segment sub-pulse code modulation data and a preset gain, and generating target pulse code modulation data meeting preset conditions.
Optionally, the adjusting module 203 is further configured to obtain an average value of absolute values of audio gains of the multiple pieces of sub-pulse code modulation data.
Optionally, the preset gain includes a first preset gain and a second preset gain, and the first preset gain is greater than the second preset gain. The adjusting module 203 is further configured to perform a difference between the audio gain of the pulse code modulation data and the first preset gain, and perform a difference between the audio gain of the pulse code modulation data and the second preset gain; if the difference value of the audio gain of the pulse code modulation data minus the first preset gain is larger than zero, reducing the audio gain of the pulse code modulation data, and generating the target pulse code modulation data with the audio gain between the first preset gain and the second preset gain; and if the difference value of the audio gain of the pulse code modulation data minus the second preset gain is smaller than zero, increasing the audio gain of the pulse code modulation data, and generating the target pulse code modulation data with the audio gain between the first preset gain and the second preset gain.
Optionally, the adjusting module 203 is further configured to multiply the audio gain of the pulse code modulation data by a first preset coefficient; wherein the first predetermined coefficient is less than 1; or multiplying the audio gain of the pulse code modulation data by a second preset coefficient; wherein the second predetermined factor is greater than 1.
Optionally, the adjusting module 203 is further configured to perform a difference between an audio gain of the pulse code modulation data and a preset gain; and if the difference value of the audio gain of the pulse code modulation data minus the preset gain is larger than zero, reducing the audio gain of the pulse code modulation data, and generating the target pulse code modulation data with the audio gain smaller than the preset gain.
Optionally, the adjusting module 203 is further configured to perform a difference between an audio gain of the pulse code modulation data and a preset gain; and if the difference value of the audio gain of the pulse code modulation data minus the preset gain is smaller than zero, increasing the audio gain of the pulse code modulation data, and generating the target pulse code modulation data with the audio gain larger than the preset gain.
It should be noted that, as those skilled in the art can clearly understand, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Based on the same inventive concept, the present application further provides a storage medium, on which a computer program is stored, and when the computer program is executed, the computer program performs the method provided in the foregoing embodiments.
The storage medium may be any available medium that can be accessed by a computer or a data storage device including one or more integrated servers, data centers, and the like. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
In addition, units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
Furthermore, the functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. An audio gain control method applied to a broadcast terminal, the method comprising:
receiving audio data sent by broadcast audio equipment;
decoding the audio data to generate pulse code modulation data;
adjusting the audio gain of the pulse code modulation data according to the difference value between the audio gain of the pulse code modulation data and a preset gain to generate target pulse code modulation data meeting a preset condition;
and outputting the target pulse code modulation data.
2. The audio gain control method according to claim 1, wherein the adjusting the audio gain of the pulse code modulation data according to the difference between the audio gain of the pulse code modulation data and a preset gain to generate target pulse code modulation data meeting a preset condition comprises:
dividing the pulse code modulation data into a plurality of sections of sub pulse code modulation data according to a preset time interval; obtaining the average value of the audio gain of the multi-segment sub-pulse code modulation data;
and adjusting the audio gain of the multi-segment sub-pulse code modulation data according to the difference value between the average value of the audio gain of the multi-segment sub-pulse code modulation data and a preset gain, and generating target pulse code modulation data meeting preset conditions.
3. The audio gain control method of claim 2, wherein the obtaining the average value of the audio gains of the plurality of pieces of sub-pulse code modulation data comprises:
and acquiring the average value of the absolute values of the audio gain of the multi-segment sub-pulse code modulation data.
4. The audio gain control method of claim 1, wherein the predetermined gain comprises a first predetermined gain and a second predetermined gain, the first predetermined gain being greater than the second predetermined gain; the adjusting the audio gain of the pulse code modulation data according to the difference value between the audio gain of the pulse code modulation data and a preset gain to generate target pulse code modulation data meeting a preset condition includes:
performing a difference between the audio gain of the pulse code modulation data and the first preset gain and performing a difference between the audio gain of the pulse code modulation data and the second preset gain;
if the difference value of the audio gain of the pulse code modulation data minus the first preset gain is larger than zero, reducing the audio gain of the pulse code modulation data, and generating the target pulse code modulation data with the audio gain between the first preset gain and the second preset gain;
and if the difference value of the audio gain of the pulse code modulation data minus the second preset gain is smaller than zero, increasing the audio gain of the pulse code modulation data, and generating the target pulse code modulation data with the audio gain between the first preset gain and the second preset gain.
5. The audio gain control method of claim 4, wherein the reducing the audio gain of the pulse code modulation data comprises:
multiplying an audio gain of the pulse code modulation data by a first preset coefficient; wherein the first preset coefficient is less than 1;
the increasing the audio gain of the pulse code modulation data comprises:
multiplying an audio gain of the pulse code modulation data by a second preset coefficient; wherein the second predetermined coefficient is greater than 1.
6. The audio gain control method according to claim 1, wherein the adjusting the audio gain of the pulse code modulation data according to the difference between the audio gain of the pulse code modulation data and a preset gain to generate target pulse code modulation data meeting a preset condition comprises:
performing difference on the audio gain of the pulse code modulation data and a preset gain;
and if the difference value of the audio gain of the pulse code modulation data minus the preset gain is larger than zero, reducing the audio gain of the pulse code modulation data, and generating the target pulse code modulation data with the audio gain smaller than the preset gain.
7. The audio gain control method of claim 1, wherein the adjusting the audio gain of the pulse code modulation data according to the difference between the audio gain of the pulse code modulation data and a preset gain to generate target pulse code modulation data comprises:
performing difference on the audio gain of the pulse code modulation data and a preset gain;
and if the difference value of the audio gain of the pulse code modulation data minus the preset gain is smaller than zero, increasing the audio gain of the pulse code modulation data, and generating the target pulse code modulation data with the audio gain larger than the preset gain.
8. An audio gain control apparatus, applied to a broadcasting terminal, the apparatus comprising:
the receiving module is used for receiving audio data sent by the broadcast audio equipment;
the decoding module is used for decoding the audio data to generate pulse code modulation data;
the adjusting module is used for adjusting the audio gain of the pulse code modulation data according to the difference value between the audio gain of the pulse code modulation data and a preset gain to generate target pulse code modulation data meeting a preset condition;
and the output module is used for outputting the target pulse code modulation data.
9. A broadcast terminal, comprising: a processor and a memory, the processor and the memory connected;
the memory is used for storing programs;
the processor is configured to execute a program stored in the memory to perform the method of any of claims 1-7.
10. A storage medium, having stored thereon a computer program which, when executed by a computer, performs the method of any one of claims 1-7.
CN202010249706.7A 2020-04-01 2020-04-01 Audio gain control method and device, broadcasting terminal and storage medium Pending CN111508520A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010249706.7A CN111508520A (en) 2020-04-01 2020-04-01 Audio gain control method and device, broadcasting terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010249706.7A CN111508520A (en) 2020-04-01 2020-04-01 Audio gain control method and device, broadcasting terminal and storage medium

Publications (1)

Publication Number Publication Date
CN111508520A true CN111508520A (en) 2020-08-07

Family

ID=71877424

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010249706.7A Pending CN111508520A (en) 2020-04-01 2020-04-01 Audio gain control method and device, broadcasting terminal and storage medium

Country Status (1)

Country Link
CN (1) CN111508520A (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101409807A (en) * 2008-11-03 2009-04-15 康佳集团股份有限公司 Intelligent control method for television volume
CN102255607A (en) * 2010-05-17 2011-11-23 腾讯科技(深圳)有限公司 Method for adjusting output volume and system thereof
CN102355562A (en) * 2011-09-16 2012-02-15 青岛海信移动通信技术股份有限公司 Volume control method and equipment
CN102547523A (en) * 2011-12-15 2012-07-04 无锡中星微电子有限公司 Volume adjusting method and device
CN103716568A (en) * 2013-12-27 2014-04-09 乐视致新电子科技(天津)有限公司 Television volume adjustment method and system
CN104364848A (en) * 2012-06-08 2015-02-18 三星电子株式会社 Apparatus and method for adjusting volume in a terminal
CN104486668A (en) * 2014-11-20 2015-04-01 深圳市金立通信设备有限公司 Volume adjustment method
CN105375896A (en) * 2014-08-29 2016-03-02 中兴通讯股份有限公司 Method for automatically adjusting volume and electronic equipment
CN107124149A (en) * 2017-05-05 2017-09-01 北京小鱼在家科技有限公司 A kind of method for regulation of sound volume, device and equipment
CN108882115A (en) * 2017-05-12 2018-11-23 华为技术有限公司 loudness adjusting method, device and terminal

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101409807A (en) * 2008-11-03 2009-04-15 康佳集团股份有限公司 Intelligent control method for television volume
CN102255607A (en) * 2010-05-17 2011-11-23 腾讯科技(深圳)有限公司 Method for adjusting output volume and system thereof
CN102355562A (en) * 2011-09-16 2012-02-15 青岛海信移动通信技术股份有限公司 Volume control method and equipment
CN102547523A (en) * 2011-12-15 2012-07-04 无锡中星微电子有限公司 Volume adjusting method and device
CN104364848A (en) * 2012-06-08 2015-02-18 三星电子株式会社 Apparatus and method for adjusting volume in a terminal
CN103716568A (en) * 2013-12-27 2014-04-09 乐视致新电子科技(天津)有限公司 Television volume adjustment method and system
CN105375896A (en) * 2014-08-29 2016-03-02 中兴通讯股份有限公司 Method for automatically adjusting volume and electronic equipment
CN104486668A (en) * 2014-11-20 2015-04-01 深圳市金立通信设备有限公司 Volume adjustment method
CN107124149A (en) * 2017-05-05 2017-09-01 北京小鱼在家科技有限公司 A kind of method for regulation of sound volume, device and equipment
CN108882115A (en) * 2017-05-12 2018-11-23 华为技术有限公司 loudness adjusting method, device and terminal

Similar Documents

Publication Publication Date Title
US8310965B1 (en) Buffered audio system with synchronizing bus controller
CN108616800B (en) Audio playing method and device, storage medium and electronic device
KR101476138B1 (en) Method of Setting Configuration of Codec and Codec using the same
CN112130616B (en) Clock synchronization method, device and storage medium
US20230069653A1 (en) Audio Transmission Method and Electronic Device
CN112887429A (en) Data transmission method and device, electronic equipment and storage medium
CN117278775A (en) Method and device for transmitting audio data, electronic equipment and audio playing equipment
CN111768790B (en) Method and device for transmitting voice data
US20100324911A1 (en) Cvsd decoder state update after packet loss
CN111508520A (en) Audio gain control method and device, broadcasting terminal and storage medium
CN110149631B (en) Method and system suitable for cloud loudspeaker box connection establishment
CN106412767B (en) Sound mixing method and sound mixing circuit
RU2492579C2 (en) Device for embedding digital information into audio signal
KR101904422B1 (en) Method of Setting Configuration of Codec and Codec using the same
CN112423197A (en) Method and device for realizing multipath Bluetooth audio output
CN113347614A (en) Audio processing apparatus, system and method
US10009130B1 (en) Internet radio stream generation
US11935546B2 (en) Transmission error robust ADPCM compressor with enhanced response
CN112291660B (en) Equalizer switching method, device, equipment and storage medium
CN116155425B (en) Instruction sound eliminating method and system for medium wave emergency broadcast
CN112188480B (en) Method, device and storage medium for OTA (over the air) upgrade of Bluetooth equipment by utilizing LC3 audio codec
US11567894B1 (en) Concurrent transmission of audio and ultrasound
CN107680607B (en) Signal compression method, signal decompression method and device thereof
RU2554507C2 (en) Method and system for transmitting digital information via broadcast channel
CN110896341A (en) Signal processing method, integrated talkback chip and interphone

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200807

RJ01 Rejection of invention patent application after publication