WO2023273701A1 - Coding control method and apparatus, wireless earphone, and storage medium - Google Patents

Coding control method and apparatus, wireless earphone, and storage medium Download PDF

Info

Publication number
WO2023273701A1
WO2023273701A1 PCT/CN2022/094710 CN2022094710W WO2023273701A1 WO 2023273701 A1 WO2023273701 A1 WO 2023273701A1 CN 2022094710 W CN2022094710 W CN 2022094710W WO 2023273701 A1 WO2023273701 A1 WO 2023273701A1
Authority
WO
WIPO (PCT)
Prior art keywords
wireless earphone
audio data
parameter
wireless
target
Prior art date
Application number
PCT/CN2022/094710
Other languages
French (fr)
Chinese (zh)
Inventor
许逸君
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2023273701A1 publication Critical patent/WO2023273701A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R1/00Details of transducers, loudspeakers or microphones
    • H04R1/10Earpieces; Attachments therefor ; Earphones; Monophonic headphones
    • H04R1/1041Mechanical or electronic switches, or control elements
    • 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/04Speech 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 predictive techniques
    • G10L19/16Vocoder architecture
    • G10L19/18Vocoders using multiple modes
    • G10L19/24Variable rate codecs, e.g. for generating different qualities using a scalable representation such as hierarchical encoding or layered encoding
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the present application relates to the technical field of audio processing, and more specifically, to an encoding control method and device, a wireless earphone and a storage medium.
  • TWS True Wireless Stereo
  • Current wireless earphones are usually provided with a microphone for sound collection in a recording scene.
  • the wireless earphones are used for recording, since the audio data of two channels will be collected, the wireless earphones are prone to stuttering when transmitting the collected two-channel audio data to the electronic device, resulting in stuttering or disconnection of the recording. continued.
  • the present application proposes an encoding control method, device, wireless earphone and storage medium.
  • the embodiment of the present application provides an encoding control method, which is applied to a first wireless earphone, the first wireless earphone is connected to a second wireless earphone and an electronic device, and the first wireless earphone and the second wireless earphone The wireless earphones are all provided with an audio collection device.
  • the method includes: during the audio collection process of the first wireless earphone and the second wireless earphone, the first wireless earphone respectively collects the first wireless earphone and the second wireless earphone and passes The encoded audio data is sent to the electronic device; the communication quality parameter of the wireless communication between the first wireless earphone and the electronic device is obtained; the target code rate corresponding to the communication quality parameter is obtained, and the The first wireless earphone and the second wireless earphone encode the collected audio data at the target bit rate.
  • the embodiment of the present application provides an encoding control device, which is applied to a first wireless earphone, the first wireless earphone is connected to a second wireless earphone and an electronic device, and the first wireless earphone and the second wireless earphone
  • the wireless earphones are all provided with an audio collection device, and the device includes: a data transmission module, a quality acquisition module and a code rate control module, wherein the data transmission module is used to transmit data between the first wireless earphone and the second wireless earphone
  • the first wireless earphone sends the encoded audio data collected by the first wireless earphone and the second wireless earphone to the electronic device;
  • the quality acquisition module is used to Obtain a communication quality parameter of wireless communication between the first wireless earphone and the electronic device;
  • the bit rate control module is used to acquire a target bit rate corresponding to the communication quality parameter, and control the first wireless earphone
  • the second wireless earphone encodes the collected audio data at the target bit rate.
  • the embodiment of the present application provides a wireless headset, including: one or more processors; memory; one or more application programs, wherein the one or more application programs are stored in the memory and The one or more programs are configured to be executed by the one or more processors, and the one or more programs are configured to execute the encoding control method provided in the first aspect above.
  • the embodiment of the present application provides a computer-readable storage medium, where program code is stored in the computer-readable storage medium, and the program code can be invoked by a processor to execute the code provided in the first aspect above. Control Method.
  • FIG. 1 shows a schematic diagram of an application environment provided by an embodiment of the present application.
  • FIG. 2 shows another schematic diagram of an application environment provided by an embodiment of the present application.
  • FIG. 3 shows another schematic diagram of an application environment provided by an embodiment of the present application.
  • Fig. 4 shows a flowchart of an encoding control method according to an embodiment of the present application.
  • Fig. 5 shows a flowchart of an encoding control method according to another embodiment of the present application.
  • Fig. 6 shows a flowchart of an encoding control method according to yet another embodiment of the present application.
  • FIG. 7 shows a schematic diagram of an application scenario provided by an embodiment of the present application.
  • FIG. 8 shows another schematic diagram of an application scenario provided by an embodiment of the present application.
  • FIG. 9 shows another schematic diagram of an application scenario provided by an embodiment of the present application.
  • FIG. 10 shows a schematic diagram of the principles of the encoding control method provided by the embodiment of the present application.
  • Fig. 11 shows a flowchart of an encoding control method according to yet another embodiment of the present application.
  • Fig. 12 shows a flowchart of an encoding control method according to yet another embodiment of the present application.
  • Fig. 13 shows a flowchart of an encoding control method according to yet another embodiment of the present application.
  • Fig. 14 shows a block diagram of an encoding control device according to an embodiment of the present application.
  • Fig. 15 is a block diagram of a wireless earphone for executing the coding control method according to the embodiment of the present application according to the embodiment of the present application.
  • Fig. 16 is a storage unit for storing or carrying program codes for implementing the encoding control method according to the embodiment of the present application according to the embodiment of the present application.
  • TWS True Wireless Stereo
  • Binaural audio recording technology (Binaural Audio) is a recording technology that highly restores the real sense of hearing. It is equipped with microphones at the two ears of the artificial head, so that it can capture the sound reaching each ear. Two signals can be reproduced on each ear separately. This kind of reproduction is not suitable for monophonic playback, and if you use speakers to play it, it will not achieve the expected effect. Therefore, headphones are usually used to completely isolate the sound signals received by the two ears. This method can make the artificial head completely Replicate what the audience heard.
  • the microphones can be set separately on the two earphones of the TWS earphone to collect sound, which can achieve the effect of the above binaural recording technology.
  • the two earphones of the TWS headset After the two earphones of the TWS headset collect audio data, they need to transmit the recorded two-channel audio to the mobile phone Bluetooth through the Bluetooth protocol. Due to the need to ensure the recorded sound field, the format of the recorded audio must be at least 48khz (kilohertz), 16bit (bit), 2 channels. At this time, the bandwidth after compression also needs to be at least 400-500kbps (kilobits per second). If Bluetooth When the signal fluctuates or the earphone is far away from the mobile phone, the transmission bandwidth will become smaller, and the transmission process is also prone to stuttering or interruption, resulting in stuttering or intermittent recording.
  • the inventor proposed the encoding control method, device, wireless earphone and storage medium provided by the embodiment of the present application, which can realize the transmission of audio data to the electronic device during the recording process of the first wireless earphone and the second wireless earphone.
  • the first wireless earphone of the device according to the communication quality parameters of the wireless communication between it and the electronic device, controls the code rate of the audio data encoded by the first wireless earphone and the second wireless earphone, so as to avoid stuttering during audio data transmission , causing the recorded audio to appear stuck or intermittent, which improves the recording effect.
  • the application environment corresponding to the encoding control method includes a recording system 10 , and the recording system 10 includes an electronic device 11 , a first wireless earphone 12 and a second wireless earphone 13 .
  • the electronic device 11 may be a smart phone, a tablet computer, an e-book, a smart wearable device, etc., which can run application programs and have the function of collecting audio signals.
  • the first wireless earphone 12 and the second wireless earphone 13 form a true wireless stereo (True Wireless Stereo, TWS) earphone, wherein, the left and right earphones of the TWS earphone are independent of each other, without the need for cables to be connected, and the wireless separation of the left and right channels can be realized. .
  • TWS True Wireless Stereo
  • the first wireless earphone 12 and the second wireless earphone 13 can respectively collect the sound of the left and right channels.
  • an application program capable of collecting audio is installed in the electronic device 11 , specifically, the application program may be audio playback software, video playback software, or call software, or other software capable of triggering audio playback.
  • Both the first wireless earphone 12 and the second wireless earphone 13 may be provided with an audio collection device, for example, a microphone.
  • the first wireless earphone 12 and the second wireless earphone 13 may be provided with an audio collection device to collect audio signals, and the electronic device 11 processes the audio signals to generate audio files.
  • the electronic device 11 may also send the audio to be played to at least one of the first wireless earphone 12 and the second wireless earphone 13 , and at least one of the first wireless earphone 12 and the second wireless earphone 13 plays the voice.
  • the electronic device 11 can be connected to the first wireless earphone 12 and the second wireless earphone 13 at the same time.
  • the first wireless earphone 12 and the second wireless earphone 13 can directly send audio data to the electronic device 11 , or receive and play the audio data sent by the electronic device 11 .
  • the electronic device 11 is connected to the first wireless earphone 12 through Bluetooth, and then the first wireless earphone 12 is connected to the second wireless earphone 13 through Bluetooth, so that the electronic device 11,
  • the first wireless earphone 12 and the second wireless earphone 13 are connected simultaneously through networking, that is, the first wireless earphone 12 acts as a repeater between the electronic device 11 and the second wireless earphone 13 .
  • the electronic device 11, the first wireless earphone 12 and the second wireless earphone 13 are connected in the manner shown in FIG. from the headset.
  • FIG. 4 shows a schematic flowchart of an encoding control method provided by an embodiment of the present application.
  • the encoding method can be applied to the above-mentioned recording system.
  • the execution body of the method can be the first wireless earphone, and the first wireless earphone and the second wireless earphone are both equipped with audio collection device, and the first wireless earphone and the second wireless earphone adopt the connection method shown in Figure 4.
  • the flow shown in Figure 4 will be described in detail below, and the encoding control method may specifically include the following steps:
  • Step S110 During the audio collection process of the first wireless earphone and the second wireless earphone, the first wireless earphone collects and codes the first wireless earphone and the second wireless earphone respectively audio data sent to the electronic device.
  • the first wireless earphone is connected to the electronic device and the second wireless earphone as the main earphone, and when the first wireless earphone and the second wireless earphone are used for recording, the first wireless earphone and the second wireless earphone can respectively collect audio data, and The collected audio data is encoded to obtain audio data for transmission to the electronic device.
  • the audio data obtained after the first wireless earphone encodes the collected audio data can be used as the audio data corresponding to one of the two channels; the audio data obtained after the second wireless earphone encodes the collected audio data can be As the audio data corresponding to the other channel in the dual channel.
  • the audio data collected by the first wireless headset and encoded may be audio data corresponding to the left channel
  • the audio data collected by the second wireless headset and encoded may be audio data corresponding to the right channel
  • the encoded audio data collected by the first wireless earphone may be audio data corresponding to the right channel
  • the encoded audio data collected by the second wireless earphone may be audio data corresponding to the left channel.
  • the first wireless earphone when recording through the first wireless earphone and the second wireless earphone, during the process of audio data collection by the first wireless earphone and the second wireless earphone, the first wireless earphone is the main device connected to the electronic device.
  • the encoded audio data collected by the first wireless earphone and the encoded audio data collected by the second wireless earphone can be sent to the electronic device through the first wireless earphone.
  • the second wireless earphone also collects the audio data and encodes it to obtain the other audio data of the two channels.
  • the electronic device may receive the binaural audio data acquired by the first wireless earphone and the second wireless earphone, and generate an audio file according to the received audio data.
  • the first wireless earphone and the second wireless earphone when used in the recording process, the first wireless earphone and the second wireless earphone may be in a wearing state or in a non-wearing state.
  • a first wireless earphone and a second wireless earphone can be worn by the same user on the left and right ear, so that the sound reaching each ear position can be captured, and the recorded audio can be reproduced on each ear separately when played.
  • the first wireless headset and the second wireless headset can be worn by different users in the same real scene, so that audio data at different spatial positions in the space where the real scene is located can be collected, and the recorded audio can be reproduced when played.
  • the first wireless earphone can be worn, and the second wireless earphone can be in the state of being held, thus, the recording in the interview scene can be realized.
  • the wearing state of the first wireless earphone and the second wireless earphone when used for recording may not be limited.
  • the voice of a specified user may also be collected.
  • the first wireless headset and the second wireless headset can collect the voice of the specified user according to the phase angle between the sound source and the specified user, or according to the voiceprint characteristics of the specified user, to obtain the audio data of the specified user.
  • the first wireless earphone and the second wireless earphone can collect the voice of the same user, for example, collect the teaching audio of the teacher in the teaching scene;
  • a wireless earphone and a second wireless earphone can also be used by the user to collect the voices of different users.
  • the first wireless earphone can be used to collect the interviewer's voice
  • the second wireless earphone can be used for the interviewee's voice. sound.
  • the specific application scenarios when the first wireless earphone and the second wireless earphone are used for recording may not be limited.
  • the first wireless earphone and the second wireless earphone can collect and encode the audio data respectively.
  • the encoded audio data is combined into audio data packets.
  • the audio data collected and encoded by the first wireless earphone and the second wireless earphone respectively contain time stamps
  • the first wireless earphone may, according to the time stamps contained in the audio data
  • the audio data with the same time stamp among the audio data acquired by the earphone and the second wireless earphone are combined to obtain an audio data packet for sending to the electronic device.
  • the first wireless earphone and the second wireless earphone can generate audio data packets according to the audio data generated within the same duration.
  • the data packets are synchronized.
  • the audio data packets generated by the first wireless earphone and the second wireless earphone are merged.
  • the audio data packets generated subsequently do not need to be synchronized, and can be directly merged to be sent to the electronic device. Audio packets for the device.
  • Step S120 Obtain a communication quality parameter of the wireless communication between the first wireless earphone and the electronic device.
  • the first wireless earphone can obtain the communication quality parameters of the wireless communication between the first wireless earphone and the electronic device during the recording process, so that the communication quality parameters between the first wireless earphone and the electronic device can be determined according to the communication quality parameters.
  • the communication quality of the wireless communication between the devices is to dynamically control the coding rate of the audio data collected by the first wireless earphone and the second wireless earphone, so that the first wireless earphone needs to transmit the audio data to the electronic device.
  • the bandwidth is different to avoid lag during transmission.
  • the first wireless earphone can detect the communication quality parameter of the wireless communication between the first wireless earphone and the electronic device in real time, so as to control the audio data collected by the first wireless earphone and the second wireless earphone according to the communication quality parameter
  • the encoding bit rate for encoding so that the encoding bit rate matches the communication quality
  • the first wireless earphone can also obtain the communication quality parameters of the wireless communication between the first wireless earphone and the electronic device according to the set frequency, for example, the first wireless earphone
  • the communication quality parameter of the wireless communication between the first wireless earphone and the electronic device may be acquired every 10 seconds.
  • the communication quality parameters may include one or more of the following parameters: received signal strength, retransmission rate, packet loss rate, and channel occupancy ratio. It can be understood that the obtained communication quality parameter may reflect the communication quality of the wireless communication between the first wireless earphone and the electronic device. Of course, the specific communication quality parameter may not be limited. For example, the communication quality parameter may also include the magnitude vector difference Wait.
  • the communication quality parameter may include Bluetooth received signal strength.
  • the first wireless earphone obtains the Bluetooth received signal strength, it can determine the first received signal strength according to the broadcast sent by the electronic device, and can obtain the second received signal strength detected by the electronic device from the electronic device, and then determine the first received signal strength according to the first received signal strength. strength and the second received signal strength, and calculate the third received signal strength as the Bluetooth received signal strength between the first wireless earphone and the electronic device.
  • the average value of the first received signal strength and the second received signal strength may be obtained as the third received signal strength, and for example, according to the weight corresponding to the first received signal strength and the weight corresponding to the second received signal strength, the The first received signal strength and the second received signal strength are weighted to obtain the third received signal strength.
  • the first wireless earphone can detect 8192 times within 1 second, and calculate the average value to obtain the first received signal strength.
  • the communication quality parameter may include a retransmission rate.
  • the first wireless earphone can obtain the ratio between the number of automatically retransmitted reports and the preset number after sending a preset number of data packets to the electronic device, so as to obtain the retransmission rate.
  • the first wireless earphone may also obtain the number of data packets sent within the target duration as the first number, and the number of automatically retransmitted data packets as the second number, and then obtain the second number and the first number A ratio of the number to get the retransmission rate.
  • Step S130 Obtain a target bit rate corresponding to the communication quality parameter, and control the first wireless earphone and the second wireless earphone to encode the collected audio data at the target bit rate.
  • the first wireless earphone after the first wireless earphone acquires the above communication quality parameters, it can respectively control the coding rate of the first wireless earphone and the second wireless earphone to encode the collected audio data according to the communication quality parameters. , so that the encoding bit rate matches the communication quality parameters, and avoids lag when the audio data is transmitted to the electronic device due to a high encoding bit rate when the communication quality is poor.
  • the first wireless earphone can determine a corresponding target bit rate according to the communication quality parameter, and control the first wireless earphone and the second wireless earphone to encode the collected audio data at the target bit rate.
  • the first wireless earphone can determine the encoding bit rate that matches the communication quality parameter as the target bit rate, and then control the first wireless earphone to encode at the target bit rate; in addition, the determined target bit rate can be sent to to the second wireless earphone, so as to instruct the second wireless earphone to encode at the target bit rate, so as to control the encoding bit rates of the first wireless earphone and the second wireless earphone respectively according to the communication quality parameters.
  • the first wireless earphone can determine the corresponding encoding bit rate as the target bit rate according to the communication quality parameter, and then control the first wireless earphone to encode at the target bit rate; in addition, the communication quality parameter can be After sending to the second wireless earphone, the second wireless earphone determines the corresponding target bit rate according to the same method of determining the encoding bit rate according to the communication quality parameters, and then controls the second wireless earphone to encode at the target bit rate.
  • the first wireless earphone used to transmit audio data to the electronic device, according to the wireless communication between the first wireless earphone and the electronic device
  • the communication quality parameter controls the bit rate at which the first wireless earphone and the second wireless earphone encode audio data, so that the encoding bit rate adapts to the communication quality parameter, and avoids the stuttering of the audio data transmission, resulting in the recorded audio There is a stutter or intermittent, which improves the recording effect.
  • FIG. 5 shows a schematic flowchart of an encoding control method provided by another embodiment of the present application, and the encoding control method is applied to the above-mentioned first wireless earphone.
  • the communication quality parameters acquired by the first wireless earphone may include multiple quality parameters.
  • the flow shown in Figure 5 will be described in detail below, and the encoding control method may specifically include the following steps:
  • Step S210 During the process of audio collection by the first wireless earphone and the second wireless earphone, the first wireless earphone collects and codes the first wireless earphone and the second wireless earphone respectively audio data sent to the electronic device.
  • Step S220 Obtain a communication quality parameter of the wireless communication between the first wireless earphone and the electronic device.
  • step S210 and step S220 in the embodiment of the present application, reference may be made to the contents of other embodiments for step S210 and step S220, and details are not repeated here.
  • Step S230 According to the various quality parameters, determine a corresponding coding rate as a target rate.
  • the communication quality parameters obtained by the first wireless earphone and the electronic device for wireless communication may include various quality parameters, so as to synthesize the various quality parameters to determine the correspondence between the first wireless earphone and the second wireless earphone.
  • the encoding bit rate of is used as the target bit rate.
  • the multiple quality parameters may include at least received signal strength, retransmission rate, and packet loss rate, and of course, the multiple quality parameters may also include more parameters for reflecting the communication quality between the first wireless earphone and the electronic device, For example, parameters such as channel occupancy ratio may also be included.
  • the correspondence between the encoding bit rate and different parameter values of various quality parameters may be preset, and the first wireless earphone may search for the corresponding relationship, and the obtained parameter values of various quality parameters For the corresponding encoding bit rates, the encoding bit rates corresponding to the first wireless earphone and the second wireless earphone are obtained as target bit rates.
  • the first wireless earphone can judge whether the current encoding bit rate satisfies the first condition according to various quality parameters.
  • the conditions for smooth transmission when transmitting to electronic devices under these quality parameters if the current encoding bit rate does not meet the first condition, the encoding bit rate can be reduced to avoid jamming during transmission; if the current encoding bit rate If the code rate satisfies the first condition, it is further judged whether the current encoding rate meets the second condition.
  • the second condition is that after increasing the encoding rate, it can be transmitted smoothly to the electronic device under various quality parameters obtained.
  • the encoding bit rate can be increased to improve the quality of the audio data transmitted to the electronic device; if the current encoding bit rate does not meet the second condition, the current encoding bit rate can be maintained The code rate remains unchanged.
  • the specific manner in which the first wireless earphone determines the target code rate according to various quality parameters may not be limited.
  • the first wireless earphone may determine whether various quality parameters meet corresponding parameter conditions, and determine the corresponding code rate as the target code rate according to the judgment result.
  • Step S240 respectively controlling the first wireless earphone and the second wireless earphone to encode the collected audio data at the target bit rate.
  • the first wireless earphone after the first wireless earphone determines the target code rate, it can respectively control the first wireless earphone and the second wireless earphone to encode the collected audio data at the target code rate.
  • the first wireless earphone can be controlled to adjust the encoding bit rate to the target bit rate; in addition, the target bit rate can be sent to the second wireless earphone to indicate that the first wireless earphone The second wireless earphone adjusts the coding bit rate to the target bit rate.
  • both the first wireless earphone and the second wireless earphone are equipped with the same logic of determining the corresponding code rate as the target code rate according to various quality parameters above, then when controlling the encoding code rate of the second wireless earphone At this time, various quality parameters may also be sent to the second wireless earphone, so that the second wireless earphone may determine the bit rate corresponding to the various quality parameters according to the logic, and then adjust the encoding bit rate to the bit rate.
  • the first wireless earphone is used to transmit audio data to the electronic device, and the wireless communication between it and the electronic device is integrated.
  • a variety of quality parameters are used to control the bit rate at which the first wireless earphone and the second wireless earphone encode audio data, thereby enabling the encoding bit rate and various quality parameters of the first wireless earphone and the second wireless earphone to be encoded.
  • the parameters are adapted to avoid stuttering during audio data transmission, resulting in stuttering or intermittent audio recording, which improves the recording effect.
  • FIG. 6 shows a schematic flowchart of an encoding control method provided by another embodiment of the present application, and the encoding control method is applied to the above-mentioned first wireless earphone.
  • the communication quality parameters acquired by the first wireless earphone may include multiple quality parameters.
  • the process shown in Figure 6 will be described in detail below, and the encoding control method may specifically include the following steps:
  • Step S310 During the audio collection process of the first wireless earphone and the second wireless earphone, the first wireless earphone collects and codes the first wireless earphone and the second wireless earphone respectively audio data sent to the electronic device.
  • Step S320 Obtain a communication quality parameter of the wireless communication between the first wireless earphone and the electronic device.
  • step S310 and step S320 in this embodiment of the present application, reference may be made to the contents of other embodiments for step S310 and step S320, and details are not repeated here.
  • Step S330 Obtain the number of quality parameters that meet the corresponding preset parameter conditions among the various quality parameters, where each quality parameter corresponds to a preset parameter condition.
  • each quality parameter obtained by the first wireless earphone may correspond to a preset parameter condition, and the preset parameter condition is used to determine whether the quality parameter satisfies smooth transmission of audio data. to electronic equipment.
  • the first wireless earphone may match each quality parameter with a preset parameter condition corresponding to each quality parameter, and then determine the number of quality parameters satisfying the corresponding preset parameter condition. Understandably, the more quality parameters satisfying the preset parameter condition, the better the communication quality of the wireless communication between the first wireless earphone and the electronic device.
  • the preset parameter condition may be a parameter value condition.
  • Each quality parameter may correspond to multiple parameter values, for example, each quality parameter is a plurality of parameter values of the type of quality parameter obtained within a preset time period.
  • the first wireless earphone can obtain the target parameter value corresponding to each quality parameter based on multiple parameter values corresponding to each quality parameter; match the target parameter value corresponding to each quality parameter with the corresponding parameter value condition, wherein each One quality parameter corresponds to one parameter value condition; the number of target quality parameters among the multiple quality parameters is obtained, wherein the target parameter value of the target quality parameter matches the corresponding parameter value condition.
  • the first wireless earphone acquires the target parameter value corresponding to each quality parameter based on the multiple parameter values corresponding to each quality parameter, which may be, acquires the average value of the multiple parameter values corresponding to each quality parameter, as Target parameter values for each quality parameter.
  • the parameter value condition may be: the received signal strength is between -105dBm (decibel milliwatt) ⁇ -95dBm; when the quality parameter is the retransmission rate, the parameter value condition may be: the retransmission rate less than 0.05.
  • the specific parameter value conditions may not be limited, and may be set according to actual requirements.
  • the first wireless earphone may acquire a target parameter value corresponding to each quality parameter and a change trend corresponding to each quality parameter based on multiple parameter values corresponding to each quality parameter;
  • the target parameter value corresponding to the quality parameter is matched with the corresponding parameter value condition, wherein each quality parameter corresponds to a parameter value condition; the quantity of the target quality parameter among various quality parameters is obtained, wherein the target parameter value of the target quality parameter is matched with The corresponding parameter value conditions match, and the change trend corresponding to the target quality parameter is not a decreasing trend.
  • the multiple parameter values corresponding to each quality parameter may be parameter values obtained within a preset time period, and the first wireless earphone may also determine each quality parameter value based on the multiple parameter values corresponding to each quality parameter.
  • the change trend of the parameters, and whether each quality parameter satisfies its corresponding parameter value condition and the change trend of each quality parameter determine the quantity of quality parameters that meet the corresponding preset parameter condition. It can be understood that, for a certain quality parameter, if it satisfies the corresponding parameter value condition at the same time, and its change trend is not a decreasing trend, it means that the communication quality represented by the quality parameter is better.
  • Step S340 Based on the quantity, determine a corresponding coding rate as a target rate, wherein the coding rate is positively correlated with the quantity.
  • the corresponding coding rate may be determined as the target bit rate based on the number. Since the greater the determined above quantity, it means that the communication quality between the first wireless earphone and the electronic device is better, so the coding bit rate can be positively correlated with the quantity, that is to say, the larger the quantity, the better the communication quality , so the encoding rate is higher.
  • the first wireless earphone stores the correspondence between the encoding code rate and the quantity, and the first wireless earphone can determine the encoding code rate corresponding to the above-determined quantity by searching for the correspondence, And use the encoding bit rate as the target bit rate.
  • the encoding bit rate includes three ranges, 100 ⁇ 200kbps, 200 ⁇ 300kbps, and 300 ⁇ 400kbps; when starting to record, the initial compression bit rate is set to the highest, that is, under normal circumstances, the communication quality is better , at this time, a high bit rate is used for encoding, and the recorded sound quality is the best; in the subsequent recording process, the encoding can be determined according to the received signal strength and the number of parameters in the retransmission rate that meet the corresponding preset parameter conditions.
  • the encoding code rate can be 300-400kbps; if one of the received signal strength and retransmission rate meets its corresponding preset parameter conditions , the coding rate can be in the range of 200-300kbps; if the received signal strength and the retransmission rate do not have the corresponding preset parameter conditions, the coding rate can be in the range of 100-200kbps.
  • the various quality parameters obtained at this time the quality that satisfies the preset parameter conditions
  • the number of parameters is M; please refer to FIG. 8, if the user wears the first wireless earphone 12 and the second wireless earphone 13, and the electronic device 11 is placed in the pocket of the clothes, the various quality parameters obtained satisfy the preset
  • the quantity of the quality parameter of the parameter condition is N; Wherein, N and M are positive integers, since the electronic device 11 is in the pocket in Fig.
  • the wireless communication between the first wireless earphone 12 and the electronic device 13 will be affected, so obtain N will be smaller than M, that is, the communication quality in the scenario shown in Figure 8 will be worse than that in the scenario shown in Figure 7.
  • the encoding rate determined based on N is lower than the encoding rate determined based on M. bit rate, thereby ensuring that when the electronic device 11 is in the pocket, there will be no stuttering or intermittent recording.
  • the user wears the first wireless earphone 12 and the second wireless earphone 13, and holds the electronic device 11, among the various quality parameters obtained at this time, those that meet the preset parameter conditions
  • the number of quality parameters is M; please refer to FIG. 9, if the user wears the first wireless earphone 12 and the second wireless earphone 13, and the electronic device 11 is placed on a desktop far away, the various quality parameters obtained at this time
  • the number of quality parameters that meet the preset parameter conditions is T; wherein, M and T are positive integers. Since the electronic device 11 is placed on the desktop in FIG.
  • the wireless communication between will be affected, so the obtained T will be smaller than M, that is to say, the communication quality in Figure 9 will be worse than that in Figure 7, at this time, the coding rate determined based on T is lower than that based on The coding rate determined by M ensures that when the electronic device 11 is at a certain distance from the user, there will be no stuttering or intermittent recording.
  • Step S350 respectively controlling the first wireless earphone and the second wireless earphone to encode the collected audio data at the target bit rate.
  • the first wireless earphone after the first wireless earphone determines the target code rate, it can respectively control the first wireless earphone and the second wireless earphone to encode the collected audio data at the target code rate.
  • the first wireless earphone can be controlled to adjust the encoding bit rate to the target bit rate; in addition, the target bit rate can be sent to the second wireless earphone to indicate that the first wireless earphone The second wireless earphone adjusts the coding bit rate to the target bit rate.
  • both the first wireless earphone and the second wireless earphone are equipped with the same logic of determining the corresponding code rate as the target code rate according to various quality parameters above, then when controlling the encoding code rate of the second wireless earphone At this time, various quality parameters may also be sent to the second wireless earphone, so that the second wireless earphone may determine the bit rate corresponding to the various quality parameters according to the logic, and then adjust the encoding bit rate to the bit rate.
  • the first wireless earphone is provided with a TWS module, a stability identification module, a code rate control module, an encoder and an SPP (Serial Port Profile, Bluetooth serial port transmission protocol) transmission module, and the second wireless earphone
  • a TWS module a stability identification module
  • a code rate control module an encoder and an SPP (Serial Port Profile, Bluetooth serial port transmission protocol) transmission module
  • SPP Serial Port Profile, Bluetooth serial port transmission protocol
  • the TWS module of the second wireless earphone is used to transmit the collected and encoded audio data to the first wireless earphone;
  • the stability recognition module of the first wireless earphone is used to obtain communication quality parameters, and the code rate control module is used to Communication quality parameters, determine the eigenvalue of the corresponding encoding code rate, and then send the eigenvalue to the encoder, and the encoder adjusts the encoding bit rate to the corresponding bit rate according to the eigenvalue;
  • the stability recognition module of the first wireless earphone can also set the The obtained communication quality parameters are sent to the code rate control module of the second wireless earphone.
  • the code rate control module in the second wireless earphone can determine the characteristic value of the corresponding encoding code rate according to the communication quality parameter, and then send the characteristic value to To the encoder, the encoder adjusts the encoding bit rate to the corresponding bit rate according to the feature value.
  • the encoding bit rates of the first wireless earphone and the second wireless earphone may be the same or different.
  • the first wireless earphone may also obtain a communication quality parameter of the wireless communication with the second wireless earphone, and then determine the corresponding encoding code rate as the first code rate according to the communication quality parameter, wherein determining the encoding code rate
  • the method can refer to the above method of determining the encoding code rate according to the communication quality parameters; if the first code rate is the same as the above target code rate, the first wireless earphone and the second wireless earphone can be controlled to encode at the target code rate; if the first If the bit rate is lower than the target bit rate, the second wireless earphone can be controlled to encode at the first bit rate, and the first wireless earphone can be controlled to encode at the target bit rate.
  • the second wireless earphone can be sent After the audio data of the audio data is adjusted to the audio data of the target code rate, and then merged to obtain the audio data of the target code rate, it can ensure the smooth transmission of audio data between the second wireless earphone and the first wireless earphone, and make The quality of the audio data obtained after the encoding of the first wireless earphone is relatively good; if the first bit rate is lower than the target bit rate, at this time, it is necessary to give priority to ensuring smooth audio data transmission between the first wireless earphone and the electronic device, so , it is possible to control both the first wireless earphone and the second wireless earphone to encode at the target bit rate, thereby ensuring smooth communication between the second wireless earphone and the first wireless earphone, and between the first wireless earphone and the electronic device. Carry out the transmission of audio data.
  • the first wireless earphone used to transmit audio data to the electronic device according to the wireless communication between the first wireless earphone and the electronic device
  • a variety of quality parameters determine the number of quality parameters that meet the corresponding preset parameter adjustment conditions, and determine the corresponding encoding bit rate according to the number, so that the first wireless earphone and the second wireless earphone can encode the encoding code
  • the rate is adapted to a variety of quality parameters, avoiding stuttering during audio data transmission, resulting in stuttering or intermittent recording of audio, and improving the recording effect.
  • FIG. 11 shows a schematic flowchart of an encoding control method provided by another embodiment of the present application, and the encoding control method is applied to the above-mentioned first wireless earphone.
  • the communication quality parameters acquired by the first wireless earphone may include multiple quality parameters.
  • the flow shown in Figure 11 will be described in detail below, and the encoding control method may specifically include the following steps:
  • Step S410 During the process of audio collection by the first wireless earphone and the second wireless earphone, the first wireless earphone collects and codes the first wireless earphone and the second wireless earphone respectively audio data sent to the electronic device.
  • Step S420 Obtain a communication quality parameter of the wireless communication between the first wireless earphone and the electronic device.
  • step S310 and step S320 in this embodiment of the present application, reference may be made to the contents of other embodiments for step S310 and step S320, and details are not repeated here.
  • Step S430 Obtain the quality score corresponding to each quality parameter in the various quality parameters.
  • the first wireless earphone when the first wireless earphone determines the corresponding encoding bit rate based on various quality parameters, it may obtain the quality score corresponding to each quality parameter among the various quality parameters, so as to obtain the corresponding quality score according to each quality parameter Quality Score, a score that determines the current communication quality.
  • the first wireless earphone may be provided with a corresponding relationship between the quality score of each quality parameter and the different parameter values of each quality parameter, and the first wireless earphone may obtain the value of each quality parameter according to the corresponding relationship.
  • the score corresponding to the parameter value The score of the quality parameter may be positively correlated with the parameter value of the quality parameter, that is, the higher the parameter value of each quality parameter, the better the communication quality corresponding to the quality parameter, and therefore the higher the score may be.
  • Step S440 Obtain the weight corresponding to each quality parameter.
  • the first wireless earphone may further store weights corresponding to each quality parameter.
  • the weights corresponding to each quality parameter can be preset, and the weights of different quality parameters can be the same or different.
  • the weight corresponding to each quality parameter can be set by the wireless headset before leaving the factory and stored in the wireless headset, so that when the wireless headset is used for recording, the weight can be read to calculate the score of the communication quality parameter .
  • the weight corresponding to each quality parameter may also be set by the user before the wireless earphone starts recording.
  • the electronic device can display a configuration interface for configuring the weight of each quality parameter, and the electronic device can obtain the weight of each quality parameter configured by the user based on the user's operation; After weighting the parameters, the weight of each quality parameter can be sent to the wireless earphone, so that the wireless earphone can obtain the weight of each quality parameter configured in the recording process.
  • Step S450 Based on the weight corresponding to each quality parameter and the quality score corresponding to each quality parameter, acquire the quality score corresponding to the communication quality parameter as a total score.
  • the first wireless earphone may perform weighted calculation based on the weight corresponding to each quality parameter obtained above and the quality score corresponding to each quality parameter, so as to obtain the quality score corresponding to the communication quality parameter as the total score .
  • the weighted calculation may be a weighted sum, or a weighted average, etc., and the specific calculation method may not be limited.
  • Step S460 Based on the total score, determine a corresponding encoding bit rate as a target bit rate, wherein the encoding bit rate is positively correlated with the total score.
  • the first wireless earphone may determine the corresponding coding rate as the target rate based on the total score.
  • the total score represents the current communication quality score, the higher the total score, the better the communication quality, therefore, the coding rate is positively correlated with the total score, that is, the higher the total score, the higher the coding rate.
  • the first wireless earphone stores the correspondence between the encoding bit rate and the total score of the communication quality parameter, and when determining the corresponding encoding bit rate based on the total score, the first wireless earphone can search for The encoding bit rate corresponding to the obtained total score.
  • Step S470 respectively controlling the first wireless earphone and the second wireless earphone to encode the collected audio data at the target bit rate.
  • the first wireless earphone used to transmit audio data to the electronic device, according to the wireless communication between the first wireless earphone and the electronic device Various quality parameters, and then obtain the quality score corresponding to each quality parameter, and calculate the total score corresponding to the communication quality parameter according to the score corresponding to each quality parameter and its weight, thus, the first wireless earphone and the second wireless earphone can be used
  • the coding bit rate of the two wireless earphones is adapted to various quality parameters, avoiding stuttering during audio data transmission, resulting in stuttering or intermittent recording of audio, and improving the recording effect.
  • FIG. 12 shows a schematic flowchart of an encoding control method provided in yet another embodiment of the present application, and the encoding control method is applied to the above-mentioned first wireless earphone.
  • the process shown in Figure 12 will be described in detail below, and the encoding control method may specifically include the following steps:
  • Step S510 During the process of audio collection by the first wireless earphone and the second wireless earphone, the first wireless earphone collects and codes the first wireless earphone and the second wireless earphone respectively audio data sent to the electronic device.
  • Step S520 Obtain a communication quality parameter of the wireless communication between the first wireless earphone and the electronic device.
  • Step S530 Obtain a target bit rate corresponding to the communication quality parameter, and control the first wireless earphone and the second wireless earphone to encode the collected audio data at the target bit rate.
  • Step S540 If the parameter value corresponding to the communication quality parameter is lower than a first threshold, detect the distance between the first wireless earphone and the electronic device.
  • the first wireless earphone after the first wireless earphone acquires the above communication quality parameters, it can also compare the parameter value corresponding to the communication quality parameter with the first threshold; and determine whether the parameter value is lower than the first threshold according to the comparison result. Threshold; if it is lower than the first threshold, it means that the communication quality between the first wireless earphone and the electronic device is not good, and the poor communication quality is mostly caused by the distance between the first wireless earphone and the electronic device, Therefore, the distance between the first wireless earphone and the electronic device can be detected to determine whether the current poor communication quality is caused by the distance between the first wireless earphone and the electronic device; if it is not lower than the first threshold, it indicates a wireless The communication quality between the headset and the electronic device is good, so it can be left alone.
  • the first wireless earphone detects the distance between the first wireless earphone and the electronic device, and can determine the distance between the first wireless earphone and the electronic device according to the broadcast message sent by the electronic device and according to the received signal strength indication carried in the broadcast message. distance.
  • the distance between the first wireless earphone and the electronic device may be negatively correlated with the strength of the received signal, that is, the greater the strength of the received signal, the closer the distance between the first wireless earphone and the electronic device.
  • the manner in which the first wireless earphone detects its distance relative to the electronic device may not be limited.
  • Step S550 If the distance is less than a distance threshold, increase the transmission power of the wireless communication of the first wireless earphone.
  • the distance can be compared with the distance threshold; according to the comparison result, it is determined whether the distance is less than the distance threshold;
  • the distance relative to the electronic device is less than the distance threshold, it means that the current communication quality of the wireless communication between the first wireless earphone and the electronic device is not good, which is caused by the distance between the first wireless earphone and the electronic device. Therefore, it can be increased
  • the transmission power of the wireless communication of the first wireless earphone is increased, so as to improve the transmission quality of the audio data transmitted by the first wireless earphone to the electronic device, and avoid the stuttering when transmitting the audio data.
  • the obtained distance between the first wireless earphone and the electronic device is not less than the distance threshold, it means that the current communication quality of the wireless communication between the first wireless earphone and the electronic device is not good, not because of the distance between the first wireless earphone and the electronic device In this case, the current poor communication quality may be caused by the signal transmission being blocked due to the electronic device being in the pocket. Therefore, if the first wireless headset is worn, a prompt message can be output to prompt the user to place the electronic device Take it out from the pocket to improve the communication quality of the wireless communication between the first wireless earphone and the electronic device.
  • the first wireless headset may also acquire the If the remaining power is greater than the power threshold, it means that the current remaining power is sufficient, so the transmission power of the wireless communication of the first wireless earphone is increased. If the remaining power is less than or equal to the power threshold, it means that the current remaining power is not sufficient.
  • the wearing state of the first wireless earphone can be obtained; if the first wireless earphone is in the wearing state, the target prompt information is output, and the target prompt information is used for The user is prompted to reduce the distance between the first wireless headset and the electronic device.
  • the first wireless earphone used to transmit audio data to the electronic device, according to the wireless communication between the first wireless earphone and the electronic device
  • the communication quality parameter controls the bit rate at which the first wireless earphone and the second wireless earphone encode audio data, so that the encoding bit rate adapts to the communication quality parameter, and avoids the stuttering of the audio data transmission, resulting in the recorded audio There is a stutter or intermittent, which improves the recording effect.
  • the parameter value of the communication quality parameter is compared with the first threshold, and when the parameter value is lower than the first threshold and the distance to the electronic device is greater than the distance threshold, the transmission power is increased, thereby effectively ensuring that the first wireless earphone It is relatively smooth when transmitting audio data to electronic equipment, further avoiding stuttering or intermittent recording.
  • FIG. 13 shows a schematic flowchart of an encoding control method provided by still another embodiment of the present application, and the encoding control method is applied to the above-mentioned first wireless earphone.
  • the flow shown in Figure 13 will be described in detail below, and the encoding control method may specifically include the following steps:
  • Step S610 During the audio collection process of the first wireless earphone and the second wireless earphone, the first wireless earphone stores the collected and encoded first audio data packet in the first buffer, and stores the The received second audio data packet collected by the second wireless earphone and encoded is stored in the second buffer.
  • buffers are set in both the first wireless earphone and the second wireless earphone, wherein the buffer area in the first wireless earphone is the first The first buffer and the second buffer, the buffer in the second wireless earphone is the third buffer.
  • the second audio data packet obtained after encoding the collected audio data can put the second audio data packet into the third buffer; after the first wireless earphone encodes the collected audio data For the obtained first audio data packet, the first audio data packet may be put into the first buffer.
  • the second wireless earphone sends the second audio data packet in the third buffer to the first wireless earphone
  • the first wireless earphone stores the second audio data packet in the second buffer, and subsequently performs the process of sending uplink data.
  • Step S620 Combine the first audio data packet and the second audio data packet and send them to the electronic device.
  • the first wireless earphone when sending uplink data, can take out the first audio data packet in the first buffer and the second audio data packet in the second buffer, and then take out the first After the audio data packet and the second audio data packet are combined into one audio data packet, it is sent to the electronic device.
  • the first audio data packet that the first wireless earphone needs to merge with the second The acquisition time corresponding to the audio data packets needs to be synchronized and consistent, so as to ensure the authenticity of the merged audio data packets.
  • the first audio data and the second audio data can be The data is consolidated into one audio data packet.
  • the first wireless earphone may also synchronize the first audio data packet when the recording starts, and subsequent audio data packets may be directly merged.
  • the first audio data packet and the second audio data packet are the first audio data packet in the recording process, then the first audio data packet can be recorded according to the synchronization information in the first audio data packet and the second audio data packet.
  • the data packet and the second audio data are compared; if the first audio data packet matches the second audio data, the first audio data packet and the second audio data packet are combined and sent to the electronic device.
  • the audio data packets respectively obtained by the first wireless earphone and the second wireless earphone can be combined and transmitted to the electronic device according to the chronological order of acquisition; of course, the first wireless earphone and the The second wireless headset can also number the collected and encoded audio data packets according to the order in which the audio data packets are generated.
  • the audio data packets are directly combined and transmitted to the electronic device.
  • the electronic device After the electronic device receives the audio data packet transmitted by the first wireless earphone, it can generate an audio file based on the audio data packet. Specifically, it can generate an audio file in a specified audio format after performing operations such as encoding or optimization processing on the audio data packet.
  • the specified audio format may be MP3, WAV, FLC, etc., and the specific audio format may not be limited.
  • the first wireless earphone when the first wireless earphone transmits the encoded audio data collected by the first wireless earphone and the second wireless earphone to the electronic device, it can also add code rate information to the audio data, so that the electronic device can After receiving the audio data, the code rate of the audio data can be known according to the code rate information, so that when the audio data is further processed to generate an audio file, the sampling rate, bit information and compression during processing can be adjusted according to the code rate strength of the data, etc.
  • Step S630 Obtain a communication quality parameter of the wireless communication between the first wireless earphone and the electronic device.
  • Step S640 Obtain a target bit rate corresponding to the communication quality parameter, and control the first wireless earphone and the second wireless earphone to encode the collected audio data at the target bit rate.
  • step S630 and step S640 in the embodiment of the present application, reference may be made to the contents of the foregoing embodiments for step S630 and step S640, and details are not repeated here.
  • the first wireless earphone after the first wireless earphone acquires the above communication quality parameters, it can also compare the parameter value corresponding to the communication quality parameter with the second threshold; determine whether the parameter value is lower than the second threshold according to the comparison result ; If it is lower than the second threshold, it means that the communication quality between the first wireless earphone and the electronic device is not good. In this case, the collected audio data may be lost during transmission to the electronic device. Therefore, it can Increase the amount of buffered data in the first buffer and the second buffer to avoid loss of audio data in the case of low transmission efficiency, and effectively retain the collected audio content.
  • code rate control method provided in the foregoing embodiments can also be applied to the second wireless earphone, and when the second wireless earphone is connected to the electronic device and the first wireless earphone as the master earphone, the foregoing embodiments can be implemented The rate control method provided in .
  • the first wireless earphone used to transmit audio data to the electronic device, according to the wireless communication between the first wireless earphone and the electronic device
  • the communication quality parameter controls the bit rate at which the first wireless earphone and the second wireless earphone encode audio data, so that the encoding bit rate adapts to the communication quality parameter, and avoids the stuttering of the audio data transmission, resulting in the recorded audio There is a stutter or intermittent, which improves the recording effect.
  • the audio data is combined before transmission, and the first wireless earphone and the second wireless earphone respectively collect Moreover, the encoded audio data is synchronized without synchronously comparing the corresponding audio data of the first wireless earphone and the second wireless earphone after the electronic device receives the audio data, which can reduce the complicated design of the electronic device side.
  • FIG. 14 shows a structural block diagram of an encoding control device 400 provided by an embodiment of the present application.
  • the encoding control device 400 is applied to a first wireless earphone, the first wireless earphone is connected to a second wireless earphone and an electronic device, and both the first wireless earphone and the second wireless earphone are provided with an audio collection device.
  • the encoding control device 400 includes: a data transmission module 410 , a quality acquisition module 420 and a code rate control module 430 .
  • the data transmission module 410 is configured to collect and encode the first wireless earphone and the second wireless earphone respectively during the audio collection process of the first wireless earphone and the second wireless earphone.
  • the final audio data is sent to the electronic device; the quality acquisition module 420 is used to obtain the communication quality parameter of the wireless communication between the first wireless earphone and the electronic device; the code rate control module 430 is used to obtain A target bit rate corresponding to the communication quality parameter, and controlling the first wireless earphone and the second wireless earphone to encode the collected audio data at the target bit rate.
  • the data transmission module 410 may include: a data caching module and a data sending module.
  • the data buffer module is used for the first wireless earphone to store the collected and encoded first audio data packet in the first buffer, and to store the received second wireless earphone collected and encoded second audio data
  • the packets are stored in the second buffer; the data sending module is used to combine the first audio data packet and the second audio data packet and send them to the electronic device.
  • the data transmission module 410 may also be configured to if the first audio data packet and the second audio data packet are the first audio data packet in the recording process, according to the The synchronization information in the first audio data packet and the second audio data packet is compared with the first audio data packet and the second audio data; if the first audio data packet and the second audio data packet If the audio data matches, the first audio data packet and the second audio data packet are combined and sent to the electronic device.
  • the encoding control apparatus 400 may further include: a cache adjustment module.
  • the buffer adjustment module is configured to increase the second threshold if the parameter value corresponding to the communication quality parameter is lower than a second threshold after the acquisition of the communication quality parameter between the first wireless earphone and the electronic device.
  • the buffer data volume of the first buffer and the second buffer is configured to increase the second threshold if the parameter value corresponding to the communication quality parameter is lower than a second threshold after the acquisition of the communication quality parameter between the first wireless earphone and the electronic device.
  • the multiple quality parameters include one or more of the following quality parameters: received signal strength, retransmission rate, and packet loss rate.
  • the communication quality parameters include multiple quality parameters.
  • the code rate control module 430 includes a code rate determination unit and a control execution unit. Wherein, the code rate determination unit is used to determine the corresponding coding code rate as the target code rate according to the various quality parameters; the control execution unit is used to respectively control the first wireless earphone and the second wireless earphone to use the The target bit rate is used to encode the collected audio data.
  • the code rate determining unit may be configured to: acquire the number of quality parameters satisfying corresponding preset parameter conditions among the multiple quality parameters, where each quality parameter corresponds to a preset parameter condition; Based on the quantity, determine a corresponding coding rate as a target rate, where the coding rate is positively correlated with the quantity.
  • each quality parameter includes multiple parameter values within a preset time period.
  • the code rate determination unit may be used to: obtain a target parameter value corresponding to each quality parameter based on multiple parameter values corresponding to each quality parameter; combine the target parameter value corresponding to each quality parameter with the corresponding parameter value Conditions are matched, wherein each quality parameter corresponds to a parameter value condition; the number of target quality parameters among the multiple quality parameters is acquired, wherein the target parameter value of the target quality parameter matches the corresponding parameter value condition.
  • the code rate determination unit may be configured to: acquire the quality score corresponding to each quality parameter among the various quality parameters; acquire the weight corresponding to each quality parameter; The weight corresponding to the parameter, and the quality score corresponding to each quality parameter, acquiring the quality score corresponding to the communication quality parameter as the total score; based on the total score, determining the corresponding encoding code rate as the target code rate, wherein, The coding rate is positively correlated with the total score.
  • the encoding control device 400 may further include: a distance acquiring module and a power increasing module.
  • the distance acquisition module is used to detect the distance of the first wireless earphone relative to the electronic device if the parameter value corresponding to the communication quality parameter is lower than the first threshold; the power increase module is used to detect if the distance is less than the distance threshold, Increase the transmission power of the wireless communication of the first wireless earphone.
  • the power increasing module may be used to: if the distance is less than a distance threshold, obtain the remaining power of the first wireless earphone; if the remaining power is greater than the power threshold, increase the first The transmission power of the wireless communication of the wireless earphone.
  • the coding control device 400 may further include: a wearing detection module and a prompt module.
  • the wearing detection module is used to obtain the wearing state of the first wireless earphone if the remaining power is less than or equal to the power threshold;
  • the prompting module is used to output target prompt information if the first wireless earphone is in the wearing state, and the target The prompt information is used to prompt the user to reduce the distance between the first wireless earphone and the electronic device.
  • the coupling between the modules may be electrical, mechanical or other forms of coupling.
  • each functional module in each embodiment of the present application may be integrated into one processing module, each module may exist separately physically, or two or more modules may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules.
  • the first wireless headset connected to the electronic device collects the first wireless headset and the second wireless headset respectively And the encoded audio data is sent to the electronic device, and the communication quality parameter of the wireless communication between the first wireless earphone and the electronic device is obtained, and then the target code rate corresponding to the communication quality parameter is obtained, and the first wireless earphone and the second wireless earphone are controlled.
  • the second wireless earphone encodes the collected audio data at the target bit rate.
  • the first wireless earphone used to transmit audio data to the electronic device, according to the communication quality parameters of the wireless communication between it and the electronic device, for the second wireless earphone
  • the first wireless earphone and the second wireless earphone control the code rate of the audio data to avoid the stuttering during the transmission of the audio data, resulting in stuttering or discontinuity in the recorded audio, and improving the recording effect.
  • the wireless headset 100 in the present application may include one or more of the following components: a processor 110, a memory 120, an audio collection device 130, a communication device 140, and one or more application programs, wherein one or more application programs may be stored in In the memory 120 and configured to be executed by one or more processors 110, one or more programs are configured to execute the method described in the foregoing method embodiment, the memory 120, the audio collection device 130 and the communication device 140 are all related to the processing Device 110 is connected.
  • the audio collection device 130 can be a microphone
  • the communication device 140 can be a wireless communication device, for example, can be a bluetooth communication module
  • Processor 110 may include one or more processing cores.
  • the processor 110 uses various interfaces and lines to connect various parts in the entire wireless earphone 100, by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120 to execute Various functions and processing data of the wireless earphone 100.
  • the processor 110 may adopt at least one of Digital Signal Processing (Digital Signal Processing, DSP), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and Programmable Logic Array (Programmable Logic Array, PLA). implemented in the form of hardware.
  • DSP Digital Signal Processing
  • FPGA Field-Programmable Gate Array
  • PLA Programmable Logic Array
  • the processor 110 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU), a modem, and the like.
  • CPU Central Processing Unit
  • GPU Graphics Processing Unit
  • the CPU mainly handles the operating system, user interface and application programs, etc.
  • the GPU is used to render and draw the displayed content
  • the modem is used to handle wireless communication. It can be understood that, the above-mentioned modem may not be integrated into the processor 110, but may be realized by a communication chip alone.
  • the memory 120 may include random access memory (Random Access Memory, RAM), and may also include read-only memory (Read-Only Memory).
  • the memory 120 may be used to store instructions, programs, codes, sets of codes, or sets of instructions.
  • the memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system and instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , instructions for implementing the following method embodiments, and the like.
  • the storage data area can also store data created during use of the wireless headset 100 (such as phonebook, audio and video data, chat record data) and the like.
  • FIG. 16 shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application.
  • Program codes are stored in the computer-readable medium 800, and the program codes can be invoked by a processor to execute the methods described in the foregoing method embodiments.
  • the computer readable storage medium 800 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • the computer-readable storage medium 800 includes a non-transitory computer-readable storage medium (non-transitory computer-readable storage medium).
  • the computer-readable storage medium 800 has a storage space for program code 810 for executing any method steps in the above-mentioned methods. These program codes can be read from or written into one or more computer program products.
  • Program code 810 may, for example, be compressed in a suitable form.

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Quality & Reliability (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Circuit For Audible Band Transducer (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The present application discloses a coding control method and apparatus, a wireless earphone, and a storage medium. The coding control method is applied to a first wireless earphone, the first wireless earphone is connected to a second wireless earphone and an electronic device, and the first wireless earphone and the second wireless earphone are each provided with an audio collection apparatus. The method comprises: in the process of performing audio collection by the first wireless earphone and the second wireless earphone, the first wireless earphone sending audio data respectively collected by the first wireless earphone and the second wireless earphone and subjected to coding to the electronic device; obtaining communication quality parameters of wireless communication between the first wireless earphone and the electronic device; and obtaining a target code rate corresponding to the communication quality parameter, and controlling the first wireless earphone and the second wireless earphone to code the collected audio data at the target code rate. According to the method, the recording of the wireless earphone can be prevented from being stuck or interrupted.

Description

编码控制方法、装置、无线耳机及存储介质Coding control method, device, wireless earphone and storage medium
相关申请的交叉引用Cross References to Related Applications
本申请要求于2021年6月30日提交的申请号为202110735822.4的中国申请的优先权,其在此出于所有目的通过引用将其全部内容并入本文。This application claims priority to Chinese application No. 202110735822.4 filed on June 30, 2021, which is hereby incorporated by reference in its entirety for all purposes.
技术领域technical field
本申请涉及音频处理技术领域,更具体地,涉及一种编码控制方法、装置、无线耳机及存储介质。The present application relates to the technical field of audio processing, and more specifically, to an encoding control method and device, a wireless earphone and a storage medium.
背景技术Background technique
随着科技水平和生活水平的快速进步,无线耳机因其方便携带等特点得到越来越广泛的应用。其中,真无线立体声(True Wireless Stereo,TWS)耳机更因其完全摒弃有线的烦恼,在使用上更为自由而受到使用者的青睐。目前的无线耳机通常设置有麦克风,以用于录音场景中声音的采集。但在无线耳机被用于录音时,由于会采集两个声道的音频数据,无线耳机在将采集的双声道的音频数据传输至电子设备时容易出现卡顿,导致录音出现卡顿或断续。With the rapid advancement of technology and living standards, wireless earphones are being used more and more widely because of their portability and other features. Among them, True Wireless Stereo (TWS) earphones are favored by users because they completely abandon the troubles of cables and are more free to use. Current wireless earphones are usually provided with a microphone for sound collection in a recording scene. However, when the wireless earphones are used for recording, since the audio data of two channels will be collected, the wireless earphones are prone to stuttering when transmitting the collected two-channel audio data to the electronic device, resulting in stuttering or disconnection of the recording. continued.
发明内容Contents of the invention
鉴于上述问题,本申请提出了一种编码控制方法、装置、无线耳机及存储介质。In view of the above problems, the present application proposes an encoding control method, device, wireless earphone and storage medium.
第一方面,本申请实施例提供了一种编码控制方法,应用于第一无线耳机,所述第一无线耳机与第二无线耳机以及电子设备连接,所述第一无线耳机和所述第二无线耳机均设置有音频采集装置。所述方法包括:在所述第一无线耳机以及所述第二无线耳机进行音频采集的过程中,所述第一无线耳机将所述第一无线耳机以及所述第二无线耳机各自采集且经过编码后的音频数据发送至所述电子设备;获取所述第一无线耳机与所述电子设备之间无线通信的通信质量参数;获取与所述通信质量参数对应的目标码率,并控制所述第一无线耳机以及所述第二无线耳机以所述目标码率,对采集的音频数据进行编码。In the first aspect, the embodiment of the present application provides an encoding control method, which is applied to a first wireless earphone, the first wireless earphone is connected to a second wireless earphone and an electronic device, and the first wireless earphone and the second wireless earphone The wireless earphones are all provided with an audio collection device. The method includes: during the audio collection process of the first wireless earphone and the second wireless earphone, the first wireless earphone respectively collects the first wireless earphone and the second wireless earphone and passes The encoded audio data is sent to the electronic device; the communication quality parameter of the wireless communication between the first wireless earphone and the electronic device is obtained; the target code rate corresponding to the communication quality parameter is obtained, and the The first wireless earphone and the second wireless earphone encode the collected audio data at the target bit rate.
第二方面,本申请实施例提供了一种编码控制装置,应用于第一无线耳机,所述第一无线耳机与第二无线耳机以及电子设备连接,所述第一无线耳机和所述第二无线耳机均设置有音频采集装置,所述装置包括:数据传输模块、质量获取模块以及码率控制模块,其中,所述数据传输模块用于在所述第一无线耳机以及所述第二无线耳机进行音频采集的过程中,所述第一无线耳机将所述第一无线耳机以及所述第二无线耳机各自采集且经过编码后的音频数据发送至所述电子设备;所述质量获取模块用于获取所述第一无线耳机与所述电子设备之间无线通信的通信质量参数;所述码率控制模块用于获取与所述通信质量参数对应的目标码率,并控制所述第一无线耳机以及所述第二无线耳机以所述目标码率,对采集的音频数据进行编码。In the second aspect, the embodiment of the present application provides an encoding control device, which is applied to a first wireless earphone, the first wireless earphone is connected to a second wireless earphone and an electronic device, and the first wireless earphone and the second wireless earphone The wireless earphones are all provided with an audio collection device, and the device includes: a data transmission module, a quality acquisition module and a code rate control module, wherein the data transmission module is used to transmit data between the first wireless earphone and the second wireless earphone In the process of audio collection, the first wireless earphone sends the encoded audio data collected by the first wireless earphone and the second wireless earphone to the electronic device; the quality acquisition module is used to Obtain a communication quality parameter of wireless communication between the first wireless earphone and the electronic device; the bit rate control module is used to acquire a target bit rate corresponding to the communication quality parameter, and control the first wireless earphone And the second wireless earphone encodes the collected audio data at the target bit rate.
第三方面,本申请实施例提供了一种无线耳机,包括:一个或多个处理器;存储器;一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行上述第一方面提供的编码控制方法。In a third aspect, the embodiment of the present application provides a wireless headset, including: one or more processors; memory; one or more application programs, wherein the one or more application programs are stored in the memory and The one or more programs are configured to be executed by the one or more processors, and the one or more programs are configured to execute the encoding control method provided in the first aspect above.
第四方面,本申请实施例提供了一种计算机可读取存储介质,所述计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行上述第一方面提供的编码控制方法。In the fourth aspect, the embodiment of the present application provides a computer-readable storage medium, where program code is stored in the computer-readable storage medium, and the program code can be invoked by a processor to execute the code provided in the first aspect above. Control Method.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained based on these drawings without any creative effort.
图1示出了本申请实施例提供的一种应用环境的一种示意图。FIG. 1 shows a schematic diagram of an application environment provided by an embodiment of the present application.
图2示出了本申请实施例提供的一种应用环境的另一种示意图。FIG. 2 shows another schematic diagram of an application environment provided by an embodiment of the present application.
图3示出了本申请实施例提供的一种应用环境的又一种示意图。FIG. 3 shows another schematic diagram of an application environment provided by an embodiment of the present application.
图4示出了根据本申请一个实施例的编码控制方法流程图。Fig. 4 shows a flowchart of an encoding control method according to an embodiment of the present application.
图5示出了根据本申请另一个实施例的编码控制方法流程图。Fig. 5 shows a flowchart of an encoding control method according to another embodiment of the present application.
图6示出了根据本申请又一个实施例的编码控制方法流程图。Fig. 6 shows a flowchart of an encoding control method according to yet another embodiment of the present application.
图7示出了本申请实施例提供的一种应用场景的一种示意图。FIG. 7 shows a schematic diagram of an application scenario provided by an embodiment of the present application.
图8示出了本申请实施例提供的一种应用场景的另一种示意图。FIG. 8 shows another schematic diagram of an application scenario provided by an embodiment of the present application.
图9示出了本申请实施例提供的一种应用场景的再一种示意图。FIG. 9 shows another schematic diagram of an application scenario provided by an embodiment of the present application.
图10示出了本申请实施例提供的编码控制方法的原理示意图。FIG. 10 shows a schematic diagram of the principles of the encoding control method provided by the embodiment of the present application.
图11示出了根据本申请再一个实施例的编码控制方法流程图。Fig. 11 shows a flowchart of an encoding control method according to yet another embodiment of the present application.
图12示出了根据本申请又另一个实施例的编码控制方法流程图。Fig. 12 shows a flowchart of an encoding control method according to yet another embodiment of the present application.
图13示出了根据本申请又再一个实施例的编码控制方法流程图。Fig. 13 shows a flowchart of an encoding control method according to yet another embodiment of the present application.
图14示出了根据本申请一个实施例的编码控制装置的一种框图。Fig. 14 shows a block diagram of an encoding control device according to an embodiment of the present application.
图15是本申请实施例的用于执行根据本申请实施例的编码控制方法的无线耳机的框图。Fig. 15 is a block diagram of a wireless earphone for executing the coding control method according to the embodiment of the present application according to the embodiment of the present application.
图16是本申请实施例的用于保存或者携带实现根据本申请实施例的编码控制方法的程序代码的存储单元。Fig. 16 is a storage unit for storing or carrying program codes for implementing the encoding control method according to the embodiment of the present application according to the embodiment of the present application.
具体实施方式detailed description
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
电子设备(例如智能手机、平板电脑等),已经成为人们日常生活中最常用的消费型电子产品之一,随着无线通信技术的发展,用户在利用电子设备进行录音时,无线耳机因其方便携带等特点得到越来越广泛的应用。其中,真无线立体声(True Wireless Stereo,TWS)耳机由于其佩戴更为舒适、使用方便、不引人注目、更加小巧美观等优秀特性,TWS耳机在耳机市场的占有率逐渐提高。Electronic devices (such as smart phones, tablet computers, etc.) have become one of the most commonly used consumer electronics products in people's daily life. With the development of wireless communication technology, when users use electronic devices to record, wireless headphones are convenient. Features such as carrying are more and more widely used. Among them, True Wireless Stereo (TWS) earphones have gradually increased their share in the earphone market due to their excellent features such as more comfortable to wear, easier to use, unobtrusive, more compact and beautiful.
双耳立体声录音技术(Binaural Audio)是一种高度还原真实听感的录音技术,其通过在人工头部的两只耳朵位置配有麦克风,从而可以捕捉到达每只耳朵位置的声音,两个信号就可以分别在每只耳朵上重现。这种重现不适用单声道播放,如果用扬声器来播放也达不到预期的效果,所以通常会使用耳机,将两只耳朵接收的声信号完全隔离开,这种做法可以使人工头完全复刻听众所听到的内容。Binaural audio recording technology (Binaural Audio) is a recording technology that highly restores the real sense of hearing. It is equipped with microphones at the two ears of the artificial head, so that it can capture the sound reaching each ear. Two signals can be reproduced on each ear separately. This kind of reproduction is not suitable for monophonic playback, and if you use speakers to play it, it will not achieve the expected effect. Therefore, headphones are usually used to completely isolate the sound signals received by the two ears. This method can make the artificial head completely Replicate what the audience heard.
在实现双耳立体声录音时,可以使用TWS耳机的两个耳机分别设置的麦克风(Microphone,MIC)进行收音,可以达到以上双耳录音技术的效果。TWS耳机的两个耳机在采集音频数据后,需要通过蓝牙协议向手机蓝牙传输录制的双声道音频。由于需要保证录制的声场,录制音频的格式至少需要保证48khz(千赫兹),16bit(比特),2声道,此时压缩之后的带宽也至少需要400-500kbps(千比特每秒),如果蓝牙的信号出现波动或者耳机距离手机较远时,传输的带宽就会变小,传输过程也容易出现卡顿或中断,从而导致录音出现卡顿或断续。When realizing binaural stereo recording, you can use the microphones (Microphone, MIC) set separately on the two earphones of the TWS earphone to collect sound, which can achieve the effect of the above binaural recording technology. After the two earphones of the TWS headset collect audio data, they need to transmit the recorded two-channel audio to the mobile phone Bluetooth through the Bluetooth protocol. Due to the need to ensure the recorded sound field, the format of the recorded audio must be at least 48khz (kilohertz), 16bit (bit), 2 channels. At this time, the bandwidth after compression also needs to be at least 400-500kbps (kilobits per second). If Bluetooth When the signal fluctuates or the earphone is far away from the mobile phone, the transmission bandwidth will become smaller, and the transmission process is also prone to stuttering or interruption, resulting in stuttering or intermittent recording.
针对上述问题,发明人提出了本申请实施例提供的编码控制方法、装置、无线耳机以及存储介质,可以实现第一无线耳机以及第二无线耳机进行录音的过程中,用于传输音频数据至电子设备的第一无线耳机,根据其与电子设备之间无线通信的通信质量参数,对第一无线耳机以及第二无线耳机对音频数据进行编码的码率进行控制,避免音频数据传输时的卡顿,而导致录制的音频出现卡顿或断续,提升了录音效果。In view of the above problems, the inventor proposed the encoding control method, device, wireless earphone and storage medium provided by the embodiment of the present application, which can realize the transmission of audio data to the electronic device during the recording process of the first wireless earphone and the second wireless earphone. The first wireless earphone of the device, according to the communication quality parameters of the wireless communication between it and the electronic device, controls the code rate of the audio data encoded by the first wireless earphone and the second wireless earphone, so as to avoid stuttering during audio data transmission , causing the recorded audio to appear stuck or intermittent, which improves the recording effect.
在介绍本申请实施例的编码控制方法之前,先介绍该编码控制方法对应的应用环境。如图1所示,该编码控制方法对应的应用环境包括录音***10,录音***10包括电子设备11、第一无线耳机12和第二无线耳机13。该电子设备11可以是智能手机、平板电脑、电子书、智能穿戴设备等能够运行应用程序、并且具有音频信号采集的功能的设备。第一无线耳机12和第二无线耳机13构成真无线立体声(True Wireless Stereo,TWS)耳机,其中,TWS耳机的左右两只耳机相互独立、无需线缆相连,即可实现左右声道的无线分离。于本申请实施例中,可以通过第一无线耳机12和第二无线耳机13分别采集左右声道的声音。Before introducing the encoding control method in the embodiment of the present application, the application environment corresponding to the encoding control method is introduced first. As shown in FIG. 1 , the application environment corresponding to the coding control method includes a recording system 10 , and the recording system 10 includes an electronic device 11 , a first wireless earphone 12 and a second wireless earphone 13 . The electronic device 11 may be a smart phone, a tablet computer, an e-book, a smart wearable device, etc., which can run application programs and have the function of collecting audio signals. The first wireless earphone 12 and the second wireless earphone 13 form a true wireless stereo (True Wireless Stereo, TWS) earphone, wherein, the left and right earphones of the TWS earphone are independent of each other, without the need for cables to be connected, and the wireless separation of the left and right channels can be realized. . In the embodiment of the present application, the first wireless earphone 12 and the second wireless earphone 13 can respectively collect the sound of the left and right channels.
于本申请实施例中,电子设备11内安装有能够采集音频的应用程序,具体地,该应用程序可以是音频播放软件、视频播放软件或者通话软件或者其他的能够触发音频播放的软件等。 第一无线耳机12和第二无线耳机13中可以均设置有音频采集装置,例如,设置有麦克风。第一无线耳机12和第二无线耳机13中可以设置有音频采集装置可以采集音频信号,并且由电子设备11将该音频信号处理之后生成音频文件。当然,电子设备11也可以将需要播放的音频发送给第一无线耳机12和第二无线耳机13中的至少一个,由第一无线耳机12和第二无线耳机13中的至少一个播放语音。In this embodiment of the present application, an application program capable of collecting audio is installed in the electronic device 11 , specifically, the application program may be audio playback software, video playback software, or call software, or other software capable of triggering audio playback. Both the first wireless earphone 12 and the second wireless earphone 13 may be provided with an audio collection device, for example, a microphone. The first wireless earphone 12 and the second wireless earphone 13 may be provided with an audio collection device to collect audio signals, and the electronic device 11 processes the audio signals to generate audio files. Certainly, the electronic device 11 may also send the audio to be played to at least one of the first wireless earphone 12 and the second wireless earphone 13 , and at least one of the first wireless earphone 12 and the second wireless earphone 13 plays the voice.
作为一种实施方式,如图2所示,电子设备11能够同时与第一无线耳机12和第二无线耳机13连接。第一无线耳机12和第二无线耳机13能够直接将音频数据发送至电子设备11,或者,接收电子设备11发送的音频数据进行播放。As an implementation manner, as shown in FIG. 2 , the electronic device 11 can be connected to the first wireless earphone 12 and the second wireless earphone 13 at the same time. The first wireless earphone 12 and the second wireless earphone 13 can directly send audio data to the electronic device 11 , or receive and play the audio data sent by the electronic device 11 .
作为另一种实施方式,如图3所示,电子设备11与第一无线耳机12通过蓝牙连接,然后,第一无线耳机12再通过蓝牙和第二无线耳机13连接,从而,电子设备11、第一无线耳机12和第二无线耳机13通过组网的方式实现同时连接,即第一无线耳机12作为电子设备11和第二无线耳机13的中继器。As another implementation manner, as shown in FIG. 3 , the electronic device 11 is connected to the first wireless earphone 12 through Bluetooth, and then the first wireless earphone 12 is connected to the second wireless earphone 13 through Bluetooth, so that the electronic device 11, The first wireless earphone 12 and the second wireless earphone 13 are connected simultaneously through networking, that is, the first wireless earphone 12 acts as a repeater between the electronic device 11 and the second wireless earphone 13 .
在本申请实施例中,电子设备11、第一无线耳机12和第二无线耳机13通过图3所示的方式连接,则该第一无线耳机12可以作为主耳机,第二无线耳机13可以作为从耳机。In the embodiment of the present application, the electronic device 11, the first wireless earphone 12 and the second wireless earphone 13 are connected in the manner shown in FIG. from the headset.
请参阅图4,图4示出了本申请一个实施例提供的编码控制方法的流程示意图。在具体的实施例中,该编码方法可以应用于上述录音***,具体地,该方法的执行主体可以是第一无线耳机,所述第一无线耳机和所述第二无线耳机均设置有音频采集装置,且第一无线耳机和第二无线耳机采用图4所示的连接方式。下面将针对图4所示的流程进行详细的阐述,所述编码控制方法具体可以包括以下步骤:Please refer to FIG. 4 , which shows a schematic flowchart of an encoding control method provided by an embodiment of the present application. In a specific embodiment, the encoding method can be applied to the above-mentioned recording system. Specifically, the execution body of the method can be the first wireless earphone, and the first wireless earphone and the second wireless earphone are both equipped with audio collection device, and the first wireless earphone and the second wireless earphone adopt the connection method shown in Figure 4. The flow shown in Figure 4 will be described in detail below, and the encoding control method may specifically include the following steps:
步骤S110:在所述第一无线耳机以及所述第二无线耳机进行音频采集的过程中,所述第一无线耳机将所述第一无线耳机以及所述第二无线耳机各自采集且经过编码后的音频数据发送至所述电子设备。Step S110: During the audio collection process of the first wireless earphone and the second wireless earphone, the first wireless earphone collects and codes the first wireless earphone and the second wireless earphone respectively audio data sent to the electronic device.
其中,第一无线耳机作为主耳机与电子设备以及第二无线耳机连接,第一无线耳机以及第二无线耳机被用于录音时,第一无线耳机以及第二无线耳机可以分别采集音频数据,并对采集的音频数据进行编码,得到用于传输至电子设备的音频数据。第一无线耳机对采集的音频数据进行编码后得到的音频数据,可以作为双声道中其中一个声道对应的音频数据;第二无线耳机对采集的音频数据进行编码后得到的音频数据,可以作为双声道中另一个声道对应的音频数据。可选地,第一无线耳机采集且经过编码后的音频数据可以为左声道对应的音频数据,第二无线耳机采集且经过编码后的音频数据可以为右声道对应的音频数据;也可以是,第一无线耳机采集且经过编码后的音频数据可以为右声道对应的音频数据,第二无线耳机采集且经过编码后的音频数据可以为左声道对应的音频数据。Wherein, the first wireless earphone is connected to the electronic device and the second wireless earphone as the main earphone, and when the first wireless earphone and the second wireless earphone are used for recording, the first wireless earphone and the second wireless earphone can respectively collect audio data, and The collected audio data is encoded to obtain audio data for transmission to the electronic device. The audio data obtained after the first wireless earphone encodes the collected audio data can be used as the audio data corresponding to one of the two channels; the audio data obtained after the second wireless earphone encodes the collected audio data can be As the audio data corresponding to the other channel in the dual channel. Optionally, the audio data collected by the first wireless headset and encoded may be audio data corresponding to the left channel, and the audio data collected by the second wireless headset and encoded may be audio data corresponding to the right channel; Yes, the encoded audio data collected by the first wireless earphone may be audio data corresponding to the right channel, and the encoded audio data collected by the second wireless earphone may be audio data corresponding to the left channel.
在本申请实施例中,在通过第一无线耳机以及第二无线耳机进行录音时,第一无线耳机以及第二无线耳机进行音频数据采集的过程中,第一无线耳机为与电子设备连接的主耳机时,可以通过第一无线耳机将第一无线耳机采集且经过编码后的音频数据以及第二无线耳机采集且经过编码后的音频数据发送至电子设备。其中,第一无线耳机在采集音频数据并进行编码,得到双声道中的其中一个声道的音频数据时,第二无线耳机也在采集音频数据并进行编码,得到双声道中另一个声道的音频数据,并通过与第一无线耳机之间的连接,将获取的音频数据发送至第一无线耳机;第一无线耳机可以将两个声道的音频数据合并后发送至电子设备,从而电子设备可以接收到第一无线耳机以及第二无线耳机获取的双声道的音频数据,并根据接收到的音频数据生成音频文件。In the embodiment of the present application, when recording through the first wireless earphone and the second wireless earphone, during the process of audio data collection by the first wireless earphone and the second wireless earphone, the first wireless earphone is the main device connected to the electronic device. In the case of earphones, the encoded audio data collected by the first wireless earphone and the encoded audio data collected by the second wireless earphone can be sent to the electronic device through the first wireless earphone. Wherein, when the first wireless earphone collects audio data and encodes it to obtain the audio data of one of the two channels, the second wireless earphone also collects the audio data and encodes it to obtain the other audio data of the two channels. channel audio data, and through the connection with the first wireless earphone, the acquired audio data is sent to the first wireless earphone; the first wireless earphone can combine the audio data of the two channels and send it to the electronic device, thereby The electronic device may receive the binaural audio data acquired by the first wireless earphone and the second wireless earphone, and generate an audio file according to the received audio data.
在一些实施方式中,第一无线耳机以及第二无线耳机被用于录音过程时,第一无线耳机以及第二无线耳机可以处于佩戴状态,也可以处于非佩戴状态。例如,第一无线耳机以及第二无线耳机可以被同一用户佩戴于左耳和右耳,从而可以捕捉到达每只耳朵位置的声音,录制的音频被播放时就可以分别在每只耳朵上重现;又例如,第一无线耳机以及第二无线耳机可以被同一现实场景中不同的用户佩戴,从而可以采集到现实场景所处空间中不同空间位置处的音频数据,录制的音频被播放时可以重现空间感;再例如,第一无线耳机可以被佩戴,第二无线耳机处于被手持的状态,由此,可以实现采访场景下的录音。当然,第一无线耳机以及第二无线耳机用于录音时的佩戴状态可以不做限定。In some embodiments, when the first wireless earphone and the second wireless earphone are used in the recording process, the first wireless earphone and the second wireless earphone may be in a wearing state or in a non-wearing state. For example, a first wireless earphone and a second wireless earphone can be worn by the same user on the left and right ear, so that the sound reaching each ear position can be captured, and the recorded audio can be reproduced on each ear separately when played. For another example, the first wireless headset and the second wireless headset can be worn by different users in the same real scene, so that audio data at different spatial positions in the space where the real scene is located can be collected, and the recorded audio can be reproduced when played. Realize the sense of space; for another example, the first wireless earphone can be worn, and the second wireless earphone can be in the state of being held, thus, the recording in the interview scene can be realized. Certainly, the wearing state of the first wireless earphone and the second wireless earphone when used for recording may not be limited.
在一些实施方式中,第一无线耳机以及第二无线耳机被用于录音时,也可以对指定用户的声音进行采集。可选地,第一无线耳机以及第二无线耳机可以根据声源与其之间的相位角,或 者根据指定用户的声纹特征,对指定用户的声音进行采集,得到指定用户的音频数据。第一无线耳机以及第二无线耳机用于对指定用户的声音采集时,第一无线耳机以及第二无线耳机可以采集相同用户的声音,例如,在教学场景中对教师的教学音频进行采集;第一无线耳机以及第二无线耳机也可以被用户采集不同的用户的声音,例如,在采访场景中,第一无线耳机可以用于采集采访者的声音,第二无线耳机可以用于被采访者的声音。当然,第一无线耳机以及第二无线耳机用于录音时的具体应用场景可以不做限定。In some implementations, when the first wireless earphone and the second wireless earphone are used for recording, the voice of a specified user may also be collected. Optionally, the first wireless headset and the second wireless headset can collect the voice of the specified user according to the phase angle between the sound source and the specified user, or according to the voiceprint characteristics of the specified user, to obtain the audio data of the specified user. When the first wireless earphone and the second wireless earphone are used to collect the voice of a designated user, the first wireless earphone and the second wireless earphone can collect the voice of the same user, for example, collect the teaching audio of the teacher in the teaching scene; A wireless earphone and a second wireless earphone can also be used by the user to collect the voices of different users. For example, in an interview scene, the first wireless earphone can be used to collect the interviewer's voice, and the second wireless earphone can be used for the interviewee's voice. sound. Certainly, the specific application scenarios when the first wireless earphone and the second wireless earphone are used for recording may not be limited.
在一些实施方式中,第一无线耳机将第一无线耳机以及第二无线耳机各自采集且经过编码后的音频数据发送至电子设备时,可以对第一无线耳机以及第二无线耳机各自采集且经过编码后的音频数据合并为音频数据包。In some implementations, when the first wireless earphone sends the encoded audio data collected by the first wireless earphone and the second wireless earphone to the electronic device, the first wireless earphone and the second wireless earphone can collect and encode the audio data respectively. The encoded audio data is combined into audio data packets.
在一种可能的实施方式中,第一无线耳机以及第二无线耳机各自采集且经过编码后的音频数据中包含时间戳,第一无线耳机可以根据音频数据中包含的时间戳,对第一无线耳机以及第二无线耳机各自获取的音频数据中相同时间戳的音频数据进行合并,得到用于发送至电子设备的音频数据包。In a possible implementation manner, the audio data collected and encoded by the first wireless earphone and the second wireless earphone respectively contain time stamps, and the first wireless earphone may, according to the time stamps contained in the audio data, The audio data with the same time stamp among the audio data acquired by the earphone and the second wireless earphone are combined to obtain an audio data packet for sending to the electronic device.
在一种可能的实施方式中,第一无线耳机以及第二无线耳机在音频采集的过程中,可以按照相同时长内生成的音频数据生成音频数据包,在录音开始时,可以对第一包音频数据包进行同步,同步成功后,则将第一无线耳机以及第二无线耳机各自生成的音频数据包进行合并,后续生成的音频数据包则无需进行同步,可以直接进行合并得到用于发送至电子设备的音频数据包。In a possible implementation, during the audio collection process, the first wireless earphone and the second wireless earphone can generate audio data packets according to the audio data generated within the same duration. The data packets are synchronized. After the synchronization is successful, the audio data packets generated by the first wireless earphone and the second wireless earphone are merged. The audio data packets generated subsequently do not need to be synchronized, and can be directly merged to be sent to the electronic device. Audio packets for the device.
步骤S120:获取所述第一无线耳机与所述电子设备之间无线通信的通信质量参数。Step S120: Obtain a communication quality parameter of the wireless communication between the first wireless earphone and the electronic device.
在本申请实施例中,第一无线耳机可以在录音过程中获取第一无线耳机与电子设备之间无线通信的通信质量参数,由此,可以根据通信质量参数,确定出第一无线耳机与电子设备之间的无线通信的通信质量,以动态控制第一无线耳机以及第二无线耳机对采集的音频数据进行编码的编码码率,使得第一无线耳机在传输音频数据至电子设备时所需求的带宽不同,避免传输时的卡顿。In the embodiment of the present application, the first wireless earphone can obtain the communication quality parameters of the wireless communication between the first wireless earphone and the electronic device during the recording process, so that the communication quality parameters between the first wireless earphone and the electronic device can be determined according to the communication quality parameters. The communication quality of the wireless communication between the devices is to dynamically control the coding rate of the audio data collected by the first wireless earphone and the second wireless earphone, so that the first wireless earphone needs to transmit the audio data to the electronic device. The bandwidth is different to avoid lag during transmission.
在一些实施方式中,第一无线耳机可以实时的检测第一无线耳机与电子设备之间无线通信的通信质量参数,以根据通信质量参数控制第一无线耳机以及第二无线耳机对采集的音频数据进行编码的编码码率,使编码码率与通信质量匹配;第一无线耳机也可以按照设置的频率,获取第一无线耳机与电子设备之间无线通信的通信质量参数,例如,第一无线耳机可以每间隔10秒获取一次第一无线耳机与电子设备之间无线通信的通信质量参数。In some embodiments, the first wireless earphone can detect the communication quality parameter of the wireless communication between the first wireless earphone and the electronic device in real time, so as to control the audio data collected by the first wireless earphone and the second wireless earphone according to the communication quality parameter The encoding bit rate for encoding, so that the encoding bit rate matches the communication quality; the first wireless earphone can also obtain the communication quality parameters of the wireless communication between the first wireless earphone and the electronic device according to the set frequency, for example, the first wireless earphone The communication quality parameter of the wireless communication between the first wireless earphone and the electronic device may be acquired every 10 seconds.
在一些实施方式中,通信质量参数可以包括以下参数中的一种或多种:接收信号强度、重传率、丢包率以及信道占用比。可以理解地,获取的通信质量参数可以反映第一无线耳机与电子设备之间无线通信的通信质量,当然,具体的通信质量参数可以不做限定,例如,通信质量参数也可以包括幅值向量差等。In some implementations, the communication quality parameters may include one or more of the following parameters: received signal strength, retransmission rate, packet loss rate, and channel occupancy ratio. It can be understood that the obtained communication quality parameter may reflect the communication quality of the wireless communication between the first wireless earphone and the electronic device. Of course, the specific communication quality parameter may not be limited. For example, the communication quality parameter may also include the magnitude vector difference Wait.
可选地,通信质量参数可以包括蓝牙接收信号强度。第一无线耳机在获取蓝牙接收信号强度时,可以根据电子设备发送的广播,确定第一接收信号强度,并且可以从电子设备获取由电子设备检测的第二接收信号强度,再根据第一接收信号强度以及第二接收信号强度,计算出第三接收信号强度,作为第一无线耳机与电子设备之间的蓝牙接收信号强度。例如,可以获取第一接收信号强度以及第二接收信号强度的平均值,作为第三接收信号强度,又例如,根据第一接收信号强度对应的权重以及第二接收信号强度对应的权重,对第一接收信号强度以及第二接收信号强度进行加权计算,得到第三接收信号强度。另外,在获取第一接收信号强度以及第二接收信号强度时,还可以获取一定时长内测得的多个接收信号强度,并基于多个接收信号强度,获取平均值,得到第一接收信号强度以及第二接收信号强度,例如,第一无线耳机可以1秒内检测8192次,并计算出平均值,得到第一接收信号强度。Optionally, the communication quality parameter may include Bluetooth received signal strength. When the first wireless earphone obtains the Bluetooth received signal strength, it can determine the first received signal strength according to the broadcast sent by the electronic device, and can obtain the second received signal strength detected by the electronic device from the electronic device, and then determine the first received signal strength according to the first received signal strength. strength and the second received signal strength, and calculate the third received signal strength as the Bluetooth received signal strength between the first wireless earphone and the electronic device. For example, the average value of the first received signal strength and the second received signal strength may be obtained as the third received signal strength, and for example, according to the weight corresponding to the first received signal strength and the weight corresponding to the second received signal strength, the The first received signal strength and the second received signal strength are weighted to obtain the third received signal strength. In addition, when obtaining the first received signal strength and the second received signal strength, it is also possible to obtain multiple received signal strengths measured within a certain period of time, and based on the multiple received signal strengths, obtain an average value to obtain the first received signal strength As well as the second received signal strength, for example, the first wireless earphone can detect 8192 times within 1 second, and calculate the average value to obtain the first received signal strength.
可选地,通信质量参数可以包括重传率。第一无线耳机在获取重传率时,可以获取在发送预设数量的数据包至电子设备后,获取自动重传的报数与预设数量之间的比值,得到重传率。第一无线耳机在获取重传率时,也可以获取在目标时长内发送的数据包的数量作为第一数量,以及自动重传的数据包的数量作为第二数量,然后获取第二数量与第一数量的比值,得到重传率。Optionally, the communication quality parameter may include a retransmission rate. When obtaining the retransmission rate, the first wireless earphone can obtain the ratio between the number of automatically retransmitted reports and the preset number after sending a preset number of data packets to the electronic device, so as to obtain the retransmission rate. When obtaining the retransmission rate, the first wireless earphone may also obtain the number of data packets sent within the target duration as the first number, and the number of automatically retransmitted data packets as the second number, and then obtain the second number and the first number A ratio of the number to get the retransmission rate.
步骤S130:获取与所述通信质量参数对应的目标码率,并控制所述第一无线耳机以及所述第二无线耳机以所述目标码率,对采集的音频数据进行编码。Step S130: Obtain a target bit rate corresponding to the communication quality parameter, and control the first wireless earphone and the second wireless earphone to encode the collected audio data at the target bit rate.
在本申请实施例中,第一无线耳机在获取到以上通信质量参数之后,则可以根据该通信质量参数,分别控制第一无线耳机以及第二无线耳机对采集的音频数据进行编码的编码码率,以使编码码率与通信质量参数相匹配,避免通信质量较差时,编码码率较高而导致音频数据传输至电子设备时出现卡顿。其中,第一无线耳机可以根据通信质量参数,确定出对应的目标码率,并控制第一无线耳机以及第二无线耳机以目标码率,对采集的音频数据进行编码。In the embodiment of the present application, after the first wireless earphone acquires the above communication quality parameters, it can respectively control the coding rate of the first wireless earphone and the second wireless earphone to encode the collected audio data according to the communication quality parameters. , so that the encoding bit rate matches the communication quality parameters, and avoids lag when the audio data is transmitted to the electronic device due to a high encoding bit rate when the communication quality is poor. Wherein, the first wireless earphone can determine a corresponding target bit rate according to the communication quality parameter, and control the first wireless earphone and the second wireless earphone to encode the collected audio data at the target bit rate.
在一些实施方式中,第一无线耳机可以确定与通信质量参数相匹配的编码码率作为目标码率,然后控制第一无线耳机以目标码率进行编码;另外,可以将确定的目标码率发送至第二无线耳机,以指示第二无线耳机以该目标码率进行编码,从而实现根据通信质量参数分别控制第一无线耳机以及第二无线耳机的编码码率。In some implementations, the first wireless earphone can determine the encoding bit rate that matches the communication quality parameter as the target bit rate, and then control the first wireless earphone to encode at the target bit rate; in addition, the determined target bit rate can be sent to to the second wireless earphone, so as to instruct the second wireless earphone to encode at the target bit rate, so as to control the encoding bit rates of the first wireless earphone and the second wireless earphone respectively according to the communication quality parameters.
在一些实施方式中,第一无线耳机可以根据通信质量参数,确定对应的编码码率作为目标码率后,控制第一无线耳机以该目标码率码率进行编码;另外,可以将通信质量参数发送至第二无线耳机,第二无线耳机根据同样的确定编码码率的方式,根据通信质量参数,确定出对应的目标码率后,控制第二无线耳机以该目标码率进行编码。In some implementations, the first wireless earphone can determine the corresponding encoding bit rate as the target bit rate according to the communication quality parameter, and then control the first wireless earphone to encode at the target bit rate; in addition, the communication quality parameter can be After sending to the second wireless earphone, the second wireless earphone determines the corresponding target bit rate according to the same method of determining the encoding bit rate according to the communication quality parameters, and then controls the second wireless earphone to encode at the target bit rate.
本申请实施例提供的编码控制方法,第一无线耳机以及第二无线耳机进行音频采集的过程中,用于传输音频数据至电子设备的第一无线耳机,根据其与电子设备之间无线通信的通信质量参数,对第一无线耳机以及第二无线耳机对音频数据进行编码的码率进行控制,使编码码率与通信质量参数相适应,避免音频数据传输时的卡顿,而导致录制的音频出现卡顿或断续,提升了录音效果。According to the encoding control method provided by the embodiment of the present application, during the audio collection process of the first wireless earphone and the second wireless earphone, the first wireless earphone used to transmit audio data to the electronic device, according to the wireless communication between the first wireless earphone and the electronic device The communication quality parameter controls the bit rate at which the first wireless earphone and the second wireless earphone encode audio data, so that the encoding bit rate adapts to the communication quality parameter, and avoids the stuttering of the audio data transmission, resulting in the recorded audio There is a stutter or intermittent, which improves the recording effect.
请参阅图5,图5示出了本申请另一个实施例提供的编码控制方法的流程示意图,该编码控制方法应用于上述第一无线耳机。于本实施例中,第一无线耳机获取的通信质量参数可以包括多种质量参数。下面将针对图5所示的流程进行详细的阐述,所述编码控制方法具体可以包括以下步骤:Please refer to FIG. 5 . FIG. 5 shows a schematic flowchart of an encoding control method provided by another embodiment of the present application, and the encoding control method is applied to the above-mentioned first wireless earphone. In this embodiment, the communication quality parameters acquired by the first wireless earphone may include multiple quality parameters. The flow shown in Figure 5 will be described in detail below, and the encoding control method may specifically include the following steps:
步骤S210:在所述第一无线耳机以及所述第二无线耳机进行音频采集的过程中,所述第一无线耳机将所述第一无线耳机以及所述第二无线耳机各自采集且经过编码后的音频数据发送至所述电子设备。Step S210: During the process of audio collection by the first wireless earphone and the second wireless earphone, the first wireless earphone collects and codes the first wireless earphone and the second wireless earphone respectively audio data sent to the electronic device.
步骤S220:获取所述第一无线耳机与所述电子设备之间无线通信的通信质量参数。Step S220: Obtain a communication quality parameter of the wireless communication between the first wireless earphone and the electronic device.
在本申请实施例中,步骤S210以及步骤S220可以参阅其他实施例的内容,在此不再赘述。In the embodiment of the present application, reference may be made to the contents of other embodiments for step S210 and step S220, and details are not repeated here.
步骤S230:根据所述多种质量参数,确定对应的编码码率作为目标码率。Step S230: According to the various quality parameters, determine a corresponding coding rate as a target rate.
在本申请实施例中,第一无线耳机获取的与电子设备之间无线通信的通信质量参数,可以包括多种质量参数,以综合多种质量参数,确定第一无线耳机以及第二无线耳机对应的编码码率作为目标码率。其中,多种质量参数可以至少包括接收信号强度、重传率以及丢包率,当然,多种质量参数也可以包括更多的用于反映第一无线耳机与电子设备之间通信质量的参数,例如还可以包括信道占用比等参数。In the embodiment of the present application, the communication quality parameters obtained by the first wireless earphone and the electronic device for wireless communication may include various quality parameters, so as to synthesize the various quality parameters to determine the correspondence between the first wireless earphone and the second wireless earphone. The encoding bit rate of is used as the target bit rate. Wherein, the multiple quality parameters may include at least received signal strength, retransmission rate, and packet loss rate, and of course, the multiple quality parameters may also include more parameters for reflecting the communication quality between the first wireless earphone and the electronic device, For example, parameters such as channel occupancy ratio may also be included.
在一些实施方式中,可以预先设置有编码码率与多种质量参数的不同参数值之间的对应关系,第一无线耳机可以通过查找该对应关系中,与获取的多种质量参数的参数值所对应的编码码率,得到第一无线耳机以及第二无线耳机对应的编码码率作为目标码率。其中,多种质量参数的参数值越高,则编码码率越高。In some implementations, the correspondence between the encoding bit rate and different parameter values of various quality parameters may be preset, and the first wireless earphone may search for the corresponding relationship, and the obtained parameter values of various quality parameters For the corresponding encoding bit rates, the encoding bit rates corresponding to the first wireless earphone and the second wireless earphone are obtained as target bit rates. Wherein, the higher the parameter values of various quality parameters are, the higher the coding rate is.
在另一些实施方式中,第一无线耳机可以根据多种质量参数,判断当前的编码码率是否满足第一条件,第一条件为根据当前的编码码率进行编码的音频数据,在获取的多种质量参数下传输至电子设备时能够顺畅的传输的条件;若当前的编码码率不满足第一条件,则可以对编码码率进行减小,以避免传输时出现卡顿;若当前的编码码率满足第一条件,则进一步判断当前的编码码率是否满足第二条件,第二条件为增大编码码率后,在获取的多种质量参数下传输至电子设备时能够顺畅的传输的条件;若当前的编码码率满足第二条件,则可以增大编码码率,以提升传输至电子设备的音频数据的质量;若当前的编码码率不满足第二条件,则可以保持当前的编码码率不变。In some other implementation manners, the first wireless earphone can judge whether the current encoding bit rate satisfies the first condition according to various quality parameters. The conditions for smooth transmission when transmitting to electronic devices under these quality parameters; if the current encoding bit rate does not meet the first condition, the encoding bit rate can be reduced to avoid jamming during transmission; if the current encoding bit rate If the code rate satisfies the first condition, it is further judged whether the current encoding rate meets the second condition. The second condition is that after increasing the encoding rate, it can be transmitted smoothly to the electronic device under various quality parameters obtained. Condition; if the current encoding bit rate satisfies the second condition, the encoding bit rate can be increased to improve the quality of the audio data transmitted to the electronic device; if the current encoding bit rate does not meet the second condition, the current encoding bit rate can be maintained The code rate remains unchanged.
当然,第一无线耳机根据多种质量参数,确定目标码率的具体方式可以不做限定。例如,第一无线耳机可以判断多种质量参数是否满足相应的参数条件,并根据判断结果,确定对应的码率作为目标码率。Of course, the specific manner in which the first wireless earphone determines the target code rate according to various quality parameters may not be limited. For example, the first wireless earphone may determine whether various quality parameters meet corresponding parameter conditions, and determine the corresponding code rate as the target code rate according to the judgment result.
步骤S240:分别控制所述第一无线耳机以及所述第二无线耳机以所述目标码率,对采集的音频数据进行编码。Step S240: respectively controlling the first wireless earphone and the second wireless earphone to encode the collected audio data at the target bit rate.
在本申请实施例中,第一无线耳机在确定出目标码率之后,则可以分别控制第一无线耳机以及所述第二无线耳机以目标码率,对采集的音频数据进行编码。可选地,若当前的编码码率与目标码率不同,则可以控制第一无线耳机将编码码率调整为目标码率;另外,可以将目标码率发送至第二无线耳机,以指示第二无线耳机将编码码率调整为目标码率。In the embodiment of the present application, after the first wireless earphone determines the target code rate, it can respectively control the first wireless earphone and the second wireless earphone to encode the collected audio data at the target code rate. Optionally, if the current encoding bit rate is different from the target bit rate, the first wireless earphone can be controlled to adjust the encoding bit rate to the target bit rate; in addition, the target bit rate can be sent to the second wireless earphone to indicate that the first wireless earphone The second wireless earphone adjusts the coding bit rate to the target bit rate.
在一些实施方式中,若第一无线耳机以及第二无线耳机中均设置有以上根据多种质量参数确定对应的码率作为目标码率的相同逻辑,则在控制第二无线耳机的编码码率时,也可以将多种质量参数发送至第二无线耳机,从而第二无线耳机可以根据该逻辑,确定出多种质量参数对应的码率后,将编码码率调整为该码率。In some embodiments, if both the first wireless earphone and the second wireless earphone are equipped with the same logic of determining the corresponding code rate as the target code rate according to various quality parameters above, then when controlling the encoding code rate of the second wireless earphone At this time, various quality parameters may also be sent to the second wireless earphone, so that the second wireless earphone may determine the bit rate corresponding to the various quality parameters according to the logic, and then adjust the encoding bit rate to the bit rate.
本申请实施例提供的编码控制方法,第一无线耳机以及第二无线耳机进行音频采集的过程中,用于传输音频数据至电子设备的第一无线耳机,综合其与电子设备之间无线通信的多种质量参数,对第一无线耳机以及第二无线耳机对音频数据进行编码的码率进行控制,由此,可以使第一无线耳机以及第二无线耳机进行编码的编码码率与多种质量参数相适应,避免音频数据传输时的卡顿,而导致录制的音频出现卡顿或断续,提升了录音效果。In the encoding control method provided by the embodiment of the present application, during the audio collection process of the first wireless earphone and the second wireless earphone, the first wireless earphone is used to transmit audio data to the electronic device, and the wireless communication between it and the electronic device is integrated. A variety of quality parameters are used to control the bit rate at which the first wireless earphone and the second wireless earphone encode audio data, thereby enabling the encoding bit rate and various quality parameters of the first wireless earphone and the second wireless earphone to be encoded. The parameters are adapted to avoid stuttering during audio data transmission, resulting in stuttering or intermittent audio recording, which improves the recording effect.
请参阅图6,图6示出了本申请又一个实施例提供的编码控制方法的流程示意图,该编码控制方法应用于上述第一无线耳机。于本实施例中,第一无线耳机获取的通信质量参数可以包括多种质量参数。下面将针对图6所示的流程进行详细的阐述,所述编码控制方法具体可以包括以下步骤:Please refer to FIG. 6 . FIG. 6 shows a schematic flowchart of an encoding control method provided by another embodiment of the present application, and the encoding control method is applied to the above-mentioned first wireless earphone. In this embodiment, the communication quality parameters acquired by the first wireless earphone may include multiple quality parameters. The process shown in Figure 6 will be described in detail below, and the encoding control method may specifically include the following steps:
步骤S310:在所述第一无线耳机以及所述第二无线耳机进行音频采集的过程中,所述第一无线耳机将所述第一无线耳机以及所述第二无线耳机各自采集且经过编码后的音频数据发送至所述电子设备。Step S310: During the audio collection process of the first wireless earphone and the second wireless earphone, the first wireless earphone collects and codes the first wireless earphone and the second wireless earphone respectively audio data sent to the electronic device.
步骤S320:获取所述第一无线耳机与所述电子设备之间无线通信的通信质量参数。Step S320: Obtain a communication quality parameter of the wireless communication between the first wireless earphone and the electronic device.
在本申请实施例中,步骤S310以及步骤S320可以参阅其他实施例的内容,在此不再赘述。In this embodiment of the present application, reference may be made to the contents of other embodiments for step S310 and step S320, and details are not repeated here.
步骤S330:获取所述多种质量参数中满足对应的预设参数条件的质量参数的数量,其中,每种质量参数对应一个预设参数条件。Step S330: Obtain the number of quality parameters that meet the corresponding preset parameter conditions among the various quality parameters, where each quality parameter corresponds to a preset parameter condition.
在本申请实施例中,第一无线耳机获取的多种质量参数的每种质量参数可以对应的有一个预设参数条件,该预设参数条件用于确定该质量参数是否满足顺畅的传输音频数据至电子设备。第一无线耳机可以将每种质量参数与每种质量参数对应的预设参数条件进行匹配,然后确定出满足其对应的预设参数条件的质量参数的数量。可以理解地,满足预设参数条件的质量参数的数量越多,则表示第一无线耳机与电子设备之间无线通信的通信质量越好。In the embodiment of the present application, each quality parameter obtained by the first wireless earphone may correspond to a preset parameter condition, and the preset parameter condition is used to determine whether the quality parameter satisfies smooth transmission of audio data. to electronic equipment. The first wireless earphone may match each quality parameter with a preset parameter condition corresponding to each quality parameter, and then determine the number of quality parameters satisfying the corresponding preset parameter condition. Understandably, the more quality parameters satisfying the preset parameter condition, the better the communication quality of the wireless communication between the first wireless earphone and the electronic device.
在一些实施方式中,预设参数条件可以为参数值条件。每种质量参数可以对应有多个参数值,例如,每种质量参数为预设时长内获取到的该类型的质量参数的多个参数值。第一无线耳机可以基于每种质量参数对应的多个参数值,获取每种质量参数对应的目标参数值;将每种质量参数对应的目标参数值与对应的参数值条件进行匹配,其中,每种质量参数对应一个参数值条件;获取多种质量参数中目标质量参数的数量,其中,目标质量参数的目标参数值与对应的参数值条件匹配。可选地,第一无线耳机基于每种质量参数对应的多个参数值,获取每种质量参数对应的目标参数值,可以是,获取每种质量参数对应的多个参数值的平均值,作为每种质量参数对应的目标参数值。In some implementations, the preset parameter condition may be a parameter value condition. Each quality parameter may correspond to multiple parameter values, for example, each quality parameter is a plurality of parameter values of the type of quality parameter obtained within a preset time period. The first wireless earphone can obtain the target parameter value corresponding to each quality parameter based on multiple parameter values corresponding to each quality parameter; match the target parameter value corresponding to each quality parameter with the corresponding parameter value condition, wherein each One quality parameter corresponds to one parameter value condition; the number of target quality parameters among the multiple quality parameters is obtained, wherein the target parameter value of the target quality parameter matches the corresponding parameter value condition. Optionally, the first wireless earphone acquires the target parameter value corresponding to each quality parameter based on the multiple parameter values corresponding to each quality parameter, which may be, acquires the average value of the multiple parameter values corresponding to each quality parameter, as Target parameter values for each quality parameter.
可以理解地,质量参数的类型不同,则其参数值之间也不同,因此需要针对不同的质量参数,设置对应的参数值条件。示例性地,质量参数为接收信号强度时,参数值条件可以为:接收信号强度处于-105dBm(分贝毫瓦)~-95dBm;质量参数为重传率时,参数值条件可以为:重传率小于0.05。当然,具体的参数值条件可以不做限定,可以根据实际需求设置。It can be understood that different types of quality parameters have different parameter values. Therefore, corresponding parameter value conditions need to be set for different quality parameters. Exemplarily, when the quality parameter is the received signal strength, the parameter value condition may be: the received signal strength is between -105dBm (decibel milliwatt) ~ -95dBm; when the quality parameter is the retransmission rate, the parameter value condition may be: the retransmission rate less than 0.05. Certainly, the specific parameter value conditions may not be limited, and may be set according to actual requirements.
在一种可能的实施方式中,第一无线耳机可以基于每种质量参数对应的多个参数值,获取每种质量参数对应的目标参数值,以及每种质量参数对应的变化趋势;将每种质量参数对应的目标参数值与对应的参数值条件进行匹配,其中,每种质量参数对应一个参数值条件;获取多种质量参数中目标质量参数的数量,其中,目标质量参数的目标参数值与对应的参数值条件匹配,且目标质量参数对应的变化趋势不为减小趋势。在该实施方式中,每种质量参数对应的多个参数值可以为预设时长内获取到的参数值,第一无线耳机还可以基于每种质量参数对应的多个参数值,确定每种质量参数的变化趋势,并且综合每种质量参数是否满足其对应的参数值条件以及每种质量参数的变化趋势,确定出满足对应的预设参数条件的质量参数的数量。可以理解地,对于某种质量参数,若其同时满足对应的参数值条件,并且其变化趋势不为减小趋势, 则表示该质量参数所表示的通信质量较好。In a possible implementation manner, the first wireless earphone may acquire a target parameter value corresponding to each quality parameter and a change trend corresponding to each quality parameter based on multiple parameter values corresponding to each quality parameter; The target parameter value corresponding to the quality parameter is matched with the corresponding parameter value condition, wherein each quality parameter corresponds to a parameter value condition; the quantity of the target quality parameter among various quality parameters is obtained, wherein the target parameter value of the target quality parameter is matched with The corresponding parameter value conditions match, and the change trend corresponding to the target quality parameter is not a decreasing trend. In this embodiment, the multiple parameter values corresponding to each quality parameter may be parameter values obtained within a preset time period, and the first wireless earphone may also determine each quality parameter value based on the multiple parameter values corresponding to each quality parameter. The change trend of the parameters, and whether each quality parameter satisfies its corresponding parameter value condition and the change trend of each quality parameter, determine the quantity of quality parameters that meet the corresponding preset parameter condition. It can be understood that, for a certain quality parameter, if it satisfies the corresponding parameter value condition at the same time, and its change trend is not a decreasing trend, it means that the communication quality represented by the quality parameter is better.
步骤S340:基于所述数量,确定对应的编码码率作为目标码率,其中,所述编码码率与所述数量呈正相关。Step S340: Based on the quantity, determine a corresponding coding rate as a target rate, wherein the coding rate is positively correlated with the quantity.
在本申请实施例中,第一无线耳机确定出满足其对应的预设参数条件的质量参数的数量之后,则可以基于该数量,确定对应的编码码率作为目标码率。由于确定的以上数量越大,则表示第一无线耳机与电子设备之间通信的通信质量越好,因此编码码率可以与数量呈正相关,也就是说,该数量越大,表示通信质量越好,因此编码码率越高。In the embodiment of the present application, after the first wireless earphone determines the number of quality parameters satisfying its corresponding preset parameter condition, the corresponding coding rate may be determined as the target bit rate based on the number. Since the greater the determined above quantity, it means that the communication quality between the first wireless earphone and the electronic device is better, so the coding bit rate can be positively correlated with the quantity, that is to say, the larger the quantity, the better the communication quality , so the encoding rate is higher.
在一些实施方式中,第一无线耳机中存储有编码码率与该数量之间的对应关系,第一无线耳机可以通过查找该对应关系,确定出与以上确定的数量所对应的编码码率,并将该编码码率作为目标码率。In some implementation manners, the first wireless earphone stores the correspondence between the encoding code rate and the quantity, and the first wireless earphone can determine the encoding code rate corresponding to the above-determined quantity by searching for the correspondence, And use the encoding bit rate as the target bit rate.
示例性地,以多种质量参数包括接收信号强度以及重传率时,说明不同情况下的编码码率。其中,编码码率包括三个范围,100~200kbps,200~300kbps,以及,300~400kbps;在开始进行录音时,初始的压缩码率设为最高,即在一般的情况下,通信质量比较好,此时采用高码率进行编码,录制出来的声音质量最好;在后续的录音过程中,则可以根据接收信号强度以及重传率中满足对应的预设参数条件的参数的数量,确定编码码率,若接收信号强度以及重传率均满足其对应的预设参数条件,则编码码率可以处于300~400kbps;若接收信号强度以及重传率中其中一个满足其对应的预设参数条件,则编码码率可以处于200~300kbps;若接收信号强度以及重传率中均不其对应的预设参数条件,则编码码率可以处于100~200kbps。Exemplarily, when various quality parameters include received signal strength and retransmission rate, the coding rates under different situations are illustrated. Among them, the encoding bit rate includes three ranges, 100~200kbps, 200~300kbps, and 300~400kbps; when starting to record, the initial compression bit rate is set to the highest, that is, under normal circumstances, the communication quality is better , at this time, a high bit rate is used for encoding, and the recorded sound quality is the best; in the subsequent recording process, the encoding can be determined according to the received signal strength and the number of parameters in the retransmission rate that meet the corresponding preset parameter conditions. Code rate, if the received signal strength and retransmission rate meet its corresponding preset parameter conditions, the encoding code rate can be 300-400kbps; if one of the received signal strength and retransmission rate meets its corresponding preset parameter conditions , the coding rate can be in the range of 200-300kbps; if the received signal strength and the retransmission rate do not have the corresponding preset parameter conditions, the coding rate can be in the range of 100-200kbps.
在一些场景中,请参阅图7,若用户佩戴第一无线耳机12以及第二无线耳机13的情况下,并且手持电子设备11,此时获得的多种质量参数中满足预设参数条件的质量参数的数量为M;请参阅图8,若用户佩戴第一无线耳机12以及第二无线耳机13的情况下,并且电子设备11放置于衣服的口袋内,获得的多种质量参数中满足预设参数条件的质量参数的数量为N;其中,N和M为正整数,由于图8中电子设备11处于口袋内,第一无线耳机12与电子设备13之间的无线通信会受到影响,因此获得的N会小于M,也就是说,图8所示场景中的通信质量会差于图7所示场景中的通信质量,此时,基于N所确定的编码码率低于基于M确定的编码码率,由此保证电子设备11处于口袋内时,录音时不会出现卡顿或断续。In some scenarios, please refer to FIG. 7, if the user wears the first wireless earphone 12 and the second wireless earphone 13, and holds the electronic device 11, among the various quality parameters obtained at this time, the quality that satisfies the preset parameter conditions The number of parameters is M; please refer to FIG. 8, if the user wears the first wireless earphone 12 and the second wireless earphone 13, and the electronic device 11 is placed in the pocket of the clothes, the various quality parameters obtained satisfy the preset The quantity of the quality parameter of the parameter condition is N; Wherein, N and M are positive integers, since the electronic device 11 is in the pocket in Fig. 8, the wireless communication between the first wireless earphone 12 and the electronic device 13 will be affected, so obtain N will be smaller than M, that is, the communication quality in the scenario shown in Figure 8 will be worse than that in the scenario shown in Figure 7. At this time, the encoding rate determined based on N is lower than the encoding rate determined based on M. bit rate, thereby ensuring that when the electronic device 11 is in the pocket, there will be no stuttering or intermittent recording.
在一些场景中,请再次参阅图7,若用户佩戴第一无线耳机12以及第二无线耳机13的情况下,并且手持电子设备11,此时获得的多种质量参数中满足预设参数条件的质量参数的数量为M;请参阅图9,若用户佩戴第一无线耳机12以及第二无线耳机13的情况下,电子设备11放置于相距较远的桌面上,此时获得的多种质量参数中满足预设参数条件的质量参数的数量为T;其中,M和T为正整数,由于图9中电子设备11放置于桌面,相距用户有一定距离,第一无线耳机12与电子设备13之间的无线通信会受到影响,因此获得的T会小于M,也就是说,图9中的通信质量会差于图7中的通信质量,此时,基于T所确定的编码码率低于基于M确定的编码码率,由此保证电子设备11相距用户有一定距离时,录音时不会出现卡顿或断续。In some scenarios, please refer to FIG. 7 again. If the user wears the first wireless earphone 12 and the second wireless earphone 13, and holds the electronic device 11, among the various quality parameters obtained at this time, those that meet the preset parameter conditions The number of quality parameters is M; please refer to FIG. 9, if the user wears the first wireless earphone 12 and the second wireless earphone 13, and the electronic device 11 is placed on a desktop far away, the various quality parameters obtained at this time The number of quality parameters that meet the preset parameter conditions is T; wherein, M and T are positive integers. Since the electronic device 11 is placed on the desktop in FIG. The wireless communication between will be affected, so the obtained T will be smaller than M, that is to say, the communication quality in Figure 9 will be worse than that in Figure 7, at this time, the coding rate determined based on T is lower than that based on The coding rate determined by M ensures that when the electronic device 11 is at a certain distance from the user, there will be no stuttering or intermittent recording.
步骤S350:分别控制所述第一无线耳机以及所述第二无线耳机以所述目标码率,对采集的音频数据进行编码。Step S350: respectively controlling the first wireless earphone and the second wireless earphone to encode the collected audio data at the target bit rate.
在本申请实施例中,第一无线耳机在确定出目标码率之后,则可以分别控制第一无线耳机以及所述第二无线耳机以目标码率,对采集的音频数据进行编码。可选地,若当前的编码码率与目标码率不同,则可以控制第一无线耳机将编码码率调整为目标码率;另外,可以将目标码率发送至第二无线耳机,以指示第二无线耳机将编码码率调整为目标码率。In the embodiment of the present application, after the first wireless earphone determines the target code rate, it can respectively control the first wireless earphone and the second wireless earphone to encode the collected audio data at the target code rate. Optionally, if the current encoding bit rate is different from the target bit rate, the first wireless earphone can be controlled to adjust the encoding bit rate to the target bit rate; in addition, the target bit rate can be sent to the second wireless earphone to indicate that the first wireless earphone The second wireless earphone adjusts the coding bit rate to the target bit rate.
在一些实施方式中,若第一无线耳机以及第二无线耳机中均设置有以上根据多种质量参数确定对应的码率作为目标码率的相同逻辑,则在控制第二无线耳机的编码码率时,也可以将多种质量参数发送至第二无线耳机,从而第二无线耳机可以根据该逻辑,确定出多种质量参数对应的码率后,将编码码率调整为该码率。In some embodiments, if both the first wireless earphone and the second wireless earphone are equipped with the same logic of determining the corresponding code rate as the target code rate according to various quality parameters above, then when controlling the encoding code rate of the second wireless earphone At this time, various quality parameters may also be sent to the second wireless earphone, so that the second wireless earphone may determine the bit rate corresponding to the various quality parameters according to the logic, and then adjust the encoding bit rate to the bit rate.
示例性地,请参阅图10,第一无线耳机中设置有TWS模块、稳定性识别模块、码率控制模块、编码器以及SPP(Serial Port Profile,蓝牙串口传输协议)传输模块,第二无线耳机中设置有编码器、码率控制模块以及TWS模块。其中,第二无线耳机的TWS模块用于传输其采集且经过编码后的音频数据至第一无线耳机;第一无线耳机的稳定性识别模块用于获取通信质量参数,码率控制模块用于根据通信质量参数,确定对应的编码码率的特征值,然后将特征 值发送至编码器,编码器根据特征值调整编码码率为对应的码率;第一无线耳机的稳定性识别模块还可以将获取的通信质量参数发送至第二无线耳机的码率控制模块,同样的,第二无线耳机中的码率控制模块可以根据通信质量参数确定对应的编码码率的特征值,然后将特征值发送至编码器,编码器根据特征值调整编码码率为对应的码率。Exemplarily, referring to Fig. 10, the first wireless earphone is provided with a TWS module, a stability identification module, a code rate control module, an encoder and an SPP (Serial Port Profile, Bluetooth serial port transmission protocol) transmission module, and the second wireless earphone An encoder, a code rate control module and a TWS module are set in it. Among them, the TWS module of the second wireless earphone is used to transmit the collected and encoded audio data to the first wireless earphone; the stability recognition module of the first wireless earphone is used to obtain communication quality parameters, and the code rate control module is used to Communication quality parameters, determine the eigenvalue of the corresponding encoding code rate, and then send the eigenvalue to the encoder, and the encoder adjusts the encoding bit rate to the corresponding bit rate according to the eigenvalue; the stability recognition module of the first wireless earphone can also set the The obtained communication quality parameters are sent to the code rate control module of the second wireless earphone. Similarly, the code rate control module in the second wireless earphone can determine the characteristic value of the corresponding encoding code rate according to the communication quality parameter, and then send the characteristic value to To the encoder, the encoder adjusts the encoding bit rate to the corresponding bit rate according to the feature value.
在一些实施方式中,第一无线耳机根据多种质量参数,确定编码码率时,第一无线耳机与第二无线耳机进行编码的编码码率可以相同,也可以不同。可选地,第一无线耳机还可以获取与第二无线耳机之间无线通信的通信质量参数,然后根据该通信质量参数,确定对应的编码码率作为第一码率,其中,确定编码码率的方式可以参考上述根据通信质量参数确定编码码率的方式;若第一码率与上述目标码率相同,则可以控制第一无线耳机以及第二无线耳机以目标码率进行编码;若第一码率小于目标码率,则可以控制第二无线耳机以第一码率进行编码,控制第一无线耳机以目标码率进行编码,在合并两者的音频数据时,可以将第二无线耳机发送的音频数据调整为目标码率的音频数据后,再进行合并,得到目标码率的音频数据,由此,可以保证第二无线耳机与第一无线耳机之间顺畅进行音频数据的传输,并且使第一无线耳机编码后获取的音频数据的质量相对较好;若第一码率小于目标码率,此时,需要优先保证第一无线耳机与电子设备之间可以顺畅的进行音频数据传输,因此,可以控制第一无线耳机以及第二无线耳机均以目标码率进行编码,由此,可以保证第二无线耳机与第一无线耳机之间、以及第一无线耳机与电子设备之间均能顺畅进行音频数据的传输。In some implementation manners, when the first wireless earphone determines the encoding bit rate according to various quality parameters, the encoding bit rates of the first wireless earphone and the second wireless earphone may be the same or different. Optionally, the first wireless earphone may also obtain a communication quality parameter of the wireless communication with the second wireless earphone, and then determine the corresponding encoding code rate as the first code rate according to the communication quality parameter, wherein determining the encoding code rate The method can refer to the above method of determining the encoding code rate according to the communication quality parameters; if the first code rate is the same as the above target code rate, the first wireless earphone and the second wireless earphone can be controlled to encode at the target code rate; if the first If the bit rate is lower than the target bit rate, the second wireless earphone can be controlled to encode at the first bit rate, and the first wireless earphone can be controlled to encode at the target bit rate. When the audio data of the two are combined, the second wireless earphone can be sent After the audio data of the audio data is adjusted to the audio data of the target code rate, and then merged to obtain the audio data of the target code rate, it can ensure the smooth transmission of audio data between the second wireless earphone and the first wireless earphone, and make The quality of the audio data obtained after the encoding of the first wireless earphone is relatively good; if the first bit rate is lower than the target bit rate, at this time, it is necessary to give priority to ensuring smooth audio data transmission between the first wireless earphone and the electronic device, so , it is possible to control both the first wireless earphone and the second wireless earphone to encode at the target bit rate, thereby ensuring smooth communication between the second wireless earphone and the first wireless earphone, and between the first wireless earphone and the electronic device. Carry out the transmission of audio data.
本申请实施例提供的编码控制方法,第一无线耳机以及第二无线耳机进行音频采集的过程中,用于传输音频数据至电子设备的第一无线耳机,根据其与电子设备之间无线通信的多种质量参数,确定满足对应的预设参数调条件的质量参数的数量,并根据该数量确定对应的编码码率,由此,可以使第一无线耳机以及第二无线耳机进行编码的编码码率与多种质量参数相适应,避免音频数据传输时的卡顿,而导致录制的音频出现卡顿或断续,提升了录音效果。According to the encoding control method provided by the embodiment of the present application, during the audio collection process of the first wireless earphone and the second wireless earphone, the first wireless earphone used to transmit audio data to the electronic device, according to the wireless communication between the first wireless earphone and the electronic device A variety of quality parameters, determine the number of quality parameters that meet the corresponding preset parameter adjustment conditions, and determine the corresponding encoding bit rate according to the number, so that the first wireless earphone and the second wireless earphone can encode the encoding code The rate is adapted to a variety of quality parameters, avoiding stuttering during audio data transmission, resulting in stuttering or intermittent recording of audio, and improving the recording effect.
请参阅图11,图11示出了本申请再一个实施例提供的编码控制方法的流程示意图,该编码控制方法应用于上述第一无线耳机。于本实施例中,第一无线耳机获取的通信质量参数可以包括多种质量参数。下面将针对图11所示的流程进行详细的阐述,所述编码控制方法具体可以包括以下步骤:Please refer to FIG. 11 . FIG. 11 shows a schematic flowchart of an encoding control method provided by another embodiment of the present application, and the encoding control method is applied to the above-mentioned first wireless earphone. In this embodiment, the communication quality parameters acquired by the first wireless earphone may include multiple quality parameters. The flow shown in Figure 11 will be described in detail below, and the encoding control method may specifically include the following steps:
步骤S410:在所述第一无线耳机以及所述第二无线耳机进行音频采集的过程中,所述第一无线耳机将所述第一无线耳机以及所述第二无线耳机各自采集且经过编码后的音频数据发送至所述电子设备。Step S410: During the process of audio collection by the first wireless earphone and the second wireless earphone, the first wireless earphone collects and codes the first wireless earphone and the second wireless earphone respectively audio data sent to the electronic device.
步骤S420:获取所述第一无线耳机与所述电子设备之间无线通信的通信质量参数。Step S420: Obtain a communication quality parameter of the wireless communication between the first wireless earphone and the electronic device.
在本申请实施例中,步骤S310以及步骤S320可以参阅其他实施例的内容,在此不再赘述。In this embodiment of the present application, reference may be made to the contents of other embodiments for step S310 and step S320, and details are not repeated here.
步骤S430:获取所述多种质量参数中每种质量参数对应的质量得分。Step S430: Obtain the quality score corresponding to each quality parameter in the various quality parameters.
在本申请实施例中,第一无线耳机在基于多种质量参数,确定对应的编码码率时,可以获取多种质量参数中每种质量参数对应的质量得分,以根据每种质量参数对应的质量得分,确定当前通信质量的得分。In this embodiment of the present application, when the first wireless earphone determines the corresponding encoding bit rate based on various quality parameters, it may obtain the quality score corresponding to each quality parameter among the various quality parameters, so as to obtain the corresponding quality score according to each quality parameter Quality Score, a score that determines the current communication quality.
在一些实施方式中,第一无线耳机可以设置有每种质量参数的质量得分与每种质量参数的不同参数值之间的对应关系,第一无线耳机可以根据对应关系,获取每种质量参数的参数值所对应的得分。其中,质量参数的得分可以与质量参数的参数值呈正相关,也就是说,每种质量参数的参数值越高,则该质量参数对应的通信质量越好,因此得分也可以越高。In some implementations, the first wireless earphone may be provided with a corresponding relationship between the quality score of each quality parameter and the different parameter values of each quality parameter, and the first wireless earphone may obtain the value of each quality parameter according to the corresponding relationship. The score corresponding to the parameter value. The score of the quality parameter may be positively correlated with the parameter value of the quality parameter, that is, the higher the parameter value of each quality parameter, the better the communication quality corresponding to the quality parameter, and therefore the higher the score may be.
步骤S440:获取所述每种质量参数对应的权重。Step S440: Obtain the weight corresponding to each quality parameter.
在本申请实施例中,第一无线耳机还可以存储有每种质量参数对应的权重。每种质量参数对应的权重可以预先设置,其中,不同质量参数的权重可以相同,也可以不同。In this embodiment of the present application, the first wireless earphone may further store weights corresponding to each quality parameter. The weights corresponding to each quality parameter can be preset, and the weights of different quality parameters can be the same or different.
可选地,每种质量参数对应的权重可以由无线耳机在出厂前进行设置,并存储于无线耳机中,从而无线耳机在被用于录音时,能够读取该权重以计算通信质量参数的得分。Optionally, the weight corresponding to each quality parameter can be set by the wireless headset before leaving the factory and stored in the wireless headset, so that when the wireless headset is used for recording, the weight can be read to calculate the score of the communication quality parameter .
可选地,每种质量参数对应的权重也可以在无线耳机开始录音之前,由用户进行设置。例如,电子设备可以显示用于配置每种质量参数的权重的配置界面,电子设备可以基于用户的操作,获取到用户配置的每种质量参数的权重;电子设备在获取到用户配置的每种质量参数的权重之后,可以将每种质量参数的权重发送至无线耳机,由此,无线耳机可以获取到本次录音过程中所配置的每种质量参数的权重。Optionally, the weight corresponding to each quality parameter may also be set by the user before the wireless earphone starts recording. For example, the electronic device can display a configuration interface for configuring the weight of each quality parameter, and the electronic device can obtain the weight of each quality parameter configured by the user based on the user's operation; After weighting the parameters, the weight of each quality parameter can be sent to the wireless earphone, so that the wireless earphone can obtain the weight of each quality parameter configured in the recording process.
步骤S450:基于所述每种质量参数对应的权重,以及所述每种质量参数对应的质量得分, 获取所述通信质量参数对应的质量得分作为总得分。Step S450: Based on the weight corresponding to each quality parameter and the quality score corresponding to each quality parameter, acquire the quality score corresponding to the communication quality parameter as a total score.
在本申请实施例中,第一无线耳机可以基于以上获取的每种质量参数对应的权重,以及每种质量参数对应的质量得分,进行加权计算,从而得到通信质量参数对应的质量得分作为总得分。其中,加权计算可以为加权求和,也可以为加权求平均值等,具体计算方式可以不做限定。In the embodiment of the present application, the first wireless earphone may perform weighted calculation based on the weight corresponding to each quality parameter obtained above and the quality score corresponding to each quality parameter, so as to obtain the quality score corresponding to the communication quality parameter as the total score . Wherein, the weighted calculation may be a weighted sum, or a weighted average, etc., and the specific calculation method may not be limited.
步骤S460:基于所述总得分,确定对应的编码码率作为目标码率,其中,所述编码码率与所述总得分呈正相关。Step S460: Based on the total score, determine a corresponding encoding bit rate as a target bit rate, wherein the encoding bit rate is positively correlated with the total score.
在本申请实施例中,第一无线耳机在基于每种质量参数对应的质量得分,确定出通信质量参数对应的总得分之后,可以基于总得分,确定对应的编码码率作为目标码率。其中,总得分表示了当前通信质量的分值,该总得分越高,则通信质量越好,因此,编码码率与总得分呈正相关,即总得分越高,则编码码率也越高。In the embodiment of the present application, after the first wireless earphone determines the total score corresponding to the communication quality parameter based on the quality score corresponding to each quality parameter, it may determine the corresponding coding rate as the target rate based on the total score. The total score represents the current communication quality score, the higher the total score, the better the communication quality, therefore, the coding rate is positively correlated with the total score, that is, the higher the total score, the higher the coding rate.
在一些实施方式中,第一无线耳机存储有编码码率与通信质量参数的总得分的对应关系,第一无线耳机在基于总得分,确定对应的编码码率时,可以基于该对应关系,查找与获取的总得分所对应的编码码率。In some implementations, the first wireless earphone stores the correspondence between the encoding bit rate and the total score of the communication quality parameter, and when determining the corresponding encoding bit rate based on the total score, the first wireless earphone can search for The encoding bit rate corresponding to the obtained total score.
步骤S470:分别控制所述第一无线耳机以及所述第二无线耳机以所述目标码率,对采集的音频数据进行编码。Step S470: respectively controlling the first wireless earphone and the second wireless earphone to encode the collected audio data at the target bit rate.
在本申请实施例中,步骤S460可以参阅前述实施例的内容,在此不再赘述。In the embodiment of the present application, reference may be made to the contents of the foregoing embodiments for step S460, and details are not repeated here.
本申请实施例提供的编码控制方法,第一无线耳机以及第二无线耳机进行音频采集的过程中,用于传输音频数据至电子设备的第一无线耳机,根据其与电子设备之间无线通信的多种质量参数,然后获取每种质量参数对应的质量的得分,并根据每种质量参数对应的得分及其权重,计算通信质量参数对应的总得分,由此,可以使第一无线耳机以及第二无线耳机进行编码的编码码率与多种质量参数相适应,避免音频数据传输时的卡顿,而导致录制的音频出现卡顿或断续,提升了录音效果。According to the encoding control method provided by the embodiment of the present application, during the audio collection process of the first wireless earphone and the second wireless earphone, the first wireless earphone used to transmit audio data to the electronic device, according to the wireless communication between the first wireless earphone and the electronic device Various quality parameters, and then obtain the quality score corresponding to each quality parameter, and calculate the total score corresponding to the communication quality parameter according to the score corresponding to each quality parameter and its weight, thus, the first wireless earphone and the second wireless earphone can be used The coding bit rate of the two wireless earphones is adapted to various quality parameters, avoiding stuttering during audio data transmission, resulting in stuttering or intermittent recording of audio, and improving the recording effect.
请参阅图12,图12示出了本申请又另一个实施例提供的编码控制方法的流程示意图,该编码控制方法应用于上述第一无线耳机。下面将针对图12所示的流程进行详细的阐述,所述编码控制方法具体可以包括以下步骤:Please refer to FIG. 12 . FIG. 12 shows a schematic flowchart of an encoding control method provided in yet another embodiment of the present application, and the encoding control method is applied to the above-mentioned first wireless earphone. The process shown in Figure 12 will be described in detail below, and the encoding control method may specifically include the following steps:
步骤S510:在所述第一无线耳机以及所述第二无线耳机进行音频采集的过程中,所述第一无线耳机将所述第一无线耳机以及所述第二无线耳机各自采集且经过编码后的音频数据发送至所述电子设备。Step S510: During the process of audio collection by the first wireless earphone and the second wireless earphone, the first wireless earphone collects and codes the first wireless earphone and the second wireless earphone respectively audio data sent to the electronic device.
步骤S520:获取所述第一无线耳机与所述电子设备之间无线通信的通信质量参数。Step S520: Obtain a communication quality parameter of the wireless communication between the first wireless earphone and the electronic device.
步骤S530:获取与所述通信质量参数对应的目标码率,并控制所述第一无线耳机以及所述第二无线耳机以所述目标码率,对采集的音频数据进行编码。Step S530: Obtain a target bit rate corresponding to the communication quality parameter, and control the first wireless earphone and the second wireless earphone to encode the collected audio data at the target bit rate.
在本申请实施例中,步骤S510至步骤S530可以参阅其他实施例的内容,在此不再赘述。In the embodiment of the present application, for steps S510 to S530, reference may be made to the contents of other embodiments, and details are not repeated here.
步骤S540:若所述通信质量参数对应的参数值低于第一阈值,检测所述第一无线耳机相对所述电子设备的距离。Step S540: If the parameter value corresponding to the communication quality parameter is lower than a first threshold, detect the distance between the first wireless earphone and the electronic device.
在本申请实施例中,第一无线耳机在获取到以上通信质量参数后,还可以将通信质量参数对应的参数值与第一阈值进行比较;根据比较结果,确定该参数值是否低于第一阈值;若低于第一阈值,表示第一无线耳机与电子设备之间的通信质量不佳,而通信质量不佳大多数情况下由于第一无线耳机与电子设备之间相距较远所致,因此,可以检测第一无线耳机相对电子设备的距离,以确定当前通信质量不佳是否由第一无线耳机与电子设备之间相距较远所致;若不低于第一阈值,则表示一无线耳机与电子设备之间的通信质量良好,因此可以不做处理。In the embodiment of the present application, after the first wireless earphone acquires the above communication quality parameters, it can also compare the parameter value corresponding to the communication quality parameter with the first threshold; and determine whether the parameter value is lower than the first threshold according to the comparison result. Threshold; if it is lower than the first threshold, it means that the communication quality between the first wireless earphone and the electronic device is not good, and the poor communication quality is mostly caused by the distance between the first wireless earphone and the electronic device, Therefore, the distance between the first wireless earphone and the electronic device can be detected to determine whether the current poor communication quality is caused by the distance between the first wireless earphone and the electronic device; if it is not lower than the first threshold, it indicates a wireless The communication quality between the headset and the electronic device is good, so it can be left alone.
在一些实施方式中,第一无线耳机检测第一无线耳机相对电子设备的距离,可以根据电子设备发出的广播消息,并根据广播消息中携带的接收信号强度指示,确定第一无线耳机相对电子设备的距离。其中,第一无线耳机相对电子设备的距离,可以与接收信号强度呈负相关,也就是说,接收信号强度越大,则第一无线耳机相对电子设备的距离越近。当然,第一无线耳机检测其相对电子设备的距离的方式可以不做限定。In some embodiments, the first wireless earphone detects the distance between the first wireless earphone and the electronic device, and can determine the distance between the first wireless earphone and the electronic device according to the broadcast message sent by the electronic device and according to the received signal strength indication carried in the broadcast message. distance. Wherein, the distance between the first wireless earphone and the electronic device may be negatively correlated with the strength of the received signal, that is, the greater the strength of the received signal, the closer the distance between the first wireless earphone and the electronic device. Certainly, the manner in which the first wireless earphone detects its distance relative to the electronic device may not be limited.
步骤S550:若所述距离小于距离阈值,增大所述第一无线耳机的所述无线通信的发射功率。Step S550: If the distance is less than a distance threshold, increase the transmission power of the wireless communication of the first wireless earphone.
在本申请实施例中,在获取到第一无线耳机相对电子设备的距离之后,可以将该距离与距离阈值进行比较;根据比较结果,确定该距离是否小于距离阈值;在获取的第一无线耳机相对电子设备的距离小于距离阈值时,则表示第一无线耳机与电子设备之间无线通信的当前通信质 量不佳,由第一无线耳机与电子设备之间相距较远所致,因此,可以增大第一无线耳机的无线通信的发射功率,以提升第一无线耳机传输音频数据至电子设备的传输质量,避免传输音频数据时的卡顿。在获取的第一无线耳机相对电子设备的距离不小于距离阈值时,则表示第一无线耳机与电子设备之间无线通信的当前通信质量不佳,不是由第一无线耳机与电子设备之间相距较远所致,该情况下,当前通信质量不佳可能是电子设备处于口袋内而导致信号传输被遮挡,因此,若第一无线耳机被佩戴,则可以输出提示信息,以提示用户将电子设备从口袋取出,以提升第一无线耳机与电子设备之间无线通信的通信质量。In the embodiment of the present application, after the distance between the first wireless earphone and the electronic device is obtained, the distance can be compared with the distance threshold; according to the comparison result, it is determined whether the distance is less than the distance threshold; When the distance relative to the electronic device is less than the distance threshold, it means that the current communication quality of the wireless communication between the first wireless earphone and the electronic device is not good, which is caused by the distance between the first wireless earphone and the electronic device. Therefore, it can be increased The transmission power of the wireless communication of the first wireless earphone is increased, so as to improve the transmission quality of the audio data transmitted by the first wireless earphone to the electronic device, and avoid the stuttering when transmitting the audio data. When the obtained distance between the first wireless earphone and the electronic device is not less than the distance threshold, it means that the current communication quality of the wireless communication between the first wireless earphone and the electronic device is not good, not because of the distance between the first wireless earphone and the electronic device In this case, the current poor communication quality may be caused by the signal transmission being blocked due to the electronic device being in the pocket. Therefore, if the first wireless headset is worn, a prompt message can be output to prompt the user to place the electronic device Take it out from the pocket to improve the communication quality of the wireless communication between the first wireless earphone and the electronic device.
在一些实施方式中,由于增大无线通信的发射功率,会带来功耗的增加,因此,第一无线耳机在确定出其相对电子设备的距离小于距离阈值时,还可以获取第一无线耳机的剩余电量;若剩余电量大于电量阈值,表示当前剩余电量充足,因此增大第一无线耳机的无线通信的发射功率。若剩余电量小于或等于电量阈值,表示当前的剩余电量不充足,此时,可以获取第一无线耳机的佩戴状态;若第一无线耳机处于佩戴状态,输出目标提示信息,该目标提示信息用于提示用户减小第一无线耳机与电子设备之间的距离。In some implementations, increasing the transmission power of wireless communication will lead to an increase in power consumption. Therefore, when the first wireless headset determines that its distance from the electronic device is less than the distance threshold, the first wireless headset may also acquire the If the remaining power is greater than the power threshold, it means that the current remaining power is sufficient, so the transmission power of the wireless communication of the first wireless earphone is increased. If the remaining power is less than or equal to the power threshold, it means that the current remaining power is not sufficient. At this time, the wearing state of the first wireless earphone can be obtained; if the first wireless earphone is in the wearing state, the target prompt information is output, and the target prompt information is used for The user is prompted to reduce the distance between the first wireless headset and the electronic device.
本申请实施例提供的编码控制方法,第一无线耳机以及第二无线耳机进行音频采集的过程中,用于传输音频数据至电子设备的第一无线耳机,根据其与电子设备之间无线通信的通信质量参数,对第一无线耳机以及第二无线耳机对音频数据进行编码的码率进行控制,使编码码率与通信质量参数相适应,避免音频数据传输时的卡顿,而导致录制的音频出现卡顿或断续,提升了录音效果。另外,还根据通信质量参数的参数值与第一阈值进行比较,在参数值低于第一阈值,且相对电子设备的距离大于距离阈值时,增大发射功率,从而有效保证了第一无线耳机传输音频数据至电子设备时较为顺畅,进一步避免了录音时的卡顿或断续。According to the encoding control method provided by the embodiment of the present application, during the audio collection process of the first wireless earphone and the second wireless earphone, the first wireless earphone used to transmit audio data to the electronic device, according to the wireless communication between the first wireless earphone and the electronic device The communication quality parameter controls the bit rate at which the first wireless earphone and the second wireless earphone encode audio data, so that the encoding bit rate adapts to the communication quality parameter, and avoids the stuttering of the audio data transmission, resulting in the recorded audio There is a stutter or intermittent, which improves the recording effect. In addition, the parameter value of the communication quality parameter is compared with the first threshold, and when the parameter value is lower than the first threshold and the distance to the electronic device is greater than the distance threshold, the transmission power is increased, thereby effectively ensuring that the first wireless earphone It is relatively smooth when transmitting audio data to electronic equipment, further avoiding stuttering or intermittent recording.
请参阅图13,图13示出了本申请又再一个实施例提供的编码控制方法的流程示意图,该编码控制方法应用于上述第一无线耳机。下面将针对图13所示的流程进行详细的阐述,所述编码控制方法具体可以包括以下步骤:Please refer to FIG. 13 . FIG. 13 shows a schematic flowchart of an encoding control method provided by still another embodiment of the present application, and the encoding control method is applied to the above-mentioned first wireless earphone. The flow shown in Figure 13 will be described in detail below, and the encoding control method may specifically include the following steps:
步骤S610:在所述第一无线耳机以及所述第二无线耳机进行音频采集的过程中,所述第一无线耳机将采集且经过编码后的第一音频数据包存储于第一缓冲区,将接收到的所述第二无线耳机采集且经过编码后的第二音频数据包存储于第二缓冲区。Step S610: During the audio collection process of the first wireless earphone and the second wireless earphone, the first wireless earphone stores the collected and encoded first audio data packet in the first buffer, and stores the The received second audio data packet collected by the second wireless earphone and encoded is stored in the second buffer.
在本申请实施例中,第一无线耳机以及第二无线耳机进行录音的过程中,第一无线耳机以及第二无线耳机中均设置有缓冲区,其中,第一无线耳机中的缓冲区为第一缓冲区和第二缓冲区,第二无线耳机中的缓冲区为第三缓冲区。第二无线耳机在录音时,对采集的音频数据进行编码后得到的第二音频数据包,可以将第二音频数据包放入第三缓冲区;第一无线耳机对采集的音频数据进行编码后得到的第一音频数据包,可以将第一音频数据包放入第一缓冲区。第二无线耳机将第三缓冲区中的第二音频数据包发送至第一无线耳机后,第一无线耳机将第二音频数据包存储于第二缓冲区中,后续进行上行数据的发送流程。In the embodiment of the present application, during the recording process of the first wireless earphone and the second wireless earphone, buffers are set in both the first wireless earphone and the second wireless earphone, wherein the buffer area in the first wireless earphone is the first The first buffer and the second buffer, the buffer in the second wireless earphone is the third buffer. When the second wireless earphone is recording, the second audio data packet obtained after encoding the collected audio data can put the second audio data packet into the third buffer; after the first wireless earphone encodes the collected audio data For the obtained first audio data packet, the first audio data packet may be put into the first buffer. After the second wireless earphone sends the second audio data packet in the third buffer to the first wireless earphone, the first wireless earphone stores the second audio data packet in the second buffer, and subsequently performs the process of sending uplink data.
步骤S620:将所述第一音频数据包以及所述第二音频数据包合并后发送至所述电子设备。Step S620: Combine the first audio data packet and the second audio data packet and send them to the electronic device.
在本申请实施例中,在进行上行数据的发送时,第一无线耳机可以将第一缓冲区中的第一音频数据包与第二缓冲区中的第二音频数据包取出,然后将第一音频数据包以及第二音频数据包合并为同一个音频数据包之后,发送至电子设备。In this embodiment of the application, when sending uplink data, the first wireless earphone can take out the first audio data packet in the first buffer and the second audio data packet in the second buffer, and then take out the first After the audio data packet and the second audio data packet are combined into one audio data packet, it is sent to the electronic device.
在一些实施方式中,双耳录音时,需要保证第一无线耳机以及第二无线耳机获取的音频数据包之间同步,也就是说,第一无线耳机需要合并的第一音频数据包与第二音频数据包对应的采集时间需要同步一致,以保证合并后的音频数据包的真实性。可选地,基于第一音频数据包的第一时间戳和第二音频数据包的第二时间戳,若第一时间戳与第二时间戳一致,则可以将第一音频数据和第二音频数据整合成一个音频数据包。In some implementations, during binaural recording, it is necessary to ensure synchronization between the audio data packets acquired by the first wireless earphone and the second wireless earphone, that is, the first audio data packet that the first wireless earphone needs to merge with the second The acquisition time corresponding to the audio data packets needs to be synchronized and consistent, so as to ensure the authenticity of the merged audio data packets. Optionally, based on the first timestamp of the first audio data packet and the second timestamp of the second audio data packet, if the first timestamp is consistent with the second timestamp, the first audio data and the second audio data can be The data is consolidated into one audio data packet.
在另一些实施方式中,第一无线耳机也可以在录音开始时,对首个音频数据包进行同步,后续的音频数据包则可以直接进行合并。其中,若第一音频数据包以及第二音频数据包为录音的过程中的第一个音频数据包,则可以根据第一音频数据包以及第二音频数据包中的同步信息,对第一音频数据包以及第二音频数据进行比对;若第一音频数据包与第二音频数据匹配,则将第一音频数据包以及第二音频数据包合并后发送至电子设备。对于后续获取的音频数据包,可以按照获取时的时间先后顺序,对第一无线耳机以及第二无线耳机所分别获取的音频数据包进行合并后,传输至电子设备;当然,第一无线耳机以及第二无线耳机也可以按照音频数据包生成的先后顺序,对采集且经过编码后的音频数据包进行编号,在各自生成的第一个音频 数据包比对成功后,则后续只需要将相同编号的音频数据包直接进行合并后,传输至电子设备。In some other implementation manners, the first wireless earphone may also synchronize the first audio data packet when the recording starts, and subsequent audio data packets may be directly merged. Wherein, if the first audio data packet and the second audio data packet are the first audio data packet in the recording process, then the first audio data packet can be recorded according to the synchronization information in the first audio data packet and the second audio data packet. The data packet and the second audio data are compared; if the first audio data packet matches the second audio data, the first audio data packet and the second audio data packet are combined and sent to the electronic device. For the audio data packets obtained subsequently, the audio data packets respectively obtained by the first wireless earphone and the second wireless earphone can be combined and transmitted to the electronic device according to the chronological order of acquisition; of course, the first wireless earphone and the The second wireless headset can also number the collected and encoded audio data packets according to the order in which the audio data packets are generated. The audio data packets are directly combined and transmitted to the electronic device.
电子设备接收到第一无线耳机传输的音频数据包之后,则可以基于音频数据包生成音频文件,具体地,可以是对音频数据包执行编码或者优化处理等操作之后生成指定音频格式的音频文件,该指定音频格式可以是MP3、WAV、FLC等,具体的音频格式可以不做限定。After the electronic device receives the audio data packet transmitted by the first wireless earphone, it can generate an audio file based on the audio data packet. Specifically, it can generate an audio file in a specified audio format after performing operations such as encoding or optimization processing on the audio data packet. The specified audio format may be MP3, WAV, FLC, etc., and the specific audio format may not be limited.
在一些实施方式中,第一无线耳机将第一无线耳机以及第二无线耳机各自采集且经过编码后的音频数据传输至电子设备时,还可以在音频数据中添加码率信息,以便电子设备在接收到音频数据后,可以根据码率信息,获知音频数据的码率,从而在对音频数据进行进一步的处理而生成音频文件时,能够根据码率调整处理时的采样率、位数信息和压缩数据的强度等。In some implementations, when the first wireless earphone transmits the encoded audio data collected by the first wireless earphone and the second wireless earphone to the electronic device, it can also add code rate information to the audio data, so that the electronic device can After receiving the audio data, the code rate of the audio data can be known according to the code rate information, so that when the audio data is further processed to generate an audio file, the sampling rate, bit information and compression during processing can be adjusted according to the code rate strength of the data, etc.
步骤S630:获取所述第一无线耳机与所述电子设备之间无线通信的通信质量参数。Step S630: Obtain a communication quality parameter of the wireless communication between the first wireless earphone and the electronic device.
步骤S640:获取与所述通信质量参数对应的目标码率,并控制所述第一无线耳机以及所述第二无线耳机以所述目标码率,对采集的音频数据进行编码。Step S640: Obtain a target bit rate corresponding to the communication quality parameter, and control the first wireless earphone and the second wireless earphone to encode the collected audio data at the target bit rate.
在本申请实施例中,步骤S630以及步骤S640可以参阅前述实施例的内容,在此不再赘述。In the embodiment of the present application, reference may be made to the contents of the foregoing embodiments for step S630 and step S640, and details are not repeated here.
在一些实施方式中,第一无线耳机在获取到以上通信质量参数后,还可以将通信质量参数对应的参数值与第二阈值进行比较;根据比较结果,确定该参数值是否低于第二阈值;若低于第二阈值,表示第一无线耳机与电子设备之间的通信质量不佳,该情况下,可能会出现采集的音频数据在传输至电子设备的过程中丢失的情况,因此,可以增大第一缓冲区以及第二缓冲区的缓冲数据量,避免出现传输效率较低的情况下,音频数据出现丢失,可以有效保留采集的音频内容。In some implementations, after the first wireless earphone acquires the above communication quality parameters, it can also compare the parameter value corresponding to the communication quality parameter with the second threshold; determine whether the parameter value is lower than the second threshold according to the comparison result ; If it is lower than the second threshold, it means that the communication quality between the first wireless earphone and the electronic device is not good. In this case, the collected audio data may be lost during transmission to the electronic device. Therefore, it can Increase the amount of buffered data in the first buffer and the second buffer to avoid loss of audio data in the case of low transmission efficiency, and effectively retain the collected audio content.
需要说明的是,前述的实施例中提供的码率控制方法也可以应用于第二无线耳机,第二无线耳机作为主耳机与电子设备以及第一无线耳机连接时,则可以执行前述的实施例中提供的码率控制方法。It should be noted that the code rate control method provided in the foregoing embodiments can also be applied to the second wireless earphone, and when the second wireless earphone is connected to the electronic device and the first wireless earphone as the master earphone, the foregoing embodiments can be implemented The rate control method provided in .
本申请实施例提供的编码控制方法,第一无线耳机以及第二无线耳机进行音频采集的过程中,用于传输音频数据至电子设备的第一无线耳机,根据其与电子设备之间无线通信的通信质量参数,对第一无线耳机以及第二无线耳机对音频数据进行编码的码率进行控制,使编码码率与通信质量参数相适应,避免音频数据传输时的卡顿,而导致录制的音频出现卡顿或断续,提升了录音效果。另外,第一无线耳机在传输第一无线耳机以及第二无线耳机各自获取的音频数据至电子设备时,将音频数据进行合并后再进行传输,而且对第一无线耳机以及第二无线耳机各自采集且编码后的音频数据进行同步,而无需电子设备接收到音频数据后,再对第一无线耳机以及第二无线耳机各自对应的音频数据进行同步比对,可以减少电子设备侧的复杂设计。According to the encoding control method provided by the embodiment of the present application, during the audio collection process of the first wireless earphone and the second wireless earphone, the first wireless earphone used to transmit audio data to the electronic device, according to the wireless communication between the first wireless earphone and the electronic device The communication quality parameter controls the bit rate at which the first wireless earphone and the second wireless earphone encode audio data, so that the encoding bit rate adapts to the communication quality parameter, and avoids the stuttering of the audio data transmission, resulting in the recorded audio There is a stutter or intermittent, which improves the recording effect. In addition, when the first wireless earphone transmits the audio data acquired by the first wireless earphone and the second wireless earphone to the electronic device, the audio data is combined before transmission, and the first wireless earphone and the second wireless earphone respectively collect Moreover, the encoded audio data is synchronized without synchronously comparing the corresponding audio data of the first wireless earphone and the second wireless earphone after the electronic device receives the audio data, which can reduce the complicated design of the electronic device side.
请参阅图14,其示出了本申请实施例提供的一种编码控制装置400的结构框图。该编码控制装置400应用于第一无线耳机,所述第一无线耳机与第二无线耳机以及电子设备连接,所述第一无线耳机和所述第二无线耳机均设置有音频采集装置。该编码控制装置400包括:数据传输模块410、质量获取模块420以及码率控制模块430。其中,所述数据传输模块410用于在所述第一无线耳机以及所述第二无线耳机进行音频采集的过程中,将所述第一无线耳机以及所述第二无线耳机各自采集且经过编码后的音频数据发送至所述电子设备;所述质量获取模块420用于获取所述第一无线耳机与所述电子设备之间无线通信的通信质量参数;所述码率控制模块430用于获取与所述通信质量参数对应的目标码率,并控制所述第一无线耳机以及所述第二无线耳机以所述目标码率,对采集的音频数据进行编码。Please refer to FIG. 14 , which shows a structural block diagram of an encoding control device 400 provided by an embodiment of the present application. The encoding control device 400 is applied to a first wireless earphone, the first wireless earphone is connected to a second wireless earphone and an electronic device, and both the first wireless earphone and the second wireless earphone are provided with an audio collection device. The encoding control device 400 includes: a data transmission module 410 , a quality acquisition module 420 and a code rate control module 430 . Wherein, the data transmission module 410 is configured to collect and encode the first wireless earphone and the second wireless earphone respectively during the audio collection process of the first wireless earphone and the second wireless earphone. The final audio data is sent to the electronic device; the quality acquisition module 420 is used to obtain the communication quality parameter of the wireless communication between the first wireless earphone and the electronic device; the code rate control module 430 is used to obtain A target bit rate corresponding to the communication quality parameter, and controlling the first wireless earphone and the second wireless earphone to encode the collected audio data at the target bit rate.
在一些实施方式中,数据传输模块410可以包括:数据缓存模块以及数据发送模块。数据缓存模块用于所述第一无线耳机将采集且经过编码后的第一音频数据包存储于第一缓冲区,将接收到的所述第二无线耳机采集且经过编码后的第二音频数据包存储于第二缓冲区;数据发送模块用于将所述第一音频数据包以及所述第二音频数据包合并后发送至所述电子设备。In some implementations, the data transmission module 410 may include: a data caching module and a data sending module. The data buffer module is used for the first wireless earphone to store the collected and encoded first audio data packet in the first buffer, and to store the received second wireless earphone collected and encoded second audio data The packets are stored in the second buffer; the data sending module is used to combine the first audio data packet and the second audio data packet and send them to the electronic device.
作为一种可能的实施方式,数据传输模块410还可以用于若所述第一音频数据包以及所述第二音频数据包为所述录音的过程中的第一个音频数据包,根据所述第一音频数据包以及所述第二音频数据包中的同步信息,对所述第一音频数据包以及所述第二音频数据进行比对;若所述第一音频数据包与所述第二音频数据匹配,则将所述第一音频数据包以及所述第二音频数据包合并后发送至所述电子设备。As a possible implementation manner, the data transmission module 410 may also be configured to if the first audio data packet and the second audio data packet are the first audio data packet in the recording process, according to the The synchronization information in the first audio data packet and the second audio data packet is compared with the first audio data packet and the second audio data; if the first audio data packet and the second audio data packet If the audio data matches, the first audio data packet and the second audio data packet are combined and sent to the electronic device.
作为一种可能的实施方式,该编码控制装置400还可以包括:缓存调整模块。缓存调整模块用于在所述获取所述第一无线耳机与所述电子设备之间通信的通信质量参数之后,若所述通信质量参数对应的参数值低于第二阈值,增大所述第一缓冲区以及所述第二缓冲区的缓冲数据 量。As a possible implementation manner, the encoding control apparatus 400 may further include: a cache adjustment module. The buffer adjustment module is configured to increase the second threshold if the parameter value corresponding to the communication quality parameter is lower than a second threshold after the acquisition of the communication quality parameter between the first wireless earphone and the electronic device. The buffer data volume of the first buffer and the second buffer.
在一些实施方式中,所述多种质量参数包括以下质量参数中的一种或多种:接收信号强度、重传率以及丢包率。In some implementations, the multiple quality parameters include one or more of the following quality parameters: received signal strength, retransmission rate, and packet loss rate.
在一些实施方式中,所述通信质量参数包括多种质量参数。码率控制模块430包括码率确定单元以及控制执行单元。其中,码率确定单元用于根据所述多种质量参数,确定对应的编码码率作为目标码率;控制执行单元用于分别控制所述第一无线耳机以及所述第二无线耳机以所述目标码率,对采集的音频数据进行编码。In some implementations, the communication quality parameters include multiple quality parameters. The code rate control module 430 includes a code rate determination unit and a control execution unit. Wherein, the code rate determination unit is used to determine the corresponding coding code rate as the target code rate according to the various quality parameters; the control execution unit is used to respectively control the first wireless earphone and the second wireless earphone to use the The target bit rate is used to encode the collected audio data.
作为一种可能的实施方式,码率确定单元可以用于:获取所述多种质量参数中满足对应的预设参数条件的质量参数的数量,其中,每种质量参数对应一个预设参数条件;基于所述数量,确定对应的编码码率作为目标码率,其中,所述编码码率与所述数量呈正相关。As a possible implementation manner, the code rate determining unit may be configured to: acquire the number of quality parameters satisfying corresponding preset parameter conditions among the multiple quality parameters, where each quality parameter corresponds to a preset parameter condition; Based on the quantity, determine a corresponding coding rate as a target rate, where the coding rate is positively correlated with the quantity.
可选地,所述每种质量参数包括预设时长内的多个参数值。码率确定单元可以用于:基于所述每种质量参数对应的多个参数值,获取每种质量参数对应的目标参数值;将所述每种质量参数对应的目标参数值与对应的参数值条件进行匹配,其中,每种质量参数对应一个参数值条件;获取所述多种质量参数中目标质量参数的数量,其中,所述目标质量参数的目标参数值与对应的参数值条件匹配。Optionally, each quality parameter includes multiple parameter values within a preset time period. The code rate determination unit may be used to: obtain a target parameter value corresponding to each quality parameter based on multiple parameter values corresponding to each quality parameter; combine the target parameter value corresponding to each quality parameter with the corresponding parameter value Conditions are matched, wherein each quality parameter corresponds to a parameter value condition; the number of target quality parameters among the multiple quality parameters is acquired, wherein the target parameter value of the target quality parameter matches the corresponding parameter value condition.
作为一种可能的实施方式,码率确定单元可以用于:获取所述多种质量参数中每种质量参数对应的质量得分;获取所述每种质量参数对应的权重;基于所述每种质量参数对应的权重,以及所述每种质量参数对应的质量得分,获取所述通信质量参数对应的质量得分作为总得分;基于所述总得分,确定对应的编码码率作为目标码率,其中,所述编码码率与所述总得分呈正相关。As a possible implementation manner, the code rate determination unit may be configured to: acquire the quality score corresponding to each quality parameter among the various quality parameters; acquire the weight corresponding to each quality parameter; The weight corresponding to the parameter, and the quality score corresponding to each quality parameter, acquiring the quality score corresponding to the communication quality parameter as the total score; based on the total score, determining the corresponding encoding code rate as the target code rate, wherein, The coding rate is positively correlated with the total score.
在一些实施方式中,该编码控制装置400还可以包括:距离获取模块以及功率增大模块。距离获取模块用于若所述通信质量参数对应的参数值低于第一阈值,检测所述第一无线耳机相对所述电子设备的距离;功率增大模块用于若所述距离小于距离阈值,增大所述第一无线耳机的所述无线通信的发射功率。In some implementation manners, the encoding control device 400 may further include: a distance acquiring module and a power increasing module. The distance acquisition module is used to detect the distance of the first wireless earphone relative to the electronic device if the parameter value corresponding to the communication quality parameter is lower than the first threshold; the power increase module is used to detect if the distance is less than the distance threshold, Increase the transmission power of the wireless communication of the first wireless earphone.
作为一种可能的实施方式,功率增大模块可以用于:若所述距离小于距离阈值,获取所述第一无线耳机的剩余电量;若所述剩余电量大于电量阈值,增大所述第一无线耳机的所述无线通信的发射功率。As a possible implementation manner, the power increasing module may be used to: if the distance is less than a distance threshold, obtain the remaining power of the first wireless earphone; if the remaining power is greater than the power threshold, increase the first The transmission power of the wireless communication of the wireless earphone.
可选地,该编码控制装置400还可以包括:佩戴检测模块以及提示模块。佩戴检测模块用于若所述剩余电量小于或等于电量阈值,获取所述第一无线耳机的佩戴状态;提示模块用于若所述第一无线耳机处于佩戴状态,输出目标提示信息,所述目标提示信息用于提示用户减小所述第一无线耳机与所述电子设备之间的距离。Optionally, the coding control device 400 may further include: a wearing detection module and a prompt module. The wearing detection module is used to obtain the wearing state of the first wireless earphone if the remaining power is less than or equal to the power threshold; the prompting module is used to output target prompt information if the first wireless earphone is in the wearing state, and the target The prompt information is used to prompt the user to reduce the distance between the first wireless earphone and the electronic device.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述装置和模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the devices and modules described above can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.
在本申请所提供的几个实施例中,模块相互之间的耦合可以是电性,机械或其它形式的耦合。In several embodiments provided in the present application, the coupling between the modules may be electrical, mechanical or other forms of coupling.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application may be integrated into one processing module, each module may exist separately physically, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules.
综上所述,本申请提供的方案,通过在第一无线耳机以及第二无线耳机进行音频采集的过程中,与电子设备连接的第一无线耳机将第一无线耳机以及第二无线耳机各自采集且经过编码后的音频数据发送至电子设备,获取第一无线耳机与电子设备之间无线通信的通信质量参数,然后获取与该通信质量参数对应的目标码率,并控制第一无线耳机以及第二无线耳机以该目标码率,对采集的音频数据进行编码。从而,可以实现第一无线耳机以及第二无线耳机进行音频采集的过程中,用于传输音频数据至电子设备的第一无线耳机,根据其与电子设备之间无线通信的通信质量参数,对第一无线耳机以及第二无线耳机对音频数据进行编码的码率进行控制,避免音频数据传输时的卡顿,而导致录制的音频出现卡顿或断续,提升了录音效果。To sum up, in the solution provided by this application, during the audio collection process of the first wireless headset and the second wireless headset, the first wireless headset connected to the electronic device collects the first wireless headset and the second wireless headset respectively And the encoded audio data is sent to the electronic device, and the communication quality parameter of the wireless communication between the first wireless earphone and the electronic device is obtained, and then the target code rate corresponding to the communication quality parameter is obtained, and the first wireless earphone and the second wireless earphone are controlled. The second wireless earphone encodes the collected audio data at the target bit rate. Therefore, it can be realized that in the process of audio collection by the first wireless earphone and the second wireless earphone, the first wireless earphone used to transmit audio data to the electronic device, according to the communication quality parameters of the wireless communication between it and the electronic device, for the second wireless earphone The first wireless earphone and the second wireless earphone control the code rate of the audio data to avoid the stuttering during the transmission of the audio data, resulting in stuttering or discontinuity in the recorded audio, and improving the recording effect.
请参考图15,其示出了本申请实施例提供的一种无线耳机的结构框图。本申请中的无线耳机100可以包括一个或多个如下部件:处理器110、存储器120、音频采集装置130、通信装置140以及一个或多个应用程序,其中一个或多个应用程序可以被存储在存储器120中并被配置为由一个或多个处理器110执行,一个或多个程序配置用于执行如前述方法实施例所描 述的方法,存储器120、音频采集装置130和通信装置140均与处理器110连接。该音频采集装置130可以是麦克风,通信装置140可以是无线通信装置,例如,可以是蓝牙通信模块Please refer to FIG. 15 , which shows a structural block diagram of a wireless earphone provided by an embodiment of the present application. The wireless headset 100 in the present application may include one or more of the following components: a processor 110, a memory 120, an audio collection device 130, a communication device 140, and one or more application programs, wherein one or more application programs may be stored in In the memory 120 and configured to be executed by one or more processors 110, one or more programs are configured to execute the method described in the foregoing method embodiment, the memory 120, the audio collection device 130 and the communication device 140 are all related to the processing Device 110 is connected. The audio collection device 130 can be a microphone, and the communication device 140 can be a wireless communication device, for example, can be a bluetooth communication module
处理器110可以包括一个或者多个处理核。处理器110利用各种接口和线路连接整个无线耳机100内的各个部分,通过运行或执行存储在存储器120内的指令、程序、代码集或指令集,以及调用存储在存储器120内的数据,执行无线耳机100的各种功能和处理数据。可选地,处理器110可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器110可集成中央处理器(Central Processing Unit,CPU)、图形处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作***、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器110中,单独通过一块通信芯片进行实现。 Processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts in the entire wireless earphone 100, by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120 to execute Various functions and processing data of the wireless earphone 100. Optionally, the processor 110 may adopt at least one of Digital Signal Processing (Digital Signal Processing, DSP), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and Programmable Logic Array (Programmable Logic Array, PLA). implemented in the form of hardware. The processor 110 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU), a modem, and the like. Among them, the CPU mainly handles the operating system, user interface and application programs, etc.; the GPU is used to render and draw the displayed content; the modem is used to handle wireless communication. It can be understood that, the above-mentioned modem may not be integrated into the processor 110, but may be realized by a communication chip alone.
存储器120可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。存储器120可用于存储指令、程序、代码、代码集或指令集。存储器120可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作***的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等。存储数据区还可以存储无线耳机100在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。The memory 120 may include random access memory (Random Access Memory, RAM), and may also include read-only memory (Read-Only Memory). The memory 120 may be used to store instructions, programs, codes, sets of codes, or sets of instructions. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system and instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , instructions for implementing the following method embodiments, and the like. The storage data area can also store data created during use of the wireless headset 100 (such as phonebook, audio and video data, chat record data) and the like.
请参考图16,其示出了本申请实施例提供的一种计算机可读存储介质的结构框图。该计算机可读介质800中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。Please refer to FIG. 16 , which shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application. Program codes are stored in the computer-readable medium 800, and the program codes can be invoked by a processor to execute the methods described in the foregoing method embodiments.
计算机可读存储介质800可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读存储介质800包括非易失性计算机可读介质(non-transitory computer-readable storage medium)。计算机可读存储介质800具有执行上述方法中的任何方法步骤的程序代码810的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码810可以例如以适当形式进行压缩。The computer readable storage medium 800 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 800 includes a non-transitory computer-readable storage medium (non-transitory computer-readable storage medium). The computer-readable storage medium 800 has a storage space for program code 810 for executing any method steps in the above-mentioned methods. These program codes can be read from or written into one or more computer program products. Program code 810 may, for example, be compressed in a suitable form.
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent replacements are made to some of the technical features; and these modifications or replacements do not drive the essence of the corresponding technical solutions away from the spirit and scope of the technical solutions of the various embodiments of the present application.

Claims (20)

  1. 一种编码控制方法,其特征在于,应用于第一无线耳机,所述第一无线耳机与第二无线耳机以及电子设备连接,所述第一无线耳机和所述第二无线耳机均设置有音频采集装置,所述方法包括:An encoding control method, characterized in that it is applied to a first wireless earphone, the first wireless earphone is connected to a second wireless earphone and an electronic device, and both the first wireless earphone and the second wireless earphone are equipped with audio collection device, the method comprising:
    在所述第一无线耳机以及所述第二无线耳机进行音频采集的过程中,将所述第一无线耳机以及所述第二无线耳机各自采集且经过编码后的音频数据发送至所述电子设备;In the process of audio collection by the first wireless earphone and the second wireless earphone, the encoded audio data collected by the first wireless earphone and the second wireless earphone are sent to the electronic device ;
    获取所述第一无线耳机与所述电子设备之间无线通信的通信质量参数;acquiring a communication quality parameter of wireless communication between the first wireless earphone and the electronic device;
    获取与所述通信质量参数对应的目标码率,并控制所述第一无线耳机以及所述第二无线耳机以所述目标码率,对采集的音频数据进行编码。Acquire a target bit rate corresponding to the communication quality parameter, and control the first wireless earphone and the second wireless earphone to encode the collected audio data at the target bit rate.
  2. 根据权利要求1所述的方法,其特征在于,所述将所述第一无线耳机以及所述第二无线耳机各自采集且经过编码后的音频数据发送至所述电子设备,包括:The method according to claim 1, wherein the sending the encoded audio data collected by the first wireless earphone and the second wireless earphone to the electronic device includes:
    所述第一无线耳机将采集且经过编码后的第一音频数据包存储于第一缓冲区,将接收到的所述第二无线耳机采集且经过编码后的第二音频数据包存储于第二缓冲区;The first wireless earphone stores the collected and encoded first audio data packet in the first buffer, and stores the received second audio data packet collected and encoded by the second wireless earphone in the second buffer. buffer zone;
    将所述第一音频数据包以及所述第二音频数据包合并后发送至所述电子设备。The first audio data packet and the second audio data packet are combined and then sent to the electronic device.
  3. 根据权利要求2所述的方法,其特征在于,在所述将所述第一音频数据包以及所述第二音频数据包合并后发送至所述电子设备之前,所述方法还包括:The method according to claim 2, wherein, before the first audio data packet and the second audio data packet are combined and sent to the electronic device, the method further comprises:
    若所述第一音频数据包以及所述第二音频数据包为所述音频采集的过程中的第一个音频数据包,根据所述第一音频数据包以及所述第二音频数据包中的同步信息,对所述第一音频数据包以及所述第二音频数据进行比对;If the first audio data packet and the second audio data packet are the first audio data packet in the audio collection process, according to the first audio data packet and the second audio data packet synchronization information, comparing the first audio data packet with the second audio data;
    若所述第一音频数据包与所述第二音频数据匹配,则将所述第一音频数据包以及所述第二音频数据包合并后发送至所述电子设备。If the first audio data packet matches the second audio data, combine the first audio data packet and the second audio data packet and send them to the electronic device.
  4. 根据权利要求2所述的方法,其特征在于,在所述将所述第一音频数据包以及所述第二音频数据包合并后发送至所述电子设备之前,所述方法还包括:The method according to claim 2, wherein, before the first audio data packet and the second audio data packet are combined and sent to the electronic device, the method further comprises:
    比对所述第一音频数据包的第一时间戳以及所述第二音频数据包的第二时间戳;comparing the first timestamp of the first audio data packet with the second timestamp of the second audio data packet;
    若所述第一时间戳与所述第二时间戳一致,则将所述第一音频数据包以及所述第二音频数据包合并后发送至所述电子设备。If the first time stamp is consistent with the second time stamp, the first audio data packet and the second audio data packet are combined and sent to the electronic device.
  5. 根据权利要求2-4任一项所述的方法,其特征在于,在所述获取所述第一无线耳机与所述电子设备之间通信的通信质量参数之后,所述方法还包括:The method according to any one of claims 2-4, characterized in that, after acquiring the communication quality parameters communicated between the first wireless earphone and the electronic device, the method further comprises:
    若所述通信质量参数对应的参数值低于第二阈值,增大所述第一缓冲区以及所述第二缓冲区的缓冲数据量。If the parameter value corresponding to the communication quality parameter is lower than a second threshold, increase the amount of buffered data in the first buffer and the second buffer.
  6. 根据权利要求1-5任一项所述的方法,其特征在于,所述通信质量参数包括以下质量参数中的一种或多种:接收信号强度、重传率以及丢包率。The method according to any one of claims 1-5, wherein the communication quality parameters include one or more of the following quality parameters: received signal strength, retransmission rate, and packet loss rate.
  7. 根据权利要求1-6任一项所述的方法,其特征在于,所述通信质量参数包括多种质量参数,所述获取与所述通信质量参数对应的目标码率,并控制所述第一无线耳机以及所述第二无线耳机以所述目标码率,对采集的音频数据进行编码,包括:The method according to any one of claims 1-6, wherein the communication quality parameters include multiple quality parameters, and the acquiring the target code rate corresponding to the communication quality parameters and controlling the first The wireless earphone and the second wireless earphone encode the collected audio data at the target code rate, including:
    根据所述多种质量参数,确定对应的编码码率作为目标码率;According to the various quality parameters, determine the corresponding coding rate as the target rate;
    分别控制所述第一无线耳机以及所述第二无线耳机以所述目标码率,对采集的音频数据进行编码。respectively controlling the first wireless earphone and the second wireless earphone to encode the collected audio data at the target bit rate.
  8. 根据权利要求7所述的方法,其特征在于,所述根据所述多种质量参数,确定对应的编码码率作为目标码率,包括:The method according to claim 7, wherein said determining the corresponding coding rate as the target rate according to the various quality parameters comprises:
    获取所述多种质量参数中满足对应的预设参数条件的质量参数的数量,其中,每种质量参数对应一个预设参数条件;Obtain the number of quality parameters satisfying corresponding preset parameter conditions among the plurality of quality parameters, where each quality parameter corresponds to a preset parameter condition;
    基于所述数量,确定对应的编码码率作为目标码率,其中,所述编码码率与所述数量呈正相关。Based on the quantity, determine a corresponding coding rate as a target rate, where the coding rate is positively correlated with the quantity.
  9. 根据权利要求8所述的方法,其特征在于,所述每种质量参数包括预设时长内的多个参数值,所述获取所述多种质量参数中满足对应的预设参数条件的质量参数的数量,包括:The method according to claim 8, wherein each quality parameter includes a plurality of parameter values within a preset time period, and the acquiring quality parameters satisfying corresponding preset parameter conditions among the various quality parameters amount, including:
    基于所述每种质量参数对应的多个参数值,获取每种质量参数对应的目标参数值;Obtaining a target parameter value corresponding to each quality parameter based on multiple parameter values corresponding to each quality parameter;
    将所述每种质量参数对应的目标参数值与对应的参数值条件进行匹配,其中,每种质量参数对应一个参数值条件;Matching the target parameter value corresponding to each quality parameter with the corresponding parameter value condition, wherein each quality parameter corresponds to a parameter value condition;
    获取所述多种质量参数中目标质量参数的数量,其中,所述目标质量参数的目标参数值与对应的参数值条件匹配。A quantity of target quality parameters among the plurality of quality parameters is acquired, wherein a target parameter value of the target quality parameter is conditionally matched with a corresponding parameter value.
  10. 根据权利要求9所述的方法,其特征在于,所述每种质量参数包括预设时长内的多个参数值,所述获取所述多种质量参数中满足对应的预设参数条件的质量参数的数量,包括:The method according to claim 9, characterized in that, each quality parameter includes a plurality of parameter values within a preset time period, and the acquiring quality parameters satisfying corresponding preset parameter conditions among the various quality parameters amount, including:
    基于所述每种质量参数对应的多个参数值,获取每种质量参数对应的目标参数值,以及每种质量参数对应的变化趋势;Obtaining a target parameter value corresponding to each quality parameter and a change trend corresponding to each quality parameter based on the plurality of parameter values corresponding to each quality parameter;
    将所述每种质量参数对应的目标参数值与对应的参数值条件进行匹配,其中,每种质量参数对应一个参数值条件;Matching the target parameter value corresponding to each quality parameter with the corresponding parameter value condition, wherein each quality parameter corresponds to a parameter value condition;
    获取所述多种质量参数中目标质量参数的数量,其中,所述目标质量参数的目标参数值与对应的参数值条件匹配,且所述目标质量参数对应的变化趋势不为减小趋势。Acquire the number of target quality parameters among the multiple quality parameters, wherein the target parameter value of the target quality parameter matches the corresponding parameter value condition, and the change trend corresponding to the target quality parameter is not a decreasing trend.
  11. 根据权利要求9或10所述的方法,其特征在于,所述基于所述每种质量参数对应的多个参数值,获取每种质量参数对应的目标参数值,包括:The method according to claim 9 or 10, wherein said obtaining a target parameter value corresponding to each quality parameter based on the plurality of parameter values corresponding to each quality parameter comprises:
    获取所述每种质量参数对应的多个参数值的平均值,作为每种质量参数对应的目标参数值。The average value of the multiple parameter values corresponding to each quality parameter is obtained as the target parameter value corresponding to each quality parameter.
  12. 根据权利要求7所述的方法,其特征在于,所述根据所述多种质量参数,确定对应的编码码率作为目标码率,包括:The method according to claim 7, wherein said determining the corresponding coding rate as the target rate according to the various quality parameters comprises:
    获取所述多种质量参数中每种质量参数对应的质量得分;Obtaining a quality score corresponding to each quality parameter in the plurality of quality parameters;
    获取所述每种质量参数对应的权重;Obtaining the weight corresponding to each quality parameter;
    基于所述每种质量参数对应的权重,以及所述每种质量参数对应的质量得分,获取所述通信质量参数对应的质量得分作为总得分;Based on the weight corresponding to each quality parameter and the quality score corresponding to each quality parameter, acquiring the quality score corresponding to the communication quality parameter as a total score;
    基于所述总得分,确定对应的编码码率作为目标码率,其中,所述编码码率与所述总得分呈正相关。Based on the total score, determine a corresponding encoding bit rate as a target bit rate, where the encoding bit rate is positively correlated with the total score.
  13. 根据权利要求1-12任一项所述的方法,其特征在于,所述控制所述第一无线耳机以及所述第二无线耳机以所述目标码率,对采集的音频数据进行编码,包括:The method according to any one of claims 1-12, wherein the controlling the first wireless earphone and the second wireless earphone to encode the collected audio data at the target bit rate includes: :
    控制所述第一无线耳机以所述目标码率,对采集的音频数据进行编码;controlling the first wireless earphone to encode the collected audio data at the target bit rate;
    将所述目标码率发送至所述第二无线耳机,以指示所述第二无线耳机以所述目标码率对采集的音频数据进行编码。Sending the target bit rate to the second wireless earphone to instruct the second wireless earphone to encode the collected audio data at the target bit rate.
  14. 根据权利要求1-12任一项所述的方法,其特征在于,所述控制所述第一无线耳机以及所述第二无线耳机以所述目标码率,对采集的音频数据进行编码,包括:The method according to any one of claims 1-12, wherein the controlling the first wireless earphone and the second wireless earphone to encode the collected audio data at the target bit rate includes: :
    控制所述第一无线耳机以所述目标码率,对采集的音频数据进行编码;controlling the first wireless earphone to encode the collected audio data at the target bit rate;
    将所述通信质量参数发送至所述第二无线耳机,所述第二无线耳机用于根据所述通信质量参数确定对应的目标码率后,以确定的目标码率对采集的音频数据进行编码。sending the communication quality parameter to the second wireless earphone, and the second wireless earphone is used to encode the collected audio data at the determined target bit rate after determining a corresponding target bit rate according to the communication quality parameter .
  15. 根据权利要求1-14任一项所述的方法,其特征在于,在所述获取所述第一无线耳机与所述电子设备之间无线通信的通信质量参数之后,所述方法还包括:The method according to any one of claims 1-14, characterized in that, after acquiring the communication quality parameters of the wireless communication between the first wireless earphone and the electronic device, the method further comprises:
    若所述通信质量参数对应的参数值低于第一阈值,检测所述第一无线耳机相对所述电子设备的距离;If the parameter value corresponding to the communication quality parameter is lower than a first threshold, detecting the distance between the first wireless earphone and the electronic device;
    若所述距离小于距离阈值,增大所述第一无线耳机的所述无线通信的发射功率。If the distance is less than a distance threshold, increase the transmission power of the wireless communication of the first wireless earphone.
  16. 根据权利要求15所述的方法,其特征在于,所述若所述距离小于距离阈值,增大所述第一无线耳机的所述无线通信的发射功率,包括:The method according to claim 15, wherein if the distance is less than a distance threshold, increasing the transmission power of the wireless communication of the first wireless earphone comprises:
    若所述距离小于距离阈值,获取所述第一无线耳机的剩余电量;If the distance is less than a distance threshold, acquire the remaining power of the first wireless earphone;
    若所述剩余电量大于电量阈值,增大所述第一无线耳机的所述无线通信的发射功率。If the remaining power is greater than a power threshold, increase the transmission power of the wireless communication of the first wireless earphone.
  17. 根据权利要求16所述的方法,其特征在于,在所述获取所述第一无线耳机的剩余电量之后,所述方法还包括:The method according to claim 16, characterized in that, after acquiring the remaining power of the first wireless earphone, the method further comprises:
    若所述剩余电量小于或等于电量阈值,获取所述第一无线耳机的佩戴状态;If the remaining power is less than or equal to a power threshold, acquire the wearing state of the first wireless earphone;
    若所述第一无线耳机处于佩戴状态,输出目标提示信息,所述目标提示信息用于提示用户减小所述第一无线耳机与所述电子设备之间的距离。If the first wireless earphone is in the wearing state, output target prompt information, where the target prompt information is used to prompt the user to reduce the distance between the first wireless earphone and the electronic device.
  18. 一种编码控制装置,其特征在于,应用于第一无线耳机,所述第一无线耳机与第二无线耳机以及电子设备连接,所述第一无线耳机和所述第二无线耳机均设置有音频采集装置,所 述装置包括:数据传输模块、质量获取模块以及码率控制模块,其中,An encoding control device, characterized in that it is applied to a first wireless earphone, the first wireless earphone is connected to a second wireless earphone and electronic equipment, and both the first wireless earphone and the second wireless earphone are equipped with audio Acquisition device, the device includes: a data transmission module, a quality acquisition module and a code rate control module, wherein,
    所述数据传输模块用于在所述第一无线耳机以及所述第二无线耳机进行音频采集的过程中,将所述第一无线耳机以及所述第二无线耳机各自采集且经过编码后的音频数据发送至所述电子设备;The data transmission module is used to collect and encode the audio data collected by the first wireless earphone and the second wireless earphone during the audio collection process of the first wireless earphone and the second wireless earphone sending data to said electronic device;
    所述质量获取模块用于获取所述第一无线耳机与所述电子设备之间无线通信的通信质量参数;The quality acquisition module is configured to acquire communication quality parameters of wireless communication between the first wireless earphone and the electronic device;
    所述码率控制模块用于获取与所述通信质量参数对应的目标码率,并控制所述第一无线耳机以及所述第二无线耳机以所述目标码率,对采集的音频数据进行编码。The code rate control module is used to obtain a target code rate corresponding to the communication quality parameter, and control the first wireless earphone and the second wireless earphone to encode the collected audio data at the target code rate .
  19. 一种无线耳机,其特征在于,包括:A wireless earphone, characterized in that it comprises:
    音频采集装置;Audio collection device;
    一个或多个处理器;one or more processors;
    存储器;memory;
    一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行如权利要求1-17任一项所述的方法。one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs are configured to perform as The method according to any one of claims 1-17.
  20. 一种计算机可读取存储介质,其特征在于,所述计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行如权利要求1-17任一项所述的方法。A computer-readable storage medium, characterized in that program codes are stored in the computer-readable storage medium, and the program codes can be invoked by a processor to execute the method according to any one of claims 1-17 .
PCT/CN2022/094710 2021-06-30 2022-05-24 Coding control method and apparatus, wireless earphone, and storage medium WO2023273701A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110735822.4A CN113453114B (en) 2021-06-30 2021-06-30 Encoding control method, encoding control device, wireless headset and storage medium
CN202110735822.4 2021-06-30

Publications (1)

Publication Number Publication Date
WO2023273701A1 true WO2023273701A1 (en) 2023-01-05

Family

ID=77814598

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/094710 WO2023273701A1 (en) 2021-06-30 2022-05-24 Coding control method and apparatus, wireless earphone, and storage medium

Country Status (2)

Country Link
CN (1) CN113453114B (en)
WO (1) WO2023273701A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113453114B (en) * 2021-06-30 2023-04-07 Oppo广东移动通信有限公司 Encoding control method, encoding control device, wireless headset and storage medium
CN114339350B (en) * 2021-12-30 2023-12-05 Oppo广东移动通信有限公司 Data processing method and device and electronic equipment
CN115022537B (en) * 2022-05-24 2023-08-29 Oppo广东移动通信有限公司 Video shooting method, device, electronic equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102457700A (en) * 2010-10-26 2012-05-16 中兴通讯股份有限公司 Audio data transmission method and system
US20130108058A1 (en) * 2011-11-01 2013-05-02 Phonak Ag Binaural hearing device and method to operate the hearing device
CN107333339A (en) * 2017-05-16 2017-11-07 恒玄科技(上海)有限公司 Audio data transmission method and double wireless headsets between a kind of pair of wireless headset
CN109120933A (en) * 2018-10-11 2019-01-01 广州酷狗计算机科技有限公司 Dynamic adjusts method, apparatus, equipment and the storage medium of code rate
CN110913375A (en) * 2019-11-27 2020-03-24 南京中感微电子有限公司 Wireless communication system and equipment
WO2020124611A1 (en) * 2018-12-22 2020-06-25 华为技术有限公司 Rate control method and device
CN112291661A (en) * 2020-10-23 2021-01-29 安声(重庆)电子科技有限公司 Bluetooth earphone
CN113453114A (en) * 2021-06-30 2021-09-28 Oppo广东移动通信有限公司 Encoding control method, encoding control device, wireless headset and storage medium

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1284138C (en) * 2004-12-31 2006-11-08 清华大学 Self-adaptive frame selection line spectrum frequency parameter quantization method
CN101252425B (en) * 2008-04-09 2010-10-27 杭州华三通信技术有限公司 Loss package error correcting method and system of self-adapting network
GB2496203B (en) * 2011-11-07 2015-09-16 Broadcom Corp Transmission of channel quality indications
JP2013110635A (en) * 2011-11-22 2013-06-06 Kddi Corp Handover parameter adjusting device, handover parameter adjusting method and computer program
EP2717262A1 (en) * 2012-10-05 2014-04-09 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. Encoder, decoder and methods for signal-dependent zoom-transform in spatial audio object coding
CN104517613A (en) * 2013-09-30 2015-04-15 华为技术有限公司 Method and device for evaluating speech quality
EP2934037B1 (en) * 2014-04-15 2016-04-13 Telefonaktiebolaget LM Ericsson (publ) Technique for Evaluation of a Parameter Adjustment in a Mobile Communications Network
KR102340127B1 (en) * 2017-03-24 2021-12-16 삼성전자주식회사 Method and electronic apparatus for transmitting audio data to a plurality of external devices
CN110855522A (en) * 2019-11-13 2020-02-28 国网上海市电力公司 Electric energy meter communication quality detection method based on analytic hierarchy process
CN112583716A (en) * 2020-12-22 2021-03-30 广州技象科技有限公司 Path selection method and device based on data transmission of Internet of things

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102457700A (en) * 2010-10-26 2012-05-16 中兴通讯股份有限公司 Audio data transmission method and system
US20130108058A1 (en) * 2011-11-01 2013-05-02 Phonak Ag Binaural hearing device and method to operate the hearing device
CN107333339A (en) * 2017-05-16 2017-11-07 恒玄科技(上海)有限公司 Audio data transmission method and double wireless headsets between a kind of pair of wireless headset
CN109120933A (en) * 2018-10-11 2019-01-01 广州酷狗计算机科技有限公司 Dynamic adjusts method, apparatus, equipment and the storage medium of code rate
WO2020124611A1 (en) * 2018-12-22 2020-06-25 华为技术有限公司 Rate control method and device
CN110913375A (en) * 2019-11-27 2020-03-24 南京中感微电子有限公司 Wireless communication system and equipment
CN112291661A (en) * 2020-10-23 2021-01-29 安声(重庆)电子科技有限公司 Bluetooth earphone
CN113453114A (en) * 2021-06-30 2021-09-28 Oppo广东移动通信有限公司 Encoding control method, encoding control device, wireless headset and storage medium

Also Published As

Publication number Publication date
CN113453114B (en) 2023-04-07
CN113453114A (en) 2021-09-28

Similar Documents

Publication Publication Date Title
WO2023273701A1 (en) Coding control method and apparatus, wireless earphone, and storage medium
WO2023005412A1 (en) Recording method and apparatus, wireless earphones and storage medium
US9832578B2 (en) Enabling concurrent proprietary audio and Bluetooth low energy using enhanced LE link layer for hearing device
US10705793B1 (en) Low latency mode for wireless communication between devices
CN110493678B (en) Earphone control method and device, earphone and storage medium
US20220248333A1 (en) Method For Operating A Bluetooth Device
CN108882087A (en) A kind of intelligent sound detection method, wireless headset, TWS earphone and terminal
WO2021185077A1 (en) Audio processing method, apparatus and system
US11089411B2 (en) Systems and methods for coordinating rendering of a remote audio stream by binaural hearing devices
US11503405B2 (en) Capturing and synchronizing data from multiple sensors
WO2021160040A1 (en) Audio transmission method and electronic device
WO2023029829A1 (en) Audio processing method and apparatus, user terminal, and computer readable medium
WO2020132907A1 (en) Communication method for audio data, and electronic device
CN113573202A (en) Data transmission control method and system of Bluetooth headset
CN113422866A (en) Volume adjusting method and device, storage medium and electronic equipment
WO2023160249A1 (en) Call method and call apparatus
KR101597768B1 (en) Interactive multiparty communication system and method using stereophonic sound
CN114501239B (en) Master-slave switching method and device of earphone, bluetooth earphone and storage medium
CN115174538A (en) Data transmission method and device, electronic equipment and computer readable medium
US12010496B2 (en) Method and system for performing audio ducking for headsets
CN113115281A (en) Bluetooth audio device, Bluetooth audio system and operation method thereof
CN113196800A (en) Hybrid microphone for wireless headset
CN113038317A (en) Earphone control method and device, Bluetooth earphone and storage medium
CN114640740B (en) Communication processing method, device, electronic equipment and storage medium
CN115022766B (en) Audio data playing method and equipment

Legal Events

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

Ref document number: 22831524

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22831524

Country of ref document: EP

Kind code of ref document: A1