Bluetooth device audio control method, device, equipment and storage medium
By playing preset transition audio in Bluetooth devices, the problem that the device may be disconnected when there is no audio playback state is solved, and the smoothness of audio playback is improved.
Patent Information
- Application Number
- CN202210781807.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-04
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2042-07-04
AI Technical Summary
After a Bluetooth device has no audio playback for a period of time, it may be in a disconnected state or there is no sound in the first few seconds of playback, affecting the smoothness of audio playback.
By obtaining the connection status and audio playback status of the Bluetooth device, if the device is connected but has no audio playback status, the preset transition audio is played to keep the connection.
Effectively avoided the sound of no sound due to the disconnected connection, and improved the smoothness of the audio playback of Bluetooth equipment.
Smart Images

Figure CN115022773B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Bluetooth communication, and in particular to a method, device, equipment and storage medium for controlling audio of a Bluetooth device. Background Art
[0002] There are more and more Bluetooth audio devices that can play audio, such as Bluetooth speakers and TWS (True Wireless Stereo) Bluetooth headsets. They are becoming more and more popular among consumers due to their convenience and sound quality.
[0003] After the Bluetooth device is connected to the device that controls audio playback, there are no problems in normal playback. However, after a period of time without audio playback (such as playback completion or pause), when audio playback is resumed, the Bluetooth device may be disconnected, or even if it is connected, there is no sound for a few seconds before audio playback, affecting the smoothness of audio playback. Summary of the invention
[0004] The main purpose of the present invention is to provide a Bluetooth device audio control method, device, equipment and storage medium, aiming to solve the problem of audio disconnection when the Bluetooth device plays audio.
[0005] To achieve the above object, the present invention provides a method for controlling audio of a Bluetooth device, the method comprising:
[0006] Get the connection status with the Bluetooth sound device;
[0007] If the connection status is connected, the current audio playback status is obtained;
[0008] If the current audio playing state is a no audio playing state, a preset transition audio is played to maintain the connection with the Bluetooth sound device.
[0009] Optionally, the step of obtaining the connection status with the Bluetooth sound device includes:
[0010] Detect whether a Bluetooth device is currently connected;
[0011] If a connected Bluetooth device is detected, determining the device type of the Bluetooth device;
[0012] If the device type is a Bluetooth sound device, it is determined that the device is in a connected state with the Bluetooth sound device.
[0013] Optionally, the step of obtaining the current audio playback status includes:
[0014] Check whether the currently running program has audio playback permission;
[0015] If the currently running program has the audio playback permission, obtaining the audio playback permission usage status of the currently running program;
[0016] If the audio play permission usage status is unused, it is determined that the current audio play status is a no audio play status.
[0017] Optionally, before the step of playing the preset transition audio to maintain the connection with the Bluetooth sound device, the method further includes:
[0018] Detecting the duration of the no audio playback state;
[0019] If the duration exceeds a preset time threshold, the step of playing the preset transition audio is performed.
[0020] Optionally, the step of playing a preset transition audio to maintain the connection with the Bluetooth sound device includes:
[0021] Obtaining identification information of the transition audio;
[0022] Searching for the audio file of the transition audio in a preset audio file library according to the identification information, and playing the audio file;
[0023] The audio file is transmitted to the Bluetooth sound device via a Bluetooth connection with the Bluetooth sound device.
[0024] Optionally, after the step of playing a preset transition audio if the current audio playback state is a no audio playback state to maintain the connection with the Bluetooth sound device, the method further includes:
[0025] When the current audio playing state changes from a state without audio playing to a state with audio playing, the playing of the transition audio is stopped.
[0026] Optionally, before the step of stopping playing the transition audio, the method further includes:
[0027] Obtaining duration information of the audio to be played, and determining whether the audio to be played is a short-duration audio according to the duration information;
[0028] If the audio to be played is a short audio, continue to play the transition audio;
[0029] If the audio to be played is a long audio, the step of stopping playing the transition audio is performed.
[0030] In addition, to achieve the above-mentioned purpose, the present invention further provides a Bluetooth device audio control device, the Bluetooth device audio control device comprising:
[0031] A first acquisition module, used to acquire the connection status with the Bluetooth sound device;
[0032] A second acquisition module, configured to acquire a current audio playback state if the connection state is a connected state;
[0033] The audio playing module is used to play a preset transition audio if the current audio playing state is a no audio playing state, so as to maintain the connection with the Bluetooth sound device.
[0034] In addition, to achieve the above-mentioned purpose, the present invention also provides an electronic device, which includes: a memory, a processor, and a Bluetooth device audio control program stored in the memory and executable on the processor, wherein the Bluetooth device audio control program is configured to implement the steps of the Bluetooth device audio control method as described above.
[0035] In addition, to achieve the above objectives, the present invention also provides a computer-readable storage medium, on which a Bluetooth device audio control program is stored. When the Bluetooth device audio control program is executed by a processor, the steps of the Bluetooth device audio control method described above are implemented.
[0036] The present invention obtains the connection status with a Bluetooth sound device; if the connection status is a connected state, the current audio playing status is obtained; if the current audio playing status is a no-audio playing state, a preset transition audio is played to maintain the connection with the Bluetooth sound device, and when the no-audio playing state is currently in the transition audio is played to maintain the data stream connection with the Bluetooth sound device, so when the audio playing state is restored to continue playing, the situation of no sound playing due to disconnection is avoided, thereby improving the fluency of the audio playing of the Bluetooth sound device. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic diagram of the structure of an electronic device in a hardware operating environment involved in an embodiment of the present invention;
[0038] Figure 2 A schematic diagram of a flow chart of a first embodiment of a method for controlling audio of a Bluetooth device according to the present invention;
[0039] Figure 3 A schematic diagram of a connection scenario between an audio control device and a Bluetooth sound device in the Bluetooth device audio control method of the present invention;
[0040] Figure 4 A schematic diagram of a flow chart of a second embodiment of a method for controlling audio of a Bluetooth device according to the present invention;
[0041] Figure 5Schematic diagram of an audio control device for a Bluetooth device according to an embodiment of the present invention.
[0042] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0043] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0044] The main technical scheme of the present invention is: obtaining the connection status between the Bluetooth sound device; if the connection status is a connected state, obtaining the current audio playback status; if the current audio playback status is a no audio playback state, playing the preset transition audio to maintain the connection with the Bluetooth sound device.
[0045] Reference Figure 1 , Figure 1 The figure is a schematic diagram of the structure of an electronic device of the hardware operating environment involved in the embodiment of the present invention.
[0046] like Figure 1 As shown, the electronic device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0047] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0048] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a Bluetooth device audio control program.
[0049] exist Figure 1 In the electronic device shown, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the electronic device of the present invention can be set in the electronic device, and the electronic device calls the Bluetooth device audio control program stored in the memory 1005 through the processor 1001, and performs the following steps:
[0050] Get the connection status with the Bluetooth sound device;
[0051] If the connection status is connected, the current audio playback status is obtained;
[0052] If the current audio playing state is a no audio playing state, the preset transition audio is played to maintain the connection with the Bluetooth sound device.
[0053] Optionally, the processor 1001 calls the Bluetooth device audio control program stored in the memory 1005, and may also perform the following steps:
[0054] Detect whether a Bluetooth device is currently connected;
[0055] If a connected Bluetooth device is detected, determining the device type of the Bluetooth device;
[0056] If the device type is a Bluetooth sound device, it is determined that the device is in a connected state with the Bluetooth sound device.
[0057] Optionally, the processor 1001 calls the Bluetooth device audio control program stored in the memory 1005, and may also perform the following steps:
[0058] Check whether the currently running program has audio playback permission;
[0059] If the currently running program has the audio playback permission, obtaining the audio playback permission usage status of the currently running program;
[0060] If the audio play permission usage status is unused, it is determined that the current audio play status is a no audio play status.
[0061] Optionally, the processor 1001 calls the Bluetooth device audio control program stored in the memory 1005, and may also perform the following steps:
[0062] Detecting the duration of the no audio playback state;
[0063] If the duration exceeds a preset time threshold, the step of playing the preset transition audio is performed.
[0064] Optionally, the processor 1001 calls the Bluetooth device audio control program stored in the memory 1005, and may also perform the following steps:
[0065] Obtaining identification information of the transition audio;
[0066] Searching for the audio file of the transition audio in a preset audio file library according to the identification information, and playing the audio file;
[0067] The audio file is transmitted to the Bluetooth sound device via a Bluetooth connection with the Bluetooth sound device.
[0068] Optionally, the processor 1001 calls the Bluetooth device audio control program stored in the memory 1005, and may also perform the following steps:
[0069] When the current audio playing state changes from a state without audio playing to a state with audio playing, the playing of the transition audio is stopped.
[0070] Optionally, the processor 1001 calls the Bluetooth device audio control program stored in the memory 1005, and may also perform the following steps:
[0071] Obtaining duration information of the audio to be played, and determining whether the audio to be played is a short-duration audio according to the duration information;
[0072] If the audio to be played is a short audio, continue to play the transition audio;
[0073] If the audio to be played is a long audio, the step of stopping playing the transition audio is performed.
[0074] The embodiment of the present invention provides a method for controlling audio of a Bluetooth device, referring to Figure 2 , Figure 2 The figure is a flowchart of a first embodiment of a method for controlling audio of a Bluetooth device according to the present invention.
[0075] In this embodiment, the Bluetooth device audio control method includes:
[0076] Step S10, obtaining the connection status with the Bluetooth sound device;
[0077] Bluetooth is a radio technology that supports short-range communication between devices. Through Bluetooth connection, various types of data such as audio, pictures and documents can be transmitted between devices. The Bluetooth sound device in this embodiment refers to a device with Bluetooth function that can play audio, such as Bluetooth headsets and Bluetooth speakers. The device connected to the Bluetooth sound device can be an audio control device, such as a mobile phone and a television. After the audio control device is connected to the Bluetooth sound device, the audio control device can transmit audio data to the Bluetooth sound device, and the audio originally played on the audio control device is played by the Bluetooth sound device. The connection status between the audio control device and the Bluetooth sound device can be represented by the Bluetooth connection status. This embodiment is described with the audio control device as the execution subject.
[0078] Figure 3 It is a connection scene graph between the audio control device and the Bluetooth sound device, such as Figure 3 As shown, the audio control device is connected to the Bluetooth sound device via Bluetooth. In an actual Bluetooth connection scenario, if the audio played by the audio control device remains paused or the playback is completed for a period of time, the Bluetooth connection may be disconnected. Even if the Bluetooth connection is not disconnected, the user cannot immediately hear the audio playing after the audio control device resumes the audio playback.
[0079] As an example, the step of obtaining the connection status with the Bluetooth sound device may include:
[0080] Step A1, detecting whether a Bluetooth device is currently connected;
[0081] Step A2, if a connected Bluetooth device is detected, determining the device type of the Bluetooth device;
[0082] Step A3: If the device type is a Bluetooth sound device, determine that the device is in a connected state with the Bluetooth sound device.
[0083] A Bluetooth device is a device with a Bluetooth function, which can be understood as a Bluetooth device including a Bluetooth sound device. When the Bluetooth function of the audio control device is turned on, the audio control device can search whether there is a Bluetooth device within the effective communication distance. When a Bluetooth device is searched, a Bluetooth connection request is initiated to the Bluetooth device, a Bluetooth connection is established with the Bluetooth device, and the Bluetooth device that successfully establishes a Bluetooth connection is added to the list of connected devices. Specifically, when the audio control device establishes a Bluetooth connection with the Bluetooth device, the device information of the Bluetooth device can be obtained, and the device information can be added to the list of connected devices. It can be determined whether the Bluetooth device is currently connected based on whether the device information of the Bluetooth device exists in the list of connected devices. When the device information exists in the connection list, it indicates that the audio control device is currently connected to the Bluetooth device. When there is no device information in the connection list, it indicates that the audio control device is currently not connected to the Bluetooth device. The device information can include the model information of the Bluetooth device. The audio control device can query the device type of the Bluetooth device based on the signal information. The device type can be a mobile phone, a computer, a headset or a smart watch, etc. Devices whose main function is audio playback, such as Bluetooth headsets and Bluetooth speakers, are classified as Bluetooth sound devices. When it is determined that the device type of the Bluetooth device belongs to the Bluetooth sound device, it can be determined that the audio control device and the Bluetooth sound device are in a connected state.
[0084] Step S20, if the connection state is connected, obtaining the current audio playback state;
[0085] When the audio control device and the Bluetooth sound device are in a connected state, the audio data generated by the audio control device is transmitted to the Bluetooth sound device and played through the Bluetooth sound device.
[0086] As an example, the step of obtaining the current audio playback status may include:
[0087] Step B1, detecting whether the currently running program has audio playback permission;
[0088] Step B2: if the currently running program has the audio playback permission, obtaining the audio playback permission usage status of the currently running program;
[0089] Step B3: if the audio play permission usage status is unused, determining that the current audio play status is a no audio play status.
[0090] The currently running program may include a foreground running program and a background running program, that is, there may be multiple currently running programs at the same time. For example, when the audio control device is a mobile phone, the user uses the mobile phone to read an e-book while listening to music. The foreground running program is a reading software, and the background running program is a music software. When the user installs or uses an application in the audio control device, the application can ask the user whether to grant certain permissions through prompt information, such as audio playback permission, camera usage permission, and notification sending permission. Therefore, it is possible to determine whether the current running program will play audio by detecting whether the current running program has audio playback permission. If the current running program does not have audio playback permission, the running status of the current running program can be monitored, and when the current running program is changed to a new application, the step of detecting audio playback permission is performed. If the current running program has audio playback permission, the audio playback permission usage status of the current running program can be detected. For example, the current running program is a music software. When the music software plays music, the audio playback permission usage status is in use, and the current audio playback status can be determined to be an audio playback status; when the music software pauses or stops playing, the audio playback permission usage status is unused, and the current audio playback status can be determined to be a no audio playback status. The current audio playback status can be accurately determined by the audio playback permission usage status.
[0091] In some embodiments, the current audio playback state can be obtained by detecting the sound waveform of the audio, that is, the sound can be captured by a microphone, converted into a numerical value, and stored as a waveform file, and the sound is represented by a sine wave, the amplitude of the sine wave represents the volume, and the frequency of the sine wave represents the frequency of the sound, and the current audio playback state is determined by the changes in the amplitude and frequency in the waveform file.
[0092] Step S30: If the current audio playing state is a no audio playing state, a preset transition audio is played to maintain the connection with the Bluetooth sound device.
[0093] The audio control device and the Bluetooth sound device mainly transmit audio data via Bluetooth connection. When the audio control device is in a state of no audio playback, the data flow between the two may be interrupted. Playing transition audio can maintain the data flow connection.
[0094] The transition audio can be white noise, that is, sound that the human ear cannot hear. Specifically, it can be manifested as audio with a volume of negative infinity or audio that exceeds the hearing range of the human ear. The hearing range of the human ear is generally 20Hz-20000Hz. In actual applications, considering that the hearing of special groups may be very sensitive, a frequency above 30000Hz can be selected to ensure that the user cannot hear the sound when playing white noise. Playing transition audio in the state of no audio playback can maintain the connection of the data stream without affecting the user's experience of using Bluetooth sound devices.
[0095] As an example, before playing the preset transition audio to control the step of maintaining the connection with the Bluetooth sound device, the following steps may also be included:
[0096] Step C1, detecting the duration of the no audio playback state;
[0097] Step C2: If the duration exceeds a preset time threshold, the step of playing the preset transition audio is executed.
[0098] In actual situations, even if the Bluetooth connection between the audio control device and the Bluetooth sound device is not disconnected, a short audio gap may occur when resuming audio playback, that is, the user cannot hear any sound from the Bluetooth sound device. The preset time threshold can be set according to the time when the audio gap occurs. Due to various differences in manufacturers, models, and connection stability between different Bluetooth sound devices, the time when the audio gap occurs may be different. The time threshold can be set to a smaller value to avoid audio gaps when resuming audio playback.
[0099] By setting a judgment condition for the duration of the no-audio playback state before playing the transition audio, the use time of the Bluetooth audio device can be reduced and power can be saved.
[0100] As an example, the step of playing a preset transition audio to control the connection with the Bluetooth sound device may include:
[0101] Step D1, obtaining identification information of the transition audio;
[0102] Step D2, searching for the audio file of the transition audio in a preset audio file library according to the identification information, and playing the audio file;
[0103] Step D3: transmitting the audio file to the Bluetooth sound device via a Bluetooth connection with the Bluetooth sound device.
[0104] The audio control device can emit sounds that are inaudible to the human ear by playing an audio file of transition audio. The preset audio file library can be set in the audio control device or in a cloud server. The audio file library can include audio files of transition audio of different frequencies and volumes, and different audio files are distinguished by the identification information of the transition audio. The identification information may include at least one of the file name, frequency characteristics, and volume characteristics. The playback mode of the transition audio can be random playback, sequential playback, or loop playback. The audio control device and the Bluetooth sound device are in a Bluetooth connection state. When the audio control device plays the transition audio, the audio file can be transferred to the Bluetooth sound device to maintain the connection of the data stream and avoid the Bluetooth connection being disconnected.
[0105] When the current audio playback state changes from a state without audio playback to a state with audio playback, the transition audio stops playing. When the user operates the audio control device to resume audio playback, such as switching the song played in the music software from pause to play, the audio control device can stop playing the transition audio and switch to continue playing the song in the music software, so that the audio connection is smooth and the audio gap is avoided.
[0106] In this embodiment, the connection status with the Bluetooth sound device is obtained; if the connection status is the connected status, the current audio playback status is obtained; if the current audio playback status is the no audio playback status, the preset transition audio is played to maintain the connection with the Bluetooth sound device. When the no audio playback status is currently in the no audio playback status, the data stream connection with the Bluetooth sound device is maintained by playing the transition audio. When the audio playback status is restored to continue playback, the situation of no sound playback due to disconnection is avoided, thereby improving the smoothness of the audio playback of the Bluetooth sound device.
[0107] Further, in the second embodiment of the Bluetooth device audio control method of the present invention, referring to Figure 4 , the method comprising:
[0108] Step S11, obtaining the duration information of the audio to be played, and determining whether the audio to be played is a short-duration audio according to the duration information;
[0109] The audio to be played can be the original audio played when there is audio playing. When the audio is changed from the audio playing state to the non-audio playing state, the original audio may not be played completely, such as in the paused state. When the playback is resumed, the original audio continues to be played. The original audio can be understood as the audio to be played. The audio to be played can also be a message reminder audio, which can be regarded as the audio of the application pushing various notifications to the user. After obtaining the duration information of the audio to be played, the duration type of the audio to be played can be determined based on the duration information. The audio to be played with a duration of 2s or less can be regarded as short-term audio, and the audio to be played with a duration of more than 2s can be regarded as long-term audio.
[0110] Step S12, if the audio to be played is a short audio, continue to play the transition audio;
[0111] During the playing of transition audio, if the audio control device needs to play short-duration audio, the short-duration audio can be filtered out and the audio data of the short-duration audio is not transmitted to the Bluetooth sound device. The audio played by the Bluetooth sound device is still transition audio.
[0112] Step S13: If the audio to be played is a long audio, the step of stopping playing the transition audio is executed.
[0113] When the audio to be played is a long audio, stop playing the transition audio and switch the currently playing audio to the audio to be played to meet the user's requirement to resume playback.
[0114] In this embodiment, the audio to be played whose audio type is short-term audio is filtered, which can save data transmission resources.
[0115] The embodiment of the present invention also provides a Bluetooth device audio control device, such as Figure 5 As shown, the Bluetooth device audio control device includes:
[0116] The first acquisition module 101 is used to acquire the connection status with the Bluetooth sound device;
[0117] The second acquisition module 102 is used to acquire the current audio playing state if the connection state is the connected state;
[0118] The audio playing module 103 is used to play a preset transition audio if the current audio playing state is a no audio playing state, so as to maintain the connection with the Bluetooth sound device.
[0119] Optionally, the first acquisition module 101 is further configured to:
[0120] Detect whether a Bluetooth device is currently connected;
[0121] If a connected Bluetooth device is detected, determining the device type of the Bluetooth device;
[0122] If the device type is a Bluetooth sound device, it is determined that the device is in a connected state with the Bluetooth sound device.
[0123] Optionally, the second acquisition module 102 is further configured to:
[0124] Check whether the currently running program has audio playback permission;
[0125] If the currently running program has the audio playback permission, obtaining the audio playback permission usage status of the currently running program;
[0126] If the audio play permission usage status is unused, it is determined that the current audio play status is a no audio play status.
[0127] Optionally, the Bluetooth device audio control apparatus further includes a detection module, which is used to:
[0128] Detecting the duration of the no audio playback state;
[0129] If the duration exceeds a preset time threshold, the step of playing the preset transition audio is performed.
[0130] Optionally, the audio playing module 103 is further used for:
[0131] Obtaining identification information of the transition audio;
[0132] Searching for the audio file of the transition audio in a preset audio file library according to the identification information, and playing the audio file;
[0133] The audio file is transmitted to the Bluetooth sound device via a Bluetooth connection with the Bluetooth sound device.
[0134] Optionally, the Bluetooth device audio control apparatus further includes a playback control module, which is used to:
[0135] When the current audio playing state changes from a state without audio playing to a state with audio playing, the playing of the transition audio is stopped.
[0136] Optionally, the playback control module is further used to:
[0137] Obtaining duration information of the audio to be played, and determining whether the audio to be played is a short-duration audio according to the duration information;
[0138] If the audio to be played is a short audio, continue to play the transition audio;
[0139] If the audio to be played is a long audio, the step of stopping playing the transition audio is performed.
[0140] The embodiment of the present invention further provides an electronic device, the electronic device comprising: a memory, a processor, and a Bluetooth device audio control program stored in the memory and executable on the processor, the Bluetooth device audio control program being configured to implement the steps of the Bluetooth device audio control method as described above. The specific implementation of the electronic device of the embodiment of the present invention is referred to the above-mentioned embodiments of the Bluetooth device audio control method, which will not be described in detail here.
[0141] The embodiment of the present invention further provides a computer-readable storage medium, on which a Bluetooth device audio control program is stored, and when the Bluetooth device audio control program is executed by a processor, the steps of the Bluetooth device audio control method described above are implemented. The specific implementation of the computer-readable storage medium of the embodiment of the present invention can be found in the above-mentioned embodiments of the Bluetooth device audio control method, which will not be repeated here.
[0142] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0143] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0144] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0145] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for controlling audio of a Bluetooth device, characterized in that: The Bluetooth device audio control method comprises the following steps: Get the connection status with the Bluetooth sound device; If the connection status is connected, the current audio playback status is obtained; If the current audio playback state is a no-audio playback state, detecting the duration of the no-audio playback state; If the duration exceeds a preset time threshold, a preset transition audio is played to maintain the connection with the Bluetooth sound device.
2. The Bluetooth device audio control method according to claim 1, characterized in that: The step of obtaining the connection status with the Bluetooth sound device comprises: Detect whether a Bluetooth device is currently connected; If a connected Bluetooth device is detected, determining the device type of the Bluetooth device; If the device type is a Bluetooth sound device, it is determined that the device is in a connected state with the Bluetooth sound device.
3. The Bluetooth device audio control method according to claim 1, characterized in that: The step of obtaining the current audio playback status includes: Check whether the currently running program has audio playback permission; If the currently running program has the audio playback permission, obtaining the audio playback permission usage status of the currently running program; If the audio play permission usage status is unused, it is determined that the current audio play status is a no audio play status.
4. The Bluetooth device audio control method according to claim 1, characterized in that: The step of playing the preset transition audio to maintain the connection with the Bluetooth sound device comprises: Obtaining identification information of the transition audio; Searching for the audio file of the transition audio in a preset audio file library according to the identification information, and playing the audio file; The audio file is transmitted to the Bluetooth sound device via a Bluetooth connection with the Bluetooth sound device.
5. The Bluetooth device audio control method according to any one of claims 1 to 4, characterized in that: After the step of playing a preset transition audio if the current audio playback state is a no audio playback state to maintain the connection with the Bluetooth sound device, the method further includes: When the current audio playing state changes from a state without audio playing to a state with audio playing, the playing of the transition audio is stopped.
6. The method for controlling audio of a Bluetooth device as claimed in claim 5, wherein: Before the step of stopping playing the transition audio, the method further includes: Obtaining duration information of the audio to be played, and determining whether the audio to be played is a short-duration audio according to the duration information; If the audio to be played is a short audio, continue to play the transition audio; If the audio to be played is a long audio, the step of stopping playing the transition audio is performed.
7. A Bluetooth device audio control device, characterized in that: The Bluetooth device audio control device comprises: A first acquisition module, used to acquire the connection status with the Bluetooth sound device; A second acquisition module, configured to acquire a current audio playback state if the connection state is a connected state; A detection module, configured to detect the duration of the no-audio playback state if the current audio playback state is a no-audio playback state; The audio playing module is used to play a preset transition audio if the duration exceeds a preset time threshold, so as to maintain the connection with the Bluetooth sound device.
8. An electronic device, characterized in that: The electronic device comprises: a memory, a processor, and a Bluetooth device audio control program stored in the memory and executable on the processor, wherein the Bluetooth device audio control program is configured to implement the steps of the Bluetooth device audio control method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a Bluetooth device audio control program, and when the Bluetooth device audio control program is executed by the processor, the steps of the Bluetooth device audio control method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Audio processing method and device, electronic equipment and computer readable medium
CN115314865A