Mixing method, device, electronic device and storage medium

By analyzing the fit based on the benchmark audio model, calculating mixing weights and encoding splicing, the problem of poor audio transcription in multi-party video conferences is solved, and more accurate audio mixing and better speech conversion are achieved. writing effect.

CN115188394BActive Publication Date: 2024-10-29ANHUI IFLYREC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210700556.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-20
Publication Date
2024-10-29
Estimated Expiration
2042-06-20

AI Technical Summary

Technical Problem

In multi-party video conferencing scenarios, the audio transcription effect after mixing in the existing technology is poor, mainly due to the inconsistent audio volume collection levels of each channel and the influence of environmental noise, resulting in the inability to effectively isolate human voices and environmental sounds.

Method used

The mixing method is used to determine the mixing weight based on the fitting degree of the benchmark audio model. By analyzing the fitting degree between each audio segment in the two-channel audio and the benchmark audio, the mixing weight of each audio segment is calculated, and Encode and splice for more accurate mixes.

Benefits of technology

The voice transcription effect after mixing has been improved, which can better isolate the noise volume and enhance the volume of the human voice, making the transcription effect clearer and more accurate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115188394B_ABST
    Figure CN115188394B_ABST
Patent Text Reader

Abstract

The present invention provides a mixing method, device, electronic device and storage medium, wherein the method comprises: obtaining two channels of audio to be mixed; determining the degree of fit between each audio segment in the two channels of audio and the reference audio based on an audio model of a reference audio, wherein the audio model is determined based on the signal-to-noise ratio of the reference audio in the frequency domain, and the reference audio includes noise audio and / or human voice audio; and mixing the two channels of audio based on the degree of fit between each audio segment in the two channels of audio and the reference audio. The mixing method, device, electronic device and storage medium provided by the embodiments of the present invention mix two channels of audio based on the degree of fit, can achieve more accurate mixing weight setting, avoids the problem of poor mixing effect caused by setting mixing weights based on experience in the prior art, and makes the effect of speech transcription after mixing better.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of audio and video technology, and in particular to a mixing method, device, electronic equipment and storage medium. Background Art

[0002] Currently, in the video conferencing scenario, users need to synchronously collect system audio and microphone audio, and after mixing the two audio channels, they can synchronously perform real-time voice transcription or perform offline file transcription after the meeting.

[0003] Currently, the commonly used mixing method is to directly add and clip the audio data of each channel, or to manually set the volume proportion of each channel of audio in the mix based on empirical values.

[0004] In a multi-party video conferencing scenario, the volume collection levels of each audio channel may be inconsistent, and there is environmental noise. The volume proportion of each audio channel in the mix is ​​set according to experience, resulting in poor transcription effect of the mixed audio. Summary of the invention

[0005] The present invention provides a mixing method, a device, an electronic device and a storage medium, which are used to solve the defect in the prior art that the mixed audio has a poor transcription effect.

[0006] The present invention provides a mixing method, comprising:

[0007] Get the two channels of audio to be mixed;

[0008] Based on an audio model of a reference audio, determining a degree of fit between each audio segment in the two channels of audio and the reference audio, wherein the audio model is determined based on a signal-to-noise ratio of the reference audio in a frequency domain, and the reference audio includes noise audio and / or human voice audio;

[0009] The two channels of audio are mixed based on the degree of fit between each audio segment in the two channels of audio and the reference audio.

[0010] According to a mixing method provided by the present invention, the mixing of the two channels of audio based on the degree of fit between each audio segment in the two channels of audio and the reference audio respectively comprises:

[0011] Determining a mixing weight of each audio segment in the two channels of audio based on the fit between the audio segments corresponding to the same time period in the two channels of audio and the reference audio;

[0012] The two channels of audio are mixed based on the mixing weights of the audio segments in the two channels of audio.

[0013] According to a mixing method provided by the present invention, the mixing weights of the audio segments in the two channels of audio are determined based on the fit between the audio segments corresponding to the same time period in the two channels of audio and the reference audio, including:

[0014] The sum of the degrees of fit between the audio segments corresponding to the same time period in the two channels of audio and a type of reference audio is normalized, and the mixing weights of the audio segments corresponding to the same time period are determined based on the normalized degrees of fit.

[0015] According to a mixing method provided by the present invention, the mixing weights of the audio segments in the two channels of audio are determined based on the fit between the audio segments corresponding to the same time period in the two channels of audio and the reference audio, and the method also includes:

[0016] In the audio segments corresponding to the same time period in the two channels of audio, when there is a degree of fit between one audio segment and one type of reference audio, and a degree of fit between another audio segment and another type of reference audio, the degree of fit between the other audio segment and the other type of reference audio is converted into a degree of fit between the other audio segment and the one type of reference audio.

[0017] According to a mixing method provided by the present invention, the two channels of audio are mixed based on the mixing weights of the audio segments in the two channels of audio, comprising:

[0018] Based on the sequence number and mixing weight of each audio segment in the two channels of audio, respectively encode the two channels of audio to obtain two channels of encoded audio;

[0019] The two channels of encoded audio are mixed.

[0020] According to a mixing method provided by the present invention, the two channels of audio are respectively encoded based on the sequence number and mixing weight of each audio segment in the two channels of audio to obtain two channels of encoded audio, including:

[0021] Constructing a frame header of each audio segment based on the sequence number and mixing weight of each audio segment in the two channels of audio, and splicing the frame header of each audio segment with each audio segment to obtain frame data of each audio segment;

[0022] The frame data of each audio segment in the two channels of audio are spliced ​​respectively to obtain the two channels of encoded audio.

[0023] According to a mixing method provided by the present invention, the frame headers of each audio segment are spliced ​​with each audio segment to obtain frame data of each audio segment, including:

[0024] Generating a check code for each audio segment based on the frame header of each audio segment and each audio segment;

[0025] The frame headers of the audio segments, the audio segments and the check codes of the audio segments are spliced ​​respectively to obtain the frame data of the audio segments.

[0026] According to a mixing method provided by the present invention, the audio model is determined based on the following steps:

[0027] Determine a sample audio corresponding to the reference audio, and calculate the signal energy of the sample audio in the frequency domain;

[0028] Determining the vocal power and noise power of the sample audio based on the signal energy;

[0029] Determining a signal-to-noise ratio of the sample audio based on a human voice power and a noise power of the sample audio;

[0030] An audio model of the reference audio is determined based on the signal-to-noise ratio and the signal energy of the sample audio in the frequency domain.

[0031] The present invention also provides a mixing device, comprising:

[0032] An audio acquisition unit, used to acquire two channels of audio to be mixed;

[0033] a fit determination unit, configured to determine the fit between each audio segment in the two channels of audio and the reference audio based on an audio model of the reference audio, wherein the audio model is determined based on a signal-to-noise ratio of the reference audio in the frequency domain, and the reference audio includes noise audio and / or human voice audio;

[0034] The mixing unit is used to mix the two audio channels based on the fit between each audio segment in the two audio channels and the reference audio.

[0035] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the mixing methods described above is implemented.

[0036] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the mixing method described in any one of the above is implemented.

[0037] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned mixing methods.

[0038] The mixing method, device, electronic device and storage medium provided by the present invention determine the degree of fit between each audio segment in two-way audio and the reference audio based on the audio model of the reference audio, and then mix the two-way audio based on the degree of fit between each audio segment in the two-way audio and the reference audio. Mixing the two-way audio based on the degree of fit can achieve more accurate mixing weight setting, avoid the problem of poor mixing effect caused by setting the mixing weight according to experience in the prior art, and make the effect of speech transcription after mixing better. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0040] Figure 1 It is one of the flow charts of the mixing method provided by the present invention;

[0041] Figure 2 is a flow chart of step 130 in the mixing method provided by the present invention;

[0042] Figure 3 This is the second flow chart of the mixing method provided by the present invention;

[0043] Figure 4 This is the third flow chart of the mixing method provided by the present invention;

[0044] Figure 5 This is the fourth flow chart of the mixing method provided by the present invention;

[0045] Figure 6 is a flow chart of the audio model determination method provided by the present invention;

[0046] Figure 7 is a schematic structural diagram of a sound mixing device provided by the present invention;

[0047] Figure 8 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0049] Currently, there are five main technical solutions for mixing two-channel audio:

[0050] 1) Direct mathematical addition and peak clipping: that is, multiple audio channels are directly added according to the corresponding bit numbers according to mathematical operations, and peak clipping is performed according to the upper and lower bounds to prevent data from crossing the boundary.

[0051] 2) Average adjustment weight method: linearly add the voice of each channel and then divide it by the number of channels to reduce the possibility of noise in the audio.

[0052] 3) Normalized mixing algorithm: All audio channels are multiplied by a preset coefficient factor. The preset coefficient here is generally an empirical value. For example, the coefficient of the externally recorded audio is 2, and the coefficient of the system audio is 1, so that the amplitude is normalized, thereby achieving weight differentiation of each audio channel.

[0053] 4) Adaptive mixing weighting: Use a variable attenuation factor to attenuate the speech. The attenuation factor represents the weight of the speech. The attenuation factor changes with the data. When the data overflows, the attenuation factor is correspondingly reduced so that the subsequent data is within the critical value after attenuation. When there is no overflow, the attenuation factor is slowly increased to make the data change relatively smooth.

[0054] 5) Automatic alignment algorithm: Taking into account the different weights of each audio channel, the volume proportion of each audio channel in the mix is ​​manually set to achieve weighted calculation of different audio channels.

[0055] The above solutions are all based on multi-channel audio mixing algorithms, which can meet the needs of common scenarios, such as singer recording, multi-channel music mixing, etc.

[0056] However, for remote video conferencing scenarios, especially for multi-party conference scenarios, the above mixing algorithms are unable to achieve the isolation of ambient sound and human voice during mixing. For example, when two parties are in a meeting, one party is playing music and the other party is speaking. At this time, the audio after mixing may sound like noisy music mixed with some human voices, resulting in poor transcription effect and difficulty in achieving the effect of what you hear is what you see.

[0057] In view of the above problems, an embodiment of the present invention provides a mixing method, which can be applied to scenarios where two-way audio needs to be mixed, such as conference discussion scenarios, speech scenarios, busy market scenes, etc. The mixing method can be implemented by a mixing device, which is a program module stored in a readable storage medium of a terminal, and a processor in the terminal can call the mixing device to implement the mixing method. The terminal can be a user-side terminal, such as a smart phone, a tablet computer, etc., or a service-side terminal, such as a server.

[0058] Figure 1 It is one of the flow charts of the mixing method provided by the present invention, such as Figure 1 As shown, the mixing method includes:

[0059] Step 110: Obtain two channels of audio to be mixed.

[0060] Specifically, the mixing device can obtain two channels of audio to be mixed, where one channel of the two channels of audio refers to the system audio, that is, the audio obtained through the audio circuit component in the terminal, such as the multimedia audio played by the computer. For example, in a multi-party conference, one party may be playing music, which can be directly obtained through the audio circuit component. The other channel refers to the audio obtained through the microphone component. However, since there may be noise in the surrounding environment, noise will also be collected when sound is collected through the microphone component. For example, one party of the meeting may be in a downtown area, and when sound is collected through the microphone component, various environmental sounds such as whistles and shouts may also be collected.

[0061] It is understandable that one of the two audio channels is obtained directly from the terminal by the audio circuit component through internal recording, which may include multimedia playback sound; while the other channel is obtained through external recording by the microphone recording the sound of the speaker and the surrounding environment, which may include various environmental noises. In a multi-party conference scenario, multimedia playback sound and environmental noise are both invalid external sound sources. When mixing, it is impossible to distinguish the real speaker's voice from the external wireless sound source, resulting in poor mixing quality.

[0062] In addition, since the volume collection level of the system audio may be inconsistent with the volume collection level of the microphone, it will often result in only being able to hear the system sound or only being able to hear the microphone sound after mixing, resulting in poor transcription effects after mixing.

[0063] Step 120: Determine the degree of fit between each audio segment in the two audio channels and the reference audio based on an audio model of the reference audio. The audio model is determined based on a signal-to-noise ratio of the reference audio in the frequency domain. The reference audio includes noise audio and / or human voice audio.

[0064] Specifically, since the multimedia playback sound or environmental noise contained in the two-channel audio may lead to poor transcription effect after mixing, it is necessary to pre-process the two-channel audio before mixing, and the pre-processing may include audio splitting and fitting degree determination. First, the two-channel audio is split according to the time window, for example, according to a fixed duration or a fixed number of bytes, to obtain each audio segment.

[0065] After obtaining each audio segment in the two audio channels, the degree of fit between each audio segment and the reference audio can be determined. The degree of fit here represents the degree of similarity between each audio segment and the reference audio. The higher the degree of fit, the higher the degree of similarity between the audio segment and the reference audio; the lower the degree of fit, the lower the degree of similarity between the audio segment and the reference audio.

[0066] The determination of the degree of fit between each audio segment and the reference audio can be achieved through the audio model of the reference audio, and the audio model of the reference audio can be pre-set. The audio model of the reference audio can reflect the statistical characteristics of the reference audio, and specifically can reflect the components of noise and human voice corresponding to each frequency point in the reference audio spectrum. The audio model of the reference audio can be determined by the signal-to-noise ratio of the reference audio in the frequency domain. Therefore, the audio model can reflect the signal-to-noise ratio of the reference audio in the frequency domain, and thus the audio segment can be input into the audio model to achieve fitting in terms of the signal-to-noise ratio, thereby determining the degree of fit between the two.

[0067] It can be understood that the higher the fitting degree is, the closer the distribution of the signal-to-noise ratio of the audio segment and the reference audio in the frequency domain is, and the more similar the audio type of the audio segment is to the actual audio type of the reference audio.

[0068] Among them, the reference audio may include noise audio and / or human voice audio, where the noise audio refers to pure noise audio, and the human voice audio refers to pure human voice audio, which can be obtained by separating noise and human voice from noisy speech, for example, by a commonly used noise reduction algorithm, and the embodiment of the present invention does not specifically limit this.

[0069] For example, each audio segment in the two-channel audio can be input into the audio model of the noise audio respectively to obtain the degree of fit between each audio segment in the two-channel audio and the noise audio; each audio segment in the two-channel audio can also be input into the audio model of the human voice audio respectively to obtain the degree of fit between each audio segment in the two-channel audio and the human voice audio; part of the audio segments in the two-channel audio can also be input into the audio model of the noise audio, and part of the audio segments can be input into the audio model of the human voice audio to obtain the audio models of each audio segment and the noise audio or the human voice audio respectively; each audio segment in the two-channel audio can also be input into the audio model of the noise audio and the audio model of the human voice audio at the same time to obtain the degree of fit between each audio segment in the two-channel audio and the noise audio, and between each audio segment and the human voice audio.

[0070] Step 130 : Mix the two channels of audio based on the degree of fit between each audio segment in the two channels of audio and the reference audio.

[0071] Specifically, the two audio channels can be mixed based on the fitting degree between each audio segment in the two audio channels and the reference audio. The desired mixing effect is that the human voice volume is as loud as possible and the noise volume is as small as possible, so as to achieve the best speech transcription effect.

[0072] In one embodiment, for each audio segment in two channels of audio, an audio segment having a higher degree of fit with the audio model of the noise audio may be given a lower weight during mixing than an audio segment having a lower degree of fit with the audio model of the noise audio; on the contrary, an audio segment having a higher degree of fit with the audio model of the human voice audio may be given a higher weight during mixing than an audio segment having a lower degree of fit with the audio model of the human voice audio, thereby obtaining a better effect of mixed audio after transcription.

[0073] The method provided by the embodiment of the present invention determines the degree of fit between each audio segment in two channels of audio and the reference audio based on the audio model of the reference audio, and then mixes the two channels of audio based on the degree of fit between each audio segment in the two channels of audio and the reference audio. Mixing the two channels of audio based on the degree of fit can achieve more accurate mixing weight setting, avoids the problem of poor mixing effect caused by setting mixing weights based on experience in the prior art, and makes the effect of speech transcription after mixing better.

