Audio output method and device, electronic device, and storage medium

CN116634085BActive Publication Date: 2026-09-25HAINING ESWIN IC DESIGN CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310459406.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-23
Publication Date
2026-09-25
Estimated Expiration
2043-04-23

AI Technical Summary

Technical Problem

[0005]本公开提供一种音频输出方法、装置、电子设备及存储介质,用以解决现有的音频输出方法都具有一定的局限性,导致电子设备最终输出的目标音频不够准确的缺陷,实现在音量控制阶段中,能够对音频源的多个通道的音量幅度进行调整,以增设溢出反馈处理,进而提高目标音频的输出准确性

Benefits of technology

[0022]本公开提供的音频输出方法、装置、电子设备及存储介质,通过获取音频源对应的多个通道及各所述通道在当前时刻对应的第一音量幅度;针对各所述通道,根据所述通道对应的所述第一音量幅度及所述通道中采样点对应的初始音量幅度,确定所述通道对应的第二音量幅度;对所述多个通道对应的音频码流进行混合,得到目标音频,并对所述目标音频对应的通道进行混合,得到目标通道;基于各所述通道对应的第二音量幅度,通过所述目标通道输出所述目标音频。该方法用以解决现有的音频输出方法都具有一定的局限性,导致电子设备最终输出的目标音频不够准确的缺陷,实现在音量控制阶段中,能够对音频源的多个通道的音量幅度进行调整,以增设溢出反馈处理,进而提高目标音频的输出准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116634085B_ABST
    Figure CN116634085B_ABST
Patent Text Reader

Abstract

The present disclosure provides an audio output method, device, electronic equipment and storage medium, the method comprising: obtaining a plurality of channels corresponding to an audio source and a first volume amplitude corresponding to each channel at a current time; for each channel, determining a second volume amplitude corresponding to the channel according to the first volume amplitude corresponding to the channel and an initial volume amplitude corresponding to a sampling point in the channel; mixing audio code streams corresponding to the plurality of channels to obtain target audio, and mixing channels corresponding to the target audio to obtain target channels; and outputting the target audio through the target channels based on the second volume amplitude corresponding to each channel. The method is used to solve the problem that existing audio output methods have certain limitations, resulting in the defect that the final output target audio of the electronic equipment is not accurate enough, and to achieve adjusting the volume amplitude of the plurality of channels of the audio source in the volume control stage, to add overflow feedback processing, and to improve the output accuracy of the target audio.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing technology, and in particular to an audio output method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the rapid development of technology, the number of television audio systems is also increasing. When multiple audio streams are simultaneously connected to the audio interface or broadcast from the speaker in a television audio system, it is necessary to mix these multiple audio streams into a single stream so that it can be effectively connected to the audio interface or broadcast from the speaker.

[0003] In existing audio output methods, electronic devices can use three mixing algorithms to mix multiple audio bitstreams to output the mixed target audio. These three mixing algorithms can include: average mixing, alignment mixing, and self-alignment mixing. However, the average mixing algorithm causes a sharp decline in the performance of the target audio as the number of mixing paths increases; the alignment mixing algorithm causes the target audio volume to fluctuate during mixing, resulting in instability; and the self-alignment mixing algorithm introduces noise, leading to inaccurate target audio volume.

[0004] In summary, existing audio output methods all have certain limitations, resulting in inaccurate target audio output by electronic devices. Summary of the Invention

[0005] This disclosure provides an audio output method, apparatus, electronic device, and storage medium to address the limitations of existing audio output methods, which result in inaccurate target audio output by the electronic device. The method enables adjustment of the volume amplitude of multiple channels of the audio source during the volume control stage, and adds overflow feedback processing to improve the output accuracy of the target audio.

[0006] This disclosure provides an audio output method, including:

[0007] Obtain multiple channels corresponding to the audio source and the first volume amplitude of each channel at the current moment;

[0008] For each channel, the second volume amplitude corresponding to the channel is determined based on the first volume amplitude corresponding to the channel and the initial volume amplitude corresponding to the sampling point in the channel;

[0009] The audio streams corresponding to the multiple channels are mixed to obtain the target audio, and the channels corresponding to the target audio are mixed to obtain the target channel;

