[go: up one dir, main page]

CN112840678B - Stereo playing method, device, storage medium and electronic equipment - Google Patents

Stereo playing method, device, storage medium and electronic equipment Download PDF

Info

Publication number
CN112840678B
CN112840678B CN201880098484.4A CN201880098484A CN112840678B CN 112840678 B CN112840678 B CN 112840678B CN 201880098484 A CN201880098484 A CN 201880098484A CN 112840678 B CN112840678 B CN 112840678B
Authority
CN
China
Prior art keywords
signal
stereo
channel signal
virtual
audio
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201880098484.4A
Other languages
Chinese (zh)
Other versions
CN112840678A (en
Inventor
陈岩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Shenzhen Huantai Technology Co Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Shenzhen Huantai Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd, Shenzhen Huantai Technology Co Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Publication of CN112840678A publication Critical patent/CN112840678A/en
Application granted granted Critical
Publication of CN112840678B publication Critical patent/CN112840678B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04SSTEREOPHONIC SYSTEMS 
    • H04S1/00Two-channel systems
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L19/00Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis
    • G10L19/008Multichannel audio signal coding or decoding using interchannel correlation to reduce redundancy, e.g. joint-stereo, intensity-coding or matrixing

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Acoustics & Sound (AREA)
  • Signal Processing (AREA)
  • Stereophonic System (AREA)

Abstract

本申请公开了一种立体声播放方法,包括:提取音频信号中具有方位信息的立体声信号,对所述立体声信号进行解码,以得到多声道信号,将所述多声道信号转码成双声道信号,分别对所述双声道信号进行串扰消除并输出至所述双扬声器进行播放。本申请还提供了一种立体声播放装置、存储介质及电子设备。

Figure 201880098484

The present application discloses a stereo playback method, comprising: extracting a stereo signal with orientation information in an audio signal, decoding the stereo signal to obtain a multi-channel signal, and transcoding the multi-channel signal into two-sound The two-channel signals are respectively subjected to crosstalk cancellation and output to the two speakers for playback. The present application also provides a stereo playback device, a storage medium and an electronic device.

Figure 201880098484

Description

立体声播放方法、装置、存储介质及电子设备Stereo playback method, device, storage medium and electronic device

技术领域technical field

本申请属于声学技术领域,尤其涉及一种立体声播放方法、装置、存储介质及电子设备。The present application belongs to the technical field of acoustics, and in particular, relates to a stereo playback method, device, storage medium and electronic device.

背景技术Background technique

随着电子设备的不断发展,手机上的多媒体播放功能已经成为用户日常使用的功能之一,用户对手机音频播放效果的要求也越来越高,目前提高音频播放效果的方式之一是实现立体声播放,实现立体声播放的效果需要较大的空间和设备,不利于手机等便携电子设备实现立体声播放,目前大部分厂商的解决方案是通过耳机端构建虚拟扬声器阵列来实现立体声播放的效果,另一种解决方案是在手机上设置两个扬声器作为外放设备,在提高音量的同时,也可以实现立体声播放的效果。With the continuous development of electronic devices, the multimedia playback function on mobile phones has become one of the functions that users use on a daily basis, and users have higher and higher requirements for the audio playback effect of mobile phones. Currently, one of the ways to improve the audio playback effect is to achieve stereo sound Play, to achieve the effect of stereo playback requires a large space and equipment, which is not conducive to the realization of stereo playback on portable electronic devices such as mobile phones. One solution is to set two speakers on the mobile phone as external devices, which can achieve the effect of stereo playback while increasing the volume.

发明内容SUMMARY OF THE INVENTION

本申请实施例提供一种立体声播放方法、装置、存储介质及电子设备,可以实现立体声播放的效果。Embodiments of the present application provide a stereo playback method, device, storage medium, and electronic device, which can achieve the effect of stereo playback.

第一方面,本申请实施例提供一种立体声播放方法,应用于电子设备,所述电子设备包括双扬声器,所述方法包括:In a first aspect, an embodiment of the present application provides a stereo playback method, which is applied to an electronic device, where the electronic device includes dual speakers, and the method includes:

提取音频信号中具有方位信息的立体声信号;Extract the stereo signal with orientation information in the audio signal;

对所述立体声信号进行解码,以得到多声道信号;decoding the stereo signal to obtain a multi-channel signal;

对所述多声道信号转码成双声道信号;transcoding the multi-channel signal into a two-channel signal;

分别对所述双声道信号进行串扰消除并输出至所述双扬声器进行播放。Crosstalk cancellation is performed on the two-channel signals respectively, and the two-channel signals are output to the two speakers for playback.

第二方面,本申请实施例提供一种立体声播放装置,应用于电子设备,所述电子设备包括双扬声器,所述装置包括:In a second aspect, an embodiment of the present application provides a stereo playback device, which is applied to an electronic device, where the electronic device includes dual speakers, and the device includes:

提取模块,用于提取音频信号中具有方位信息的立体声信号;The extraction module is used to extract the stereo signal with orientation information in the audio signal;

解码模块,用于对所述立体声信号进行解码,以得到多声道信号;a decoding module for decoding the stereo signal to obtain a multi-channel signal;

转码模块,用于将所述多声道信号转码成双声道信号;a transcoding module for transcoding the multi-channel signal into a two-channel signal;

串扰消除模块,用于分别对所述双声道信号进行串扰消除。A crosstalk cancellation module, configured to perform crosstalk cancellation on the two-channel signals respectively.

第三方面,本申请实施例提供了一种存储介质,其上存储有计算机程序,其中,当所述计算机程序在计算机上执行时,使得所述计算机执行本实施例第一方面提供的立体声播放方法。In a third aspect, an embodiment of the present application provides a storage medium on which a computer program is stored, wherein, when the computer program is executed on a computer, the computer is caused to execute the stereo playback provided in the first aspect of this embodiment. method.

第四方面,本申请实施例提供了一种用于立体声播放的电子设备,包括双扬声器、处理器及存储器,其中,所述处理器通过调用所述存储器中的计算机程序,用于执行:In a fourth aspect, an embodiment of the present application provides an electronic device for stereo playback, including dual speakers, a processor, and a memory, wherein the processor is configured to execute: by invoking a computer program in the memory:

提取音频信号中具有方位信息的立体声信号;Extract the stereo signal with orientation information in the audio signal;

对所述立体声信号进行解码,以得到多声道信号;decoding the stereo signal to obtain a multi-channel signal;

将所述多声道信号转码成双声道信号;transcoding the multi-channel signal into a two-channel signal;

分别对所述双声道信号进行串扰消除并输出至所述双扬声器进行播放。Crosstalk cancellation is performed on the two-channel signals respectively, and the two-channel signals are output to the two speakers for playback.

由于本申请实施例可以将多声道信号转码成双声道信号,最后对具有立体声信号的双声道信号进行串扰消除,可以达到双扬声器播放音频时有立体声播放效果。Because the embodiment of the present application can transcode multi-channel signals into two-channel signals, and finally perform crosstalk cancellation on the two-channel signals with stereo signals, it is possible to achieve a stereo playback effect when two speakers play audio.

附图说明Description of drawings

下面结合附图,通过对本申请的具体实施方式详细描述,将使本申请的技术方案及其有益效果显而易见。The technical solutions of the present application and the beneficial effects thereof will be apparent through the detailed description of the specific embodiments of the present application in conjunction with the accompanying drawings.

图1是本申请实施例提供的立体声播放方法的第一种流程图。FIG. 1 is a first flow chart of a stereo playback method provided by an embodiment of the present application.

图2是本申请实施例提供的立体声播放方法的第二种流程图。FIG. 2 is a second flowchart of a stereo playback method provided by an embodiment of the present application.

图3是本申请实施例提供的立体声播放的第一种场景示意图。FIG. 3 is a schematic diagram of a first scenario of stereo playback provided by an embodiment of the present application.

图4是本申请实施例提供的立体声播放的第二种场景示意图。FIG. 4 is a schematic diagram of a second scenario of stereo playback provided by an embodiment of the present application.

图5是本申请实施例提供的立体声播放装置的第一种结构示意图。FIG. 5 is a first structural schematic diagram of a stereo playback device provided by an embodiment of the present application.

图6是本申请实施例提供的立体声播放装置的第二种结构示意图。FIG. 6 is a schematic diagram of a second structure of a stereo playback device provided by an embodiment of the present application.

图7是本申请实施例提供的用于立体声播放的电子设备结构示意图。FIG. 7 is a schematic structural diagram of an electronic device for stereo playback provided by an embodiment of the present application.

具体实施方式Detailed ways

请参照图式,其中相同的组件符号代表相同的组件,本申请的原理是以实施在一适当的运算环境中来举例说明。以下的说明是基于所例示的本申请具体实施例,其不应被视为限制本申请未在此详述的其它具体实施例。Please refer to the drawings, wherein the same component symbols represent the same components, and the principles of the present application are exemplified by being implemented in a suitable computing environment. The following description is based on illustrated specific embodiments of the present application and should not be construed as limiting other specific embodiments of the present application not detailed herein.

在以下的说明中,本申请的具体实施例将参考由一部或多部计算机所执行的步骤及符号来说明,除非另有述明。因此,这些步骤及操作将有数次提到由计算机执行,本文所指的计算机执行包括了由代表了以一结构化型式中的数据的电子信号的计算机处理单元的操作。此操作转换该数据或将其维持在该计算机的内存系统中的位置处,其可重新配置或另外以本领域测试人员所熟知的方式来改变该计算机的运作。该数据所维持的数据结构为该内存的实体位置,其具有由该数据格式所定义的特定特性。但是,本申请原理以上述文字来说明,其并不代表为一种限制,本领域测试人员将可了解到以下所述的多种步骤及操作亦可实施在硬件当中。In the following description, specific embodiments of the present application will be described with reference to steps and symbols executed by one or more computers, unless otherwise stated. Accordingly, the steps and operations will be referred to several times as being performed by a computer, which reference herein includes operations by a computer processing unit of electronic signals representing data in a structured format. This operation transforms the data or maintains it in a location in the computer's memory system, which can be reconfigured or otherwise change the operation of the computer in a manner well known to testers in the art. The data structures maintained by the data are physical locations of the memory that have specific characteristics defined by the data format. However, the principle of the present application is described by the above text, which is not meant to be a limitation, and testers in the art will understand that various steps and operations described below can also be implemented in hardware.

本申请中的术语“第一”、“第二”和“第三”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或模块的过程、方法、系统、产品或设备没有限定于已列出的步骤或模块,而是某些实施例还包括没有列出的步骤或模块,或某些实施例还包括对于这些过程、方法、产品或设备固有的其它步骤或模块。The terms "first," "second," and "third," etc. in this application are used to distinguish different objects, rather than to describe a specific order. Furthermore, the terms "comprising" and "having", and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or modules is not limited to the listed steps or modules, but some embodiments also include unlisted steps or modules, or some embodiments Other steps or modules inherent to these processes, methods, products or devices are also included.

随着电子设备的不断发展,如智能手机等电子设备,部分电子设备中设置了双扬声器,用户在播放音频的时候,不仅可以提高音量,也能达到立体声播放的效果,由于双扬声器的距离较近,当手机水平放置播放音频的时候,耳朵在接收到同侧扬声器发出的声音的时候,还会接收到另一扬声器发出的声音,这就是串扰现象。本申请实施例中提供的方案可以解决双扬声器播放音频时出现串扰现象的问题,实现双扬声器播放音频时达到立体声播放效果。With the continuous development of electronic devices, such as smart phones and other electronic devices, some electronic devices are equipped with dual speakers. When users play audio, they can not only increase the volume, but also achieve the effect of stereo playback. Due to the relatively long distance between the dual speakers Recently, when the mobile phone is placed horizontally to play audio, when the ear receives the sound from the speaker on the same side, it also receives the sound from the other speaker, which is the phenomenon of crosstalk. The solutions provided in the embodiments of the present application can solve the problem of crosstalk phenomenon when audio is played by dual speakers, and achieve a stereo playback effect when audio is played by dual speakers.

在一实施例中,一种立体声播放方法,应用于具有双扬声器的电子设备,方法包括:In one embodiment, a stereo playback method, applied to an electronic device with dual speakers, includes:

提取音频信号中具有方位信息的立体声信号;Extract the stereo signal with orientation information in the audio signal;

对所述立体声信号进行解码,以得到多声道信号;decoding the stereo signal to obtain a multi-channel signal;

将所述多声道信号转码成双声道信号;transcoding the multi-channel signal into a two-channel signal;

分别对所述双声道信号进行串扰消除并输出至所述双扬声器进行播放。Crosstalk cancellation is performed on the two-channel signals respectively, and the two-channel signals are output to the two speakers for playback.

在一实施例中,提取音频信号中具有方位信息的立体声信号,包括:In one embodiment, extracting a stereo signal with orientation information in the audio signal includes:

判断所述音频信号是否包含立体声信号;determine whether the audio signal includes a stereo signal;

若否,对所述音频信号进行编码,以得到所述具有方位信息的立体声信号。If not, encoding the audio signal to obtain the stereo signal with orientation information.

在一实施例中,将所述多声道信号转码成双声道信号,包括:In one embodiment, transcoding the multi-channel signal into a two-channel signal includes:

基于头相关传输函数构建虚拟扬声器阵列;Build a virtual speaker array based on the head-related transfer function;

对所述虚拟扬声器阵列信号进行双声道转码。Binaural transcoding is performed on the virtual speaker array signal.

在一实施例中,基于头相关传输函数构建虚拟扬声器阵列,包括:In one embodiment, constructing a virtual speaker array based on a head-related transfer function includes:

构建多个虚拟扬声器在空间中的位置;Build the position of multiple virtual speakers in space;

基于第一公式分别计算多个所述虚拟扬声器的音频信号,其中所述第一公式为:The audio signals of the plurality of virtual speakers are respectively calculated based on a first formula, wherein the first formula is:

Figure BDA0003010579710000041
Figure BDA0003010579710000041

其中,Pi为第i个虚拟扬声器的音频信号,θi为第i个虚拟扬声器位置在水平面XY上的方位角,

Figure BDA0003010579710000042
为第i个虚拟扬声器位置在垂直平面YZ上的方位角,d为一个比例系数,W为声道信号。Among them, Pi is the audio signal of the ith virtual speaker, θ i is the azimuth angle of the position of the ith virtual speaker on the horizontal plane XY,
Figure BDA0003010579710000042
is the azimuth angle of the i-th virtual speaker position on the vertical plane YZ, d is a scale factor, and W is the channel signal.

在一实施例中,对所述虚拟扬声器阵列信号进行双声道转码,包括:In one embodiment, performing binaural transcoding on the virtual speaker array signal includes:

基于第二公式对所述虚拟扬声器阵列信号进行双声道转码,可以得到双声信号的立体声信号,其中所述第二公式为:Perform binaural transcoding on the virtual speaker array signal based on the second formula, and a stereo signal of the binaural signal can be obtained, wherein the second formula is:

Figure BDA0003010579710000043
Figure BDA0003010579710000043

其中L为左声道信号,R为右声道信号,H为头相关传输函数,P为虚拟扬声器的音频信号。Where L is the left channel signal, R is the right channel signal, H is the head-related transfer function, and P is the audio signal of the virtual speaker.

在一实施例中,所述对所述双声道信号进行串扰消除,包括:In an embodiment, the performing crosstalk cancellation on the two-channel signal includes:

将所述双声道信号的左声道信号通过高通滤波器,右声道信号通过低通滤波器,对中低频信号进行串扰消除。The left channel signal of the two-channel signal is passed through a high-pass filter, and the right channel signal is passed through a low-pass filter, so as to eliminate the crosstalk of the middle and low frequency signals.

在一实施例中,所述对中低频信号进行串扰消除,包括:In an embodiment, the performing crosstalk cancellation on the medium and low frequency signals includes:

基于第三公式对所诉中低频信号进行串扰消除,其中所述第三公式为:Crosstalk cancellation is performed on the claimed medium and low frequency signal based on a third formula, wherein the third formula is:

Figure BDA0003010579710000051
Figure BDA0003010579710000051

其中C为消除矩阵,G为增益常数,LLP是通过低通滤波器的左声道信号,LHP是通过高通滤波器的左声道信号,RLP是通过低通滤波器的右声道信号,RHP为通过高通滤波器的右声道信号,Lout为输出的左声道信号,Rout为输出的右声道信号。where C is the cancellation matrix, G is the gain constant, L LP is the left channel signal passed through the low pass filter, L HP is the left channel signal passed through the high pass filter, and R LP is the right channel signal passed through the low pass filter signal, R HP is the right channel signal passed through the high-pass filter, L out is the output left channel signal, and R out is the output right channel signal.

请参阅图1,图1是本申请实施例提供的立体声播放方法的流程示意图。该立体声播放方法可以应用于含有双扬声器的电子设备。该立体声播放方法的流程可以包括:Please refer to FIG. 1. FIG. 1 is a schematic flowchart of a stereo playback method provided by an embodiment of the present application. The stereo playback method can be applied to electronic equipment with dual speakers. The flow of the stereo playback method may include:

在101中,提取音频信号中具有方位信息的立体声信号。In 101, a stereo signal with orientation information in the audio signal is extracted.

电子设备播放音频的时候,会通过网络下载或者本地存储的方式将音频文件打开,此时会输入音频信号,音频文件有很多种格式,一些格式的音频文件中含有立体声信息,电子设备在接收到输入的音频信号后,会对音频信号进行提取,得到具有方位信息的立体声信号。When the electronic device plays audio, it will download the audio file from the network or open it locally. At this time, the audio signal will be input. The audio file has many formats. Some formats of audio files contain stereo information. After the audio signal is input, the audio signal is extracted to obtain a stereo signal with orientation information.

在102中,对立体声信号进行解码,以得到多声道信号。At 102, the stereo signal is decoded to obtain a multi-channel signal.

在一种实施例中,立体声播放效果可以是多声道环绕声的播放效果,由于多声道环绕声有很多种不同的格式,例如,Dolby AC-3(Dolby Audio Code3)标准,DTS(DigitalTheater Sound)标准。在播放音频时,不同音频编码格式的音频文件,输入的音频信号也不同,对音频信号包含的立体声信号进行解码,根据解码的信息,获取多声道信号。In one embodiment, the stereo playback effect may be the playback effect of multi-channel surround sound, since there are many different formats of multi-channel surround sound, for example, Dolby AC-3 (Dolby Audio Code 3) standard, DTS (Digital Theater Sound) standard. When playing audio, audio files of different audio coding formats have different input audio signals. The stereo signal contained in the audio signal is decoded, and the multi-channel signal is obtained according to the decoded information.

在103中,将多声道信号进行转码,以得到双声道信号。In 103, the multi-channel signal is transcoded to obtain a two-channel signal.

在转码之前,对立体声信号进行解码,得到虚拟扬声器信号,然后根据虚拟扬声器信号构建成虚拟扬声器阵列,虚拟扬声器阵列位置可以基于头相关传输函数来构建,虚拟扬声器的位置可以在人头部所处空间的任意地方,最后含有不同声道信息的虚拟扬声器阵列信号进行双声道转码,最终得到具有立体声信号的双声道信号。Before transcoding, the stereo signal is decoded to obtain a virtual speaker signal, and then a virtual speaker array is constructed according to the virtual speaker signal. The position of the virtual speaker array can be constructed based on the head-related transfer function. At any place in the space, the virtual speaker array signal containing different channel information is finally transcoded in two channels, and finally a two-channel signal with a stereo signal is obtained.

在104中,分别对双声道信号进行串扰消除并输出至所述双扬声器进行播放。In 104, crosstalk cancellation is performed on the two-channel signals respectively, and the two-channel signals are output to the two speakers for playback.

对多声道信号进行转码后的双声道信号需要进行串扰消除,在一种实施例中,通过对不同频段的双声道信号进行滤波,达到串音消除的目的,具体地,由于人的头部的屏蔽效应,在播放音频时,高频信号的的串扰现象并不明显,可以通过对双声道信号中的左声道信号通过高通滤波器,右声道信号通过低通滤波器,主要对双声道信号中的中低频信号进行串扰消除,最终将串扰消除后的双声道信号输出至双扬声器,双扬声器进行音频播放,使电子设备达到立体声播放的效果。The two-channel signal after transcoding the multi-channel signal needs to perform crosstalk elimination. In an embodiment, the purpose of crosstalk elimination is achieved by filtering the two-channel signal in different frequency bands. The shielding effect of the head, when playing audio, the crosstalk of high-frequency signals is not obvious, you can pass the left channel signal in the two-channel signal through a high-pass filter, and the right channel signal through a low-pass filter. , mainly to eliminate the crosstalk of the medium and low frequency signals in the two-channel signal, and finally output the two-channel signal after the crosstalk elimination to the dual speakers, and the dual speakers perform audio playback, so that the electronic equipment can achieve the effect of stereo playback.

由上述可知,本实施例通过对提取音频信号中的立体声信号,再对立体声信号进行解码,将解码后的多声道信号转码成双声道信号,最后输出的双声道信号进行串扰消除,将双声道信号输出双扬声器,在双扬声器上播放音频时能达到较好的立体声播放效果。It can be seen from the above that in this embodiment, the stereo signal is extracted from the audio signal, and then the stereo signal is decoded, the decoded multi-channel signal is transcoded into a two-channel signal, and the finally output two-channel signal is crosstalk eliminated. , output the dual-channel signal to dual speakers, and can achieve better stereo playback effect when playing audio on dual speakers.

请参阅图2,图2是本申请实施例提供的立体声播放方法的第二种流程示意图。该立体声播放方法可以应用于含有双扬声器的电子设备。该立体声播放方法的流程可以包括:Please refer to FIG. 2. FIG. 2 is a schematic flowchart of a second stereo playback method provided by an embodiment of the present application. The stereo playback method can be applied to electronic equipment with dual speakers. The flow of the stereo playback method may include:

在201中,获取输入的音频信号。In 201, an input audio signal is acquired.

获取输入的音频信号可以有多种方式,例如,用户可以用手机在网络上在线下载音频文件,然后播放音频文件时,获取输入的音频信号,用户还可以在手机本地存储上播放音频文件,获取音频信号。由于音频文件的格式有很多种,例如音频文件有MP3、WMA、APE、AAC等格式,因此在音频播放时输入的音频信号也有所不同。There are many ways to obtain the input audio signal. For example, the user can use the mobile phone to download the audio file online on the network, and then when the audio file is played, the input audio signal is obtained. audio signal. Since there are many formats of audio files, for example, audio files have formats such as MP3, WMA, APE, AAC, etc., the audio signals input during audio playback are also different.

在202中,判断输入的音频信号是否含有立体声信号,若否,则执行步骤203。In 202, it is judged whether the input audio signal contains a stereo signal, if not, step 203 is executed.

可以理解的是,不同的音频信号包含的信息也不同,一些输入的音频信号中含有立体声信号,常见的立体声信号有B-Format、N3D、SN3D等格式,立体声信号中含有方位信息,但是有些音频信号是不含有立体声信号的。It can be understood that different audio signals contain different information. Some input audio signals contain stereo signals. Common stereo signals include B-Format, N3D, SN3D and other formats. Stereo signals contain orientation information, but some audio The signal does not contain a stereo signal.

立体声信号含有方位信息,例如在一个虚拟的三维空间中,立体声信号所具有的方位信息可以是多个位置,可以理解的是,在这个三维虚拟空间中,虚拟扬声器播放音频时,处在三维虚拟空间的人耳可以接收到从各个位置虚拟扬声器发出的声音。The stereo signal contains orientation information. For example, in a virtual three-dimensional space, the orientation information of the stereo signal can be multiple positions. It is understandable that in this three-dimensional virtual space, when the virtual speaker plays audio, it is in a three-dimensional virtual The human ear in the space can pick up the sound from the virtual speakers in various locations.

在处理接下来的步骤时,需要先判断输入的音频信号是否含有立体声信号,若输入的音频信号含有立体声信号,则执行204步骤,若输入的音频信号没有立体声信号,则执行203步骤。When processing the next steps, it is necessary to first determine whether the input audio signal contains a stereo signal. If the input audio signal contains a stereo signal, execute step 204, and if the input audio signal does not have a stereo signal, execute step 203.

在203中,对输入的音频信号进行编码。In 203, the input audio signal is encoded.

判断出输入的音频信号不含有立体声信号的情况下,需要对音频信号编码。在一种实施例中,在音频信号不含有立体声信号的情况下,可以理解的是,该音频信号只含有单声道音频信号,这时可以通过设置空间参数,通过设置的立体声参数和单声道音频信号结合,编码成具有立体声信号的音频信号。When it is determined that the input audio signal does not contain a stereo signal, the audio signal needs to be encoded. In an embodiment, when the audio signal does not contain a stereo signal, it can be understood that the audio signal only contains a mono audio signal. In this case, the spatial parameters can be set, and the stereo parameters and mono The audio signals are combined and encoded into an audio signal with a stereo signal.

如图3所示,图3为本实施例提供的立体声播放的场景示意图,例如,可以将输入的音频信号编码成具有立体声信号的音频信号,其中,立体声信号可以为B-Format、N3D、SN3D等格式,具体地,可以将一阶B-Format格式的立体声信号,具体编码过程如下:As shown in FIG. 3, FIG. 3 is a schematic diagram of a stereo playback scenario provided in this embodiment. For example, an input audio signal may be encoded into an audio signal having a stereo signal, wherein the stereo signal may be B-Format, N3D, SN3D and other formats, specifically, the stereo signal in the first-order B-Format format can be encoded, and the specific encoding process is as follows:

Figure BDA0003010579710000071
Figure BDA0003010579710000071

Figure BDA0003010579710000072
Figure BDA0003010579710000072

Figure BDA0003010579710000073
Figure BDA0003010579710000073

Figure BDA0003010579710000074
Figure BDA0003010579710000074

图3中θ为虚拟扬声器位置在水平面XY上的方位角,

Figure BDA0003010579710000075
为虚拟扬声器位置在垂直平面YZ上的方位角。则公式中,θi为虚拟扬声器位置在水平面XY上的方位角,
Figure BDA0003010579710000076
为虚拟扬声器位置在垂直平面YZ上的方位角,其中,si为第i个音频信号,i=(1,2…k)为音频信号的个数,W声道信号表示全方向的声信号,X声道信号,Y声道信号和Z声道信号分别表示空间三个互相垂直取向的声信号。In Figure 3, θ is the azimuth angle of the virtual speaker position on the horizontal plane XY,
Figure BDA0003010579710000075
is the azimuth of the virtual speaker position on the vertical plane YZ. In the formula, θ i is the azimuth angle of the virtual speaker position on the horizontal plane XY,
Figure BDA0003010579710000076
is the azimuth angle of the virtual speaker position on the vertical plane YZ, where s i is the ith audio signal, i=(1,2...k) is the number of audio signals, and the W channel signal represents the omnidirectional acoustic signal , the X channel signal, the Y channel signal and the Z channel signal respectively represent three acoustic signals oriented vertically to each other in space.

通过公式,最终可以将输入的音频信号编码成具有立体声信号的音频信号,在本实施例中,编码的立体声信号可以为一阶B-Format立体声信号。Through the formula, the input audio signal can finally be encoded into an audio signal having a stereo signal. In this embodiment, the encoded stereo signal can be a first-order B-Format stereo signal.

在204中,构建虚拟扬声器阵列,并对具有方位信息的立体声信号进行解码。At 204, a virtual speaker array is constructed and the stereo signal with orientation information is decoded.

可以理解的是,虚拟扬声器阵列中包含多个虚拟扬声器,在虚拟的三维虚拟空间中,这些虚拟扬声器摆放在不同的位置,对具有方位信息的立体声信号进行解码,使得虚拟扬声器阵列的信号具有方位信息,最终在三维虚拟空间中构建成虚拟扬声器阵列。It can be understood that the virtual speaker array includes multiple virtual speakers. In the virtual three-dimensional virtual space, these virtual speakers are placed in different positions to decode the stereo signal with orientation information, so that the signal of the virtual speaker array has The orientation information is finally constructed into a virtual speaker array in a three-dimensional virtual space.

在一种实施例中,可以对B-Format、N3D等格式的立体声信号解码成多个虚拟扬声器信号进行播放,此时人处于虚拟扬声器播放的虚拟三维空间中,接收各个虚拟扬声器发出的声音,实现立体声播放。In one embodiment, a stereo signal in formats such as B-Format and N3D can be decoded into a plurality of virtual speaker signals for playback. At this time, a person is in the virtual three-dimensional space played by the virtual speakers and receives the sound from each virtual speaker. Realize stereo playback.

例如,请参阅图3,图3是本实施例提供的立体声播放的场景示意图,虚拟三维空间是正方体形状,也可以是其它形状的空间,本实施例中以正方体的虚拟三维空间为例,此时,人处于虚拟三维空间的中心位置,手机置于人头的正前方,L1和R1分别为手机的左扬声器和右扬声器,θ为虚拟扬声器位置在水平面XY上的方位角,

Figure BDA0003010579710000083
为虚拟扬声器位置在垂直平面YZ上的方位角,图中10、20、30、40、50、60、70、80为处在虚拟三维空间中不同位置的虚拟扬声器,虚拟扬声器的位置可以基于头相关传输函数创建,也可以通过其它方式创建。对B-Format格式的立体声信号解码成8个虚拟扬声器信号进行重放,此时,8个虚拟扬声器的空间位置分别为(45°,30°)、(-45°,30°)、(135°,30°)、(-135°,30°)、(45°,-30°)、(-45°,-30°)、(135°,-30°)、(-135°,-30°)。具体地,根据公式进行重放,公式如下:For example, please refer to FIG. 3. FIG. 3 is a schematic diagram of a stereo playback scene provided by this embodiment. The virtual three-dimensional space is in the shape of a cube, and may also be a space in other shapes. In this embodiment, the virtual three-dimensional space of a cube is used as an example. When the person is in the center of the virtual three-dimensional space, the mobile phone is placed directly in front of the person's head, L1 and R1 are the left and right speakers of the mobile phone, respectively, θ is the azimuth of the virtual speaker position on the horizontal plane XY,
Figure BDA0003010579710000083
is the azimuth angle of the virtual speaker position on the vertical plane YZ, 10, 20, 30, 40, 50, 60, 70, 80 in the figure are virtual speakers at different positions in the virtual three-dimensional space, and the position of the virtual speaker can be based on the head The associated transfer function is created, and can also be created in other ways. The stereo signal in B-Format format is decoded into 8 virtual speaker signals for playback. At this time, the spatial positions of the 8 virtual speakers are (45°, 30°), (-45°, 30°), (135°). °, 30°), (-135°, 30°), (45°, -30°), (-45°, -30°), (135°, -30°), (-135°, -30 °). Specifically, playback is performed according to the formula, which is as follows:

Figure BDA0003010579710000081
Figure BDA0003010579710000081

其中,Pi为第i个虚拟扬声器的重放信号,i=(1,2…8),θi为虚拟扬声器位置在水平面XY上的方位角,

Figure BDA0003010579710000082
为虚拟扬声器位置在垂直平面YZ上的方位角,W声道信号表示全方向的声信号,d为一个比例系数,取值范围0~2,在本实施例中,推荐值取1。最终得到的虚拟扬声器阵列信号可以表示为:Among them, P i is the playback signal of the ith virtual speaker, i=(1,2...8), θ i is the azimuth angle of the virtual speaker position on the horizontal plane XY,
Figure BDA0003010579710000082
is the azimuth angle of the virtual speaker position on the vertical plane YZ, the W channel signal represents the omnidirectional sound signal, d is a proportional coefficient, and the value ranges from 0 to 2. In this embodiment, the recommended value is 1. The resulting virtual speaker array signal can be expressed as:

Figure BDA0003010579710000091
Figure BDA0003010579710000091

在205中,将解码后的多声道信号转码成双声道信号。In 205, the decoded multi-channel signal is transcoded into a two-channel signal.

在一种实施例中,虚拟扬声器阵列位置可以基于头相关传输函数HRTF构建,对多声道的虚拟扬声器阵列信号进行双声道转码,可以得到双声道输出的立体声信号。根据上一步骤得出的虚拟扬声器阵列信号,每个虚拟扬声器对应相应空间角度的头相关传输函数HRTF,在时域上为头相关冲击响应HRIR,则双声道的立体声信号为:In one embodiment, the virtual speaker array position may be constructed based on the head-related transfer function HRTF, and the multi-channel virtual speaker array signal is binaurally transcoded to obtain a binaural output stereo signal. According to the virtual speaker array signal obtained in the previous step, each virtual speaker corresponds to the head-related transfer function HRTF of the corresponding spatial angle, and in the time domain is the head-related impulse response HRIR, then the stereo signal of the two-channel is:

Figure BDA0003010579710000092
Figure BDA0003010579710000092

其中,L、R分别表示为左声道信号和右声道信号,H为头相关传输函数,P为虚拟扬声器的重放信号。Among them, L and R represent the left channel signal and the right channel signal respectively, H is the head-related transfer function, and P is the playback signal of the virtual speaker.

在206中,对双声道信号进行串扰消除。At 206, crosstalk cancellation is performed on the binaural signal.

在双扬声器播放音频时,如果两个扬声器距离很近,就会产生串扰现象,此时,需要对输入的双声道信号进行串扰消除处理,使双扬声器播放音频时,没有串扰现象。When two speakers play audio, if the distance between the two speakers is very close, crosstalk will occur. At this time, it is necessary to perform crosstalk cancellation processing on the input two-channel signal, so that there is no crosstalk when the two speakers play audio.

请参阅图4,图4是本实施例提供的立体声播放的场景示意图,在图4中,其中,HLL、HRR、HRL和HLR为头相关传输函数HRTF,1为手机的左扬声器,2为手机的右扬声器,3为人的左耳,4为人的右耳,在手机的双扬声器播放音频时,左扬声器和右扬声器都可以发出声音,人耳会接收到两个扬声器发出的声音,在没有对音频信号处理的情况下,由于双扬声器距离很近,当手机水平放置播放音频的时候,耳朵在接收到同侧扬声器发出的声音的时候,还会接收到另一扬声器发出的声音,这就是串扰现象,在对输入的音频信号进行串扰消除处理后,再使用手机的双扬声器播放音频时,就会没有串扰现象,图中手机扬声器的位置可以是其它位置,手机形态也可以根据实际的生产使用进行调整。Please refer to FIG. 4 . FIG. 4 is a schematic diagram of a stereo playback scenario provided by this embodiment. In FIG. 4 , H LL , H RR , H RL and H LR are the head-related transfer function HRTF, and 1 is the left speaker of the mobile phone , 2 is the right speaker of the mobile phone, 3 is the left ear of the human being, and 4 is the right ear of the human being. When the dual speakers of the mobile phone play audio, both the left and right speakers can emit sound, and the human ear will receive the sound from the two speakers. , in the absence of audio signal processing, due to the close distance between the two speakers, when the phone is placed horizontally to play audio, when the ear receives the sound from the speaker on the same side, it will also receive the sound from the other speaker. , this is the crosstalk phenomenon. After the input audio signal is processed to eliminate the crosstalk, and then use the dual speakers of the mobile phone to play the audio, there will be no crosstalk phenomenon. Adjusted for actual production use.