[0074] Based on the above embodiments, Figure 2 is a flow chart of step 130 in the mixing method provided by the present invention, such as Figure 2 As shown, step 130 specifically includes:

[0075] Step 131, determining the mixing weight of each audio segment in the two channels of audio based on the fit between the audio segments corresponding to the same time period in the two channels of audio and the reference audio;

[0076] Step 132: Mix the two audio channels based on the mixing weights of the audio segments in the two audio channels.

[0077] Specifically, the audio segments corresponding to the same time period in the two audio channels refer to the audio segments corresponding to the same time period obtained by splitting the two audio channels according to the same time window. For example, audio segment A corresponds to the 1st to 2nd minute of one audio channel, and audio segment B corresponds to the 1st to 2nd minute of the other audio channel, and audio segment A and audio segment B correspond to the same time period.

[0078] After obtaining the audio segments corresponding to the same time period in the two audio channels, the degree of fit between the audio segments corresponding to the same time period and the reference audio can be determined respectively. Here, each audio segment can correspond to the same reference audio or different reference audios. For example, the degree of fit between audio segment A and audio segment B and noise audio can be determined respectively; the degree of fit between audio segment A and audio segment B and human voice audio can be determined respectively; the degree of fit between audio segment A and human voice audio, and the degree of fit between audio segment B and noise audio can also be determined; the degree of fit between audio segment A and noise audio, and the degree of fit between audio segment B and human voice audio can also be determined, and the embodiment of the present invention does not specifically limit this.

[0079] After obtaining the fit between the audio segments corresponding to the same time period and the reference audio, the mixing weight of each audio segment in the two audio channels can be determined, for example, by using a proportional method or a normalization method.

[0080] For example, the fit between audio segment A and human voice audio is 0.8, and the fit between audio segment B and human voice audio is 0.4. According to the proportion method, when the two-channel audio is mixed, the mixing weight of audio segment A is 2 / 3, and the mixing weight of audio segment B is 1 / 3.

[0081] For another example, the degree of fit between audio segment A and the noise audio is 0.8, and the degree of fit between audio segment B and the noise audio is 0.4. According to the proportional method, when the two-channel audio is mixed, the mixing weight of audio segment A is 1 / 3, and the mixing weight of audio segment B is 2 / 3.

[0082] After the mixing weights of the audio segments in the two audio channels are obtained, the two audio channels are mixed, for example, by performing a weighted summation of the loudness of the two audio channels to achieve mixing.

[0083] Based on any of the above embodiments, step 131 specifically includes:

[0084] The sum of the fitting degrees between the audio segments corresponding to the same time period in the two channels of audio and a type of reference audio is normalized, and the mixing weights of the audio segments corresponding to the same time period are determined based on the normalized fitting degrees.

[0085] Specifically, in order to make the audio after mixing better, the total loudness of the audio after mixing can be always equal to the average loudness of the two audio channels, so that the loudness of the two audio channels can be maintained in the weighted calculation scenario.

[0086] By normalizing the sum of the fits between the audio segments corresponding to the same time period in the two channels of audio and a type of reference audio, the mixing weights of the audio segments corresponding to the same time period are determined based on the normalized fits. Here, a type of reference audio means that the reference audio is either noise audio or human voice audio. In other words, the sum of the fits between the audio segments corresponding to the same time period in the two channels of audio and the noise audio is normalized, or the sum of the fits between the audio segments corresponding to the same time period in the two channels of audio and the human voice audio is normalized.

[0087] For example, the degree of fit between audio segment A and human voice audio is 0.8, the degree of fit between audio segment B and human voice audio is 0.4, and the sum of the degrees of fit is normalized to obtain a degree of fit between audio segment A and human voice audio of 0.67, and a degree of fit between audio segment B and human voice audio of 0.33. Since the first type of reference audio here is human voice audio, it can be determined that the mixing weight of audio segment A is 0.67, and the mixing weight of audio segment B is 0.33.

[0088] It should be noted that if one type of reference audio here is noise audio, when the degree of fit between audio segment A and the noise audio is 0.8, and the degree of fit between audio segment B and the noise audio is 0.4, it can be determined that the mixing weight of audio segment A is 0.33, and the mixing weight of audio segment B is 0.67.

[0089] The method provided by the embodiment of the present invention normalizes the sum of the fits between the audio segments corresponding to the same time period in the two-channel audio and a type of reference audio, and determines the mixing weights of the audio segments corresponding to the same time period based on the normalized fits, so that the total loudness of the mixed audio is always equal to the average loudness of the two-channel audio, thereby achieving the loudness of the two-channel audio in the weighted calculation scenario, thereby improving the transcription effect.

[0090] Based on any of the above embodiments, before step 131, the following step is further included:

[0091] In audio segments corresponding to the same time period in two audio channels, when there is a degree of fit between one audio segment and one type of reference audio, and a degree of fit between another audio segment and another type of reference audio, the degree of fit between the other audio segment and the other type of reference audio is converted into a degree of fit between the other audio segment and the one type of reference audio.

[0092] Specifically, considering that in the audio segments corresponding to the same time period in the two audio channels, there is a degree of fit between one audio segment and one type of reference audio, and a degree of fit between another audio segment and another type of reference audio, the degree of fit between the other audio segment and the other type of reference audio can be converted into the degree of fit between the other audio segment and one type of reference audio.