[0010] Based on the second volume amplitude corresponding to each channel, the target audio is output through the target channel.

[0011] According to an audio output method provided in this disclosure, the method of outputting target audio through a target channel based on the second volume amplitude corresponding to each channel includes: determining the target volume amplitude corresponding to the target audio based on the second volume amplitude corresponding to each channel and a preset mixing weight; and outputting the target audio through the target channel based on the target volume amplitude.

[0012] According to an audio output method provided in this disclosure, obtaining the first volume amplitude corresponding to each channel at the current moment includes: obtaining the third volume amplitude corresponding to each channel at the previous moment; and for each channel, determining the first volume amplitude corresponding to the channel at the current moment based on the third volume amplitude corresponding to the channel and a preset volume amplitude.

[0013] According to an audio output method provided in this disclosure, determining the first volume amplitude corresponding to the channel at the current moment based on the third volume amplitude corresponding to the channel and the preset volume amplitude includes: performing a weighted summation of the third volume amplitude corresponding to the channel and the preset volume amplitude to obtain the first volume amplitude corresponding to the channel at the current moment, wherein the sum of the weight corresponding to the third volume amplitude and the weight corresponding to the preset volume amplitude is 1.

[0014] According to an audio output method provided in this disclosure, determining a second volume amplitude corresponding to a channel based on a first volume amplitude corresponding to the channel and an initial volume amplitude corresponding to a sampling point in the channel includes: determining an adjustment coefficient based on the first volume amplitude corresponding to the channel; multiplying the adjustment coefficient by the initial volume amplitude corresponding to a sampling point in the channel to obtain a second volume amplitude corresponding to the sampling point; and determining a second volume amplitude corresponding to the channel based on the second volume amplitudes corresponding to all sampling points.

[0015] According to an audio output method provided in this disclosure, determining the target volume amplitude of the target audio based on the second volume amplitude corresponding to each channel and the preset mixing weight includes: determining the current volume amplitude corresponding to a specified channel in the target audio based on the second volume amplitude corresponding to each channel and the preset mixing weight; if the current volume amplitude does not meet the preset volume amplitude threshold, adjusting the preset mixing weight corresponding to the specified channel so that the current volume amplitude meets the preset volume amplitude range, thereby obtaining the target volume amplitude of the target audio.

[0016] According to an audio output method provided in this disclosure, the method of mixing the channels corresponding to the target audio to obtain a target channel includes: determining preset weight parameters corresponding to each of the multiple channels corresponding to the target audio, wherein the preset weight parameters are all positive numbers and the sum of the preset weight parameters is 1; and mixing the multiple channels corresponding to the target audio according to each preset weight parameter to obtain a target channel.

[0017] This disclosure also provides an audio output device, including:

[0018] The acquisition module is used to acquire multiple channels corresponding to the audio source and the first volume amplitude of each channel at the current moment.

[0019] The processing module is used to determine the second volume amplitude corresponding to each channel based on the first volume amplitude corresponding to the channel and the initial volume amplitude corresponding to the sampling point in the channel; mix the audio bitstreams corresponding to the multiple channels to obtain the target audio, and mix the channels corresponding to the target audio to obtain the target channel; and output the target audio through the target channel based on the second volume amplitude corresponding to each channel.

[0020] This disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements an audio output method as described above.

[0021] This disclosure also provides a non-transitory computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the audio output method as described above.

[0022] The audio output method, apparatus, electronic device, and storage medium disclosed herein acquire multiple channels corresponding to an audio source and a first volume amplitude corresponding to each channel at the current moment; for each channel, a second volume amplitude corresponding to the channel is determined based on the first volume amplitude corresponding to the channel and the initial volume amplitude corresponding to the sampling point in the channel; the audio bitstreams corresponding to the multiple channels are mixed to obtain a target audio, and the channels corresponding to the target audio are mixed to obtain a target channel; based on the second volume amplitude corresponding to each channel, the target audio is output through the target channel. This method addresses the limitations of existing audio output methods, which result in inaccurate target audio output by the electronic device. It enables adjustment of the volume amplitudes of multiple channels of the audio source during the volume control stage, adding overflow feedback processing to improve the accuracy of the target audio output. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 This is a flowchart illustrating the audio output method provided in this disclosure;

