CN113496705A - Audio processing method and device, storage medium and electronic equipment - Google Patents
Audio processing method and device, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN113496705A CN113496705A CN202110957155.4A CN202110957155A CN113496705A CN 113496705 A CN113496705 A CN 113496705A CN 202110957155 A CN202110957155 A CN 202110957155A CN 113496705 A CN113496705 A CN 113496705A
- Authority
- CN
- China
- Prior art keywords
- audio
- real
- time
- compression
- playing
- 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.)
- Granted
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 21
- 238000007906 compression Methods 0.000 claims abstract description 139
- 230000006835 compression Effects 0.000 claims abstract description 139
- 238000000034 method Methods 0.000 claims abstract description 26
- 230000000875 corresponding effect Effects 0.000 claims description 36
- 230000015654 memory Effects 0.000 claims description 18
- 238000004590 computer program Methods 0.000 claims description 13
- 238000013144 data compression Methods 0.000 claims description 5
- 230000014759 maintenance of location Effects 0.000 claims description 4
- 230000002596 correlated effect Effects 0.000 claims description 3
- 238000005070 sampling Methods 0.000 description 12
- 238000010586 diagram Methods 0.000 description 9
- 230000005540 biological transmission Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000007547 defect Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 238000012952 Resampling Methods 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 238000005034 decoration Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003139 buffering effect Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L19/00—Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/60—Network streaming of media packets
- H04L65/75—Media network packet handling
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Computational Linguistics (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- Acoustics & Sound (AREA)
- Circuit For Audible Band Transducer (AREA)
Abstract
The invention discloses an audio processing method and device, a storage medium and electronic equipment. Wherein, the method comprises the following steps: under the condition that the playing interruption of the real-time audio playing is detected, acquiring real-time audio to be played, wherein the real-time audio comprises mute audio and effective audio; under the condition that the data volume of the real-time audio reaches the reference magnitude, counting the data volume of the mute audio in the real-time audio with the reference magnitude, wherein the audio amplitude of the mute audio is smaller than the amplitude threshold; determining audio compression parameters corresponding to the data volume of the mute audio; and carrying out audio compression processing on the effective audio according to the audio compression parameters to obtain the played audio. The invention solves the technical problem of poor user experience caused by incomplete audio data due to direct discarding of the audio data.
Description
Technical Field
The present invention relates to the field of audio processing, and in particular, to an audio processing method and apparatus, a storage medium, and an electronic device.
Background
The digital voice talkback is to realize two-way voice conversation by transmitting the voice data sampling code to a far end for playing after being digitalized through a network. In data-to-voice talkback, the speed of audio acquisition and audio playback is consistent in the case of a good network. However, when the network is unstable, since the network transmission speed is lower than the audio acquisition speed, a play gap occurs at the audio playing end, and the balance between audio acquisition and audio playing is broken.
In order to restore the balance between audio acquisition and audio playing, the prior art usually adopts a mode of audio packet discarding, and the balance between audio acquisition and audio playing is restored as soon as possible by buffering the discarded part of data. The audio discard directly affects the integrity of the audio data, which results in intermittent and incomplete audio playing, so that the user cannot receive the complete audio data, key information may be missed, and the user experience is poor.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides an audio processing method and device, a storage medium and electronic equipment, and aims to at least solve the technical problem of poor user experience caused by incomplete audio data due to direct discarding of the audio data.
According to an aspect of an embodiment of the present invention, there is provided an audio processing method including: under the condition that the playing interruption of the real-time audio playing is detected, acquiring the real-time audio to be played, wherein the real-time audio comprises a mute audio and an effective audio; under the condition that the data volume of the real-time audio reaches a reference value, counting the data volume of the mute audio in the real-time audio with the reference value, wherein the audio amplitude of the mute audio is smaller than an amplitude threshold value; determining audio compression parameters corresponding to the data volume of the mute audio; and carrying out audio compression processing on the effective audio according to the audio compression parameters to obtain played audio.
According to another aspect of the embodiments of the present invention, there is also provided an audio processing apparatus, including: under the condition that the playing interruption of the real-time audio playing is detected, acquiring the real-time audio to be played, wherein the real-time audio comprises a mute audio and an effective audio; under the condition that the data volume of the real-time audio reaches a reference value, counting the data volume of the mute audio in the real-time audio with the reference value, wherein the audio amplitude of the mute audio is smaller than an amplitude threshold value; determining audio compression parameters corresponding to the data volume of the mute audio; and carrying out audio compression processing on the effective audio according to the audio compression parameters to obtain played audio.
According to a further aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium having a computer program stored therein, wherein the computer program is configured to execute the above-mentioned audio processing method when running.
According to still another aspect of the embodiments of the present invention, there is also provided an electronic device, including a memory and a processor, the memory having a computer program stored therein, the processor being configured to execute the audio processing method described above through the computer program.
In the embodiment of the invention, the real-time audio to be played is acquired under the condition that the playing of the real-time audio is interrupted, the data volume of the mute audio in the real-time audio with the reference value is counted, the audio compression parameter of the effective audio is determined according to the data volume of the mute audio, and the playing audio obtained by compressing the effective audio according to the audio compression parameter is used for playing the real-time audio, the audio compression degree of the effective audio is determined according to the data volume of the mute audio, the audio compression degree of the effective audio in the real-time audio is judged according to the data volume of the mute audio in the real-time audio, so that the defect of the effective audio caused by audio compression is avoided, the technical effect of audio compression of the real-time audio data on the basis of no data loss is realized, and the problem of incomplete audio data caused by directly discarding the audio data is solved, leading to a technical problem of poor user experience.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a schematic diagram of an application environment of an alternative audio processing method according to an embodiment of the invention;
FIG. 2 is a schematic flow diagram of an alternative audio processing method according to an embodiment of the invention;
FIG. 3 is a schematic flow diagram of an alternative audio processing method according to an embodiment of the invention;
FIG. 4 is a schematic flow diagram of an alternative audio processing method according to an embodiment of the invention;
FIG. 5 is a schematic flow chart diagram of an alternative audio processing method according to an embodiment of the invention;
FIG. 6 is a schematic flow chart diagram of an alternative audio processing method according to an embodiment of the invention;
FIG. 7 is a schematic diagram of an alternative audio processing apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an alternative electronic device according to an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an aspect of the embodiments of the present invention, there is provided an audio processing method, which may be applied, but not limited, to the environment as shown in fig. 1. The processor 110 receives the real-time captured audio sent by the capture terminal 100, processes the real-time audio, and sends the processed played audio to the playing terminal 120 to implement audio playing.
Processor 110 is not limited to having database 112 and processing engine 114. The database 112 is used to receive and store real-time audio and play audio. The processing engine 114 is not limited to playing audio by executing S102 to S108 in sequence to implement processing of real-time audio. And acquiring the real-time audio to be played. And under the condition that the playing interruption of the real-time audio playing is detected, acquiring the real-time audio to be played, wherein the real-time audio comprises a mute audio and an effective audio. And (5) counting the data volume of mute application. And under the condition that the data volume of the real-time audio reaches the reference magnitude, counting the data volume of the mute audio in the real-time audio with the reference magnitude, wherein the audio amplitude of the mute audio is smaller than the amplitude threshold. Audio compression parameters are determined. And determining audio compression parameters corresponding to the data volume of the mute audio. And compressing the audio to obtain the played audio. And carrying out audio compression processing on the effective audio according to the audio compression parameters to obtain the played audio.
Optionally, in this embodiment, the capture end 100 and the play end 120 are not limited to terminal devices equipped with real-time audio capture and play, and may include but are not limited to at least one of the following: mobile phones (such as Android phones, IOS phones, etc.), notebook computers, tablet computers, palm computers, MID (Mobile Internet Devices), PAD, desktop computers, smart televisions, smart phones, etc. The collection end and the playing end and the processor are not limited to transmit audio data through a network, and the network may include but is not limited to: a wired network, a wireless network, wherein the wired network comprises: a local area network, a metropolitan area network, and a wide area network, the wireless network comprising: bluetooth, WIFI, and other networks that enable wireless communication. The processor is not limited to a server, and may be a single server, a server cluster composed of a plurality of servers, or a cloud server. The above is merely an example, and this is not limited in this embodiment.
As an alternative implementation, as shown in fig. 2, the audio processing method includes:
s202, under the condition that the playing interruption of the real-time audio playing is detected, acquiring the real-time audio to be played, wherein the real-time audio comprises a mute audio and an effective audio;
s204, under the condition that the data volume of the real-time audio reaches the reference value, counting the data volume of the mute audio in the real-time audio with the reference value, wherein the audio amplitude of the mute audio is smaller than the amplitude threshold value;
s206, determining audio compression parameters corresponding to the data volume of the mute audio;
and S208, carrying out audio compression processing on the effective audio according to the audio compression parameters to obtain the playing audio.
Optionally, the playing discontinuity is not limited to that the playing buffer is empty, and there is no data to be played in the playing buffer. In the real-time audio playing scene, the real-time audio data collected by the collection end is transmitted to the playing end through the network. Under the ideal state of not being influenced by network transmission, the audio acquisition rate of the acquisition end and the audio playing rate of the playing end are kept consistent, so that the real-time playing of the audio is realized. When the playing buffer area of the playing end stores data to be played, the real-time playing of the audio is in a balanced state, and when the data to be played does not exist in the playing buffer area of the playing end, namely the playing end does not currently have audio data for playing, the playing is determined to be interrupted.
Optionally, in order to restore the real-time synchronization of the audio of the playing terminal and the audio of the collecting terminal to the balanced state again and ensure that the collecting terminal collects the audio in real time, the real-time synchronization of the playing terminal and the collecting terminal on the audio is restored by compressing the audio playing of the playing terminal without being limited to processing the collected real-time audio. And under the balanced state that the acquisition end and the playing end process real-time playing, the playing end plays the real-time audio acquired by the acquisition end.
Optionally, when it is detected that the playing of the playing end is interrupted, the real-time audio which is collected by the collection end after the playing is interrupted and is to be played is obtained. The real-time audio includes mute audio and active audio. The mute audio is the audio with the audio amplitude smaller than the amplitude threshold, and the effective audio is the audio with the audio amplitude larger than or equal to the amplitude threshold. Dividing real-time audio into mute audio and effective audio through a preset amplitude threshold, and regarding the mute audio with the audio amplitude smaller than the amplitude threshold as audio data without effective sound content.
Alternatively, in the case where the data amount of the real-time audio reaches the reference magnitude value, the audio compression processing is performed on the real-time audio. The reference value is a preset audio processing value of the real-time audio, and is not limited to performing audio compression processing on the real-time audio of the reference value every time. And under the condition that the data volume of the real-time audio is smaller than the reference magnitude value, continuing to accumulate the real-time audio until the data volume of the real-time audio reaches the reference magnitude value. The data amount of the real-time audio is not limited to the number of sampling points of the real-time audio.
Optionally, the audio compression processing is performed on the real-time audio with the reference magnitude, and is not limited to determining audio compression parameters for the effective audio according to the data amount of the mute audio in the real-time audio, so as to compress the effective audio, and the compressed effective audio is used as the playing audio, and the real-time synchronicity of the audio of the acquisition end and the playing end is restored by discarding the mute audio in the real-time audio and compressing the effective audio.
In the embodiment of the application, the real-time audio to be played is acquired when the interruption of the real-time audio playing is detected, the data volume of the mute audio in the real-time audio with the reference value is counted, the audio compression parameter of the effective audio is determined according to the data volume of the mute audio, and the playing audio obtained by compressing the effective audio according to the audio compression parameter is used for playing the real-time audio, the audio compression degree of the effective audio is determined according to the data volume of the mute audio, the audio compression degree of the effective audio in the real-time audio is judged according to the data volume of the mute audio in the real-time audio, so that the defect of the effective audio caused by audio compression is avoided, the technical effect of audio compression of the real-time audio on the basis of no data loss is realized, and the problem that the audio data is not complete due to the direct discarding of the audio data is solved, leading to a technical problem of poor user experience.
As an alternative implementation, as shown in fig. 3, the determining the audio compression parameter corresponding to the data amount of the mute audio includes:
s302, inquiring the audio compression grade corresponding to the data volume of the mute audio;
s304, determining audio compression parameters corresponding to the data volume of the mute audio according to the audio compression level.
Optionally, after counting the data amount of the mute audio in the real-time audio of the reference magnitude, determining the audio compression parameter of the valid audio according to the audio compression level corresponding to the data amount of the mute audio.
Optionally, before the real-time audio to be played is acquired, the association relationship between the data volume of the mute audio and the audio compression parameter is established, and is not limited to the audio compression association table. And recording the corresponding relation between the mute audio data amount and the audio compression parameters in the real-time audio of the reference magnitude in the audio compression association table.
Alternatively, in the audio compression association table, the amount of mute audio data, the level of mute audio data amount, the level of audio compression, and the audio compression parameter are not limited to being recorded. The mute audio data amount level is used to indicate a data amount level at which the mute audio data amount is present, and the audio compression level is used to indicate a level of audio compression degree. For example, the silent audio has a high data volume level and a high corresponding audio compression level.
Alternatively, it is not limited that the larger the amount of the mute audio data, the smaller the degree of audio compression. In the real-time audio data of the reference value, the larger the data amount of the contained mute audio is, the smaller the data amount of the remaining effective audio is, and the smaller the corresponding compression degree is for ensuring the integrity of the compressed audio. In the real-time audio data of the reference value, the smaller the data amount of the contained mute audio is, the larger the data amount of the remaining effective audio is, so that the effective audio can be compressed to a greater extent without affecting the playing integrity of the compressed effective audio, and therefore, the greater the corresponding compression degree is.
As an optional implementation manner, the determining an audio compression parameter corresponding to the data amount of the mute audio includes: in the case where the audio compression parameter is used to indicate the degree of retention of valid audio, the amount of data of the muted audio is positively correlated with the value of the audio compression parameter.
Alternatively, the degree of retention of the effective audio is not limited to the ratio of the number of audio points of the playing audio obtained by compression to the number of audio points of the effective audio, and may also be expressed by a sampling rate. Under the condition that the audio compression parameters are represented by the audio sampling rate, the data volume of the mute audio is positively correlated with the numerical value of the audio sampling rate, and in the real-time audio with the reference value, the larger the data volume of the mute audio is, the larger the numerical value of the audio sampling rate is, and the smaller the audio compression degree of the effective audio is. In real-time audio of a reference magnitude, the smaller the data amount of the mute audio, the smaller the value of the audio sampling rate, and the greater the degree of audio compression for the effective audio.
In the embodiment of the application, the data volume of the mute audio in the real-time audio with the reference value is determined, and the data volume of the effective audio contained in the real-time audio is determined, so that the audio compression parameters for performing audio compression on the effective audio are determined, the audio compression without breaking the effective integrity of the audio on the effective audio is ensured, and the audio compression is realized while the integrity of the audio is ensured.
As an alternative implementation, as shown in fig. 4, before the acquiring the real-time audio to be played, the method further includes:
s402, acquiring the discontinuous duration of playing discontinuity;
s404, calculating a target data volume corresponding to the intermittent duration, wherein the target data volume is used for indicating the data compression volume to be subjected to audio compression processing.
Optionally, in a case where the playing discontinuity is detected, a discontinuity duration of the playing discontinuity is determined. The discontinuous duration of the playing discontinuity is the duration from the beginning of the playing discontinuity to the starting of the real-time playing. Under the condition of determining the interruption time length, calculating a target data volume corresponding to the interruption time length to obtain a data compression volume corresponding to audio compression processing, namely a compression volume required to perform audio compression on real-time audio.
Taking the target data amount as the number of audio sampling points as an example, the calculation of the target data amount is not limited to the following formula (1):
DN ═ T × number of sampling points × number of channels sampling frequency/8 (1)
Wherein DN represents a target data amount corresponding to T; t represents the duration of the break in seconds.
When the number of sampling points is 16, the sampling frequency is 48000, and the number of channels is binaural 2, the calculation method of the target data amount corresponding to the discontinuity duration T is not limited to:
DN=T*16*2*48000/8 (2)
in the embodiment of the application, the interval duration is converted into the target data volume to obtain the data compression volume needing to be subjected to audio compression processing, so that whether the real-time audio is subjected to audio compression processing or not is conveniently judged.
As an optional implementation manner, after the playing audio is obtained, the method further includes:
s502, calculating a difference value between the reference quantity value and the data quantity of the played audio to obtain a playing compression quantity;
s504, under the condition that the playing compression amount is smaller than the target data amount, the current real-time audio is obtained;
s506, under the condition that the current real-time audio reaches the reference value, performing audio compression processing on the current effective audio in the current real-time audio according to the data volume of the current mute audio in the current real-time audio.
Optionally, after the target data amount is determined and the playing audio is obtained, a difference between the data amount of the playing audio and the reference value is calculated to determine the playing compression amount. The playing compression amount is used to represent the data amount difference between the real-time audio of the reference magnitude and the playing audio.
Optionally, when the playing compression amount is smaller than the target data amount, audio compression processing is continuously performed on the real-time audio to be played, and not limited to that when the current real-time audio after the real-time audio reaches the reference value, the audio compression parameter for performing audio compression processing on the current effective audio in the current real-time audio is determined according to the data amount of the current mute audio in the current real-time audio, so as to perform audio compression processing on the current effective audio. And calculating the playing compression amount of the data volume of the current playing audio obtained by compression and the reference value, and accumulating the playing compression amount corresponding to the playing audio until the accumulated playing compression amount is more than or equal to the target data volume.
As an optional implementation manner, after obtaining the play compression amount, the method further includes: and under the condition that the playing compression amount is equal to or larger than the target data amount, taking the current real-time audio as the current playing audio.
Optionally, when the playing compression amount is greater than or equal to the target data amount, determining that the playing end and the collecting end reach a real-time synchronous equilibrium state, stopping audio compression processing on the real-time audio, and using the collected real-time audio as the playing audio of the playing end.
Optionally, without being limited to using the target data amount corresponding to the intermittent duration as the initial value of the target data amount, in the case of obtaining the played audio, the target data amount is updated according to the playing compression amount corresponding to the played audio until the updated value of the target data amount is equal to or less than zero, and it is determined that the audio processing is ended.
The audio processing flow is not limited to that shown in fig. 6. And executing S602 and counting the interruption time length T under the condition that the interruption of the real-time audio playing is detected. In the case where the intermittent duration T is determined, S604 is executed to convert the intermittent duration T into the target data volume DN. And executing S606, determining the reference value N for processing the real-time audio each time, and establishing the association relation between the mute audio data volume and the audio compression parameters.
S608 is executed to determine whether the current DN is greater than 0. If the determination in S608 is yes, the current DN is greater than 0, that is, if audio compression processing is required, S610 is performed, and the data volume AN of the mute audio in N is counted. If the amount of mute audio data AN is determined, S612 is performed to determine the audio compression parameter R corresponding to the amount of mute audio data AN. Taking the audio compression parameter as the resampling ratio as an example, in the case of determining the resampling ratio R, S614 is executed to resample the valid audio to obtain the played audio. In the case where the played audio is obtained, S616 is performed to calculate AN audio compression amount dN — N-R (N-AN). And executes S618, updating DN: DN-DN. After updating the DN, S608 is performed to determine whether the current DN is greater than 0. If the determination in S608 is negative and the current DN is less than or equal to 0, S620 is executed to use the real-time audio as the playing audio.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
According to another aspect of the embodiment of the present invention, there is also provided an audio processing apparatus for implementing the audio processing method. As shown in fig. 7, the apparatus includes:
an obtaining unit 702, configured to obtain a real-time audio to be played when it is detected that playing of the real-time audio is interrupted, where the real-time audio includes a mute audio and an effective audio;
a statistic unit 704, configured to, in a case that the data amount of the real-time audio reaches a reference magnitude, count the data amount of a mute audio in the real-time audio of the reference magnitude, where an audio amplitude of the mute audio is smaller than an amplitude threshold;
a determining unit 706, configured to determine an audio compression parameter corresponding to the data amount of the mute audio;
the compressing unit 708 is configured to perform audio compression processing on the effective audio according to the audio compression parameter, so as to obtain a played audio.
Optionally, the determining unit 706 includes:
the query module is used for querying the audio compression grade corresponding to the data volume of the mute audio;
and the determining module is used for determining audio compression parameters corresponding to the data volume of the mute audio according to the audio compression level.
Optionally, the determining unit 706 is further configured to positively correlate the data amount of the mute audio with the value of the audio compression parameter in a case where the audio compression parameter is used to indicate the degree of retention of the valid audio.
Optionally, the audio processing apparatus further includes a duration unit, configured to obtain a discontinuous duration of playing discontinuity before obtaining the real-time audio to be played; and calculating a target data volume corresponding to the intermittent duration, wherein the target data volume is used for indicating the data compression volume to be subjected to audio compression processing.
Optionally, the audio processing apparatus further includes a calculating unit, configured to calculate a difference between the reference value and a data amount of the played audio after the played audio is obtained, so as to obtain a playing compression amount; under the condition that the playing compression amount is smaller than the target data amount, acquiring the current real-time audio; and under the condition that the current real-time audio reaches the reference magnitude, performing audio compression processing on the current effective audio in the current real-time audio according to the data volume of the current mute audio in the current real-time audio.
Optionally, the audio processing apparatus further includes a playing unit, configured to, after obtaining the playing compression amount, take the current real-time audio as the current playing audio when the playing compression amount is equal to or greater than the target data amount.
In the embodiment of the application, the real-time audio to be played is acquired when the interruption of the real-time audio playing is detected, the data volume of the mute audio in the real-time audio with the reference value is counted, the audio compression parameter of the effective audio is determined according to the data volume of the mute audio, and the playing audio obtained by compressing the effective audio according to the audio compression parameter is used for playing the real-time audio, the audio compression degree of the effective audio is determined according to the data volume of the mute audio, the audio compression degree of the effective audio in the real-time audio is judged according to the data volume of the mute audio in the real-time audio, so that the defect of the effective audio caused by audio compression is avoided, the technical effect of audio compression of the real-time audio on the basis of no data loss is realized, and the problem that the audio data is not complete due to the direct discarding of the audio data is solved, leading to a technical problem of poor user experience.
According to another aspect of the embodiment of the present invention, there is also provided an electronic device for implementing the audio processing method, where the electronic device may be a playing end or a processor shown in fig. 1. The present embodiment takes the electronic device as an example for explanation. As shown in fig. 8, the electronic device comprises a memory 802 and a processor 804, the memory 802 having a computer program stored therein, the processor 804 being arranged to perform the steps of any of the above-described method embodiments by means of the computer program.
Optionally, in this embodiment, the electronic device may be located in at least one network device of a plurality of network devices of a computer network.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, acquiring real-time audio to be played under the condition that the playing interruption of the real-time audio playing is detected, wherein the real-time audio comprises a mute audio and an effective audio;
s2, under the condition that the data volume of the real-time audio reaches the reference value, counting the data volume of the mute audio in the real-time audio with the reference value, wherein the audio amplitude of the mute audio is smaller than the amplitude threshold value;
s3, determining audio compression parameters corresponding to the data volume of the mute audio;
and S4, performing audio compression processing on the effective audio according to the audio compression parameters to obtain the playing audio.
Alternatively, it can be understood by those skilled in the art that the structure shown in fig. 8 is only an illustration, and the electronic device may also be a terminal device such as a smart phone (e.g., an Android phone, an IOS phone, etc.), a tablet computer, a palmtop computer, and a Mobile Internet Device (MID), a PAD, and an intercom. Fig. 8 is a diagram illustrating a structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, etc.) than shown in FIG. 8, or have a different configuration than shown in FIG. 8.
The memory 802 may be used to store software programs and modules, such as program instructions/modules corresponding to the audio processing method and apparatus in the embodiments of the present invention, and the processor 804 executes various functional applications and data processing by running the software programs and modules stored in the memory 802, so as to implement the audio processing method described above. The memory 802 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 802 can further include memory located remotely from the processor 804, which can be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. The memory 802 may be used for storing, but not limited to, real-time audio, audio compression parameters, playing audio, and other information. As an example, as shown in fig. 8, the memory 802 may include, but is not limited to, an obtaining unit 702, a counting unit 704, a determining unit 706, and a compressing unit 708 in the audio processing apparatus. In addition, other module units in the audio processing apparatus may also be included, but are not limited to these, and are not described in this example again.
Optionally, the transmitting device 806 is configured to receive or transmit data via a network. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 806 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices to communicate with the internet or a local area Network. In one example, the transmission device 806 is a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In addition, the electronic device further includes: a display 808 for displaying the played audio; and a connection bus 810 for connecting the respective module parts in the above-described electronic apparatus.
In other embodiments, the terminal device or the server may be a node in a distributed system, where the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting a plurality of nodes through a network communication. Nodes can form a Peer-To-Peer (P2P, Peer To Peer) network, and any type of computing device, such as a server, a terminal, and other electronic devices, can become a node in the blockchain system by joining the Peer-To-Peer network.
According to an aspect of the application, a computer program product or computer program is provided, comprising computer instructions, the computer instructions being stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform the method provided in the various alternative implementations of the audio processing aspect described above. Wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the above-mentioned computer-readable storage medium may be configured to store a computer program for executing the steps of:
s1, acquiring real-time audio to be played under the condition that the playing interruption of the real-time audio playing is detected, wherein the real-time audio comprises a mute audio and an effective audio;
s2, under the condition that the data volume of the real-time audio reaches the reference value, counting the data volume of the mute audio in the real-time audio with the reference value, wherein the audio amplitude of the mute audio is smaller than the amplitude threshold value;
s3, determining audio compression parameters corresponding to the data volume of the mute audio;
and S4, performing audio compression processing on the effective audio according to the audio compression parameters to obtain the playing audio.
Alternatively, in this embodiment, a person skilled in the art may understand that all or part of the steps in the methods of the foregoing embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be 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 through some interfaces, units or modules, and may be in an electrical or other form.
The 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.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.
Claims (9)
1. An audio processing method, comprising:
under the condition that the playing interruption of real-time audio playing is detected, acquiring real-time audio to be played, wherein the real-time audio comprises mute audio and effective audio;
under the condition that the data volume of the real-time audio reaches a reference magnitude, counting the data volume of the mute audio in the real-time audio with the reference magnitude, wherein the audio amplitude of the mute audio is smaller than an amplitude threshold value;
determining audio compression parameters corresponding to the data volume of the mute audio;
and carrying out audio compression processing on the effective audio according to the audio compression parameters to obtain played audio.
2. The method of claim 1, wherein the determining audio compression parameters corresponding to the amount of data of the muted audio comprises:
inquiring the audio compression grade corresponding to the data volume of the mute audio;
and determining the audio compression parameters corresponding to the data volume of the mute audio according to the audio compression level.
3. The method according to claim 1 or 2, wherein the determining the audio compression parameter corresponding to the data amount of the mute audio comprises:
in a case where the audio compression parameter is used to indicate a degree of retention of the valid audio, the data amount of the muted audio is positively correlated with the value of the audio compression parameter.
4. The method of claim 1, wherein prior to obtaining real-time audio to be played, the method further comprises:
acquiring the discontinuous time length of the playing discontinuity;
and calculating a target data volume corresponding to the break duration, wherein the target data volume is used for indicating a data compression volume to be subjected to audio compression processing.
5. The method of claim 4, wherein after the playback audio is obtained, the method further comprises:
calculating the difference value between the reference quantity value and the data quantity of the played audio to obtain a played compression quantity;
under the condition that the playing compression amount is smaller than the target data amount, acquiring the current real-time audio;
and under the condition that the current real-time audio reaches the reference magnitude value, performing audio compression processing on the current effective audio in the current real-time audio according to the data volume of the current mute audio in the current real-time audio.
6. The method of claim 5, wherein after obtaining the playback compression amount, the method further comprises:
and taking the current real-time audio as the current playing audio under the condition that the playing compression amount is equal to or larger than the target data amount.
7. An audio processing apparatus, comprising:
the device comprises an acquisition unit, a processing unit and a display unit, wherein the acquisition unit is used for acquiring real-time audio to be played under the condition that the playing interruption of real-time audio playing is detected, and the real-time audio comprises mute audio and effective audio;
the statistic unit is used for counting the data quantity of the mute audio in the real-time audio with the reference magnitude under the condition that the data quantity of the real-time audio reaches the reference magnitude, wherein the audio amplitude of the mute audio is smaller than an amplitude threshold value;
the determining unit is used for determining audio compression parameters corresponding to the data volume of the mute audio;
and the compression unit is used for carrying out audio compression processing on the effective audio according to the audio compression parameters to obtain the playing audio.
8. A computer-readable storage medium comprising a stored program, wherein the program when executed performs the method of any of claims 1 to 6.
9. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 6 by means of the computer program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110957155.4A CN113496705B (en) | 2021-08-19 | 2021-08-19 | Audio processing method and device, storage medium and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110957155.4A CN113496705B (en) | 2021-08-19 | 2021-08-19 | Audio processing method and device, storage medium and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113496705A true CN113496705A (en) | 2021-10-12 |
CN113496705B CN113496705B (en) | 2024-03-08 |
Family
ID=77996912
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110957155.4A Active CN113496705B (en) | 2021-08-19 | 2021-08-19 | Audio processing method and device, storage medium and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113496705B (en) |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0573089A (en) * | 1991-09-18 | 1993-03-26 | Matsushita Electric Ind Co Ltd | Speech reproducing method |
JPH08211894A (en) * | 1995-02-03 | 1996-08-20 | Sanyo Electric Co Ltd | Voice-grade communication equipment and voice-grade communication system |
JPH0945001A (en) * | 1995-08-02 | 1997-02-14 | Matsushita Electric Ind Co Ltd | Disk apparatus |
US6282611B1 (en) * | 1990-07-11 | 2001-08-28 | Hitachi, Ltd. | Digital information system, digital audio signal processor and signal converter |
JP2008058956A (en) * | 2006-07-31 | 2008-03-13 | Matsushita Electric Ind Co Ltd | Speech reproduction device |
CN101771869A (en) * | 2008-12-30 | 2010-07-07 | 深圳市万兴软件有限公司 | AV (audio/video) encoding and decoding device and method |
CN104123949A (en) * | 2014-01-24 | 2014-10-29 | 腾讯科技(深圳)有限公司 | Clamped frame detection method and device |
JP2015122682A (en) * | 2013-12-25 | 2015-07-02 | ブラザー工業株式会社 | Remote conference program, terminal device, and remote conference method |
CN105847857A (en) * | 2016-03-07 | 2016-08-10 | 乐视致新电子科技(天津)有限公司 | Method and device for processing audios when video is played in double speed |
CN108924665A (en) * | 2018-05-30 | 2018-11-30 | 深圳市捷视飞通科技股份有限公司 | Reduce method, apparatus, computer equipment and the storage medium of video playing delay |
CN109427342A (en) * | 2017-09-01 | 2019-03-05 | 三星Sds株式会社 | For preventing the voice data processing apparatus and method of voice latency |
CN111355996A (en) * | 2018-12-20 | 2020-06-30 | 海信视像科技股份有限公司 | Audio playing method and computing device |
CN116259322A (en) * | 2021-12-10 | 2023-06-13 | 腾讯科技(深圳)有限公司 | Audio data compression method and related products |
-
2021
- 2021-08-19 CN CN202110957155.4A patent/CN113496705B/en active Active
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6282611B1 (en) * | 1990-07-11 | 2001-08-28 | Hitachi, Ltd. | Digital information system, digital audio signal processor and signal converter |
JPH0573089A (en) * | 1991-09-18 | 1993-03-26 | Matsushita Electric Ind Co Ltd | Speech reproducing method |
JPH08211894A (en) * | 1995-02-03 | 1996-08-20 | Sanyo Electric Co Ltd | Voice-grade communication equipment and voice-grade communication system |
JPH0945001A (en) * | 1995-08-02 | 1997-02-14 | Matsushita Electric Ind Co Ltd | Disk apparatus |
JP2008058956A (en) * | 2006-07-31 | 2008-03-13 | Matsushita Electric Ind Co Ltd | Speech reproduction device |
CN101771869A (en) * | 2008-12-30 | 2010-07-07 | 深圳市万兴软件有限公司 | AV (audio/video) encoding and decoding device and method |
JP2015122682A (en) * | 2013-12-25 | 2015-07-02 | ブラザー工業株式会社 | Remote conference program, terminal device, and remote conference method |
CN104123949A (en) * | 2014-01-24 | 2014-10-29 | 腾讯科技(深圳)有限公司 | Clamped frame detection method and device |
CN105847857A (en) * | 2016-03-07 | 2016-08-10 | 乐视致新电子科技(天津)有限公司 | Method and device for processing audios when video is played in double speed |
CN109427342A (en) * | 2017-09-01 | 2019-03-05 | 三星Sds株式会社 | For preventing the voice data processing apparatus and method of voice latency |
CN108924665A (en) * | 2018-05-30 | 2018-11-30 | 深圳市捷视飞通科技股份有限公司 | Reduce method, apparatus, computer equipment and the storage medium of video playing delay |
CN111355996A (en) * | 2018-12-20 | 2020-06-30 | 海信视像科技股份有限公司 | Audio playing method and computing device |
CN116259322A (en) * | 2021-12-10 | 2023-06-13 | 腾讯科技(深圳)有限公司 | Audio data compression method and related products |
Non-Patent Citations (1)
Title |
---|
王希公: "MP3数码音频播放机设计", 《中国优秀硕士学位论文全文数据库(信息科技辑)》, 15 July 2006 (2006-07-15) * |
Also Published As
Publication number | Publication date |
---|---|
CN113496705B (en) | 2024-03-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109246671B (en) | Data transmission method, device and system | |
CN101577631B (en) | Method, system and network device for evaluating experience quality of user | |
US20090300685A1 (en) | System, method, and device for transmitting video captured on a wireless device | |
CN103970793A (en) | Information inquiry method, client side and server | |
CN113220715B (en) | Data processing method, system, computer and readable storage medium | |
CN103327378B (en) | Data output method, data output routine and terminal device | |
CN108900855B (en) | Live content recording method and device, computer readable storage medium and server | |
TWI507046B (en) | Video message system, terminal and implement method of video message | |
US9402172B2 (en) | Message combination method and device | |
CN109511011B (en) | YouTube DASH encrypted video-oriented fingerprint database construction method | |
CN103702178B (en) | A kind of playback method and electronic equipment | |
CN113784001B (en) | Audio data playing method and device, electronic equipment and storage medium | |
CN104486645A (en) | Method for determining program audience rating, playback equipment, server and device | |
CN110086703B (en) | Message transmission method and device based on TCP (Transmission control protocol) | |
CN110830832A (en) | Audio playing parameter configuration method of mobile terminal and related equipment | |
CN103455569A (en) | Method and system for recording external communication data of instant messaging | |
CN113496705A (en) | Audio processing method and device, storage medium and electronic equipment | |
CN107454539A (en) | A kind of typhon self-check system and method | |
CN112565016B (en) | Positioning method, system and device for abnormal time delay, electronic equipment and storage medium | |
WO2019000877A1 (en) | Audio data processing method and device | |
JP2015106768A (en) | Program for communication device, communication device, and communication method | |
WO2013044670A1 (en) | Method, device, and system for integrating traditional short message and network message | |
CN110365690A (en) | Flow collection method, apparatus and storage medium | |
CN104243403B (en) | A kind of method and apparatus for supporting to play online | |
CN101179408B (en) | Method and system of obtaining network TV program in instant communication cluster |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |