CN113542984B - Stereo realization system, method, electronic device and storage medium - Google Patents
Stereo realization system, method, electronic device and storage medium Download PDFInfo
- Publication number
- CN113542984B CN113542984B CN202110642600.8A CN202110642600A CN113542984B CN 113542984 B CN113542984 B CN 113542984B CN 202110642600 A CN202110642600 A CN 202110642600A CN 113542984 B CN113542984 B CN 113542984B
- Authority
- CN
- China
- Prior art keywords
- audio
- broadcast signal
- stream data
- volume
- receiving device
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R5/00—Stereophonic arrangements
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L19/00—Speech 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/008—Multichannel audio signal coding or decoding using interchannel correlation to reduce redundancy, e.g. joint-stereo, intensity-coding or matrixing
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L19/00—Speech 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/02—Speech 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 using spectral analysis, e.g. transform vocoders or subband vocoders
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/06—Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/80—Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R2430/00—Signal processing covered by H04R, not provided for in its groups
- H04R2430/01—Aspects of volume control, not necessarily automatic, in sound systems
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- Acoustics & Sound (AREA)
- Multimedia (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- Health & Medical Sciences (AREA)
- Computer Networks & Wireless Communication (AREA)
- Human Computer Interaction (AREA)
- Spectroscopy & Molecular Physics (AREA)
- Mathematical Physics (AREA)
- Circuit For Audible Band Transducer (AREA)
Abstract
Description
技术领域technical field
本申请涉及音频播放技术领域,尤其涉及一种立体声实现系统、方法、电子设备及存储介质。The present application relates to the technical field of audio playback, and in particular, to a stereo implementation system, method, electronic device and storage medium.
背景技术Background technique
为了能播放出空间立体声效果,蓝牙耳机的音源文件需要包括左右耳声道数据,才能使蓝牙耳机在播放音频文件时播放出空间立体声效果。然而,业界绝大多数音源文件为单声道声音文件,在播放时无法获得空间立体声效果。此外,现有的蓝牙音频传输模型协定(Advanced Audio Distribution Profile,A2DP)在进行音量调节时,若蓝牙耳机的主耳的音量调节模式及副耳的音量调节模式不相同,手机会将蓝牙耳机的主耳及副耳的音量调节模式由绝对音量切换为普通音量,造成蓝牙耳机的音量调节不协调或出现音效突变的问题。例如,在手机先连接普通音量模式的耳机时,绝对音量模式的耳机的音量会突然变小,又例如,手机先连接绝对音量模式的耳机时,普通音量模式的耳机的音量会突然变大。In order to play the spatial stereo effect, the audio source file of the Bluetooth headset needs to include left and right ear channel data, so that the Bluetooth headset can play the spatial stereo effect when playing the audio file. However, the vast majority of sound source files in the industry are mono sound files, which cannot obtain spatial stereo effects during playback. In addition, when the existing Bluetooth audio distribution profile (Advanced Audio Distribution Profile, A2DP) performs volume adjustment, if the volume adjustment mode of the main ear of the Bluetooth headset and the volume adjustment mode of the auxiliary ear are different, the mobile phone will adjust the volume of the Bluetooth headset. The volume adjustment mode of the main ear and the auxiliary ear is switched from the absolute volume to the normal volume, which causes the inconsistency of the volume adjustment of the Bluetooth headset or the problem of sudden sound effects. For example, when the mobile phone is first connected to the earphone in the normal volume mode, the volume of the earphone in the absolute volume mode will suddenly decrease. For another example, when the mobile phone is connected to the earphone in the absolute volume mode first, the volume of the earphone in the normal volume mode will suddenly increase.
发明内容SUMMARY OF THE INVENTION
鉴于以上内容,有必要提供一种立体声实现系统、方法、电子设备及存储介质以解决单声道声音文件无法播放立体声的技术问题。In view of the above content, it is necessary to provide a stereo system, method, electronic device and storage medium to solve the technical problem that monophonic sound files cannot play stereo.
第一方面,本申请实施例提供一种立体声实现系统,所述系统包括:音频发送装置,用于:扫描并接收第一音频接收装置发送的第一广播信号,并根据所述第一广播信号携带的发射功率确定所述第一广播信号的空间损耗;获取所述第一广播信号的载波频率,根据所述第一广播信号的载波频率及空间损耗计算所述音频发送装置与所述第一音频接收装置之间的第一距离;扫描并接收第二音频接收装置发送的第二广播信号,并根据所述第二广播信号携带的发射功率确定所述第二广播信号的空间损耗;获取所述第二广播信号的载波频率,根据所述第二广播信号的载波频率及空间损耗计算所述音频发送装置与所述第二音频接收装置之间的第二距离;根据所述第一距离及所述第二距离计算出声音数字信号调节比例系数;获取脉冲编码调制(Pulse Code Modulation,PCM)音频数据,将PCM音频数据分流成第一流数据及第二流数据,并根据声音数字信号调节比例系数调节第一流数据的音量得到音量调节后的第一流数据;将所述音量调节后的第一流数据发送给第一音频接收装置,及将所述第二流数据发送给第二音频接收装置;所述第一音频接收装置,用于:向所述音频发送装置发送携带发射功率的第一广播信号;响应接收到的所述音量调节后的第一流数据,并播放所述音量调节后的第一流数据;所述第二音频接收装置,用于:向音频发送装置发送携带发射功率的第二广播信号;响应接收到的所述第二流数据,并播放所述第二流数据。本申请根据音频发送装置与音频接收装置之间的距离计算出声音数字信号调节比例系数,并根据声音数字信号调节比例系数调节第一流数据的音量,将音量调节后的第一流数据发送给第一音频接收装置,将第二流数据发送给第二音频接收装置,如此,音量调节后的第一流数据与第二流数据之间存在差异,使得第一音频接收装置在播放第一流数据及第二音频接收装置在播放第二流数据时产生空间立体声效果。In a first aspect, an embodiment of the present application provides a stereo implementation system, the system includes: an audio sending device, configured to: scan and receive a first broadcast signal sent by a first audio receiving device, and according to the first broadcast signal The transmitted power carried determines the space loss of the first broadcast signal; obtains the carrier frequency of the first broadcast signal, and calculates the relationship between the audio transmission device and the first broadcast signal according to the carrier frequency and space loss of the first broadcast signal. the first distance between the audio receiving devices; scan and receive the second broadcast signal sent by the second audio receiving device, and determine the space loss of the second broadcast signal according to the transmit power carried by the second broadcast signal; obtain the the carrier frequency of the second broadcast signal, and calculate the second distance between the audio transmitting device and the second audio receiving device according to the carrier frequency and the space loss of the second broadcast signal; according to the first distance and The second distance calculates the sound digital signal adjustment scale factor; obtains pulse code modulation (Pulse Code Modulation, PCM) audio data, divides the PCM audio data into first stream data and second stream data, and adjusts the ratio according to the sound digital signal The coefficient adjusts the volume of the first stream data to obtain the first stream data after the volume adjustment; sending the first stream data after the volume adjustment to the first audio receiving device, and sending the second stream data to the second audio receiving device; The first audio receiving device is configured to: send a first broadcast signal carrying transmission power to the audio transmitting device; respond to the received first stream data after the volume adjustment, and play the first stream data after the volume adjustment. stream data; the second audio receiving device is used for: sending a second broadcast signal carrying transmit power to the audio sending device; responding to the received second stream data, and playing the second stream data. The present application calculates the sound digital signal adjustment proportional coefficient according to the distance between the audio transmission device and the audio receiving device, adjusts the volume of the first stream data according to the sound digital signal adjustment proportional coefficient, and sends the volume-adjusted first stream data to the first stream data. The audio receiving device sends the second stream data to the second audio receiving device, so that there is a difference between the first stream data after volume adjustment and the second stream data, so that the first audio receiving device is playing the first stream data and the second stream data. The audio receiving device generates a spatial stereo effect when playing the second stream data.
在一种实现方式中,所述获取PCM音频数据,将PCM音频数据分流成第一流数据及第二流数据并根据声音数字信号调节比例系数调节第一流数据的音量得到音量调节后的第一流数据包括:响应播放音频文件的操作,获取所述音频文件中的所述PCM音频数据,并将所述音频文件中的所述PCM音频数据分流成所述第一流数据及所述第二流数据。上述技术方案,可以通过执行播放音频文件的操作,将音频文件中的PCM音频数据分流成所述第一流数据及所述第二流数据。In an implementation manner, the acquiring PCM audio data, splitting the PCM audio data into the first stream data and the second stream data, and adjusting the volume of the first stream data according to the sound digital signal adjusting the proportional coefficient to obtain the volume-adjusted first stream data The method includes: in response to an operation of playing an audio file, acquiring the PCM audio data in the audio file, and splitting the PCM audio data in the audio file into the first stream data and the second stream data. In the above technical solution, the PCM audio data in the audio file can be divided into the first stream data and the second stream data by performing the operation of playing the audio file.
在一种实现方式中,所述播放音频文件的操作包括点击音乐播放应用或视频播放应用的用户界面上的播放按键的操作。通过上述技术方案,在点击音乐播放应用或视频播放应用的用户界面上的播放按键的操作时,将音频文件中的PCM音频数据分流成所述第一流数据及所述第二流数据。In an implementation manner, the operation of playing the audio file includes an operation of clicking a play button on the user interface of the music playing application or the video playing application. Through the above technical solution, when the play button on the user interface of the music playing application or the video playing application is clicked, the PCM audio data in the audio file is divided into the first stream data and the second stream data.
在一种实现方式中,所述将PCM音频数据分流成第一流数据及第二流数据,并根据声音数字信号调节比例系数调节第一流数据的音量得到音量调节后的第一流数据包括:所述音频发送装置的蓝牙协议栈接口模块将所述PCM音频数据进行分流得到第一流数据及第二流数据,根据所述声音数字信号调节比例系数调节所述第一流数据的音量得到音量调节后的第一流数据;所述蓝牙协议栈接口模块将所述音量调节后的第一流数据及所述第二流数据合并成音量调节后的PCM音频数据,并将所述音量调节后的PCM音频数据传送给所述音频发送装置的蓝牙协议栈应用层模块;所述蓝牙协议栈应用层模块将所述音量调节后的PCM音频数据传送给所述音频发送装置的蓝牙协议栈模块;所述蓝牙协议栈模块对所述音量调节后的PCM音频数据按照预设编码方法进行编码得到编码后的PCM音频数据。通过上述技术方案,可以在对PCM音频数据编码前完成对PCM音频数据的音量调节,从而提高PCM音频数据播放时的立体声效果。In an implementation manner, the dividing the PCM audio data into the first stream data and the second stream data, and adjusting the volume of the first stream data according to the sound digital signal adjusting the proportional coefficient to obtain the volume-adjusted first stream data includes: the The Bluetooth protocol stack interface module of the audio transmission device divides the PCM audio data to obtain the first stream data and the second stream data, and adjusts the volume of the first stream data according to the sound digital signal by adjusting the proportional coefficient to obtain the first stream after the volume adjustment. Stream data; the Bluetooth protocol stack interface module combines the volume-adjusted first stream data and the second stream data into volume-adjusted PCM audio data, and transmits the volume-adjusted PCM audio data to The Bluetooth protocol stack application layer module of the audio transmission device; the Bluetooth protocol stack application layer module transmits the volume-adjusted PCM audio data to the Bluetooth protocol stack module of the audio transmission device; the Bluetooth protocol stack module The PCM audio data after volume adjustment is encoded according to a preset encoding method to obtain encoded PCM audio data. Through the above technical solution, the volume adjustment of the PCM audio data can be completed before the encoding of the PCM audio data, thereby improving the stereo effect when the PCM audio data is played.
在一种实现方式中,所述蓝牙协议栈模块将所述音量调节后的第一流数据发送给第一音频接收装置,及将所述第二流数据发送给第二音频接收装置包括:将所述编码后的PCM音频数据中的所述音量调节后的第一流数据发送给所述第一音频接收装置,及将所述编码后的PCM音频数据中的所述第二流数据发送给所述第二音频接收装置。通过上述技术方案,通过蓝牙协议栈模块将编码后的PCM音频数据发送给第一音频接收装置及第二音频接收装置。In an implementation manner, the Bluetooth protocol stack module sending the volume-adjusted first stream data to the first audio receiving device, and sending the second stream data to the second audio receiving device includes: sending the volume-adjusted first stream data in the encoded PCM audio data to the first audio receiving device, and sending the second stream data in the encoded PCM audio data to the first audio receiving device A second audio receiving device. Through the above technical solution, the encoded PCM audio data is sent to the first audio receiving device and the second audio receiving device through the Bluetooth protocol stack module.
在一种实现方式中,所述预设编码方法为子带编码方法。In an implementation manner, the preset encoding method is a subband encoding method.
在一种实现方式中,所述将PCM音频数据分流成第一流数据及第二流数据,并根据声音数字信号调节比例系数调节第一流数据的音量得到音量调节后的第一流数据包括:所述音频发送装置的蓝牙协议栈接口模块确定所述第一音频接收装置的音量调节模式及所述第二音频接收装置的音量调节模式为绝对音量调节模式时,根据所述声音数字信号调节比例系数调节所述第一流数据的音量得到音量调节后的第一流数据。通过上述技术方案,蓝牙协议栈接口模块在确定第一音频接收装置的音量调节模式及第二音频接收装置的音量调节模式为绝对音量调节模式时根据所述声音数字信号调节比例系数调节所述第一流数据的音量,如此,音量调节后的第一流数据与第二流数据之间存在差异,使得第一音频接收装置在播放第一流数据及第二音频接收装置在播放第二流数据时产生空间立体声效果。In an implementation manner, the dividing the PCM audio data into the first stream data and the second stream data, and adjusting the volume of the first stream data according to the sound digital signal adjusting the proportional coefficient to obtain the volume-adjusted first stream data includes: the When the Bluetooth protocol stack interface module of the audio transmission device determines that the volume adjustment mode of the first audio receiving device and the volume adjustment mode of the second audio receiving device are absolute volume adjustment modes, adjust the proportional coefficient adjustment according to the sound digital signal The volume of the first stream data obtains the volume-adjusted first stream data. Through the above technical solution, when determining that the volume adjustment mode of the first audio receiving device and the volume adjustment mode of the second audio receiving device are absolute volume adjustment modes, the bluetooth protocol stack interface module adjusts the The volume of the first-stream data, so that there is a difference between the first-stream data and the second-stream data after volume adjustment, so that the first audio receiving device generates space when playing the first-stream data and the second audio-receiver is playing the second-stream data Stereo effect.
在一种实现方式中,所述将PCM音频数据分流成第一流数据及第二流数据,并根据声音数字信号调节比例系数调节第一流数据的音量得到音量调节后的第一流数据包括:所述音频发送装置的蓝牙协议栈接口模块确定所述第一音频接收装置的音量调节模式为绝对音量调节模式及所述第二音频接收装置的音量调节模式为非绝对音量调节模式时,获取所述音频发送装置的音量增益;根据所述声音数字信号调节比例系数调节所述第一流数据的音量得到音量调节后的第一流数据,及根据所述音频发送装置的音量增益调节所述第二流数据得到音量调节后的第二流数据。通过上述技术方案,蓝牙协议栈接口模块在确定第一音频接收装置的音量调节模式为绝对音量调节模式及所述第二音频接收装置的音量调节模式为非绝对音量调节模式时,根据音频发送装置的音量增益调节第二流数据的音量,使得第二音频接收装置在播放第二流数据时的音量不会突然变大,从而解决第二音频接收装置播放第二流数据时音效突变的问题。In an implementation manner, the dividing the PCM audio data into the first stream data and the second stream data, and adjusting the volume of the first stream data according to the sound digital signal adjusting the proportional coefficient to obtain the volume-adjusted first stream data includes: the When the Bluetooth protocol stack interface module of the audio transmission device determines that the volume adjustment mode of the first audio receiving device is an absolute volume adjustment mode and the volume adjustment mode of the second audio receiving device is a non-absolute volume adjustment mode, obtain the audio The volume gain of the transmitting device; adjusting the volume of the first stream data according to the sound digital signal adjusting the proportional coefficient to obtain the volume-adjusted first stream data, and adjusting the second stream data according to the volume gain of the audio transmitting device to obtain Volume-adjusted second stream data. Through the above technical solution, when the Bluetooth protocol stack interface module determines that the volume adjustment mode of the first audio receiving device is the absolute volume adjustment mode and the volume adjustment mode of the second audio receiving device is the non-absolute volume adjustment mode, according to the audio transmission device The volume gain of the device adjusts the volume of the second stream data, so that the volume of the second audio receiving device does not suddenly increase when playing the second stream data, thereby solving the problem of sudden sound effects when the second audio receiving device plays the second stream data.
在一种实现方式中,所述将PCM音频数据分流成第一流数据及第二流数据,并根据声音数字信号调节比例系数调节第一流数据的音量得到所述音量调节后的第一流数据包括:所述音频发送装置的蓝牙协议栈接口模块确定所述第一音频接收装置的音量调节模式为非绝对音量调节模式及所述第二音频接收装置的音量调节模式为绝对音量调节模式时,获取所述音频发送装置的音量增益,根据所述声音数字信号调节比例系数及所述音频发送装置的音量增益调节第一流数据的音量得到所述音量调节后的第一流数据。通过上述技术方案,蓝牙协议栈接口模块在确定第一音频接收装置的音量调节模式为绝对音量调节模式及所述第二音频接收装置的音量调节模式为非绝对音量调节模式时,根据声音数字信号调节比例系数及音频发送装置的音量增益调节第一流数据的音量,使得第一音频接收装置在播放第一流数据时的音量不会突然变大,从而解决第一音频接收装置播放第一流数据时音效突变的问题。In an implementation manner, dividing the PCM audio data into the first stream data and the second stream data, and adjusting the volume of the first stream data according to the sound digital signal adjusting the proportional coefficient to obtain the volume-adjusted first stream data includes: When the Bluetooth protocol stack interface module of the audio transmission device determines that the volume adjustment mode of the first audio receiving device is a non-absolute volume adjustment mode and the volume adjustment mode of the second audio receiving device is an absolute volume adjustment mode, obtain the The volume gain of the audio transmission device is adjusted, and the volume of the first stream data is adjusted according to the sound digital signal and the volume gain of the audio transmission device to obtain the volume-adjusted first stream data. Through the above technical solution, when the Bluetooth protocol stack interface module determines that the volume adjustment mode of the first audio receiving device is the absolute volume adjustment mode and the volume adjustment mode of the second audio receiving device is the non-absolute volume adjustment mode, according to the sound digital signal Adjust the scale factor and the volume gain of the audio transmitting device to adjust the volume of the first stream data, so that the volume of the first audio receiving device when playing the first stream data will not suddenly increase, thereby solving the problem of sound effects when the first audio receiving device plays the first stream data. mutation problem.
在一种实现方式中,所述将PCM音频数据分流成第一流数据及第二流数据,并根据声音数字信号调节比例系数调节第一流数据的音量得到所述音量调节后的第一流数据包括:所述音频发送装置的蓝牙协议栈接口模块确定所述第一音频接收装置的音量调节模式为非绝对音量调节模式及所述第二音频接收装置的音量调节模式为非绝对音量调节模式时,获取所述音频发送装置的音量增益;根据所述声音数字信号调节比例系数及所述音频发送装置的音量增益调节所述第一流数据的音量得到所述音量调节后的第一流数据,及根据所述音频发送装置的音量增益调节所述第二流数据的音量得到音量调节后的第二流数据。通过上述技术方案,蓝牙协议栈接口模块在确定第一音频接收装置的音量调节模式为非绝对音量调节模式及第二音频接收装置的音量调节模式为非绝对音量调节模式时根据声音数字信号调节比例系数及音频发送装置的音量增益调节第一流数据的音量,及根据音频发送装置的音量增益调节第二流数据的音量,使得第一音频接收装置在播放第一流数据及第二音频接收装置在播放第二流数据时的音量不会突然变大。In an implementation manner, dividing the PCM audio data into the first stream data and the second stream data, and adjusting the volume of the first stream data according to the sound digital signal adjusting the proportional coefficient to obtain the volume-adjusted first stream data includes: When the Bluetooth protocol stack interface module of the audio transmission device determines that the volume adjustment mode of the first audio receiving device is a non-absolute volume adjustment mode and the volume adjustment mode of the second audio receiving device is a non-absolute volume adjustment mode, obtain The volume gain of the audio transmission device; adjusting the proportional coefficient according to the sound digital signal and the volume gain of the audio transmission device by adjusting the volume of the first stream data to obtain the volume-adjusted first stream data, and according to the The volume gain of the audio sending device adjusts the volume of the second stream data to obtain volume-adjusted second stream data. Through the above technical solution, the Bluetooth protocol stack interface module adjusts the ratio according to the sound digital signal when determining that the volume adjustment mode of the first audio receiving device is the non-absolute volume adjustment mode and the volume adjustment mode of the second audio receiving device is the non-absolute volume adjustment mode The coefficient and the volume gain of the audio transmitting device adjust the volume of the first stream data, and adjust the volume of the second stream data according to the volume gain of the audio transmitting device, so that the first audio receiving device is playing the first stream data and the second audio receiving device is playing The volume of the second stream data will not suddenly become louder.
在一种实现方式中,所述系统还包括:所述音频发送装置的蓝牙协议栈接口模块将所述音量调节后的第一流数据、所述第二流数据合并成音量调节后的PCM音频数据,或将所述音量调节后的第一流数据、所述音量调节后的第二流数据合并成音量调节后的PCM音频数据,并将所述音量调节后的PCM音频数据传送给所述音频发送装置的蓝牙协议栈应用层模块;所述蓝牙协议栈应用层模块将所述音量调节后的PCM音频数据传送给所述音频发送装置的蓝牙协议栈模块;所述蓝牙协议栈模块对所述音量调节后的PCM音频数据按照预设编码方法进行编码得到编码后的PCM音频数据。通过上述技术方案,蓝牙协议栈模块对音量调节后的PCM音频数据按照预设编码方法进行编码得到编码后的PCM音频数据。In an implementation manner, the system further includes: the Bluetooth protocol stack interface module of the audio transmission device combines the volume-adjusted first stream data and the second stream data into volume-adjusted PCM audio data , or combine the volume-adjusted first stream data and the volume-adjusted second stream data into volume-adjusted PCM audio data, and transmit the volume-adjusted PCM audio data to the audio transmitter The Bluetooth protocol stack application layer module of the device; the Bluetooth protocol stack application layer module transmits the PCM audio data after the volume adjustment to the Bluetooth protocol stack module of the audio sending device; the Bluetooth protocol stack module The adjusted PCM audio data is encoded according to a preset encoding method to obtain encoded PCM audio data. Through the above technical solution, the Bluetooth protocol stack module encodes the PCM audio data after volume adjustment according to a preset encoding method to obtain the encoded PCM audio data.
在一种实现方式中,所述扫描并接收第一音频接收装置发送的第一广播信号,并根据所述第一广播信号携带的发射功率确定所述第一广播信号的空间损耗包括:获取所述第一广播信号的发射功率;获取所述第一广播信号的接收功率;计算所述第一广播信号的发射功率及所述第一广播信号的接收功率的差值得到所述第一广播信号的空间损耗。通过上述技术方案,通过计算第一广播信号的发射功率及第一广播信号的接收功率的差值得到第一广播信号的空间损耗。In an implementation manner, the scanning and receiving the first broadcast signal sent by the first audio receiving apparatus, and determining the space loss of the first broadcast signal according to the transmit power carried by the first broadcast signal includes: obtaining the the transmit power of the first broadcast signal; obtain the receive power of the first broadcast signal; calculate the difference between the transmit power of the first broadcast signal and the receive power of the first broadcast signal to obtain the first broadcast signal space loss. Through the above technical solution, the space loss of the first broadcast signal is obtained by calculating the difference between the transmit power of the first broadcast signal and the received power of the first broadcast signal.
在一种实现方式中,所述根据所述第一广播信号的载波频率及空间损耗计算所述音频发送装置与所述第一音频接收装置之间的第一距离包括:根据公式D1=10^((Losdb1-32.45-20×log10(F1))/20)计算得到所述第一距离,其中,Losdb1为所述第一广播信号的空间损耗,F1为所述第一广播信号的载波频率,D1为所述第一距离。通过上述技术方案,所述第一距离根据公式D1=10^((Losdb1-32.45-20×log10(F1))/20)计算得到。In an implementation manner, the calculating the first distance between the audio sending device and the first audio receiving device according to the carrier frequency and the space loss of the first broadcast signal includes: according to the formula D1=10^ ((Losdb1-32.45-20×log10(F1))/20) is calculated to obtain the first distance, where Losdb1 is the space loss of the first broadcast signal, F1 is the carrier frequency of the first broadcast signal, D1 is the first distance. Through the above technical solution, the first distance is calculated according to the formula D1=10^((Losdb1-32.45-20×log10(F1))/20).
在一种实现方式中,扫描并接收第二音频接收装置发送的第二广播信号,并根据所述第二广播信号携带的发射功率确定所述第二广播信号的空间损耗包括:获取所述第二广播信号的发射功率;获取所述第二广播信号的接收功率;计算所述第二广播信号的发射功率及所述第二广播信号的接收功率确定所述第二广播信号的空间损耗。通过上述技术方案,通过计算第二广播信号的发射功率及第二广播信号的接收功率确定第二广播信号的空间损耗。In an implementation manner, scanning and receiving the second broadcast signal sent by the second audio receiving apparatus, and determining the space loss of the second broadcast signal according to the transmit power carried by the second broadcast signal includes: acquiring the first broadcast signal. 2. the transmit power of the broadcast signal; obtain the receive power of the second broadcast signal; calculate the transmit power of the second broadcast signal and the receive power of the second broadcast signal to determine the space loss of the second broadcast signal. Through the above technical solution, the space loss of the second broadcast signal is determined by calculating the transmit power of the second broadcast signal and the received power of the second broadcast signal.
在一种实现方式中,所述根据所述第二广播信号的载波频率及空间损耗计算所述音频发送装置与所述第二音频接收装置之间的第二距离包括:根据公式D2=10^((Losdb2-32.45-20×log10(F2))/20)计算得到所述第二距离,其中,Losdb2为所述第二广播信号的空间损耗,F2为所述第二广播信号的载波频率,D2为所述第二距离。通过上述技术方案,所述第二距离根据公式D2=10^((Losdb2-32.45-20×log10(F2))/20)计算得到。In an implementation manner, the calculating the second distance between the audio sending device and the second audio receiving device according to the carrier frequency and the space loss of the second broadcast signal includes: according to the formula D2=10^ ((Losdb2-32.45-20×log10(F2))/20) to calculate the second distance, where Losdb2 is the space loss of the second broadcast signal, F2 is the carrier frequency of the second broadcast signal, D2 is the second distance. Through the above technical solution, the second distance is calculated according to the formula D2=10^((Losdb2-32.45-20×log10(F2))/20).
在一种实现方式中,所述根据所述第一距离及所述第二距离计算出声音数字信号调节比例系数包括:根据公式A=20log10(D1/D2)计算出声音模拟信号调节比例系数,其中D1为所述第一距离,D2为所述第二距离,A为所述声音模拟信号调节比例系数;根据公式K=10^(A/20)计算出声音数字信号调节比例系数,其中K为所述声音数字信号调节比例系数。通过上述技术方案,所述声音数字信号调节比例系数根据公式A=20log10(D1/D2)及公式K=10^(A/20)计算得到。In an implementation manner, the calculating the sound digital signal adjustment proportional coefficient according to the first distance and the second distance includes: calculating the sound analog signal adjustment proportional coefficient according to the formula A=20log10(D1/D2), Wherein D1 is the first distance, D2 is the second distance, A is the sound analog signal adjustment proportional coefficient; According to the formula K=10^(A/20), the sound digital signal adjustment proportional coefficient is calculated, wherein K A scaling factor is adjusted for the audio digital signal. Through the above technical solution, the digital sound signal adjustment scale factor is calculated according to the formula A=20log10(D1/D2) and the formula K=10^(A/20).
第二方面,本申请实施例提供另一种立体声实现系统,所述系统包括:音频发送装置,用于:向第一音频接收装置发送携带发射功率的第三广播信号;向第二音频接收装置发送携带发射功率的第四广播信号;获取PCM音频数据,将PCM音频数据分流成第一流数据及第二流数据,并将所述第一流数据发送给所述第一音频接收装置,将所述第二流数据发送给所述第二音频接收装置;第一音频接收装置用于:扫描并接收所述第三广播信号,并根据所述第三广播信号携带的发射功率确定所述第三广播信号的空间损耗;获取所述第三广播信号的载波频率,根据所述第三广播信号的载波频率及所述第三广播信号的空间损耗计算所述第一音频接收装置与所述音频发送装置之间的第三距离,并向所述第二音频接收装置发送所述第三距离;响应接收到的所述第一流数据,播放所述第一流数据;第二音频接收装置,用于:扫描并接收所述第四广播信号,并根据所述第四广播信号携带的发射功率确定所述第四广播信号的空间损耗;获取所述第四广播信号的载波频率,根据所述第四广播信号的载波频率及所述第四广播信号的空间损耗计算所述第二音频接收装置与所述音频发送装置之间的第四距离;根据所述第三距离及所述第四距离计算出声音数字信号调节比例系数;响应接收到的所述第二流数据,根据所述声音数字信号调节比例系数调节第二流数据的音量,并播放音量调节后的第二流数据。In a second aspect, an embodiment of the present application provides another stereo implementation system, the system includes: an audio sending device, configured to: send a third broadcast signal carrying transmit power to a first audio receiving device; Sending a fourth broadcast signal carrying transmit power; acquiring PCM audio data, splitting the PCM audio data into first stream data and second stream data, and sending the first stream data to the first audio receiving device, and sending the The second stream data is sent to the second audio receiving device; the first audio receiving device is configured to: scan and receive the third broadcast signal, and determine the third broadcast signal according to the transmit power carried by the third broadcast signal Signal space loss; obtain the carrier frequency of the third broadcast signal, and calculate the first audio receiving device and the audio sending device according to the carrier frequency of the third broadcast signal and the space loss of the third broadcast signal and send the third distance to the second audio receiving device; in response to the received first stream data, play the first stream data; the second audio receiving device is used for: scanning and receive the fourth broadcast signal, and determine the space loss of the fourth broadcast signal according to the transmit power carried by the fourth broadcast signal; obtain the carrier frequency of the fourth broadcast signal, Calculate the fourth distance between the second audio receiving device and the audio transmitting device according to the carrier frequency and the space loss of the fourth broadcast signal; calculate the sound number according to the third distance and the fourth distance The signal adjusts the scale factor; in response to the received second stream data, adjusts the volume of the second stream data by adjusting the scale factor according to the sound digital signal, and plays the volume-adjusted second stream data.
本申请中第二音频接收装置接收音频发送装置发送的PCM音频数据的第二流数据,并根据声音数字信号调节比例系数调节第二流数据的音量,并播放音量调节后的第一流数据,第一音频接收装置播放音频发送装置发送的PCM音频数据的第一流数据。如此,音量调节后的第二流数据与第一流数据之间存在差异,使得第一音频接收装置在播放第一流数据及第二音频接收装置在播放第二流数据时产生空间立体声效果。In this application, the second audio receiving device receives the second stream data of the PCM audio data sent by the audio transmitting device, adjusts the volume of the second stream data according to the sound digital signal adjustment scale factor, and plays the volume-adjusted first stream data, An audio receiving device plays the first stream data of the PCM audio data sent by the audio transmitting device. In this way, there is a difference between the volume-adjusted second stream data and the first stream data, so that the first audio receiving device produces a spatial stereo effect when playing the first stream data and the second audio receiving device plays the second stream data.
在一种实现方式中,所述扫描并接收所述第三广播信号,并根据所述第三广播信号携带的发射功率确定所述第三广播信号的空间损耗包括:获取所述第三广播信号的发射功率;获取所述第三广播信号的接收功率;计算所述第三广播信号的发射功率及所述第三广播信号的接收功率的差值得到所述第三广播信号的空间损耗。通过上述技术方案,通过计算第三广播信号的发射功率及第三广播信号的接收功率的差值得到第三广播信号的空间损耗。In an implementation manner, the scanning and receiving the third broadcast signal, and determining the space loss of the third broadcast signal according to the transmit power carried by the third broadcast signal includes: acquiring the third broadcast signal obtain the received power of the third broadcast signal; calculate the difference between the transmit power of the third broadcast signal and the received power of the third broadcast signal to obtain the space loss of the third broadcast signal. Through the above technical solution, the space loss of the third broadcast signal is obtained by calculating the difference between the transmit power of the third broadcast signal and the received power of the third broadcast signal.
在一种实现方式中,所述根据所述第三广播信号的载波频率及所述第三广播信号的空间损耗计算所述第一音频接收装置与所述音频发送装置之间的第三距离包括:根据公式D3=10^((Losdb3-32.45-20×log10(F3))/20)计算得到所述第三距离,其中,Losdb3为所述第三广播信号的空间损耗,F3为所述第三广播信号的载波频率,D3为所述第三距离。通过上述技术方案,所述第三距离根据公式D3=10^((Losdb3-32.45-20×log10(F3))/20)计算得到。In an implementation manner, the calculating the third distance between the first audio receiving device and the audio transmitting device according to the carrier frequency of the third broadcast signal and the space loss of the third broadcast signal includes: : Calculate the third distance according to the formula D3=10^((Losdb3-32.45-20×log10(F3))/20), where Losdb3 is the space loss of the third broadcast signal, and F3 is the third distance The carrier frequency of the three broadcast signals, and D3 is the third distance. Through the above technical solution, the third distance is calculated according to the formula D3=10^((Losdb3-32.45-20×log10(F3))/20).
在一种实现方式中,扫描并接收所述第四广播信号,并根据所述第四广播信号携带的发射功率确定所述第四广播信号的空间损耗包括:获取所述第四广播信号的发射功率;获取所述第四广播信号的接收功率;计算所述第四广播信号的发射功率及所述第四广播信号的接收功率确定所述第四广播信号的空间损耗。通过上述技术方案,通过计算第四广播信号的发射功率及第四广播信号的接收功率确定第四广播信号的空间损耗。In an implementation manner, scanning and receiving the fourth broadcast signal, and determining the space loss of the fourth broadcast signal according to the transmission power carried by the fourth broadcast signal includes: acquiring the transmission of the fourth broadcast signal power; acquiring the received power of the fourth broadcast signal; calculating the transmit power of the fourth broadcast signal and the received power of the fourth broadcast signal to determine the space loss of the fourth broadcast signal. Through the above technical solution, the space loss of the fourth broadcast signal is determined by calculating the transmit power of the fourth broadcast signal and the receive power of the fourth broadcast signal.
在一种实现方式中,所述根据所述第四广播信号的载波频率及所述第四广播信号的空间损耗计算所述第二音频接收装置与所述音频发送装置之间的第四距离包括:根据公式D4=10^((Losdb4-32.45-20×log10(F4))/20)计算得到所述第四距离,其中,Losdb4为所述第四广播信号的空间损耗,F4为所述第四广播信号的载波频率,D4为所述第四距离。通过上述技术方案,所述第四距离根据公式D4=10^((Losdb4-32.45-20×log10(F4))/20)计算得到。In an implementation manner, the calculating the fourth distance between the second audio receiving device and the audio transmitting device according to the carrier frequency of the fourth broadcast signal and the space loss of the fourth broadcast signal includes: : Calculate the fourth distance according to the formula D4=10^((Losdb4-32.45-20×log10(F4))/20), where Losdb4 is the space loss of the fourth broadcast signal, and F4 is the first Four carrier frequencies of broadcast signals, D4 is the fourth distance. Through the above technical solution, the fourth distance is calculated according to the formula D4=10^((Losdb4-32.45-20×log10(F4))/20).
在一种实现方式中,所述根据所述第三距离及所述第四距离计算出声音数字信号调节比例系数包括:根据公式A=20log10(D3/D4)计算出声音模拟信号调节比例系数,其中D3为所述第三距离,D4为所述第四距离,A为所述声音模拟信号调节比例系数;根据公式K=10^(A/20)计算出声音数字信号调节比例系数,其中K为所述声音数字信号调节比例系数。通过上述技术方案,所述声音数字信号调节比例系数根据公式A=20log10(D1/D2)及公式K=10^(A/20)计算得到。In an implementation manner, the calculating the sound digital signal adjustment proportional coefficient according to the third distance and the fourth distance includes: calculating the sound analog signal adjustment proportional coefficient according to the formula A=20log10(D3/D4), Wherein D3 is the third distance, D4 is the fourth distance, and A is the sound analog signal adjustment proportional coefficient; according to the formula K=10^(A/20), the sound digital signal adjustment proportional coefficient is calculated, wherein K A scaling factor is adjusted for the audio digital signal. Through the above technical solution, the digital sound signal adjustment scale factor is calculated according to the formula A=20log10(D1/D2) and the formula K=10^(A/20).
第三方面,本申请实施例提供一种立体声实现方法,应用在音频发送装置中,所述方法包括:扫描并接收第一音频接收装置发送的携带发射功率的第一广播信号,并根据所述第一广播信号携带的发射功率确定所述第一广播信号的空间损耗;获取所述第一广播信号的载波频率,并根据所述第一广播信号的载波频率及所述第一广播信号的空间损耗计算所述音频发送装置与所述第一音频接收装置之间的第一距离;扫描并接收第二音频接收装置发送的携带发射功率的第二广播信号,并根据所述第二广播信号携带的发射功率确定所述第二广播信号的空间损耗;获取所述第二广播信号的频率,并根据所述第二广播信号的频率及所述第二广播信号的空间损耗计算所述音频发送装置与所述第二音频接收装置的第二距离;根据所述第一距离及所述第二距离计算出声音数字信号调节比例系数;获取PCM音频数据,将PCM音频数据分流成第一流数据及第二流数据,并根据所述声音数字信号调节比例系数调节所述第一流数据的音量得到音量调节后的第一流数据;将所述音量调节后的第一流数据发送给第一音频接收装置进行播放;将所述第二流数据发送给第二音频接收装置进行播放。本申请根据音频发送装置与音频接收装置之间的距离计算出声音数字信号调节比例系数,并根据声音数字信号调节比例系数调节第一流数据的音量,将音量调节后的第一流数据发送给第一音频接收装置,将第二流数据发送给第二音频接收装置,如此,音量调节后的第一流数据与第二流数据之间存在差异,使得第一音频接收装置在播放第一流数据及第二音频接收装置在播放第二流数据时产生空间立体声效果。In a third aspect, an embodiment of the present application provides a stereo implementation method, which is applied in an audio sending device, the method includes: scanning and receiving a first broadcast signal carrying transmit power sent by a first audio receiving device, and according to the The transmit power carried by the first broadcast signal determines the space loss of the first broadcast signal; obtains the carrier frequency of the first broadcast signal, and determines the space loss of the first broadcast signal according to the carrier frequency of the first broadcast signal and the space of the first broadcast signal Calculate the first distance between the audio sending device and the first audio receiving device; scan and receive the second broadcast signal carrying the transmit power sent by the second audio receiving device, and carry the transmission power according to the second broadcast signal determine the space loss of the second broadcast signal; obtain the frequency of the second broadcast signal, and calculate the audio transmission device according to the frequency of the second broadcast signal and the space loss of the second broadcast signal A second distance from the second audio receiving device; calculating a sound digital signal adjustment scale factor according to the first distance and the second distance; acquiring PCM audio data, and splitting the PCM audio data into first stream data and first stream data. Second-stream data, and adjust the volume of the first-stream data according to the sound digital signal adjusting the proportional coefficient to obtain volume-adjusted first-stream data; send the volume-adjusted first-stream data to the first audio receiving device for playback ; Send the second stream data to a second audio receiving device for playback. The present application calculates the sound digital signal adjustment proportional coefficient according to the distance between the audio transmission device and the audio receiving device, adjusts the volume of the first stream data according to the sound digital signal adjustment proportional coefficient, and sends the volume-adjusted first stream data to the first stream data. The audio receiving device sends the second stream data to the second audio receiving device, so that there is a difference between the first stream data after volume adjustment and the second stream data, so that the first audio receiving device is playing the first stream data and the second stream data. The audio receiving device generates a spatial stereo effect when playing the second stream data.
在一种实现方式中,所述获取PCM音频数据,将PCM音频数据分流成第一流数据及第二流数据,并根据所述声音数字信号调节比例系数调节所述第一流数据的音量得到音量调节后的第一流数据包括:响应播放音频文件的操作,获取所述音频文件中的所述PCM音频数据,并将所述音频文件中的所述PCM音频数据分流成所述第一流数据及所述第二流数据。上述技术方案,可以通过执行播放音频文件的操作,将音频文件中的PCM音频数据分流成所述第一流数据及所述第二流数据。In an implementation manner, the acquiring PCM audio data, splitting the PCM audio data into first stream data and second stream data, and adjusting the volume of the first stream data according to the sound digital signal adjusting scale factor to obtain volume adjustment The subsequent first stream data includes: in response to the operation of playing the audio file, acquiring the PCM audio data in the audio file, and splitting the PCM audio data in the audio file into the first stream data and the second stream data. In the above technical solution, the PCM audio data in the audio file can be divided into the first stream data and the second stream data by performing the operation of playing the audio file.
在一种实现方式中,所述播放音频文件的操作包括点击音乐播放应用或视频播放应用的用户界面上的播放按键的操作。通过上述技术方案,在点击音乐播放应用或视频播放应用的用户界面上的播放按键的操作时,将音频文件中的PCM音频数据分流成所述第一流数据及所述第二流数据。In an implementation manner, the operation of playing the audio file includes an operation of clicking a play button on the user interface of the music playing application or the video playing application. Through the above technical solution, when the play button on the user interface of the music playing application or the video playing application is clicked, the PCM audio data in the audio file is divided into the first stream data and the second stream data.
在一种实现方式中,所述获取PCM音频数据,将PCM音频数据分流成第一流数据及第二流数据,并根据所述声音数字信号调节比例系数调节所述第一流数据的音量得到音量调节后的第一流数据包括:所述音频发送装置的蓝牙协议栈接口模块将所述PCM音频数据进行分流得到第一流数据及第二流数据,根据所述声音数字信号调节比例系数调节所述第一流数据的音量得到所述音量调节后的第一流数据;所述蓝牙协议栈接口模块将所述音量调节后的第一流数据及所述第二流数据合并成音量调节后的PCM音频数据,并将所述音量调节后的PCM音频数据传送给所述音频发送装置的蓝牙协议栈应用层模块;所述蓝牙协议栈应用层模块将所述音量调节后的PCM音频数据传送给所述音频发送装置的蓝牙协议栈模块;所述蓝牙协议栈模块对所述音量调节后的PCM音频数据按照预设编码方法进行编码得到编码后的PCM音频数据。通过上述技术方案,可以在对PCM音频数据编码前完成对PCM音频数据的音量调节,从而提高PCM音频数据播放时的立体声效果。In an implementation manner, the acquiring PCM audio data, splitting the PCM audio data into first stream data and second stream data, and adjusting the volume of the first stream data according to the sound digital signal adjusting scale factor to obtain volume adjustment The latter first stream data includes: the Bluetooth protocol stack interface module of the audio transmission device divides the PCM audio data to obtain first stream data and second stream data, and adjusts the first stream according to the sound digital signal by adjusting the scale factor. The volume of the data obtains the first stream data after the volume adjustment; the Bluetooth protocol stack interface module combines the first stream data after the volume adjustment and the second stream data into the PCM audio data after the volume adjustment, and the The PCM audio data after the volume adjustment is transmitted to the Bluetooth protocol stack application layer module of the audio transmission device; the Bluetooth protocol stack application layer module transmits the PCM audio data after the volume adjustment to the audio transmission device. A Bluetooth protocol stack module; the Bluetooth protocol stack module encodes the PCM audio data after volume adjustment according to a preset coding method to obtain coded PCM audio data. Through the above technical solution, the volume adjustment of the PCM audio data can be completed before the encoding of the PCM audio data, thereby improving the stereo effect when the PCM audio data is played.
在一种实现方式中,所述将所述音量调节后的第一流数据发送给第一音频接收装置,及将所述第二流数据发送给第二音频接收装置包括:所述蓝牙协议栈模块将所述编码后的PCM音频数据中的所述音量调节后的第一流数据发送给所述第一音频接收装置,及将所述编码后的PCM音频数据中的所述第二流数据发送给所述第二音频接收装置。通过上述技术方案,通过蓝牙协议栈模块将编码后的PCM音频数据发送给第一音频接收装置及第二音频接收装置。In an implementation manner, the sending the volume-adjusted first stream data to the first audio receiving device and sending the second stream data to the second audio receiving device include: the Bluetooth protocol stack module Sending the volume-adjusted first stream data in the encoded PCM audio data to the first audio receiving device, and sending the second stream data in the encoded PCM audio data to the second audio receiving device. Through the above technical solution, the encoded PCM audio data is sent to the first audio receiving device and the second audio receiving device through the Bluetooth protocol stack module.
在一种实现方式中,所述将PCM音频数据分流成第一流数据及第二流数据,并根据声音数字信号调节比例系数调节第一流数据的音量得到音量调节后的第一流数据包括:所述音频发送装置的蓝牙协议栈接口模块确定所述第一音频接收装置的音量调节模式及所述第二音频接收装置的音量调节模式为绝对音量调节模式时,根据所述声音数字信号调节比例系数调节所述第一流数据的音量得到音量调节后的第一流数据。通过上述技术方案,蓝牙协议栈接口模块在确定第一音频接收装置的音量调节模式及第二音频接收装置的音量调节模式为绝对音量调节模式时根据所述声音数字信号调节比例系数调节所述第一流数据的音量,如此,音量调节后的第一流数据与第二流数据之间存在差异,使得第一音频接收装置在播放第一流数据及第二音频接收装置在播放第二流数据时产生空间立体声效果。In an implementation manner, the dividing the PCM audio data into the first stream data and the second stream data, and adjusting the volume of the first stream data according to the sound digital signal adjusting the proportional coefficient to obtain the volume-adjusted first stream data includes: the When the Bluetooth protocol stack interface module of the audio transmission device determines that the volume adjustment mode of the first audio receiving device and the volume adjustment mode of the second audio receiving device are absolute volume adjustment modes, adjust the proportional coefficient adjustment according to the sound digital signal The volume of the first stream data obtains the volume-adjusted first stream data. Through the above technical solution, when determining that the volume adjustment mode of the first audio receiving device and the volume adjustment mode of the second audio receiving device are absolute volume adjustment modes, the bluetooth protocol stack interface module adjusts the The volume of the first-stream data, so that there is a difference between the first-stream data and the second-stream data after volume adjustment, so that the first audio receiving device generates space when playing the first-stream data and the second audio-receiver is playing the second-stream data Stereo effect.
在一种实现方式中,所述将PCM音频数据分流成第一流数据及第二流数据,并根据声音数字信号调节比例系数调节第一流数据的音量得到音量调节后的第一流数据包括:所述音频发送装置的蓝牙协议栈接口模块确定所述第一音频接收装置的音量调节模式为绝对音量调节模式及所述第二音频接收装置的音量调节模式为非绝对音量调节模式时,获取所述音频发送装置的音量增益;根据所述声音数字信号调节比例系数调节所述第一流数据的音量得到音量调节后的第一流数据,及根据所述音频发送装置的音量增益调节所述第二流数据得到音量调节后的第二流数据。通过上述技术方案,蓝牙协议栈接口模块在确定第一音频接收装置的音量调节模式为绝对音量调节模式及所述第二音频接收装置的音量调节模式为非绝对音量调节模式时,根据音频发送装置的音量增益调节第二流数据的音量,使得第二音频接收装置在播放第二流数据时的音量不会突然变大,从而解决第二音频接收装置播放第二流数据时音效突变的问题。In an implementation manner, the dividing the PCM audio data into the first stream data and the second stream data, and adjusting the volume of the first stream data according to the sound digital signal adjusting the proportional coefficient to obtain the volume-adjusted first stream data includes: the When the Bluetooth protocol stack interface module of the audio transmission device determines that the volume adjustment mode of the first audio receiving device is an absolute volume adjustment mode and the volume adjustment mode of the second audio receiving device is a non-absolute volume adjustment mode, obtain the audio The volume gain of the transmitting device; adjusting the volume of the first stream data according to the sound digital signal adjusting the proportional coefficient to obtain the volume-adjusted first stream data, and adjusting the second stream data according to the volume gain of the audio transmitting device to obtain Volume-adjusted second stream data. Through the above technical solution, when the Bluetooth protocol stack interface module determines that the volume adjustment mode of the first audio receiving device is the absolute volume adjustment mode and the volume adjustment mode of the second audio receiving device is the non-absolute volume adjustment mode, according to the audio transmission device The volume gain of the device adjusts the volume of the second stream data, so that the volume of the second audio receiving device does not suddenly increase when playing the second stream data, thereby solving the problem of sudden sound effects when the second audio receiving device plays the second stream data.
在一种实现方式中,所述将PCM音频数据分流成第一流数据及第二流数据,并根据声音数字信号调节比例系数调节第一流数据的音量得到所述音量调节后的第一流数据包括:所述音频发送装置的蓝牙协议栈接口模块确定所述第一音频接收装置的音量调节模式为非绝对音量调节模式及所述第二音频接收装置的音量调节模式为绝对音量调节模式时,获取所述音频发送装置的音量增益,根据所述声音数字信号调节比例系数及所述音频发送装置的音量增益调节第一流数据的音量得到所述音量调节后的第一流数据。通过上述技术方案,蓝牙协议栈接口模块在确定第一音频接收装置的音量调节模式为绝对音量调节模式及所述第二音频接收装置的音量调节模式为非绝对音量调节模式时,根据声音数字信号调节比例系数及音频发送装置的音量增益调节第一流数据的音量,使得第一音频接收装置在播放第一流数据时的音量不会突然变大,从而解决第一音频接收装置播放第一流数据时音效突变的问题。In an implementation manner, dividing the PCM audio data into the first stream data and the second stream data, and adjusting the volume of the first stream data according to the sound digital signal adjusting the proportional coefficient to obtain the volume-adjusted first stream data includes: When the Bluetooth protocol stack interface module of the audio transmission device determines that the volume adjustment mode of the first audio receiving device is a non-absolute volume adjustment mode and the volume adjustment mode of the second audio receiving device is an absolute volume adjustment mode, obtain the The volume gain of the audio transmission device is adjusted, and the volume of the first stream data is adjusted according to the sound digital signal and the volume gain of the audio transmission device to obtain the volume-adjusted first stream data. Through the above technical solution, when the Bluetooth protocol stack interface module determines that the volume adjustment mode of the first audio receiving device is the absolute volume adjustment mode and the volume adjustment mode of the second audio receiving device is the non-absolute volume adjustment mode, according to the sound digital signal Adjust the scale factor and the volume gain of the audio transmitting device to adjust the volume of the first stream data, so that the volume of the first audio receiving device when playing the first stream data will not suddenly increase, thereby solving the problem of sound effects when the first audio receiving device plays the first stream data. mutation problem.
在一种实现方式中,所述将PCM音频数据分流成第一流数据及第二流数据,并根据声音数字信号调节比例系数调节第一流数据的音量得到所述音量调节后的第一流数据包括:所述音频发送装置的蓝牙协议栈接口模块确定所述第一音频接收装置的音量调节模式为非绝对音量调节模式及所述第二音频接收装置的音量调节模式为非绝对音量调节模式时,获取所述音频发送装置的音量增益;根据所述声音数字信号调节比例系数及所述音频发送装置的音量增益调节所述第一流数据的音量得到所述音量调节后的第一流数据,及根据所述音频发送装置的音量增益调节所述第二流数据的音量得到音量调节后的第二流数据。通过上述技术方案,蓝牙协议栈接口模块在确定第一音频接收装置的音量调节模式为非绝对音量调节模式及第二音频接收装置的音量调节模式为非绝对音量调节模式时根据声音数字信号调节比例系数及音频发送装置的音量增益调节第一流数据的音量,及根据音频发送装置的音量增益调节第二流数据的音量,使得第一音频接收装置在播放第一流数据及第二音频接收装置在播放第二流数据时的音量不会突然变大。In an implementation manner, dividing the PCM audio data into the first stream data and the second stream data, and adjusting the volume of the first stream data according to the sound digital signal adjusting the proportional coefficient to obtain the volume-adjusted first stream data includes: When the Bluetooth protocol stack interface module of the audio transmission device determines that the volume adjustment mode of the first audio receiving device is a non-absolute volume adjustment mode and the volume adjustment mode of the second audio receiving device is a non-absolute volume adjustment mode, obtain The volume gain of the audio transmission device; adjusting the proportional coefficient according to the sound digital signal and the volume gain of the audio transmission device by adjusting the volume of the first stream data to obtain the volume-adjusted first stream data, and according to the The volume gain of the audio sending device adjusts the volume of the second stream data to obtain volume-adjusted second stream data. Through the above technical solution, the Bluetooth protocol stack interface module adjusts the ratio according to the sound digital signal when determining that the volume adjustment mode of the first audio receiving device is the non-absolute volume adjustment mode and the volume adjustment mode of the second audio receiving device is the non-absolute volume adjustment mode The coefficient and the volume gain of the audio transmitting device adjust the volume of the first stream data, and adjust the volume of the second stream data according to the volume gain of the audio transmitting device, so that the first audio receiving device is playing the first stream data and the second audio receiving device is playing The volume of the second stream data will not suddenly become louder.
在一种实现方式中,所述方法还包括:所述蓝牙协议栈接口模块将所述音量调节后的第一流数据、所述第二流数据合并成音量调节后的PCM音频数据,或将所述音量调节后的第一流数据、所述音量调节后的第二流数据合并成音量调节后的PCM音频数据,并将所述音量调节后的PCM音频数据传送给所述音频发送装置的蓝牙协议栈应用层模块;所述蓝牙协议栈应用层模块将所述音量调节后的PCM音频数据传送给所述音频发送装置的蓝牙协议栈模块;所述蓝牙协议栈模块对所述音量调节后的PCM音频数据按照预设编码方法进行编码得到编码后的PCM音频数据。通过上述技术方案,蓝牙协议栈模块对音量调节后的PCM音频数据按照预设编码方法进行编码得到编码后的PCM音频数据。In an implementation manner, the method further includes: the Bluetooth protocol stack interface module combines the volume-adjusted first stream data and the second stream data into volume-adjusted PCM audio data, or combines the volume-adjusted PCM audio data. The first stream data after the volume adjustment and the second stream data after the volume adjustment are merged into the PCM audio data after the volume adjustment, and the PCM audio data after the volume adjustment is transmitted to the Bluetooth protocol of the audio transmission device stack application layer module; the Bluetooth protocol stack application layer module transmits the volume-adjusted PCM audio data to the Bluetooth protocol stack module of the audio transmission device; the Bluetooth protocol stack module transfers the volume-adjusted PCM audio data The audio data is encoded according to a preset encoding method to obtain encoded PCM audio data. Through the above technical solution, the Bluetooth protocol stack module encodes the PCM audio data after volume adjustment according to a preset encoding method to obtain the encoded PCM audio data.
在一种实现方式中,所述扫描并接收第一音频接收装置发送的第一广播信号,并根据所述第一广播信号携带的发射功率确定所述第一广播信号的空间损耗包括:获取所述第一广播信号的发射功率;获取所述第一广播信号的接收功率;计算所述第一广播信号的发射功率及所述第一广播信号的接收功率的差值得到所述第一广播信号的空间损耗。通过上述技术方案,通过计算第一广播信号的发射功率及第一广播信号的接收功率的差值得到第一广播信号的空间损耗。In an implementation manner, the scanning and receiving the first broadcast signal sent by the first audio receiving apparatus, and determining the space loss of the first broadcast signal according to the transmit power carried by the first broadcast signal includes: obtaining the the transmit power of the first broadcast signal; obtain the receive power of the first broadcast signal; calculate the difference between the transmit power of the first broadcast signal and the receive power of the first broadcast signal to obtain the first broadcast signal space loss. Through the above technical solution, the space loss of the first broadcast signal is obtained by calculating the difference between the transmit power of the first broadcast signal and the received power of the first broadcast signal.
在一种实现方式中,所述根据所述第一广播信号的载波频率及空间损耗计算所述音频发送装置与所述第一音频接收装置之间的第一距离包括:根据公式D1=10^((Losdb1-32.45-20×log10(F1))/20)计算得到所述第一距离,其中,Losdb1为所述第一广播信号的空间损耗,F1为所述第一广播信号的载波频率,D1为所述第一距离。通过上述技术方案,所述第一距离根据公式D1=10^((Losdb1-32.45-20×log10(F1))/20)计算得到。In an implementation manner, the calculating the first distance between the audio sending device and the first audio receiving device according to the carrier frequency and the space loss of the first broadcast signal includes: according to the formula D1=10^ ((Losdb1-32.45-20×log10(F1))/20) is calculated to obtain the first distance, where Losdb1 is the space loss of the first broadcast signal, F1 is the carrier frequency of the first broadcast signal, D1 is the first distance. Through the above technical solution, the first distance is calculated according to the formula D1=10^((Losdb1-32.45-20×log10(F1))/20).
在一种实现方式中,所述扫描并接收第二音频接收装置发送的第二广播信号,并根据所述第二广播信号携带的发射功率确定所述第二广播信号的空间损耗包括:获取所述第二广播信号的发射功率;获取所述第二广播信号的接收功率;计算所述第二广播信号的发射功率及所述第二广播信号的接收功率确定所述第二广播信号的空间损耗。通过上述技术方案,通过计算第二广播信号的发射功率及第二广播信号的接收功率确定第二广播信号的空间损耗。In an implementation manner, the scanning and receiving the second broadcast signal sent by the second audio receiving apparatus, and determining the space loss of the second broadcast signal according to the transmit power carried by the second broadcast signal includes: acquiring the transmit power of the second broadcast signal; obtain the receive power of the second broadcast signal; calculate the transmit power of the second broadcast signal and the receive power of the second broadcast signal to determine the space loss of the second broadcast signal . Through the above technical solution, the space loss of the second broadcast signal is determined by calculating the transmit power of the second broadcast signal and the received power of the second broadcast signal.
在一种实现方式中,所述根据所述第二广播信号的载波频率及空间损耗计算所述音频发送装置与所述第二音频接收装置之间的第二距离包括:根据公式D2=10^((Losdb2-32.45-20×log10(F2))/20)计算得到所述第二距离,其中,Losdb2为所述第二广播信号的空间损耗,F2为所述第二广播信号的载波频率,D2为所述第二距离。通过上述技术方案,所述第二距离根据公式D2=10^((Losdb2-32.45-20×log10(F2))/20)计算得到。In an implementation manner, the calculating the second distance between the audio sending device and the second audio receiving device according to the carrier frequency and the space loss of the second broadcast signal includes: according to the formula D2=10^ ((Losdb2-32.45-20×log10(F2))/20) to calculate the second distance, where Losdb2 is the space loss of the second broadcast signal, F2 is the carrier frequency of the second broadcast signal, D2 is the second distance. Through the above technical solution, the second distance is calculated according to the formula D2=10^((Losdb2-32.45-20×log10(F2))/20).
在一种实现方式中,所述根据所述第一距离及所述第二距离计算出声音数字信号调节比例系数包括:根据公式A=20log10(D1/D2)计算出声音模拟信号调节比例系数,其中D1为所述第一距离,D2为所述第二距离,A为所述声音模拟信号调节比例系数;根据公式K=10^(A/20)计算出声音数字信号调节比例系数,其中K为所述声音数字信号调节比例系数。通过上述技术方案,所述声音数字信号调节比例系数根据公式A=20log10(D1/D2)及公式K=10^(A/20)计算得到。In an implementation manner, the calculating the sound digital signal adjustment proportional coefficient according to the first distance and the second distance includes: calculating the sound analog signal adjustment proportional coefficient according to the formula A=20log10(D1/D2), Wherein D1 is the first distance, D2 is the second distance, A is the sound analog signal adjustment proportional coefficient; According to the formula K=10^(A/20), the sound digital signal adjustment proportional coefficient is calculated, wherein K A scaling factor is adjusted for the audio digital signal. Through the above technical solution, the digital sound signal adjustment scale factor is calculated according to the formula A=20log10(D1/D2) and the formula K=10^(A/20).
第五方面,本申请实施例提供一种立体声实现方法,所述方法包括:音频发送装置向第一音频接收装置发送携带发射功率的第三广播信号,及向第二音频接收装置发送携带发射功率的第四广播信号;所述第一音频接收装置扫描并接收所述第三广播信号,并根据所述第三广播信号携带的发射功率确定所述第三广播信号的空间损耗;所述第一音频接收装置获取所述第三广播信号的载波频率,根据所述第三广播信号的载波频率及所述第三广播信号的空间损耗计算所述第一音频接收装置与所述音频发送装置之间的第三距离,并向所述第二音频接收装置发送所述第三距离;所述第二音频接收装置扫描并接收所述第四广播信号,并根据所述第四广播信号携带的发射功率确定所述第四广播信号的空间损耗;所述第二音频接收装置获取所述第四广播信号的载波频率,根据所述第四广播信号的载波频率及所述第四广播信号的空间损耗计算所述第二音频接收装置与所述音频发送装置之间的第四距离;所述第二音频接收装置根据所述第三距离及所述第四距离计算出声音数字信号调节比例系数;所述音频发送装置获取PCM音频数据,将PCM音频数据分流成第一流数据及第二流数据,并将所述第一流数据发送给所述第一音频接收装置,将所述第二流数据发送给所述第二音频接收装置;所述第一音频接收装置响应接收到的所述第一流数据,播放所述第一流数据;所述第二音频接收装置响应接收到的所述第二流数据,根据所述声音数字信号调节比例系数调节第二流数据的音量,并播放音量调节后的第二流数据。本申请中第二音频接收装置接收音频发送装置发送的PCM音频数据的第二流数据,并根据声音数字信号调节比例系数调节第二流数据的音量,并播放音量调节后的第一流数据,第一音频接收装置播放音频发送装置发送的PCM音频数据的第一流数据,如此音量调节后的第二流数据与第一流数据之间存在差异,使得第一音频接收装置在播放第一流数据及第二音频接收装置在播放第二流数据时产生空间立体声效果。In a fifth aspect, an embodiment of the present application provides a stereo implementation method, the method comprising: an audio sending device sending a third broadcast signal carrying transmit power to a first audio receiving device, and sending a third broadcast signal carrying transmit power to a second audio receiving device the fourth broadcast signal; the first audio receiving device scans and receives the third broadcast signal, and determines the space loss of the third broadcast signal according to the transmit power carried by the third broadcast signal; the first The audio receiving device obtains the carrier frequency of the third broadcast signal, and calculates the distance between the first audio receiving device and the audio transmitting device according to the carrier frequency of the third broadcast signal and the space loss of the third broadcast signal and send the third distance to the second audio receiving device; the second audio receiving device scans and receives the fourth broadcast signal, and transmits the third distance according to the transmission power carried by the fourth broadcast signal determining the space loss of the fourth broadcast signal; the second audio receiving device obtains the carrier frequency of the fourth broadcast signal, and calculates according to the carrier frequency of the fourth broadcast signal and the space loss of the fourth broadcast signal a fourth distance between the second audio receiving device and the audio transmitting device; the second audio receiving device calculates a sound digital signal adjustment scale factor according to the third distance and the fourth distance; the The audio sending device acquires PCM audio data, divides the PCM audio data into first stream data and second stream data, sends the first stream data to the first audio receiving device, and sends the second stream data to the The second audio receiving device; the first audio receiving device plays the first stream data in response to the received first stream data; the second audio receiving device responds to the received second stream data, according to The sound digital signal adjusts the proportional coefficient to adjust the volume of the second stream data, and plays the volume-adjusted second stream data. In this application, the second audio receiving device receives the second stream data of the PCM audio data sent by the audio transmitting device, adjusts the volume of the second stream data according to the sound digital signal adjustment scale factor, and plays the volume-adjusted first stream data, An audio receiving device plays the first stream data of the PCM audio data sent by the audio transmitting device, so that there is a difference between the second stream data after volume adjustment and the first stream data, so that the first audio receiving device is playing the first stream data and the second stream data. The audio receiving device generates a spatial stereo effect when playing the second stream data.
在一种实现方式中,所述第一音频接收装置扫描并接收所述第三广播信号,并根据所述第三广播信号携带的发射功率确定所述第三广播信号的空间损耗包括:获取所述第三广播信号的发射功率;获取所述第三广播信号的接收功率;计算所述第三广播信号的发射功率及所述第三广播信号的接收功率的差值得到所述第三广播信号的空间损耗。通过上述技术方案,通过计算第三广播信号的发射功率及第三广播信号的接收功率的差值得到第三广播信号的空间损耗。In an implementation manner, the first audio receiving apparatus scans and receives the third broadcast signal, and determines the space loss of the third broadcast signal according to the transmit power carried by the third broadcast signal includes: obtaining the the transmit power of the third broadcast signal; obtain the receive power of the third broadcast signal; calculate the difference between the transmit power of the third broadcast signal and the receive power of the third broadcast signal to obtain the third broadcast signal space loss. Through the above technical solution, the space loss of the third broadcast signal is obtained by calculating the difference between the transmit power of the third broadcast signal and the received power of the third broadcast signal.
在一种实现方式中,所述根据所述第三广播信号的载波频率及所述第三广播信号的空间损耗计算所述第一音频接收装置与所述音频发送装置之间的第三距离包括:根据公式D3=10^((Losdb3-32.45-20×log10(F3))/20)计算得到所述第三距离,其中,Losdb3为所述第三广播信号的空间损耗,F3为所述第三广播信号的载波频率,D3为所述第三距离。通过上述技术方案,所述第三距离根据公式D3=10^((Losdb3-32.45-20×log10(F3))/20)计算得到。In an implementation manner, the calculating the third distance between the first audio receiving device and the audio transmitting device according to the carrier frequency of the third broadcast signal and the space loss of the third broadcast signal includes: : Calculate the third distance according to the formula D3=10^((Losdb3-32.45-20×log10(F3))/20), where Losdb3 is the space loss of the third broadcast signal, and F3 is the third distance The carrier frequency of the three broadcast signals, and D3 is the third distance. Through the above technical solution, the third distance is calculated according to the formula D3=10^((Losdb3-32.45-20×log10(F3))/20).
在一种实现方式中,所述第二音频接收装置扫描并接收所述第四广播信号,并根据所述第四广播信号携带的发射功率确定所述第四广播信号的空间损耗包括:获取所述第四广播信号的发射功率;获取所述第四广播信号的接收功率;计算所述第四广播信号的发射功率及所述第四广播信号的接收功率确定所述第四广播信号的空间损耗。通过上述技术方案,通过计算第四广播信号的发射功率及第四广播信号的接收功率确定第四广播信号的空间损耗。In an implementation manner, the second audio receiving apparatus scans and receives the fourth broadcast signal, and determines the space loss of the fourth broadcast signal according to the transmit power carried by the fourth broadcast signal includes: acquiring the transmit power of the fourth broadcast signal; obtain the receive power of the fourth broadcast signal; calculate the transmit power of the fourth broadcast signal and the receive power of the fourth broadcast signal to determine the space loss of the fourth broadcast signal . Through the above technical solution, the space loss of the fourth broadcast signal is determined by calculating the transmit power of the fourth broadcast signal and the receive power of the fourth broadcast signal.
在一种实现方式中,所述根据所述第四广播信号的载波频率及所述第四广播信号的空间损耗计算所述第二音频接收装置与所述音频发送装置之间的第四距离包括:根据公式D4=10^((Losdb4-32.45-20×log10(F4))/20)计算得到所述第四距离,其中,Losdb4为所述第四广播信号的空间损耗,F4为所述第四广播信号的载波频率,D4为所述第四距离。通过上述技术方案,所述第四距离根据公式D4=10^((Losdb4-32.45-20×log10(F4))/20)计算得到。In an implementation manner, the calculating the fourth distance between the second audio receiving device and the audio transmitting device according to the carrier frequency of the fourth broadcast signal and the space loss of the fourth broadcast signal includes: : Calculate the fourth distance according to the formula D4=10^((Losdb4-32.45-20×log10(F4))/20), where Losdb4 is the space loss of the fourth broadcast signal, and F4 is the first Four carrier frequencies of broadcast signals, D4 is the fourth distance. Through the above technical solution, the fourth distance is calculated according to the formula D4=10^((Losdb4-32.45-20×log10(F4))/20).
在一种实现方式中,所述第二音频接收装置根据所述第三距离及所述第四距离计算出声音数字信号调节比例系数包括:根据公式A=20log10(D3/D4)计算出声音模拟信号调节比例系数,其中D3为所述第三距离,D4为所述第四距离,A为所述声音模拟信号调节比例系数;根据公式K=10^(A/20)计算出声音数字信号调节比例系数,其中K为所述声音数字信号调节比例系数。通过上述技术方案,所述声音数字信号调节比例系数根据公式A=20log10(D1/D2)及公式K=10^(A/20)计算得到。In one implementation, the second audio receiving device calculating the sound digital signal adjustment proportional coefficient according to the third distance and the fourth distance includes: calculating the sound analog signal according to the formula A=20log10(D3/D4) Signal adjustment proportional coefficient, wherein D3 is the third distance, D4 is the fourth distance, A is the sound analog signal adjustment proportional coefficient; According to the formula K=10^(A/20), the sound digital signal adjustment is calculated scale factor, where K is the scale factor for adjusting the sound digital signal. Through the above technical solution, the digital sound signal adjustment scale factor is calculated according to the formula A=20log10(D1/D2) and the formula K=10^(A/20).
第五方面,本申请的一些实施例提供一种电子设备,电子设备包括存储器和处理器:其中,存储器,用于存储程序指令;处理器,用于读取并执行存储器中存储的程序指令,当程序指令被处理器执行时,使得电子设备执行上述立体声实现方法。In a fifth aspect, some embodiments of the present application provide an electronic device, the electronic device includes a memory and a processor: the memory is used for storing program instructions; the processor is used for reading and executing the program instructions stored in the memory, When the program instructions are executed by the processor, the electronic device is caused to execute the above-mentioned stereo realization method.
第六方面,本申请实施例提供一种计算机存储介质,计算机存储介质存储有程序指令,当程序指令在电子设备上运行时,使得电子设备执行上述立体声实现方法。In a sixth aspect, an embodiment of the present application provides a computer storage medium, where a program instruction is stored in the computer storage medium, and when the program instruction is executed on an electronic device, the electronic device is made to execute the above stereo implementation method.
另外,第五方面至第六方面所带来的技术效果可参见上述方法部分各设计的方法相关的描述,此处不再赘述。In addition, for the technical effects brought by the fifth to sixth aspects, reference may be made to the descriptions related to the methods designed in the above method section, and details are not repeated here.
附图说明Description of drawings
图1为本申请一实施例提供的立体声实现系统的架构图。FIG. 1 is an architectural diagram of a stereo implementation system provided by an embodiment of the present application.
图2为本申请一实施例提供的立体声实现方法的流程图。FIG. 2 is a flowchart of a stereo implementation method provided by an embodiment of the present application.
图3为获取脉冲编码调制音频数据的界面操作图。FIG. 3 is an interface operation diagram for acquiring PCM audio data.
图4为本申请一实施例提供的音频发送装置的结构框架图。FIG. 4 is a structural frame diagram of an audio transmission apparatus provided by an embodiment of the present application.
图5为本申请又一实施例提供的立体声实现方法的流程图。FIG. 5 is a flowchart of a stereo implementation method provided by another embodiment of the present application.
图6为本申请又一实施例提供的音频发送装置的结构框架图。FIG. 6 is a structural frame diagram of an audio sending apparatus provided by another embodiment of the present application.
图7为本申请又一实施例提供的蓝牙协议栈接口模块的结构框架图。FIG. 7 is a structural frame diagram of a Bluetooth protocol stack interface module provided by another embodiment of the present application.
图8为本申请又一实施例提供的立体声实现方法的流程图。FIG. 8 is a flowchart of a stereo implementation method provided by yet another embodiment of the present application.
图9为本申请一实施例提供的立体声实现系统的应用环境图。FIG. 9 is an application environment diagram of a stereo implementation system provided by an embodiment of the present application.
图10为本申请实施例提供的电子设备的架构图。FIG. 10 is a structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本申请实施例的描述中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。Hereinafter, the terms "first" and "second" are only used for descriptive purposes, and should not be construed as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may expressly or implicitly include one or more of that feature. In the description of the embodiments of the present application, words such as "exemplary" or "for example" are used to mean serving as an example, illustration or illustration. Any embodiments or designs described in the embodiments of the present application as "exemplary" or "such as" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present the related concepts in a specific manner.
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请中的技术领域的技术人员通常理解的含义相同。本申请的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本申请。应理解,本申请中除非另有说明,“/”表示或的意思。例如,A/B可以表示A或B。本申请中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系。例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B三种情况。“至少一个”是指一个或者多个。“多个”是指两个或多于两个。例如,a、b或c中的至少一个,可以表示:a,b,c,a和b,a和c,b和c,a、b和c七种情况。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field in this application. Terms used in the specification of the present application are for the purpose of describing specific embodiments only, and are not intended to limit the present application. It should be understood that unless otherwise specified in this application, "/" means or means. For example, A/B can mean A or B. In this application, "and/or" is only an association relationship to describe associated objects, which means that there can be three kinds of relationships. For example, A and/or B can mean that A exists alone, A and B exist at the same time, and B exists alone. "At least one" means one or more. "Plural" means two or more. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c, a, b and c seven situations.
参考图1所示,为本申请一实施例提供的立体声实现系统10的架构图。所述立体声实现系统10包括音频发送装置1及两个音频接收装置。以下为描述方便,将两个音频接收装置分别描述为第一音频接收装置21及第二音频接收装置22。音频发送装置1分别与第一音频接收装置21及第二音频接收装置22通信连接。在一实施例中,音频发送装置1与第一音频接收装置21以及第一音频接收装置22之间的通信连接可以是常见的短距离连接方式,例如蓝牙、Wi-Fi等。音频发送装置1用于向第一音频接收装置21及第二音频接收装置22发送音频数据,第一音频接收装置21及第二音频接收装置22分别播放接收的音频数据以实现音频数据的立体声播放。本申请的一些实施例中的立体声可以是指使用两个或者多个独立的音效通道,在一对以对称方式配置的设备上出现,例如,在一些实施例中,第一音频接收装置21播放左声道音频数据,第二音频接收装置22播放右声道音频数据。本申请中所述的音频接收装置可以是一对的方式出现,例如,常见的TWS耳机,左右耳机之间有数据传输;在一些实施例中音频接收装置也可以是独立出现,例如音箱等。以下结合图2所示的立体声实现方法具体描述本申请的立体声实现系统10。所述立体声实现方法具体包括如下步骤。Referring to FIG. 1 , it is an architectural diagram of a
步骤S201,获取脉冲编码调制(Pulse Code Modulation,PCM)音频数据。Step S201, acquiring pulse code modulation (Pulse Code Modulation, PCM) audio data.
本实施例中,获取PCM音频数据包括:音频发送装置1响应用户播放音频文件的操作,获取音频文件中的PCM音频数据。In this embodiment, acquiring the PCM audio data includes: the audio sending
以下以手机为音频发送装置1,第一音箱为第一音频接收装置21,第二音箱为第二音频接收装置22介绍本申请实施例提供的立体声实现方法。参考图3,手机上显示音乐播放应用程序的用户界面,手机接收用户点击音乐播放应用或视频播放应用的用户界面上的播放按键的操作,手机执行打开音频文件的操作,并获取音频文件中的所述PCM音频数据。Hereinafter, a mobile phone is used as the
步骤S202,分别获取第一音频接收装置21的音量调节模式及第二音频接收装置22的音量调节模式。Step S202 , respectively acquiring the volume adjustment mode of the first
本实施例中,音频发送装置1与第一音频接收装置21通信连接后,从第一音频接收装置21中获取第一音频接收装置21的音量调节模式;音频发送装置1与第二音频接收装置22通信连接后,从第二音频接收装置22中获取第二音频接收装置22的音量调节模式。本实施例中,音量调节类型包括绝对音量调节模式及非绝对音量调节模式。绝对音量调节模式是指音频接收装置和音频发送装置1连接播放音频文件时音频接收装置的音量和音频发送装置1的音量同步,也就是在绝对音量调节模式下,当在音频发送装置1上调节音量时,音频接收装置的音量也被同步调节。非绝对音量调节模式是指音频接收装置和音频发送装置1连接播放音频文件时音频接收装置的音量和音频发送装置1的音量不同步,也就是在非绝对音量调节模式下,在音频发送装置1上调节音量及在音频接收装置上调节音量是相互独立的。In this embodiment, after the
步骤S203,判断第一音频接收装置21的音量调节模式与第二音频接收装置22的音量调节模式是否相同。若第一音频接收装置21的音量调节模式与第二音频接收装置22的音量调节模式不相同,执行步骤S204,若第一音频接收装置21的音量调节模式与第二音频接收装置22的音量调节模式相同,执行步骤S205。Step S203 , determine whether the volume adjustment mode of the first
步骤S204,将第一音频接收装置21的音量调节模式由绝对音量调节模式切换为非绝对音量调节模式,或将第二音频接收装置22的音量调节模式由绝对音量调节模式切换为非绝对音量调节模式。通过第一音频接收装置21或第二音频接收装置22对音量调节类型的切换,实现二者的音量调节模式达成一致。Step S204, switching the volume adjustment mode of the first
步骤S205,对PCM音频数据进行编码。Step S205, encoding the PCM audio data.
步骤S206,将编码后的PCM音频数据分流成第一流数据及第二流数据。Step S206, splitting the encoded PCM audio data into first stream data and second stream data.
步骤S207,将第一流数据发送给第一音频接收装置21以使第一音频接收装置21播放第一流数据,及将第二流数据发送给第二音频接收装置22以使第二音频接收装置22播放第二流数据。Step S207, sending the first stream data to the first
参考图4所示,为本申请一实施例提供的音频发送装置1的结构框架图。音频发送装置1包括音频播放应用11、音频框架模块12、音频处理模块13、音频调节模块14、音频硬件抽象层模块15、蓝牙协议栈硬件抽象层模块16、蓝牙协议栈接口模块17、蓝牙协议栈应用层模块18、蓝牙协议栈模块19。本实施例中,音频播放应用11与音频框架模块12连接。参考图3,音频播放应用11用于接收用户点击音乐播放应用或视频播放应用的用户界面上的播放按键的操作,执行打开音频文件的操作,并获取音频文件中的所述PCM音频数据。本实施例中,音频播放应用11包括音乐播放应用或视频播放应用中的至少一种。音频框架模块12用于调用系统函数对PCM音频数据进行处理。所述音频框架模块12与音频处理模块13连接。音频处理模块13用于对PCM音频数据进行音效处理。所述音效处理包括降噪处理、重低音处理、环绕音处理、均衡器处理、混响处理、可视化处理中的至少一种。所述音频调节模块14用于调节PCM音频数据的音量增益。本实施例中,所述音频调节模块14对PCM音频数据进行100%音量增益调节。所述音频调节模块14与音频硬件抽象层模块15连接,所述音频硬件抽象层模块15与蓝牙协议栈硬件抽象层模块16连接,所述蓝牙协议栈硬件抽象层模块16与蓝牙协议栈接口模块17连接。所述音频硬件抽象层模块15将音量增益调节后的PCM音频数据转发给蓝牙协议栈硬件抽象层模块16。所述蓝牙协议栈硬件抽象层模块16将PCM音频数据转发给蓝牙协议栈接口模块17。所述蓝牙协议栈接口模块17与蓝牙协议栈应用层模块18连接,所述蓝牙协议栈应用层模块18判断第一音频接收装置21的音量调节模式与第二音频接收装置22的音量调节模式是否相同,并在第一音频接收装置21的音量调节模式与第二音频接收装置22的音量调节模式不相同时,将第一音频接收装置21的音量调节模式由绝对音量调节模式切换为非绝对音量调节模式,或将第二音频接收装置22的音量调节模式由绝对音量调节模式切换为非绝对音量调节模式。所述蓝牙协议栈应用层模块18与蓝牙协议栈模块19连接。所述蓝牙协议栈模块19包括编码模块191、分流模块192及蓝牙协议栈线程模块193。编码模块191用于对PCM音频数据进行编码。分流模块192用于将编码后的PCM音频数据分流成第一流数据及第二流数据。蓝牙协议栈线程模块193将第一流数据发送给第一音频接收装置21以使第一音频接收装置21播放第一流数据,并将第二流数据发送给第二音频接收装置22以使第二音频接收装置22播放第二流数据。本实施例中,所述编码模块191采用子带编码(subband codec,SBC)方法对音量调节后的第一流数据及第二流数据进行编码。Referring to FIG. 4 , it is a structural frame diagram of an
本实施例中,当第一音频接收装置21的音量调节模式与第二音频接收装置22的音量调节模式不相同时,将第一音频接收装置21的音量调节模式由绝对音量调节模式切换为非绝对音量调节模式,使得第一音频接收装置21在播放第一流数据时的音量会突然变得很大;或者当第一音频接收装置21的音量调节模式与第二音频接收装置22的音量调节模式不相同时,将第二音频接收装置22的音量调节模式由绝对音量调节模式切换为非绝对音量调节模式,第一音频接收装置21在播放第一流数据时的音量会突然变得很小,造成音效的突变。此外,由于PCM音频数据来源于音源文件,当音源文件有左右耳声道数据,才能播放出立体声效果。但是业界绝大多数音源文件均为单声道声音文件,播放单声道声音文件的PCM音频数据时无法获得空间立体声的效果体验。为此友商在第一音频接收装置21及第二音频接收装置22(如蓝牙耳机)侧新增了陀螺仪用于检测人头部的转动,估计转动的幅度调节左右耳的音量与调节低频,模拟空间立体声效果。本申请实施例在耳机不新增陀螺仪等物理的前提下也能实现类似播放效果。参照图5所示,为本申请另一实施例提供的立体声实现方法的流程图,具体包括如下步骤。In this embodiment, when the volume adjustment mode of the first
步骤S501,第一音频接收装置21向音频发送装置1发送携带发射功率的第一广播信号。Step S501 , the first
以下同样以手机为音频发送装置1,第一音箱为第一音频接收装置21,第二音箱为第二音频接收装置22介绍本申请实施例提供的立体声实现方法。Hereinafter, a mobile phone is also used as the
本实施例中,第一音频接收装置21检测到与音频发送装置1建立蓝牙连接后,每隔第一预设时间向音频发送装置1发送携带有发射功率的第一广播信号。例如,第一音箱检测到与手机建立蓝牙连接后,每隔第一预设时间向手机发送携带有发射功率的第一广播信号。在一些实施例中,第一广播信号可以是蓝牙低能耗(Bluetooth Low Energy,BLE)信号。例如,第一音箱检测到与手机建立蓝牙连接后,每隔第一预设时间向手机发送发射功率为100mw的蓝牙低能耗信号。In this embodiment, after detecting that a Bluetooth connection is established with the
步骤S502,音频发送装置1扫描并接收第一广播信号,并根据第一广播信号携带的发射功率确定第一广播信号的空间损耗。Step S502, the
本实施例中,音频发送装置1扫描并接收第一广播信号,并根据第一广播信号携带的发射功率确定第一广播信号的空间损耗包括:获取第一广播信号的发射功率;获取第一广播信号的接收功率;根据第一广播信号的发射功率及接收功率确定第一广播信号的空间损耗。In this embodiment, the
例如,手机扫描到第一音箱发送的第一广播信号后,接收第一广播信号并获取接收的第一广播信号的信号强度。手机根据接收的第一广播信号的信号强度,确定第一广播信号的接收功率,并从第一广播信号中获取第一广播信号所携带的发射功率。手机计算第一广播信号的发射功率及接收功率的差值得到第一广播信号的空间损耗。For example, after scanning the first broadcast signal sent by the first speaker, the mobile phone receives the first broadcast signal and obtains the signal strength of the received first broadcast signal. The mobile phone determines the reception power of the first broadcast signal according to the received signal strength of the first broadcast signal, and obtains the transmit power carried by the first broadcast signal from the first broadcast signal. The mobile phone calculates the difference between the transmit power and the receive power of the first broadcast signal to obtain the space loss of the first broadcast signal.
步骤S503,音频发送装置1获取第一广播信号的载波频率,根据第一广播信号的载波频率及空间损耗计算音频发送装置1与第一音频接收装置21之间的第一距离。Step S503 , the
本实施例中,根据第一广播信号的载波频率及空间损耗计算音频发送装置1与第一音频接收装置21的第一距离包括:将第一广播信号的载波频率及空间损耗代入公式D1=10^((Losdb1-32.45-20×log10(F1))/20)计算得到音频发送装置1与第一音频接收装置21的第一距离,其中,Losdb1为第一广播信号的空间损耗,F1为第一广播信号的载波频率,D1为第一距离。本实施例中,第一广播信号的载波频率为2.4GHz。In this embodiment, calculating the first distance between the
本实施例中,音频发送装置1接收到一个第一广播信号后,根据所述第一广播信号的载波频率及空间损耗计算得到与所述第一广播信号对应的第一距离。在本申请的另一实施例中,音频发送装置1从第一音频接收装置21接收预设数量的第一广播信号,计算出与每一第一广播信号对应的第一距离得到预设数量的第一距离,计算出预设数量的第一距离的距离均值,并将所述距离均值作为音频发送装置1与第一音频接收装置21之间的第一距离。本实施例中,第一音频接收装置21每间隔第一预设时间发送第一广播信号,音频发送装置1在第二时间段内接收的预设数量的第一广播信号中的每一第一广播信号对应一个时间点。所述音频发送装置1在计算预设数量的第一距离的第一距离均值时,将时间点超过预设时间段所对应的广播信号丢弃,以避免时效老化的第一广播信号对第一距离均值的影响。本实施方式中,所述音频发送装置1还用于计算预设数量的第一距离的第一距离方差,并从预设数量的第一距离中确定出与第一距离方差的差值超过预设阈值的第一距离所对应的第一广播信号,并在计算预设数量的第一距离的第一距离均值时,丢弃与第一距离方差的差值超过预设阈值的第一距离所对应的第一广播信号,避免第一广播信号在空间传输时遇到偶发干扰源的干扰对第一距离均值的影响。In this embodiment, after receiving a first broadcast signal, the
发明人通过研究发现,当音频发送装置1与第一音频接收装置21之间隔着人体时,若音频发送装置1与第一音频接收装置21相距2米以内,第一广播信号的衰减在3db,根据第一广播信号所计算出的第一距离的误差在3厘米。若音频发送装置1与第一音频接收装置21相距2米以上,人体对第一广播信号的影响会更小,根据第一广播信号所计算出的第一距离的误差会比3厘米更小。The inventor found through research that when the human body is separated from the
步骤S504,第二音频接收装置22向音频发送装置1发送携带发射功率的第二广播信号。Step S504 , the second
本实施例中,所述第二音频接收装置22向音频发送装置1发送携带发射功率的第二广播信号包括:第二音频接收装置22与音频发送装置1建立连接后,每隔第一预设时间向音频发送装置1发送携带发射功率的第二广播信号。例如,第二音箱在与手机建立蓝牙连接后,每隔第一预设时间向手机发送携带发射功率的第二广播信号。In this embodiment, the second
步骤S505,音频发送装置1扫描并接收第二广播信号,并根据第二广播信号携带的发射功率确定第二广播信号的空间损耗。Step S505, the
本实施例中,音频发送装置1扫描到第二音箱发送的第二广播信号后接收第二广播信号;获取第二广播信号的发射功率;获取第二广播信号的接收功率;根据第二广播信号的发射功率及接收功率确定第二广播信号的空间损耗。例如,手机扫描到第二音箱发送的第二广播信号后接收第二广播信号并获取接收的第二广播信号的信号强度。手机根据接收的第二广播信号的信后强度确定第二广播信号的接收功率,并从第二广播信号中获取第二广播信号所携带的发射功率。手机计算第二广播信号的发射功率及接收功率的差值后得到第二广播信号的空间损耗。In this embodiment, the
步骤S506,音频发送装置1获取第二广播信号的载波频率,根据第二广播信号的载波频率及空间损耗计算音频发送装置1与第二音频接收装置22的第二距离。Step S506 , the
本实施例中,音频发送装置1将第二广播信号的载波频率及空间损耗代入公式D2=10^((Losdb2-32.45-20×log10(F2))/20)计算得到音频发送装置1与第二音频接收装置22的第二距离,其中,Losdb2为第二广播信号的空间损耗,F2为第二广播信号的载波频率,D2为第二距离。In this embodiment, the
本实施例中,音频发送装置1接收到一个第二广播信号后,根据所述第二广播信号的载波频率及空间损耗,计算得到与所述第二广播信号对应的第二距离。在本申请的另一实施例中,音频发送装置1从第二音频接收装置22接收预设数量的第二广播信号,计算出与每一第二广播信号对应的第二距离得到预设数量的第二距离,计算出预设数量的第二距离的第二距离均值,并将所述第二距离均值作为音频发送装置1与第二音频接收装置22之间的第二距离。本实施例中,第二音频接收装置22每间隔第一预设时间发送的第二广播信号,音频发送装置1在第二时间段内接收的预设数量的第二广播信号中的每一第二广播信号对应一个时间点。所述音频发送装置1在计算预设数量的第二距离的第二距离均值时,将时间点超过预设时间段所对应的广播信号丢弃,以避免时效老化的第二广播信号对第二距离均值的影响。本实施方式中,所述音频发送装置1还用于计算预设数量的第二距离的第二距离方差,并从预设数量的第二距离中确定出与第二距离方差的差值超过预设阈值的第二距离所对应的第二广播信号,并在计算预设数量的第二距离的第二距离均值时,丢弃与第二距离方差的差值超过预设阈值的第二距离所对应的第一广播信号,避免第二广播信号在空间传输时遇到偶发干扰源的干扰对第二距离均值的影响。In this embodiment, after receiving a second broadcast signal, the
步骤S507,音频发送装置1根据第一距离及第二距离计算出声音数字信号调节比例系数。In step S507, the
本实施例中,音频发送装置1根据第一距离及第二距离计算出声音数字信号调节比例系数包括:将第一距离及第二距离代入公式A=20log10(D1/D2)计算出声音模拟信号调节比例系数,其中,D1为第一距离,D2为第二距离,A为声音模拟信号调节比例系数;将声音模拟信号调节比例系数代入公式K=10^(A/20)计算出声音数字信号调节比例系数,其中K为声音数字信号调节比例系数。In this embodiment, the
步骤S508,音频发送装置1获取PCM音频数据,将PCM音频数据分流成第一流数据及第二流数据,根据声音数字信号调节比例系数调节第一流数据的音量得到音量调节后的第一流数据。Step S508, the
本实施例中,音频发送装置1获取PCM音频数据,将PCM音频数据分流成第一流数据及第二流数据包括:音频发送装置1响应用户播放音频文件的操作,打开并获取音频文件中的所述PCM音频数据,并将音频文件中的所述PCM音频数据分流成第一流数据及第二流数据。例如,参考图3,手机上显示音乐播放应用或视频播放应用的用户界面,用户点击音乐播放应用或视频播放应用的用户界面上的播放按键,手机执行打开音频文件的操作,并获取音频文件中的所述PCM音频数据,并将所述PCM音频数据分流成第一流数据及第二流数据。In this embodiment, the
例如,手机将PCM音频数据“aAbBcCdD”分流成第一流数据“abcd”及第二流数据“ABCD”,根据声音数字信号调节比例系数调节第一流数据“abcd”的音量,将调节的第一流数据“abcd”发送给第一音箱及将第二流数据“ABCD”发送给第二音箱,或者将调节的第一流数据“abcd”发送给第二音箱及将第二流数据“ABCD”发送给第一音箱。本实施例中,根据声音数字信号调节比例系数调节第一流数据的音量包括:将第一流数据的音量与声音数字信号调节比例系数进行相乘运算后,得到调节的第一流数据。For example, the mobile phone divides the PCM audio data "aAbBcCdD" into the first stream data "abcd" and the second stream data "ABCD", and adjusts the volume of the first stream data "abcd" by adjusting the scale factor according to the sound digital signal. "abcd" is sent to the first speaker and the second stream data "ABCD" is sent to the second speaker, or the adjusted first stream data "abcd" is sent to the second speaker and the second stream data "ABCD" is sent to the second speaker a speaker. In this embodiment, adjusting the volume of the first stream data according to the scaling factor of the digital sound signal includes: after multiplying the volume of the first stream data by the scaling factor of the digital sound signal adjustment, the adjusted first stream data is obtained.
步骤S509,音频发送装置1将音量调节后的第一流数据发送给第一音频接收装置21。Step S509 , the
步骤S510,音频发送装置1将第二流数据发送给第二音频接收装置22。Step S510 , the
步骤S511,响应接收到的音量调节后的第一流数据,第一音频接收装置21播放音量调节后的第一流数据。Step S511, in response to the received volume-adjusted first stream data, the first
步骤S512,响应接收到的第二流数据,第二音频接收装置22播放第二流数据。Step S512, in response to the received second stream data, the second
参考图6,所示为本申请另一实施例提供的音频发送装置1的结构框架图。图6中的音频发送装置1的结构框图与图3中的音频发送装置1的结构框架大致相同。不同之处在于,所述蓝牙协议栈接口模块17对所述PCM音频数据进行分流得到第一流数据及第二流数据。所述蓝牙协议栈接口模块17根据声音数字信号调节比例系数调节第一流数据的音量。所述蓝牙协议栈接口模块17将音量调节后的第一流数据及第二流数据合并成音量调节后的PCM音频数据,并将音量调节后的PCM音频数据传送给蓝牙协议栈应用层模块18。所述蓝牙协议栈应用层模块18与蓝牙协议栈模块19连接,用于将音量调节后的PCM音频数据传送给所述蓝牙协议栈模块19。所述蓝牙协议栈模块19对音量调节后的PCM音频数据按照预设编码方法进行编码,并将编码后的PCM音频数据中的第一流数据发送给第一音频接收装置21,将编码后的PCM音频数据中的第二流数据发送给第二音频接收装置22。本实施例中,预设编码方法位子带编码方法。也即,所述蓝牙协议栈模块19采用子带编码方法对音量调节后的PCM音频数据进行编码得到编码后的PCM音频数据。Referring to FIG. 6 , a structural frame diagram of an
本申请中音频发送装置1根据音频发送装置1与音频接收装置之间的距离计算出声音数字信号调节比例系数,并根据声音数字信号调节比例系数调节第一流数据的音量,将音量调节后的第一流数据发送给第一音频接收装置21,将第二流数据发送给第二音频接收装置22。如此,音量调节后的第一流数据与第二流数据之间存在差异,使得第一音频接收装置21在播放第一流数据及第二音频接收装置22在播放第二流数据时产生空间立体声效果。In the present application, the
参考图7,所示为本申请另一实施例提供的蓝牙协议栈接口模块17的结构框架图。图7中的音频发送装置1的结构框图与图6中的音频发送装置1的结构框架大致相同。不同之处在于,所述蓝牙协议栈接口模块17分别判断第一音频接收装置21的音量调节模式及第二音频接收装置21的音量调节模式是否是绝对音量调节模式。若确定第一音频接收装置21的音量调节模式及第二音频接收装置22的音量调节模式为绝对音量调节模式,根据声音数字信号调节比例系数调节第一流数据的音量得到所述音量调节后的第一流数据。若确定第一音频接收装置21的音量调节模式为绝对音量调节模式及第二音频接收装置22的音量调节模式为非绝对音量调节模式,获取音频发送装置1的音量增益,根据声音数字信号调节比例系数调节第一流数据的音量得到所述音量调节后的第一流数据及根据音频发送装置1的音量增益调节第二流数据得到音量调节后的第二流数据。若确定第一音频接收装置21的音量调节模式为非绝对音量调节模式及第二音频接收装置22的音量调节模式为绝对音量调节模式,获取音频发送装置1的音量增益,根据声音数字信号调节比例系数及音频发送装置1的音量增益调节第一流数据的音量得到所述音量调节后的第一流数据;若确定第一音频接收装置21的音量调节模式为非绝对音量调节模式及第二音频接收装置22的音量调节模式为非绝对音量调节模式,获取音频发送装置1的音量增益,根据声音数字信号调节比例系数及音频发送装置1的音量增益调节第一流数据的音量得到所述音量调节后的第一流数据,及根据音频发送装置1的音量增益调节第二流数据的音量得到音量调节后的第二流数据。所述蓝牙协议栈接口模块17将音量调节后的第一流数据、第二流数据或音量调节后的第二流数据合并成PCM音频数据,并将音量调节后的PCM音频数据传送给蓝牙协议栈应用层模块18。本实施例中,根据音频发送装置1的音量增益调节第二流数据包括:将第二流数据的音量与音频发送装置1的音量增益进行相乘运算。本实施例中,根据声音数字信号调节比例系数及音频发送装置1的音量增益调节第一流数据的音量包括:将第一流数据与声音数字信号调节比例系数及音频发送装置1的音量增益进行相乘运算。Referring to FIG. 7 , a structural frame diagram of a Bluetooth protocol
本申请中,若确定第一音频接收装置21的音量调节模式为非绝对音量调节模式,根据声音数字信号调节比例系数及音频发送装置1的音量增益调节第一流数据的音量,使得第一音频接收装置21在播放第一流数据时的音量不会突然变大,从而解决第一音频接收装置21播放第一流数据时音效突变的问题。In this application, if it is determined that the volume adjustment mode of the first
参考图8,所示为本申请又一实施例提供的立体声实现方法的流程图。参考图9,所述音频发送装置1分别与第一音频接收装置21及第二音频接收装置22通信连接。所述第一音频接收装置21与第二音频接收装置22通信连接。所述立体声实现方法具体包括如下步骤。Referring to FIG. 8 , a flowchart of a stereo implementation method provided by yet another embodiment of the present application is shown. Referring to FIG. 9 , the
步骤S801,音频发送装置1向第一音频接收装置21发送携带发射功率的第三广播信号。Step S801 , the
以下以手机为音频发送装置1,真无线立体声(True Wireless Stereo,TWS)耳机的主耳为第一音频接收装置21,TWS耳机的副耳为第二音频接收装置22介绍本申请实施例提供的立体声实现方法。Hereinafter, a mobile phone is used as the
本实施例中,音频发送装置1向第一音频接收装置21发送携带发射功率的第三广播信号包括:音频发送装置1在与第一音频接收装置21建立通信连接后,每隔第三预设时间向第一音频接收装置21发送携带有发射功率的第三广播信号。例如,手机在与TWS耳机的主耳建立蓝牙连接后,每隔第三预设时间向TWS耳机的主耳发送携带有发射功率的第三广播信号。In this embodiment, the
步骤S802,第一音频接收装置21扫描并接收第三广播信号,并根据第三广播信号携带的发射功率确定第三广播信号的空间损耗。Step S802, the first
本实施例中,第一音频接收装置21扫描并接收第三广播信号,并根据第三广播信号携带的发射功率确定第三广播信号的空间损耗包括:第一音频接收装置21扫描到音频发送装置1发送的第三广播信号后接收第三广播信号;获取第三广播信号的发射功率;获取第三广播信号的接收功率;根据第三广播信号的发射功率及接收功率确定第三广播信号的空间损耗。本实施例中,TWS耳机的主耳扫描到手机发送的第三广播信号后接收第三广播信号并获取接收的第三广播信号的信号强度。TWS耳机的主耳根据接收的第三广播信号的信号强度确定第三广播信号的接收功率,并从第三广播信号中获取第三广播信号所携带的发射功率。TWS耳机的主耳计算第三广播信号的发射功率及接收功率的差值后得到第三广播信号的空间损耗。In this embodiment, the first
步骤S803,第一音频接收装置21获取第三广播信号的载波频率,根据第三广播信号的载波频率及空间损耗计算第一音频接收装置21与音频发送装置1之间的第三距离。Step S803 , the first
本实施例中,第一音频接收装置21将第三广播信号的载波频率及空间损耗代入公式D3=10^((Losdb3-32.45-20×log10(F3))/20)计算得到音频发送装置1与第一音频接收装置21的第三距离,其中,Losdb3为第三广播信号的空间损耗,F3为第三广播信号的频率,D3为第三距离。In this embodiment, the first
步骤S804,音频发送装置1向第二音频接收装置22发送携带发射功率的第四广播信号。Step S804 , the
本实施例中,音频发送装置1向第二音频接收装置22发送携带发射功率的第四广播信号包括:音频发送装置1在与第二音频接收装置22建立通信连接后,每隔第三预设时间向第二音频接收装置22发送携带有发射功率的第四广播信号。例如,手机在与TWS耳机的副耳建立蓝牙连接后,每隔第三预设时间向TWS耳机的副耳发送携带有发射功率的第四广播信号。In this embodiment, the
步骤S805,第二音频接收装置22扫描并接收第四广播信号,并根据第四广播信号携带的发射功率确定第四广播信号的空间损耗。Step S805, the second
本实施例中,第二音频接收装置22扫描并接收第四广播信号,并根据第四广播信号携带的发射功率确定第四广播信号的空间损耗包括:第二音频接收装置22扫描到音频发送装置1发送的第四广播信号后接收第四广播信号;获取第四广播信号的发射功率;获取第四广播信号的接收功率;根据第四广播信号的发射功率及接收功率确定第四广播信号的空间损耗。本实施例中,TWS耳机的副耳扫描到手机发送的第四广播信号后接收第四广播信号并获取接收的第四广播信号的信号强度。TWS耳机的副耳根据接收的第四广播信号的信号强度确定第四广播信号的接收功率,并从第四广播信号中获取第四广播信号所携带的发射功率。TWS耳机的副耳计算第四广播信号的发射功率及接收功率的差值后得到第四广播信号的空间损耗。In this embodiment, the second
步骤S806,第二音频接收装置22获取第四广播信号的载波频率,根据第四广播信号的载波频率及空间损耗计算第二音频接收装置22与音频发送装置1之间的第四距离。Step S806 , the second
本实施例中,第二音频接收装置22将第四广播信号的载波频率及空间损耗代入公式D4=10^((Losdb4-32.45-20×log10(F4))/20)计算得到音频发送装置1与第二音频接收装置22的第四距离,其中,Losdb4为第四广播信号的空间损耗,F4为第四广播信号的频率,D4为第四距离。In this embodiment, the second
步骤S807,第一音频接收装置21向第二音频接收装置22发送第三距离。Step S807 , the first
本实施例中,第一音频接收装置21与第二音频接收装置22通过蓝牙低能耗(Bluetooh Low Energy,BLE)协议或串行端口配置文件(Serial Port Profile,SPP)协议进行通信连接。第一音频接收装置21在计算出第三距离后将第三距离发送给第二音频接收装置22。例如,TWS耳机的主耳与副耳建立通信连接并计算得到第三距离后,将第三距离发送给副耳。In this embodiment, the first
步骤S808,第二音频接收装置22根据第三距离及第四距离计算出声音数字信号调节比例系数。In step S808, the second
本实施例中,第二音频接收装置22将第三距离及第四距离代入公式A=20log10(D3/D4)计算出声音模拟信号调节比例系数,其中,D3为第三距离,D4为第四距离,A为声音模拟信号调节比例系数;将声音模拟信号调节比例系数代入公式K=10^(A/20)计算出声音数字信号调节比例系数,其中K为声音数字信号调节比例系数。In this embodiment, the second
步骤S809,音频发送装置1获取PCM音频数据,将PCM音频数据分流成第一流数据及第二流数据,并将第一流数据发送给第一音频接收装置21。本实施例中,所述PCM音频数据为单声道声音文件的音频数据。Step S809 , the
步骤S810,音频发送装置1将第二流数据发送给第二音频接收装置22。Step S810 , the
步骤S811,响应接收到的第一流数据,第一音频接收装置21播放第一流数据。Step S811, in response to the received first stream data, the first
步骤S812,响应接收到的第二流数据,第二音频接收装置22根据声音数字信号调节比例系数调节第二流数据的音量,并播放音量调节后的第二流数据。Step S812, in response to the received second stream data, the second
本实施例中,第一音频接收装置21与第二音频接收装置22的身份位置可互换。例如,第二音频接收装置22将计算得到的第四距离发送给第一音频接收装置21;第一音频接收装置21根据第三距离及第四距离计算出声音数字信号调节比例系数后,根据声音数字信号调节比例系数调节第一流数据,并播放调节后的第一流数据;第二音频接收装置22播放第二流数据。In this embodiment, the identities of the first
本申请中第二音频接收装置22接收音频发送装置1发送的单声道声音文件的第二流数据,并根据声音数字信号调节比例系数调节第二流数据的音量,并播放音量调节后的第一流数据,所述第一音频接收装置22播放音频发送装置1发送的单声道声音文件的第一流数据。如此,音量调节后的第二流数据与第一流数据之间存在差异,使得第一音频接收装置21在播放第一流数据及第二音频接收装置22在播放第二流数据时产生空间立体声效果。In the present application, the second
参考图10所示,为本申请实施例的一种电子设备100的结构示意图。所述立体声实现方法应用在电子设备100中。所述电子设备100可以是手机、平板电脑、桌面型计算机、膝上型计算机、手持计算机、笔记本电脑、超级移动个人计算机(ultra-mobile personalcomputer,UMPC)、上网本,以及蜂窝电话、个人数字助理(personal digital assistant,PDA)、增强现实(augmented reality,AR)设备、虚拟现实(virtual reality,VR)设备、人工智能(artificial intelligence,AI)设备、可穿戴式设备、车载设备、智能家居设备和/或智慧城市设备,本申请实施例对该电子设备100的具体类型不作特殊限制。本实施例中,所述电子设备100包括音频发送装置1。Referring to FIG. 10 , it is a schematic structural diagram of an electronic device 100 according to an embodiment of the present application. The stereo realization method is applied in the electronic device 100 . The electronic device 100 may be a cell phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, as well as a cellular phone, a personal digital assistant ( personal digital assistant (PDA), augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (AI) devices, wearable devices, in-vehicle devices, smart home devices and/or Or a smart city device, and the specific type of the electronic device 100 is not particularly limited in this embodiment of the present application. In this embodiment, the electronic device 100 includes an
电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。The electronic device 100 may include a processor 110, an
可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that, the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or less components than shown, or combine some components, or separate some components, or arrange different components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor ( image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in processor 110 is cache memory. This memory may hold instructions or data that have just been used or recycled by the processor 110 . If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby increasing the efficiency of the system.
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuitsound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purposeinput/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, the processor 110 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuitsound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver (universal asynchronous receiver) interface /transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and/or Universal serial bus (universal serial bus, USB) interface, etc.
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备100的触摸功能。The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may contain multiple sets of I2C buses. The processor 110 can be respectively coupled to the touch sensor 180K, the charger, the flash, the
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。The I2S interface can be used for audio communication. In some embodiments, the processor 110 may contain multiple sets of I2S buses. The processor 110 may be coupled with the audio module 170 through an I2S bus to implement communication between the processor 110 and the audio module 170 . In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 through the I2S interface, so as to realize the function of answering calls through a Bluetooth headset.
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。The PCM interface can also be used for audio communications, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。The UART interface is a universal serial data bus used for asynchronous communication. The bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is typically used to connect the processor 110 with the wireless communication module 160 . For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface, so as to realize the function of playing music through the Bluetooth headset.
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(displayserial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备100的显示功能。The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface may be used to connect the processor 110 with the
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备100,例如AR设备等。The USB interface 130 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices 100, such as AR devices and the like.
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 . In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备100供电。The
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。The power management module 141 is used for connecting the battery 142 , the
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 may be implemented by the
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。The modem processor may include a modulator and a demodulator. Wherein, the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and passed to the application processor. The application processor outputs sound signals through audio devices (not limited to the speaker 170A, the
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wirelesslocal area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。The wireless communication module 160 can provide wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellite systems applied on the electronic device 100 . (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 . The wireless communication module 160 can also receive the signal to be sent from the processor 110 , perform frequency modulation on it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2 .
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(codedivision multiple access,CDMA),宽带码分多址(wideband code division multipleaccess,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidounavigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellitesystem,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。In some embodiments, the
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emittingdiode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrixorganic light emitting diode的,AMOLED),柔性发光二极管(flex light-emittingdiode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot lightemitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode). , AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diodes (quantum dot light emitting diodes, QLED) and so on. In some embodiments, the electronic device 100 may include one or N display screens 194 , where N is a positive integer greater than one.
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The electronic device 100 may implement a shooting function through an ISP, a
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used to process the data fed back by the
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。A digital signal processor is used to process digital signals, in addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy and so on.
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in various encoding formats, for example, moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。The NPU is a neural-network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transfer mode between neurons in the human brain, it can quickly process the input information, and can continuously learn by itself. Applications such as intelligent cognition of the electronic device 100 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
内部存储器121可以包括一个或多个随机存取存储器(random access memory,RAM)和一个或多个非易失性存储器(non-volatile memory,NVM)。The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
随机存取存储器可以包括静态随机存储器(static random-access memory,SRAM)、动态随机存储器(dynamic random access memory,DRAM)、同步动态随机存储器(synchronous dynamic random access memory,SDRAM)、双倍资料率同步动态随机存取存储器(double data rate synchronous dynamic random access memory,DDR SDRAM,例如第五代DDR SDRAM一般称为DDR5 SDRAM)等;Random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous Dynamic random access memory (double data rate synchronous dynamic random access memory, DDR SDRAM, such as fifth-generation DDR SDRAM is generally called DDR5 SDRAM), etc.;
非易失性存储器可以包括磁盘存储器件、快闪存储器(flash memory)。Non-volatile memory may include magnetic disk storage devices, flash memory.
快闪存储器按照运作原理划分可以包括NOR FLASH、NAND FLASH、3D NAND FLASH等,按照存储单元电位阶数划分可以包括单阶存储单元(single-level cell,SLC)、多阶存储单元(multi-level cell,MLC)、三阶储存单元(triple-level cell,TLC)、四阶储存单元(quad-level cell,QLC)等,按照存储规范划分可以包括通用闪存存储(英文:universalflash storage,UFS)、嵌入式多媒体存储卡(embedded multi media Card,eMMC)等。Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operation principle, and can include single-level memory cell (SLC), multi-level memory cell (multi-level memory cell, SLC) according to the level of storage cell potential. cell, MLC), triple-level cell (TLC), quad-level cell (QLC), etc., according to storage specifications, it can include universal flash storage (English: universal flash storage, UFS), Embedded multimedia memory card (embedded multi media Card, eMMC) and so on.
随机存取存储器可以由处理器110直接进行读写,可以用于存储操作系统或其他正在运行中的程序的可执行程序(例如机器指令),还可以用于存储用户及应用程序的数据等。The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (eg, machine instructions) of an operating system or other running programs, and can also be used to store data of users and application programs.
非易失性存储器也可以存储可执行程序和存储用户及应用程序的数据等,可以提前加载到随机存取存储器中,用于处理器110直接进行读写。The non-volatile memory can also store executable programs and store data of user and application programs, etc., and can be loaded into the random access memory in advance for the processor 110 to directly read and write.
外部存储器接口120可以用于连接外部的非易失性存储器,实现扩展电子设备100的存储能力。外部的非易失性存储器通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部的非易失性存储器中。The
内部存储器121或外部存储器接口120用于存储一个或多个计算机程序。一个或多个计算机程序被配置为被该处理器110执行。该一个或多个计算机程序包括多个指令,多个指令被处理器110执行时,可实现上述实施例中在电子设备100上执行的立体声实现方法,以实现电子设备100的立体声实现功能。Internal memory 121 or
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。The audio module 170 is used for converting digital audio information into analog audio signal output, and also for converting analog audio input into digital audio signal. Audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110 , or some functional modules of the audio module 170 may be provided in the processor 110 .
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或收听免提通话。Speaker 170A, also referred to as a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music through the speaker 170A, or listen to a hands-free call.
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。The
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备100可以设置至少一个麦克风170C。在另一些实施例中,电子设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。The
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备100平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of theUSA,CTIA)标准接口。The
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。The pressure sensor 180A is used to sense pressure signals, and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 180A may be provided on the display screen 194 . There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, and the like. The capacitive pressure sensor may be comprised of at least two parallel plates of conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example, when a touch operation whose intensity is less than the first pressure threshold acts on the short message application icon, the instruction for viewing the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, the instruction to create a new short message is executed.
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。The gyro sensor 180B may be used to determine the motion attitude of the electronic device 100 . In some embodiments, the angular velocity of electronic device 100 about three axes (ie, x, y, and z axes) may be determined by gyro sensor 180B. The gyro sensor 180B can be used for image stabilization. Exemplarily, when the shutter is pressed, the gyro sensor 180B detects the shaking angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse motion to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenarios.
气压传感器180C用于测量气压。在一些实施例中,电子设备100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.
磁传感器180D包括霍尔传感器。电子设备100可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当电子设备100是翻盖机时,电子设备100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can detect the opening and closing of the flip holster using the magnetic sensor 180D. In some embodiments, when the electronic device 100 is a flip machine, the electronic device 100 can detect the opening and closing of the flip according to the magnetic sensor 180D. Further, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, characteristics such as automatic unlocking of the flip cover are set.
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备100姿态,应用于横竖屏切换,计步器等应用。The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). The magnitude and direction of gravity can be detected when the electronic device 100 is stationary. It can also be used to recognize the posture of the electronic device 100, and can be used in applications such as horizontal and vertical screen switching, and pedometers.
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。Distance sensor 180F for measuring distance. The electronic device 100 can measure the distance through infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器180G检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。Proximity light sensor 180G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes. The light emitting diodes may be infrared light emitting diodes. The electronic device 100 emits infrared light to the outside through the light emitting diode. Electronic device 100 uses photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100 . When insufficient reflected light is detected, the electronic device 100 may determine that there is no object near the electronic device 100 . The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. Proximity light sensor 180G can also be used in holster mode, pocket mode automatically unlocks and locks the screen.
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。The ambient light sensor 180L is used to sense ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket, so as to prevent accidental touch.
指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to realize fingerprint unlocking, accessing application locks, taking pictures with fingerprints, answering incoming calls with fingerprints, and the like.
温度传感器180J用于检测温度。在一些实施例中,电子设备100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,电子设备100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,电子设备100对电池142加热,以避免低温导致电子设备100异常关机。在其他一些实施例中,当温度低于又一阈值时,电子设备100对电池142的输出电压执行升压,以避免低温导致的异常关机。The temperature sensor 180J is used to detect the temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold value, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J in order to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 caused by the low temperature. In some other embodiments, when the temperature is lower than another threshold, the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
触摸传感器180K,也称“触控器件”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。Touch sensor 180K, also called "touch device". The touch sensor 180K may be disposed on the display screen 194 , and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”. The touch sensor 180K is used to detect a touch operation on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to touch operations may be provided through display screen 194 . In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 , which is different from the location where the display screen 194 is located.
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器180M也可以设置于耳机中,结合成骨传导耳机。音频模块170可以基于所述骨传导传感器180M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器180M获取的血压跳动信号解析心率信息,实现心率检测功能。The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire the vibration signal of the vibrating bone mass of the human voice. The bone conduction sensor 180M can also contact the pulse of the human body and receive the blood pressure beating signal. In some embodiments, the bone conduction sensor 180M can also be disposed in the earphone, combined with the bone conduction earphone. The audio module 170 can analyze the voice signal based on the vibration signal of the vocal vibration bone block obtained by the bone conduction sensor 180M, so as to realize the voice function. The application processor can analyze the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M, and realize the function of heart rate detection.
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。The keys 190 include a power-on key, a volume key, and the like. Keys 190 may be mechanical keys. It can also be a touch key. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100 .
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。The
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。The SIM card interface 195 is used to connect a SIM card. The SIM card can be contacted and separated from the electronic device 100 by inserting into the SIM card interface 195 or pulling out from the SIM card interface 195 . The electronic device 100 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card and so on. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the plurality of cards may be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as call and data communication. In some embodiments, the electronic device 100 employs an eSIM, ie: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100 .
本实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机指令,当该计算机指令在电子设备100上运行时,使得电子设备100执行上述相关方法步骤实现上述实施例中的立体声实现方法。This embodiment also provides a computer storage medium, where computer instructions are stored in the computer storage medium, and when the computer instructions are executed on the electronic device 100, the electronic device 100 executes the above-mentioned relevant method steps to realize the stereo implementation in the above-mentioned embodiments method.
本实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的立体声实现方法。This embodiment also provides a computer program product, which, when the computer program product runs on a computer, causes the computer to execute the above-mentioned relevant steps, so as to realize the stereo realization method in the above-mentioned embodiment.
另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述各方法实施例中的立体声实现方法。In addition, the embodiments of the present application also provide an apparatus, which may specifically be a chip, a component or a module, and the apparatus may include a connected processor and a memory; wherein, the memory is used for storing computer execution instructions, and when the apparatus is running, The processor can execute the computer-executed instructions stored in the memory, so that the chip executes the stereo implementation method in the above method embodiments.
其中,本实施例提供的电子设备、计算机存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Wherein, the electronic device, computer storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, for the beneficial effects that can be achieved, reference can be made to the corresponding provided above. The beneficial effects in the method will not be repeated here.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。From the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions can be allocated as required. It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,该模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined. Or it may be integrated into another device, or some features may be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
该作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components shown as units may be one physical unit or multiple physical units, that is, may be located in one place, or may be distributed to multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
该集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, which are stored in a storage medium , including several instructions to make a device (which may be a single chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes .
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application rather than limitations. Although the present application has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present application can be Modifications or equivalent substitutions can be made without departing from the spirit and scope of the technical solutions of the present application.
Claims (45)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110642600.8A CN113542984B (en) | 2021-06-09 | 2021-06-09 | Stereo realization system, method, electronic device and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110642600.8A CN113542984B (en) | 2021-06-09 | 2021-06-09 | Stereo realization system, method, electronic device and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN113542984A CN113542984A (en) | 2021-10-22 |
| CN113542984B true CN113542984B (en) | 2022-04-15 |
Family
ID=78124725
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202110642600.8A Active CN113542984B (en) | 2021-06-09 | 2021-06-09 | Stereo realization system, method, electronic device and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN113542984B (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116249076A (en) * | 2023-02-28 | 2023-06-09 | 珠海慧联科技有限公司 | Audio synchronization method and device based on multicast system and readable storage medium |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101465910A (en) * | 2009-01-12 | 2009-06-24 | 深圳华为通信技术有限公司 | Control method, terminal and system for playing stereo based on mobile terminal |
| CN102611510A (en) * | 2011-01-24 | 2012-07-25 | 苏州大学 | Method and system for measuring link quality and communication distance of 2.4GB channel |
| US9363597B1 (en) * | 2013-08-21 | 2016-06-07 | Turtle Beach Corporation | Distance-based audio processing for parametric speaker system |
| CN106686520A (en) * | 2017-01-03 | 2017-05-17 | 南京地平线机器人技术有限公司 | Multi-channel audio system capable of tracking user and equipment with multi-channel audio system |
| CN107506171A (en) * | 2017-08-22 | 2017-12-22 | 深圳传音控股有限公司 | Audio-frequence player device and its effect adjusting method |
| CN111131957A (en) * | 2019-12-26 | 2020-05-08 | 上海传英信息技术有限公司 | Volume control method, terminal and readable storage medium |
| CN112399306A (en) * | 2020-11-16 | 2021-02-23 | 联想(北京)有限公司 | Control method and device |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9986356B2 (en) * | 2012-02-15 | 2018-05-29 | Harman International Industries, Incorporated | Audio surround processing system |
-
2021
- 2021-06-09 CN CN202110642600.8A patent/CN113542984B/en active Active
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101465910A (en) * | 2009-01-12 | 2009-06-24 | 深圳华为通信技术有限公司 | Control method, terminal and system for playing stereo based on mobile terminal |
| CN102611510A (en) * | 2011-01-24 | 2012-07-25 | 苏州大学 | Method and system for measuring link quality and communication distance of 2.4GB channel |
| US9363597B1 (en) * | 2013-08-21 | 2016-06-07 | Turtle Beach Corporation | Distance-based audio processing for parametric speaker system |
| CN106686520A (en) * | 2017-01-03 | 2017-05-17 | 南京地平线机器人技术有限公司 | Multi-channel audio system capable of tracking user and equipment with multi-channel audio system |
| CN107506171A (en) * | 2017-08-22 | 2017-12-22 | 深圳传音控股有限公司 | Audio-frequence player device and its effect adjusting method |
| CN111131957A (en) * | 2019-12-26 | 2020-05-08 | 上海传英信息技术有限公司 | Volume control method, terminal and readable storage medium |
| CN112399306A (en) * | 2020-11-16 | 2021-02-23 | 联想(北京)有限公司 | Control method and device |
Also Published As
| Publication number | Publication date |
|---|---|
| CN113542984A (en) | 2021-10-22 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN113228701B (en) | Audio data synchronization method and device | |
| CN112312366B (en) | Method, electronic equipment and system for realizing functions through NFC (near field communication) tag | |
| WO2021008534A1 (en) | Voice wakeup method and electronic device | |
| CN114726946A (en) | A method and electronic device for automatically switching Bluetooth audio coding methods | |
| CN113126948B (en) | Audio playing method and related equipment | |
| CN110572799B (en) | Method and equipment for simultaneous response | |
| CN114880251B (en) | Storage unit access method, access device and terminal equipment | |
| WO2022156555A1 (en) | Screen brightness adjustment method, apparatus, and terminal device | |
| WO2022095752A1 (en) | Frame demultiplexing method, electronic device and storage medium | |
| WO2023197997A1 (en) | Wearable device, and sound pickup method and apparatus | |
| CN113129916A (en) | Audio acquisition method, system and related device | |
| CN116389822A (en) | Data transmission method, chip system and related device | |
| CN113467904B (en) | Method, apparatus, electronic device and readable storage medium for determining cooperation mode | |
| CN113438643B (en) | Terminal capability reporting system, method, electronic equipment and storage medium | |
| CN113542984B (en) | Stereo realization system, method, electronic device and storage medium | |
| CN117130975B (en) | Bus interface expansion method and related equipment | |
| CN109285563B (en) | Voice data processing method and device in online translation process | |
| CN115119336A (en) | Earphone connection system, earphone connection method, earphone, electronic device and readable storage medium | |
| CN116939559A (en) | Bluetooth audio encoding data distribution method, electronic device and storage medium | |
| CN115706755A (en) | Echo cancellation method, electronic device, and storage medium | |
| CN115993592B (en) | Bluetooth ranging method, electronic equipment and storage medium | |
| CN115480250A (en) | Speech recognition method, device, electronic device and storage medium | |
| CN114915359A (en) | Method, apparatus, electronic device, and readable storage medium for selecting a channel | |
| CN114579900A (en) | Cross-device page switching method, electronic device and storage medium | |
| CN115019803B (en) | Audio processing method, electronic device and storage medium |
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 | ||
| CP03 | Change of name, title or address | ||
| CP03 | Change of name, title or address |
Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Patentee after: Honor Terminal Co.,Ltd. Country or region after: China Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong Patentee before: Honor Device Co.,Ltd. Country or region before: China |