[0025] Figure 2 This is a schematic diagram of the audio output device provided in this disclosure;

[0026] Figure 3 This is a schematic diagram of the structure of the electronic device provided in this disclosure. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of this disclosure clearer, the technical solutions of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0028] It should be noted that the execution entity involved in the embodiments of this disclosure can be an audio output device or an electronic device. Optionally, the electronic device may include: a computer, a mobile terminal, and a wearable device, etc.

[0029] The embodiments of this disclosure will be further described below using an electronic device as an example.

[0030] like Figure 1 The diagram shown is a flowchart of the audio output method provided in this disclosure, which may include:

[0031] 101. Obtain multiple channels corresponding to the audio source and the first volume amplitude of each channel at the current moment.

[0032] The audio source refers to the audio to be output from the electronic device.

[0033] Channels are used to transmit audio streams, which refer to the data flow used by a video or audio file per unit of time. The number of channels can be represented by M, where M is an integer greater than or equal to 2.

[0034] Volume amplitude refers to the output volume of an audio source, measured in decibels (dB).

[0035] During the volume control phase, the electronic device can first acquire the audio source and the multiple channels corresponding to the audio source; then, the electronic device acquires the first volume amplitude corresponding to each of these multiple channels at the current moment, so as to adjust the first volume amplitude later.

[0036] Optionally, the first volume amplitude corresponding to each channel can be the same or different; no specific limitation is made here.

[0037] In some embodiments, the electronic device may obtain the first volume amplitude corresponding to each channel at the current moment by: the electronic device obtaining the third volume amplitude corresponding to each channel at the previous moment; and the electronic device determining the first volume amplitude corresponding to each channel at the current moment based on the third volume amplitude corresponding to the channel and a preset volume amplitude.

[0038] The preset volume level is user-defined.

[0039] In the process of acquiring the first volume amplitude, the electronic device can first acquire the third volume amplitude corresponding to each channel at the previous moment, and acquire the preset volume amplitude; then, for any channel among the multiple channels, the electronic device can determine the first volume amplitude corresponding to any channel at the current moment based on the third volume amplitude and the first parameter corresponding to any channel, and the preset volume amplitude and the second parameter corresponding to any channel. In this way, the electronic device can determine the first volume amplitude corresponding to each of the multiple channels.

[0040] Both the first parameter and the second parameter are positive numbers, and the sum of the first parameter and the second parameter is 1.

[0041] It should be noted that the timing of the electronic device acquiring the third volume amplitude is not limited to the timing of the electronic device acquiring the preset volume amplitude.

[0042] In some embodiments, the electronic device determines the first volume amplitude corresponding to the channel at the current moment based on the third volume amplitude corresponding to the channel and the preset volume amplitude. This may include: the electronic device performing a weighted summation of the third volume amplitude corresponding to the channel and the preset volume amplitude to obtain the first volume amplitude corresponding to the channel at the current moment, wherein the sum of the weight corresponding to the third volume amplitude and the weight corresponding to the preset volume amplitude is 1.

[0043] The first volume amplitude can be calculated using a first formula, which is:

[0044] current_frac1=a0*current_frac0+(1-a0)*dest_frac;

[0045] current_frac1 represents the first volume amplitude; a0 represents the weight corresponding to the third volume amplitude, which can also be called the adjustment parameter or the first parameter; 1-a0=b0 represents the weight corresponding to the preset volume amplitude, which can be called the second parameter; current_frac0 represents the third volume amplitude; dest_frac represents the preset volume amplitude.

[0046] Where, the adjustment parameter a0 = (1-percent)^(1 / n_sample_at);

[0047] Percent represents the preset constant; n_sample_at = at_time / (1 / fs) represents the third parameter, where at_time represents the time taken for each volume adjustment; and fs represents the sampling rate.

[0048] According to the first formula, the electronic device can accurately determine the first volume amplitude corresponding to any one of the multiple channels at the current moment, and the first volume amplitude is also relatively accurate.

[0049] 102. For each channel, determine the second volume amplitude corresponding to the channel based on the first volume amplitude corresponding to the channel and the initial volume amplitude corresponding to the sampling point in the channel.

[0050] The number of sampling points in the channel is unlimited.

[0051] After acquiring multiple channels, the electronic device can asynchronously sample each channel to obtain the sampling point corresponding to each channel. Then, for any channel among the multiple channels, the electronic device can determine the initial volume amplitude corresponding to the sampling point in that channel, and determine the second volume amplitude corresponding to that channel based on the initial volume amplitude and the previously acquired first volume amplitude. In this way, the electronic device can determine the second volume amplitude corresponding to each of the multiple channels.

[0052] Optionally, the second volume amplitude corresponding to each channel can be the same or different; no specific limitation is made here.

[0053] In some embodiments, the electronic device determines the second volume amplitude corresponding to a channel based on the first volume amplitude corresponding to the channel and the initial volume amplitude corresponding to the sampling point in the channel. This may include: the electronic device determining an adjustment coefficient based on the first volume amplitude corresponding to the channel; the electronic device multiplying the adjustment coefficient by the initial volume amplitude corresponding to the sampling point in the channel to obtain the second volume amplitude corresponding to the sampling point; and the electronic device determining the second volume amplitude corresponding to the channel based on the second volume amplitudes corresponding to all sampling points.

[0054] In determining the second volume amplitude corresponding to a channel, the electronic device can first determine an adjustment coefficient based on the first volume amplitude to adjust the initial volume amplitude corresponding to the sampling point in the channel, thus accurately obtaining the second volume amplitude corresponding to that sampling point. Specifically, the product of the adjustment coefficient and the initial volume amplitude is determined as the second volume amplitude. Optionally, the value of the adjustment coefficient can be the value of the first volume amplitude. Based on this, the electronic device will acquire the second volume amplitude corresponding to the number of sampling points in the channel, and then determine the second volume amplitude corresponding to the channel based on the second volume amplitudes corresponding to all sampling points.

[0055] Optionally, the second volume amplitude corresponding to the sampling point can be calculated by the second formula, which is: y_out(i)=y(i)*current_frac'1;

[0056] y_out(i) represents the second volume amplitude; y(i) represents the initial volume amplitude corresponding to the i-th sampling point in the channel; current_frac'1 represents the adjustment coefficient.

[0057] It should be noted that when the above adjustment coefficient is the value of the first volume amplitude, current_frac'1 = current_frac1.

[0058] According to the second formula, the electronic device can accurately determine the second volume amplitude corresponding to any sampling point in any channel among multiple channels, and the second volume amplitude is also relatively accurate.

[0059] In summary, the electronic device can effectively reduce the amplitude of the audio signal in steps 101 and 102, thereby preventing overflow caused by the superposition of sampled values ​​from various channels during the subsequent mixing stage. In other words, the adjustment of the first volume amplitude during the volume control stage can effectively prevent data overflow.

[0060] 103. Mix the audio streams corresponding to multiple channels to obtain the target audio, and mix the channels corresponding to the target audio to obtain the target channel.

[0061] After the volume control stage is completed, the electronic device can enter the mixing stage. In the mixing stage, the electronic device can first determine the audio bitstream corresponding to each channel; then, the electronic device mixes the audio bitstreams to obtain the target audio; next, the electronic device mixes the channels corresponding to the target audio to obtain the target channel, so that subsequent electronic devices can use the target channel to effectively output the target audio.

[0062] 104. Based on the second volume amplitude corresponding to each channel, output the target audio through the target channel.

[0063] In some embodiments, the electronic device outputs target audio through a target channel based on the second volume amplitude corresponding to each channel, which may include: the electronic device determining the target volume amplitude corresponding to the target audio based on the second volume amplitude corresponding to each channel and a preset mixing weight; the electronic device outputting the target audio through a target channel based on the target volume amplitude.

[0064] The preset mixing weights can be set at the factory or customized by the user based on actual conditions. The preset mixing weights for each channel can be the same or different; no specific limitation is made here. In other words, the preset mixing weights are flexible and configurable, simple to calculate, and easy to implement in hardware.

[0065] Optionally, the preset mixing weights are all positive numbers and the sum of the preset mixing weights is 1.

[0066] The electronic device can adjust the preset mixing weights based on the second volume amplitude to determine the target volume amplitude corresponding to the target audio with higher accuracy; then, based on the target volume amplitude, the electronic device effectively outputs the target audio using the target channel to improve the output accuracy of the target audio.

[0067] It should be noted that the entire mixing process introduces virtually no noise, making it extremely easy to implement simultaneously in both hardware and software. Furthermore, the process requires no intervention from the Central Processing Unit (CPU), has virtually no latency, and can effectively improve data processing speed.

[0068] In some embodiments, the electronic device determines the target volume amplitude corresponding to the target audio based on the second volume amplitude corresponding to each channel and the preset mixing weights. This may include: the electronic device determining the current volume amplitude corresponding to a specified channel in the target audio based on the second volume amplitude corresponding to each channel and the preset mixing weights; if the current volume amplitude does not meet the preset volume amplitude threshold, the electronic device adjusts the preset mixing weights corresponding to the specified channel so that the current volume amplitude meets the preset volume amplitude range, thereby obtaining the target volume amplitude corresponding to the target audio.

[0069] The preset volume amplitude range is constructed by a first preset volume amplitude threshold and a second preset volume amplitude threshold, wherein the first preset volume amplitude threshold is less than the second preset volume amplitude threshold.

[0070] Optionally, the preset volume range can be set before the electronic device leaves the factory, or it can be customized by the user according to the actual situation; no specific limitation is made here.

[0071] The electronic device can first determine the current volume amplitude corresponding to a specified channel in the target audio based on a second volume amplitude and a preset mixing weight; then, the electronic device compares the current volume amplitude with a preset volume amplitude range, and there may be two situations in which the current volume amplitude does not meet the preset volume amplitude range:

[0072] Case 1: When the current volume amplitude is less than the first preset volume amplitude threshold, the electronic device can increase the preset mixing weight corresponding to the specified channel and decrease the preset mixing weight corresponding to other channels, so that the current volume amplitude is greater than or equal to the first preset volume amplitude threshold and less than or equal to the second preset volume amplitude threshold, thereby obtaining the target volume amplitude corresponding to the target audio.

[0073] Among them, other channels are all channels in the target audio except for the specified channel.

[0074] Scenario 2: When the current volume amplitude is greater than the second preset volume amplitude threshold, the electronic device can reduce the preset mixing weight corresponding to the specified channel and increase the preset mixing weight corresponding to other channels, so that the current volume amplitude is less than or equal to the second preset volume amplitude threshold and greater than or equal to the first preset volume amplitude threshold, thereby obtaining the target volume amplitude corresponding to the target audio.

[0075] However, if the current volume level meets the preset volume level range, the electronic device does not need to adjust the preset mixing weights.

[0076] Optionally, the electronic device determines the target volume amplitude corresponding to the target audio based on the second volume amplitude corresponding to each channel and the preset mixing weights. This may include: when the audio bitstream corresponding to the target audio experiences data overflow, or when the volume amplitude corresponding to the target audio is less than a preset threshold, the electronic device uses a mixing algorithm based on the second volume amplitude to adjust the preset mixing weights to obtain the target volume amplitude corresponding to the target audio.

[0077] Among them, the mixing algorithm refers to the algorithm that can adjust the preset mixing weights of each channel, which can flexibly meet various user needs and is not affected by the number of mixing channels.

[0078] Optionally, the mixing algorithm may include alignment algorithms or clamping algorithms, etc.

[0079] The alignment algorithm refers to using the maximum absolute value of the sampled values ​​in the current mixing frame of each audio stream and the maximum absolute value of the sampled values ​​in the accumulated result when calculating the mixing weights. Since the calculation of these mixing weights is related to the maximum value of each audio sampled value, the sampled values ​​need to be processed twice during the calculation. Furthermore, during real-time mixing, different mixing weights in two consecutive mixing frames can cause fluctuations in volume.

