Nothing Special   »   [go: up one dir, main page]

CN113542984A - Stereo sound implementation system, method, electronic device, and storage medium - Google Patents

Stereo sound implementation system, method, electronic device, and storage medium Download PDF

Info

Publication number
CN113542984A
CN113542984A CN202110642600.8A CN202110642600A CN113542984A CN 113542984 A CN113542984 A CN 113542984A CN 202110642600 A CN202110642600 A CN 202110642600A CN 113542984 A CN113542984 A CN 113542984A
Authority
CN
China
Prior art keywords
audio
broadcast signal
volume
stream data
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.)
Granted
Application number
CN202110642600.8A
Other languages
Chinese (zh)
Other versions
CN113542984B (en
Inventor
唐能福
董吉阳
王福凯
牛永民
黄鹏飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202110642600.8A priority Critical patent/CN113542984B/en
Publication of CN113542984A publication Critical patent/CN113542984A/en
Application granted granted Critical
Publication of CN113542984B publication Critical patent/CN113542984B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R5/00Stereophonic arrangements
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L19/00Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis
    • G10L19/008Multichannel audio signal coding or decoding using interchannel correlation to reduce redundancy, e.g. joint-stereo, intensity-coding or matrixing
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L19/00Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis
    • G10L19/02Speech 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/06Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R2430/00Signal processing covered by H04R, not provided for in its groups
    • H04R2430/01Aspects of volume control, not necessarily automatic, in sound systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Signal Processing (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Mathematical Physics (AREA)
  • Circuit For Audible Band Transducer (AREA)

Abstract

The present application relates to the field of intelligent audio playing, and in particular, to a stereo sound implementation method, an electronic device, and a storage medium. The method comprises the following steps: the audio transmitting device calculates a first distance between the audio transmitting device and the first audio receiving device according to a first broadcast signal transmitted by the first audio receiving device, calculates a second distance between the audio transmitting device and the second audio receiving device according to a second broadcast signal transmitted by the second audio receiving device, and calculates a sound digital signal regulation proportionality coefficient according to the first distance and the second distance. The audio sending device adjusts the volume of first stream data of the PCM audio data according to the sound digital signal adjustment proportionality coefficient, the first stream data after volume adjustment is sent to the first audio receiving device to be played, and second stream data of the PCM audio data is sent to the second audio receiving device to be played. The method and the device can solve the technical problem that the monophonic sound file cannot play stereophonic sound.

Description

Stereo sound implementation system, method, electronic device, and storage medium
Technical Field
The present application relates to the field of audio playing technologies, and in particular, to a stereo sound implementation system, method, electronic device, and storage medium.
Background
In order to play a spatial stereo effect, the sound source file of the bluetooth headset needs to include left and right ear sound channel data so that the bluetooth headset can play the spatial stereo effect when playing an audio file. However, most audio source files in the industry are mono audio files, and spatial stereo effect cannot be obtained during playing. In addition, when the existing bluetooth Audio transmission model protocol (A2 DP) performs volume adjustment, if the volume adjustment mode of the main ear and the volume adjustment mode of the sub-ear of the bluetooth headset are different, the mobile phone switches the volume adjustment modes of the main ear and the sub-ear of the bluetooth headset from absolute volume to normal volume, which causes the problem of inconsistent volume adjustment or abrupt sound effect change of the bluetooth headset. For example, when the handset is connected to the earphone in the normal volume mode first, the volume of the earphone in the absolute volume mode may suddenly decrease, and when the handset is connected to the earphone in the absolute volume mode first, the volume of the earphone in the normal volume mode may suddenly increase.
Disclosure of Invention
In view of the foregoing, there is a need for a stereo sound implementation system, method, electronic device and storage medium to solve the technical problem that a mono sound file cannot play stereo sound.
In a first aspect, an embodiment of the present application provides a stereo sound implementation system, where the system includes: audio transmission means for: scanning and receiving a first broadcast signal sent by a first audio receiving device, and determining the space loss of the first broadcast signal according to the transmitting power carried by the first broadcast signal; acquiring a carrier frequency of the first broadcast signal, and calculating a first distance between the audio transmitting device and the first audio receiving device according to the carrier frequency and the space loss of the first broadcast signal; scanning and receiving a second broadcast signal sent by a second audio receiving device, and determining the space loss of the second broadcast signal according to the transmitting power carried by the second broadcast signal; acquiring the carrier frequency of the second broadcast signal, and calculating a 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; calculating a sound digital signal regulation proportionality coefficient according to the first distance and the second distance; acquiring Pulse Code Modulation (PCM) audio data, dividing the PCM audio data into first stream data and second stream data, and adjusting the volume of the first stream data according to a sound digital signal adjusting proportionality coefficient to obtain volume-adjusted first stream data; sending the first stream data after the volume adjustment to a first audio receiving device, and sending the second stream data to a second audio receiving device; the first audio receiving means is configured to: sending a first broadcast signal carrying transmission power to the audio sending device; responding to the received first streaming data after the volume adjustment, and playing the first streaming data after the volume adjustment; the second audio receiving means is configured to: transmitting a second broadcast signal carrying transmission power to the audio transmitting apparatus; responding to the received second stream data, and playing the second stream data. According to the method, the sound digital signal adjustment proportionality coefficient is calculated according to the distance between the audio sending device and the audio receiving device, the volume of the first stream data is adjusted according to the sound digital signal adjustment proportionality coefficient, the first stream data after volume adjustment is sent to the first audio receiving device, the second stream data is sent to the second audio receiving device, and therefore the first stream data after volume adjustment and the second stream data have difference, and the first audio receiving device can generate a space stereo effect when playing the first stream data and the second audio receiving device play the second stream data.
In one implementation, the obtaining PCM audio data, splitting the PCM audio data into first stream data and second stream data, and adjusting a volume of the first stream data according to a sound digital signal adjustment scaling factor to obtain volume-adjusted first stream data includes: responding 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. According to the technical scheme, the PCM audio data in the audio file can be divided into the first stream data and the second stream data by executing the operation of playing the audio file.
In one implementation, the operation of playing the audio file includes an operation of clicking a play button on a user interface of the music playing application or the video playing application. According to the technical scheme, when a play key on a user interface of a music play application or a video play application is clicked, PCM audio data in an audio file is divided into the first stream data and the second stream data.
In one implementation, the 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 adjustment scaling factor to obtain the volume-adjusted first stream data includes: a Bluetooth protocol stack interface module of the audio sending device shunts the PCM audio data to obtain first stream data and second stream data, and adjusts the volume of the first stream data according to the sound digital signal adjustment proportionality coefficient to obtain volume-adjusted first stream data; the Bluetooth protocol stack interface module merges the volume-adjusted first stream data and the volume-adjusted second stream data into volume-adjusted PCM audio data and transmits the volume-adjusted PCM audio data to a Bluetooth protocol stack application layer module of the audio transmitting device; the Bluetooth protocol stack application layer module transmits the PCM audio data after volume adjustment to a Bluetooth protocol stack module of the audio transmitting device; and the Bluetooth protocol stack module encodes the PCM audio data after the volume adjustment according to a preset encoding method to obtain encoded PCM audio data. By the technical scheme, the volume adjustment of the PCM audio data can be completed before the PCM audio data is coded, so that the stereo effect of the PCM audio data during playing is improved.
In one implementation, the sending, by the bluetooth protocol stack module, the volume-adjusted first stream data to a first audio receiving device, and sending the second stream data to a second audio receiving device includes: sending the volume-adjusted first stream data of the encoded PCM audio data to the first audio receiving device, and sending the second stream data of the encoded PCM audio data to the second audio receiving device. Through the technical scheme, the coded PCM audio data is sent to the first audio receiving device and the second audio receiving device through the Bluetooth protocol stack module.
In one implementation, the preset encoding method is a subband encoding method.
In one implementation, the 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 adjustment scaling factor to obtain the volume-adjusted first stream data includes: and when the Bluetooth protocol stack interface module of the audio sending device determines that the volume adjusting mode of the first audio receiving device and the volume adjusting mode of the second audio receiving device are absolute volume adjusting modes, adjusting the volume of the first stream data according to the sound digital signal adjusting proportionality coefficient to obtain volume-adjusted first stream data. According to the technical scheme, the Bluetooth protocol stack interface module adjusts the volume of the first stream data according to the sound digital signal adjustment proportionality coefficient 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 the absolute volume adjustment mode, so that the difference exists between the first stream data and the second stream data after volume adjustment, and the first audio receiving device generates a space stereo effect when playing the first stream data and the second audio receiving device plays the second stream data.
In one implementation, the 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 adjustment scaling factor to obtain the volume-adjusted first stream data includes: when the Bluetooth protocol stack interface module of the audio transmitting device determines that the volume adjusting mode of the first audio receiving device is an absolute volume adjusting mode and the volume adjusting mode of the second audio receiving device is a non-absolute volume adjusting mode, acquiring the volume gain of the audio transmitting device; and adjusting the volume of the first stream data according to the sound digital signal adjustment proportionality coefficient to obtain volume-adjusted first stream data, and adjusting the second stream data according to the volume gain of the audio sending device to obtain volume-adjusted second stream data. According to the technical scheme, when the Bluetooth protocol stack interface module determines that the volume adjusting mode of the first audio receiving device is the absolute volume adjusting mode and the volume adjusting mode of the second audio receiving device is the non-absolute volume adjusting mode, the volume of the second stream data is adjusted according to the volume gain of the audio sending device, so that the volume of the second audio receiving device cannot be suddenly increased when the second stream data is played, and the problem of sound effect mutation when the second audio receiving device plays the second stream data is solved.
In one implementation, the 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 adjustment scaling factor to obtain the volume-adjusted first stream data includes: and when the Bluetooth protocol stack interface module of the audio sending device determines that the volume adjusting mode of the first audio receiving device is a non-absolute volume adjusting mode and the volume adjusting mode of the second audio receiving device is an absolute volume adjusting mode, acquiring the volume gain of the audio sending device, and adjusting the volume of the first-stream data according to the sound digital signal adjusting proportionality coefficient and the volume gain of the audio sending device to obtain the first-stream data after volume adjustment. According to the technical scheme, when the Bluetooth protocol stack interface module determines that the volume adjusting mode of the first audio receiving device is the absolute volume adjusting mode and the volume adjusting mode of the second audio receiving device is the non-absolute volume adjusting mode, the volume of the first stream data is adjusted according to the sound digital signal adjusting proportionality coefficient and the volume gain of the audio sending device, so that the volume of the first audio receiving device can not be suddenly increased when the first stream data is played, and the problem of sound effect mutation when the first audio receiving device plays the first stream data is solved.
In one implementation, the 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 adjustment scaling factor to obtain the volume-adjusted first stream data includes: when the Bluetooth protocol stack interface module of the audio transmitting device determines that the volume adjusting mode of the first audio receiving device is a non-absolute volume adjusting mode and the volume adjusting mode of the second audio receiving device is a non-absolute volume adjusting mode, acquiring the volume gain of the audio transmitting device; and adjusting the volume of the first stream data according to the sound digital signal adjustment proportionality coefficient and the volume gain of the audio sending device to obtain the first stream data after volume adjustment, and adjusting the volume of the second stream data according to the volume gain of the audio sending device to obtain the second stream data after volume adjustment. Through the technical scheme, when the Bluetooth protocol stack interface module determines that the volume adjusting mode of the first audio receiving device is a non-absolute volume adjusting mode and the volume adjusting mode of the second audio receiving device is a non-absolute volume adjusting mode, the volume of the first stream data is adjusted according to the sound digital signal adjusting proportionality coefficient and the volume gain of the audio sending device, and the volume of the second stream data is adjusted according to the volume gain of the audio sending device, so that the volume of the first audio receiving device and the volume of the second audio receiving device can not be suddenly increased when the first audio receiving device plays the first stream data and the second audio receiving device plays the second stream data.
In one implementation, the system further comprises: the bluetooth protocol stack interface module of the audio sending device merges the volume-adjusted first stream data and the volume-adjusted second stream data into volume-adjusted PCM audio data, or merges the volume-adjusted first stream data and the volume-adjusted 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 sending device; the Bluetooth protocol stack application layer module transmits the PCM audio data after volume adjustment to a Bluetooth protocol stack module of the audio transmitting device; and the Bluetooth protocol stack module encodes the PCM audio data after the volume adjustment according to a preset encoding method to obtain encoded PCM audio data. According to the technical scheme, the Bluetooth protocol stack module encodes the PCM audio data with the adjusted volume according to a preset encoding method to obtain encoded PCM audio data.
In one implementation manner, the scanning and receiving a first broadcast signal sent by a first audio receiving apparatus, and determining a spatial loss of the first broadcast signal according to a transmission power carried by the first broadcast signal includes: acquiring the transmitting power of the first broadcast signal; acquiring the receiving power of the first broadcast signal; and calculating the difference value of the transmitting power of the first broadcast signal and the receiving power of the first broadcast signal to obtain the space loss of the first broadcast signal. According to the technical scheme, the space loss of the first broadcast signal is obtained by calculating the difference value between the transmitting power of the first broadcast signal and the receiving power of the first broadcast signal.
In one implementation, the calculating a first distance between the audio transmitting device and the first audio receiving device according to a carrier frequency and a spatial loss of the first broadcast signal comprises: the first distance is calculated according to the formula D1 ^ 10 ((Losdb1-32.45-20 × log10(F1))/20), where Losdb1 is the spatial loss of the first broadcast signal, F1 is the carrier frequency of the first broadcast signal, and D1 is the first distance. Through the technical scheme, the first distance is calculated according to the formula D1 ^ 10^ ((Losdb1-32.45-20 Xlog 10 (F1))/20).
In one implementation, scanning and receiving a second broadcast signal sent by a second audio receiving apparatus, and determining a spatial loss of the second broadcast signal according to a transmission power carried by the second broadcast signal includes: acquiring the transmitting power of the second broadcast signal; acquiring the receiving power of the second broadcast signal; calculating the transmission power of the second broadcast signal and the reception power of the second broadcast signal determines the spatial loss of the second broadcast signal. Through the technical scheme, the space loss of the second broadcast signal is determined by calculating the transmitting power of the second broadcast signal and the receiving power of the second broadcast signal.
In one implementation, the calculating a second distance between the audio transmitting device and the second audio receiving device according to the carrier frequency and the spatial loss of the second broadcast signal includes: the second distance is calculated according to the formula D2 ^ 10 ((Losdb2-32.45-20 × log10(F2))/20), where Losdb2 is the spatial loss of the second broadcast signal, F2 is the carrier frequency of the second broadcast signal, and D2 is the second distance. Through the technical scheme, the second distance is calculated according to the formula D2 ^ 10^ ((Losdb2-32.45-20 Xlog 10 (F2))/20).
In one implementation, the calculating the sound digital signal conditioning scaling factor from the first distance and the second distance includes calculating a sound analog signal conditioning scaling factor from a formula of 20log10(D1/D2), where D1 is the first distance, D2 is the second distance, and a is the sound analog signal conditioning scaling factor; calculating a sound digital signal adjustment scaling factor according to the formula K10 (A/20), wherein K is the sound digital signal adjustment scaling factor. Through the technical scheme, the sound digital signal adjusting proportionality coefficient is calculated according to a formula A of 20log10(D1/D2) and a formula K of 10 (A/20).
In a second aspect, an embodiment of the present application provides another stereo sound implementation system, including: audio transmission means for: transmitting a third broadcast signal carrying transmission power to the first audio receiving device; transmitting a fourth broadcast signal carrying transmission power to a second audio receiving device; acquiring PCM audio data, splitting the PCM audio data into first stream data and second stream data, sending the first stream data to the first audio receiving device, and sending the second stream data to the second audio receiving device; the first audio receiving means is for: scanning and receiving the third broadcast signal, and determining the space loss of the third broadcast signal according to the transmission power carried by the third broadcast signal; acquiring a carrier frequency of the third broadcast signal, calculating a third distance between the first audio receiving device and the audio transmitting device according to the carrier frequency of the third broadcast signal and a space loss of the third broadcast signal, and transmitting the third distance to the second audio receiving device; responding to the received first stream data, and playing the first stream data; second audio receiving means for: 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; acquiring a carrier frequency of the fourth broadcast signal, and calculating a 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; calculating a sound digital signal regulation proportionality coefficient according to the third distance and the fourth distance; and responding to the received second stream data, adjusting the volume of the second stream data according to the sound digital signal adjusting proportionality coefficient, and playing the volume-adjusted second stream data.
In the application, the second audio receiving device receives the second stream data of the PCM audio data sent by the audio sending device, adjusts the volume of the second stream data according to the sound digital signal adjustment proportionality coefficient, and plays the first stream data after volume adjustment, and the first audio receiving device plays the first stream data of the PCM audio data sent by the audio sending device. Therefore, the second stream data after volume adjustment and the first stream data have difference, so that the first audio receiving device generates a spatial stereo effect when playing the first stream data and the second audio receiving device plays the second stream data.
In one implementation, the scanning and receiving the third broadcast signal, and determining the spatial loss of the third broadcast signal according to the transmission power carried by the third broadcast signal includes: acquiring the transmitting power of the third broadcast signal; acquiring the receiving power of the third broadcast signal; and calculating the difference value of the transmitting power of the third broadcast signal and the receiving power of the third broadcast signal to obtain the space loss of the third broadcast signal. According to the technical scheme, the space loss of the third broadcast signal is obtained by calculating the difference value of the transmitting power of the third broadcast signal and the receiving power of the third broadcast signal.
In one implementation, the calculating a 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 spatial loss of the third broadcast signal includes: the third distance is calculated according to the formula D3 ^ 10 ((Losdb3-32.45-20 × log10(F3))/20), where Losdb3 is a spatial loss of the third broadcast signal, F3 is a carrier frequency of the third broadcast signal, and D3 is the third distance. Through the technical scheme, the third distance is calculated according to the formula D3 ^ 10^ ((Losdb3-32.45-20 Xlog 10 (F3))/20).
In one implementation, scanning and receiving the fourth broadcast signal, and determining a spatial loss of the fourth broadcast signal according to a transmission power carried by the fourth broadcast signal includes: acquiring the transmitting power of the fourth broadcast signal; acquiring the receiving power of the fourth broadcast signal; calculating a transmit power of the fourth broadcast signal and a receive power of the fourth broadcast signal determines a spatial loss of the fourth broadcast signal. Through the technical scheme, the space loss of the fourth broadcast signal is determined by calculating the transmitting power of the fourth broadcast signal and the receiving power of the fourth broadcast signal.
In one implementation, the calculating a 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 spatial loss of the fourth broadcast signal includes: the fourth distance is calculated according to the formula D4 ^ 10 ((Losdb4-32.45-20 × log10(F4))/20), where Losdb4 is a spatial loss of the fourth broadcast signal, F4 is a carrier frequency of the fourth broadcast signal, and D4 is the fourth distance. Through the technical scheme, the fourth distance is calculated according to the formula D4 ^ 10^ ((Losdb4-32.45-20 Xlog 10 (F4))/20).
In one implementation, the calculating the sound digital signal conditioning scaling factor from the third distance and the fourth distance includes calculating a sound analog signal conditioning scaling factor from a formula of 20log10(D3/D4), where D3 is the third distance, D4 is the fourth distance, and a is the sound analog signal conditioning scaling factor; calculating a sound digital signal adjustment scaling factor according to the formula K10 (A/20), wherein K is the sound digital signal adjustment scaling factor. Through the technical scheme, the sound digital signal adjusting proportionality coefficient is calculated according to a formula A of 20log10(D1/D2) and a formula K of 10 (A/20).
In a third aspect, an embodiment of the present application provides a stereo implementing method, which is applied in an audio sending apparatus, and the method includes: scanning and receiving a first broadcast signal which is sent by a first audio receiving device and carries transmission power, and determining the space loss of the first broadcast signal according to the transmission power carried by the first broadcast signal; acquiring a carrier frequency of the first broadcast signal, and calculating a first distance between the audio transmitting device and the first audio receiving device according to the carrier frequency of the first broadcast signal and the space loss of the first broadcast signal; scanning and receiving a second broadcast signal which is sent by a second audio receiving device and carries transmission power, and determining the space loss of the second broadcast signal according to the transmission power carried by the second broadcast signal; acquiring the frequency of the second broadcast signal, and calculating a second distance between the audio transmitting device and the second audio receiving device according to the frequency of the second broadcast signal and the space loss of the second broadcast signal; calculating a sound digital signal regulation proportionality coefficient according to the first distance and the second distance; obtaining PCM audio data, dividing 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 adjustment proportionality coefficient to obtain volume-adjusted first stream data; sending the first stream data after the volume adjustment to a first audio receiving device for playing; and sending the second stream data to a second audio receiving device for playing. According to the method, the sound digital signal adjustment proportionality coefficient is calculated according to the distance between the audio sending device and the audio receiving device, the volume of the first stream data is adjusted according to the sound digital signal adjustment proportionality coefficient, the first stream data after volume adjustment is sent to the first audio receiving device, the second stream data is sent to the second audio receiving device, and therefore the first stream data after volume adjustment and the second stream data have difference, and the first audio receiving device can generate a space stereo effect when playing the first stream data and the second audio receiving device play the second stream data.
In one implementation, the obtaining PCM audio data, splitting the PCM audio data into first stream data and second stream data, and adjusting a volume of the first stream data according to the sound digital signal adjustment scaling factor to obtain volume-adjusted first stream data includes: responding 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. According to the technical scheme, the PCM audio data in the audio file can be divided into the first stream data and the second stream data by executing the operation of playing the audio file.
In one implementation, the operation of playing the audio file includes an operation of clicking a play button on a user interface of the music playing application or the video playing application. According to the technical scheme, when a play key on a user interface of a music play application or a video play application is clicked, PCM audio data in an audio file is divided into the first stream data and the second stream data.
In one implementation, the obtaining PCM audio data, splitting the PCM audio data into first stream data and second stream data, and adjusting a volume of the first stream data according to the sound digital signal adjustment scaling factor to obtain volume-adjusted first stream data includes: a Bluetooth protocol stack interface module of the audio sending device shunts the PCM audio data to obtain first stream data and second stream data, and adjusts the volume of the first stream data according to the sound digital signal adjustment proportionality coefficient to obtain the volume-adjusted first stream data; the Bluetooth protocol stack interface module merges the volume-adjusted first stream data and the volume-adjusted second stream data into volume-adjusted PCM audio data and transmits the volume-adjusted PCM audio data to a Bluetooth protocol stack application layer module of the audio transmitting device; the Bluetooth protocol stack application layer module transmits the PCM audio data after volume adjustment to a Bluetooth protocol stack module of the audio transmitting device; and the Bluetooth protocol stack module encodes the PCM audio data after the volume adjustment according to a preset encoding method to obtain encoded PCM audio data. By the technical scheme, the volume adjustment of the PCM audio data can be completed before the PCM audio data is coded, so that the stereo effect of the PCM audio data during playing is improved.
In one implementation, the sending the volume-adjusted first stream data to a first audio receiving device and sending the second stream data to a second audio receiving device includes: and the Bluetooth protocol stack module sends the first stream data after volume adjustment in the coded PCM audio data to the first audio receiving device, and sends the second stream data in the coded PCM audio data to the second audio receiving device. Through the technical scheme, the coded PCM audio data is sent to the first audio receiving device and the second audio receiving device through the Bluetooth protocol stack module.
In one implementation, the 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 adjustment scaling factor to obtain the volume-adjusted first stream data includes: and when the Bluetooth protocol stack interface module of the audio sending device determines that the volume adjusting mode of the first audio receiving device and the volume adjusting mode of the second audio receiving device are absolute volume adjusting modes, adjusting the volume of the first stream data according to the sound digital signal adjusting proportionality coefficient to obtain volume-adjusted first stream data. According to the technical scheme, the Bluetooth protocol stack interface module adjusts the volume of the first stream data according to the sound digital signal adjustment proportionality coefficient 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 the absolute volume adjustment mode, so that the difference exists between the first stream data and the second stream data after volume adjustment, and the first audio receiving device generates a space stereo effect when playing the first stream data and the second audio receiving device plays the second stream data.
In one implementation, the 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 adjustment scaling factor to obtain the volume-adjusted first stream data includes: when the Bluetooth protocol stack interface module of the audio transmitting device determines that the volume adjusting mode of the first audio receiving device is an absolute volume adjusting mode and the volume adjusting mode of the second audio receiving device is a non-absolute volume adjusting mode, acquiring the volume gain of the audio transmitting device; and adjusting the volume of the first stream data according to the sound digital signal adjustment proportionality coefficient to obtain volume-adjusted first stream data, and adjusting the second stream data according to the volume gain of the audio sending device to obtain volume-adjusted second stream data. According to the technical scheme, when the Bluetooth protocol stack interface module determines that the volume adjusting mode of the first audio receiving device is the absolute volume adjusting mode and the volume adjusting mode of the second audio receiving device is the non-absolute volume adjusting mode, the volume of the second stream data is adjusted according to the volume gain of the audio sending device, so that the volume of the second audio receiving device cannot be suddenly increased when the second stream data is played, and the problem of sound effect mutation when the second audio receiving device plays the second stream data is solved.
In one implementation, the 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 adjustment scaling factor to obtain the volume-adjusted first stream data includes: and when the Bluetooth protocol stack interface module of the audio sending device determines that the volume adjusting mode of the first audio receiving device is a non-absolute volume adjusting mode and the volume adjusting mode of the second audio receiving device is an absolute volume adjusting mode, acquiring the volume gain of the audio sending device, and adjusting the volume of the first-stream data according to the sound digital signal adjusting proportionality coefficient and the volume gain of the audio sending device to obtain the first-stream data after volume adjustment. According to the technical scheme, when the Bluetooth protocol stack interface module determines that the volume adjusting mode of the first audio receiving device is the absolute volume adjusting mode and the volume adjusting mode of the second audio receiving device is the non-absolute volume adjusting mode, the volume of the first stream data is adjusted according to the sound digital signal adjusting proportionality coefficient and the volume gain of the audio sending device, so that the volume of the first audio receiving device can not be suddenly increased when the first stream data is played, and the problem of sound effect mutation when the first audio receiving device plays the first stream data is solved.
In one implementation, the 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 adjustment scaling factor to obtain the volume-adjusted first stream data includes: when the Bluetooth protocol stack interface module of the audio transmitting device determines that the volume adjusting mode of the first audio receiving device is a non-absolute volume adjusting mode and the volume adjusting mode of the second audio receiving device is a non-absolute volume adjusting mode, acquiring the volume gain of the audio transmitting device; and adjusting the volume of the first stream data according to the sound digital signal adjustment proportionality coefficient and the volume gain of the audio sending device to obtain the first stream data after volume adjustment, and adjusting the volume of the second stream data according to the volume gain of the audio sending device to obtain the second stream data after volume adjustment. Through the technical scheme, when the Bluetooth protocol stack interface module determines that the volume adjusting mode of the first audio receiving device is a non-absolute volume adjusting mode and the volume adjusting mode of the second audio receiving device is a non-absolute volume adjusting mode, the volume of the first stream data is adjusted according to the sound digital signal adjusting proportionality coefficient and the volume gain of the audio sending device, and the volume of the second stream data is adjusted according to the volume gain of the audio sending device, so that the volume of the first audio receiving device and the volume of the second audio receiving device can not be suddenly increased when the first audio receiving device plays the first stream data and the second audio receiving device plays the second stream data.
In one implementation, the method further comprises: the bluetooth protocol stack interface module merges the volume-adjusted first stream data and the volume-adjusted second stream data into volume-adjusted PCM audio data, or merges the volume-adjusted first stream data and the volume-adjusted second stream data into volume-adjusted PCM audio data, and transmits the volume-adjusted PCM audio data to a bluetooth protocol stack application layer module of the audio transmitting device; the Bluetooth protocol stack application layer module transmits the PCM audio data after volume adjustment to a Bluetooth protocol stack module of the audio transmitting device; and the Bluetooth protocol stack module encodes the PCM audio data after the volume adjustment according to a preset encoding method to obtain encoded PCM audio data. According to the technical scheme, the Bluetooth protocol stack module encodes the PCM audio data with the adjusted volume according to a preset encoding method to obtain encoded PCM audio data.
In one implementation manner, the scanning and receiving a first broadcast signal sent by a first audio receiving apparatus, and determining a spatial loss of the first broadcast signal according to a transmission power carried by the first broadcast signal includes: acquiring the transmitting power of the first broadcast signal; acquiring the receiving power of the first broadcast signal; and calculating the difference value of the transmitting power of the first broadcast signal and the receiving power of the first broadcast signal to obtain the space loss of the first broadcast signal. According to the technical scheme, the space loss of the first broadcast signal is obtained by calculating the difference value between the transmitting power of the first broadcast signal and the receiving power of the first broadcast signal.
In one implementation, the calculating a first distance between the audio transmitting device and the first audio receiving device according to a carrier frequency and a spatial loss of the first broadcast signal comprises: the first distance is calculated according to the formula D1 ^ 10 ((Losdb1-32.45-20 × log10(F1))/20), where Losdb1 is the spatial loss of the first broadcast signal, F1 is the carrier frequency of the first broadcast signal, and D1 is the first distance. Through the technical scheme, the first distance is calculated according to the formula D1 ^ 10^ ((Losdb1-32.45-20 Xlog 10 (F1))/20).
In one implementation, the scanning and receiving a second broadcast signal sent by a second audio receiving apparatus, and determining a spatial loss of the second broadcast signal according to a transmission power carried by the second broadcast signal includes: acquiring the transmitting power of the second broadcast signal; acquiring the receiving power of the second broadcast signal; calculating the transmission power of the second broadcast signal and the reception power of the second broadcast signal determines the spatial loss of the second broadcast signal. Through the technical scheme, the space loss of the second broadcast signal is determined by calculating the transmitting power of the second broadcast signal and the receiving power of the second broadcast signal.
In one implementation, the calculating a second distance between the audio transmitting device and the second audio receiving device according to the carrier frequency and the spatial loss of the second broadcast signal includes: the second distance is calculated according to the formula D2 ^ 10 ((Losdb2-32.45-20 × log10(F2))/20), where Losdb2 is the spatial loss of the second broadcast signal, F2 is the carrier frequency of the second broadcast signal, and D2 is the second distance. Through the technical scheme, the second distance is calculated according to the formula D2 ^ 10^ ((Losdb2-32.45-20 Xlog 10 (F2))/20).
In one implementation, the calculating the sound digital signal conditioning scaling factor from the first distance and the second distance includes calculating a sound analog signal conditioning scaling factor from a formula of 20log10(D1/D2), where D1 is the first distance, D2 is the second distance, and a is the sound analog signal conditioning scaling factor; calculating a sound digital signal adjustment scaling factor according to the formula K10 (A/20), wherein K is the sound digital signal adjustment scaling factor. Through the technical scheme, the sound digital signal adjusting proportionality coefficient is calculated according to a formula A of 20log10(D1/D2) and a formula K of 10 (A/20).
In a fifth aspect, an embodiment of the present application provides a stereo implementing method, where the method includes: the audio transmitting device transmits a third broadcast signal carrying transmission power to the first audio receiving device and transmits a fourth broadcast signal carrying transmission power to the second audio receiving device; 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 transmitting power carried by the third broadcast signal; the first audio receiving device acquires a carrier frequency of the third broadcast signal, calculates a third distance between the first audio receiving device and the audio transmitting device according to the carrier frequency of the third broadcast signal and a space loss of the third broadcast signal, and transmits the third distance to the second audio receiving device; the second audio receiving device scans and receives the fourth broadcast signal, and determines the space loss of the fourth broadcast signal according to the transmitting power carried by the fourth broadcast signal; the second audio receiving device acquires the carrier frequency of the fourth broadcast signal, and calculates a 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; the second audio receiving device calculates a sound digital signal regulation proportionality coefficient according to the third distance and the fourth distance; 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 second audio receiving device; the first audio receiving device responds to the received first stream data and plays the first stream data; and the second audio receiving device responds to the received second stream data, adjusts the volume of the second stream data according to the sound digital signal adjustment proportionality coefficient, and plays the volume-adjusted second stream data. In the application, the second audio receiving device receives second stream data of the PCM audio data sent by the audio sending device, adjusts the volume of the second stream data according to the sound digital signal adjustment proportionality coefficient, and plays the first stream data after volume adjustment, and the first audio receiving device plays the first stream data of the PCM audio data sent by the audio sending device, so that there is a difference between the second stream data after volume adjustment and the first stream data, and the first audio receiving device generates a spatial stereo effect when playing the first stream data and the second audio receiving device plays the second stream data.
In one implementation, the scanning and receiving, by the first audio receiving apparatus, the third broadcast signal, and determining the spatial loss of the third broadcast signal according to the transmission power carried by the third broadcast signal includes: acquiring the transmitting power of the third broadcast signal; acquiring the receiving power of the third broadcast signal; and calculating the difference value of the transmitting power of the third broadcast signal and the receiving power of the third broadcast signal to obtain the space loss of the third broadcast signal. According to the technical scheme, the space loss of the third broadcast signal is obtained by calculating the difference value of the transmitting power of the third broadcast signal and the receiving power of the third broadcast signal.
In one implementation, the calculating a 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 spatial loss of the third broadcast signal includes: the third distance is calculated according to the formula D3 ^ 10 ((Losdb3-32.45-20 × log10(F3))/20), where Losdb3 is a spatial loss of the third broadcast signal, F3 is a carrier frequency of the third broadcast signal, and D3 is the third distance. Through the technical scheme, the third distance is calculated according to the formula D3 ^ 10^ ((Losdb3-32.45-20 Xlog 10 (F3))/20).
In one implementation, the scanning and receiving, by the second audio receiving apparatus, the fourth broadcast signal, and determining the spatial loss of the fourth broadcast signal according to the transmission power carried by the fourth broadcast signal includes: acquiring the transmitting power of the fourth broadcast signal; acquiring the receiving power of the fourth broadcast signal; calculating a transmit power of the fourth broadcast signal and a receive power of the fourth broadcast signal determines a spatial loss of the fourth broadcast signal. Through the technical scheme, the space loss of the fourth broadcast signal is determined by calculating the transmitting power of the fourth broadcast signal and the receiving power of the fourth broadcast signal.
In one implementation, the calculating a 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 spatial loss of the fourth broadcast signal includes: the fourth distance is calculated according to the formula D4 ^ 10 ((Losdb4-32.45-20 × log10(F4))/20), where Losdb4 is a spatial loss of the fourth broadcast signal, F4 is a carrier frequency of the fourth broadcast signal, and D4 is the fourth distance. Through the technical scheme, the fourth distance is calculated according to the formula D4 ^ 10^ ((Losdb4-32.45-20 Xlog 10 (F4))/20).
In one implementation, the second audio receiving device calculating a sound digital signal conditioning scaling factor as a function of the third distance and the fourth distance comprises calculating a sound analog signal conditioning scaling factor as a function of the formula a-20 log10(D3/D4), where D3 is the third distance, D4 is the fourth distance, and a is the sound analog signal conditioning scaling factor; calculating a sound digital signal adjustment scaling factor according to the formula K10 (A/20), wherein K is the sound digital signal adjustment scaling factor. Through the technical scheme, the sound digital signal adjusting proportionality coefficient is calculated according to a formula A of 20log10(D1/D2) and a formula K of 10 (A/20).
In a fifth aspect, some embodiments of the present application provide an electronic device comprising a memory and a processor: wherein the memory is used for storing program instructions; and a processor for reading and executing the program instructions stored in the memory, and when the program instructions are executed by the processor, the electronic device is caused to execute the stereo sound implementation method.
In a sixth aspect, an embodiment of the present application provides a computer storage medium, which stores program instructions that, when executed on an electronic device, cause the electronic device to execute the stereo sound implementation method.
In addition, the technical effects brought by the fifth aspect to the sixth aspect can be referred to the description related to the methods designed in the above methods, and are not repeated herein.
Drawings
Fig. 1 is an architecture diagram of a stereo sound implementation system according to an embodiment of the present application.
Fig. 2 is a flowchart of a stereo sound implementation method according to an embodiment of the present application.
FIG. 3 is a diagram of interface operations for acquiring pulse code modulated audio data.
Fig. 4 is a structural framework diagram of an audio transmitting apparatus according to an embodiment of the present application.
Fig. 5 is a flowchart of a stereo sound implementation method according to another embodiment of the present application.
Fig. 6 is a structural block diagram of an audio transmitting apparatus according to still another embodiment of the present application.
Fig. 7 is a block diagram of a bluetooth protocol stack interface module according to another embodiment of the present application.
Fig. 8 is a flowchart of a stereo sound implementation method according to another embodiment of the present application.
Fig. 9 is a diagram of an application environment of a stereo sound implementation system according to an embodiment of the present application.
Fig. 10 is an architecture diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
In the following, the terms "first", "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly 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 indicate examples, illustrations or illustrations. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. It should be understood that in this application, "/" means "or" means "unless otherwise indicated. For example, A/B may represent A or B. In the present application, "and/or" is only one kind of association relation describing an associated object, and means that three kinds of relations may exist. For example, a and/or B, may represent: a exists alone, A and B exist simultaneously, and B exists alone. "at least one" means one or more. "plurality" means two or more than two. For example, at least one of a, b, or c, may represent: a, b, c, a and b, a and c, b and c, a, b and c.
Referring to fig. 1, an architecture diagram of a stereo rendering system 10 is provided according to an embodiment of the present application. The stereo sound realization system 10 includes an audio transmitting apparatus 1 and two audio receiving apparatuses. Hereinafter, for convenience of description, the two audio receiving devices will be described as the first audio receiving device 21 and the second audio receiving device 22, respectively. The audio transmitting apparatus 1 is connected to the first audio receiving apparatus 21 and the second audio receiving apparatus 22 in a communication manner. In an embodiment, the communication connection between the audio sending device 1 and the first audio receiving device 21 and the first audio receiving device 22 may be a common short-distance connection, such as bluetooth, Wi-Fi, etc. The audio transmitting device 1 is configured to transmit audio data to the first audio receiving device 21 and the second audio receiving device 22, and the first audio receiving device 21 and the second audio receiving device 22 respectively play the received audio data to realize stereo playing of the audio data. Stereo in some embodiments of the present application may refer to the use of two or more independent sound effect channels, occurring on a pair of symmetrically configured devices, e.g., in some embodiments, a first audio receiving device 21 plays left channel audio data and a second audio receiving device 22 plays right channel audio data. The audio receiving device described in this application may be a pair, for example, a common TWS headset, where data is transmitted between left and right headsets; in some embodiments, the audio receiving device may also be a stand-alone device, such as a speaker. The stereo sound realization system 10 of the present application will be described in detail below with reference to the stereo sound realization method shown in fig. 2. The stereo realization method specifically comprises the following steps.
In step S201, Pulse Code Modulation (PCM) audio data is acquired.
In this embodiment, acquiring PCM audio data includes: the audio transmission apparatus 1 acquires PCM audio data in an audio file in response to an operation of a user to play the audio file.
The stereo implementation method provided in the embodiment of the present application is described below with a mobile phone as the audio sending device 1, a first sound box as the first audio receiving device 21, and a second sound box as the second audio receiving device 22. Referring to fig. 3, a user interface of the music playing application program is displayed on the mobile phone, the mobile phone receives an operation of a user clicking a playing key on the user interface of the music playing application or the video playing application, the mobile phone performs an operation of opening an audio file, and obtains the PCM audio data in the audio file.
In step S202, the volume adjustment mode of the first audio receiving device 21 and the volume adjustment mode of the second audio receiving device 22 are respectively obtained.
In this embodiment, after the audio transmitting apparatus 1 is in communication connection with the first audio receiving apparatus 21, the volume adjustment mode of the first audio receiving apparatus 21 is acquired from the first audio receiving apparatus 21; after the audio transmitting apparatus 1 is in communication connection with the second audio receiving apparatus 22, the volume adjustment mode of the second audio receiving apparatus 22 is acquired from the second audio receiving apparatus 22. In this embodiment, the volume adjustment types include an absolute volume adjustment mode and a non-absolute volume adjustment mode. The absolute volume adjustment mode is that the volume of the audio receiving device and the volume of the audio transmitting device 1 are synchronized when the audio receiving device and the audio transmitting device 1 are connected to play an audio file, that is, in the absolute volume adjustment mode, when the volume is adjusted on the audio transmitting device 1, the volume of the audio receiving device is also adjusted synchronously. The non-absolute volume adjustment mode means that the volume of the audio receiving device and the volume of the audio transmitting device 1 are not synchronous when the audio receiving device and the audio transmitting device 1 are connected to play an audio file, that is, in the non-absolute volume adjustment mode, the volume adjustment on the audio transmitting device 1 and the volume adjustment on the audio receiving device are independent of each other.
In step S203, it is determined whether the volume adjustment mode of the first audio receiving device 21 is the same as the volume adjustment mode of the second audio receiving device 22. If the volume adjustment mode of the first audio receiving device 21 is different from the volume adjustment mode of the second audio receiving device 22, step S204 is performed, and if the volume adjustment mode of the first audio receiving device 21 is the same as the volume adjustment mode of the second audio receiving device 22, step S205 is performed.
In step S204, the volume adjustment mode of the first audio receiving device 21 is switched from the absolute volume adjustment mode to the non-absolute volume adjustment mode, or the volume adjustment mode of the second audio receiving device 22 is switched from the absolute volume adjustment mode to the non-absolute volume adjustment mode. The first audio receiving device 21 or the second audio receiving device 22 switches the volume adjustment type, so that the volume adjustment modes of the two devices are agreed.
In step S205, PCM audio data is encoded.
In step S206, the encoded PCM audio data is split into first stream data and second stream data.
In step S207, the first stream data is sent to the first audio receiving device 21 to enable the first audio receiving device 21 to play the first stream data, and the second stream data is sent to the second audio receiving device 22 to enable the second audio receiving device 22 to play the second stream data.
Fig. 4 is a block diagram of an audio transmitting apparatus 1 according to an embodiment of the present disclosure. The audio sending device 1 includes an audio playing application 11, an audio framework module 12, an audio processing module 13, an audio adjusting module 14, an audio hardware abstraction layer module 15, a bluetooth protocol stack hardware abstraction layer module 16, a bluetooth protocol stack interface module 17, a bluetooth protocol stack application layer module 18, and a bluetooth protocol stack module 19. In this embodiment, the audio playing application 11 is connected to the audio framework module 12. Referring to fig. 3, the audio playing application 11 is configured to receive an operation of a user clicking a play key on a user interface of a music playing application or a video playing application, execute an operation of opening an audio file, and acquire PCM audio data in the audio file. In this embodiment, the audio playback application 11 includes at least one of a music playback application or a video playback application. Audio framework module 12 is used to call system functions to process PCM audio data. The audio frame module 12 is connected to an audio processing module 13. The audio processing module 13 is configured to perform sound effect processing on the PCM audio data. The sound effect processing includes at least one of noise reduction processing, subwoofer processing, surround sound processing, equalizer processing, reverberation processing, and visualization processing. The audio adjusting module 14 is used for adjusting the volume gain of the PCM audio data. In this embodiment, the audio adjusting module 14 performs 100% volume gain adjustment on the PCM audio data. The audio adjusting module 14 is connected with the audio hardware abstraction layer module 15, the audio hardware abstraction layer module 15 is connected with the bluetooth protocol stack hardware abstraction layer module 16, and the bluetooth protocol stack hardware abstraction layer module 16 is connected with the bluetooth protocol stack interface module 17. The audio hardware abstraction layer module 15 forwards the volume gain adjusted PCM audio data to the bluetooth protocol stack hardware abstraction layer module 16. The bluetooth protocol stack hardware abstraction layer module 16 forwards the PCM audio data to the bluetooth protocol stack interface module 17. The bluetooth protocol stack interface module 17 is connected to the bluetooth protocol stack application layer module 18, and the bluetooth protocol stack application layer module 18 determines whether the volume adjustment mode of the first audio receiving device 21 is the same as the volume adjustment mode of the second audio receiving device 22, and switches the volume adjustment mode of the first audio receiving device 21 from the absolute volume adjustment mode to the non-absolute volume adjustment mode or switches the volume adjustment mode of the second audio receiving device 22 from the absolute volume adjustment mode to the non-absolute volume adjustment mode when the volume adjustment mode of the first audio receiving device 21 is different from the volume adjustment mode of the second audio receiving device 22. The bluetooth protocol stack application layer module 18 is connected with the bluetooth protocol stack module 19. The bluetooth protocol stack module 19 includes an encoding module 191, a shunting module 192, and a bluetooth protocol stack thread module 193. The encoding module 191 is used to encode the PCM audio data. The splitting module 192 is configured to split the encoded PCM audio data into first stream data and second stream data. The bluetooth protocol stack thread module 193 transmits the first stream data to the first audio sink 21 to enable the first audio sink 21 to play the first stream data, and transmits the second stream data to the second audio sink 22 to enable the second audio sink 22 to play the second stream data. In this embodiment, the encoding module 191 encodes the first stream data and the second stream data after the volume adjustment by using a sub-band coding (SBC) method.
In this embodiment, when the volume adjustment mode of the first audio receiving device 21 is different from the volume adjustment mode of the second audio receiving device 22, the volume adjustment mode of the first audio receiving device 21 is switched from the absolute volume adjustment mode to the non-absolute volume adjustment mode, so that the volume of the first audio receiving device 21 during playing the first stream data suddenly becomes very large; or when the volume adjustment mode of the first audio receiving device 21 is different from the volume adjustment mode of the second audio receiving device 22, the volume adjustment mode of the second audio receiving device 22 is switched from the absolute volume adjustment mode to the non-absolute volume adjustment mode, and the volume of the first audio receiving device 21 during playing the first stream data suddenly becomes very small, which causes a sudden change of the sound effect. In addition, because the PCM audio data is from the sound source file, when the sound source file has left and right otoacoustic channel data, the stereo effect can be played. However, most audio source files in the industry are mono audio files, and spatial stereo effect experience cannot be obtained when PCM audio data of the mono audio files are played. Therefore, the gyroscope is additionally arranged on the first audio receiving device 21 and the second audio receiving device 22 (such as a Bluetooth headset) side by the friend for detecting the rotation of the head of the person, estimating the amplitude of the rotation, adjusting the volume of the left ear and the right ear and adjusting the low frequency, and simulating the space stereo effect. The embodiment of the application can realize similar playing effect on the premise that the earphone is not additionally provided with a gyroscope and other physics. Referring to fig. 5, a flowchart of a stereo sound implementation method provided in another embodiment of the present application specifically includes the following steps.
In step S501, the first audio receiving apparatus 21 transmits a first broadcast signal carrying transmission power to the audio transmitting apparatus 1.
Hereinafter, the stereo realization method provided by the embodiment of the present application is also described with the mobile phone as the audio transmitting device 1, the first sound box as the first audio receiving device 21, and the second sound box as the second audio receiving device 22.
In this embodiment, after detecting that the bluetooth connection is established with the audio transmitting apparatus 1, the first audio receiving apparatus 21 transmits a first broadcast signal carrying transmission power to the audio transmitting apparatus 1 at intervals of a first preset time. For example, after detecting that the bluetooth connection is established with the mobile phone, the first speaker sends a first broadcast signal carrying transmission power to the mobile phone every a first preset time. In some embodiments, the first broadcast signal may be a Bluetooth Low Energy (BLE) signal. For example, after detecting that the bluetooth connection is established with the mobile phone, the first speaker sends a bluetooth low energy signal with a transmission power of 100mw to the mobile phone every a first preset time.
Step S502, the audio transmitting apparatus 1 scans and receives the first broadcast signal, and determines the spatial loss of the first broadcast signal according to the transmission power carried by the first broadcast signal.
In this embodiment, the audio transmitting apparatus 1 scans and receives the first broadcast signal, and determines the spatial loss of the first broadcast signal according to the transmission power carried by the first broadcast signal includes: acquiring the transmitting power of a first broadcast signal; acquiring the receiving power of a first broadcast signal; the spatial loss of the first broadcast signal is determined according to the transmission power and the reception power of the first broadcast signal.
For example, after the mobile phone scans a first broadcast signal sent by a 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 receiving power of the first broadcast signal according to the signal strength of the received first broadcast signal, and acquires the transmitting power carried by the first broadcast signal from the first broadcast signal. The mobile phone calculates a difference value between the transmitting power and the receiving power of the first broadcast signal to obtain the space loss of the first broadcast signal.
In step S503, the audio transmitting apparatus 1 acquires the carrier frequency of the first broadcast signal, and calculates a first distance between the audio transmitting apparatus 1 and the first audio receiving apparatus 21 according to the carrier frequency and the spatial loss of the first broadcast signal.
In this embodiment, calculating the first distance between the audio transmitting apparatus 1 and the first audio receiving apparatus 21 according to the carrier frequency and the spatial loss of the first broadcast signal includes: the first distance between the audio transmitting apparatus 1 and the first audio receiving apparatus 21 is calculated by substituting the carrier frequency and the spatial loss of the first broadcast signal into the formula D1 ^ 10^ (Losdb1-32.45-20 × log10(F1))/20), where Losdb1 is the spatial loss of the first broadcast signal, F1 is the carrier frequency of the first broadcast signal, and D1 is the first distance. In this embodiment, the carrier frequency of the first broadcast signal is 2.4 GHz.
In this embodiment, after receiving a first broadcast signal, the audio transmitting apparatus 1 calculates a first distance corresponding to the first broadcast signal according to a carrier frequency and a spatial loss of the first broadcast signal. In another embodiment of the present application, the audio transmitting apparatus 1 receives a predetermined number of first broadcast signals from the first audio receiving apparatus 21, calculates a first distance corresponding to each first broadcast signal to obtain a predetermined number of first distances, calculates a distance average of the predetermined number of first distances, and uses the distance average as the first distance between the audio transmitting apparatus 1 and the first audio receiving apparatus 21. In this embodiment, the first audio receiving apparatus 21 transmits the first broadcast signals at intervals of a first preset time, and each of the preset number of first broadcast signals received by the audio transmitting apparatus 1 in the second time period corresponds to a time point. When the audio transmitting apparatus 1 calculates the first distance average value of the preset number of first distances, the broadcast signals corresponding to the time points exceeding the preset time period are discarded, so as to avoid the influence of the aging first broadcast signals on the first distance average value. In this embodiment, the audio transmitting apparatus 1 is further configured to calculate a first distance variance of a preset number of first distances, determine, from the preset number of first distances, a first broadcast signal corresponding to a first distance in which a difference between the first distance variance and the first distance exceeds a preset threshold, and discard, when calculating a first distance mean of the preset number of first distances, the first broadcast signal corresponding to the first distance in which the difference between the first distance variance and the first distance exceeds the preset threshold, so as to avoid an influence of interference of an accidental interference source on the first distance mean during spatial transmission of the first broadcast signal.
The inventors have found through research that when the audio transmitting apparatus 1 is spaced apart from the first audio receiving apparatus 21 by a human body, if the audio transmitting apparatus 1 is spaced apart from the first audio receiving apparatus 21 by 2 meters or less, the attenuation of the first broadcast signal is 3db, and the error of the first distance calculated from the first broadcast signal is 3 cm. If the distance between the audio transmitter 1 and the first audio receiver 21 is more than 2 meters, the human body will have less influence on the first broadcast signal, and the error of the first distance calculated from the first broadcast signal will be less than 3 centimeters.
In step S504, the second audio receiving apparatus 22 transmits the second broadcast signal carrying the transmission power to the audio transmitting apparatus 1.
In this embodiment, the sending, by the second audio receiving apparatus 22, the second broadcast signal carrying the transmission power to the audio sending apparatus 1 includes: after the second audio receiving device 22 establishes a connection with the audio transmitting device 1, a second broadcast signal carrying transmission power is transmitted to the audio transmitting device 1 at intervals of a first preset time. For example, after the second speaker establishes bluetooth connection with the mobile phone, a second broadcast signal carrying transmission power is sent to the mobile phone every a first preset time.
Step S505, the audio transmitting apparatus 1 scans and receives the second broadcast signal, and determines the spatial loss of the second broadcast signal according to the transmission power carried by the second broadcast signal.
In this embodiment, the audio transmitting apparatus 1 scans a second broadcast signal transmitted by a second speaker and then receives the second broadcast signal; acquiring the transmitting power of a second broadcast signal; acquiring the receiving power of a second broadcast signal; and determining the space loss of the second broadcast signal according to the transmitting power and the receiving power of the second broadcast signal. For example, the mobile phone scans a second broadcast signal sent by the second speaker and then receives the second broadcast signal and obtains the signal strength of the received second broadcast signal. The mobile phone determines the receiving power of the second broadcast signal according to the received signal strength of the second broadcast signal, and acquires the transmitting power carried by the second broadcast signal from the second broadcast signal. And the mobile phone calculates the difference value of the transmitting power and the receiving power of the second broadcast signal to obtain the space loss of the second broadcast signal.
In step S506, the audio transmitting apparatus 1 obtains the carrier frequency of the second broadcast signal, and calculates a second distance between the audio transmitting apparatus 1 and the second audio receiving apparatus 22 according to the carrier frequency and the spatial loss of the second broadcast signal.
In this embodiment, the audio transmitting apparatus 1 calculates a second distance between the audio transmitting apparatus 1 and the second audio receiving apparatus 22 by substituting the carrier frequency and the spatial loss of the second broadcast signal into the formula D2 ^ 10^ ((Losdb2-32.45-20 × log10(F2))/20), where Losdb2 is the spatial loss of the second broadcast signal, F2 is the carrier frequency of the second broadcast signal, and D2 is the second distance.
In this embodiment, after receiving a second broadcast signal, the audio transmitting apparatus 1 calculates a second distance corresponding to the second broadcast signal according to the carrier frequency and the spatial loss of the second broadcast signal. In another embodiment of the present application, the audio transmitting apparatus 1 receives a preset number of second broadcast signals from the second audio receiving apparatus 22, calculates a second distance corresponding to each second broadcast signal to obtain a preset number of second distances, calculates a second distance average of the preset number of second distances, and uses the second distance average as the second distance between the audio transmitting apparatus 1 and the second audio receiving apparatus 22. In this embodiment, the second audio receiving apparatus 22 sends the second broadcast signals at intervals of a first preset time, and each of the preset number of second broadcast signals received by the audio sending apparatus 1 in the second time period corresponds to a time point. When the audio transmitting apparatus 1 calculates the second distance average value of the preset number of second distances, the broadcast signal corresponding to the time point exceeding the preset time period is discarded, so as to avoid the influence of the aging second broadcast signal on the second distance average value. In this embodiment, the audio transmitting apparatus 1 is further configured to calculate a second distance variance of the preset number of second distances, determine, from the preset number of second distances, a second broadcast signal corresponding to a second distance whose difference with the second distance variance exceeds a preset threshold, and discard, when calculating a second distance mean of the preset number of second distances, the first broadcast signal corresponding to a second distance whose difference with the second distance variance exceeds the preset threshold, so as to avoid an influence of interference of an accidental interference source on the second distance mean during spatial transmission of the second broadcast signal.
In step S507, the audio transmitting apparatus 1 calculates a sound digital signal adjustment scaling factor according to the first distance and the second distance.
In this embodiment, the calculating, by the audio transmitting apparatus 1, the sound digital signal adjustment scaling factor according to the first distance and the second distance includes: substituting the first distance and the second distance into a formula A of 20log10(D1/D2) to calculate a sound analog signal adjusting proportionality coefficient, wherein D1 is the first distance, D2 is the second distance, and A is the sound analog signal adjusting proportionality coefficient; and substituting the sound analog signal regulation proportionality coefficient into a formula K of 10^ (A/20) to calculate a sound digital signal regulation proportionality coefficient, wherein K is the sound digital signal regulation proportionality coefficient.
In step S508, the audio transmitting apparatus 1 obtains PCM audio data, divides the PCM audio data into first stream data and second stream data, and adjusts the volume of the first stream data according to the sound digital signal adjustment scaling factor to obtain volume-adjusted first stream data.
In this embodiment, the audio transmitting apparatus 1 obtaining PCM audio data, and splitting the PCM audio data into first stream data and second stream data includes: the audio sending apparatus 1 responds to an operation of a user to play an audio file, opens and obtains the PCM audio data in the audio file, and divides the PCM audio data in the audio file into first stream data and second stream data. For example, referring to fig. 3, a user interface of a music playing application or a video playing application is displayed on the mobile phone, a user clicks a play button on the user interface of the music playing application or the video playing application, the mobile phone executes an operation of opening an audio file, obtains the PCM audio data in the audio file, and splits the PCM audio data into first stream data and second stream data.
For example, the mobile phone divides PCM audio data "aabbbccdd" into first stream data "ABCD" and second stream data "ABCD", adjusts the volume of the first stream data "ABCD" according to the sound digital signal, and sends the adjusted first stream data "ABCD" to the first speaker and the second stream data "ABCD" to the second speaker, or sends the adjusted first stream data "ABCD" to the second speaker and the second stream data "ABCD" to the first speaker. In this embodiment, adjusting the volume of the first stream data according to the sound digital signal adjusting scaling factor includes: and multiplying the volume of the first stream data by the sound digital signal regulation proportionality coefficient to obtain the regulated first stream data.
In step S509, the audio transmission device 1 transmits the volume-adjusted first stream data to the first audio reception device 21.
In step S510, the audio transmitting apparatus 1 transmits the second stream data to the second audio receiving apparatus 22.
In step S511, in response to the received volume-adjusted first stream data, the first audio receiving apparatus 21 plays the volume-adjusted first stream data.
In step S512, the second audio receiving device 22 plays the second streaming data in response to the received second streaming data.
Referring to fig. 6, a structural block diagram of an audio transmitting apparatus 1 according to another embodiment of the present application is shown. The block diagram of the audio transmission device 1 in fig. 6 is substantially the same as the structural framework of the audio transmission device 1 in fig. 3. The difference is that the bluetooth protocol stack interface module 17 shunts the PCM audio data to obtain first stream data and second stream data. The bluetooth protocol stack interface module 17 adjusts the volume of the first stream data according to the sound digital signal adjustment scaling factor. The bluetooth protocol stack interface module 17 merges the volume-adjusted first stream data and the volume-adjusted 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 18. The bluetooth protocol stack application layer module 18 is connected to the bluetooth protocol stack module 19, and is configured to transmit the PCM audio data with the adjusted volume to the bluetooth protocol stack module 19. The bluetooth protocol stack module 19 encodes the PCM audio data with the adjusted volume according to a preset encoding method, and sends a first stream of data in the encoded PCM audio data to the first audio receiving device 21, and sends a second stream of data in the encoded PCM audio data to the second audio receiving device 22. In this embodiment, a bit subband coding method of a preset coding method is provided. That is, the bluetooth protocol stack module 19 encodes the PCM audio data with the adjusted volume by using a sub-band encoding method to obtain encoded PCM audio data.
In the present application, the audio transmitting apparatus 1 calculates a sound digital signal adjustment scaling factor according to a distance between the audio transmitting apparatus 1 and the audio receiving apparatus, adjusts a volume of the first stream data according to the sound digital signal adjustment scaling factor, transmits the volume-adjusted first stream data to the first audio receiving apparatus 21, and transmits the second stream data to the second audio receiving apparatus 22. In this way, there is a difference between the first stream data and the second stream data after volume adjustment, so that the first audio receiving device 21 generates a spatial stereo effect when playing the first stream data and the second audio receiving device 22 generates a spatial stereo effect when playing the second stream data.
Referring to fig. 7, a structural framework diagram of the bluetooth protocol stack interface module 17 according to another embodiment of the present application is shown. The block diagram of the audio transmission device 1 in fig. 7 is substantially the same as the structural framework of the audio transmission device 1 in fig. 6. The difference is that the bluetooth protocol stack interface module 17 determines whether the volume adjustment mode of the first audio receiving device 21 and the volume adjustment mode of the second audio receiving device 21 are absolute volume adjustment modes, respectively. If the volume adjusting mode of the first audio receiving device 21 and the volume adjusting mode of the second audio receiving device 22 are determined to be the absolute volume adjusting mode, adjusting the volume of the first stream data according to the sound digital signal adjusting proportionality coefficient to obtain the volume-adjusted first stream data. If the volume adjustment mode of the first audio receiving device 21 is determined to be the absolute volume adjustment mode and the volume adjustment mode of the second audio receiving device 22 is determined to be the non-absolute volume adjustment mode, the volume gain of the audio transmitting device 1 is obtained, the volume of the first stream data is adjusted according to the sound digital signal adjustment proportionality coefficient to obtain the volume-adjusted first stream data, and the volume-adjusted second stream data is adjusted according to the volume gain of the audio transmitting device 1 to obtain the volume-adjusted second stream data. If the volume adjusting mode of the first audio receiving device 21 is determined to be a non-absolute volume adjusting mode and the volume adjusting mode of the second audio receiving device 22 is determined to be an absolute volume adjusting mode, obtaining the volume gain of the audio transmitting device 1, and adjusting the volume of the first stream data according to the sound digital signal adjusting proportionality coefficient and the volume gain of the audio transmitting device 1 to obtain the first stream data after the volume adjustment; if the volume adjustment mode of the first audio receiving device 21 is determined to be the non-absolute volume adjustment mode and the volume adjustment mode of the second audio receiving device 22 is determined to be the non-absolute volume adjustment mode, the volume gain of the audio transmitting device 1 is obtained, the volume of the first stream data is adjusted according to the sound digital signal adjustment proportionality coefficient and the volume gain of the audio transmitting device 1 to obtain the first stream data after the volume adjustment, and the volume of the second stream data is adjusted according to the volume gain of the audio transmitting device 1 to obtain the second stream data after the volume adjustment. The bluetooth protocol stack interface module 17 merges the volume-adjusted first stream data, the volume-adjusted second stream data, or the volume-adjusted second stream data into PCM audio data, and transmits the volume-adjusted PCM audio data to the bluetooth protocol stack application layer module 18. In this embodiment, adjusting the second stream data according to the volume gain of the audio transmission device 1 includes: the volume of the second stream data is multiplied by the volume gain of the audio transmission device 1. In this embodiment, adjusting the volume of the first stream data according to the sound digital signal adjusting scaling factor and the volume gain of the audio transmitting apparatus 1 includes: the first stream data is multiplied by the sound digital signal adjustment scaling factor and the volume gain of the audio transmitter 1.
In the present application, if it is determined that the volume adjustment mode of the first audio receiving device 21 is the non-absolute volume adjustment mode, the volume of the first stream data is adjusted according to the sound digital signal adjustment scaling factor and the volume gain of the audio transmitting device 1, so that the volume of the first audio receiving device 21 when playing the first stream data is not suddenly increased, and the problem of sudden sound effect change when the first audio receiving device 21 plays the first stream data is solved.
Referring to fig. 8, a flowchart of a stereo sound implementation method according to another embodiment of the present application is shown. Referring to fig. 9, the audio transmitting apparatus 1 is communicatively connected to a first audio receiving apparatus 21 and a second audio receiving apparatus 22, respectively. The first audio receiving device 21 is connected to the second audio receiving device 22 in a communication manner. The stereo realization method specifically comprises the following steps.
In step S801, the audio transmitting apparatus 1 transmits a third broadcast signal carrying transmission power to the first audio receiving apparatus 21.
The Stereo implementation method provided in the embodiment of the present application is described below with a mobile phone as an audio transmitting device 1, a main ear of a True Wireless Stereo (TWS) headset as a first audio receiving device 21, and an auxiliary ear of the TWS headset as a second audio receiving device 22.
In this embodiment, the sending, by the audio sending apparatus 1, the third broadcast signal carrying the transmission power to the first audio receiving apparatus 21 includes: after establishing a communication connection with the first audio receiving apparatus 21, the audio transmitting apparatus 1 transmits a third broadcast signal carrying transmission power to the first audio receiving apparatus 21 at intervals of a third preset time. For example, after the bluetooth connection is established between the mobile phone and the main ear of the TWS headset, a third broadcast signal carrying the transmission power is sent to the main ear of the TWS headset every third preset time.
In step S802, the first audio receiving apparatus 21 scans and receives the third broadcast signal, and determines the spatial loss of the third broadcast signal according to the transmitting power carried by the third broadcast signal.
In this embodiment, the scanning and receiving of the third broadcast signal by the first audio receiving apparatus 21, and determining the spatial loss of the third broadcast signal according to the transmission power carried by the third broadcast signal includes: the first audio receiving apparatus 21 scans the third broadcast signal transmitted by the audio transmitting apparatus 1 and then receives the third broadcast signal; acquiring the transmitting power of a third broadcast signal; acquiring the receiving power of a third broadcast signal; and determining the space loss of the third broadcast signal according to the transmitting power and the receiving power of the third broadcast signal. In this embodiment, after scanning the third broadcast signal sent by the mobile phone, the main ear of the TWS headset receives the third broadcast signal and obtains the signal strength of the received third broadcast signal. And the main ear of the TWS earphone determines the receiving power of the third broadcast signal according to the signal strength of the received third broadcast signal, and acquires the transmitting power carried by the third broadcast signal from the third broadcast signal. And calculating the difference value of the transmitting power and the receiving power of the third broadcast signal by the main ear of the TWS earphone to obtain the space loss of the third broadcast signal.
In step S803, the first audio receiving apparatus 21 acquires the carrier frequency of the third broadcast signal, and calculates a third distance between the first audio receiving apparatus 21 and the audio transmitting apparatus 1 according to the carrier frequency and the spatial loss of the third broadcast signal.
In this embodiment, the first audio receiving apparatus 21 calculates a third distance between the audio transmitting apparatus 1 and the first audio receiving apparatus 21 by substituting the carrier frequency and the spatial loss of the third broadcast signal into the formula D3 ^ 10^ ((Losdb3-32.45-20 × log10(F3))/20), where Losdb3 is the spatial loss of the third broadcast signal, F3 is the frequency of the third broadcast signal, and D3 is the third distance.
In step S804, the audio transmitting apparatus 1 transmits a fourth broadcast signal carrying the transmission power to the second audio receiving apparatus 22.
In this embodiment, the sending, by the audio sending apparatus 1, the fourth broadcast signal carrying the transmission power to the second audio receiving apparatus 22 includes: after establishing a communication connection with the second audio receiving device 22, the audio transmitting device 1 transmits a fourth broadcast signal carrying transmission power to the second audio receiving device 22 at intervals of a third preset time. For example, after the bluetooth connection is established between the mobile phone and the auxiliary ear of the TWS headset, a fourth broadcast signal carrying the transmission power is sent to the auxiliary ear of the TWS headset every third preset time.
In step S805, the second audio receiving apparatus 22 scans and receives the fourth broadcast signal, and determines the spatial loss of the fourth broadcast signal according to the transmission power carried by the fourth broadcast signal.
In this embodiment, the scanning and receiving of the fourth broadcast signal by the second audio receiving device 22, and determining the spatial loss of the fourth broadcast signal according to the transmission power carried by the fourth broadcast signal includes: the second audio receiving apparatus 22 scans the fourth broadcast signal transmitted by the audio transmitting apparatus 1 and then receives the fourth broadcast signal; acquiring the transmitting power of a fourth broadcast signal; acquiring the receiving power of a fourth broadcast signal; and determining the space loss of the fourth broadcast signal according to the transmitting power and the receiving power of the fourth broadcast signal. In this embodiment, after the third broadcast signal sent by the mobile phone is scanned by the monaural of the TWS headset, the third broadcast signal is received and the signal strength of the received third broadcast signal is obtained. The auxiliary ear of the TWS earphone determines the receiving power of the fourth broadcast signal according to the signal strength of the received fourth broadcast signal, and acquires the transmitting power carried by the fourth broadcast signal from the fourth broadcast signal. And calculating the difference value of the transmitting power and the receiving power of the fourth broadcast signal by the auxiliary ear of the TWS earphone to obtain the space loss of the fourth broadcast signal.
In step S806, the second audio receiving device 22 obtains the carrier frequency of the fourth broadcast signal, and calculates a fourth distance between the second audio receiving device 22 and the audio transmitting device 1 according to the carrier frequency and the spatial loss of the fourth broadcast signal.
In this embodiment, the second audio receiving apparatus 22 calculates a fourth distance between the audio transmitting apparatus 1 and the second audio receiving apparatus 22 by substituting the carrier frequency and the spatial loss of the fourth broadcast signal into the formula D4 ^ 10^ ((Losdb4-32.45-20 × log10(F4))/20), where Losdb4 is the spatial loss of the fourth broadcast signal, F4 is the frequency of the fourth broadcast signal, and D4 is the fourth distance.
In step S807, the first audio receiving apparatus 21 transmits the third distance to the second audio receiving apparatus 22.
In this embodiment, the first audio receiving device 21 and the second audio receiving device 22 are communicatively connected through a Bluetooth Low Energy (BLE) protocol or a Serial Port Profile (SPP) protocol. The first audio receiving apparatus 21 calculates the third distance and then transmits the third distance to the second audio receiving apparatus 22. For example, after the primary ear and the secondary ear of the TWS headset establish communication connection and calculate the third distance, the third distance is sent to the secondary ear.
In step S808, the second audio receiving device 22 calculates a scaling factor of the sound digital signal according to the third distance and the fourth distance.
In this embodiment, the second audio receiving device 22 calculates the sound analog signal adjustment scaling factor by substituting the third distance and the fourth distance into formula a of 20log10(D3/D4), where D3 is the third distance, D4 is the fourth distance, and a is the sound analog signal adjustment scaling factor; and substituting the sound analog signal regulation proportionality coefficient into a formula K of 10^ (A/20) to calculate a sound digital signal regulation proportionality coefficient, wherein K is the sound digital signal regulation proportionality coefficient.
In step S809, the audio transmitting apparatus 1 acquires the PCM audio data, divides the PCM audio data into the first stream data and the second stream data, and transmits the first stream data to the first audio receiving apparatus 21. In this embodiment, the PCM audio data is audio data of a mono sound file.
In step S810, the audio transmitting apparatus 1 transmits the second stream data to the second audio receiving apparatus 22.
In step S811, in response to the received first streaming data, the first audio receiving apparatus 21 plays the first streaming data.
In step S812, in response to the received second stream data, the second audio receiving device 22 adjusts the volume of the second stream data according to the sound digital signal adjustment scaling factor, and plays the volume-adjusted second stream data.
In this embodiment, the identities of the first audio receiving device 21 and the second audio receiving device 22 are interchangeable. For example, the second audio receiving apparatus 22 transmits the calculated fourth distance to the first audio receiving apparatus 21; the first audio receiving device 21 calculates a sound digital signal adjustment scaling factor according to the third distance and the fourth distance, adjusts the first streaming data according to the sound digital signal adjustment scaling factor, and plays the adjusted first streaming data; the second audio receiving device 22 plays the second streaming data.
In this application, the second audio receiving device 22 receives the second stream data of the monaural sound file sent by the audio sending device 1, adjusts the volume of the second stream data according to the sound digital signal adjustment scaling factor, and plays the first stream data after volume adjustment, and the first audio receiving device 22 plays the first stream data of the monaural sound file sent by the audio sending device 1. 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 21 generates a spatial stereo effect when playing the first stream data and the second audio receiving device 22 generates a spatial stereo effect when playing the second stream data.
Fig. 10 is a schematic structural diagram of an electronic device 100 according to an embodiment of the present disclosure. The stereo realization method is applied in the electronic device 100. The electronic device 100 may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a Personal Digital Assistant (PDA), an Augmented Reality (AR) device, a Virtual Reality (VR) device, an Artificial Intelligence (AI) device, a wearable device, a vehicle-mounted device, an intelligent home device, and/or an intelligent city device, and the embodiment of the present application does not particularly limit the specific type of the electronic device 100. In this embodiment, the electronic device 100 includes an audio transmitting apparatus 1.
The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identification Module (SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the illustrated structure of the embodiment of the present invention does not specifically limit the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors.
The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface, etc.
The I2C interface is a bi-directional synchronous serial bus that includes a serial data line (SDA) and a Serial Clock Line (SCL). In some embodiments, processor 110 may include multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces, respectively. For example: the processor 110 may be coupled to the touch sensor 180K via an I2C interface, such that the processor 110 and the touch sensor 180K communicate via an I2C bus interface to implement the touch functionality of the electronic device 100.
The I2S interface may be used for audio communication. In some embodiments, processor 110 may include multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may communicate audio signals to the wireless communication module 160 via the I2S interface, enabling answering of calls via a bluetooth headset.
The PCM interface may also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled by a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to implement a function of answering a call through a bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus used for asynchronous communications. 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 generally used to connect the processor 110 with the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit the audio signal to the wireless communication module 160 through a UART interface, so as to realize the function of playing music through a bluetooth headset.
MIPI interfaces may be used to connect processor 110 with peripheral devices such as display screen 194, camera 193, and the like. The MIPI interface includes a Camera Serial Interface (CSI), a Display Serial Interface (DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the capture functionality of electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the electronic device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal and may also be configured as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, and the like.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transmit data between the electronic device 100 and a peripheral device. And the earphone can also be used for connecting an earphone and playing audio through the earphone. The interface may also be used to connect other electronic devices 100, such as AR devices and the like.
It should be understood that the connection relationship between the modules according to the embodiment of the present invention is only illustrative, and is not limited to the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The charging management module 140 is configured to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive a wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device 100 through the power management module 141 while charging the battery 142.
The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140, and supplies power to the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be used to monitor parameters such as battery capacity, battery cycle count, battery state of health (leakage, impedance), etc. In some other embodiments, the power management module 141 may also be disposed in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including 2G/3G/4G/5G wireless communication applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then passes the demodulated low frequency baseband signal to a baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional modules, independent of the processor 110.
The wireless communication module 160 may provide a solution for wireless communication applied to the electronic device 100, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), bluetooth (bluetooth, BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), and the like.
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, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves.
In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150 and antenna 2 is coupled to wireless communication module 160 so that electronic device 100 can communicate with networks and other devices through wireless communication techniques. The wireless communication technology may include global system for mobile communications (GSM), General Packet Radio Service (GPRS), code division multiple access (code division multiple access, CDMA), Wideband Code Division Multiple Access (WCDMA), time-division code division multiple access (time-division code division multiple access, TD-SCDMA), Long Term Evolution (LTE), LTE, BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc. The GNSS may include a Global Positioning System (GPS), a global navigation satellite system (GLONASS), a beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and/or a Satellite Based Augmentation System (SBAS).
The electronic device 100 implements display functions via the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, with N being a positive integer greater than 1.
The electronic device 100 may implement a shooting function through the ISP, the camera 193, the video codec, the GPU, the display 194, the application processor, and the like.
The ISP is used to process the data fed back by the camera 193. For example, when a photo is taken, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converting into an image visible to naked eyes. The ISP can also carry out algorithm optimization on the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The light sensing element converts the optical signal into an electrical signal, which is then passed to the ISP where it is converted into a digital image signal. And the ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into image signal in standard RGB, YUV and other formats. In some embodiments, the electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process digital image signals and other digital signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to perform fourier transform or the like on the frequency bin energy.
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 may play or record video in a variety of encoding formats, such as: moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The NPU is a neural-network (NN) computing processor that processes input information quickly by using a biological neural network structure, for example, by using a transfer mode between neurons of a human brain, and can also learn by itself continuously. Applications such as intelligent recognition of the electronic device 100 can be realized through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, and the like.
The internal memory 121 may include one or more Random Access Memories (RAMs) and one or more non-volatile memories (NVMs).
The 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 (DDR SDRAM), such as fifth generation DDR SDRAM generally referred to as DDR5 SDRAM, and the like;
the nonvolatile memory may include a magnetic disk storage device, a flash memory (flash memory).
The FLASH memory may include NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operation principle, may include single-level cells (SLC), multi-level cells (MLC), three-level cells (TLC), four-level cells (QLC), etc. according to the level order of the memory cells, and may include universal FLASH memory (UFS), embedded multimedia memory cards (eMMC), etc. according to the storage specification.
The random access memory may be read and written directly by the processor 110, may be used to store executable programs (e.g., machine instructions) of an operating system or other programs in operation, and may also be used to store data of users and applications, etc.
The nonvolatile memory may also store executable programs, data of users and application programs, and the like, and may be loaded into the random access memory in advance for the processor 110 to directly read and write.
The external memory interface 120 may be used to connect an external nonvolatile memory to extend the storage capability of the electronic device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are saved in an external nonvolatile memory.
The internal memory 121 or the external memory interface 120 is used to store one or more computer programs. One or more computer programs are configured to be executed by the processor 110. The one or more computer programs include a plurality of instructions which, when executed by the processor 110, may implement the stereo implementation method performed on the electronic device 100 in the above embodiments to implement the stereo implementation functionality of the electronic device 100.
The electronic device 100 may implement audio functions via the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or some functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also called a "horn", is used to convert the audio electrical signal into an acoustic signal. The electronic apparatus 100 can listen to music through the speaker 170A or listen to a handsfree call.
The receiver 170B, also called "earpiece", is used to convert the electrical audio signal into an acoustic signal. When the electronic apparatus 100 receives a call or voice information, it can receive voice by placing the receiver 170B close to the ear of the person.
The microphone 170C, also referred to as a "microphone," is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can input a voice signal to the microphone 170C by speaking the user's mouth near the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C to achieve a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may further include three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, perform directional recording, and so on.
The headphone interface 170D is used to connect a wired headphone. The headset interface 170D may be the USB interface 130, or may be an open mobile electronic device 100 platform (OMTP) standard interface of 3.5mm, a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used for sensing a pressure signal, and converting the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A can be of a wide variety, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a sensor comprising at least two parallel plates having an electrically conductive material. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic apparatus 100 may also calculate the touched position from the detection signal of the pressure sensor 180A. In some embodiments, the touch operations that are applied to the same touch position but different touch operation intensities may correspond to different operation instructions. For example: and when the touch operation with the touch operation intensity smaller than the first pressure threshold value acts on the short message application icon, executing an instruction for viewing the short message. And when the touch operation with the touch operation intensity larger than or equal to the first pressure threshold value acts on the short message application icon, executing an instruction of newly building the short message.
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 (i.e., the x, y, and z axes) may be determined by gyroscope sensor 180B. The gyro sensor 180B may be used for photographing anti-shake. For example, when the shutter is pressed, the gyro sensor 180B detects a shake angle of the electronic device 100, calculates a distance to be compensated for by the lens module according to the shake angle, and allows the lens to counteract the shake of the electronic device 100 through a reverse movement, thereby achieving anti-shake. The gyroscope sensor 180B may also be used for navigation, somatosensory gaming scenes.
The air pressure sensor 180C is used to measure air pressure. In some embodiments, electronic device 100 calculates altitude, aiding in positioning and navigation, from barometric pressure values measured by barometric pressure sensor 180C.
The magnetic sensor 180D includes a hall sensor. The electronic device 100 may 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 phone, the electronic device 100 may detect the opening and closing of the flip according to the magnetic sensor 180D. And then according to the opening and closing state of the leather sheath or the opening and closing state of the flip cover, the automatic unlocking of the flip cover is set.
The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity can be detected when the electronic device 100 is stationary. The method can also be used for identifying the posture of the electronic equipment 100, and is applied to horizontal and vertical screen switching, pedometers and other applications.
A distance sensor 180F for measuring a distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, taking a picture of a scene, electronic device 100 may utilize range sensor 180F to range for fast focus.
The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light to the outside through the light emitting diode. The electronic device 100 detects infrared reflected light from nearby objects using a photodiode. 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 are no objects near the electronic device 100. The electronic device 100 can utilize the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear for talking, so as to automatically turn off the screen to achieve the purpose of saving power. The proximity light sensor 180G may also be used in a holster mode, a pocket mode automatically unlocks and locks the screen.
The ambient light sensor 180L is used to sense the ambient light level. Electronic device 100 may adaptively adjust the brightness of display screen 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust the white balance when taking a picture. The ambient light sensor 180L may also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 can utilize the collected fingerprint characteristics to unlock the fingerprint, access the application lock, photograph the fingerprint, answer an incoming call with the fingerprint, and so on.
The temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 100 implements a temperature processing strategy using the temperature detected by temperature sensor 180J. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 performs a reduction in performance of a processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection. In other embodiments, the electronic device 100 heats the battery 142 when the temperature is below another threshold to avoid the low temperature causing the electronic device 100 to shut down abnormally. In other embodiments, when the temperature is lower than a further threshold, the electronic device 100 performs boosting on the output voltage of the battery 142 to avoid abnormal shutdown due to low temperature.
The touch sensor 180K is also called a "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, which is also called a "touch screen". The touch sensor 180K is used to detect a touch operation applied thereto or nearby. The touch sensor can communicate the detected touch operation to the application processor to determine the touch event type. Visual output associated with the touch operation may be provided through the display screen 194. In other embodiments, the touch sensor 180K may be disposed on a surface of the electronic device 100, different from the position of the display screen 194.
The bone conduction sensor 180M may acquire a vibration signal. In some embodiments, the bone conduction sensor 180M may acquire a vibration signal of the human vocal part vibrating the bone mass. The bone conduction sensor 180M may also contact the human pulse to receive the blood pressure pulsation signal. In some embodiments, the bone conduction sensor 180M may also be disposed in a headset, integrated into a bone conduction headset. The audio module 170 may analyze a voice signal based on the vibration signal of the bone mass vibrated by the sound part acquired by the bone conduction sensor 180M, so as to implement a voice function. The application processor can analyze heart rate information based on the blood pressure beating signal acquired by the bone conduction sensor 180M, so as to realize the heart rate detection function.
The keys 190 include a power-on key, a volume key, and the like. The keys 190 may be mechanical keys. Or may be touch keys. The electronic apparatus 100 may receive a key input, and generate a key signal input related to user setting and function control of the electronic apparatus 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration cues, as well as for touch vibration feedback. For example, touch operations applied to different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also respond to different vibration feedback effects for touch operations applied to different areas of the display screen 194. Different application scenes (such as time reminding, receiving information, alarm clock, game and the like) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
Indicator 192 may be an indicator light that may be used to indicate a state of charge, a change in charge, or a message, missed call, notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card can be brought into and out of contact with the electronic apparatus 100 by being inserted into the SIM card interface 195 or being pulled out of the SIM card interface 195. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support a Nano SIM card, a Micro SIM card, a SIM card, etc. The same SIM card interface 195 can be inserted with multiple cards at the same time. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as communication and data communication. In some embodiments, the electronic device 100 employs esims, namely: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
The present embodiment also provides a computer storage medium, which stores computer instructions, and when the computer instructions are run on the electronic device 100, the electronic device 100 executes the related method steps to implement the stereo sound implementation method in the foregoing embodiments.
The present embodiment also provides a computer program product, which when running on a computer, causes the computer to execute the relevant steps described above, so as to implement the stereo sound implementation method in the above embodiments.
In addition, embodiments of the present application also provide an apparatus, which may be specifically a chip, a component or a module, and may include a processor and a memory connected to each other; the memory is used for storing computer execution instructions, and when the device runs, the processor can execute the computer execution instructions stored in the memory, so that the chip can execute the stereo realization method in the above-mentioned method embodiments.
The electronic device, the computer storage medium, the computer program product, or the chip provided in this embodiment are all configured to execute the corresponding method provided above, so that the beneficial effects achieved by the electronic device, the computer storage medium, the computer program product, or the chip may refer to the beneficial effects in the corresponding method provided above, and are not described herein again.
Through the above description of the embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the module or unit is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another device, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, that is, may be located in one place, or may be distributed to a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partially contributed to by the prior art, or all or part of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Finally, it should be noted that the above embodiments are only used for illustrating the technical solutions of the present application and not for limiting, and although the present application is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions can be made on the technical solutions of the present application without departing from the spirit and scope of the technical solutions of the present application.

Claims (45)

1. A stereo rendering system, the system comprising:
audio transmission means for:
scanning and receiving a first broadcast signal sent by a first audio receiving device, and determining the space loss of the first broadcast signal according to the transmitting power carried by the first broadcast signal;
acquiring a carrier frequency of the first broadcast signal, and calculating a first distance between the audio transmitting device and the first audio receiving device according to the carrier frequency and the space loss of the first broadcast signal;
scanning and receiving a second broadcast signal sent by a second audio receiving device, and determining the space loss of the second broadcast signal according to the transmitting power carried by the second broadcast signal;
acquiring the carrier frequency of the second broadcast signal, and calculating a 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;
calculating a sound digital signal regulation proportionality coefficient according to the first distance and the second distance;
acquiring Pulse Code Modulation (PCM) audio data, dividing the PCM audio data into first stream data and second stream data, and adjusting the volume of the first stream data according to a sound digital signal adjusting proportionality coefficient to obtain volume-adjusted first stream data;
sending the first stream data after the volume adjustment to a first audio receiving device, and sending the second stream data to a second audio receiving device;
the first audio receiving means is configured to:
sending a first broadcast signal carrying transmission power to the audio sending device;
responding to the received first streaming data after the volume adjustment, and playing the first streaming data after the volume adjustment;
the second audio receiving means is configured to:
transmitting a second broadcast signal carrying transmission power to the audio transmitting apparatus;
responding to the received second stream data, and playing the second stream data.
2. The stereo rendering system of claim 1, wherein obtaining the 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 adjustment scaling factor to obtain the volume-adjusted first stream data comprises:
responding 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.
3. The stereo rendering system of claim 2, wherein the operation of playing the audio file comprises an operation of clicking a play button on a user interface of a music play application or a video play application.
4. The stereo sound implementation system of claim 1, wherein the 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 adjustment scaling factor to obtain the volume-adjusted first stream data comprises:
a Bluetooth protocol stack interface module of the audio sending device shunts the PCM audio data to obtain first stream data and second stream data, and adjusts the volume of the first stream data according to the sound digital signal adjustment proportionality coefficient to obtain volume-adjusted first stream data;
the Bluetooth protocol stack interface module merges the volume-adjusted first stream data and the volume-adjusted second stream data into volume-adjusted PCM audio data and transmits the volume-adjusted PCM audio data to a Bluetooth protocol stack application layer module of the audio transmitting device;
the Bluetooth protocol stack application layer module transmits the PCM audio data after volume adjustment to a Bluetooth protocol stack module of the audio transmitting device;
and the Bluetooth protocol stack module encodes the PCM audio data after the volume adjustment according to a preset encoding method to obtain encoded PCM audio data.
5. The stereo rendering system of claim 4, wherein the sending the volume adjusted first stream data to a first audio sink device and the sending the second stream data to a second audio sink device comprises:
and the Bluetooth protocol stack module sends the first stream data after volume adjustment in the coded PCM audio data to the first audio receiving device, and sends the second stream data in the coded PCM audio data to the second audio receiving device.
6. The stereo realization system of claim 4, wherein the preset coding method is a subband coding method.
7. The stereo sound implementation system of claim 1, wherein the 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 adjustment scaling factor to obtain the volume-adjusted first stream data comprises:
and when the Bluetooth protocol stack interface module of the audio sending device determines that the volume adjusting mode of the first audio receiving device and the volume adjusting mode of the second audio receiving device are absolute volume adjusting modes, adjusting the volume of the first stream data according to the sound digital signal adjusting proportionality coefficient to obtain volume-adjusted first stream data.
8. The stereo sound implementation system of claim 1, wherein the 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 adjustment scaling factor to obtain the volume-adjusted first stream data comprises:
when the Bluetooth protocol stack interface module of the audio transmitting device determines that the volume adjusting mode of the first audio receiving device is an absolute volume adjusting mode and the volume adjusting mode of the second audio receiving device is a non-absolute volume adjusting mode, acquiring the volume gain of the audio transmitting device;
and adjusting the volume of the first stream data according to the sound digital signal adjustment proportionality coefficient to obtain volume-adjusted first stream data, and adjusting the second stream data according to the volume gain of the audio sending device to obtain volume-adjusted second stream data.
9. The stereo rendering system of claim 1, wherein the 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 adjustment scaling factor to obtain the volume-adjusted first stream data comprises:
and when the Bluetooth protocol stack interface module of the audio sending device determines that the volume adjusting mode of the first audio receiving device is a non-absolute volume adjusting mode and the volume adjusting mode of the second audio receiving device is an absolute volume adjusting mode, acquiring the volume gain of the audio sending device, and adjusting the volume of the first-stream data according to the sound digital signal adjusting proportionality coefficient and the volume gain of the audio sending device to obtain the first-stream data after volume adjustment.
10. The stereo rendering system of claim 1, wherein the 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 adjustment scaling factor to obtain the volume-adjusted first stream data comprises:
when the Bluetooth protocol stack interface module of the audio transmitting device determines that the volume adjusting mode of the first audio receiving device is a non-absolute volume adjusting mode and the volume adjusting mode of the second audio receiving device is a non-absolute volume adjusting mode, acquiring the volume gain of the audio transmitting device;
and adjusting the volume of the first stream data according to the sound digital signal adjustment proportionality coefficient and the volume gain of the audio sending device to obtain the first stream data after volume adjustment, and adjusting the volume of the second stream data according to the volume gain of the audio sending device to obtain the second stream data after volume adjustment.
11. A stereo rendering system as defined in any of claims 7 to 10, the system further comprising:
the bluetooth protocol stack interface module of the audio sending device merges the volume-adjusted first stream data and the volume-adjusted second stream data into volume-adjusted PCM audio data, or merges the volume-adjusted first stream data and the volume-adjusted 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 sending device;
the Bluetooth protocol stack application layer module transmits the PCM audio data after volume adjustment to a Bluetooth protocol stack module of the audio transmitting device;
and the Bluetooth protocol stack module encodes the PCM audio data after the volume adjustment according to a preset encoding method to obtain encoded PCM audio data.
12. The stereo rendering system of claim 1, wherein scanning and receiving a first broadcast signal transmitted by a first audio receiving device and determining the spatial loss of the first broadcast signal based on the transmit power carried by the first broadcast signal comprises:
acquiring the transmitting power of the first broadcast signal;
acquiring the receiving power of the first broadcast signal;
and calculating the difference value of the transmitting power of the first broadcast signal and the receiving power of the first broadcast signal to obtain the space loss of the first broadcast signal.
13. The stereo rendering system of claim 1, wherein the calculating a first distance between the audio transmitting device and the first audio receiving device based on a carrier frequency and a spatial loss of the first broadcast signal comprises:
the first distance is calculated according to the formula D1 ^ 10 ((Losdb1-32.45-20 × log10(F1))/20), where Losdb1 is the spatial loss of the first broadcast signal, F1 is the carrier frequency of the first broadcast signal, and D1 is the first distance.
14. The stereo rendering system of claim 1, wherein scanning and receiving a second broadcast signal transmitted by a second audio receiving device and determining a spatial loss of the second broadcast signal based on a transmit power carried by the second broadcast signal comprises:
acquiring the transmitting power of the second broadcast signal;
acquiring the receiving power of the second broadcast signal;
calculating the transmission power of the second broadcast signal and the reception power of the second broadcast signal determines the spatial loss of the second broadcast signal.
15. The stereo rendering system of claim 1, wherein the calculating a second distance between the audio transmitting device and the second audio receiving device based on the carrier frequency and spatial loss of the second broadcast signal comprises:
the second distance is calculated according to the formula D2 ^ 10 ((Losdb2-32.45-20 × log10(F2))/20), where Losdb2 is the spatial loss of the second broadcast signal, F2 is the carrier frequency of the second broadcast signal, and D2 is the second distance.
16. The stereo rendering system of claim 1, wherein the calculating of the sound digital signal adjustment scaling factor based on the first distance and the second distance comprises:
calculating a sound analog signal adjustment scaling factor according to the formula a-20 log10(D1/D2), wherein D1 is the first distance, D2 is the second distance, and a is the sound analog signal adjustment scaling factor;
calculating a sound digital signal adjustment scaling factor according to the formula K10 (A/20), wherein K is the sound digital signal adjustment scaling factor.
17. A stereo rendering system, the system comprising:
audio transmission means for:
transmitting a third broadcast signal carrying transmission power to the first audio receiving device;
transmitting a fourth broadcast signal carrying transmission power to a second audio receiving device;
acquiring PCM audio data, splitting the PCM audio data into first stream data and second stream data, sending the first stream data to the first audio receiving device, and sending the second stream data to the second audio receiving device; the first audio receiving means is for:
scanning and receiving the third broadcast signal, and determining the space loss of the third broadcast signal according to the transmission power carried by the third broadcast signal;
acquiring a carrier frequency of the third broadcast signal, calculating a third distance between the first audio receiving device and the audio transmitting device according to the carrier frequency of the third broadcast signal and a space loss of the third broadcast signal, and transmitting the third distance to the second audio receiving device;
responding to the received first stream data, and playing the first stream data;
second audio receiving means for:
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;
acquiring a carrier frequency of the fourth broadcast signal, and calculating a 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;
calculating a sound digital signal regulation proportionality coefficient according to the third distance and the fourth distance;
and responding to the received second stream data, adjusting the volume of the second stream data according to the sound digital signal adjusting proportionality coefficient, and playing the volume-adjusted second stream data.
18. The stereo rendering system of claim 17, wherein the scanning and receiving the third broadcast signal and determining the spatial loss of the third broadcast signal based on the transmit power carried by the third broadcast signal comprises:
acquiring the transmitting power of the third broadcast signal;
acquiring the receiving power of the third broadcast signal;
and calculating the difference value of the transmitting power of the third broadcast signal and the receiving power of the third broadcast signal to obtain the space loss of the third broadcast signal.
19. The stereo rendering system of claim 17, wherein the calculating a third distance between the first audio receiving device and the audio transmitting device based on the carrier frequency of the third broadcast signal and the spatial loss of the third broadcast signal comprises:
the third distance is calculated according to the formula D3 ^ 10 ((Losdb3-32.45-20 × log10(F3))/20), where Losdb3 is a spatial loss of the third broadcast signal, F3 is a carrier frequency of the third broadcast signal, and D3 is the third distance.
20. The stereo rendering system of claim 17, wherein scanning and receiving the fourth broadcast signal and determining the spatial loss of the fourth broadcast signal based on the transmit power carried by the fourth broadcast signal comprises:
acquiring the transmitting power of the fourth broadcast signal;
acquiring the receiving power of the fourth broadcast signal;
calculating a transmit power of the fourth broadcast signal and a receive power of the fourth broadcast signal determines a spatial loss of the fourth broadcast signal.
21. The stereo rendering system of claim 17, wherein the calculating a fourth distance between the second audio receiving device and the audio transmitting device based on the carrier frequency of the fourth broadcast signal and the spatial loss of the fourth broadcast signal comprises:
the fourth distance is calculated according to the formula D4 ^ 10 ((Losdb4-32.45-20 × log10(F4))/20), where Losdb4 is a spatial loss of the fourth broadcast signal, F4 is a carrier frequency of the fourth broadcast signal, and D4 is the fourth distance.
22. The stereo rendering system of claim 17, wherein the calculating of the sound digital signal adjustment scaling factor based on the third distance and the fourth distance comprises:
calculating a sound analog signal adjustment scaling factor according to the formula a-20 log10(D3/D4), where D3 is the third distance, D4 is the fourth distance, and a is the sound analog signal adjustment scaling factor;
calculating a sound digital signal adjustment scaling factor according to the formula K10 (A/20), wherein K is the sound digital signal adjustment scaling factor.
23. A stereo realization method applied in an audio transmission device, the method comprising:
scanning and receiving a first broadcast signal which is sent by a first audio receiving device and carries transmission power, and determining the space loss of the first broadcast signal according to the transmission power carried by the first broadcast signal;
acquiring a carrier frequency of the first broadcast signal, and calculating a first distance between the audio transmitting device and the first audio receiving device according to the carrier frequency of the first broadcast signal and the space loss of the first broadcast signal;
scanning and receiving a second broadcast signal which is sent by a second audio receiving device and carries transmission power, and determining the space loss of the second broadcast signal according to the transmission power carried by the second broadcast signal;
acquiring the frequency of the second broadcast signal, and calculating a second distance between the audio transmitting device and the second audio receiving device according to the frequency of the second broadcast signal and the space loss of the second broadcast signal;
calculating a sound digital signal regulation proportionality coefficient according to the first distance and the second distance;
obtaining PCM audio data, dividing 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 adjustment proportionality coefficient to obtain volume-adjusted first stream data;
sending the first stream data after the volume adjustment to a first audio receiving device for playing;
and sending the second stream data to a second audio receiving device for playing.
24. The stereo implementing method of claim 23, wherein the obtaining 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 adjustment scaling factor to obtain the volume-adjusted first stream data comprises:
responding 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.
25. The stereo sound implementation method of claim 24, wherein the operation of playing the audio file comprises an operation of clicking a play button on a user interface of a music play application or a video play application.
26. The stereo implementing method of claim 23, wherein the obtaining 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 adjustment scaling factor to obtain the volume-adjusted first stream data comprises:
a Bluetooth protocol stack interface module of the audio sending device shunts the PCM audio data to obtain first stream data and second stream data, and adjusts the volume of the first stream data according to the sound digital signal adjustment proportionality coefficient to obtain the volume-adjusted first stream data;
the Bluetooth protocol stack interface module merges the volume-adjusted first stream data and the volume-adjusted second stream data into volume-adjusted PCM audio data and transmits the volume-adjusted PCM audio data to a Bluetooth protocol stack application layer module of the audio transmitting device;
the Bluetooth protocol stack application layer module transmits the PCM audio data after volume adjustment to a Bluetooth protocol stack module of the audio transmitting device;
and the Bluetooth protocol stack module encodes the PCM audio data after the volume adjustment according to a preset encoding method to obtain encoded PCM audio data.
27. The stereo implementing method of claim 26, wherein the transmitting the volume-adjusted first stream data to a first audio receiving device and the transmitting the second stream data to a second audio receiving device comprises:
and the Bluetooth protocol stack module sends the first stream data after volume adjustment in the coded PCM audio data to the first audio receiving device, and sends the second stream data in the coded PCM audio data to the second audio receiving device.
28. The stereo sound implementing method of claim 23, wherein the 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 adjustment scaling factor to obtain the volume-adjusted first stream data comprises:
and when the Bluetooth protocol stack interface module of the audio sending device determines that the volume adjusting mode of the first audio receiving device and the volume adjusting mode of the second audio receiving device are absolute volume adjusting modes, adjusting the volume of the first stream data according to the sound digital signal adjusting proportionality coefficient to obtain volume-adjusted first stream data.
29. The stereo sound implementing method of claim 23, wherein the 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 adjustment scaling factor to obtain the volume-adjusted first stream data comprises:
when the Bluetooth protocol stack interface module of the audio transmitting device determines that the volume adjusting mode of the first audio receiving device is an absolute volume adjusting mode and the volume adjusting mode of the second audio receiving device is a non-absolute volume adjusting mode, acquiring the volume gain of the audio transmitting device;
and adjusting the volume of the first stream data according to the sound digital signal adjustment proportionality coefficient to obtain volume-adjusted first stream data, and adjusting the second stream data according to the volume gain of the audio sending device to obtain volume-adjusted second stream data.
30. The stereo realization method of claim 23, wherein the 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 adjustment scaling factor to obtain the volume-adjusted first stream data comprises:
and when the Bluetooth protocol stack interface module of the audio sending device determines that the volume adjusting mode of the first audio receiving device is a non-absolute volume adjusting mode and the volume adjusting mode of the second audio receiving device is an absolute volume adjusting mode, acquiring the volume gain of the audio sending device, and adjusting the volume of the first-stream data according to the sound digital signal adjusting proportionality coefficient and the volume gain of the audio sending device to obtain the first-stream data after volume adjustment.
31. The stereo realization method of claim 23, wherein the 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 adjustment scaling factor to obtain the volume-adjusted first stream data comprises:
when the Bluetooth protocol stack interface module of the audio transmitting device determines that the volume adjusting mode of the first audio receiving device is a non-absolute volume adjusting mode and the volume adjusting mode of the second audio receiving device is a non-absolute volume adjusting mode, acquiring the volume gain of the audio transmitting device;
and adjusting the volume of the first stream data according to the sound digital signal adjustment proportionality coefficient and the volume gain of the audio sending device to obtain the first stream data after volume adjustment, and adjusting the volume of the second stream data according to the volume gain of the audio sending device to obtain the second stream data after volume adjustment.
32. A stereo realization method as claimed in any one of claims 28 to 31, characterized in that the method further comprises:
the bluetooth protocol stack interface module merges the volume-adjusted first stream data and the volume-adjusted second stream data into volume-adjusted PCM audio data, or merges the volume-adjusted first stream data and the volume-adjusted second stream data into volume-adjusted PCM audio data, and transmits the volume-adjusted PCM audio data to a bluetooth protocol stack application layer module of the audio transmitting device;
the Bluetooth protocol stack application layer module transmits the PCM audio data after volume adjustment to a Bluetooth protocol stack module of the audio transmitting device;
and the Bluetooth protocol stack module encodes the PCM audio data after the volume adjustment according to a preset encoding method to obtain encoded PCM audio data.
33. The stereo implementing method of claim 23, wherein the scanning and receiving a first broadcast signal transmitted by a first audio receiving device and determining the spatial loss of the first broadcast signal according to the transmission power carried by the first broadcast signal comprises:
acquiring the transmitting power of the first broadcast signal;
acquiring the receiving power of the first broadcast signal;
and calculating the difference value of the transmitting power of the first broadcast signal and the receiving power of the first broadcast signal to obtain the space loss of the first broadcast signal.
34. The stereo implementing method of claim 23, wherein the calculating the first distance between the audio transmitting device and the first audio receiving device according to the carrier frequency and the spatial loss of the first broadcast signal comprises:
the first distance is calculated according to the formula D1 ^ 10 ((Losdb1-32.45-20 × log10(F1))/20), where Losdb1 is the spatial loss of the first broadcast signal, F1 is the carrier frequency of the first broadcast signal, and D1 is the first distance.
35. The stereo implementing method of claim 23, wherein the scanning and receiving a second broadcast signal transmitted by a second audio receiving device and determining the spatial loss of the second broadcast signal according to the transmission power carried by the second broadcast signal comprises:
acquiring the transmitting power of the second broadcast signal;
acquiring the receiving power of the second broadcast signal;
calculating the transmission power of the second broadcast signal and the reception power of the second broadcast signal determines the spatial loss of the second broadcast signal.
36. The stereo implementing method of claim 23, wherein the calculating the second distance between the audio transmitting device and the second audio receiving device according to the carrier frequency and the spatial loss of the second broadcast signal comprises:
the second distance is calculated according to the formula D2 ^ 10 ((Losdb2-32.45-20 × log10(F2))/20), where Losdb2 is the spatial loss of the second broadcast signal, F2 is the carrier frequency of the second broadcast signal, and D2 is the second distance.
37. The stereo realization method of claim 23, wherein the calculating of the sound digital signal adjustment scaling factor based on the first distance and the second distance comprises:
calculating a sound analog signal adjustment scaling factor according to the formula a-20 log10(D1/D2), wherein D1 is the first distance, D2 is the second distance, and a is the sound analog signal adjustment scaling factor;
calculating a sound digital signal adjustment scaling factor according to the formula K10 (A/20), wherein K is the sound digital signal adjustment scaling factor.
38. A method for stereo sound implementation, the method comprising:
the audio transmitting device transmits a third broadcast signal carrying transmission power to the first audio receiving device and transmits a fourth broadcast signal carrying transmission power to the second audio receiving device;
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 transmitting power carried by the third broadcast signal;
the first audio receiving device acquires a carrier frequency of the third broadcast signal, calculates a third distance between the first audio receiving device and the audio transmitting device according to the carrier frequency of the third broadcast signal and a space loss of the third broadcast signal, and transmits the third distance to the second audio receiving device;
the second audio receiving device scans and receives the fourth broadcast signal, and determines the space loss of the fourth broadcast signal according to the transmitting power carried by the fourth broadcast signal;
the second audio receiving device acquires the carrier frequency of the fourth broadcast signal, and calculates a 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;
the second audio receiving device calculates a sound digital signal regulation proportionality coefficient according to the third distance and the fourth distance;
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 second audio receiving device;
the first audio receiving device responds to the received first stream data and plays the first stream data;
and the second audio receiving device responds to the received second stream data, adjusts the volume of the second stream data according to the sound digital signal adjustment proportionality coefficient, and plays the volume-adjusted second stream data.
39. The stereo implementing method of claim 38, wherein the first audio receiving device scans for and receives the third broadcast signal and determining the spatial loss of the third broadcast signal based on the transmit power carried by the third broadcast signal comprises:
acquiring the transmitting power of the third broadcast signal;
acquiring the receiving power of the third broadcast signal;
and calculating the difference value of the transmitting power of the third broadcast signal and the receiving power of the third broadcast signal to obtain the space loss of the third broadcast signal.
40. The stereo implementing method of claim 38, wherein the calculating a 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 spatial loss of the third broadcast signal comprises:
the third distance is calculated according to the formula D3 ^ 10 ((Losdb3-32.45-20 × log10(F3))/20), where Losdb3 is a spatial loss of the third broadcast signal, F3 is a carrier frequency of the third broadcast signal, and D3 is the third distance.
41. The stereo implementing method of claim 38, wherein the second audio receiving device scans for and receives the fourth broadcast signal and determining the spatial loss of the fourth broadcast signal based on the transmit power carried by the fourth broadcast signal comprises:
acquiring the transmitting power of the fourth broadcast signal;
acquiring the receiving power of the fourth broadcast signal;
calculating a transmit power of the fourth broadcast signal and a receive power of the fourth broadcast signal determines a spatial loss of the fourth broadcast signal.
42. The stereo implementing method of claim 38, wherein the calculating a 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 spatial loss of the fourth broadcast signal comprises:
the fourth distance is calculated according to the formula D4 ^ 10 ((Losdb4-32.45-20 × log10(F4))/20), where Losdb4 is a spatial loss of the fourth broadcast signal, F4 is a carrier frequency of the fourth broadcast signal, and D4 is the fourth distance.
43. The stereo implementing method of claim 38, wherein the second audio receiving device calculating the sound digital signal adjustment scaling factor according to the third distance and the fourth distance comprises:
calculating a sound analog signal adjustment scaling factor according to the formula a-20 log10(D3/D4), where D3 is the third distance, D4 is the fourth distance, and a is the sound analog signal adjustment scaling factor;
calculating a sound digital signal adjustment scaling factor according to the formula K10 (A/20), wherein K is the sound digital signal adjustment scaling factor.
44. An electronic device, comprising a memory and a processor:
wherein the memory is to store program instructions;
the processor configured to read and execute the program instructions stored in the memory, and when the program instructions are executed by the processor, the electronic device is caused to perform the stereo sound implementation method according to any one of claims 23 to 43.
45. A computer storage medium having stored thereon program instructions which, when run on an electronic device, cause the electronic device to perform the stereo sound implementation method of any one of claims 23 to 43.
CN202110642600.8A 2021-06-09 2021-06-09 Stereo sound implementation system, method, electronic device, and storage medium Active CN113542984B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110642600.8A CN113542984B (en) 2021-06-09 2021-06-09 Stereo sound implementation 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 sound implementation system, method, electronic device, and storage medium

Publications (2)

Publication Number Publication Date
CN113542984A true CN113542984A (en) 2021-10-22
CN113542984B 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 sound implementation system, method, electronic device, and storage medium

Country Status (1)

Country Link
CN (1) CN113542984B (en)

Citations (8)

* Cited by examiner, † Cited by third party
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
US20130208895A1 (en) * 2012-02-15 2013-08-15 Harman International Industries, Incorporated Audio surround processing system
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

Patent Citations (8)

* Cited by examiner, † Cited by third party
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
US20130208895A1 (en) * 2012-02-15 2013-08-15 Harman International Industries, Incorporated Audio surround processing system
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
CN113542984B (en) 2022-04-15

Similar Documents

Publication Publication Date Title
CN113228701B (en) Audio data synchronization method and device
CN112789883B (en) Rate control method, device and computer storage medium
CN111369988A (en) Voice awakening method and electronic equipment
CN112312366B (en) Method, electronic equipment and system for realizing functions through NFC (near field communication) tag
CN114726946A (en) Method for automatically switching Bluetooth audio coding modes and electronic equipment
CN112771828B (en) Audio data communication method and electronic equipment
CN112651510A (en) Model updating method, working node and model updating system
CN111930335A (en) Sound adjusting method and device, computer readable medium and terminal equipment
CN113126948A (en) Audio playing method and related equipment
CN111065020B (en) Method and device for processing audio data
WO2022257563A1 (en) Volume adjustment method, and electronic device and system
CN114257920B (en) Audio playing method and system and electronic equipment
CN114880251A (en) Access method and access device of storage unit and terminal equipment
CN113438643B (en) Terminal capability reporting system, method, electronic equipment and storage medium
CN109285563B (en) Voice data processing method and device in online translation process
CN113542984B (en) Stereo sound implementation system, method, electronic device, and storage medium
CN113467747B (en) Volume adjusting method, electronic device and storage medium
WO2022095752A1 (en) Frame demultiplexing method, electronic device and storage medium
CN113506566B (en) Sound detection model training method, data processing method and related device
CN114120987B (en) Voice wake-up method, electronic equipment and chip system
CN115706755A (en) Echo cancellation method, electronic device, and storage medium
CN116962937A (en) Wearing equipment, pickup method and device
CN114120950A (en) Human voice shielding method and electronic equipment
CN115480250A (en) Voice recognition method and device, electronic equipment and storage medium
CN111885768A (en) Method, electronic device and system for adjusting light source

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