WO2017219538A1 - Channel data matching method and device - Google Patents

Channel data matching method and device Download PDF

Info

Publication number
WO2017219538A1
WO2017219538A1 PCT/CN2016/101136 CN2016101136W WO2017219538A1 WO 2017219538 A1 WO2017219538 A1 WO 2017219538A1 CN 2016101136 W CN2016101136 W CN 2016101136W WO 2017219538 A1 WO2017219538 A1 WO 2017219538A1
Authority
WO
WIPO (PCT)
Prior art keywords
speaker
data
channel data
current frame
right channel
Prior art date
Application number
PCT/CN2016/101136
Other languages
French (fr)
Chinese (zh)
Inventor
赵胜涛
刘子超
Original Assignee
乐视控股(北京)有限公司
乐视致新电子科技(天津)有限公司
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 乐视控股(北京)有限公司, 乐视致新电子科技(天津)有限公司 filed Critical 乐视控股(北京)有限公司
Publication of WO2017219538A1 publication Critical patent/WO2017219538A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04SSTEREOPHONIC SYSTEMS 
    • H04S1/00Two-channel systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04SSTEREOPHONIC SYSTEMS 
    • H04S1/00Two-channel systems
    • H04S1/007Two-channel systems in which the audio signals are in digital form

Definitions

  • the present application relates to the field of terminal communication technologies, and relates to a channel data matching method and apparatus, for example.
  • the decoded pulse-code modulation (PCM) stereo sound data is composed of left channel and right channel sound source data, and when playing music, the left channel sound source data It is sent by the left speaker on the phone, and the right channel source data is sent by the right speaker on the phone.
  • PCM pulse-code modulation
  • the inventor has found that at least the following problems exist in the related art: in the related art, when the mobile phone with dual speaker configuration on the market plays stereo music, the left and right channels are fixed, for example, the speaker disposed on the head of the mobile phone is the first speaker, For playing the left channel source data, the speaker set at the end of the phone is the second speaker for playing the right channel source data.
  • the first speaker plays the left channel sound source data; when the user converts the mobile phone posture so that the mobile phone head faces to the right, the first speaker is still playing the left channel sound source data, and the user's The left ear data is played on the right ear, and the right channel data is played on the left ear, which is inconsistent with the actual situation. This situation is unacceptable for music enthusiasts.
  • One solution in the related art is to exchange the left and right channels of the sound source digital signal in the speaker hardware layer, but this implementation cannot coexist with other sound effects algorithms, which will destroy the processing effect of the third party sound effect algorithm.
  • the present application provides a channel data matching method and apparatus to improve the playback performance of stereo music and implement a third-party compatible audio algorithm.
  • the embodiment of the present application provides a channel data matching method, which is applied to an intelligent terminal, where the method includes:
  • the current frame is sent to the speaker hardware layer for the speaker hardware layer to read the audio data in the current frame and output to the first speaker and the second speaker for playback.
  • the determining, according to the terminal posture, a current matching relationship between the first speaker and the second speaker and the left channel and the right channel including:
  • a current matching relationship between the first speaker and the second speaker and the left channel and the right channel is determined according to a relative positional relationship between the first speaker and the second speaker and the user.
  • determining a current matching relationship between the first speaker and the second speaker and the left channel and the right channel according to the relative positional relationship between the first speaker and the second speaker and the user including:
  • adjusting the positions of the left channel data and the right channel data in the current frame of the PCM according to the current matching relationship including:
  • adjusting the number of left channels in the current frame of the PCM according to the current matching relationship it also includes:
  • the compressed audio data stream is processed based on at least one of the following algorithms to obtain the PCM data: a Dolby decoding algorithm or an audio fidelity Dirac decoding algorithm.
  • the method further includes:
  • the PCM data is processed based on at least one of the following algorithms: a Dolby sound algorithm or an audio fidelity Dirac algorithm.
  • the embodiment of the present application further provides a channel data matching apparatus, where the apparatus includes:
  • a determining module configured to determine a current matching relationship between the first speaker and the second speaker and the left channel and the right channel according to the posture of the terminal;
  • Adjusting a module configured to adjust a position of the left channel data and the right channel data in the current frame of the pulse code modulation PCM according to the current matching relationship
  • the playing module is configured to send the current frame to the speaker hardware layer, so that the speaker hardware layer reads the audio data in the current frame, and outputs to the first speaker and the second speaker for playing.
  • the determining module includes:
  • the acquiring unit is configured to acquire acceleration sensor data or rotate sensor data in the terminal;
  • a first determining unit configured to determine a relative positional relationship between the first speaker and the second speaker and the user according to the acceleration sensor data or the rotation sensor data;
  • the second determining unit is configured to determine a current matching relationship between the first speaker and the second speaker and the left channel and the right channel according to the relative positional relationship between the first speaker and the second speaker and the user.
  • the second determining unit is configured to: when the distance between the first speaker and the left ear of the user is relatively close to the distance between the right ear of the user, determine the first speaker and the left Channel matching, the second speaker matches the right channel;
  • the adjustment module is configured to:
  • the device further includes:
  • a first processing module is further disposed to decode the compressed audio data stream based on at least one of the following algorithms before adjusting the positions of the left channel data and the right channel data in the current frame of the PCM according to the current matching relationship Processing to obtain the PCM data: a Dolby decoding algorithm or an audio fidelity Dirac decoding algorithm.
  • the device further includes:
  • a second processing module configured to process the PCM data based on at least one of the following algorithms after adjusting the positions of the left channel data and the right channel data in the current frame of the PCM according to the current matching relationship: More than the sound algorithm or the audio fidelity Dirac algorithm.
  • the embodiment of the present application further provides an electronic device, including:
  • At least one processor and,
  • the memory stores instructions executable by the one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform any of the channel data matching in the embodiments of the present application method.
  • the embodiment of the present application further provides a non-transitory computer readable storage medium, wherein the non-transitory computer readable storage medium stores computer instructions, where the computer instructions are used to cause the computer to execute the present Apply any channel data matching method in the embodiment.
  • the embodiment of the present application further provides a computer program product, where the computer program product includes a computing program stored on a non-transitory computer readable storage medium, where the computer program includes program instructions.
  • the program instructions When the program instructions are executed by a computer, the computer is caused to perform any of the channel data matching methods in the embodiments of the present application.
  • a channel data matching method determines a current matching relationship between a first speaker and a second speaker and a left channel and a right channel according to a terminal posture, and adjusts a pulse according to the current matching relationship. Encoding the position of the left channel data and the right channel data in the current frame of the modulated PCM, and then transmitting the adjusted current frame to the speaker hardware layer, so that the speaker hardware layer reads the audio data in the current frame and outputs to The technical means for playing the first speaker and the second speaker realizes the improvement of the playing effect of the stereo music and realizes the compatibility with the third-party audio algorithm.
  • Embodiment 1 is a flowchart of a channel data matching method in Embodiment 1 of the present application.
  • FIG. 2 is a flowchart of a channel data matching method in Embodiment 2 of the present application.
  • Embodiment 3 is a structural diagram of a channel data matching apparatus in Embodiment 3 of the present application.
  • FIG. 4 is a schematic structural diagram of hardware of a device according to Embodiment 5 of the present application.
  • exemplary embodiments are described as a process or method depicted as a flowchart. Although a flowchart depicts each operation (or step) as a sequential process, many of the operations can be implemented in parallel, concurrently, or concurrently. In addition, the order of each operation can be rearranged. The process may be terminated when each step operation is completed, but may also have additional steps not included in the figures. The processing may correspond to methods, functions, procedures, subroutines, subroutines, and the like.
  • Embodiment 1 is a flowchart of a channel data matching method according to Embodiment 1 of the present application. This embodiment is applicable to a case where a user plays a stereo music through a terminal configured with two speakers, and the method can be provided by the embodiment of the present application.
  • the vocal tract data matching device is implemented, and the device can be integrated in a terminal, such as a mobile phone. As shown in FIG. 1, the method includes:
  • a current matching relationship between the first speaker and the second speaker and the left channel and the right channel is determined according to the terminal posture.
  • the terminals sold in the market are equipped with two speakers, which are premised on the posture of the terminal when the user normally uses the terminal to make a call or send a short message, and the first speaker is usually set at the terminal.
  • the second speaker is disposed at a lower side edge of the terminal; or the first speaker and the second speaker are juxtaposed at an upper edge or a lower edge of the terminal, optionally, the first A speaker may be disposed on the left side of the second speaker.
  • the first speaker is used to play the left channel data
  • the second speaker is used to play the right channel data, thereby realizing the playback of the stereo music.
  • the first speaker used to play the left channel data is closer to the left ear than the user's right ear, the first speaker still plays the left channel data, and the second speaker that is closer to the right ear of the user's left ear remains The right channel data is also played, which will result in poor stereo music playback, which is unacceptable to some music lovers.
  • the current matching relationship between the first speaker and the second speaker and the left channel and the right channel may be determined according to the current posture of the terminal.
  • the terminal posture may refer to a relative positional relationship between two speakers configured on the terminal and the user, that is, which speaker is closer to the left ear of the user, and which speaker is closer to the right ear of the user.
  • the PCM data frame exists in a certain data format, and the data format identifies which data bits in the PCM data store left channel data, and which data bits store right channel data.
  • the data format identifies which data bits in the PCM data store left channel data, and which data bits store right channel data.
  • the default matching relationship at initialization is that the left channel data is played by the first speaker, and the right channel data is played by the second speaker, when the current matching relationship between the first speaker and the second speaker and the left channel and the right channel is When the first speaker is closer to the right channel and the second speaker is closer to the left channel, the position of the left channel data and the right channel data in the current frame of the PCM is adjusted through the hardware abstraction layer.
  • the foregoing step may be: if the location of the left channel data and the right channel data in the current frame of the PCM is different from the current matching relationship, extracting the left channel data in the current frame by using a hardware abstraction layer
  • the right channel data is buffered, and the positions of the left channel data and the right channel data in the current frame are exchanged to form a new data frame and replace the current frame.
  • the third-party algorithm may be a control algorithm that controls the matching of the channel data of a specific speaker and a compensation algorithm for specific audio compensation of specific channel data.
  • the audio data processed by the algorithm will be read through the speaker hardware layer and played by the corresponding speakers.
  • the system does not know the current matching relationship between each speaker and each channel. Therefore, if the left and right channel data are exchanged in the speaker hardware layer, the number of the left and right speaker cavities will be seriously affected.
  • the compensation effect of the three-party algorithm on the audio data for example, optimizing the compensation sound effect algorithm for a speaker cavity modeling. Therefore, the position of the left channel data and the right channel data in the current frame of the pulse code modulation PCM can be adjusted by the hardware abstraction layer according to the current matching relationship before the third algorithm is loaded.
  • the method may further include:
  • the algorithm may be a Dolby sound algorithm or an audio fidelity Dirac algorithm.
  • the Dolby decoder can be used to obtain PCM data; when using the Dirac algorithm, the PCM data can be obtained by decoding with Nuplayer or AwesomePlayer.
  • the method may further include:
  • the PCM data is processed based on at least one of the following algorithms: a Dolby sound algorithm, an audio fidelity Dirac algorithm. To enhance the playback of stereo music or to simultaneously play other sounds than the music sound.
  • the current frame is sent to the speaker hardware layer for the speaker hardware layer to read the audio data in the current frame and output to the first speaker and the second speaker for playback.
  • the current frame is composed of left channel data and right channel data
  • the left channel data can be controlled by the first speaker by loading a third party algorithm
  • the right channel data is played by the second speaker
  • the left channel data is Two speakers are played
  • the right channel data is played by the first speaker.
  • a channel data matching method provided by this embodiment determines the current matching relationship between the first speaker and the second speaker and the left channel and the right channel according to the terminal posture, and adjusts the pulse coding according to the current matching relationship. Modulating the position of the left channel data and the right channel data in the current frame of the PCM, and then transmitting the current frame to the speaker hardware layer for the speaker hardware layer to read the audio data in the current frame and outputting to the first The speaker and the second speaker are played to enhance the playback of stereo music.
  • the operation of "determining the current matching relationship between the first speaker and the second speaker and the left channel and the right channel according to the terminal posture" may be selected as "acquiring acceleration sensor data or rotation in the terminal".
  • Sensor data; determining a relative positional relationship between the first speaker and the second speaker and the user according to the acceleration sensor data or the rotation sensor data; determining the first speaker and the first speaker according to the relative positional relationship between the first speaker and the second speaker and the user The current matching relationship between the two speakers and the left and right channels”; such a setting can accurately determine the current matching relationship between the first speaker and the second speaker and the left and right channels.
  • the method includes:
  • acceleration sensor data or rotation sensor data in the terminal is acquired.
  • a relative positional relationship between the first speaker and the second speaker and the user is determined according to the acceleration sensor data or the rotation sensor data.
  • the sensor data may be a three-dimensional spatial coordinate value of the first speaker and the second speaker, and the distance between each speaker and the user may be obtained according to the three-dimensional spatial coordinate value.
  • a current matching relationship between the first speaker and the second speaker and the left channel and the right channel is determined according to a relative positional relationship between the first speaker and the second speaker and the user.
  • the above step may be: when the distance between the first speaker and the left ear of the user is relatively close to the distance between the right ear of the user, determining that the first speaker matches the left channel, The second speaker is matched to the right channel;
  • the current frame is sent to the speaker hardware layer for the speaker hardware layer to read the audio data in the current frame and output to the first speaker and the second speaker for playback.
  • a channel data matching method provided by the embodiment obtains the acceleration sensor data or the rotation sensor data in the terminal, and determines the relative positions of the first speaker and the second speaker and the user according to the acceleration sensor data or the rotation sensor data. Relationship, and then determining a current matching relationship between the first speaker and the second speaker and the left channel and the right channel according to the relative positional relationship between the first speaker and the second speaker and the user, thereby accurately determining the first speaker and the first speaker The current matching relationship between the two speakers and the left and right channels.
  • FIG. 3 is a schematic structural diagram of a channel data matching apparatus according to Embodiment 3 of the present application.
  • the apparatus may be implemented by using software or hardware.
  • the apparatus may be integrated in a terminal, and the terminal may be a mobile phone, such as As shown in FIG. 3, the structure of the apparatus includes: a determining module 410, an adjusting module 420, and a playing module 430, wherein:
  • the determining module 410 is configured to determine a current matching relationship between the first speaker and the second speaker and the left channel and the right channel according to the terminal posture;
  • the adjusting module 420 is configured to adjust, according to the current matching relationship, a position of the left channel data and the right channel data in the current frame of the pulse code modulation PCM;
  • the playing module 430 is configured to send the current frame to the speaker hardware layer for the speaker hardware layer to read the audio data in the current frame and output to the first speaker and the second speaker for playing.
  • the determining module 410 can include:
  • the acquiring unit is configured to acquire acceleration sensor data or rotate sensor data in the terminal;
  • a first determining unit configured to determine a relative positional relationship between the first speaker and the second speaker and the user according to the acceleration sensor data or the rotation sensor data;
  • the second determining unit is configured to determine a current matching relationship between the first speaker and the second speaker and the left channel and the right channel according to the relative positional relationship between the first speaker and the second speaker and the user.
  • the second determining unit is configured to determine the first speaker and the left when a distance between the first speaker and a left ear of the user is relatively close to a distance between a right ear of the user Channel matching, the second speaker matches the right channel;
  • the device may further include:
  • a first processing module configured to process the audio data based on at least one of the following algorithms to adjust the position of the left channel data and the right channel data in the current frame of the PCM according to the current matching relationship PCM data: Dolby sound algorithm or audio fidelity Dirac algorithm.
  • the adjustment module 420 is configured to:
  • the device may further include:
  • a second processing module configured to process the PCM data based on at least one of the following algorithms after adjusting the positions of the left channel data and the right channel data in the current frame of the PCM according to the current matching relationship: Specific sound algorithm, audio fidelity Dirac algorithm or mixing algorithm.
  • the vocal tract data matching apparatus determines the current matching relationship between the first speaker and the second speaker and the left channel and the right channel according to the terminal posture, and adjusts the pulse coding according to the current matching relationship. Modulating the position of the left channel data and the right channel data in the current frame of the PCM, and then transmitting the current frame to the speaker hardware layer for the speaker hardware layer to read the audio data in the current frame and outputting to the first The speaker and the second speaker are played to enhance the playback of stereo music.
  • the vocal tract data matching device described in this embodiment can be used to perform the vocal data matching method described in the foregoing embodiments, and has corresponding functional modules to achieve the same beneficial effects.
  • the fourth embodiment of the present application provides a non-transitory computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions can perform the channel data matching method in any of the foregoing method embodiments.
  • Embodiment 5
  • FIG. 4 is a schematic diagram showing the hardware structure of an electronic device for performing a channel data matching method according to Embodiment 5 of the present application. As shown in FIG. 4, the device includes:
  • processors 410 and memory 420 One or more processors 410 and memory 420, one processor 410 is exemplified in FIG.
  • the apparatus for performing the channel data matching method may further include: an input device 430 and an output device 440.
  • the processor 410, the memory 420, the input device 430, and the output device 440 may be connected by a bus or other means, as exemplified by a bus connection in FIG.
  • the memory 420 is used as a non-transitory computer readable storage medium, and can be used for storing non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions corresponding to the method for performing channel data matching in the embodiment of the present application. /module (for example, the determination module 410 shown in Figure 3, tuning The entire module 420 and the play module 430).
  • the processor 410 performs various function applications and data processing of the server by running non-transitory software programs, instructions, and modules stored in the memory 420, that is, implementing a channel data matching method.
  • the memory 420 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function; the storage data area may store data created according to use of the terminal in which the application interacts, and the like.
  • memory 420 can include high speed random access memory, and can also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device.
  • memory 420 can optionally include memory remotely located relative to processor 410, which can be connected to the terminal of application interaction via a network.
  • Examples of the above network may be the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
  • Input device 430 can receive input numeric or character information, as well as key signal inputs related to user settings and function control of the terminal that interacts with the application.
  • Output device 440 can include a display device such as a display screen.
  • the one or more modules are stored in the memory 420, and when executed by the one or more processors 410, perform an execution channel data matching method in any of the above method embodiments.
  • the above product can perform the method provided by any embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method.
  • the above product can perform the method provided by any embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method.
  • the present application can be implemented by software and necessary general hardware, and can also be implemented by hardware, but in many cases, the former is an optional implementation. .
  • the present application can be embodied in the form of a software product that can be stored in a computer readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access. Memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform each embodiment of the present application. The method described.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store a program code. .
  • the embodiment of the present application provides a channel data matching method and device, which improves the playback effect of stereo music and implements a third-party compatible audio algorithm.