[0080] Clamping algorithms introduce a clamping factor with an initial value of 1 when calculating mix weights. If any data stream overflows during calculation, the clamping factor needs to be recalculated. Clamping algorithms effectively avoid the problems of alignment algorithms. However, if the number of mix streams is large, the clamping factor changes more frequently, increasing the probability of overflow. If the number of mix streams continues to increase in this state, the mix weights and volume will fluctuate drastically.

[0081] Optionally, the preset threshold can be set before the electronic device leaves the factory or it can be user-defined; no specific limitation is made here.

[0082] After acquiring the audio bitstream corresponding to the target audio, if the electronic device determines that the audio bitstream has a data overflow, it can adaptively adjust the preset mixing weights through mixing algorithms such as alignment algorithms and clamping algorithms, and effectively prevent data overflow by using overflow feedback; or, if the electronic device determines that the volume amplitude corresponding to the target audio is less than a preset threshold, it means that the volume amplitude is small. In this case, it can adaptively adjust the preset mixing weights through the above mixing algorithms to increase the volume amplitude corresponding to the target audio.

[0083] Optionally, after the electronic device determines that the audio bitstream corresponding to the target audio has experienced data overflow, the method may further include: the electronic device adjusting the first parameter and the second parameter in the volume control algorithm so that the audio bitstream corresponding to the final acquired target audio will not experience data overflow, thereby effectively preventing data overflow.

[0084] In some embodiments, the electronic device mixes the channels corresponding to the target audio to obtain the target channel, which may include: the electronic device determining the preset weight parameters corresponding to each of the multiple channels corresponding to the target audio; the electronic device mixing the multiple channels corresponding to the target audio according to the preset weight parameters to obtain the target channel.

[0085] The preset weight parameters are adjustable, and all preset weight parameters are positive numbers with a sum of 1.

[0086] Optionally, the preset weight parameters can be set before the electronic device leaves the factory, or they can be customized by the user according to the actual situation. The preset weight parameters corresponding to each channel can be the same or different, and there is no specific limitation here.

[0087] For example, electronic devices often use average weighted summation for weighted summation between channels. For example, if there are N channels, where N is an integer greater than or equal to 2, the target channel is the result of multiplying each of these N channels by 1 / N and then summing them.

[0088] Optionally, if a virtual channel exists in the electronic device, the preset mixing weights can be replaced with a preset mixing matrix to determine the target volume amplitude corresponding to the target audio, and the target audio can be output using the target channel based on the target volume amplitude.

[0089] In this way, regardless of whether virtual audio channels exist, electronic devices can adapt to more usage scenarios, thereby improving the utilization rate of the electronic devices and outputting target audio more effectively.

[0090] In this embodiment, multiple channels corresponding to an audio source and the first volume amplitude of each channel at the current moment are obtained. For each channel, a second volume amplitude is determined based on the first volume amplitude of the channel and the initial volume amplitude of the sampling point in the channel. The audio streams corresponding to multiple channels are mixed to obtain the target audio, and the channels corresponding to the target audio are mixed to obtain the target channel. Based on the second volume amplitude of each channel, the target audio is output through the target channel. This method addresses the limitations of existing audio output methods, which result in inaccurate target audio output by electronic devices. It enables adjustment of the volume amplitude of multiple channels of the audio source during the volume control stage, adding overflow feedback processing to improve the output accuracy of the target audio.

[0091] In addition, the embodiments disclosed herein have advantages such as stable target audio performance, elimination of volume changes, and low operational complexity.

[0092] The audio output device provided in this disclosure is described below. The audio output device described below can be referred to in correspondence with the audio output method described above.

[0093] like Figure 2 The diagram shown is a structural schematic of the audio output device provided in this disclosure, which may include:

[0094] The acquisition module 201 is used to acquire multiple channels corresponding to the audio source and the first volume amplitude of each channel at the current moment;

[0095] The processing module 202 is used to determine the second volume amplitude corresponding to each channel based on the first volume amplitude corresponding to the channel and the initial volume amplitude corresponding to the sampling point in the channel; mix the audio bitstreams corresponding to the multiple channels to obtain the target audio, and mix the channels corresponding to the target audio to obtain the target channel; and output the target audio through the target channel based on the second volume amplitude corresponding to each channel.