[0093] For example, it is possible to obtain the degree of fit between audio segment A and noise audio, and the degree of fit between audio segment B and human voice audio. At this time, in order to calculate the weight more accurately, the degree of fit between audio segment B and human voice audio can be converted into the degree of fit between audio segment B and noise audio, or the degree of fit between audio segment A and noise audio can be converted into the degree of fit between audio segment A and human voice audio.

[0094] The fit conversion can be achieved by normalizing the sum of the fits. Assuming that any audio segment only includes noise and human voice, it can be further considered that the sum of the fit between any audio segment and one type of reference audio and the fit between any audio segment and another type of reference audio is 1. Then, the fit between any audio segment and one type of reference audio is equal to 1 minus the fit between the audio segment and another type of reference audio.

[0095] For example, the degree of fit between audio segment A and human voice audio is 0.8, and the degree of fit between audio segment B and noise audio is 0.6. Then, the degree of fit between audio segment A and human voice audio can be converted into the degree of fit between audio segment A and noise audio, and the degree of fit after conversion is 0.2; the degree of fit between audio segment B and noise audio can also be converted into the degree of fit between audio segment B and human voice audio, and the degree of fit after conversion is 0.4.

[0096] Based on any of the above embodiments, Figure 3 This is a second flow chart of the mixing method provided by the present invention, such as Figure 3 As shown, step 132 specifically includes:

[0097] Step 132-1, encoding the two channels of audio respectively based on the sequence number and mixing weight of each audio segment in the two channels of audio to obtain two channels of encoded audio;

[0098] Step 132-2: Mix the two channels of encoded audio.

[0099] Specifically, mixing two channels of audio can be achieved by encoding the two channels of audio respectively based on the sequence number and mixing weight of each audio segment in the two channels of audio to obtain two channels of encoded audio, and mixing the two channels of encoded audio.

[0100] The sequence number of each audio segment refers to the sequence number obtained when two audio channels are divided according to the time window. Usually, the sequence number starts from 0 and increases upward in sequence. For example, for any audio channel, the sequence number of each audio segment is 0, 1, 2, 3, etc.

[0101] The mixing weight is the mixing weight of each audio segment obtained by the method described in any of the above embodiments, and each audio segment carries the mixing weight corresponding to the audio segment. Any audio channel can be encoded using a pulse modulation coding (PCM) method. For example, after encoding, it can be displayed in the form shown in Table 1. The audio channel includes 4 audio segments, and each audio segment is encoded as PCM data. It is understandable that when the audio channel includes more than 4 audio segments, it can be encoded sequentially in the following form.

[0102] Table 1

[0103]

[0104] After encoding each audio channel respectively, two channels of encoded audio are obtained. Since each audio segment in the two channels of encoded audio carries the mixing weight corresponding to the respective audio segment, the two channels of encoded audio can be mixed on this basis.

[0105] Based on any of the above embodiments, Figure 4 3 is a flow chart of the mixing method provided by the present invention, such as Figure 4 As shown, step 132-1 specifically includes:

[0106] Step 132-11, constructing a frame header of each audio segment based on the sequence number and mixing weight of each audio segment in the two channels of audio, and splicing the frame header of each audio segment with each audio segment to obtain frame data of each audio segment;

[0107] Step 132-12, splicing the frame data of each audio segment in the two channels of audio respectively to obtain two channels of encoded audio.

[0108] Specifically, the two channels of audio are encoded separately by first constructing a frame header of each audio segment based on the sequence number and mixing weight of each audio segment in the two channels of audio, and then splicing the frame header of each audio segment with each audio segment to obtain frame data of each audio segment.

[0109] For example, one channel of coded audio may be presented in the form shown in Table 2. The frame data of each audio segment includes a frame header and an audio segment, and the frame header carries the sequence number and mixing weight of each audio segment.

[0110] Table 2

[0111] Frame header 0 + audio segment 0 Frame header 1+audio segment 1 Frame header 2 + audio segment 2 Frame header 3 + audio segment 3

[0112] Based on any of the above embodiments, Figure 5 FIG. 4 is a flow chart of the mixing method provided by the present invention. Figure 5As shown, in step 132-11, the frame header of each audio segment is spliced ​​with each audio segment to obtain frame data of each audio segment, including:

[0113] Step 132-111, generating a check code for each audio segment based on the frame header of each audio segment and each audio segment;

[0114] Step 132-112, the frame header of each audio segment, each audio segment and the check code of each audio segment are spliced ​​respectively to obtain the frame data of each audio segment.

[0115] Specifically, considering that errors may occur in data transmission or storage during the process of splicing the frame headers of each audio segment with each audio segment, a check code of each audio segment can be generated based on the frame headers of each audio segment and each audio segment. After the check code is obtained, the frame headers of each audio segment, each audio segment, and the check code of each audio segment can be spliced ​​to obtain the frame data of each audio segment.

[0116] For example, one channel of coded audio may be presented in the form shown in Table 3. The frame data of each audio segment includes a frame header, an audio segment and a check code in sequence, and the frame header carries the sequence number and mixing weight information of each audio segment.

[0117] Table 3

[0118]

[0119] Furthermore, the check code can be implemented using cyclic redundancy check (CRC) technology. CRC is a channel coding technology that generates a short fixed-bit check code based on data such as network data packets or computer files. It is mainly used to detect or check errors that may occur after data transmission or storage, and has a length of 4 bytes.

