Search

CN-120167116-B - Audio processing method, device, equipment and storage medium

CN120167116BCN 120167116 BCN120167116 BCN 120167116BCN-120167116-B

Abstract

The application discloses an audio processing method, device, equipment and storage medium, and relates to the technical field of computers. The method is executed by terminal equipment, the terminal equipment comprises a first loudspeaker and a second loudspeaker, the method comprises the steps of obtaining a left channel difference signal, a right channel difference signal and a common signal in audio signals under the condition that the first loudspeaker and the second loudspeaker are respectively located at two sides of the terminal equipment, performing strengthening processing on the common signal under the condition that the terminal equipment is in a first state to obtain processed audio signals, and performing signal offset processing on the left channel difference signal and the right channel difference signal under the condition that the terminal equipment is in a second state to obtain processed left channel audio signals and processed right channel audio signals. According to the application, different audio processing methods are adopted according to the positions of the two sides of the first loudspeaker and the second loudspeaker on the visual effect, so that the playing effect of stereophonic sound is improved.

Inventors

  • LIU CHENG
  • Urushi
  • WANG YUFEI

Assignees

  • 广州酷狗计算机科技有限公司

Dates

Publication Date
20260508
Application Date
20241220

Claims (12)

  1. 1. An audio processing method performed by a terminal device, the terminal device comprising a first speaker and a second speaker, the method comprising: Acquiring a left channel difference signal, a right channel difference signal and a common signal in audio signals under the condition that the first loudspeaker and the second loudspeaker are respectively positioned at two sides of the terminal equipment, wherein the left channel difference signal is a signal which is singly present in the left channel audio signal, the right channel difference signal is a signal which is singly present in the right channel audio signal, and the common signal is a signal which is jointly present in the left channel audio signal and the right channel audio signal; Performing strengthening processing on the common signal to obtain a processed audio signal when the terminal equipment is in a first state, and respectively outputting the processed audio signal in the first speaker and the second speaker, wherein the strengthening processing is used for improving the sound effect of the common signal in the audio signal, and the first state refers to a state that the first speaker and the second speaker are respectively positioned on the upper side and the lower side of the terminal equipment; And under the condition that the terminal equipment is in a second state, respectively performing signal cancellation processing on the left channel difference signal and the right channel difference signal to obtain a processed left channel audio signal and a processed right channel audio signal, outputting the processed left channel audio signal in the first loudspeaker and outputting the processed right channel audio signal in the second loudspeaker, wherein the signal cancellation processing is used for reducing the influence of the processed right channel audio signal on the playback effect of the processed left channel audio signal and reducing the influence of the processed left channel audio signal on the playback effect of the processed right channel audio signal, and the second state refers to the state that the first loudspeaker and the second loudspeaker are respectively positioned at the left side and the right side of the terminal equipment.
  2. 2. The method of claim 1, wherein the left channel difference signal comprises n left channel difference audio frames, the right channel difference signal comprises n right channel difference audio frames, the common signal comprises n common audio frames, n is an integer greater than 1; the step of performing reinforcement processing on the common signal to obtain a processed audio signal includes: Combining the left channel difference audio frame and the right channel difference audio frame into a single channel to obtain a single channel audio frame; Performing reinforcement processing on the common audio frame to obtain a processed common audio frame; superposing the mono audio frame and the processed common audio frame to obtain a processed audio frame; and splicing n processed audio frames to obtain the processed audio signals.
  3. 3. The method of claim 2, wherein the merging the left channel difference audio frame and the right channel difference audio frame into a mono audio frame comprises: superposing the left channel difference audio frame and the right channel difference audio frame to obtain a superposed audio frame; And delaying the superimposed audio frames for a first duration to obtain the mono audio frames.
  4. 4. A method according to claim 2 or 3, wherein said performing an emphasis process on said common audio frame results in a processed common audio frame, comprising: filtering the common audio frame through a high-pass filter and a low-pass filter to obtain a high-pass audio frame and a low-pass audio frame, wherein the high-pass filter and the low-pass filter are filters with complementary power; Delaying the high-pass audio frame for a second time length to obtain a delayed high-pass audio frame; performing equalization processing on the delayed high-pass audio frame through an equalizer to obtain a processed high-pass audio frame; and superposing the low-pass audio frame and the processed high-pass audio frame to obtain the processed common audio frame.
  5. 5. The method of claim 4, wherein the equalizer includes K peak filters, angular frequencies corresponding to the K peak filters are K frequency points in the frequency range of the delayed high-pass audio frame, the K frequency points are K frequency points in front of the order in which the frequency points in the frequency range of the delayed high-pass audio frame are ordered in order of fidelity from high to low, and K is a positive integer; And performing equalization processing on the delayed high-pass audio frame through an equalizer to obtain a processed high-pass audio frame, wherein the method comprises the following steps of: obtaining gain intervals corresponding to the K peak type filters according to the angular frequencies and the quality factors corresponding to the K peak type filters respectively, wherein the quality factors are used for indicating bandwidths of the peak type filters; and respectively executing gain processing on gain intervals respectively corresponding to the K peak type filters by adopting preset gain values through the K peak type filters to obtain the processed high-pass audio frame.
  6. 6. The method of claim 1, wherein the left channel difference signal comprises n left channel difference audio frames, the right channel difference signal comprises n right channel difference audio frames, the common signal comprises n common audio frames, n is an integer greater than 1; And performing signal cancellation processing on the left channel difference signal and the right channel difference signal respectively to obtain a processed left channel audio signal and a processed right channel audio signal, including: Performing reinforcement processing on the common audio frame to obtain a processed common audio frame; respectively executing signal cancellation processing on the left channel difference audio frame and the right channel difference audio frame to obtain a processed left channel difference audio frame and a processed right channel difference audio frame; Superposing the processed common audio frame and the processed left channel difference audio frame to obtain a processed left channel audio frame, and superposing the processed common audio frame and the processed right channel difference audio frame to obtain a processed right channel audio frame; and splicing n processed left channel audio frames to obtain the processed left channel audio signal, and splicing n processed right channel audio frames to obtain the processed right channel audio signal.
  7. 7. The method of claim 6, wherein the performing signal cancellation processing on the left channel difference audio frame and the right channel difference audio frame, respectively, results in a processed left channel difference audio frame and a processed right channel difference audio frame, comprising: Respectively executing opposite phase processing on the left channel difference audio frame and the right channel difference audio frame to obtain a left channel opposite phase difference audio frame corresponding to the left channel difference audio frame and a right channel opposite phase difference audio frame corresponding to the right channel difference audio frame; Combining the left channel opposite-phase difference audio frame with a gain control factor to obtain an opposite-phase controlled left channel difference audio frame, and combining the right channel opposite-phase difference audio frame with the gain control factor to obtain an opposite-phase controlled right channel difference audio frame; And superposing the left channel difference audio frame and the right channel difference audio frame after the inversion control to obtain the processed left channel difference audio frame, and superposing the right channel difference audio frame and the left channel difference audio frame after the inversion control to obtain the processed right channel difference audio frame.
  8. 8. The method of claim 1, wherein the method further comprises: And under the condition that the first loudspeaker and the second loudspeaker are positioned on the same side of the terminal equipment, performing strengthening processing on the common signal to obtain the processed audio signal, and respectively outputting the processed audio signal in the first loudspeaker and the second loudspeaker.
  9. 9. An audio processing apparatus, the apparatus comprising: A signal acquisition module, configured to acquire, when a first speaker and a second speaker are located on two sides of a terminal device, a left channel difference signal, a right channel difference signal, and a common signal in an audio signal, where the left channel difference signal is a signal that exists alone in a left channel audio signal, the right channel difference signal is a signal that exists alone in a right channel audio signal, and the common signal is a signal that exists together in the left channel audio signal and the right channel audio signal; a first processing module, configured to perform reinforcement processing on the common signal to obtain a processed audio signal when the terminal device is in a first state, where the reinforcement processing is used to enhance a sound effect of the common signal in the audio signal, and the first state refers to a state that the first speaker and the second speaker are located on an upper side and a lower side of the terminal device, respectively; And a second processing module, configured to perform signal cancellation processing on the left channel difference signal and the right channel difference signal, respectively, to obtain a processed left channel audio signal and a processed right channel audio signal, output the processed left channel audio signal in the first speaker, and output the processed right channel audio signal in the second speaker, where the signal cancellation processing is configured to reduce an influence of the processed right channel audio signal on a playback effect of the processed left channel audio signal, and reduce an influence of the processed left channel audio signal on a playback effect of the processed right channel audio signal, where the second state refers to a state in which the first speaker and the second speaker are located on a left side and a right side of the terminal device, respectively.
  10. 10. A terminal device comprising a processor and a memory, the memory having stored therein a computer program that is loaded and executed by the processor to implement the audio processing method of any of claims 1 to 8.
  11. 11. A computer readable storage medium having stored therein a computer program that is loaded and executed by a processor to implement the audio processing method of any of claims 1 to 8.
  12. 12. A computer program product comprising a computer program loaded and executed by a processor to implement the audio processing method of any one of claims 1 to 8.

Description

Audio processing method, device, equipment and storage medium Technical Field The present application relates to the field of computer technologies, and in particular, to an audio processing method, apparatus, device, and storage medium. Background With the development of technology, stereo speakers have begun to be popularized in terminal devices such as mobile phones and tablet computers, and compared with terminal devices with only one speaker, the terminal device with stereo speaker can retain stereo information when playing back audio, and the playback effect is better. In the related art, speakers of left and right channels of a terminal device are typically located above and below when the terminal device is in a vertical direction, for example, dual speakers are respectively distributed near an earpiece and a charging port of the terminal device, that is, a speaker of a left channel is located near the earpiece, and a speaker of a right channel is located near the charging port. The user usually holds the terminal device vertically, and then the left and right channels of the stereo sound can be played from the upper and lower sides of the terminal device at the same time, so that the user can hear the stereo sound playing effect. However, since the human ear requires stereo sound on the left and right sides, playing back stereo sound on the upper and lower sides may cause error in sound azimuth, affecting the playback effect of stereo sound. Disclosure of Invention The embodiment of the application provides an audio processing method, device, equipment and storage medium. The technical scheme provided by the embodiment of the application is as follows: according to an aspect of an embodiment of the present application, there is provided an audio processing method performed by a terminal device including a first speaker and a second speaker, the method including: Acquiring a left channel difference signal, a right channel difference signal and a common signal in audio signals under the condition that the first loudspeaker and the second loudspeaker are respectively positioned at two sides of the terminal equipment, wherein the left channel difference signal is a signal which is singly present in the left channel audio signal, the right channel difference signal is a signal which is singly present in the right channel audio signal, and the common signal is a signal which is jointly present in the left channel audio signal and the right channel audio signal; Performing strengthening processing on the common signal to obtain a processed audio signal when the terminal equipment is in a first state, and respectively outputting the processed audio signal in the first speaker and the second speaker, wherein the strengthening processing is used for improving the sound effect of the common signal in the audio signal, and the first state refers to a state that the first speaker and the second speaker are respectively positioned on the upper side and the lower side of the terminal equipment; And under the condition that the terminal equipment is in a second state, respectively performing signal cancellation processing on the left channel difference signal and the right channel difference signal to obtain a processed left channel audio signal and a processed right channel audio signal, outputting the processed left channel audio signal in the first loudspeaker and outputting the processed right channel audio signal in the second loudspeaker, wherein the signal cancellation processing is used for reducing the influence of the processed right channel audio signal on the playback effect of the processed left channel audio signal and reducing the influence of the processed left channel audio signal on the playback effect of the processed right channel audio signal, and the second state refers to the state that the first loudspeaker and the second loudspeaker are respectively positioned at the left side and the right side of the terminal equipment. According to an aspect of an embodiment of the present application, there is provided an audio processing apparatus including: A signal acquisition module, configured to acquire, when a first speaker and a second speaker are located on two sides of a terminal device, a left channel difference signal, a right channel difference signal, and a common signal in an audio signal, where the left channel difference signal is a signal that exists alone in a left channel audio signal, the right channel difference signal is a signal that exists alone in a right channel audio signal, and the common signal is a signal that exists together in the left channel audio signal and the right channel audio signal; a first processing module, configured to perform reinforcement processing on the common signal to obtain a processed audio signal when the terminal device is in a first state, where the reinforcement processing is used to enhance a sound effect of the common signal in the audio sign