CN114629987A - Method and related device for realizing ear return of Bluetooth headset - Google Patents

Method and related device for realizing ear return of Bluetooth headset Download PDF

Info

Publication number
CN114629987A
CN114629987A CN202011442700.8A CN202011442700A CN114629987A CN 114629987 A CN114629987 A CN 114629987A CN 202011442700 A CN202011442700 A CN 202011442700A CN 114629987 A CN114629987 A CN 114629987A
Authority
CN
China
Prior art keywords
size value
bluetooth headset
preset condition
cache region
data packet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011442700.8A
Other languages
Chinese (zh)
Inventor
饶邦国
余艳辉
李韦露
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202011442700.8A priority Critical patent/CN114629987A/en
Publication of CN114629987A publication Critical patent/CN114629987A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/10527Audio or video recording; Data buffering arrangements
    • 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/1091Details not provided for in groups H04R1/1008 - H04R1/1083
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R3/00Circuits for transducers, loudspeakers or microphones
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/10527Audio or video recording; Data buffering arrangements
    • G11B2020/10537Audio or video recording
    • G11B2020/10546Audio or video recording specifically adapted for audio data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R2201/00Details of transducers, loudspeakers or microphones covered by H04R1/00 but not provided for in any of its subgroups
    • H04R2201/10Details of earpieces, attachments therefor, earphones or monophonic headphones covered by H04R1/10 but not provided for in any of its subgroups

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the application provides a method and a related device for realizing the ear return of a Bluetooth headset. In the embodiment of the application, the terminal equipment can increase the size value of the cache area when the state of the terminal equipment is not good so as to reduce the load of the terminal equipment, and reduce the size value of the cache area when the state of the terminal equipment is good so as to reduce the time delay of the playback of the earlap, dynamically adjust the size value of the cache area and realize the low-delay earlap.

Description