[0120] For example, after splitting the two audio channels to be mixed into various audio segments according to the time window, apply for a new memory space, first write the frame header of the 0th audio segment, then write the PCM data of the 0th audio segment, and finally write the CRC checksum generated based on the frame header and the audio segment, and perform this operation in a loop until the two audio channels are processed separately. When mixing two audio channels, the CRC checksum of each audio segment can be verified. If the CRC checksum verification fails, it means that an error has occurred in the mixing process and remixing is required.

[0121] The method provided by the embodiment of the present invention constructs frame data of each audio segment based on the form of a frame header, an audio segment and a check code, and then splices the frame data of each audio segment in the two-channel audio respectively to obtain two-channel encoded audio. This encoding method aligns the two-channel audio, reduces the difficulty of mixing, and further improves the transcription effect of the mixed audio.

[0122] Based on any of the above embodiments, Figure 6 is a flow chart of the audio model determination method provided by the present invention, such as Figure 6 As shown, the audio model of the reference audio is determined based on the following steps:

[0123] Step 610, determining a sample audio corresponding to the reference audio, and calculating the signal energy of the sample audio in the frequency domain;

[0124] Step 620, determining the vocal power and noise power of the sample audio based on the signal energy;

[0125] Step 630, determining a signal-to-noise ratio of the sample audio based on the vocal power and noise power of the sample audio;

[0126] Step 640: Determine an audio model of the reference audio based on the signal-to-noise ratio and the signal energy of the sample audio in the frequency domain.

[0127] Specifically, considering that it is not easy to obtain pure reference audio, the sample audio can be subjected to noise reduction processing to obtain the reference audio. The sample audios here are all noisy speech, and the sample audio corresponding to the reference audio is the sample noise audio corresponding to the noise audio, or the sample human voice audio corresponding to the human voice audio. The sample noise audio refers to the audio whose noise volume is greater than the human voice volume, and the sample human voice audio refers to the audio whose human voice volume is greater than the noise volume. The sample audio here can be each sample audio segment.

[0128] Taking the reference audio as noise audio as an example, the sample audio corresponding to the reference audio is the sample noise audio. First, a short-time Fourier transform is performed on the time domain signal of the sample noise audio to obtain the frequency domain representation of the sample noise audio, and then the signal energy is obtained by squaring the amplitude spectrum.

[0129] After calculating the amplitude spectrum of the sample noise audio, the noise spectrum is estimated with the help of the result of the Voice Activity Detection (VAD) module, and the priori signal-to-noise ratio is calculated based on the calculated human voice power spectrum and the estimated noise spectrum.

[0130] The prior signal-to-noise ratio is then transformed to obtain a gain function, and the calculated gain function is multiplied by the frequency domain form of the noisy speech, that is, the frequency domain form of the sample noise audio.

[0131] By performing statistics on the frequency domain form, an audio model of the reference audio, that is, an audio model of the noise audio, can be obtained.

[0132] Similarly, when the reference audio is human voice audio, the sample audio corresponding to the reference audio is sample human voice audio, and the sample human voice audio is subjected to the same noise reduction process as above to obtain an audio model of the human voice audio.

[0133] The following is a specific example to describe the method of building an audio model of the reference audio:

[0134] Take a two-party conference, where one party is in a downtown area as an example. The sample audio is two-channel unprocessed audio, and the audio format is 16K 16Bit mono audio, namely A audio and B audio.

[0135] First, audio A and audio B are split according to a time window, such as a fixed duration or a fixed number of bytes, that is, the audio data is decomposed bit by bit, generally one voice segment is 40ms, that is, 1280 bytes is one voice segment.

[0136] By splitting the audio according to the above time windows, speech segments of different time windows can be obtained. Assuming that between the first minute and the second minute, audio A is a loud sound in a busy city and has a volume greater than that of audio B, audio A can be used as the sample audio corresponding to the noise audio. By performing the above steps 610-640 on audio A, an audio model of the noise audio of audio A between the first minute and the second minute can be obtained.

[0137] For audio B, assuming that the speaker spoke between the first minute and the second minute, audio B can be used as the sample audio corresponding to the human voice audio. By performing the above steps 610-640 on audio B, an audio model of the human voice audio of audio B between the first minute and the second minute can be obtained.

[0138] Based on any of the above embodiments, an embodiment of the present invention provides a mixing method, including:

[0139] S1, for the current existing audio scene, audio is sorted and counted, and different dimensions and types are sorted according to the scene, type, human voice, etc., so as to sort out the sample audio corresponding to the reference audio. The audio scene here may include a meeting discussion scene, a speech scene, and a busy market scene.

[0140] S2, manually calibrate the sample audios sorted out in S1, and perform audio noise scene modeling based on the above scenes to obtain an audio model of the reference audio.

[0141] S3, obtains two audio channels to be mixed. The two audio channels have the same duration and are both 16k 16-bit mono PCM data.

[0142] S4, based on the audio model of the reference audio, determining the degree of fit between each audio segment in the two channels of audio and the reference audio.

[0143] S5, normalizing the sum of the fitting degrees between the audio segments corresponding to the same time period in the two audio channels and a type of reference audio, and determining the mixing weights of the audio segments corresponding to the same time period based on the normalized fitting degrees.

[0144] S6, mixing the two audio channels based on the mixing weights of the audio segments corresponding to the same time period. S6 includes:

