An audio automatic adjustment method and system based on multi-window mixing, a terminal and a storage medium
Patent Information
- Application Number
- CN202511607225.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-05
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2045-11-05
AI Technical Summary
[0005]本发明的主要目的在于提供一种基于多窗口混音的音频自动调节方法、系统、终端及计算机可读存储介质,旨在解决现有技术中通常采用普通的声音混合方法,在多窗口模式下,无法自适应调节音频的问题
[0015]本发明中,获取多窗口模式下的双声道PCM数据和目标窗口,根据所述双声道PCM数据与所述目标窗口建立对应关系,得到对应关系表;获取基础增益,基于所述对应关系表,根据预设的混音规则和所述基础增益对所述双声道PCM数据进行动态计算,得到目标增益权重;获取混合双声道PCM数据,根据预设快速算法和所述目标增益权重对所述混合双声道PCM数据的采样值进行混音调节处理,得到目标混合双声道PCM数据。本发明通过目标增益权重对混合双声道PCM数据进行混音调节,实现在多窗口模式下进行自适应调节音频。
Smart Images

Figure CN121641041B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of audio processing technology, and in particular to an automatic audio adjustment method, system, terminal, and computer-readable storage medium based on multi-window mixing. Background Technology
[0002] Currently, with the continuous advancement and development of audio and video interaction technologies and the increasing demands of users, the importance of multi-window mixing technology is becoming increasingly prominent in various scenarios. Whether it's business meetings, education and training, or home entertainment, related technologies provide users with great convenience. However, in the field of multi-window mixing, most current methods use ordinary sound mixing techniques, which cannot effectively preserve the audio-visual effects in multi-window scenarios.
[0003] Traditional methods rely heavily on conventional sound mixing techniques, which struggle to adaptively adjust audio gain and maintain audio-visual synchronization in multi-window scenarios. This results in suboptimal mixing effects, degraded audio quality, and low computational efficiency. The inability to adaptively adjust audio in multi-window mode when using conventional sound mixing is a pressing issue that needs to be addressed.
[0004] Therefore, existing technologies still need to be improved and developed. Summary of the Invention
[0005] The main objective of this invention is to provide an automatic audio adjustment method, system, terminal, and computer-readable storage medium based on multi-window mixing, aiming to solve the problem that existing ordinary sound mixing methods cannot adaptively adjust audio in multi-window mode.
[0006] To achieve the above objectives, the present invention provides an automatic audio adjustment method based on multi-window mixing, the method comprising the following steps: Acquire dual-channel PCM data and target window in multi-window mode, establish a correspondence between the dual-channel PCM data and the target window, and obtain a correspondence table; Obtain the base gain; based on the correspondence table, dynamically calculate the two-channel PCM data according to the preset mixing rules and the base gain to obtain the target gain weight. Acquire mixed two-channel PCM data, and perform mixing adjustment processing on the sampled values of the mixed two-channel PCM data according to a preset fast algorithm and the target gain weight to obtain target mixed two-channel PCM data.
[0007] Optionally, the automatic audio adjustment method based on multi-window mixing, wherein acquiring the two-channel PCM data and the target window in multi-window mode, and establishing a correspondence between the two-channel PCM data and the target window to obtain a correspondence table, specifically includes: Obtain process data, process identifier, and window information in multi-window mode; extract the process data based on the process identifier to obtain dual-channel PCM data. The target window is determined based on the window information, and a correspondence is established between the dual-channel PCM data and the target window to obtain a correspondence table.
[0008] Optionally, in the aforementioned automatic audio adjustment method based on multi-window mixing, the target gain weight includes a left channel gain weight and a right channel gain weight. The acquisition of the base gain, based on the correspondence table, involves dynamically calculating the target gain weight from the two-channel PCM data according to preset mixing rules and the base gain, specifically including: Obtain the base gain and preset time, and determine the target gain based on the base gain, the preset time, and the dual-channel PCM data; Based on the correspondence table, the two-channel PCM data is marked according to the preset mixing rules to obtain the left channel position and the right channel position; The target gain is dynamically calculated based on the left channel position and the right channel position to obtain the left channel gain weight and the right channel gain weight.
[0009] Optionally, the automatic audio adjustment method based on multi-window mixing, wherein the step of dynamically calculating the target gain based on the left channel position and the right channel position to obtain the left channel gain weight and the right channel gain weight specifically includes: Obtain the weighting coefficients. If the dual-channel PCM data is located in the left channel, calculate the left channel gain weight based on the target gain and the weighting coefficients. If the dual-channel PCM data is located in the right channel, the right channel gain weight is calculated based on the target gain and the weighting coefficient.
[0010] Optionally, the audio automatic adjustment method based on multi-window mixing, wherein acquiring mixed two-channel PCM data and performing mixing adjustment processing on the sampled values of the mixed two-channel PCM data according to a preset fast algorithm and the target gain weight to obtain target mixed two-channel PCM data specifically includes: Acquire timestamps and mixed dual-channel PCM data; The target gain weight is periodically calculated based on a preset fast algorithm and the timestamp to obtain the optimal gain weight. The sampled values of the mixed two-channel PCM data are mixed and adjusted according to the optimal gain weight to obtain the target mixed two-channel PCM data.
[0011] Optionally, the audio automatic adjustment method based on multi-window mixing includes mixing overlay processing and amplitude limiting processing. The step of mixing and adjusting the sampled values of the mixed two-channel PCM data according to the optimal gain weight to obtain the target mixed two-channel PCM data specifically includes: The sampled values of the hybrid two-channel PCM data are weighted according to the optimal gain weight to obtain the processed sampled values. The processed sampled values are mixed and superimposed to obtain first mixed two-channel PCM data. The first mixed two-channel PCM data is then limited according to a limiting function to obtain target mixed two-channel PCM data.
[0012] Optionally, the automatic audio adjustment method based on multi-window mixing, wherein the step of periodically calculating the target gain weight according to a preset fast algorithm and the timestamp to obtain the optimal gain weight specifically includes: Obtain the continuous gain weight, and perform periodic calculations on the target gain weight according to a preset fast algorithm, the continuous gain weight, and the timestamp to obtain dynamic gain parameters; If the dynamic gain parameter reaches a preset value, the optimal left channel gain weight and the optimal right channel gain weight are calculated based on the dynamic gain parameter and the preset fast algorithm.
[0013] Furthermore, to achieve the above objectives, the present invention also provides an audio automatic adjustment method system based on multi-window mixing, wherein the audio automatic adjustment method system based on multi-window mixing: The audio relationship table generation module is used to obtain dual-channel PCM data and target windows in multi-window mode, and establish a correspondence between the dual-channel PCM data and the target windows to obtain a correspondence table; The audio weight calculation module is used to obtain the base gain, and based on the correspondence table, dynamically calculates the target gain weight of the two-channel PCM data according to the preset mixing rules and the base gain. The mixing processing module is used to acquire mixed two-channel PCM data, and to perform mixing adjustment processing on the sampled values of the mixed two-channel PCM data according to a preset fast algorithm and the target gain weight to obtain target mixed two-channel PCM data.
[0014] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores an audio automatic adjustment program based on multi-window mixing, and when the audio automatic adjustment program based on multi-window mixing is executed by a processor, it implements the steps of the audio automatic adjustment method based on multi-window mixing as described above.
[0015] In this invention, dual-channel PCM data and a target window are acquired in a multi-window mode. A correspondence is established between the dual-channel PCM data and the target window to obtain a correspondence table. A base gain is acquired, and based on the correspondence table, the dual-channel PCM data is dynamically calculated according to preset mixing rules and the base gain to obtain a target gain weight. Mixed dual-channel PCM data is acquired, and the sampled values of the mixed dual-channel PCM data are mixed and adjusted according to a preset fast algorithm and the target gain weight to obtain target mixed dual-channel PCM data. This invention achieves adaptive audio adjustment in a multi-window mode by using target gain weights to adjust the mixed dual-channel PCM data. Attached Figure Description
[0016] Figure 1 This is a flowchart of a preferred embodiment of the automatic audio adjustment method based on multi-window mixing of the present invention; Figure 2 This is a flowchart of the mixing adjustment process of a preferred embodiment of the automatic audio adjustment method based on multi-window mixing of the present invention. Figure 3 This is a structural diagram of a preferred embodiment of the audio automatic adjustment method system based on multi-window mixing of the present invention; Figure 4 This is a structural diagram of a preferred embodiment of the terminal of the device of the present invention. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of this invention clearer and more explicit, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0018] Traditional methods often rely on ordinary sound mixing techniques, which are difficult to adaptively adjust audio gain and maintain audio-visual synchronization in multi-window scenarios. This results in unsatisfactory mixing effects, degraded audio quality, and low computational efficiency. When using ordinary sound mixing, adaptive audio adjustment is not possible in multi-window mode. Therefore, an automatic audio adjustment method based on multi-window mixing is needed. This method can adjust the mixed two-channel PCM data by using target gain weights to achieve adaptive audio adjustment in multi-window mode.
[0019] The preferred embodiment of the present invention describes an automatic audio adjustment method based on multi-window mixing, such as... Figure 1 and Figure 2 As shown, the automatic audio adjustment method based on multi-window mixing includes the following steps: Step S10: Obtain the dual-channel PCM data and target window in multi-window mode, establish a correspondence between the dual-channel PCM data and the target window, and obtain a correspondence table.
[0020] Step S10 includes: Step S11: Obtain process data, process identifier and window information in multi-window mode, and extract the process data according to the process identifier to obtain dual-channel PCM data; Step S12: Determine the target window based on the window information, establish a correspondence between the dual-channel PCM data and the target window, and obtain a correspondence table.
[0021] Specifically, process data, process identifiers, and window information in multi-window mode are acquired. The process data is extracted based on the process identifier (process number) to obtain dual-channel PCM data. The target window is determined based on the window information. The dual-channel PCM (PCM stands for Pulse Code Modulation, a technology that converts analog signals into digital signals) data is associated with the target window to obtain a correspondence table. (In multi-window mode, the process number is used to identify the target window of all processes that create audio and video decoders in the system, acquire the dual-channel PCM data decoded by the decoder, and establish a correspondence table.)
[0022] In this embodiment, as Figure 2 As shown, initially, in multi-window mode, the system uses process IDs to identify the windows where all processes that create audio and video decoders reside, obtains the two-channel PCM data decoded by the decoders, establishes a corresponding table, and performs mixing according to mixing rules, combining all the two-channel PCM data into one two-channel PCM data. The TV's public amplification devices, such as speakers and headphones, play the mixed PCM data.
[0023] Step S20: Obtain the base gain. Based on the correspondence table, dynamically calculate the two-channel PCM data according to the preset mixing rules and the base gain to obtain the target gain weight.
[0024] Step S20 includes: Step S21: Obtain the base gain and preset time, and determine the target gain based on the base gain, the preset time, and the dual-channel PCM data; Step S22: Based on the correspondence table, mark the two-channel PCM data according to the preset mixing rules to obtain the left channel position and the right channel position; Step S23: Dynamically calculate the target gain based on the left channel position and the right channel position to obtain the left channel gain weight and the right channel gain weight.
[0025] Specifically, the base gain and preset time are obtained, and the target gain is determined based on the base gain, the preset time, and the dual-channel PCM data (the base gain is calculated). ), Calculation method Where n is the total number of PCM data points. For example, if there are 4 PCM data points: PCM(A), PCM(B), PCM(C), and PCM(D), then n = 4. Based on the aforementioned correspondence table, the two-channel PCM data is marked according to preset mixing rules to obtain the left and right channel positions (a target gain is set, which is recalculated every 0.5 seconds, and each PCM data channel has a target gain, and is divided into left and right channel positions, with initial values of 0.5%. For example, the target gain of the left channel in PCMA is denoted as The right channel gain of PCM A is denoted as initial value , The target gain is dynamically calculated based on the left channel position and the right channel position to obtain the left channel gain weight and the right channel gain weight.
[0026] Step S23 includes: Step S231: Obtain the weighting coefficient. If the dual-channel PCM data is located in the left channel, calculate the left channel gain weight based on the target gain and the weighting coefficient. Step S232: If the dual-channel PCM data is located in the right channel, the right channel gain weight is calculated based on the target gain and the weighting coefficient.
[0027] Specifically, weighting coefficients are obtained. If the two-channel PCM data is in the left channel position, the left channel gain weight is calculated based on the target gain and the weighting coefficients. If the two-channel PCM data is in the right channel position, the right channel gain weight is calculated based on the target gain and the weighting coefficients.
[0028] In this embodiment, for each PCM data stream X, if the window containing the PCM X data is displayed on the left side of the television, then... , For each PCM data stream X, if the window containing PCM X data is displayed on the right side of the TV, then... , , Indicates the right side. Indicates the left side.
[0029] Step S30: Obtain mixed two-channel PCM data, and perform mixing adjustment processing on the sampled values of the mixed two-channel PCM data according to the preset fast algorithm and the target gain weight to obtain target mixed two-channel PCM data.
[0030] Step S30 includes: Step S31: Obtain the timestamp and mixed dual-channel PCM data; Step S32: Perform periodic calculations on the target gain weights according to a preset fast algorithm and the timestamp to obtain the optimal gain weights; Step S33: Perform mixing adjustment processing on the sampled values of the mixed two-channel PCM data according to the optimal gain weight to obtain the target mixed two-channel PCM data.
[0031] Specifically, timestamps (every 1 second) and mixed two-channel PCM data are acquired. The target gain weight is periodically calculated based on a preset fast algorithm and the timestamps to obtain the optimal gain weight. The sampled values of the mixed two-channel PCM data are mixed and adjusted based on the optimal gain weight to obtain the target mixed two-channel PCM data.
[0032] In this embodiment, a fast algorithm is preset to calculate the average sampling value (average loudness) within t seconds: First, 100×t equally spaced sampling points are taken from a single channel of PCM data within t seconds. For example, if the sampling rate of this PCM data is 44.1kHz, then 44100×t samples will be taken within t seconds, and 100×t equally spaced sampling points are taken. That is, for this data, one sample is taken every 441 sampling points for calculation. Second, the absolute value of the sampling point data is taken, and the average of these 100×t values is calculated to obtain the average sampling value of this channel. Finally, the average sampling values of the left and right channels are averaged to obtain the average sampling value of this PCM data within t seconds.
[0033] As an example, calculate the base gain. Calculation method Where n is the total number of PCM data points, and there are 2 PCM data streams, PCM(A) and PCM(B), then n=2. Therefore, the formula for calculating the target gain is as follows: ; ; ; ; If the window where PCM (A) is located is on the left, the calculation formula is as follows: ; ; If the window where PCM (B) is located is on the right, the calculation formula is as follows: ; ; Using a fast algorithm, assuming that the obtained , , the calculation formula is as follows: ; .
[0034] The step S32 comprises: Step S321: acquiring a continuous gain weight, and performing periodic calculation on the target gain weight according to a preset fast algorithm, the continuous gain weight and the timestamp to obtain a dynamic gain parameter; Step S322: if the dynamic gain parameter reaches a preset value, performing calculation according to the dynamic gain parameter and the preset fast algorithm to obtain an optimal left channel gain weight and an optimal right channel gain weight.
[0035] Specifically, acquiring a continuous gain weight, performing periodic calculation on the target gain weight according to a preset fast algorithm, the continuous gain weight and the timestamp to obtain a dynamic gain parameter, and if the dynamic gain parameter reaches a preset value, performing calculation according to the dynamic gain parameter and the preset fast algorithm to obtain an optimal left channel gain weight and an optimal right channel gain weight.
[0036] In this embodiment, a fast algorithm is used, and every 1 second, for each path of PCM data X, the average sampling value (loudness) within seconds is calculated and denoted as , represents the time subscript,, represents the start time, represents the end time, the value is to represent the current time, is the previous seconds, and so on. If , it indicates that the sound suddenly becomes louder at this time. To ensure smoothness, the continuous gain is set , and thereafter every seconds this value decreases by The rate continues to decrease until it reaches 1, after which it stops decreasing. For this path of PCM data X, .
[0037] Step S33 includes: Step S331: Weight the sampled values of the mixed two-channel PCM data according to the optimal gain weight to obtain the processed sampled values; Step S332: Perform mixing and superposition processing on the processed sampled values to obtain first mixed two-channel PCM data. Perform amplitude limiting processing on the first mixed two-channel PCM data according to the amplitude limiting function to obtain target mixed two-channel PCM data.
[0038] Specifically, the sampled values of the mixed two-channel PCM data are weighted according to the optimal gain weight to obtain processed sampled values. These processed sampled values are then mixed and superimposed to obtain first mixed two-channel PCM data. Finally, the first mixed two-channel PCM data is limited according to a limiting function to obtain target mixed two-channel PCM data. The mixing calculation formula for all PCM data is as follows: ; ; in, This represents the i-th sample value of the mixed right channel data. Clip(m) represents the i-th sample value of the mixed left channel data. It is a clipping function that uses the maximum value when m exceeds the maximum value and the minimum value when m is less than the minimum value. For example, the maximum value for a 16-bit depth is 32767, and the minimum value is -32768. When m > 32767, Clip(m) = 32767; when m < -32768, Clip(m) = -32768. and It is 2. , and This represents the i-th sample value of the left channel of the PCM X data. , and This represents the i-th sample value of the right channel of the data.
[0039] Furthermore, such as Figure 3 As shown, based on the above-mentioned automatic audio adjustment method based on multi-window mixing, the present invention also provides a system for automatic audio adjustment based on multi-window mixing, wherein the system for automatic audio adjustment based on multi-window mixing includes: The audio relationship table generation module 51 is used to obtain the dual-channel PCM data and the target window in the multi-window mode, and establish a correspondence relationship between the dual-channel PCM data and the target window to obtain the correspondence table. The audio weight calculation module 52 is used to obtain the base gain, and based on the correspondence table, dynamically calculates the target gain weight of the two-channel PCM data according to the preset mixing rules and the base gain. The mixing processing module 53 is used to acquire mixed two-channel PCM data, and to perform mixing adjustment processing on the sampled values of the mixed two-channel PCM data according to a preset fast algorithm and the target gain weight to obtain target mixed two-channel PCM data.
[0040] Furthermore, such as Figure 4 As shown, based on the above-mentioned automatic audio adjustment method and system based on multi-window mixing, the present invention also provides a terminal, which includes a processor 10, a memory 20 and a display 30. Figure 4 Only some of the terminal components are shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0041] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory. In other embodiments, the memory 20 may be an external storage device of the terminal, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc. Further, the memory 20 may include both internal and external storage devices. The memory 20 is used to store application software and various types of data installed on the terminal, such as the program code installed on the terminal. The memory 20 can also be used to temporarily store data that has been output or will be output. In one embodiment, the memory 20 stores an audio automatic adjustment program 40 based on multi-window mixing, which can be executed by the processor 10 to implement the audio automatic adjustment method based on multi-window mixing in this application.
[0042] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor, or other data processing chip, used to run program code stored in the memory 20 or process data, such as executing the audio automatic adjustment method based on multi-window mixing.
[0043] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. The display 30 is used to display information on the terminal and to display a visual user interface. The terminals communicate with each other via a system bus.
[0044] In one embodiment, when the processor 10 executes the multi-window mixing-based audio auto-adjustment program 40 in the memory 20, the following steps are performed: Acquire dual-channel PCM data and target window in multi-window mode, establish a correspondence between the dual-channel PCM data and the target window, and obtain a correspondence table; Obtain the base gain; based on the correspondence table, dynamically calculate the two-channel PCM data according to the preset mixing rules and the base gain to obtain the target gain weight. Acquire mixed two-channel PCM data, and perform mixing adjustment processing on the sampled values of the mixed two-channel PCM data according to a preset fast algorithm and the target gain weight to obtain target mixed two-channel PCM data.
[0045] The step of acquiring dual-channel PCM data and a target window in multi-window mode, and establishing a correspondence between the dual-channel PCM data and the target window to obtain a correspondence table, specifically includes: Obtain process data, process identifier, and window information in multi-window mode; extract the process data based on the process identifier to obtain dual-channel PCM data. The target window is determined based on the window information, and a correspondence is established between the dual-channel PCM data and the target window to obtain a correspondence table.
[0046] The target gain weight includes the left channel gain weight and the right channel gain weight. The acquisition of the base gain, based on the correspondence table, involves dynamically calculating the target gain weight from the two-channel PCM data according to preset mixing rules and the base gain, specifically including: Obtain the base gain and preset time, and determine the target gain based on the base gain, the preset time, and the dual-channel PCM data; Based on the correspondence table, the two-channel PCM data is marked according to the preset mixing rules to obtain the left channel position and the right channel position; The target gain is dynamically calculated based on the left channel position and the right channel position to obtain the left channel gain weight and the right channel gain weight.
[0047] Specifically, the step of dynamically calculating the target gain based on the left channel position and the right channel position to obtain the left channel gain weight and the right channel gain weight includes: Obtain the weighting coefficients. If the dual-channel PCM data is located in the left channel, calculate the left channel gain weight based on the target gain and the weighting coefficients. If the dual-channel PCM data is located in the right channel, the right channel gain weight is calculated based on the target gain and the weighting coefficient.
[0048] The acquisition of mixed two-channel PCM data, specifically including: performing mixing and adjustment processing on the sampled values of the mixed two-channel PCM data according to a preset fast algorithm and the target gain weight to obtain target mixed two-channel PCM data, includes: Acquire timestamps and mixed dual-channel PCM data; The target gain weight is periodically calculated based on a preset fast algorithm and the timestamp to obtain the optimal gain weight. The sampled values of the mixed two-channel PCM data are mixed and adjusted according to the optimal gain weight to obtain the target mixed two-channel PCM data.
[0049] The mixing process includes mixing overlay processing and amplitude limiting processing; The step of mixing and adjusting the sampled values of the mixed two-channel PCM data according to the optimal gain weight to obtain the target mixed two-channel PCM data specifically includes: The sampled values of the hybrid two-channel PCM data are weighted according to the optimal gain weight to obtain the processed sampled values. The processed sampled values are mixed and superimposed to obtain first mixed two-channel PCM data. The first mixed two-channel PCM data is then limited according to a limiting function to obtain target mixed two-channel PCM data.
[0050] Specifically, the step of periodically calculating the target gain weight based on a preset fast algorithm and the timestamp to obtain the optimal gain weight includes: Obtain the continuous gain weight, and perform periodic calculations on the target gain weight according to a preset fast algorithm, the continuous gain weight, and the timestamp to obtain dynamic gain parameters; If the dynamic gain parameter reaches a preset value, the optimal left channel gain weight and the optimal right channel gain weight are calculated based on the dynamic gain parameter and the preset fast algorithm.
[0051] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores an audio automatic adjustment program based on multi-window mixing, and the audio automatic adjustment program based on multi-window mixing, when executed by a processor, implements the steps of the audio automatic adjustment method based on multi-window mixing as described above.
[0052] In summary, this invention provides an automatic audio adjustment method, system, terminal, and storage medium based on multi-window mixing. The method includes: acquiring two-channel PCM data and a target window in multi-window mode; establishing a correspondence between the two-channel PCM data and the target window to obtain a correspondence table; acquiring a base gain; dynamically calculating a target gain weight based on the correspondence table, according to preset mixing rules and the base gain; acquiring mixed two-channel PCM data; and performing mixing adjustment processing on the sampled values of the mixed two-channel PCM data according to a preset fast algorithm and the target gain weight to obtain target mixed two-channel PCM data. This invention achieves adaptive audio adjustment in multi-window mode by mixing mixed two-channel PCM data using target gain weight.
[0053] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal system that includes that element.
[0054] Of course, those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.). The program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The computer-readable storage medium can be a memory, magnetic disk, optical disk, etc.
[0055] It should be understood that the application of the present invention is not limited to the examples above. Those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.
Claims
1. An automatic audio adjustment method based on multi-window mixing, characterized in that, The automatic audio adjustment method based on multi-window mixing includes: Acquire dual-channel PCM data and target window in multi-window mode, establish a correspondence between the dual-channel PCM data and the target window, and obtain a correspondence table; Obtain the base gain; based on the correspondence table, dynamically calculate the two-channel PCM data according to the preset mixing rules and the base gain to obtain the target gain weight. Acquire mixed two-channel PCM data, and perform mixing and adjustment processing on the sampled values of the mixed two-channel PCM data according to a preset fast algorithm and the target gain weight to obtain target mixed two-channel PCM data. The target gain weight includes the left channel gain weight and the right channel gain weight; The acquisition of the base gain, based on the correspondence table, involves dynamically calculating the target gain weight from the two-channel PCM data according to preset mixing rules and the base gain, specifically including: Obtain the base gain and preset time, and determine the target gain based on the base gain, the preset time, and the dual-channel PCM data; Based on the correspondence table, the two-channel PCM data is marked according to the preset mixing rules to obtain the left channel position and the right channel position; The target gain is dynamically calculated based on the left channel position and the right channel position to obtain the left channel gain weight and the right channel gain weight.
2. The automatic audio adjustment method based on multi-window mixing according to claim 1, characterized in that, The process of acquiring dual-channel PCM data and a target window in multi-window mode, and establishing a correspondence between the dual-channel PCM data and the target window to obtain a correspondence table, specifically includes: Obtain process data, process identifier, and window information in multi-window mode; extract the process data based on the process identifier to obtain dual-channel PCM data. The target window is determined based on the window information, and a correspondence is established between the dual-channel PCM data and the target window to obtain a correspondence table.
3. The automatic audio adjustment method based on multi-window mixing according to claim 1, characterized in that, The step of dynamically calculating the target gain based on the left and right channel positions to obtain the left channel gain weight and the right channel gain weight specifically includes: Obtain the weighting coefficients. If the dual-channel PCM data is located in the left channel, calculate the left channel gain weight based on the target gain and the weighting coefficients. If the dual-channel PCM data is located in the right channel, the right channel gain weight is calculated based on the target gain and the weighting coefficient.
4. The automatic audio adjustment method based on multi-window mixing according to claim 1, characterized in that, The process of acquiring mixed two-channel PCM data involves mixing and adjusting the sampled values of the mixed two-channel PCM data according to a preset fast algorithm and the target gain weight, to obtain target mixed two-channel PCM data. Specifically, this includes: Acquire timestamps and mixed two-channel PCM data; The target gain weight is periodically calculated based on a preset fast algorithm and the timestamp to obtain the optimal gain weight. The sampled values of the mixed two-channel PCM data are mixed and adjusted according to the optimal gain weight to obtain the target mixed two-channel PCM data.
5. The automatic audio adjustment method based on multi-window mixing according to claim 4, characterized in that, The mixing process includes mixing overlay processing and amplitude limiting processing; The step of mixing and adjusting the sampled values of the mixed two-channel PCM data according to the optimal gain weight to obtain the target mixed two-channel PCM data specifically includes: The sampled values of the hybrid two-channel PCM data are weighted according to the optimal gain weight to obtain the processed sampled values. The processed sampled values are mixed and superimposed to obtain first mixed two-channel PCM data. The first mixed two-channel PCM data is then limited according to a limiting function to obtain target mixed two-channel PCM data.
6. The automatic audio adjustment method based on multi-window mixing according to claim 4, characterized in that, The step of periodically calculating the target gain weight based on a preset fast algorithm and the timestamp to obtain the optimal gain weight specifically includes: Obtain the continuous gain weight, and periodically calculate the target gain weight according to the preset fast algorithm, the continuous gain weight and the timestamp to obtain the dynamic gain parameter; If the dynamic gain parameter reaches a preset value, the optimal left channel gain weight and the optimal right channel gain weight are calculated based on the dynamic gain parameter and the preset fast algorithm.
7. A method system for automatic audio adjustment based on multi-window mixing, characterized in that, The audio automatic adjustment method system based on multi-window mixing is applied to the audio automatic adjustment method based on multi-window mixing as described in any one of claims 1-6, wherein the audio automatic adjustment method system based on multi-window mixing comprises: The audio relationship table generation module is used to obtain dual-channel PCM data and target windows in multi-window mode, and establish a correspondence between the dual-channel PCM data and the target windows to obtain a correspondence table; The audio weight calculation module is used to obtain the base gain, and based on the correspondence table, dynamically calculates the target gain weight of the two-channel PCM data according to the preset mixing rules and the base gain. The mixing processing module is used to acquire mixed two-channel PCM data, and to perform mixing adjustment processing on the sampled values of the mixed two-channel PCM data according to a preset fast algorithm and the target gain weight to obtain target mixed two-channel PCM data.
8. A terminal, characterized in that, The terminal includes: a memory, a processor, and an audio automatic adjustment program based on multi-window mixing stored in the memory and executable on the processor. When the multi-window mixing-based audio automatic adjustment program is executed by the processor, it implements the steps of the audio automatic adjustment method based on multi-window mixing as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores an audio automatic adjustment program based on multi-window mixing, which, when executed by a processor, implements the steps of the audio automatic adjustment method based on multi-window mixing as described in any one of claims 1-6.
Citation Information
Patent Citations
Volume configuration method for split-screen window, storage medium and terminal equipment
CN113553024A
Audio processing method and device, electronic equipment and storage medium
CN116980633A