Method and related device for realizing ear return of Bluetooth headset
Technical Field
The embodiment of the application relates to the technical field of terminal equipment, in particular to a method and a related device for realizing ear return of a Bluetooth headset.
Background
With the development of modern technology, wireless bluetooth headsets have become a part of people's daily life. Many people listen to songs and K songs through Bluetooth earphones, or live video and audio. In the above application scenarios, people usually want to be able to hear the speaking voice. Therefore, people prefer to purchase the Bluetooth headset with the ear return function.
The Bluetooth headset with the ear return function in the market at present is expensive. Research and development personnel need to design a scheme for enabling a bluetooth headset without an ear return function to realize ear return. Such schemes typically send microphone recorded audio data through the handset device to the bluetooth headset for playback.
However, in such schemes, the audio played back by the bluetooth headset in the ear is often jammed, or the delay is high, mainly because the size of the buffer area for forwarding the audio data in the mobile phone device is fixed, which cannot adapt to the change of the usage environment of the mobile phone device.
Disclosure of Invention
The embodiment of the application provides a method and a related device for realizing the ear return of a Bluetooth headset, which can adapt to the environment change of mobile phone equipment when the ear returns to play the record by dynamically adjusting the size of a cache area for forwarding the record data, thereby realizing the low-delay ear return.
In a first aspect, an embodiment of the present application provides a method for implementing bluetooth headset earreturn, including: acquiring recording data; storing the recording data to a cache region; converting the recording data into a data packet conforming to a Bluetooth protocol according to the size value of the cache region, wherein the size value of the data packet is positively correlated with the size value of the cache region; sending the converted data packet to a Bluetooth headset so that the Bluetooth headset plays audio corresponding to the data packet; wherein the size of the cache region is dynamically adjusted by: obtaining the current size value of the cache region; if the preset condition is not met, increasing the size value of the cache area; and if the preset condition is met, reducing the size value of the cache area.
In the embodiment of the application, the terminal equipment can increase the size value of the cache area when the state of the terminal equipment is not good so as to reduce the load of the terminal equipment, and reduce the size value of the cache area when the state of the terminal equipment is good so as to reduce the time delay of the playback of the earlap, dynamically adjust the size value of the cache area and realize the low-delay earlap.
With reference to the first aspect, in an implementation manner of the embodiment of the present application, the not meeting the preset condition includes: a UNDERRUN error is detected.
With reference to the first aspect, in an implementation manner of the embodiment of the present application, the not meeting the preset condition further includes: processor load greater than a first threshold is detected.
With reference to the first aspect, in an implementation manner of the embodiment of the present application, the not meeting the preset condition further includes: and detecting that the process power consumption exceeds a second threshold value and the current scene does not belong to a preset scene.
With reference to the first aspect, in an implementation manner of the embodiment of the present application, the meeting a preset condition includes: no UNDERUN error is detected, processor load is not detected to be greater than a first threshold, and process power consumption does not exceed a second threshold.
With reference to the first aspect, in an implementation manner of the embodiment of the present application, the meeting a preset condition includes:
the method comprises the steps of detecting no UNDERRUN error, detecting that the processor load is not larger than a first threshold value, and detecting that the process power consumption exceeds a second threshold value but the current scene belongs to a preset scene.
With reference to the first aspect, in an implementation manner of the embodiment of the present application, the method further includes:
and after the size value of the cache region is increased or decreased, whether the preset condition is met or not is judged again until the minimum value of the cache region meeting the preset condition is determined.
With reference to the first aspect, in an implementation manner of the embodiment of the present application, after determining the minimum value of the cache area that meets the preset condition, the method further includes:
and judging whether the preset conditions are met or not again every preset time period, and dynamically adjusting the size value of the cache region.
With reference to the first aspect, in an implementation manner of the embodiment of the present application, after the obtaining of the sound recording data, before the storing of the sound recording data in the cache region, the method further includes:
and processing the recording data through a recording algorithm.
In a second aspect, an embodiment of the present application provides an apparatus for implementing bluetooth headset earreturn, including:
the recording module is used for acquiring recording data;
the processing module is used for storing the recording data to a cache region;
the processing module is further configured to convert the recording data into a data packet conforming to a bluetooth protocol according to the size value of the cache region, where the size value of the data packet is positively correlated with the size value of the cache region;
the sending module is used for sending the converted data packet to a Bluetooth headset so that the Bluetooth headset can play audio corresponding to the data packet;
the processing module is further configured to dynamically adjust the size value of the cache region by:
obtaining the current size value of the cache region;
if the preset condition is not met, increasing the size value of the cache area;
and if the preset condition is met, reducing the size value of the cache area.
In a third aspect, an embodiment of the present application provides a terminal device, including a processor, a memory, a recorder, and a bluetooth chip;
the recorder is used for acquiring recording data and transmitting the recording data to the memory;
the memory is used for storing one or more programs;
the processor is configured to execute the one or more programs to implement the method of any of claims 1 to 9;
and the Bluetooth chip is used for sending the converted data packet to the Bluetooth headset.
According to the technical scheme, the embodiment of the application has the following advantages:
the embodiment of the application provides a method and a related device for realizing the ear return of a Bluetooth headset. In the embodiment of the application, the terminal equipment can increase the size value of the cache area when the state of the terminal equipment is not good so as to reduce the load of the terminal equipment, and reduce the size value of the cache area when the state of the terminal equipment is good so as to reduce the time delay of the playback of the earlap, dynamically adjust the size value of the cache area and realize the low-delay earlap.
Drawings
FIG. 1 is a schematic diagram of an ear return scheme for a prior art Bluetooth headset;
fig. 2 is a schematic diagram of an architecture for implementing bluetooth headset earreturn according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram illustrating a method for implementing bluetooth headset earreturn according to an embodiment of the present application;
fig. 4a is a schematic diagram of a buffer size according to an embodiment of the present disclosure;
fig. 4b is a second schematic diagram illustrating a size of a buffer according to an embodiment of the present application;
fig. 5 is a schematic diagram illustrating a method for dynamically adjusting a size value of a cache according to an embodiment of the present disclosure;
FIG. 6 is an illustration of a dynamically adjusting application provided herein;
fig. 7 is a first schematic diagram illustrating a terminal device sending a data packet to a bluetooth headset in an embodiment of the present application;
fig. 8 is a second schematic diagram illustrating that the terminal device sends a data packet to the bluetooth headset in the embodiment of the present application;
fig. 9 is a schematic diagram of an apparatus for implementing bluetooth headset earreturn according to an embodiment of the present disclosure;
fig. 10 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
The embodiment of the application provides a method and a related device for realizing the ear return of a Bluetooth headset, which can adapt to the environment change of mobile phone equipment when the ear returns to play the record by dynamically adjusting the size of a cache area for forwarding the record data, thereby realizing the low-delay ear return.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be implemented in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "corresponding" and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In the embodiments of the present application, words such as "exemplary" or "for example" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
For clarity and conciseness of the following descriptions of the various embodiments, a brief introduction to the related art is first given:
the audio earreturn technology refers to a technology of recording and playing back the voice of the user speaking himself (generally playing the voice to the earphone of the user). The ear return is used for clearly listening to the accompaniment and the sound of the user during a noisy evening or an active performance. The audio earreturn technology is mainly applied to scenes such as karaoke, live broadcasting and the like at present, and provides a feeling that a user can quickly hear a speaking. The above-mentioned return-to-ear scene is realized by that the data received by hardware is directly transmitted to audio output equipment by means of hardware return of earphone. The scene generally has accompaniment sounds, so that only the clean human voice received by the mic needs to be transmitted to the audio output device.
Fig. 1 is a schematic diagram of an ear return scheme of a bluetooth headset in the prior art. The bluetooth chip 1011 in the terminal device 101 is configured to send an audio data packet to the bluetooth headset 102, so that the bluetooth headset 102 plays music corresponding to the audio data packet. Illustratively, when the user selects to listen to a song and sing the song, the bluetooth chip 1011 sends an audio data packet corresponding to the song selected by the user to the bluetooth headset 102, so that the bluetooth headset 102 plays the song selected by the user. Specifically, the bluetooth headset 102 receives the audio data packet through the receiving chip 1021, converts the audio data packet into a digital signal, amplifies and filters the digital signal through a Digital Signal Processing (DSP) circuit 1022, and finally plays the digital signal through a speaker 1024. In the ear return aspect, the bluetooth headset 102 records the user's voice as an audio signal through the microphone 1023, and then the audio signal can be processed by the DSP circuit 1022 and played through the speaker 1024.
However, in the above technical solution corresponding to fig. 1, the bluetooth headset supporting the ear return function is needed to be implemented first, and such a bluetooth headset supporting the ear return function is expensive. Moreover, when recording is required or the sound of the user is pushed to other devices through the terminal device to be played (for example, live scenes), the sound played by the ear return is directly played through the bluetooth headset, and the sound played by the recording is processed by the terminal device, so that the sound played by the recording is inconsistent with the sound effect heard by the ear return of the headset, the user cannot correctly judge the sound effect of the user through the ear return, and the ear return effect required by the user cannot be achieved. Finally, the situation of blocking frequently occurs or the time delay is high when the audio is played by the scheme, mainly because the size of a buffer area for forwarding the audio data in the mobile phone device is fixed, the change of the use environment of the mobile phone device cannot be adapted.
In view of this, embodiments of the present application provide a method and a related apparatus for implementing an ear return of a bluetooth headset, so that the size of a buffer area for forwarding recorded data is dynamically adjusted, so that the ear return can adapt to environmental changes of a mobile phone device when the recording is played, and low-delay ear return is implemented.
Fig. 2 is a schematic diagram of an architecture for implementing bluetooth headset earreturn according to an embodiment of the present disclosure.
The terminal 201, also called User Equipment (UE), a Mobile Station (MS), a Mobile Terminal (MT), etc., is a device that provides voice and/or data connectivity to a user, or a device with a built-in chip, such as a handheld device with a wireless connection function, a vehicle-mounted device, etc. Currently, some examples of terminal devices are: a mobile phone (mobile phone), a tablet computer, a notebook computer, a palm computer, a Mobile Internet Device (MID), a wearable device, a Virtual Reality (VR) device, an Augmented Reality (AR) device, a recording and playing device in a singing place, a live streaming device, and the like.
The Application layer 2011 in the internal architecture hierarchy of the terminal device 201 includes various Application programs (applications) in the terminal device 201, and these Application programs can obtain user operations, display operation interfaces, and the like, so as to implement interaction with a user.
An application framework layer (FWK) 2012 in the internal architecture layer of the terminal device 201 is an Application Programming Interface (API) framework used by the core application. An API is a predefined function or convention that refers to the joining of different components of a software system. To provide a set of routines that applications and developers can access based on certain software or hardware without accessing source code or understanding the details of the internal workings. A buffer area (buffer)20121 may be disposed in the FWK layer for temporarily storing and forwarding data.
An AUDIO Hardware Abstraction Layer (AUDIO Hardware Abstraction Layer, AUDIO HAL)2013 in the internal architecture Layer of the terminal device 201 is an interface Layer between the operating system kernel and the Hardware circuit, and is intended to abstract the Hardware. It hides the hardware interface details of specific platform, provides virtual hardware platform for operation system, makes it have hardware independence, and can be transplanted on several platforms. In the embodiment of the present application, the AUDIO HAL layer 2013 is mainly used for interfacing between the kernel of the operating system and the AUDIO hardware circuit. The AUDIO HAL layer 2013 may be embedded with an AUDIO recording algorithm 20131 for processing AUDIO recording data, which is specifically referred to in the following embodiments and is not described herein.
A High-Fidelity Digital Signal Process (HIFI DSP) circuit 2014 in the internal architectural hierarchy of the terminal device 201 is used to Process (e.g., amplify, filter) the Digital signals from the codec 2015 and then send the processed signals to the AUDIO HAL layer 2013.
A codec (codec)2015 in the internal architecture layer of the terminal apparatus 201 is used to perform encoding processing on the sound recording signal from the sound recorder 2016 and output a digital signal to the HIFI DSP circuit 2014.
The sound recorder 2016 in the internal architecture hierarchy of the terminal device 201 may be a device, chip, or device capable of sound recording. For example, a microphone built in a mobile phone terminal, a microphone externally connected to a mobile phone, and the like, which are not limited in this embodiment of the present application.
The Bluetooth Hardware Abstraction Layer (BT HAL)2017 in the internal architecture Layer of the terminal device 201 is similar to the aforementioned AUDIO HAL Layer 2013 in principle, and is specifically an interface Layer located between the operating system kernel and the Bluetooth Hardware circuit. The BT HAL layer 2017 is configured to send the audio record data from the FWK layer 2012 to the bluetooth headset 202 via the bluetooth chip. It is understood that the bluetooth chip herein may also be referred to as a bluetooth module, and may convert the recorded data into data packets conforming to the bluetooth protocol and send the data packets to the bluetooth headset 202. In practical application, the bluetooth chip may be packaged in the same chip with the wifi module and the gps module, which is not limited in the embodiment of the present application.
The bluetooth chip 2021 in the bluetooth headset 202 is configured to receive a data packet corresponding to the recording data and convert the data packet into a corresponding digital signal.
The DSP circuit 2022 in the bluetooth headset 202 is used for processing the digital signal from the bluetooth chip 2021 and playing the processed digital signal through the speaker 2023. The speaker 2023 may be any device capable of playing audio signals, and this is not limited in this embodiment of the application.
It is understood that the architecture corresponding to fig. 2 in the embodiment of the present application is an example based on some bluetooth protocol versions, and in practical applications, a specific system architecture may be modified or replaced accordingly due to the difference of the bluetooth protocol versions. Such modifications or substitutions do not depart from the spirit and scope of the present disclosure as defined by the appended claims.
Based on the architecture shown in fig. 2, a method for implementing bluetooth headset earreturn according to the embodiment of the present application is shown in fig. 3 and can be executed by the terminal device 201 of the architecture shown in fig. 2. Fig. 3 is a schematic diagram of a method for implementing bluetooth headset earreturn according to an embodiment of the present application, where the method includes the following steps:
301. acquiring recording data;
in this embodiment, the terminal device 201 may obtain the sound of the user through the sound recorder 2016, generate a corresponding signal, and encode the signal through the codec 2015 to form a digital signal, that is, obtain the sound recording data. In practical application, the sound acquired by the sound recorder 2016 may also be converted into recorded data in other manners, which is not limited in this embodiment of the application.
It is understood that after step 301, before step 302, the terminal device 201 may perform some processing on the recording data. For example, the terminal device 201 may filter the recording data through the HIFI DSP 2014, so as to obtain clearer recording data. The terminal device 201 may further perform optimization processing on the recording data according to the recording algorithm 20131 through the AUDIO HAL layer 2013. It is understood that the recording algorithm 20131 may include, but is not limited to, 3A algorithm (AEC, Acoustic Echo cancellation), Automatic Gain Control (AGC), Active Noise Control (ANC, also called Noise cancellation, Noise suppression, Active Noise reduction), human voice enhancement algorithm, etc., which is not limited by the embodiments of the present application.
302. Storing the recording data to a cache region;
in this embodiment, the terminal device 201 may store the obtained sound recording data in the buffer20121 in the FWK layer 2012. The buffer20121 is described in detail below.
In this embodiment of the application, the buffer20121 is a buffer area in the FWK layer 2012 for caching data, and the capacity of the buffer area is fixed, but the size buffer _ size of the buffer area for caching data at a time may be set according to actual needs. Specifically, the terminal device 201 writes the audio record data to the HAL sublayer (for example, the BT HAL layer 2017) frame by frame through the FWK layer 2012, so that the terminal device 201 buffers a certain number of frames through the buffer20121 in the FWK layer 2012. The larger the buffer area size value of the buffer20121 is, the larger the number of frames the buffer20121 caches is.
The buffer size value of the buffer20121 in the terminal device 201 may be described by a frame number, which indicates the number of audio frames that can be stored in the currently set buffer. The terminal device 201 may increase the number of audio frames that the currently set buffer can store by increasing the size value of the buffer. For example, the terminal device 201 may adjust the size value of the buffer from 1 frame to 2 frames. However, in practical applications, this adjustment method is cumbersome, and therefore, in the embodiment of the present application, the frame number corresponding to 1ms is used as an adjustment range for adjustment. Fig. 4a is a schematic diagram of a buffer size according to an embodiment of the present disclosure. Fig. 4b is a second schematic diagram of a buffer size according to an embodiment of the present application. For example, in the diagram of fig. 4a, the size of the buffer 201211 is 1ms, and in the diagram of fig. 4b, the size of the buffer 201212 is 2 ms. In practical applications, if the number of frames corresponding to 1ms of audio data currently processed by the terminal device 201 is 4096 frames, the size value of the buffer 201211 in the schematic diagram corresponding to fig. 4a is 4096 frames, and the size value of the buffer 201212 in the schematic diagram corresponding to fig. 4b is 8192 frames.
On the other hand, the buffer size value of the buffer20121 also affects the time delay of the audio data played by the bluetooth headset. The larger the buffer size value of the buffer20121 is, the higher the time delay of the bluetooth headset playing the audio data is, so in order to implement low-delay playing, the buffer size value is usually set to be smaller. However, too small a buffer size may cause problems such as high system load. Therefore, a method for dynamically adjusting a size value of a cache area according to an embodiment of the present application is shown in fig. 5, where fig. 5 is a schematic diagram of the method for dynamically adjusting a size value of a cache area according to an embodiment of the present application, and the method includes the following steps:
501. and acquiring the size value of the current cache region.
In the embodiment of the present application, the terminal device 201 may determine the current buffer size value by reading the parameter in the FWK layer 2012.
502. And if the preset condition is not met, increasing the size value of the cache area.
In this embodiment, when the terminal device 201 detects that the preset condition is not satisfied currently, the terminal device may increase the size value of the buffer by adjusting parameters in the FWK layer 2012. Specifically, the adjustment may be performed with a frame number corresponding to 1ms as an adjustment range.
The case where the preset condition is not satisfied may include, but is not limited to:
A. a UNDERRUN error is detected.
In the embodiment of the present application, the terminal apparatus 201 may check whether there is an error report corresponding to the UNDERRUN error to determine whether the UNDERRUN error has occurred. The UNDERRUN error is that when the audio stream is played, if the current existing data is played, the new data is not yet ready to be written, and at this time, the UNDERRUN error occurs and an error is reported.
B. Processor load greater than a first threshold is detected.
In the embodiment of the present application, the terminal device 201 may determine the load of the processor by reading the parameter, thereby determining whether the processor load is greater than the first threshold. The processor generally refers to a processor used by the terminal device 201 to operate. Processor load generally refers to the utilization of the processor. The first threshold may be specifically set according to actual conditions, and is generally set to 80%, which is not limited in the embodiment of the present application.
C. And detecting that the process power consumption exceeds a second threshold value and the current scene does not belong to a preset scene.
In the embodiment of the present application, the terminal device 201 may determine the process power consumption by reading the parameter. The process here generally refers to a process for implementing an ear return function, and in the android system, all functions such as recording, playing audio, ear return and the like are generally implemented by one audio process. It is therefore the terminal device 201 that generally detects the power consumption of this audio process, which can be determined by reading the parameters. The second threshold may be specifically set according to an actual situation, which is not limited in this embodiment of the application.
In the embodiment of the present application, the terminal device 201 may determine the type of the current scene by reading the parameter. The terminal device 201 may determine a scene where the terminal device 201 is located through a preset algorithm, which is not limited in this embodiment of the present application. The preset scene can be a large screen scene, an intelligent sound box scene, a locomotive scene and the like. Illustratively, the large-screen scene refers to that the terminal device 201 is a large-screen device, and the scene parameter is generally generated by detecting the screen size of the terminal device 201, at this time, the terminal device 201 may determine whether the current scene is a large-screen scene by reading the scene parameter.
503. And if the preset condition is met, reducing the size value of the cache area.
In this embodiment, when the terminal device 201 detects that the preset condition is not satisfied currently, the terminal device may reduce the size value of the buffer by adjusting parameters in the FWK layer 2012. The execution sequence of step 502 and step 503 is not limited in the embodiment of the present application.
The case where the preset condition is satisfied may include, but is not limited to:
D. no UNDERRUN error is detected, processor load is not greater than a first threshold is detected, and process power consumption does not exceed a second threshold;
in this embodiment, when the terminal device 201 does not detect a UNDERRUN error, and detects that the processor load is not greater than the first threshold and the process power consumption does not exceed the second threshold, it indicates that the current operating condition of the terminal device 201 is better, and the terminal device 201 may attempt to reduce the size value of the buffer to reduce the earreturn delay.
E. The method comprises the steps of detecting no UNDERRUN error, detecting that the processor load is not larger than a first threshold value, and detecting that the process power consumption exceeds a second threshold value but the current scene belongs to a preset scene.
In this embodiment of the present application, the terminal device 201 does not detect the UNDERRUN error, and detects that the processor load is not greater than the first threshold, and although the process power consumption exceeds the second threshold, the current scenario belongs to the preset scenario, which indicates that the current operation status of the terminal device 201 is also better, and the terminal device 201 may attempt to reduce the size value of the buffer to reduce the delay of the return to the ear. Illustratively, the terminal device 201 neither detects a UNDERRUN error, and detects that the processor load is not greater than the first threshold, and although the process power consumption exceeds the second threshold, the current scenario belongs to a smart box scenario, in which the process power consumption of the audio process is higher, which belongs to a normal situation, and therefore, in fact, the current terminal device 201 is not too bad in operation, the terminal device 201 may attempt to reduce the size value of the buffer to reduce the delay of the earreturn.
The terminal apparatus 201 may make the determination based on only one of the above cases such as ABCDE, or the like, or may make the determination based on a plurality of cases. In addition, the present embodiment does not limit the determination procedure of the above cases. In practical applications, the terminal device 201 may use these situations as the basis for dynamic adjustment, such as the application example corresponding to fig. 6.
Fig. 6 is an illustration of a dynamic adjustment application provided in the present application.
In this application example, whether the terminal device 201 detects an UNDERRUN error first or not, if so, it is consistent with the case a, and the terminal device 201 may increase the buffer size value.
If the UNDERRUN error does not occur, the terminal device 201 continues to determine whether the processor load is greater than the first threshold, and if so, the case B is met, and the terminal device 201 may increase the buffer size value.
If the UNDERRUN error does not occur and the processor load is not greater than the first threshold, the terminal device 201 may continue to determine whether the process power consumption is greater than the second threshold and whether the current scene is a preset scene. If the process power consumption is greater than the second threshold and the current scene is not the preset scene, the condition C is met, and the terminal device 201 may increase the size value of the cache area. If the process power consumption is not greater than the second threshold, which is met with the condition D, the terminal device 201 may decrease the buffer size value. If the process power consumption is greater than the second threshold and the current scene is the preset scene, the condition E is met, and the terminal device 201 may decrease the size value of the cache area.
TABLE 1
Figure BDA0002830660590000081
Table 1 is an example table of a case where the default current scene is not the preset scene in the application example corresponding to fig. 6. If one of the judgment results of "whether UNDERRUN occurs", "whether the progress is greater than the second threshold", and "whether the processor load exceeds the first threshold" is yes, the terminal device 201 may increase the buffer size value, and if the three judgments are no, the terminal device may decrease the buffer size value.
In practical application, a designer may design more judgment conditions according to actual conditions, for example, whether the processor temperature exceeds the third threshold, and the like, which is not limited in the embodiment of the present application.
In this embodiment, the terminal device 201 may continuously and dynamically adjust the size value of the buffer according to the above determination condition. In another implementation manner, the terminal device 201 may further determine whether the preset condition is satisfied again after increasing or decreasing the size value of the buffer until determining the minimum value of the buffer that satisfies the preset condition. The specific manner may be that after the terminal device 201 decreases the size value of the buffer, it is determined again whether the size value of the buffer may also be decreased (i.e., whether step 503 may be executed), if not, it indicates that the size value of the buffer has been decreased to the minimum, and the current size value of the buffer is the minimum, and may be determined.
In some implementations, after determining the minimum value of the buffer, the terminal device 201 runs for a period of time at the minimum value of the buffer, which may be inaccurate in practice due to the possible change of the surrounding environment. Therefore, after a period of time, the terminal device 201 may determine whether the preset condition is met and dynamically adjust the size value of the buffer.
In this embodiment of the application, the method corresponding to fig. 5 may provide a dynamically adjusted buffer size value to the method corresponding to fig. 3, so that the terminal device 201 can implement the ear return of the bluetooth headset according to the dynamically adjusted buffer size value.
303. Converting the recorded data into a data packet conforming to a Bluetooth protocol according to the size value of the cache region;
in this embodiment, the terminal device 201 may convert the recording data into a data packet conforming to the bluetooth protocol through the BT HAL layer 2017 according to the size value of the buffer. Wherein, the size value of the data packet is positively correlated with the size value of the buffer area. Illustratively, a data packet generally includes a header portion and a data portion, the header portion is generally a portion used for communication and identifying the meaning of the data packet, and the size is generally a fixed value. And the data portion may be proportional to the size value of the buffer. The larger the buffer size value, the larger the packet size value. In this embodiment of the present application, the manner of converting the audio record data into the data packet may be converted according to the specification of the bluetooth protocol stack, which is not described in detail herein.
Fig. 7 is a first schematic diagram illustrating that the terminal device 201 sends a data packet to the bluetooth headset 202 in this embodiment of the application. In state one, the terminal apparatus 201 determines that the size value of the buffer 201211 is the number of frames corresponding to 1 ms. In state two, the buffer 201212 has a size value of 2ms for frame number, and the terminal 201 sends the bluetooth headset 202 a data packet (indicated by a dotted line) corresponding to the buffer 201211 that has been converted. Fig. 8 is a diagram illustrating a second example in which the terminal device 201 sends a data packet to the bluetooth headset 202 in this embodiment of the present application. After the second state, the data packet sent by the terminal device 201 to the bluetooth headset 202 is the data packet converted by the buffer 201212, and since the buffer 201212 is larger than the buffer 201212, the data packet converted by the buffer 201212 is also increased, that is, the size value of the data packet is positively correlated with the size value of the buffer.
304. And sending the converted data packet to the Bluetooth headset so that the Bluetooth headset plays the audio corresponding to the data packet.
In this embodiment of the application, the terminal device 201 may send the converted data packet to the bluetooth headset through the bluetooth chip or the radio frequency module, which may specifically refer to a conventional technology of bluetooth transmission, and this is not described in detail again in this embodiment of the application.
After receiving the audio data, the bluetooth headset 202 may play the audio data in a manner similar to that of fig. 1, which is not described herein again in this embodiment of the present application. In this embodiment, the bluetooth headset 202 may detect the change of the packet size, and accordingly adjust the playing mode accordingly.
In this embodiment of the application, the terminal device 201 can increase the buffer size value when the state of the terminal device 201 is not good, so as to reduce the load of the terminal device 201, and decrease the buffer size value when the state of the terminal device 201 is good, so as to reduce the delay of the playback of the earlap, dynamically adjust the buffer size value, and implement low-delay earlap.
Fig. 9 is a schematic diagram of an apparatus for implementing bluetooth headset earreturn according to an embodiment of the present disclosure. This realize bluetooth headset ear to return device 900 includes:
a recording module 901, configured to execute step 301 in each embodiment corresponding to fig. 3;
a processing module 902, configured to perform step 302 and step 303 in each embodiment corresponding to fig. 3 described above, or configured to perform all steps in each embodiment corresponding to fig. 5 described above;
a sending module 903, configured to execute step 304 in each embodiment corresponding to fig. 3.
Fig. 10 is a schematic structural diagram of a terminal device 1000 according to an embodiment of the present application. The terminal device 1000 can be applied to the system shown in fig. 2, and performs the functions of the terminal device in the above method embodiment. For convenience of explanation, fig. 10 shows only main components of the terminal device. As shown in fig. 10, the terminal device 1000 includes a processor 1001, a memory 1002, a voice recorder 1003, and a bluetooth chip 1004. The processor is mainly configured to process the communication protocol and the communication data, control the entire terminal device, execute a software program, and process data of the software program, for example, to support the terminal device to perform the actions described in the above method embodiments. The memory is used primarily for storing software programs and data. The sound recorder 1003 may be any sound recorder capable of implementing a sound recording function, such as a microphone. The bluetooth chip 1004 may be used to convert the audio data read from the memory 1002 into a data packet and transmit the data packet to the bluetooth headset. The embodiment of the present application does not limit this.
Those skilled in the art will appreciate that fig. 10 shows only one memory and one processor for ease of illustration. In an actual terminal device, there may be multiple processors and multiple memories. The memory may also be referred to as a storage medium or a storage device, and the like, which is not limited in this embodiment of the present application.
As an alternative implementation manner, the processor may include a baseband processor and/or a central processing unit, where the baseband processor is mainly used to process the communication protocol and the communication data, and the central processing unit is mainly used to control the whole terminal device, execute a software program, and process data of the software program. The processor of fig. 10 may integrate the functions of the baseband processor and the central processing unit, and those skilled in the art will understand that the baseband processor and the central processing unit may also be independent processors, and are interconnected through a bus or the like. Those skilled in the art will appreciate that the terminal device may include a plurality of baseband processors to accommodate different network formats, the terminal device may include a plurality of central processors to enhance its processing capability, and various components of the terminal device may be connected by various buses. The baseband processor can also be expressed as a baseband processing circuit or a baseband processing chip. The central processing unit can also be expressed as a central processing circuit or a central processing chip. The function of processing the communication protocol and the communication data may be built in the processor, or may be stored in the storage unit in the form of a software program, and the processor executes the software program to realize the baseband processing function.
In the embodiment of the application, the recorder is used for acquiring the recording data and transmitting the recording data to the memory; the memory is used for storing one or more programs; the processor is used for running one or more programs to implement the methods shown in the corresponding embodiments of fig. 3 or to implement the methods shown in the corresponding embodiments of fig. 5; the Bluetooth chip is used for sending the converted data packet to the Bluetooth headset.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications or substitutions do not depart from the spirit and scope of the present disclosure as defined by the appended claims.

Claims (11)

1. A method for realizing Bluetooth headset earreturn, comprising:
acquiring recording data;
storing the recording data to a cache region;
converting the recording data into a data packet conforming to a Bluetooth protocol according to the size value of the cache region, wherein the size value of the data packet is positively correlated with the size value of the cache region;
sending the converted data packet to a Bluetooth headset so that the Bluetooth headset plays audio corresponding to the data packet;
wherein the size of the cache region is dynamically adjusted by:
obtaining the current size value of the cache region;
if the preset condition is not met, increasing the size value of the cache area;
and if the preset condition is met, reducing the size value of the cache area.
2. The method according to claim 1, wherein the non-satisfaction of the preset condition comprises: a UNDERRUN error is detected.
3. The method according to claim 1 or 2, wherein the not meeting the preset condition further comprises: processor load greater than a first threshold is detected.
4. The method according to any one of claims 1 to 3, wherein the non-satisfaction of the preset condition further comprises: and detecting that the process power consumption exceeds a second threshold value and the current scene does not belong to a preset scene.
5. The method according to any one of claims 1 to 4, wherein the meeting of the preset condition comprises: no UNDERUN error is detected, processor load is not detected to be greater than a first threshold, and process power consumption does not exceed a second threshold.
6. The method according to any one of claims 1 to 5, wherein the meeting of the preset condition comprises:
the method comprises the steps of detecting no UNDERRUN error, detecting that the processor load is not larger than a first threshold value, and detecting that the process power consumption exceeds a second threshold value but the current scene belongs to a preset scene.
7. The method of any one of claims 1 to 6, further comprising:
and after the size value of the cache region is increased or decreased, whether the preset condition is met or not is judged again until the minimum value of the cache region meeting the preset condition is determined.
8. The method according to any one of claims 1 to 7, wherein after determining the minimum value of the buffer satisfying the preset condition, the method further comprises:
and judging whether the preset conditions are met or not again every preset time period, and dynamically adjusting the size value of the cache region.
9. The method of any one of claims 1 to 8, wherein after the obtaining of the audio record data and before the saving of the audio record data to the buffer, the method further comprises:
and processing the recording data through a recording algorithm.
10. An apparatus for implementing ear return of a bluetooth headset, comprising:
the recording module is used for acquiring recording data;
the processing module is used for storing the recording data to a cache region;
the processing module is further configured to convert the recording data into a data packet conforming to a bluetooth protocol according to the size value of the cache region, where the size value of the data packet is positively correlated with the size value of the cache region;
the sending module is used for sending the converted data packet to a Bluetooth headset so that the Bluetooth headset can play audio corresponding to the data packet;
the processing module is further configured to dynamically adjust the size value of the cache region by:
obtaining the current size value of the cache region;
if the preset condition is not met, increasing the size value of the cache area;
and if the preset condition is met, reducing the size value of the cache region.
11. The terminal equipment is characterized by comprising a processor, a memory, a recorder and a Bluetooth chip;
the recorder is used for acquiring recording data and transmitting the recording data to the memory;
the memory is used for storing one or more programs;
the processor is configured to run the one or more programs to implement the method of any one of claims 1 to 9;
and the Bluetooth chip is used for sending the converted data packet to the Bluetooth headset.
CN202011442700.8A 2020-12-11 2020-12-11 Method and related device for realizing ear return of Bluetooth headset Pending CN114629987A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011442700.8A CN114629987A (en) 2020-12-11 2020-12-11 Method and related device for realizing ear return of Bluetooth headset

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011442700.8A CN114629987A (en) 2020-12-11 2020-12-11 Method and related device for realizing ear return of Bluetooth headset