[0096] Optionally, the processing module 202 is specifically used to determine the target volume amplitude corresponding to the target audio based on the second volume amplitude corresponding to each channel and the preset mixing weight; and to output the target audio through the target channel based on the target volume amplitude.

[0097] Optionally, the acquisition module 201 includes an acquisition unit 2011 and a processing unit 2012;

[0098] Acquisition unit 2011 is used to acquire the third volume amplitude of each channel at the previous moment;

[0099] The processing unit 2012 is used to determine the first volume amplitude corresponding to the channel at the current moment based on the third volume amplitude and the preset volume amplitude corresponding to the channel.

[0100] Optionally, the processing module 202 is specifically used to perform a weighted summation of the third volume amplitude and the preset volume amplitude corresponding to the channel to obtain the first volume amplitude corresponding to the channel at the current moment, wherein the sum of the weight corresponding to the third volume amplitude and the weight corresponding to the preset volume amplitude is 1.

[0101] Optionally, the processing module 202 is specifically used to determine an adjustment coefficient based on the first volume amplitude corresponding to the channel; multiply the adjustment coefficient by the initial volume amplitude corresponding to the sampling point in the channel to obtain the second volume amplitude corresponding to the sampling point; and determine the second volume amplitude corresponding to the channel based on the second volume amplitudes corresponding to all sampling points.

[0102] Optionally, the processing module 202 is specifically used to determine the current volume amplitude corresponding to a specified channel in the target audio based on the second volume amplitude corresponding to each channel and the preset mixing weight; if the current volume amplitude does not meet the preset volume amplitude threshold, adjust the preset mixing weight corresponding to the specified channel so that the current volume amplitude meets the preset volume amplitude range, thereby obtaining the target volume amplitude corresponding to the target audio.

[0103] Optionally, the processing module 202 is specifically used to determine the preset weight parameters corresponding to each of the multiple channels of the target audio, wherein the preset weight parameters are all positive numbers and the sum of the preset weight parameters is 1; and to mix the multiple channels corresponding to the target audio according to each preset weight parameter to obtain the target channel.

[0104] like Figure 3 The diagram shows the structure of the electronic device provided in this disclosure. The electronic device may include a processor 310, a communication interface 320, a memory 330, and a communication bus 340. The processor 310, communication interface 320, and memory 330 communicate with each other via the communication bus 340. The processor 310 can call logical instructions in the memory 330 to execute an audio output method. This method includes: acquiring multiple channels corresponding to an audio source and a first volume amplitude corresponding to each channel at the current time; for each channel, determining a second volume amplitude corresponding to the channel based on the first volume amplitude and the initial volume amplitude corresponding to the sampling point in the channel; mixing the audio streams corresponding to the multiple channels to obtain a target audio, and mixing the channels corresponding to the target audio to obtain a target channel; and outputting the target audio through the target channel based on the second volume amplitude corresponding to each channel.

[0105] Furthermore, the logical instructions in the aforementioned memory 330 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0106] In another aspect, this disclosure also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, is implemented to perform the audio output method provided by the methods described above. The method includes: acquiring multiple channels corresponding to an audio source and a first volume amplitude corresponding to each channel at the current time; for each channel, determining a second volume amplitude corresponding to the channel based on the first volume amplitude corresponding to the channel and the initial volume amplitude corresponding to the sampling point in the channel; mixing the audio bitstreams corresponding to the multiple channels to obtain a target audio, and mixing the channels corresponding to the target audio to obtain a target channel; and outputting the target audio through the target channel based on the second volume amplitude corresponding to each channel.

[0107] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0108] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0109] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this disclosure, and are not intended to limit them. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure.

Claims