[0145] S61, splicing the frame headers of each audio segment, each audio segment and the checksum of each audio segment respectively to obtain frame data of each audio segment. The frame header includes: a frame header delimiter, a frame sequence number, a frame length, an audio segment length and a mixing weight. The frame header delimiter is a fixed character, the frame sequence number is calculated by accumulation, the frame length is calculated, the audio segment length is also calculated, and the mixing weight is obtained by fitting the audio model based on the reference audio.

[0146] Frame header delimiter: 0xFFAA0055 is used as the delimiter between two frames, indicating the separation mark between the current frame and the previous frame, and the length is four bytes.

[0147] Frame number: The initial frame number starts from 0 and increases upward in sequence, indicating the sequence of frames in the encoded audio, with a length of 4 bytes.

[0148] Frame length: identifies the total size of the frame data, including the size of the frame header data and the size of the audio segment within the frame, with a length of 4 bytes.

[0149] Audio segment length: used to mark the size of pure audio data in the frame, to facilitate obtaining PCM audio data, with a length of 4 bytes.

[0150] Mixing weight: indicates the noise ratio or vocal ratio of the frame, expressed as int, ranging from 0 to 100. When mixing, this parameter is used for weighted calculation to achieve mixing of different audio tracks. The length is 4 bytes.

[0151] S62, splicing the frame data of each audio segment in the two channels of audio respectively to obtain two channels of encoded audio.

[0152] S63, mixing the two channels of encoded audio.

[0153] The sound mixing device provided by the present invention is described below. The sound mixing device described below and the sound mixing method described above can be referred to each other.

[0154] Based on any of the above embodiments, Figure 7 Schematic diagram of the structure of the mixing device provided by the present invention. Figure 7 As shown, the device comprises:

[0155] An audio acquisition unit 710 is used to acquire two channels of audio to be mixed;

[0156] A fit determination unit 720, configured to determine a fit between each audio segment in the two channels of audio and the reference audio based on an audio model of the reference audio, wherein the audio model is determined based on a signal-to-noise ratio of the reference audio in the frequency domain, and the reference audio includes noise audio and / or human voice audio;

[0157] The audio mixing unit 730 is configured to mix the two audio channels based on the degree of fit between each audio segment in the two audio channels and the reference audio.

[0158] The mixing device provided by the embodiment of the present invention determines the degree of fit between each audio segment in the two-channel audio and the reference audio based on the audio model of the reference audio, and then mixes the two-channel audio based on the degree of fit between each audio segment in the two-channel audio and the reference audio. Mixing the two-channel audio based on the degree of fit can achieve accurate and reliable mixing weight setting, avoiding the problem of poor mixing effect caused by setting the mixing weight according to experience in the prior art, so that the effect of speech transcription after mixing is better.

[0159] Based on any of the above embodiments, the audio mixing unit 730 is further configured to:

[0160] Determining a mixing weight of each audio segment in the two channels of audio based on the fit between the audio segments corresponding to the same time period in the two channels of audio and the reference audio;

[0161] The two channels of audio are mixed based on the mixing weights of the audio segments in the two channels of audio.

[0162] Based on any of the above embodiments, the audio mixing unit 730 is further configured to:

[0163] The sum of the degrees of fit between the audio segments corresponding to the same time period in the two channels of audio and a type of reference audio is normalized, and the mixing weights of the audio segments corresponding to the same time period are determined based on the normalized degrees of fit.

[0164] Based on any of the above embodiments, the sound mixing device further includes a fitness conversion unit, which is used to:

[0165] In the audio segments corresponding to the same time period in the two channels of audio, when there is a degree of fit between one audio segment and one type of reference audio, and a degree of fit between another audio segment and another type of reference audio, the degree of fit between the other audio segment and the other type of reference audio is converted into a degree of fit between the other audio segment and the one type of reference audio.

[0166] Based on any of the above embodiments, the audio mixing unit 730 is further configured to:

[0167] Based on the sequence number and mixing weight of each audio segment in the two channels of audio, respectively encode the two channels of audio to obtain two channels of encoded audio;

[0168] The two channels of encoded audio are mixed.

[0169] Based on any of the above embodiments, the audio mixing unit 730 is further configured to:

[0170] Constructing a frame header of each audio segment based on the sequence number and mixing weight of each audio segment in the two channels of audio, and splicing the frame header of each audio segment with each audio segment to obtain frame data of each audio segment;

[0171] The frame data of each audio segment in the two channels of audio are spliced ​​respectively to obtain the two channels of encoded audio.

[0172] Based on any of the above embodiments, the audio mixing unit 730 is further configured to:

[0173] Generating a check code for each audio segment based on the frame header of each audio segment and each audio segment;

[0174] The frame headers of the audio segments, the audio segments and the check codes of the audio segments are spliced ​​respectively to obtain the frame data of the audio segments.

[0175] Based on any of the above embodiments, the audio mixing device further includes an audio model determining unit, configured to:

[0176] Determine a sample audio corresponding to the reference audio, and calculate the signal energy of the sample audio in the frequency domain;

[0177] Determining the vocal power and noise power of the sample audio based on the signal energy;

[0178] Determining a signal-to-noise ratio of the sample audio based on a human voice power and a noise power of the sample audio;

[0179] An audio model of the reference audio is determined based on the signal-to-noise ratio and the signal energy of the sample audio in the frequency domain.