Abstract

A channel data matching method, applied to an intelligent terminal and comprising: determining a current matching relation of a first loudspeaker and a second loudspeaker with a left channel and a right channel according to the posture of a terminal; adjusting locations of left channel data and right channel data in a current frame of Pulse Code Modulation (PCM) according to the current matching relation; sending the current frame to a loudspeaker hardware layer, so that the loudspeaker hardware layer reads audio data in the current frame, and outputting the audio data to the first loudspeaker and the second loudspeaker to play.

Description

声道数据匹配方法及装置Channel data matching method and device
本申请要求在2016年6月23日提交中国专利局、申请号为201610464113.6、发明名称为“声道数据匹配方法及装置”的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 201610464113.6, entitled "Channel Data Matching Method and Apparatus", filed on June 23, 2016, the entire contents of which is incorporated herein by reference. In the application.
技术领域Technical field
本申请涉及终端通信技术领域,例如涉及一种声道数据匹配方法及装置。The present application relates to the field of terminal communication technologies, and relates to a channel data matching method and apparatus, for example.
背景技术Background technique
现如今,音乐播放已经成为集成在终端上的不可或缺的一项重要娱乐功能之一。为了达到更好的播放效果,音乐在制作时均采用多声道录制以产生较强的身临其境的立体声。相关技术中的手机播放音乐时,解码后的脉冲编码调制(pulse-code modulation,PCM)立体声音数据是由左声道和右声道音源数据组成的,当播放音乐时,左声道音源数据由手机上的左边扬声器发出,右声道音源数据由手机上的右边扬声器发出。Today, music playback has become one of the most important entertainment features that are integral to the terminal. In order to achieve better playback, the music is produced with multi-channel recording to produce stronger immersive stereo. When the mobile phone plays music in the related art, the decoded pulse-code modulation (PCM) stereo sound data is composed of left channel and right channel sound source data, and when playing music, the left channel sound source data It is sent by the left speaker on the phone, and the right channel source data is sent by the right speaker on the phone.
发明人发现相关技术至少存在如下问题:在相关技术中,市场上双扬声器配置的手机在播放立体声音乐时,左右声道都是固定的,例如设置在手机头部的扬声器为第一扬声器,用于播放左声道音源数据,设置在手机尾部的扬声器为第二扬声器,用于播放右声道音源数据。当手机头位于使用者左边时,第一扬声器播放的是左声道音源数据;当用户转换手机姿势使手机头朝右时,第一扬声器仍然是播放的左声道音源数据,此时用户的右耳边播放的是左声道数据,左耳边播放的却是右声道数据,与实际情况不符,这种情况对于音乐发烧友来说是难以接受的。相关技术中的一种解决方法是在扬声器硬件层对音源数字信号进行左右声道的互换,但是这种实现方式无法与其他的音效算法共存,会破坏第三方音效算法的处理效果。The inventor has found that at least the following problems exist in the related art: in the related art, when the mobile phone with dual speaker configuration on the market plays stereo music, the left and right channels are fixed, for example, the speaker disposed on the head of the mobile phone is the first speaker, For playing the left channel source data, the speaker set at the end of the phone is the second speaker for playing the right channel source data. When the mobile phone head is located on the left side of the user, the first speaker plays the left channel sound source data; when the user converts the mobile phone posture so that the mobile phone head faces to the right, the first speaker is still playing the left channel sound source data, and the user's The left ear data is played on the right ear, and the right channel data is played on the left ear, which is inconsistent with the actual situation. This situation is unacceptable for music enthusiasts. One solution in the related art is to exchange the left and right channels of the sound source digital signal in the speaker hardware layer, but this implementation cannot coexist with other sound effects algorithms, which will destroy the processing effect of the third party sound effect algorithm.
发明内容Summary of the invention
本申请提供一种声道数据匹配方法及装置,以提高立体声音乐的播放效果,并实现了兼容第三方音频算法。 The present application provides a channel data matching method and apparatus to improve the playback performance of stereo music and implement a third-party compatible audio algorithm.
第一方面,本申请实施例提供了一种声道数据匹配方法,应用于智能终端,所述方法包括:In a first aspect, the embodiment of the present application provides a channel data matching method, which is applied to an intelligent terminal, where the method includes:
根据所述终端的姿态,确定第一扬声器和第二扬声器与左声道和右声道的当前匹配关系;Determining a current matching relationship between the first speaker and the second speaker and the left channel and the right channel according to the posture of the terminal;
根据所述当前匹配关系,调整脉冲编码调制PCM的当前帧中的左声道数据和右声道数据的位置;以及,Adjusting the position of the left channel data and the right channel data in the current frame of the pulse code modulation PCM according to the current matching relationship;
将当前帧发送至扬声器硬件层,以供扬声器硬件层读取当前帧中的音频数据,并输出至所述第一扬声器和第二扬声器进行播放。The current frame is sent to the speaker hardware layer for the speaker hardware layer to read the audio data in the current frame and output to the first speaker and the second speaker for playback.
可选的,所述根据终端姿态,确定第一扬声器和第二扬声器与左声道和右声道的当前匹配关系,包括:Optionally, the determining, according to the terminal posture, a current matching relationship between the first speaker and the second speaker and the left channel and the right channel, including:
获取终端内的加速度传感器数据或者旋转传感器数据;Acquiring acceleration sensor data or rotating sensor data in the terminal;
根据所述加速度传感器数据或者旋转传感器数据确定第一扬声器和第二扬声器与用户的相对位置关系;以及,Determining, according to the acceleration sensor data or the rotation sensor data, a relative positional relationship between the first speaker and the second speaker and the user; and
根据所述第一扬声器和第二扬声器与用户的相对位置关系确定第一扬声器和第二扬声器与左声道和右声道的当前匹配关系。A current matching relationship between the first speaker and the second speaker and the left channel and the right channel is determined according to a relative positional relationship between the first speaker and the second speaker and the user.
可选的,根据所述第一扬声器和第二扬声器与用户的相对位置关系确定第一扬声器和第二扬声器与左声道和右声道的当前匹配关系,包括:Optionally, determining a current matching relationship between the first speaker and the second speaker and the left channel and the right channel according to the relative positional relationship between the first speaker and the second speaker and the user, including:
当所述第一扬声器与用户的左耳朵之间的距离相对与用户的右耳朵之间的距离较近时,确定所述第一扬声器与左声道匹配,第二扬声器与右声道匹配:When the distance between the first speaker and the left ear of the user is relatively close to the distance between the right ear of the user, it is determined that the first speaker matches the left channel, and the second speaker matches the right channel:
或者,or,
当所述第一扬声器与用户的右耳朵之间的距离相对与用户的左耳朵之间的距离较近时,确定所述第一扬声器与右声道匹配,第二扬声器与左声道匹配。When the distance between the first speaker and the user's right ear is relatively close to the distance between the user's left ear, it is determined that the first speaker matches the right channel and the second speaker matches the left channel.
可选的,根据所述当前匹配关系,调整PCM的当前帧中的左声道数据和右声道数据的位置,包括:Optionally, adjusting the positions of the left channel data and the right channel data in the current frame of the PCM according to the current matching relationship, including:
如果所述PCM的当前帧中左声道数据和右声道数据的位置与所述当前匹配关系不同时,提取所述当前帧中左声道数据和右声道数据进行缓存,并交换所述左声道数据和右声道数据在当前帧中的位置,形成新的数据帧,并代替所述当前帧。If the positions of the left channel data and the right channel data in the current frame of the PCM are different from the current matching relationship, extracting left channel data and right channel data in the current frame for buffering, and exchanging the The position of the left channel data and the right channel data in the current frame forms a new data frame and replaces the current frame.
可选的,在根据所述当前匹配关系,调整PCM的当前帧中的左声道数 据和右声道数据的位置之前,还包括:Optionally, adjusting the number of left channels in the current frame of the PCM according to the current matching relationship According to the location of the right channel data, it also includes:
对压缩音频数据流基于如下至少一项算法进行处理,以获取所述PCM数据:杜比解码算法或者音频保真Dirac解码算法。The compressed audio data stream is processed based on at least one of the following algorithms to obtain the PCM data: a Dolby decoding algorithm or an audio fidelity Dirac decoding algorithm.
可选的,在根据所述当前匹配关系,调整PCM的当前帧中的左声道数据和右声道数据的位置之后,还包括:Optionally, after adjusting the positions of the left channel data and the right channel data in the current frame of the PCM according to the current matching relationship, the method further includes:
对所述PCM数据基于如下至少一项算法进行处理:杜比音效算法或者音频保真Dirac算法。The PCM data is processed based on at least one of the following algorithms: a Dolby sound algorithm or an audio fidelity Dirac algorithm.
第二方面,本申请实施例还提供了一种声道数据匹配装置,所述装置包括:In a second aspect, the embodiment of the present application further provides a channel data matching apparatus, where the apparatus includes:
确定模块,设置为根据所述终端的姿态,确定第一扬声器和第二扬声器与左声道和右声道的当前匹配关系;a determining module, configured to determine a current matching relationship between the first speaker and the second speaker and the left channel and the right channel according to the posture of the terminal;
调整模块,设置为根据所述当前匹配关系,调整脉冲编码调制PCM的当前帧中的左声道数据和右声道数据的位置;以及,Adjusting a module, configured to adjust a position of the left channel data and the right channel data in the current frame of the pulse code modulation PCM according to the current matching relationship; and
播放模块,设置为将当前帧发送至扬声器硬件层,以供扬声器硬件层读取当前帧中的音频数据,并输出至所述第一扬声器和第二扬声器进行播放。The playing module is configured to send the current frame to the speaker hardware layer, so that the speaker hardware layer reads the audio data in the current frame, and outputs to the first speaker and the second speaker for playing.
可选的,所述确定模块包括:Optionally, the determining module includes:
获取单元,设置为获取终端内的加速度传感器数据或者旋转传感器数据;The acquiring unit is configured to acquire acceleration sensor data or rotate sensor data in the terminal;
第一确定单元,设置为根据所述加速度传感器数据或者旋转传感器数据确定第一扬声器和第二扬声器与用户的相对位置关系;以及,a first determining unit configured to determine a relative positional relationship between the first speaker and the second speaker and the user according to the acceleration sensor data or the rotation sensor data; and
第二确定单元,设置为根据所述第一扬声器和第二扬声器与用户的相对位置关系确定第一扬声器和第二扬声器与左声道和右声道的当前匹配关系。The second determining unit is configured to determine a current matching relationship between the first speaker and the second speaker and the left channel and the right channel according to the relative positional relationship between the first speaker and the second speaker and the user.
可选的,所述第二确定单元设置为:当所述第一扬声器与用户的左耳朵之间的距离相对与用户的右耳朵之间的距离较近时,确定所述第一扬声器与左声道匹配,第二扬声器与右声道匹配;Optionally, the second determining unit is configured to: when the distance between the first speaker and the left ear of the user is relatively close to the distance between the right ear of the user, determine the first speaker and the left Channel matching, the second speaker matches the right channel;
或者,or,
当所述第一扬声器与用户的右耳朵之间的距离相对与用户的左耳朵之间的距离较近时,确定所述第一扬声器与右声道匹配,第二扬声器与左声道匹配。When the distance between the first speaker and the user's right ear is relatively close to the distance between the user's left ear, it is determined that the first speaker matches the right channel and the second speaker matches the left channel.
可选的,所述调整模块设置为:Optionally, the adjustment module is configured to:
如果所述PCM的当前帧中左声道数据和右声道数据的位置与所述当前匹配关系不同时,提取所述当前帧中左声道数据和右声道数据进行缓存,并 交换所述左声道数据和右声道数据在当前帧中的位置,形成新的数据帧,并代替所述当前帧。If the positions of the left channel data and the right channel data in the current frame of the PCM are different from the current matching relationship, extracting left channel data and right channel data in the current frame for buffering, and The position of the left channel data and the right channel data in the current frame is exchanged to form a new data frame and replace the current frame.
可选的,所述装置还包括:Optionally, the device further includes:
还包括第一处理模块,设置为在根据所述当前匹配关系,调整PCM的当前帧中的左声道数据和右声道数据的位置之前,对压缩音频数据流基于如下至少一项算法进行解码处理,以获取所述PCM数据:杜比解码算法或者音频保真Dirac解码算法。A first processing module is further disposed to decode the compressed audio data stream based on at least one of the following algorithms before adjusting the positions of the left channel data and the right channel data in the current frame of the PCM according to the current matching relationship Processing to obtain the PCM data: a Dolby decoding algorithm or an audio fidelity Dirac decoding algorithm.
可选的,所述装置还包括:Optionally, the device further includes:
第二处理模块,设置为在根据所述当前匹配关系,调整PCM的当前帧中的左声道数据和右声道数据的位置之后,对所述PCM数据基于如下至少一项算法进行处理:杜比音效算法或者音频保真Dirac算法。a second processing module, configured to process the PCM data based on at least one of the following algorithms after adjusting the positions of the left channel data and the right channel data in the current frame of the PCM according to the current matching relationship: More than the sound algorithm or the audio fidelity Dirac algorithm.
第三方面,本申请实施例还提供了一种电子设备,包括:In a third aspect, the embodiment of the present application further provides an electronic device, including:
至少一个处理器;以及,At least one processor; and,
与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein
所述存储器存储有可被所述一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够机执行本申请实施例中任一声道数据匹配方法。The memory stores instructions executable by the one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform any of the channel data matching in the embodiments of the present application method.
第四方面,本申请实施例还提供了一种非暂态计算机可读存储介质,其中,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令用于使所述计算机执行本申请实施例中任一声道数据匹配方法。In a fourth aspect, the embodiment of the present application further provides a non-transitory computer readable storage medium, wherein the non-transitory computer readable storage medium stores computer instructions, where the computer instructions are used to cause the computer to execute the present Apply any channel data matching method in the embodiment.
第五方面,本申请实施例还提供了一种计算机程序产品,其中,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行本申请实施例中任一声道数据匹配方法。In a fifth aspect, the embodiment of the present application further provides a computer program product, where the computer program product includes a computing program stored on a non-transitory computer readable storage medium, where the computer program includes program instructions. When the program instructions are executed by a computer, the computer is caused to perform any of the channel data matching methods in the embodiments of the present application.
本申请实施例提供的一种声道数据匹配方法,通过根据终端姿态,确定第一扬声器和第二扬声器与左声道和右声道的当前匹配关系,并根据所述当前匹配关系,调整脉冲编码调制PCM的当前帧中的左声道数据和右声道数据的位置,然后将调整后的当前帧发送至扬声器硬件层,以供扬声器硬件层读取当前帧中的音频数据,并输出至所述第一扬声器和第二扬声器进行播放的技术手段,实现了提高立体声音乐的播放效果,并实现了兼容第三方音频算法。 A channel data matching method provided by an embodiment of the present application determines a current matching relationship between a first speaker and a second speaker and a left channel and a right channel according to a terminal posture, and adjusts a pulse according to the current matching relationship. Encoding the position of the left channel data and the right channel data in the current frame of the modulated PCM, and then transmitting the adjusted current frame to the speaker hardware layer, so that the speaker hardware layer reads the audio data in the current frame and outputs to The technical means for playing the first speaker and the second speaker realizes the improvement of the playing effect of the stereo music and realizes the compatibility with the third-party audio algorithm.
附图说明DRAWINGS
一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。The one or more embodiments are exemplified by the accompanying drawings in the accompanying drawings, and FIG. The figures in the drawings do not constitute a scale limitation unless otherwise stated.
图1是本申请实施例一中的一种声道数据匹配方法的流程图;1 is a flowchart of a channel data matching method in Embodiment 1 of the present application;
图2是本申请实施例二中的一种声道数据匹配方法的流程图;2 is a flowchart of a channel data matching method in Embodiment 2 of the present application;
图3是本申请实施例三中的一种声道数据匹配装置的结构图;以及,3 is a structural diagram of a channel data matching apparatus in Embodiment 3 of the present application; and
图4是本申请实施例五提供的一种设备的硬件结构示意图。FIG. 4 is a schematic structural diagram of hardware of a device according to Embodiment 5 of the present application.
具体实施方式detailed description
下面结合附图和实施例对本申请进行说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本申请,而非对本申请的限定。为了便于描述,附图中仅示出了与本申请相关的部分而非全部结构。在不冲突的情况下,实施例中的特征可以相互任意组合。The present application will be described below in conjunction with the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the application and are not intended to be limiting. For the convenience of description, only some but not all of the structures related to the present application are shown in the drawings. The features in the embodiments can be arbitrarily combined with each other without conflict.
在更加详细地讨论示例性实施例之前应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将每项操作(或步骤)描述成顺序的处理,但是其中的许多操作可以被并行地、并发地或者同时实施。此外,每项操作的顺序可以被重新安排。当每个步骤操作完成时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程和子程序等等。Before discussing the exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as a process or method depicted as a flowchart. Although a flowchart depicts each operation (or step) as a sequential process, many of the operations can be implemented in parallel, concurrently, or concurrently. In addition, the order of each operation can be rearranged. The process may be terminated when each step operation is completed, but may also have additional steps not included in the figures. The processing may correspond to methods, functions, procedures, subroutines, subroutines, and the like.
实施例一Embodiment 1
图1为本申请实施例一提供的一种声道数据匹配方法的流程图,本实施例可适用于用户通过配置有两个扬声器的终端播放立体声音乐的情况,该方法可以由本申请实施例提供的声道数据匹配装置来执行,该装置可集成于终端中,例如手机。如图1所示,所述方法包括:1 is a flowchart of a channel data matching method according to Embodiment 1 of the present application. This embodiment is applicable to a case where a user plays a stereo music through a terminal configured with two speakers, and the method can be provided by the embodiment of the present application. The vocal tract data matching device is implemented, and the device can be integrated in a terminal, such as a mobile phone. As shown in FIG. 1, the method includes:
在S110中,根据终端姿态,确定第一扬声器和第二扬声器与左声道和右声道的当前匹配关系。In S110, a current matching relationship between the first speaker and the second speaker and the left channel and the right channel is determined according to the terminal posture.
市场上销售的终端,大多数都配置有两个扬声器,以用户正常使用终端打电话或者发短信时终端的姿态为前提,通常所述第一扬声器设置在终端的 上侧边缘处,所述第二扬声器设置在终端的下侧边缘;或者所述第一扬声器和所述第二扬声器并列设置在终端的上侧边缘或者下侧边缘,可选的,所述第一扬声器可以设置在所述第二扬声器的左边。例如第一扬声器用来播放左声道数据,第二扬声器用来播放右声道数据,从而实现立体声音乐的播放。但是当用来播放左声道数据的第一扬声器离用户的右耳朵较左耳朵更近时,第一扬声器依然还播放左声道数据,离用户左耳朵较右耳朵更近的第二扬声器依然还播放右声道数据,因此会导致播放的立体声音乐效果不佳,让一些音乐爱好者无法接受。Most of the terminals sold in the market are equipped with two speakers, which are premised on the posture of the terminal when the user normally uses the terminal to make a call or send a short message, and the first speaker is usually set at the terminal. The second speaker is disposed at a lower side edge of the terminal; or the first speaker and the second speaker are juxtaposed at an upper edge or a lower edge of the terminal, optionally, the first A speaker may be disposed on the left side of the second speaker. For example, the first speaker is used to play the left channel data, and the second speaker is used to play the right channel data, thereby realizing the playback of the stereo music. However, when the first speaker used to play the left channel data is closer to the left ear than the user's right ear, the first speaker still plays the left channel data, and the second speaker that is closer to the right ear of the user's left ear remains The right channel data is also played, which will result in poor stereo music playback, which is unacceptable to some music lovers.
所以为了实现更好的立体声音乐播放效果,可选的,可以根据终端的当前姿态,确定第一扬声器和第二扬声器与左声道和右声道的当前匹配关系。所述终端姿态可以是指终端上配置的两个扬声器与用户的相对位置关系,即哪个扬声器离用户的左耳朵较近,哪个扬声器离用户的右耳朵较近。Therefore, in order to achieve better stereo music playing effect, optionally, the current matching relationship between the first speaker and the second speaker and the left channel and the right channel may be determined according to the current posture of the terminal. The terminal posture may refer to a relative positional relationship between two speakers configured on the terminal and the user, that is, which speaker is closer to the left ear of the user, and which speaker is closer to the right ear of the user.
在S120中,根据所述当前匹配关系,调整脉冲编码调制PCM的当前帧中的左声道数据和右声道数据的位置。In S120, the position of the left channel data and the right channel data in the current frame of the pulse code modulation PCM is adjusted according to the current matching relationship.
其中,所述PCM数据帧是以一定的数据格式存在的,所述数据格式会标识PCM数据中哪些数据位上存储的是左声道数据,哪些数据位上存储的是右声道数据。当第一扬声器和第二扬声器与左声道和右声道的当前匹配关系与初始化时默认的匹配关系不同时,则通过硬件抽象层调整PCM的当前帧中的左声道数据和右声道数据的位置。例如,初始化时默认的匹配关系为左声道数据由第一扬声器播放,右声道数据由第二扬声器播放,当第一扬声器和第二扬声器与左声道和右声道的当前匹配关系为第一扬声器距离右声道较近,第二扬声器距离左声道较近时,则通过硬件抽象层调整PCM的当前帧中的左声道数据和右声道数据的位置。Wherein, the PCM data frame exists in a certain data format, and the data format identifies which data bits in the PCM data store left channel data, and which data bits store right channel data. When the current matching relationship between the first speaker and the second speaker and the left channel and the right channel is different from the default matching relationship at the initialization, the left channel data and the right channel in the current frame of the PCM are adjusted through the hardware abstraction layer. The location of the data. For example, the default matching relationship at initialization is that the left channel data is played by the first speaker, and the right channel data is played by the second speaker, when the current matching relationship between the first speaker and the second speaker and the left channel and the right channel is When the first speaker is closer to the right channel and the second speaker is closer to the left channel, the position of the left channel data and the right channel data in the current frame of the PCM is adjusted through the hardware abstraction layer.
可选的,上述步骤可以是如果所述PCM的当前帧中左声道数据和右声道数据的位置与所述当前匹配关系不同时,通过硬件抽象层提取所述当前帧中左声道数据和右声道数据进行缓存,并交换所述左声道数据和右声道数据在当前帧中的位置,形成新的数据帧,并代替所述当前帧。Optionally, the foregoing step may be: if the location of the left channel data and the right channel data in the current frame of the PCM is different from the current matching relationship, extracting the left channel data in the current frame by using a hardware abstraction layer The right channel data is buffered, and the positions of the left channel data and the right channel data in the current frame are exchanged to form a new data frame and replace the current frame.
因为很多第三方算法都是在音频框架层加载运行的,例如所述第三方算法可以是控制特定扬声器播放与之匹配的声道数据的控制算法以及对特定声道数据进行特定音频补偿的补偿算法,经过算法处理后的音频数据才会通过扬声器硬件层被读取并由相应的扬声器进行播放。然而在通过第三方算法对 音频数据进行处理之前系统并不知道每个扬声器与每个声道的当前匹配关系,因此,如果在扬声器硬件层进行左右声道数据的互换,会严重影响与左右扬声器腔体强相关的第三方算法对音频数据的补偿效果,例如针对一个扬声器腔体建模优化补偿音效算法。因此,可以在加载第三算法之前,根据所述当前匹配关系,通过硬件抽象层调整脉冲编码调制PCM的当前帧中的左声道数据和右声道数据的位置。Because many third-party algorithms are loaded and run in the audio framework layer, for example, the third-party algorithm may be a control algorithm that controls the matching of the channel data of a specific speaker and a compensation algorithm for specific audio compensation of specific channel data. The audio data processed by the algorithm will be read through the speaker hardware layer and played by the corresponding speakers. However in the third-party algorithm Before the audio data is processed, the system does not know the current matching relationship between each speaker and each channel. Therefore, if the left and right channel data are exchanged in the speaker hardware layer, the number of the left and right speaker cavities will be seriously affected. The compensation effect of the three-party algorithm on the audio data, for example, optimizing the compensation sound effect algorithm for a speaker cavity modeling. Therefore, the position of the left channel data and the right channel data in the current frame of the pulse code modulation PCM can be adjusted by the hardware abstraction layer according to the current matching relationship before the third algorithm is loaded.
可选的,根据所述当前匹配关系,调整PCM的当前帧中的左声道数据和右声道数据的位置之前,所述方法还可以包括:Optionally, before the location of the left channel data and the right channel data in the current frame of the PCM is adjusted according to the current matching relationship, the method may further include:
对音频数据基于至少一项算法进行处理,以获取所述PCM数据;Processing audio data based on at least one algorithm to obtain the PCM data;
可选地,所述算法可以是杜比音效算法或者音频保真Dirac算法。Optionally, the algorithm may be a Dolby sound algorithm or an audio fidelity Dirac algorithm.
当使用杜比音效算法时,可以利用杜比解码器获得PCM数据;当使用Dirac算法时,可以利用Nuplayer或者AwesomePlayer解码后得到PCM数据。When using the Dolby sound algorithm, the Dolby decoder can be used to obtain PCM data; when using the Dirac algorithm, the PCM data can be obtained by decoding with Nuplayer or AwesomePlayer.
可选的,在上述技术方案的基础上,在根据所述当前匹配关系,调整PCM的当前帧中的左声道数据和右声道数据的位置之后,所述方法还可以包括:Optionally, after the location of the left channel data and the right channel data in the current frame of the PCM is adjusted according to the current matching relationship, the method may further include:
对所述PCM数据基于如下至少一项算法进行处理:杜比音效算法、音频保真Dirac算法。以提高立体声音乐的播放效果或者实现同时播放除了音乐声音以外的其他声音。The PCM data is processed based on at least one of the following algorithms: a Dolby sound algorithm, an audio fidelity Dirac algorithm. To enhance the playback of stereo music or to simultaneously play other sounds than the music sound.
在S130中,将当前帧发送至扬声器硬件层,以供扬声器硬件层读取当前帧中的音频数据,并输出至所述第一扬声器和第二扬声器进行播放。In S130, the current frame is sent to the speaker hardware layer for the speaker hardware layer to read the audio data in the current frame and output to the first speaker and the second speaker for playback.
其中,当前帧由左声道数据和右声道数据组成,可以通过加载第三方算法控制左声道数据由第一扬声器播放,右声道数据由第二扬声器播放,或者左声道数据由第二扬声器播放,右声道数据由第一扬声器播放。Wherein, the current frame is composed of left channel data and right channel data, and the left channel data can be controlled by the first speaker by loading a third party algorithm, the right channel data is played by the second speaker, or the left channel data is Two speakers are played, and the right channel data is played by the first speaker.
本实施例提供的一种声道数据匹配方法,通过根据终端姿态,确定第一扬声器和第二扬声器与左声道和右声道的当前匹配关系,并根据所述当前匹配关系,调整脉冲编码调制PCM的当前帧中的左声道数据和右声道数据的位置,然后将当前帧发送至扬声器硬件层,以供扬声器硬件层读取当前帧中的音频数据,并输出至所述第一扬声器和第二扬声器进行播放,实现了提高立体声音乐的播放效果。A channel data matching method provided by this embodiment determines the current matching relationship between the first speaker and the second speaker and the left channel and the right channel according to the terminal posture, and adjusts the pulse coding according to the current matching relationship. Modulating the position of the left channel data and the right channel data in the current frame of the PCM, and then transmitting the current frame to the speaker hardware layer for the speaker hardware layer to read the audio data in the current frame and outputting to the first The speaker and the second speaker are played to enhance the playback of stereo music.
实施例二Embodiment 2
图2为本申请实施例二提供的一种声道数据匹配方法的流程图,本实施 例以上述实施例为基础,将“根据终端姿态,确定第一扬声器和第二扬声器与左声道和右声道的当前匹配关系”的操作可选为“获取终端内的加速度传感器数据或者旋转传感器数据;根据所述加速度传感器数据或者旋转传感器数据确定第一扬声器和第二扬声器与用户的相对位置关系;根据所述第一扬声器和第二扬声器与用户的相对位置关系确定第一扬声器和第二扬声器与左声道和右声道的当前匹配关系”;这样设置可以准确地确定第一扬声器和第二扬声器与左声道和右声道的当前匹配关系。如图2所示,所述方法包括:2 is a flowchart of a channel data matching method according to Embodiment 2 of the present application, and this implementation For example, based on the above embodiment, the operation of "determining the current matching relationship between the first speaker and the second speaker and the left channel and the right channel according to the terminal posture" may be selected as "acquiring acceleration sensor data or rotation in the terminal". Sensor data; determining a relative positional relationship between the first speaker and the second speaker and the user according to the acceleration sensor data or the rotation sensor data; determining the first speaker and the first speaker according to the relative positional relationship between the first speaker and the second speaker and the user The current matching relationship between the two speakers and the left and right channels"; such a setting can accurately determine the current matching relationship between the first speaker and the second speaker and the left and right channels. As shown in FIG. 2, the method includes:
在S210中,获取终端内的加速度传感器数据或者旋转传感器数据。In S210, acceleration sensor data or rotation sensor data in the terminal is acquired.
在S220中,根据所述加速度传感器数据或者旋转传感器数据确定第一扬声器和第二扬声器与用户的相对位置关系。In S220, a relative positional relationship between the first speaker and the second speaker and the user is determined according to the acceleration sensor data or the rotation sensor data.
其中,所述传感器数据可以是第一扬声器与第二扬声器的三维空间坐标值,根据所述三维空间坐标值可以得到每个扬声器与用户之间的距离。The sensor data may be a three-dimensional spatial coordinate value of the first speaker and the second speaker, and the distance between each speaker and the user may be obtained according to the three-dimensional spatial coordinate value.
在S230中,根据所述第一扬声器和第二扬声器与用户的相对位置关系确定第一扬声器和第二扬声器与左声道和右声道的当前匹配关系。In S230, a current matching relationship between the first speaker and the second speaker and the left channel and the right channel is determined according to a relative positional relationship between the first speaker and the second speaker and the user.
示例性地,上述步骤可以为:当所述第一扬声器与用户的左耳朵之间的距离相对与用户的右耳朵之间的距离较近时,确定所述第一扬声器与左声道匹配,第二扬声器与右声道匹配;Illustratively, the above step may be: when the distance between the first speaker and the left ear of the user is relatively close to the distance between the right ear of the user, determining that the first speaker matches the left channel, The second speaker is matched to the right channel;
或者,or,
当所述第一扬声器与用户的右耳朵之间的距离相对与用户的左耳朵之间的距离较近时,确定所述第一扬声器与右声道匹配,第二扬声器与左声道匹配。When the distance between the first speaker and the user's right ear is relatively close to the distance between the user's left ear, it is determined that the first speaker matches the right channel and the second speaker matches the left channel.
在S240中,根据所述当前匹配关系,调整脉冲编码调制PCM的当前帧中的左声道数据和右声道数据的位置。In S240, the position of the left channel data and the right channel data in the current frame of the pulse code modulation PCM is adjusted according to the current matching relationship.
在S250中,将当前帧发送至扬声器硬件层,以供扬声器硬件层读取当前帧中的音频数据,并输出至所述第一扬声器和第二扬声器进行播放。In S250, the current frame is sent to the speaker hardware layer for the speaker hardware layer to read the audio data in the current frame and output to the first speaker and the second speaker for playback.
本实施例提供的一种声道数据匹配方法,通过获取终端内的加速度传感器数据或者旋转传感器数据,并根据所述加速度传感器数据或者旋转传感器数据确定第一扬声器和第二扬声器与用户的相对位置关系,然后根据所述第一扬声器和第二扬声器与用户的相对位置关系确定第一扬声器和第二扬声器与左声道和右声道的当前匹配关系,实现了准确地确定第一扬声器和第二扬声器与左声道和右声道的当前匹配关系。 A channel data matching method provided by the embodiment obtains the acceleration sensor data or the rotation sensor data in the terminal, and determines the relative positions of the first speaker and the second speaker and the user according to the acceleration sensor data or the rotation sensor data. Relationship, and then determining a current matching relationship between the first speaker and the second speaker and the left channel and the right channel according to the relative positional relationship between the first speaker and the second speaker and the user, thereby accurately determining the first speaker and the first speaker The current matching relationship between the two speakers and the left and right channels.
实施例三Embodiment 3
图3所示为本申请实施例三提供的一种声道数据匹配装置的结构示意图,该装置可采用软件或硬件的方式实现,该装置可集成于终端中,所述终端可以是手机,如图3所示,该装置的结构包括:确定模块410、调整模块420和播放模块430,其中:FIG. 3 is a schematic structural diagram of a channel data matching apparatus according to Embodiment 3 of the present application. The apparatus may be implemented by using software or hardware. The apparatus may be integrated in a terminal, and the terminal may be a mobile phone, such as As shown in FIG. 3, the structure of the apparatus includes: a determining module 410, an adjusting module 420, and a playing module 430, wherein:
确定模块410,设置为根据终端姿态,确定第一扬声器和第二扬声器与左声道和右声道的当前匹配关系;The determining module 410 is configured to determine a current matching relationship between the first speaker and the second speaker and the left channel and the right channel according to the terminal posture;
调整模块420,设置为根据所述当前匹配关系,调整脉冲编码调制PCM的当前帧中的左声道数据和右声道数据的位置;The adjusting module 420 is configured to adjust, according to the current matching relationship, a position of the left channel data and the right channel data in the current frame of the pulse code modulation PCM;
播放模块430,设置为将当前帧发送至扬声器硬件层,以供扬声器硬件层读取当前帧中的音频数据,并输出至所述第一扬声器和第二扬声器进行播放。The playing module 430 is configured to send the current frame to the speaker hardware layer for the speaker hardware layer to read the audio data in the current frame and output to the first speaker and the second speaker for playing.
可选的,确定模块410可以包括:Optionally, the determining module 410 can include:
获取单元,设置为获取终端内的加速度传感器数据或者旋转传感器数据;The acquiring unit is configured to acquire acceleration sensor data or rotate sensor data in the terminal;
第一确定单元,设置为根据所述加速度传感器数据或者旋转传感器数据确定第一扬声器和第二扬声器与用户的相对位置关系;a first determining unit, configured to determine a relative positional relationship between the first speaker and the second speaker and the user according to the acceleration sensor data or the rotation sensor data;
第二确定单元,设置为根据所述第一扬声器和第二扬声器与用户的相对位置关系确定第一扬声器和第二扬声器与左声道和右声道的当前匹配关系。The second determining unit is configured to determine a current matching relationship between the first speaker and the second speaker and the left channel and the right channel according to the relative positional relationship between the first speaker and the second speaker and the user.
示例性地,所述第二确定单元设置为:当所述第一扬声器与用户的左耳朵之间的距离相对与用户的右耳朵之间的距离较近时,确定所述第一扬声器与左声道匹配,第二扬声器与右声道匹配;Illustratively, the second determining unit is configured to determine the first speaker and the left when a distance between the first speaker and a left ear of the user is relatively close to a distance between a right ear of the user Channel matching, the second speaker matches the right channel;
或者,or,
当所述第一扬声器与用户的右耳朵之间的距离相对与用户的左耳朵之间的距离较近时,确定所述第一扬声器与右声道匹配,第二扬声器与左声道匹配。When the distance between the first speaker and the user's right ear is relatively close to the distance between the user's left ear, it is determined that the first speaker matches the right channel and the second speaker matches the left channel.
在上述技术方案的基础上,示例性地,所述装置还可以包括:Based on the foregoing technical solutions, the device may further include:
第一处理模块,设置为在根据所述当前匹配关系,调整PCM的当前帧中的左声道数据和右声道数据的位置之前,对音频数据基于如下至少一项算法进行处理,以获取所述PCM数据:杜比音效算法或者音频保真Dirac算法。a first processing module, configured to process the audio data based on at least one of the following algorithms to adjust the position of the left channel data and the right channel data in the current frame of the PCM according to the current matching relationship PCM data: Dolby sound algorithm or audio fidelity Dirac algorithm.
示例性地,调整模块420设置为: Illustratively, the adjustment module 420 is configured to:
如果所述PCM的当前帧中左声道数据和右声道数据的位置与所述当前匹配关系不同时,提取所述当前帧中左声道数据和右声道数据进行缓存,并交换所述左声道数据和右声道数据在当前帧中的位置,形成新的数据帧,并代替所述当前帧。If the positions of the left channel data and the right channel data in the current frame of the PCM are different from the current matching relationship, extracting left channel data and right channel data in the current frame for buffering, and exchanging the The position of the left channel data and the right channel data in the current frame forms a new data frame and replaces the current frame.
示例性地,所述装置还可以包括:Illustratively, the device may further include:
第二处理模块,设置为在根据所述当前匹配关系,调整PCM的当前帧中的左声道数据和右声道数据的位置之后,对所述PCM数据基于如下至少一项算法进行处理:杜比音效算法、音频保真Dirac算法或者混音算法。a second processing module, configured to process the PCM data based on at least one of the following algorithms after adjusting the positions of the left channel data and the right channel data in the current frame of the PCM according to the current matching relationship: Specific sound algorithm, audio fidelity Dirac algorithm or mixing algorithm.
本实施例提供的一种声道数据匹配装置,通过根据终端姿态,确定第一扬声器和第二扬声器与左声道和右声道的当前匹配关系,并根据所述当前匹配关系,调整脉冲编码调制PCM的当前帧中的左声道数据和右声道数据的位置,然后将当前帧发送至扬声器硬件层,以供扬声器硬件层读取当前帧中的音频数据,并输出至所述第一扬声器和第二扬声器进行播放,实现了提高立体声音乐的播放效果。The vocal tract data matching apparatus provided in this embodiment determines the current matching relationship between the first speaker and the second speaker and the left channel and the right channel according to the terminal posture, and adjusts the pulse coding according to the current matching relationship. Modulating the position of the left channel data and the right channel data in the current frame of the PCM, and then transmitting the current frame to the speaker hardware layer for the speaker hardware layer to read the audio data in the current frame and outputting to the first The speaker and the second speaker are played to enhance the playback of stereo music.
本实施例所述的声道数据匹配装置可用于执行上述实施例所述的声道数据匹配方法,具备相应的功能模块,实现相同的有益效果。未在本实施例中详尽描述的技术细节,可参见本申请任意实施例所提供的方法。The vocal tract data matching device described in this embodiment can be used to perform the vocal data matching method described in the foregoing embodiments, and has corresponding functional modules to achieve the same beneficial effects. For technical details that are not described in detail in this embodiment, reference may be made to the methods provided in any embodiment of the present application.
实施例四Embodiment 4
本申请实施例四提供了一种非暂态计算机存储介质,所述计算机存储介质存储有计算机可执行指令,该计算机可执行指令可执行上述任意方法实施例中的声道数据匹配方法。实施例五The fourth embodiment of the present application provides a non-transitory computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions can perform the channel data matching method in any of the foregoing method embodiments. Embodiment 5
图4是本申请实施例五提供的执行声道数据匹配方法的电子设备的硬件结构示意图,如图4所示,该设备包括:4 is a schematic diagram showing the hardware structure of an electronic device for performing a channel data matching method according to Embodiment 5 of the present application. As shown in FIG. 4, the device includes:
一个或多个处理器410以及存储器420,图4中以一个处理器410为例。One or more processors 410 and memory 420, one processor 410 is exemplified in FIG.
执行声道数据匹配方法的设备还可以包括:输入装置430和输出装置440。The apparatus for performing the channel data matching method may further include: an input device 430 and an output device 440.
处理器410、存储器420、输入装置430和输出装置440可以通过总线或者其他方式连接,图4中以通过总线连接为例。The processor 410, the memory 420, the input device 430, and the output device 440 may be connected by a bus or other means, as exemplified by a bus connection in FIG.
存储器420作为一种非暂态计算机可读存储介质,可用于存储非暂态软件程序、非暂态计算机可执行程序以及模块,如本申请实施例中的执行声道数据匹配方法对应的程序指令/模块(例如,附图3所示的确定模块410、调 整模块420和播放模块430)。处理器410通过运行存储在存储器420中的非暂态软件程序、指令以及模块,从而执行服务器的多种功能应用以及数据处理,即实现声道数据匹配方法。The memory 420 is used as a non-transitory computer readable storage medium, and can be used for storing non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions corresponding to the method for performing channel data matching in the embodiment of the present application. /module (for example, the determination module 410 shown in Figure 3, tuning The entire module 420 and the play module 430). The processor 410 performs various function applications and data processing of the server by running non-transitory software programs, instructions, and modules stored in the memory 420, that is, implementing a channel data matching method.
存储器420可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据应用程序交互的终端的使用所创建的数据等。此外,存储器420可以包括高速随机存取存储器,还可以包括非暂态存储器,例如至少一个磁盘存储器件、闪存器件、或其他非暂态固态存储器件。在一些实施例中,存储器420可选包括相对于处理器410远程设置的存储器,这些远程存储器可以通过网络连接至应用程序交互的终端。The memory 420 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function; the storage data area may store data created according to use of the terminal in which the application interacts, and the like. Moreover, memory 420 can include high speed random access memory, and can also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 420 can optionally include memory remotely located relative to processor 410, which can be connected to the terminal of application interaction via a network.
上述网络的实例可以为互联网、企业内部网、局域网、移动通信网及其组合。Examples of the above network may be the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
输入装置430可接收输入的数字或字符信息,以及产生与应用程序交互的终端的用户设置以及功能控制有关的键信号输入。输出装置440可包括显示屏等显示设备。 Input device 430 can receive input numeric or character information, as well as key signal inputs related to user settings and function control of the terminal that interacts with the application. Output device 440 can include a display device such as a display screen.
所述一个或者多个模块存储在所述存储器420中,当被所述一个或者多个处理器410执行时,执行上述任意方法实施例中的执行声道数据匹配方法。The one or more modules are stored in the memory 420, and when executed by the one or more processors 410, perform an execution channel data matching method in any of the above method embodiments.
上述产品可执行本申请任意实施例所提供的方法,具备执行方法相应的功能模块和有益效果。未在本实施例中详尽描述的技术细节,可参见本申请任意实施例所提供的方法。The above product can perform the method provided by any embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in this embodiment, reference may be made to the methods provided in any embodiment of the present application.
通过以上关于实施方式的描述,所属领域的技术人员可以清楚地了解到,本申请可借助软件及必需的通用硬件来实现,当然也可以通过硬件实现,但很多情况下前者是可选的实施方式。基于这样的理解,本申请可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如计算机的软盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、闪存(FLASH)、硬盘或光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请每个实施例所述的方法。Through the above description of the embodiments, those skilled in the art can clearly understand that the present application can be implemented by software and necessary general hardware, and can also be implemented by hardware, but in many cases, the former is an optional implementation. . Based on such understanding, the present application can be embodied in the form of a software product that can be stored in a computer readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access. Memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform each embodiment of the present application. The method described.
本领域技术人员可以理解实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor) 执行本申请每个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等多种可以存储程序代码的介质。Those skilled in the art can understand that all or part of the steps of implementing the above embodiments may be completed by a program instructing related hardware, and the program is stored in a storage medium, and includes a plurality of instructions for making a device (which may be a single chip microcomputer). , chip, etc.) or processor All or part of the steps of the method described in each embodiment of the present application are performed. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store a program code. .
注意,上述仅为本申请的可选实施例及所运用技术原理。本领域技术人员会理解,本申请可选的为以上所述实施例,对本领域技术人员来说能够进行多种变化、重新调整和替代而不会脱离本申请的保护范围。Note that the above are only optional embodiments of the present application and the technical principles applied thereto. Those skilled in the art will appreciate that the present application is susceptible to the above-described embodiments, and that various changes, modifications, and substitutions can be made by those skilled in the art without departing from the scope of the invention.
工业实用性Industrial applicability
本申请实施例提供了一种声道数据匹配方法和装置,实现了提高立体声音乐的播放效果,并实现了兼容第三方音频算法。 The embodiment of the present application provides a channel data matching method and device, which improves the playback effect of stereo music and implements a third-party compatible audio algorithm.