Publications (1)

Publication Number Publication Date
CN114629987A true CN114629987A (en) 2022-06-14

Family

ID=81895737

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011442700.8A Pending CN114629987A (en) 2020-12-11 2020-12-11 Method and related device for realizing ear return of Bluetooth headset

Country Status (1)

Country Link
CN (1) CN114629987A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101001362A (en) * 2006-01-11 2007-07-18 腾讯科技(深圳)有限公司 Method and terminal of on-line playing flow media
CN104065834A (en) * 2014-06-20 2014-09-24 宇龙计算机通信科技(深圳)有限公司 Method and device for reducing terminal power consumption and terminal
CN107992282A (en) * 2017-11-29 2018-05-04 珠海市魅族科技有限公司 Audio data processing method and device, computer installation and readable storage devices
CN111556361A (en) * 2020-04-29 2020-08-18 腾讯科技(深圳)有限公司 Buffer zone setting method, device, equipment and storage medium for Bluetooth audio playing
CN111586529A (en) * 2020-05-08 2020-08-25 北京三体云联科技有限公司 Audio data processing method, device, terminal and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101001362A (en) * 2006-01-11 2007-07-18 腾讯科技(深圳)有限公司 Method and terminal of on-line playing flow media
CN104065834A (en) * 2014-06-20 2014-09-24 宇龙计算机通信科技(深圳)有限公司 Method and device for reducing terminal power consumption and terminal
CN107992282A (en) * 2017-11-29 2018-05-04 珠海市魅族科技有限公司 Audio data processing method and device, computer installation and readable storage devices
CN111556361A (en) * 2020-04-29 2020-08-18 腾讯科技(深圳)有限公司 Buffer zone setting method, device, equipment and storage medium for Bluetooth audio playing
CN111586529A (en) * 2020-05-08 2020-08-25 北京三体云联科技有限公司 Audio data processing method, device, terminal and computer readable storage medium

Similar Documents

Publication Publication Date Title
US9208767B2 (en) Method for adaptive audio signal shaping for improved playback in a noisy environment
EP2392150B1 (en) Audio coding selection based on device operating condition
JP5526042B2 (en) Acoustic system and method for providing sound
KR101731714B1 (en) Method and headset for improving sound quality
WO2017215657A1 (en) Sound effect processing method, and terminal device
CN113542479B (en) Recording method, recording device, wireless earphone and storage medium
WO2021160040A1 (en) Audio transmission method and electronic device
WO2021180115A1 (en) Recording method and recording system using true wireless earbuds
US20190098398A1 (en) Multi-Resolution Audio Signals
WO2023273701A1 (en) Coding control method and apparatus, wireless earphone, and storage medium
WO2022262410A1 (en) Sound recording method and apparatus
CN111770404A (en) Recording method, recording device, electronic equipment and readable storage medium
CN106293607B (en) Method and system for automatically switching audio output modes
CN114629987A (en) Method and related device for realizing ear return of Bluetooth headset
CN113286219A (en) Bluetooth earphone with recording function and recording method thereof
JP5940672B2 (en) Source-dependent wireless earphone equalization
CN113196800A (en) Hybrid microphone for wireless headset
WO2024098895A1 (en) Audio processing method and apparatus, and audio playback device and storage medium
WO2023160286A1 (en) Noise reduction parameter adaptation method and apparatus
TWI784594B (en) Conference terminal and embedding method of audio watermark
US20240029755A1 (en) Intelligent speech or dialogue enhancement
JP5332348B2 (en) Audio playback system, audio playback device, portable player, and audio playback control method
CN116709418A (en) Dynamic delay adjustment method and device, bluetooth playing equipment and storage medium
US20190355341A1 (en) Methods and apparatus for playback of captured ambient sounds
KR20040058660A (en) Mobile phone for outputting stereo sound

Legal Events

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