[0180] Figure 8 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 8As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820 and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the mixing method, which includes: obtaining two channels of audio to be mixed; based on the audio model of the reference audio, determining the degree of fit between each audio segment in the two channels of audio and the reference audio, the audio model is determined based on the signal-to-noise ratio of the reference audio in the frequency domain, and the reference audio includes noise audio and / or human voice audio; based on the degree of fit between each audio segment in the two channels of audio and the reference audio, mixing the two channels of audio.

[0181] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0182] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the mixing method provided by the above-mentioned methods, which includes: obtaining two channels of audio to be mixed; based on an audio model of a reference audio, determining the degree of fit between each audio segment in the two channels of audio and the reference audio, respectively, wherein the audio model is determined based on a signal-to-noise ratio of the reference audio in the frequency domain, and the reference audio includes noise audio and / or human voice audio; based on the degree of fit between each audio segment in the two channels of audio and the reference audio, mixing the two channels of audio.

[0183] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the mixing method provided by the above-mentioned methods, the method comprising: obtaining two channels of audio to be mixed; based on an audio model of a reference audio, determining the degree of fit between each audio segment in the two channels of audio and the reference audio, respectively, wherein the audio model is determined based on a signal-to-noise ratio of the reference audio in the frequency domain, and the reference audio includes noise audio and / or human voice audio; and mixing the two channels of audio based on the degree of fit between each audio segment in the two channels of audio and the reference audio.

[0184] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0185] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0186] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A mixing method, characterized in that: include: Get the two channels of audio to be mixed; Based on an audio model of a reference audio, determining a degree of fit between each audio segment in the two channels of audio and the reference audio, wherein the audio model is determined based on a signal-to-noise ratio of the reference audio in a frequency domain, and the reference audio includes noise audio and / or human voice audio; Determining a mixing weight of each audio segment in the two channels of audio based on the fit between the audio segments corresponding to the same time period in the two channels of audio and the reference audio; The two channels of audio are mixed based on the mixing weights of the audio segments in the two channels of audio.

2. The mixing method according to claim 1, characterized in that: The step of determining the mixing weight of each audio segment in the two channels of audio based on the fit between the audio segments corresponding to the same time period in the two channels of audio and the reference audio, comprises: The sum of the degrees of fit between the audio segments corresponding to the same time period in the two channels of audio and a type of reference audio is normalized, and the mixing weights of the audio segments corresponding to the same time period are determined based on the normalized degrees of fit.

3. The mixing method according to claim 1, characterized in that: The step of determining the mixing weight of each audio segment in the two channels of audio based on the fit between the audio segments corresponding to the same time period in the two channels of audio and the reference audio, further comprises: In the case where there is a degree of fit between one audio segment and one type of reference audio and a degree of fit between another audio segment and another type of reference audio in the audio segments corresponding to the same time period in the two channels of audio, converting the degree of fit between the other audio segment and the other type of reference audio into the degree of fit between the other audio segment and the one type of reference audio; If the one type of reference audio is noise audio, then the other type of reference audio is human voice audio; if the one type of reference audio is human voice audio, then the other type of reference audio is noise audio.

4. The mixing method according to claim 1, characterized in that: The mixing of the two channels of audio based on the mixing weights of the audio segments in the two channels of audio includes: Based on the sequence number and mixing weight of each audio segment in the two channels of audio, respectively encode the two channels of audio to obtain two channels of encoded audio; The two channels of encoded audio are mixed.

5. The mixing method according to claim 4, characterized in that: The method of encoding the two channels of audio respectively based on the sequence number and mixing weight of each audio segment in the two channels of audio to obtain two channels of encoded audio includes: Constructing a frame header of each audio segment based on the sequence number and mixing weight of each audio segment in the two channels of audio, and splicing the frame header of each audio segment with each audio segment to obtain frame data of each audio segment; The frame data of each audio segment in the two channels of audio are spliced ​​respectively to obtain the two channels of encoded audio.

6. The mixing method according to claim 5, characterized in that: The step of splicing the frame headers of each audio segment with each audio segment to obtain frame data of each audio segment includes: Generating a check code for each audio segment based on the frame header of each audio segment and each audio segment; The frame headers of the audio segments, the audio segments and the check codes of the audio segments are spliced ​​respectively to obtain the frame data of the audio segments.

7. The mixing method according to any one of claims 1 to 6, characterized in that: The audio model is determined based on the following steps: Determine a sample audio corresponding to the reference audio, and calculate the signal energy of the sample audio in the frequency domain; Determining the vocal power and noise power of the sample audio based on the signal energy; Determining a signal-to-noise ratio of the sample audio based on a human voice power and a noise power of the sample audio; An audio model of the reference audio is determined based on the signal-to-noise ratio and the signal energy of the sample audio in the frequency domain.

8. A sound mixing device, characterized in that: include: An audio acquisition unit, used to acquire two channels of audio to be mixed; a fit determination unit, configured to determine the fit between each audio segment in the two channels of audio and the reference audio based on an audio model of the reference audio, wherein the audio model is determined based on a signal-to-noise ratio of the reference audio in the frequency domain, and the reference audio includes noise audio and / or human voice audio; The mixing unit is used to determine the mixing weight of each audio segment in the two channels of audio based on the fit between the audio segments corresponding to the same time period in the two channels of audio and the reference audio; and mix the two channels of audio based on the mixing weight of each audio segment in the two channels of audio.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the mixing method according to any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the mixing method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Audio recording method, device, storage medium and terminal

    CN109300482A

  • Sound mixing method, apparatus and device, and storage medium

    CN109327633A