Claims (15)

  1. 一种声道数据匹配方法,应用于智能终端,包括:A channel data matching method is applied to a smart terminal, including:
    根据所述终端的姿态,确定第一扬声器和第二扬声器与左声道和右声道的当前匹配关系;Determining a current matching relationship between the first speaker and the second speaker and the left channel and the right channel according to the posture of the terminal;
    根据所述当前匹配关系,调整脉冲编码调制PCM的当前帧中的左声道数据和右声道数据的位置;以及,Adjusting the position of the left channel data and the right channel data in the current frame of the pulse code modulation PCM according to the current matching relationship;
    将当前帧发送至扬声器硬件层,以供扬声器硬件层读取当前帧中的音频数据,并输出至所述第一扬声器和第二扬声器进行播放。The current frame is sent to the speaker hardware layer for the speaker hardware layer to read the audio data in the current frame and output to the first speaker and the second speaker for playback.
  2. 根据权利要求1所述的方法,其中,所述根据所述终端的姿态,确定第一扬声器和第二扬声器与左声道和右声道的当前匹配关系,包括:The method according to claim 1, wherein said determining a current matching relationship between the first speaker and the second speaker and the left channel and the right channel according to the posture of the terminal comprises:
    获取终端内的加速度传感器数据或者旋转传感器数据;Acquiring acceleration sensor data or rotating sensor data in the terminal;
    根据所述加速度传感器数据或者旋转传感器数据确定第一扬声器和第二扬声器与用户的相对位置关系;以及,Determining, according to the acceleration sensor data or the rotation sensor data, a relative positional relationship between the first speaker and the second speaker and the user; and
    根据所述第一扬声器和第二扬声器与用户的相对位置关系确定第一扬声器和第二扬声器与左声道和右声道的当前匹配关系。A current matching relationship between the first speaker and the second speaker and the left channel and the right channel is determined according to a relative positional relationship between the first speaker and the second speaker and the user.
  3. 根据权利要求2所述的方法,其中,根据所述第一扬声器和第二扬声器与用户的相对位置关系确定第一扬声器和第二扬声器与左声道和右声道的当前匹配关系,包括:The method according to claim 2, wherein determining a current matching relationship between the first speaker and the second speaker and the left channel and the right channel according to the relative positional relationship between the first speaker and the second speaker and the user comprises:
    当所述第一扬声器与用户的左耳朵之间的距离相对与用户的右耳朵之间的距离较近时,确定所述第一扬声器与左声道匹配,第二扬声器与右声道匹配;Determining that the first speaker matches the left channel and the second speaker matches the right channel when a distance between the first speaker and a left ear of the user is relatively close to a distance between the right ear of the user;
    或者,or,
    当所述第一扬声器与用户的右耳朵之间的距离相对与用户的左耳朵之间的距离较近时,确定所述第一扬声器与右声道匹配,第二扬声器与左声道匹配。When the distance between the first speaker and the user's right ear is relatively close to the distance between the user's left ear, it is determined that the first speaker matches the right channel and the second speaker matches the left channel.
  4. 根据权利要求1所述的方法,其中,根据所述当前匹配关系,调整PCM的当前帧中的左声道数据和右声道数据的位置,包括:The method of claim 1, wherein adjusting the positions of the left channel data and the right channel data in the current frame of the PCM according to the current matching relationship comprises:
    如果所述PCM的当前帧中左声道数据和右声道数据的位置与所述当前匹配关系不同时,提取所述当前帧中左声道数据和右声道数据进行缓存,并交换所述左声道数据和右声道数据在当前帧中的位置,形成新的数据帧,并代替所述当前帧。If the positions of the left channel data and the right channel data in the current frame of the PCM are different from the current matching relationship, extracting left channel data and right channel data in the current frame for buffering, and exchanging the The position of the left channel data and the right channel data in the current frame forms a new data frame and replaces the current frame.
  5. 根据权利要求1所述的方法,在根据所述当前匹配关系,调整PCM的当前帧中的左声道数据和右声道数据的位置之前,还包括:The method of claim 1, before adjusting the positions of the left channel data and the right channel data in the current frame of the PCM according to the current matching relationship, further comprising:
    对压缩音频数据流基于如下至少一项算法进行解码处理,以获取所述PCM 数据:杜比解码算法或者音频保真Dirac解码算法。Decoding the compressed audio data stream based on at least one of the following algorithms to obtain the PCM Data: Dolby decoding algorithm or audio fidelity Dirac decoding algorithm.
  6. 根据权利要求1所述的方法,在根据所述当前匹配关系,调整PCM的当前帧中的左声道数据和右声道数据的位置之后,还包括:The method of claim 1, after adjusting the positions of the left channel data and the right channel data in the current frame of the PCM according to the current matching relationship, the method further includes:
    对所述PCM数据基于如下至少一项算法进行处理:杜比音效算法或者音频保真Dirac算法。The PCM data is processed based on at least one of the following algorithms: a Dolby sound algorithm or an audio fidelity Dirac algorithm.
  7. 一种声道数据匹配装置,包括:A channel data matching device includes:
    确定模块,设置为根据终端的姿态,确定第一扬声器和第二扬声器与左声道和右声道的当前匹配关系;Determining a module, configured to determine a current matching relationship between the first speaker and the second speaker and the left channel and the right channel according to the posture of the terminal;
    调整模块,设置为根据所述当前匹配关系,调整脉冲编码调制PCM的当前帧中的左声道数据和右声道数据的位置;以及,Adjusting a module, configured to adjust a position of the left channel data and the right channel data in the current frame of the pulse code modulation PCM according to the current matching relationship; and
    播放模块,设置为将当前帧发送至扬声器硬件层,以供扬声器硬件层读取当前帧中的音频数据,并输出至所述第一扬声器和第二扬声器进行播放。The playing module is configured to send the current frame to the speaker hardware layer, so that the speaker hardware layer reads the audio data in the current frame, and outputs to the first speaker and the second speaker for playing.
  8. 根据权利要求7所述的装置,其中,所述确定模块包括:The apparatus of claim 7, wherein the determining module comprises:
    获取单元,设置为获取终端内的加速度传感器数据或者旋转传感器数据;The acquiring unit is configured to acquire acceleration sensor data or rotate sensor data in the terminal;
    第一确定单元,设置为根据所述加速度传感器数据或者旋转传感器数据确定第一扬声器和第二扬声器与用户的相对位置关系;以及,a first determining unit configured to determine a relative positional relationship between the first speaker and the second speaker and the user according to the acceleration sensor data or the rotation sensor data; and
    第二确定单元,设置为根据所述第一扬声器和第二扬声器与用户的相对位置关系确定第一扬声器和第二扬声器与左声道和右声道的当前匹配关系。The second determining unit is configured to determine a current matching relationship between the first speaker and the second speaker and the left channel and the right channel according to the relative positional relationship between the first speaker and the second speaker and the user.
  9. 根据权利要求8所述的装置,其中,所述第二确定单元设置为:The apparatus according to claim 8, wherein said second determining unit is configured to:
    当所述第一扬声器与用户的左耳朵之间的距离相对与用户的右耳朵之间的距离较近时,确定所述第一扬声器与左声道匹配,第二扬声器与右声道匹配;Determining that the first speaker matches the left channel and the second speaker matches the right channel when a distance between the first speaker and a left ear of the user is relatively close to a distance between the right ear of the user;
    或者,or,
    当所述第一扬声器与用户的右耳朵之间的距离相对与用户的左耳朵之间的距离较近时,确定所述第一扬声器与右声道匹配,第二扬声器与左声道匹配。When the distance between the first speaker and the user's right ear is relatively close to the distance between the user's left ear, it is determined that the first speaker matches the right channel and the second speaker matches the left channel.
  10. 根据权利要求7所述的装置,其中,所述调整模块设置为:The apparatus of claim 7 wherein said adjustment module is configured to:
    如果所述PCM的当前帧中左声道数据和右声道数据的位置与所述当前匹配关系不同时,提取所述当前帧中左声道数据和右声道数据进行缓存,并交换所述左声道数据和右声道数据在当前帧中的位置,形成新的数据帧,并代替所述当前帧。If the positions of the left channel data and the right channel data in the current frame of the PCM are different from the current matching relationship, extracting left channel data and right channel data in the current frame for buffering, and exchanging the The position of the left channel data and the right channel data in the current frame forms a new data frame and replaces the current frame.
  11. 根据权利要求7所述的装置,还包括第一处理模块,设置为在根据所述当前匹配关系,调整PCM的当前帧中的左声道数据和右声道数据的位置之前, 对压缩音频数据流基于如下至少一项算法进行处理,以获取所述PCM数据:杜比解码算法或者音频保真Dirac解码算法。The apparatus of claim 7, further comprising a first processing module configured to adjust a position of the left channel data and the right channel data in the current frame of the PCM according to the current matching relationship, The compressed audio data stream is processed based on at least one of the following algorithms to obtain the PCM data: a Dolby decoding algorithm or an audio fidelity Dirac decoding algorithm.
  12. 根据权利要求7所述的装置,还包括:The apparatus of claim 7 further comprising:
    第二处理模块,设置为在根据所述当前匹配关系,调整PCM的当前帧中的左声道数据和右声道数据的位置之后,对所述PCM数据基于如下至少一项算法进行处理:杜比音效算法、音频保真Dirac算法或者混音算法。a second processing module, configured to process the PCM data based on at least one of the following algorithms after adjusting the positions of the left channel data and the right channel data in the current frame of the PCM according to the current matching relationship: Specific sound algorithm, audio fidelity Dirac algorithm or mixing algorithm.
  13. 一种电子设备,包括:An electronic device comprising:
    至少一个处理器;以及,At least one processor; and,
    与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein
    所述存储器存储有可被所述一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1-6任一项的声道数据匹配方法。The memory stores instructions executable by the one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the vocal tract data of any of claims 1-6 Matching method.
  14. 一种非暂态计算机可读存储介质,其中,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令用于使所述计算机执行权利要求1-6任一项的声道数据匹配方法。A non-transitory computer readable storage medium, wherein the non-transitory computer readable storage medium stores computer instructions for causing the computer to perform the vocal tract data of any of claims 1-6 Matching method.
  15. 一种计算机程序产品,其中,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行权利要求1-6任一项的声道数据匹配方法。 A computer program product, comprising: a computing program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer, The computer performs the vocal data matching method of any of claims 1-6.
PCT/CN2016/101136 2016-06-23 2016-09-30 Channel data matching method and device WO2017219538A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610464113.6 2016-06-23
CN201610464113.6A CN105898666A (en) 2016-06-23 2016-06-23 Channel data matching method and channel data matching device

Publications (1)

Publication Number Publication Date
WO2017219538A1 true WO2017219538A1 (en) 2017-12-28

Family

ID=56718987

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/101136 WO2017219538A1 (en) 2016-06-23 2016-09-30 Channel data matching method and device

Country Status (2)

Country Link
CN (1) CN105898666A (en)
WO (1) WO2017219538A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110827843A (en) * 2018-08-14 2020-02-21 Oppo广东移动通信有限公司 Audio processing method and device, storage medium and electronic equipment
CN112162460A (en) * 2020-09-27 2021-01-01 深圳市火乐科技发展有限公司 Audio playing method and related device
WO2021103259A1 (en) * 2019-11-28 2021-06-03 歌尔股份有限公司 Speaker sound channel selection method and device and speaker

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105898666A (en) * 2016-06-23 2016-08-24 乐视控股(北京)有限公司 Channel data matching method and channel data matching device
CN106657617B (en) * 2016-11-30 2020-06-16 重庆亿优科技有限公司 Method for controlling loudspeaker to play and mobile terminal
CN106713645B (en) * 2016-12-28 2019-11-15 努比亚技术有限公司 A kind of method and mobile terminal of the broadcasting of control loudspeaker
CN107547987B (en) * 2017-08-09 2019-07-26 维沃移动通信有限公司 A kind of effect adjusting method and mobile terminal
CN109862475A (en) * 2019-01-28 2019-06-07 Oppo广东移动通信有限公司 Audio-frequence player device and method, storage medium, communication terminal
CN113411702A (en) * 2020-03-16 2021-09-17 维沃移动通信有限公司 Sound channel configuration method and electronic equipment
CN111530069A (en) * 2020-04-22 2020-08-14 歌尔科技有限公司 Game paddle control method and device and hand game system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102595304A (en) * 2012-03-15 2012-07-18 国光电器股份有限公司 Sound channel automatic switching device
CN103295610A (en) * 2013-05-22 2013-09-11 华为技术有限公司 Audio playing method and audio playing device
CN103974167A (en) * 2013-02-06 2014-08-06 辉达公司 Flat-panel electronic device and audio player thereof
US20160014539A1 (en) * 2014-07-09 2016-01-14 Acer Incorporated Earphone and sound channel control method thereof
CN105898666A (en) * 2016-06-23 2016-08-24 乐视控股(北京)有限公司 Channel data matching method and channel data matching device

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101533293A (en) * 2008-03-13 2009-09-16 大众电脑股份有限公司 Audio and video outputting device and electronic device having same
JP2012108587A (en) * 2010-11-15 2012-06-07 Panasonic Corp Voice communication device and voice communication method
CN102186049B (en) * 2011-04-22 2013-03-20 华为终端有限公司 Conference terminal audio signal processing method, conference terminal and video conference system
KR20130016906A (en) * 2011-08-09 2013-02-19 삼성전자주식회사 Electronic apparatus, method for providing of stereo sound
CN202711124U (en) * 2012-06-26 2013-01-30 亚忆电子(深圳)有限公司 Dual-track tablet PC with high acoustic quality
CN102752687A (en) * 2012-06-28 2012-10-24 华为终端有限公司 Sound effect adjusting method for terminal device and terminal device
CN103533497A (en) * 2013-10-09 2014-01-22 上海斐讯数据通信技术有限公司 Sound channel switching device and sound channel switching method of stereo playing system
CN104104346B (en) * 2014-07-14 2019-06-28 努比亚技术有限公司 A kind of method and apparatus improving mobile terminal playing audio
CN104967953B (en) * 2015-06-23 2018-10-09 Tcl集团股份有限公司 A kind of multichannel playback method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102595304A (en) * 2012-03-15 2012-07-18 国光电器股份有限公司 Sound channel automatic switching device
CN103974167A (en) * 2013-02-06 2014-08-06 辉达公司 Flat-panel electronic device and audio player thereof
CN103295610A (en) * 2013-05-22 2013-09-11 华为技术有限公司 Audio playing method and audio playing device
US20160014539A1 (en) * 2014-07-09 2016-01-14 Acer Incorporated Earphone and sound channel control method thereof
CN105898666A (en) * 2016-06-23 2016-08-24 乐视控股(北京)有限公司 Channel data matching method and channel data matching device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110827843A (en) * 2018-08-14 2020-02-21 Oppo广东移动通信有限公司 Audio processing method and device, storage medium and electronic equipment
CN110827843B (en) * 2018-08-14 2023-06-20 Oppo广东移动通信有限公司 Audio processing method and device, storage medium and electronic equipment
WO2021103259A1 (en) * 2019-11-28 2021-06-03 歌尔股份有限公司 Speaker sound channel selection method and device and speaker
CN112162460A (en) * 2020-09-27 2021-01-01 深圳市火乐科技发展有限公司 Audio playing method and related device
CN112162460B (en) * 2020-09-27 2021-09-03 深圳市火乐科技发展有限公司 Audio playing method and related device

Also Published As

Publication number Publication date
CN105898666A (en) 2016-08-24

Similar Documents

Publication Publication Date Title
WO2017219538A1 (en) Channel data matching method and device
US10070245B2 (en) Method and apparatus for personalized audio virtualization
JP6400739B2 (en) Metadata for ducking control
US10979842B2 (en) Methods and systems for providing a composite audio stream for an extended reality world
RU2661775C2 (en) Transmission of audio rendering signal in bitstream
US20180352359A1 (en) Remote personalization of audio
CN109165005B (en) Sound effect enhancement method and device, electronic equipment and storage medium
EP3056019B1 (en) Method and system for surround sound processing in a headset
US20200213727A1 (en) Recording Method, Recording Play Method, Apparatuses, and Terminals
US20140270185A1 (en) System and methods for processing stereo audio content
CN106416301B (en) For rendering the method and apparatus of acoustic signal
EP3056020B1 (en) Headset with source detection and volume control
WO2020182020A1 (en) Audio signal playback method and display device
JP2020109968A (en) Customized audio processing based on user-specific audio information and hardware-specific audio information
CN114143700B (en) Audio processing method, device, equipment, medium and program product
CN106170037A (en) Audio play control method and device
CN110730406A (en) Method for outputting two paths of independent sound sources based on Android system
TWM526238U (en) Electronic device capable of adjusting settings of equalizer according to user's age and audio playing device thereof
CN110191745B (en) Game streaming using spatial audio
CN108650592B (en) Method for realizing neck strap type surround sound and stereo control system
US11729574B2 (en) Spatial audio augmentation and reproduction
WO2020107201A1 (en) Stereo sound playback method and device, storage medium and electronic device
WO2021243560A1 (en) Integrated auditory system and control method
WO2017215158A1 (en) Communication terminal sound processing control method, device and communication terminal
WO2023240467A1 (en) Audio playback method and apparatus, and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16906078

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16906078

Country of ref document: EP

Kind code of ref document: A1