在一种实施例中,可以将人耳听到手机双扬声器的声音表示为:In an embodiment, the sound that the human ear hears from the dual speakers of the mobile phone can be expressed as:

Figure BDA0003010579710000101
Figure BDA0003010579710000101

Figure BDA0003010579710000102
Figure BDA0003010579710000102

其中,HLL、HRR、HRL和HLR为头相关传输函数HRTF。为了消除串扰现象,使得左声道发出的声音和右声道发出的声音在传入人耳中不会出现串扰现象,需要创建一个消除矩阵C,使得Among them, H LL , H RR , H RL and H LR are head related transfer functions HRTF. In order to eliminate the crosstalk phenomenon, so that the sound from the left channel and the sound from the right channel will not appear crosstalk in the human ear, it is necessary to create a cancellation matrix C, so that

Figure BDA0003010579710000103
Figure BDA0003010579710000103

Figure BDA0003010579710000104
Figure BDA0003010579710000104

在现实中,由于人头的屏蔽效应,高频信号串扰现象不明显,本实施例将双声道的立体声信号左声道信号和右声道信号分别通过高通滤波器与低通滤波器,并主要对中低频信号进行串扰消除:In reality, due to the shielding effect of the human head, the crosstalk of high-frequency signals is not obvious. Crosstalk cancellation for medium and low frequency signals:

Figure BDA0003010579710000105
Figure BDA0003010579710000105

其中G为增益常数,LLP是通过低通滤波器的左声道信号,LHP是通过高通滤波器的左声道信号,RLP是通过低通滤波器的右声道信号,RHP为通过高通滤波器的右声道信号,Lout为输出的左声道信号,Rout为输出的右声道信号,采用的滤波器的分频点f0可取值范围3500~5500Hz,本实施例中取值为4000Hz。where G is the gain constant, L LP is the left channel signal passed through the low pass filter, L HP is the left channel signal passed through the high pass filter, R LP is the right channel signal passed through the low pass filter, and R HP is The right channel signal passed through the high-pass filter, L out is the output left channel signal, R out is the output right channel signal, and the crossover point f 0 of the filter used can take a value in the range of 3500-5500 Hz. This implementation In the example, the value is 4000Hz.

根据上述过程,对输入的双声道信号进行处理,达到对双声道信号串扰消除的效果。According to the above process, the input two-channel signal is processed to achieve the effect of eliminating the crosstalk of the two-channel signal.

在207中,输入音频信号至双扬声器播放。In 207, the audio signal is input to dual speaker playback.

在完成串扰消除的步骤之后,将双声道信号输入至双扬声器,在双扬声器播放音频时,串扰现象得到消除,实现了立体声播放的效果。After completing the step of eliminating the crosstalk, the dual-channel signal is input to the dual speakers, and when the dual speakers play audio, the crosstalk phenomenon is eliminated, and the effect of stereo playback is realized.

由上述可知,本申请实施例通过对输入的音频信号进行判断,判断出输入的音频信号是否具有立体声信号,如果有立体声信号,则构建虚拟扬声器阵列,对具有方位信息的立体声信号进行解码,如果输入的音频信号中不具有立体声信号,则对音频信号进行编码,使其具有立体声信号,再构建虚拟扬声器阵列,对具有方位信息的立体声信号进行解码,之后将解码后的多声道信号转码成双声道信号,对转码成的双声道信号进行串扰消除,将音频信号输入至双扬声器进行播放,达到立体声播放的效果。As can be seen from the above, the embodiment of the present application judges whether the input audio signal has a stereo signal by judging the input audio signal, and if there is a stereo signal, a virtual speaker array is constructed to decode the stereo signal with orientation information. If the input audio signal does not have a stereo signal, encode the audio signal to make it have a stereo signal, then construct a virtual speaker array, decode the stereo signal with orientation information, and then transcode the decoded multi-channel signal Convert the two-channel signal into a two-channel signal, eliminate the crosstalk of the transcoded two-channel signal, and input the audio signal to the dual speakers for playback to achieve the effect of stereo playback.

在一实施例中,立体声播放装置包括:In one embodiment, the stereo playback device includes:

提取模块,用于提取音频信号中具有方位信息的立体声信号;The extraction module is used to extract the stereo signal with orientation information in the audio signal;

解码模块,用于对所述立体声信号进行解码,以得到多声道信号;a decoding module for decoding the stereo signal to obtain a multi-channel signal;

转码模块,用于将所述多声道信号转码成双声道信号;a transcoding module for transcoding the multi-channel signal into a two-channel signal;

串扰消除模块,用于分别对所述双声道信号进行串扰消除。A crosstalk cancellation module, configured to perform crosstalk cancellation on the two-channel signals respectively.

在一实施例中,所述提取模块包括:In one embodiment, the extraction module includes:

判断子模块,用于判断所述音频信号是否包含立体声信号;A judging submodule for judging whether the audio signal includes a stereo signal;

编码子模块,用于所述判断子模块判断为否时,对所述音频信号进行编码,以得到所述具有方位信息的立体声信号。an encoding sub-module, configured to encode the audio signal when the determination sub-module determines that it is no, so as to obtain the stereo signal with orientation information.

在一实施例中,所述转码模块包括:In one embodiment, the transcoding module includes:

阵列构建子模块,用于基于头相关传输函数构建虚拟扬声器阵列;an array construction submodule for constructing a virtual speaker array based on the head-related transfer function;

转码子模块,具体用于对所述虚拟扬声器阵列信号进行双声道转码。The transcoding submodule is specifically configured to perform binaural transcoding on the virtual speaker array signal.

在一实施例中,所述阵列构建子模块,具体用于构建多个虚拟扬声器在空间中的位置;In one embodiment, the array construction sub-module is specifically used to construct the positions of multiple virtual speakers in space;

基于第一公式分别计算多个所述虚拟扬声器的音频信号,其中所述第一公式为:The audio signals of the plurality of virtual speakers are respectively calculated based on a first formula, wherein the first formula is:

Figure BDA0003010579710000111
Figure BDA0003010579710000111

其中,Pi为第i个虚拟扬声器的音频信号,θi为第i个虚拟扬声器位置在水平面XY上的方位角,

Figure BDA0003010579710000112
为第i个虚拟扬声器位置在垂直平面YZ上的方位角,d为一个比例系数,W为声道信号。Among them, Pi is the audio signal of the ith virtual speaker, θ i is the azimuth angle of the position of the ith virtual speaker on the horizontal plane XY,
Figure BDA0003010579710000112
is the azimuth angle of the i-th virtual speaker position on the vertical plane YZ, d is a scale factor, and W is the channel signal.

在一实施例中,所述串扰消除模块包括:In one embodiment, the crosstalk cancellation module includes:

滤波子模块,用于将所述双声道信号的左声道信号通过高通滤波器,右声道信号通过低通滤波器,对中低频信号进行串扰消除。The filtering sub-module is used to pass the left channel signal of the two-channel signal through a high-pass filter, and the right channel signal through a low-pass filter, so as to eliminate the crosstalk of the middle and low frequency signals.

请参阅图5,图5是本申请实施例提供的立体声播放装置,立体声播放装置500应用于含有双扬声器的电子设备,立体声播放装置500包括提取模块501、解码模块502、转码模块503和串扰消除模块504。Please refer to FIG. 5. FIG. 5 is a stereo playback device provided by an embodiment of the present application. The stereo playback device 500 is applied to an electronic device containing dual speakers. The stereo playback device 500 includes an extraction module 501, a decoding module 502, a transcoding module 503, and a crosstalk module. Elimination module 504 .

其中,提取模块501,用于提取音频信号中具有方位信息的立体声信号。Among them, the extraction module 501 is used for extracting the stereo signal with orientation information in the audio signal.

具体地,在用户使用电子设备播放音频的时候,会通过网络下载或者本地存储的方式将音频文件打开,此时会输入音频信号,音频文件有很多种格式,例如,例如音频文件有MP3、WMA、APE、AAC等格式,一些格式的音频文件中含有立体声信息,电子设备在接收到输入的音频信号后,提取模块501会对音频信号进行提取,得到具有方位信息的立体声信号。Specifically, when a user uses an electronic device to play audio, the audio file will be opened through network download or local storage, and an audio signal will be input at this time. The audio file has many formats, for example, the audio file has MP3, WMA , APE, AAC and other formats, some audio files contain stereo information. After the electronic device receives the input audio signal, the extraction module 501 will extract the audio signal to obtain a stereo signal with orientation information.

解码模块502,用于对所述立体声信号进行解码,以得到多声道信号。The decoding module 502 is configured to decode the stereo signal to obtain a multi-channel signal.

解码模块502对B-Format,N3D,SN3D等格式立体声信号进行解码,获取多声道信号,可以理解的是,在虚拟三维空间中,多声道信号可以是不同位置的虚拟扬声器发出的。The decoding module 502 decodes the stereo signals in B-Format, N3D, SN3D and other formats to obtain multi-channel signals. It can be understood that in the virtual three-dimensional space, the multi-channel signals may be sent by virtual speakers at different positions.

转码模块503,用于将所述多声道信号转码成双声道信号。The transcoding module 503 is configured to transcode the multi-channel signal into a dual-channel signal.

在一种实施例中,虚拟扬声器阵列位置可以基于头相关传输函数HRTF构建,对多声道的虚拟扬声器阵列信号进行双声道转码,可以得到双声道输出的立体声信号。In one embodiment, the virtual speaker array position may be constructed based on the head-related transfer function HRTF, and the multi-channel virtual speaker array signal is binaurally transcoded to obtain a binaural output stereo signal.

需要说明的是,多声道信号进行转码之后,得到的双声道信号是具有立体声信号的,多声道信号可以理解为多个虚拟扬声器发出的音频信号。It should be noted that after the multi-channel signal is transcoded, the obtained two-channel signal has a stereo signal, and the multi-channel signal can be understood as an audio signal sent by multiple virtual speakers.

串扰消除模块504,用于分别对所述双声道信号进行串扰消除并输出至所述双扬声器进行播放。The crosstalk cancellation module 504 is configured to perform crosstalk cancellation on the two-channel signals respectively and output the signals to the two speakers for playback.

对多声道信号进行转码后的双声道信号需要进行串扰消除,在一种实施例中,通过对不同频段的双声道信号进行滤波,达到串音消除的目的,具体地,由于人的头部的屏蔽效应,在播放音频时,高频信号的的串扰现象并不明显,可以通过对双声道信号中的左声道信号通过高通滤波器,右声道信号通过低通滤波器,主要对双声道信号中的中低频信号进行串扰消除,最终将串扰消除后的双声道信号输出至双扬声器,双扬声器进行音频播放,使电子设备达到立体声播放的效果。The two-channel signal after transcoding the multi-channel signal needs to perform crosstalk elimination. In an embodiment, the purpose of crosstalk elimination is achieved by filtering the two-channel signal in different frequency bands. The shielding effect of the head, when playing audio, the crosstalk of high-frequency signals is not obvious, you can pass the left channel signal in the two-channel signal through a high-pass filter, and the right channel signal through a low-pass filter. , mainly to eliminate the crosstalk of the medium and low frequency signals in the two-channel signal, and finally output the two-channel signal after the crosstalk elimination to the dual speakers, and the dual speakers perform audio playback, so that the electronic equipment can achieve the effect of stereo playback.

请一并参阅图6,图6是本申请实施例提供的立体声播放装置的另一结构示意图,立体声播放装置500应用于含有双扬声器的电子设备。在一些实施方式中,提取模块501可以包括判断子模块5011、编码子模块5012。Please also refer to FIG. 6 . FIG. 6 is another schematic structural diagram of a stereo playback device provided by an embodiment of the present application. The stereo playback device 500 is applied to an electronic device with dual speakers. In some embodiments, the extraction module 501 may include a judgment sub-module 5011 and an encoding sub-module 5012 .

判断模块5011,用于判断所述音频信号是否含有立体声信号。The judging module 5011 is used for judging whether the audio signal contains a stereo signal.

在输入的音频信号中,有的音频信号并不含有具有方位信息的立体声信号,需要对输入的音频信号进行一个判断,如果输入的音频信号不具有立体声信号的情况下,需要编码子模块5012继续执行下一步骤。In the input audio signal, some audio signals do not contain a stereo signal with orientation information, and a judgment needs to be made on the input audio signal. If the input audio signal does not have a stereo signal, the encoding sub-module 5012 needs to continue. Go to the next step.

编码子模块5012,用于对不包含立体声信号的音频信号进行编码,以得到所述具有方位信息的立体声信号。The encoding sub-module 5012 is configured to encode the audio signal that does not contain the stereo signal to obtain the stereo signal with orientation information.

判断出输入的音频信号不含有立体声信号的情况下,需要对音频信号编码。在一种实施例中,在音频信号不含有立体声信号的情况下,可以理解的是,该音频信号只含有单声道音频信号,这时可以通过设置空间参数,通过设置的立体声参数和单声道音频信号结合,编码成具有立体声信号的音频信号。When it is determined that the input audio signal does not contain a stereo signal, the audio signal needs to be encoded. In an embodiment, when the audio signal does not contain a stereo signal, it can be understood that the audio signal only contains a mono audio signal. In this case, the spatial parameters can be set, and the stereo parameters and mono The audio signals are combined and encoded into an audio signal with a stereo signal.

在一些实施方式中,转码模块503包括阵列构建子模块5031,转码子模块5032。In some embodiments, the transcoding module 503 includes an array construction sub-module 5031 and a transcoding sub-module 5032.

阵列构建子模块5031用于基于头相关传输函数构建虚拟扬声器阵列。The array construction sub-module 5031 is used to construct a virtual speaker array based on the head-related transfer function.

可以理解的是,虚拟扬声器阵列中包含多个虚拟扬声器,在虚拟的三维虚拟空间中,这些虚拟扬声器摆放在不同的位置,对具有方位信息的立体声信号进行解码,使得虚拟扬声器阵列的信号具有方位信息,最终在三维虚拟空间中构建成虚拟扬声器阵列。It can be understood that the virtual speaker array includes multiple virtual speakers. In the virtual three-dimensional virtual space, these virtual speakers are placed in different positions to decode the stereo signal with orientation information, so that the signal of the virtual speaker array has The orientation information is finally constructed into a virtual speaker array in a three-dimensional virtual space.

转码子模块5032具体用于对所述虚拟扬声器阵列信号进行双声道转码。The transcoding sub-module 5032 is specifically configured to perform binaural transcoding on the virtual speaker array signal.

在一种实施例中,可以对B-Format、N3D等格式的立体声信号解码成多个虚拟扬声器信号进行播放,此时人处于虚拟扬声器播放的虚拟三维空间中,接收各个虚拟扬声器发出的声音,实现立体声播放。In one embodiment, a stereo signal in formats such as B-Format and N3D can be decoded into a plurality of virtual speaker signals for playback. At this time, a person is in the virtual three-dimensional space played by the virtual speakers and receives the sound from each virtual speaker. Realize stereo playback.

在一些实施方式中,串扰消除模块504包括滤波模块5041,用于将所述双声道信号的左声道信号通过高通滤波器,右声道信号通过低通滤波器。In some embodiments, the crosstalk cancellation module 504 includes a filtering module 5041 for passing the left channel signal of the binaural signal through a high-pass filter, and the right channel signal through a low-pass filter.

具体地,在转码之后生成的双声道信号,需要对双声道信号进行滤波,输出的双声道信号在双扬声器播放时才不会出现串扰现象,由于,在现实中,由于人头的屏蔽效应,高频信号串扰现象不明显,本实施例将双声道的立体声信号左声道信号和右声道信号分别通过高通滤波器与低通滤波器,并主要对中低频信号进行串扰消除。Specifically, the two-channel signal generated after transcoding needs to be filtered, and the output two-channel signal will not have crosstalk when it is played by two speakers, because, in reality, due to the human head Shielding effect, the crosstalk phenomenon of high-frequency signals is not obvious. In this embodiment, the left channel signal and the right channel signal of the two-channel stereo signal are passed through the high-pass filter and the low-pass filter respectively, and the crosstalk is mainly eliminated for the middle and low frequency signals. .

需要说明的是,本申请中在判断出输入的音频信号不具有立体声信号时,可以对音频信号进行编码成含有多种格式立体声信号的音频信号,在将多声道信号转码成双声道信号的时候,可以根据预设的转码方式进行转码,例如,利用多声道信号中自身包含的空间信息,在最后的串扰消除步骤中,本申请实施例中通过对中低频信号进行滤波来达到串扰消除的目的,具体地,可以根据手机的放置方式来进行双声道信号的实时调整,不对本申请作出限制。It should be noted that, in the present application, when it is determined that the input audio signal does not have a stereo signal, the audio signal can be encoded into an audio signal containing stereo signals in multiple formats, and the multi-channel signal can be transcoded into a two-channel audio signal. When the signal is transcoded, it can be transcoded according to a preset transcoding method. For example, by using the spatial information contained in the multi-channel signal itself, in the final crosstalk elimination step, in the embodiment of the present application, the medium and low frequency signals are filtered. To achieve the purpose of eliminating crosstalk, specifically, the real-time adjustment of the two-channel signal can be performed according to the placement method of the mobile phone, which is not limited to the present application.

由上述可知,本申请实施例通过对输入的音频信号进行判断,判断出输入的音频信号是否具有立体声信号,如果有立体声信号,则构建虚拟扬声器阵列,对具有方位信息的立体声信号进行解码,如果输入的音频信号中不具有立体声信号,则对音频信号进行编码,使其具有立体声信号,再构建虚拟扬声器阵列,对具有方位信息的立体声信号进行解码,之后将解码后的多声道信号转码成双声道信号,对转码成的双声道信号进行串扰消除,将音频信号输入至双扬声器进行播放,达到立体声播放的效果。As can be seen from the above, the embodiment of the present application judges whether the input audio signal has a stereo signal by judging the input audio signal, and if there is a stereo signal, a virtual speaker array is constructed to decode the stereo signal with orientation information. If the input audio signal does not have a stereo signal, encode the audio signal to make it have a stereo signal, then construct a virtual speaker array, decode the stereo signal with orientation information, and then transcode the decoded multi-channel signal Convert the two-channel signal into a two-channel signal, eliminate the crosstalk of the transcoded two-channel signal, and input the audio signal to the dual speakers for playback to achieve the effect of stereo playback.

本申请实施例中,立体声播放装置与上文实施例中的立体声播放方法属于同一构思,在立体声装置上可以运行立体声播放方法实施例中提供的任一方法,其具体实现过程详见立体声播放方法的实施例,此处不再赘述。In the embodiment of the present application, the stereo playback device and the stereo playback method in the above embodiments belong to the same concept, and any method provided in the embodiment of the stereo playback method can be executed on the stereo device. For the specific implementation process, please refer to the stereo playback method. embodiment, which will not be repeated here.

本文所使用的术语“模块”可看作为在该运算系统上执行的软件对象。本文所述的不同组件、模块、引擎及服务可看作为在该运算系统上的实施对象。而本文所述的装置及方法可以以软件的方式进行实施,当然也可在硬件上进行实施,均在本申请保护范围之内。As used herein, the term "module" can be thought of as a software object that executes on the computing system. The various components, modules, engines, and services described herein can be viewed as objects of implementation on the computing system. The apparatus and method described herein can be implemented in software, and certainly can also be implemented in hardware, which are all within the protection scope of the present application.

本申请实施例还提供一种存储介质,其上存储有计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行上述的用立体声播放方法。Embodiments of the present application further provide a storage medium, on which a computer program is stored, and when the computer program runs on a computer, the computer can execute the above-mentioned method for playing in stereo.

本申请实施例还提供一种电子设备,如平板电脑、手机等电子设备。电子设备中的处理器会按照如下的步骤,将一个或一个以上的应用程序的进程对应的指令加载到存储器中,并由处理器来运行存储在存储器中的应用程序,从而实现各种功能:The embodiments of the present application also provide an electronic device, such as a tablet computer, a mobile phone and other electronic devices. The processor in the electronic device loads the instructions corresponding to the processes of one or more application programs into the memory according to the following steps, and the processor runs the application programs stored in the memory, thereby realizing various functions:

提取音频信号中具有方位信息的立体声信号;Extract the stereo signal with orientation information in the audio signal;

对所述立体声信号进行解码,以得到多声道信号;decoding the stereo signal to obtain a multi-channel signal;

将所述多声道信号转码成双声道信号;transcoding the multi-channel signal into a two-channel signal;

分别对所述双声道信号进行串扰消除并输出至所述双扬声器进行播放。Crosstalk cancellation is performed on the two-channel signals respectively, and the two-channel signals are output to the two speakers for playback.

在一实施例中,提取音频信号中具有方位信息的立体声信号时,所述处理器用于执行以下步骤:In one embodiment, when extracting a stereo signal with orientation information in an audio signal, the processor is configured to perform the following steps:

判断所述音频信号是否包含立体声信号;determine whether the audio signal includes a stereo signal;

若否,对所述音频信号进行编码,以得到所述具有方位信息的立体声信号。If not, encoding the audio signal to obtain the stereo signal with orientation information.

在一实施例中,在将所述多声道信号转码成双声道信号时,所述处理器用于执行以下步骤:In one embodiment, when transcoding the multi-channel signal into a two-channel signal, the processor is configured to perform the following steps:

基于头相关传输函数构建虚拟扬声器阵列;Build a virtual speaker array based on the head-related transfer function;

对所述虚拟扬声器阵列信号进行双声道转码。Binaural transcoding is performed on the virtual speaker array signal.

在一实施例中,基于头相关传输函数构建虚拟扬声器阵列时,所述处理器用于执行以下步骤:In one embodiment, when constructing the virtual speaker array based on the head-related transfer function, the processor is configured to perform the following steps:

构建多个虚拟扬声器在空间中的位置;Build the position of multiple virtual speakers in space;

基于第一公式分别计算多个所述虚拟扬声器的音频信号,其中所述第一公式为:The audio signals of the plurality of virtual speakers are respectively calculated based on a first formula, wherein the first formula is:

Figure BDA0003010579710000151
Figure BDA0003010579710000151

其中,Pi为第i个虚拟扬声器的音频信号,θi为第i个虚拟扬声器位置在水平面XY上的方位角,

Figure BDA0003010579710000152
为第i个虚拟扬声器位置在垂直平面YZ上的方位角,d为一个比例系数,W为声道信号。Among them, Pi is the audio signal of the ith virtual speaker, θ i is the azimuth angle of the position of the ith virtual speaker on the horizontal plane XY,
Figure BDA0003010579710000152
is the azimuth angle of the i-th virtual speaker position on the vertical plane YZ, d is a scale factor, and W is the channel signal.

在一实施例中,对所述虚拟扬声器阵列信号进行双声道转码时,所述处理器用于执行以下步骤:In one embodiment, when performing binaural transcoding on the virtual speaker array signal, the processor is configured to perform the following steps:

基于第二公式对所述虚拟扬声器阵列信号进行双声道转码,可以得到双声信号的立体声信号,其中所述第二公式为:Perform binaural transcoding on the virtual speaker array signal based on the second formula, and a stereo signal of the binaural signal can be obtained, wherein the second formula is:

Figure BDA0003010579710000153
Figure BDA0003010579710000153

其中L为左声道信号,R为右声道信号,H为头相关传输函数,P为虚拟扬声器的音频信号。Where L is the left channel signal, R is the right channel signal, H is the head-related transfer function, and P is the audio signal of the virtual speaker.

在一实施例中,对中低频信号进行串扰消除时,所述处理器用于执行以下步骤:In one embodiment, the processor is configured to perform the following steps when performing crosstalk cancellation on the medium and low frequency signals:

基于第三公式对所诉中低频信号进行串扰消除,其中所述第三公式为:Crosstalk cancellation is performed on the claimed medium and low frequency signal based on a third formula, wherein the third formula is:

Figure BDA0003010579710000161
Figure BDA0003010579710000161

其中C为消除矩阵,G为增益常数,LLP是通过低通滤波器的左声道信号,LHP是通过高通滤波器的左声道信号,RLP是通过低通滤波器的右声道信号,RHP为通过高通滤波器的右声道信号,Lout为输出的左声道信号,Rout为输出的右声道信号。where C is the cancellation matrix, G is the gain constant, L LP is the left channel signal passed through the low pass filter, L HP is the left channel signal passed through the high pass filter, and R LP is the right channel signal passed through the low pass filter signal, R HP is the right channel signal passed through the high-pass filter, L out is the output left channel signal, and R out is the output right channel signal.

在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference herein to an "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor a separate or alternative embodiment that is mutually exclusive of other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

请参阅图7,图7是本发明实施例提供的用于立体声播放的电子设备结构示意图。电子设备700包括:处理器701、显示器702、存储器703、射频电路704、音频模块705以及电源706。Please refer to FIG. 7 . FIG. 7 is a schematic structural diagram of an electronic device for stereo playback provided by an embodiment of the present invention. The electronic device 700 includes: a processor 701 , a display 702 , a memory 703 , a radio frequency circuit 704 , an audio module 705 and a power supply 706 .

其中,处理器701是电子设备700的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或加载存储在存储器702内的计算机程序,以及调用存储在存储器702内的数据,执行电子设备700的各种功能并处理数据,从而对电子设备700进行整体监控。The processor 701 is the control center of the electronic device 700, using various interfaces and lines to connect various parts of the entire electronic device, by running or loading the computer program stored in the memory 702, and calling the data stored in the memory 702, Various functions of the electronic device 700 are performed and data is processed, thereby overall monitoring of the electronic device 700 is performed.

存储器702可用于存储软件程序以及模块,处理器701通过运行存储在存储器702的计算机程序以及模块,从而执行各种功能应用以及数据处理。存储器702可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的计算机程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据电子设备的使用所创建的数据等。此外,存储器702可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器702还可以包括存储器控制器,以提供处理器701对存储器702的访问。The memory 702 can be used to store software programs and modules, and the processor 701 executes various functional applications and data processing by running the computer programs and modules stored in the memory 702 . The memory 702 may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, a computer program (such as a sound playback function, an image playback function, etc.) required for at least one function, and the like; Data created by the use of electronic equipment, etc. Additionally, memory 702 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, memory 702 may also include a memory controller to provide processor 701 access to memory 702 .

在本申请实施例中,电子设备700中的处理器701会按照如下的步骤,将一个或一个以上的计算机程序的进程对应的指令加载到存储器702中,并由处理器701运行存储在存储器702中的计算机程序,从而实现各种功能,如下:In the embodiment of the present application, the processor 701 in the electronic device 700 loads the instructions corresponding to the processes of one or more computer programs into the memory 702 according to the following steps, and is executed by the processor 701 and stored in the memory 702 The computer program in , so as to realize various functions, as follows:

获取输入的音频信号,提取输入的音频信号中具有方位信息的立体声信号,如果输入的音频信号不具有立体声信号,则对输入的音频信号进行编码,使其具有立体声信号,然后,对具有立体声信号的音频信号进行解码,以得到多声道信号,利用头相关传输函数创建虚拟扬声器阵列,将多声道信号转码成具有立体声信号的双声道信号,再对双声道信号进行串扰消除,最后将进行串扰消除后的双声道信号输出至双扬声器进行播放,实现电子设备播放音频时实现立体声播放效果。Obtain the input audio signal, extract the stereo signal with orientation information in the input audio signal, if the input audio signal does not have a stereo signal, encode the input audio signal to make it have a stereo signal, and then, encode the input audio signal with a stereo signal. The audio signal is decoded to obtain a multi-channel signal, the head-related transfer function is used to create a virtual speaker array, the multi-channel signal is transcoded into a two-channel signal with a stereo signal, and crosstalk is eliminated for the two-channel signal. Finally, the two-channel signal after the crosstalk cancellation is output to the dual speakers for playback, so as to realize the stereo playback effect when the electronic device plays the audio.

显示器703可以用于显示由用户输入的信息或提供给用户的信息以及各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。显示器703可以包括显示面板,在一些实施方式中,可以采用液晶显示器(Liquid Crystal Display,LCD)、或者有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板。The display 703 may be used to display information input by or provided to the user and various graphical user interfaces, which may be composed of graphics, text, icons, video, and any combination thereof. The display 703 may include a display panel, and in some embodiments, the display panel may be configured in the form of a Liquid Crystal Display (LCD), or an Organic Light-Emitting Diode (OLED).

射频电路704可以用于收发射频信号,以通过无线通信与网络设备或其他电子设备建立无线通讯,与网络设备或其他电子设备之间收发信号。The radio frequency circuit 704 can be used to send and receive radio frequency signals, so as to establish wireless communication with the network device or other electronic devices through wireless communication, and to send and receive signals with the network device or other electronic devices.

音频模块705,包含双扬声器以及音频电路。音频电路可将接收到的音频数据转换后的电信号,传输到双扬声器,由双扬声器转换为声音信号输出;另一方面,传声器将收集的声音信号转换为电信号,由音频电路接收后转换为音频数据,再将音频数据输出处理器701处理后,经射频电路704以发送给比如另一终端,或者将音频数据输出至存储器702以便进一步处理。音频电路还可能包括耳塞插孔,以提供外设耳机与终端的通信。The audio module 705 includes dual speakers and audio circuits. The audio circuit can convert the received audio data into an electrical signal and transmit it to the dual speakers, which are converted into sound signals for output; on the other hand, the microphone converts the collected sound signals into electrical signals, which are received and converted by the audio circuit. In the form of audio data, the audio data is output to the processor 701 for processing, and then sent to, for example, another terminal via the radio frequency circuit 704, or the audio data is output to the memory 702 for further processing. Audio circuitry may also include earplug jacks to provide peripheral headsets to communicate with the terminal.

电源706可以用于给电子设备700的各个部件供电。在一些实施例中,电源706可以通过电源管理系统与处理器701逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。Power supply 706 may be used to power various components of electronic device 700 . In some embodiments, the power supply 706 may be logically connected to the processor 701 through a power management system, so as to implement functions such as managing charging, discharging, and power consumption through the power management system.

尽管图7中并未示出,电子设备700还可以包括摄像头、蓝牙模块等,在此不做赘述。Although not shown in FIG. 7 , the electronic device 700 may further include a camera, a Bluetooth module, etc., which will not be described in detail here.

在本申请实施例中,存储介质可以是磁碟、光盘、只读存储器(Read Only Memory,ROM)、或者随机存取记忆体(Random Access Memory,RAM)等。In this embodiment of the present application, the storage medium may be a magnetic disk, an optical disk, a read only memory (Read Only Memory, ROM), or a random access memory (Random Access Memory, RAM), or the like.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.

需要说明的是,对本申请实施例的立体声播放方法而言,本领域普通测试人员可以理解实现本申请实施例用户性别预测方法的全部或部分流程,是可以通过计算机程序来控制相关的硬件来完成,计算机程序可存储于一计算机可读取存储介质中,如存储在电子设备的存储器中,并被该电子设备内的至少一个处理器执行,在执行过程中可包括如用户性别预测方法的实施例的流程。其中,的存储介质可为磁碟、光盘、只读存储器、随机存取记忆体等。It should be noted that, for the stereo playback method of the embodiment of the present application, ordinary testers in the art can understand that all or part of the process of realizing the user gender prediction method of the embodiment of the present application can be completed by controlling the relevant hardware through a computer program. , the computer program can be stored in a computer-readable storage medium, such as in a memory of an electronic device, and executed by at least one processor in the electronic device, and the execution process can include, for example, the implementation of a method for predicting gender of a user example process. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, or the like.

对本申请实施例的立体声播放装置而言,其各功能模块可以集成在一个处理芯片中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中,存储介质譬如为只读存储器,磁盘或光盘等。For the stereo playback device of the embodiment of the present application, each functional module may be integrated in one processing chip, or each module may exist physically alone, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules. If the integrated modules are implemented in the form of software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium, such as a read-only memory, a magnetic disk or an optical disk.

以上对本申请实施例所提供的一种立体声播放方法、装置、存储介质及电子设备进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。A stereo playback method, device, storage medium, and electronic device provided by the embodiments of the present application have been described in detail above. The principles and implementations of the present application are described with specific examples. The descriptions of the above embodiments are only It is used to help understand the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there will be changes in the specific embodiments and application scope. In summary, this specification The content should not be construed as a limitation on this application.

Claims (9)