1. An audio output method, characterized in that, include: Obtain multiple channels corresponding to the audio source and the first volume amplitude of each channel at the current moment; For each of the channels, the second volume amplitude corresponding to the channel is determined based on the first volume amplitude corresponding to the channel and the initial volume amplitude corresponding to the sampling point in the channel; The audio streams corresponding to the multiple channels are mixed to obtain the target audio, and the channels corresponding to the target audio are mixed to obtain the target channel; Based on the second volume amplitude corresponding to each of the channels, the target audio is output through the target channel; The step of determining the second volume amplitude corresponding to the channel based on the first volume amplitude corresponding to the channel and the initial volume amplitude corresponding to the sampling point in the channel includes: The adjustment coefficient is determined based on the first volume amplitude corresponding to the channel; Multiply the adjustment coefficient by the initial volume amplitude corresponding to the sampling point in the channel to obtain the second volume amplitude corresponding to the sampling point; The second volume amplitude corresponding to the channel is determined based on the second volume amplitude corresponding to all sampling points; Obtaining the first volume amplitude of each channel at the current time includes: Obtain the third volume amplitude of each channel at the previous moment; For each channel, the third volume amplitude and the preset volume amplitude corresponding to the channel are weighted and summed to obtain the first volume amplitude corresponding to the channel at the current time. The weight corresponding to the third volume amplitude is a0, and the weight corresponding to the preset volume amplitude is 1-a0, and a0=(1-percent)^(1 / n_sample_at), where percent represents a preset constant; n_sample_at=at_time / (1 / fs), which represents the third parameter, at_time represents the time taken for each volume amplitude adjustment; and fs represents the sampling rate.

2. The method according to claim 1, characterized in that, The step of outputting the target audio through the target channel based on the second volume amplitude corresponding to each of the channels includes: Based on the second volume amplitude corresponding to each channel and the preset mixing weight, the target volume amplitude corresponding to the target audio is determined; Based on the target volume amplitude, the target audio is output through the target channel.

3. The method according to claim 2, characterized in that, The step of determining the target volume amplitude corresponding to the target audio based on the second volume amplitude corresponding to each of the channels and the preset mixing weights includes: Based on the second volume amplitude corresponding to each channel and the preset mixing weight, the current volume amplitude corresponding to the specified channel in the target audio is determined; If the current volume amplitude does not meet the preset volume amplitude range, adjust the preset mixing weight corresponding to the specified channel so that the current volume amplitude meets the preset volume amplitude range, thereby obtaining the target volume amplitude corresponding to the target audio.

4. The method according to any one of claims 1-3, characterized in that, The process of mixing the channels corresponding to the target audio to obtain the target channel includes: Determine the preset weight parameters corresponding to each of the multiple channels of the target audio, wherein all preset weight parameters are positive numbers and the sum of the preset weight parameters is 1; According to the preset weight parameters, the multiple channels corresponding to the target audio are mixed to obtain the target channel.

5. An audio output device, characterized in that, include: The acquisition module is used to acquire multiple channels corresponding to the audio source and the first volume amplitude of each channel at the current moment; The processing module is configured to, for each of the channels, determine the second volume amplitude corresponding to the channel based on the first volume amplitude corresponding to the channel and the initial volume amplitude corresponding to the sampling point in the channel; mix the audio bitstreams corresponding to the multiple channels to obtain target audio, and mix the channels corresponding to the target audio to obtain target channels; and output the target audio through the target channels based on the second volume amplitude corresponding to each of the channels. The processing module is specifically configured to: determine an adjustment coefficient based on the first volume amplitude corresponding to the channel; multiply the adjustment coefficient by the initial volume amplitude corresponding to the sampling point in the channel to obtain the second volume amplitude corresponding to the sampling point; and determine the second volume amplitude corresponding to the channel based on the second volume amplitudes corresponding to all sampling points. The acquisition module is specifically used for: Obtain the third volume amplitude of each channel at the previous moment; For each channel, the third volume amplitude and the preset volume amplitude corresponding to the channel are weighted and summed to obtain the first volume amplitude corresponding to the channel at the current time. The weight corresponding to the third volume amplitude is a0, and the weight corresponding to the preset volume amplitude is 1-a0, and a0=(1-percent)^(1 / n_sample_at), where percent represents a preset constant; n_sample_at=at_time / (1 / fs), which represents the third parameter, at_time represents the time taken for each volume amplitude adjustment; and fs represents the sampling rate.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the audio output method as described in any one of claims 1 to 4.

7. 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, it implements the audio output method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Audio mixing processing system and audio mixing processing method

    CN101989430A

  • Volume control method and device

    CN105991103A

  • Audio processing device and audio processing method

    CN112995856A