1. A stereo playing method is applied to an electronic device, the electronic device comprises two loudspeakers, and the method comprises the following steps:
extracting a stereo signal with azimuth information in the audio signal;
decoding the stereo signal to obtain a multi-channel signal;
constructing the positions of a plurality of virtual loudspeakers in the space according to the multi-channel signals;
respectively calculating audio signals of a plurality of virtual speakers based on a first formula to obtain a virtual speaker array signal, wherein the first formula is as follows:
Figure 884319DEST_PATH_IMAGE001
wherein,
Figure 270301DEST_PATH_IMAGE002
is a first
Figure 518880DEST_PATH_IMAGE003
The audio signal of the individual virtual loudspeakers is,
Figure 632199DEST_PATH_IMAGE004
Is as follows
Figure 712150DEST_PATH_IMAGE005
The azimuth of the virtual loudspeaker position in the horizontal plane XY,
Figure 206716DEST_PATH_IMAGE006
is as follows
Figure 942591DEST_PATH_IMAGE007
The azimuth angle of the virtual loudspeaker position on a vertical plane YZ, d is a proportionality coefficient, and W is a sound channel signal;
performing binaural transcoding on the virtual speaker array signal to obtain a binaural signal;
respectively carrying out crosstalk elimination on the two-channel signals and outputting the two-channel signals to the dual loudspeakers for playing, wherein the crosstalk elimination on the two-channel signals comprises the following steps:
enabling a left channel signal of the two-channel signal to pass through a high-pass filter, enabling a right channel signal to pass through a low-pass filter, and eliminating crosstalk of the middle-low frequency signal based on a third formula, wherein the third formula is as follows:
Figure 361065DEST_PATH_IMAGE008
where C is the cancellation matrix, G is the gain constant,
Figure 498786DEST_PATH_IMAGE009
is the left channel signal that is passed through the low pass filter,
Figure 960991DEST_PATH_IMAGE010
is the left channel signal that is passed through a high pass filter,
Figure 184162DEST_PATH_IMAGE011
is the right channel signal that is passed through the low pass filter,
Figure 639283DEST_PATH_IMAGE012
for the right channel signal to pass through the high pass filter,
Figure 631510DEST_PATH_IMAGE013
in order to output the left channel signal of the left channel,
Figure 530196DEST_PATH_IMAGE014
is the output right channel signal.
2. The stereo playback method as defined in claim 1, wherein extracting the stereo signal having the azimuth information from the audio signal comprises:
Judging whether the audio signal contains a stereo signal;
if not, the audio signal is encoded to obtain the stereo signal with the azimuth information.
3. The stereo playback method as defined in claim 1, wherein the binaural transcoding of the virtual speaker array signal comprises:
and performing binaural transcoding on the virtual speaker array signal based on a second formula to obtain a stereo signal of the binaural signal, where the second formula is:
Figure 240663DEST_PATH_IMAGE015
where L is the left channel signal, R is the right channel signal, H is the head related transfer function, and P is the audio signal of the virtual speaker.
4. A stereo playing device applied to an electronic device comprising two loudspeakers, comprises:
the device comprises an extraction module, a decoding module, a transcoding module and a crosstalk elimination module;
the extraction module is used for extracting a stereo signal with azimuth information in the audio signal;
the decoding module is used for decoding the stereo signal to obtain a multi-channel signal;
the transcoding module comprises an array construction sub-module and a transcoding sub-module;
the array construction submodule is specifically used for constructing the positions of a plurality of virtual loudspeakers in the space according to the multi-channel signals;
Respectively calculating audio signals of a plurality of virtual speakers based on a first formula to obtain a virtual speaker array signal, wherein the first formula is as follows:
Figure 781365DEST_PATH_IMAGE016
wherein,
Figure 641481DEST_PATH_IMAGE017
is as follows
Figure 445489DEST_PATH_IMAGE003
The audio signals of the individual virtual loudspeakers,
Figure 643252DEST_PATH_IMAGE018
is as follows
Figure 190908DEST_PATH_IMAGE019
The azimuth of the virtual loudspeaker position in the horizontal plane XY,
Figure 406994DEST_PATH_IMAGE006
is a first
Figure 647483DEST_PATH_IMAGE020
The azimuth angle of the virtual loudspeaker position on a vertical plane YZ, d is a proportionality coefficient, and W is a sound channel signal;
the transcoding sub-module is used for performing double-channel transcoding on the virtual loudspeaker array signal to obtain a double-channel signal;
the crosstalk elimination module is configured to perform crosstalk elimination on the binaural signals respectively and output the binaural signals to the dual speakers for playing, where performing crosstalk elimination on the binaural signals includes:
enabling a left channel signal of the two-channel signal to pass through a high-pass filter, enabling a right channel signal to pass through a low-pass filter, and eliminating crosstalk of the middle-low frequency signal based on a third formula, wherein the third formula is as follows:
Figure 66963DEST_PATH_IMAGE021
where C is the cancellation matrix, G is the gain constant,
Figure 418310DEST_PATH_IMAGE022
is the left channel signal that is passed through the low pass filter,
Figure 724788DEST_PATH_IMAGE023
is the left channel signal that is passed through a high pass filter,
Figure 401757DEST_PATH_IMAGE024
is the right channel signal that is passed through the low pass filter,
Figure 308533DEST_PATH_IMAGE025
For the right channel signal to pass through the high pass filter,
Figure 197992DEST_PATH_IMAGE026
in order to output the left channel signal,
Figure 123092DEST_PATH_IMAGE027
is the output right channel signal.
5. The stereo playback device according to claim 4, wherein the extraction module includes:
the judgment submodule is used for judging whether the audio signal contains a stereo signal;
and the coding submodule is used for coding the audio signal to obtain the stereo signal with the azimuth information when the judgment submodule judges that the audio signal is not the stereo signal with the azimuth information.
6. A storage medium having stored thereon a computer program, wherein the computer program, when executed on a computer, causes the computer to perform the method of any of claims 1 to 3.
7. An electronic device for stereophonic sound reproduction comprising dual speakers, a processor and a memory, wherein said processor is adapted to execute, by invoking a computer program in said memory:
extracting a stereo signal with azimuth information in the audio signal;
decoding the stereo signal to obtain a multi-channel signal;
constructing the positions of a plurality of virtual loudspeakers in the space according to the multi-channel signals;
respectively calculating audio signals of a plurality of virtual speakers based on a first formula to obtain a virtual speaker array signal, wherein the first formula is as follows:
Figure 705383DEST_PATH_IMAGE029
Wherein,
Figure 99455DEST_PATH_IMAGE030
is as follows
Figure 792604DEST_PATH_IMAGE031
The audio signals of the individual virtual loudspeakers,
Figure 119681DEST_PATH_IMAGE032
is as follows
Figure 614816DEST_PATH_IMAGE033
The azimuth of the virtual loudspeaker position in the horizontal plane XY,
Figure 496185DEST_PATH_IMAGE006
is as follows
Figure 993025DEST_PATH_IMAGE034
The azimuth angle of the virtual loudspeaker position on a vertical plane YZ, d is a proportionality coefficient, and W is a sound channel signal;
performing binaural transcoding on the virtual speaker array signal to obtain a binaural signal;
respectively carrying out crosstalk elimination on the two-channel signals and outputting the two-channel signals to the dual loudspeakers for playing, wherein the crosstalk elimination on the two-channel signals comprises the following steps:
enabling a left channel signal of the two-channel signal to pass through a high-pass filter, enabling a right channel signal to pass through a low-pass filter, and eliminating crosstalk of the middle-low frequency signal based on a third formula, wherein the third formula is as follows:
Figure 643449DEST_PATH_IMAGE035
where C is the cancellation matrix, G is the gain constant,
Figure 551231DEST_PATH_IMAGE036
is the left channel signal that is passed through the low pass filter,
Figure 654316DEST_PATH_IMAGE037
is the left channel signal that is passed through a high pass filter,
Figure 689269DEST_PATH_IMAGE038
is the right channel signal that is passed through the low pass filter,
Figure 459778DEST_PATH_IMAGE039
for the right channel signal to pass through the high pass filter,
Figure 39927DEST_PATH_IMAGE040
is an outputOf the left channel signal of (a) a left channel signal,
Figure 895887DEST_PATH_IMAGE041
is the output right channel signal.
8. The electronic device for stereophonic sound reproduction according to claim 7, wherein, when extracting a stereophonic sound signal having orientation information from the audio signal, the processor is configured to perform:
Judging whether the audio signal contains a stereo signal;
if not, the audio signal is coded to obtain the stereo signal with the azimuth information.
9. The electronic device of claim 8, wherein the processor is configured to perform, when binaural transcoding is performed on the virtual speaker array signal:
performing crosstalk cancellation on the low and medium frequency signals based on a second formula, wherein the second formula is as follows:
Figure 109DEST_PATH_IMAGE042
where L is the left channel signal, R is the right channel signal, H is the head related transfer function, and P is the audio signal of the virtual speaker.
CN201880098484.4A 2018-11-27 2018-11-27 Stereo playing method, device, storage medium and electronic equipment Active CN112840678B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/117642 WO2020107201A1 (en) 2018-11-27 2018-11-27 Stereo sound playback method and device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN112840678A CN112840678A (en) 2021-05-25
CN112840678B true CN112840678B (en) 2022-06-14

Family

ID=70852207

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201880098484.4A Active CN112840678B (en) 2018-11-27 2018-11-27 Stereo playing method, device, storage medium and electronic equipment

Country Status (2)

Country Link
CN (1) CN112840678B (en)
WO (1) WO2020107201A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US12417773B2 (en) * 2020-08-27 2025-09-16 Apple Inc. Stereo-based immersive coding
CN115376529B (en) * 2021-05-17 2024-10-11 华为技术有限公司 Three-dimensional audio signal coding method, device and coder
CN113810838B (en) * 2021-09-16 2024-12-10 Oppo广东移动通信有限公司 Audio control method and audio playback device
CN113891219A (en) * 2021-10-19 2022-01-04 Oppo广东移动通信有限公司 Device layout method, device, audio playback device, and storage medium
CN116208908A (en) * 2023-03-03 2023-06-02 Oppo广东移动通信有限公司 Recording file playing method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1277532A (en) * 1999-06-10 2000-12-20 三星电子株式会社 Multiple-channel audio frequency replaying apparatus and method
CN1860826A (en) * 2004-06-04 2006-11-08 三星电子株式会社 Apparatus and method of reproducing wide stereo sound
CN101212834A (en) * 2006-12-30 2008-07-02 上海乐金广电电子有限公司 Cross talk eliminator in audio system
CN108632714A (en) * 2017-03-23 2018-10-09 展讯通信(上海)有限公司 Sound processing method, device and the mobile terminal of loud speaker

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100569675B1 (en) * 2004-01-30 2006-04-10 엘지전자 주식회사 Method and apparatus for downmixing audio data
US8670576B2 (en) * 2008-01-01 2014-03-11 Lg Electronics Inc. Method and an apparatus for processing an audio signal
US9973874B2 (en) * 2016-06-17 2018-05-15 Dts, Inc. Audio rendering using 6-DOF tracking

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1277532A (en) * 1999-06-10 2000-12-20 三星电子株式会社 Multiple-channel audio frequency replaying apparatus and method
CN1860826A (en) * 2004-06-04 2006-11-08 三星电子株式会社 Apparatus and method of reproducing wide stereo sound
CN101212834A (en) * 2006-12-30 2008-07-02 上海乐金广电电子有限公司 Cross talk eliminator in audio system
CN108632714A (en) * 2017-03-23 2018-10-09 展讯通信(上海)有限公司 Sound processing method, device and the mobile terminal of loud speaker

Also Published As

Publication number Publication date
WO2020107201A1 (en) 2020-06-04
CN112840678A (en) 2021-05-25

Similar Documents

Publication Publication Date Title
CN112840678B (en) Stereo playing method, device, storage medium and electronic equipment
TWI819344B (en) Audio signal rendering method, apparatus, device and computer readable storage medium
EP2926573A1 (en) Constrained dynamic amplitude panning in collaborative sound systems
CN109165005B (en) Sound effect enhancement method and device, electronic equipment and storage medium
US20140247945A1 (en) Method and apparatus for communicating with audio signals having corresponding spatial characteristics
TW201517643A (en) Method for and apparatus for decoding an ambisonics audio soundfield representation for audio playback using 2D setups
CN101695151A (en) Method and equipment for converting multi-channel audio signals into dual-channel audio signals
CN117501362B (en) Audio rendering system, method and electronic device
US12335700B2 (en) Bluetooth speaker control method and system, storage medium, and mobile terminal
CN117546236B (en) Audio rendering system, method and electronic device
CN104581512A (en) Stereo recording method and device
CN110191745B (en) Game streaming using spatial audio
CN118264971B (en) Speaker-based spatial audio system, audio processor, vehicle, virtual surround sound conversion method, and audio rendering method
KR20200100664A (en) Monophonic signal processing in a 3D audio decoder that delivers stereoscopic sound content
CN109074813A (en) Handle high definition audio data
CN105721639A (en) Stereo output device of mobile terminal and mobile terminal
CN114339582A (en) Dual-channel audio processing method, directional filter generating method, apparatus and medium
CN106331356B (en) A volume control method and terminal
CN114128312B (en) Audio rendering for low frequency effects
CN117931116B (en) Volume adjustment method, electronic device, and medium
CN118714491B (en) Audio processing method, device, equipment, medium and product
CN117676002B (en) Audio processing method and electronic equipment
US20250104719A1 (en) Method and System for Producing an Augmented Ambisonic Format
CN117707464A (en) Audio processing method and related equipment
US20140372110A1 (en) Voic call enhancement

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant