WO2019223600A1 - 蓝牙音频传输方法、装置及计算机可读存储介质 - Google Patents

蓝牙音频传输方法、装置及计算机可读存储介质 Download PDF

Info

Publication number
WO2019223600A1
WO2019223600A1 PCT/CN2019/087241 CN2019087241W WO2019223600A1 WO 2019223600 A1 WO2019223600 A1 WO 2019223600A1 CN 2019087241 W CN2019087241 W CN 2019087241W WO 2019223600 A1 WO2019223600 A1 WO 2019223600A1
Authority
WO
WIPO (PCT)
Prior art keywords
audio
bluetooth
bluetooth audio
audio output
source
Prior art date
Application number
PCT/CN2019/087241
Other languages
English (en)
French (fr)
Inventor
曾庆忠
朱海明
潘志兴
严力
Original Assignee
深圳Tcl新技术有限公司
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 深圳Tcl新技术有限公司 filed Critical 深圳Tcl新技术有限公司
Publication of WO2019223600A1 publication Critical patent/WO2019223600A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/439Processing of audio elementary streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/41Structure of client; Structure of client peripherals
    • H04N21/4104Peripherals receiving signals from specially adapted client devices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/439Processing of audio elementary streams
    • H04N21/4392Processing of audio elementary streams involving audio buffer management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • H04N21/44231Monitoring of peripheral device or external card, e.g. to detect processing problems in a handheld device or the failure of an external recording device
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/443OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication

Definitions

  • the present application relates to the technical field of smart televisions, and in particular, to a Bluetooth audio transmission method, a Bluetooth audio transmission device, and a computer-readable storage medium.
  • the application scenarios also become rich and complex.
  • the user wants to use the Bluetooth remote control to chat with friends while enjoying music MV on the smart TV.
  • the smart TV needs to obtain audio data from the TV source and the Bluetooth remote control at the same time, and transfer the Bluetooth audio data obtained by the Bluetooth remote control to the chat Application software; for example, in the implementation of the voice recognition function of the Bluetooth remote control, the voice recognition application needs to obtain the Bluetooth audio data of the Bluetooth remote control and transmit it to the cloud for analysis.
  • the smart TV system has not been able to implement software to obtain Bluetooth audio data from multiple audio input sources to multiple applications, which cannot meet the audio transmission requirements in different application scenarios.
  • the main purpose of this application is to provide a method for Bluetooth audio transmission, a device for Bluetooth audio transmission, and a computer-readable storage medium, which are intended to solve the technical problems in the Bluetooth audio transmission of the prior art described in the above background art.
  • the present application provides a method for Bluetooth audio transmission.
  • the method for Bluetooth audio transmission includes the following steps:
  • the Bluetooth audio input source and audio output source specified in each of the request messages are obtained separately, where the Bluetooth audio specified in each of the request messages is obtained
  • An input source is associated with the audio output source
  • the Bluetooth audio data corresponding to each of the request messages is read from the buffer space and sent to the associated audio output source.
  • the method for Bluetooth audio transmission further includes the following steps:
  • the default audio input source is turned off.
  • the method further includes:
  • audio data is obtained from the default audio input source.
  • the method further includes:
  • the method further includes:
  • the acquired audio data is output from the default audio output device.
  • the step of detecting whether there is an audio input source other than the default audio input source before includes:
  • the system After the system is started, it is detected whether a request for obtaining Bluetooth audio data is received from an application program, wherein the system is a system to which the method of Bluetooth audio transmission is applied, and the application program runs in the system.
  • the method further includes:
  • the audio output source with the highest priority is used as the target audio output source.
  • the method further includes:
  • the step of reading Bluetooth audio data corresponding to each of the request messages from the buffer space and sending the Bluetooth audio data to the associated audio output source includes:
  • the step of obtaining the audio input source and audio output source specified in each of the request messages further includes:
  • the audio output function of the default audio output device is turned off.
  • the steps of reading Bluetooth audio data corresponding to each of the requests from each of the audio input sources, and buffering the Bluetooth audio data to a buffer space in real time include:
  • the Bluetooth audio data is buffered into a buffer space at the corresponding buffer rate in real time.
  • the cache space is a preset memory space.
  • the buffer space is determined according to a memory hardware and a memory allocation situation in which the Bluetooth audio transmission system is applied.
  • the buffer space is determined according to a transmission delay requirement of an application program that sends the request message.
  • the method for Bluetooth audio transmission further includes the following steps:
  • the transmission request message queue is queried in real time, and the Bluetooth audio transmission request messages in the transmission request message queue are processed in chronological order.
  • the steps of obtaining the Bluetooth audio input source and audio output source specified in each of the request messages include:
  • the method before the step of reading Bluetooth audio data corresponding to each of the request messages from the buffer space and sending the Bluetooth audio data to the associated audio output source, the method further includes:
  • a connection is established with the associated audio output source.
  • the audio output source includes a Bluetooth device and an application process running in the system.
  • the present application also provides the Bluetooth audio transmission device, which includes a memory, a processor, a Bluetooth module, and a Bluetooth audio transmission stored on the memory and operable on the processor.
  • a control program that, when executed by the processor, implements the steps of the Bluetooth audio transmission method as described above.
  • the present application also proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a Bluetooth audio transmission control program, and the Bluetooth audio transmission control program is implemented when executed by a processor. Steps of the Bluetooth audio transmission method as described above.
  • each of the request messages is obtained.
  • a designated Bluetooth audio input source and an audio output source wherein the Bluetooth audio input source specified in each of the request messages is associated with the audio output source, and a corresponding process or thread is started for each of the request messages Reading Bluetooth audio data from the Bluetooth audio input source with the process or thread, and buffering the Bluetooth audio data to a buffer space in real time, and reading the Bluetooth audio corresponding to each of the request messages from the buffer space Data and send it to the associated audio output source.
  • this application By receiving multiple requests for obtaining Bluetooth audio data, this application obtains corresponding Bluetooth audio data from each audio input source according to the requested instructions, and transmits the Bluetooth audio data to the associated audio output source, thereby realizing the acquisition from multiple audio input sources.
  • Bluetooth audio data is provided to multiple applications, so as to meet the audio transmission needs in different application scenarios.
  • FIG. 1 is a schematic structural diagram of a terminal in a hardware operating environment according to a solution of an embodiment of the present application
  • FIG. 2 is a schematic flowchart of a first embodiment of a Bluetooth audio transmission method of the present application
  • FIG. 3 is a schematic flowchart of a second embodiment of a Bluetooth audio transmission method according to the present application.
  • FIG. 4 is a schematic flowchart of a third embodiment of a Bluetooth audio transmission method of the present application.
  • FIG. 5 is a schematic flowchart of a fourth embodiment of a Bluetooth audio transmission method of the present application.
  • the main solution of the embodiment of the present application is: when receiving multiple requests for acquiring Bluetooth audio data, acquiring an audio input source and an audio output source corresponding to each of the requests; and acquiring each channel from each of the audio input sources. Bluetooth audio data; transmitting each of the Bluetooth audio data to the audio output source.
  • the smart TV system has not been able to achieve Bluetooth software data from multiple audio input sources to multiple applications in software, which cannot meet the audio transmission requirements in different application scenarios.
  • the present application provides a solution by receiving multiple requests for obtaining Bluetooth audio data, acquiring corresponding Bluetooth audio data from each audio input source according to the request indication, and transmitting the Bluetooth audio data to an associated audio output source, thereby realizing Multiple audio input sources acquire Bluetooth audio data to multiple applications, thereby meeting the audio transmission needs in different application scenarios.
  • FIG. 1 is a schematic structural diagram of a terminal in a hardware operating environment involved in the solution of the embodiment of the present application.
  • the terminal is a Bluetooth audio transmission device.
  • the Bluetooth audio transmission device may include a processor 1001, such as a CPU, a communication bus 1002, a Bluetooth module 1003, and a memory 1004.
  • the communication bus 1002 is used to implement connection and communication between these components.
  • the memory 1004 may be a high-speed RAM memory or a non-volatile memory. memory), such as disk storage.
  • the memory 1004 may optionally be a storage device independent of the foregoing processor 1001.
  • terminal structure shown in FIG. 1 does not constitute a limitation on the terminal, and may include more or fewer components than shown in the figure, or some components may be combined, or different component arrangements.
  • the memory 1004 as a computer storage medium may include an operating system and a Bluetooth audio transmission control application program.
  • the processor 1001 may be used to call a Bluetooth audio transmission control program stored in the memory 1004 and perform the following operations:
  • the Bluetooth audio input source and audio output source specified in each of the request messages are obtained separately, where the Bluetooth audio specified in each of the request messages is obtained
  • An input source is associated with the audio output source
  • the Bluetooth audio data corresponding to each of the request messages is read from the buffer space and sent to the associated audio output source.
  • processor 1001 may call the Bluetooth audio transmission control program stored in the memory 1004, and further perform the following operations:
  • the default audio input source is turned off.
  • processor 1001 may call the Bluetooth audio transmission control program stored in the memory 1004, and further perform the following operations:
  • audio data is obtained from the default audio input source.
  • processor 1001 may call the Bluetooth audio transmission control program stored in the memory 1004, and further perform the following operations:
  • processor 1001 may call the Bluetooth audio transmission control program stored in the memory 1004, and further perform the following operations:
  • the acquired audio data is output from the default audio output device.
  • processor 1001 may call the Bluetooth audio transmission control program stored in the memory 1004, and further perform the following operations:
  • the system After the system is started, it is detected whether a request for obtaining Bluetooth audio data is received from an application program, wherein the system is a system to which the method of Bluetooth audio transmission is applied, and the application program runs in the system.
  • processor 1001 may call the Bluetooth audio transmission control program stored in the memory 1004, and further perform the following operations:
  • the audio output source with the highest priority is used as the target audio output source.
  • processor 1001 may call the Bluetooth audio transmission control program stored in the memory 1004, and further perform the following operations:
  • processor 1001 may call the Bluetooth audio transmission control program stored in the memory 1004, and further perform the following operations:
  • processor 1001 may call the Bluetooth audio transmission control program stored in the memory 1004, and further perform the following operations:
  • the audio output function of the default audio output device is turned off.
  • processor 1001 may call the Bluetooth audio transmission control program stored in the memory 1004, and further perform the following operations:
  • the Bluetooth audio data is buffered into a buffer space at the corresponding buffer rate in real time.
  • processor 1001 may call the Bluetooth audio transmission control program stored in the memory 1004, and further perform the following operations:
  • the cache space is a preset memory space.
  • processor 1001 may call the Bluetooth audio transmission control program stored in the memory 1004, and further perform the following operations:
  • the buffer space is determined according to a memory hardware and a memory allocation situation in which the Bluetooth audio transmission system is applied.
  • processor 1001 may call the Bluetooth audio transmission control program stored in the memory 1004, and further perform the following operations:
  • the buffer space is determined according to a transmission delay requirement of an application program that sends the request message.
  • processor 1001 may call the Bluetooth audio transmission control program stored in the memory 1004, and further perform the following operations:
  • the transmission request message queue is queried in real time, and the Bluetooth audio transmission request messages in the transmission request message queue are processed in chronological order.
  • processor 1001 may call the Bluetooth audio transmission control program stored in the memory 1004, and further perform the following operations:
  • processor 1001 may call the Bluetooth audio transmission control program stored in the memory 1004, and further perform the following operations:
  • a connection is established with the associated audio output source.
  • a first embodiment of the present application provides a method for Bluetooth audio transmission.
  • the method includes:
  • Step S10 When receiving a plurality of application request messages for obtaining Bluetooth audio data, obtain a Bluetooth audio input source and an audio output source specified in each of the request messages, respectively.
  • the Bluetooth audio input source is associated with the audio output source.
  • Audio devices can be electronic devices such as televisions, computers or mobile phones. The following description uses a television as an example.
  • the audio input source of the TV includes a TV program, a remote control or a mobile phone with a Bluetooth function; the audio output source of the TV includes a TV speaker, a Bluetooth speaker, a Bluetooth headset, and an application process running in a TV operating system.
  • the television processing system includes an audio input interface unit, a Bluetooth processing unit, and an audio service unit.
  • the audio input interface unit is responsible for receiving Bluetooth audio data in the received TV signal, and there is a hardware connection between the audio input interface unit and the TV speaker, that is, the audio input interface unit outputs the Bluetooth audio data in the TV program to the TV via the hardware connection Speaker for audio playback.
  • the Bluetooth processing unit is responsible for receiving and processing Bluetooth audio signals from a Bluetooth remote control or a mobile phone.
  • the audio service unit is responsible for obtaining Bluetooth audio data from the audio input interface unit or the Bluetooth processing unit and outputting it to a TV speaker, Bluetooth speaker, Bluetooth headset, or application process.
  • a unique identifier is defined for each audio input source and each audio output source, for each processing unit to identify, for example:
  • AUDIO_OUT_DEVICE_SPEAKER 0x0002;
  • AUDIO_OUT_DEVICE_BT_SPEAKER 0x0008;
  • AUDIO_OUT_DEVICE_APP 0x0010.
  • Audio input device is TV:
  • AUDIO_IN_DEVICE_TV 0x1002
  • the audio input device is a Bluetooth remote control:
  • the audio input device is a Bluetooth phone:
  • AUDIO_IN_DEVICE_BT_PHONE 0x1008.
  • the audio service unit provides a Bluetooth audio transmission interface and is called by a process to issue a Bluetooth audio data transmission request message.
  • the Bluetooth audio transmission interface parameters include audio input source parameters and audio output source parameters, where the audio input source parameters and audio output source parameters need to be assigned with the above-mentioned audio device identification for the interface caller to specify the corresponding Bluetooth audio transmission. Audio input source and audio output source.
  • each application process calls the Bluetooth audio transmission interface to send a separate Bluetooth audio transmission request message to the audio service unit.
  • the audio service unit queries the queue in real time, and processes the Bluetooth audio transmission request messages in the queue one by one in order of time, and obtains the audio input source and audio output source corresponding to each Bluetooth audio transmission request message.
  • Step S20 Start a corresponding process or thread for each of the request messages, use the process or thread to read Bluetooth audio data from the Bluetooth audio input source, and cache the Bluetooth audio data to a buffer space in real time.
  • the audio service unit After acquiring the audio input source and audio output source corresponding to each Bluetooth audio transmission request message, the audio service unit acquires each channel of Bluetooth audio data from each audio input source. Specifically, the audio service unit may notify the audio interface input unit and trigger the audio interface input unit to transmit the received Bluetooth audio data of the audio input source to the audio service unit or buffer it to a designated memory space; the audio service unit may also actively and The audio interface input unit establishes a connection, reads the Bluetooth audio data of the audio input source received by the audio interface input unit, and buffers the Bluetooth audio data to a preset memory space.
  • the audio service unit when it receives the request message transmitted by the application program through the Bluetooth audio transmission interface, it starts a corresponding process or thread for the audio input source specified by each request message, and uses the process or thread corresponding to each audio input source. The thread obtains each Bluetooth audio data.
  • step S30 the Bluetooth audio data corresponding to each of the request messages is read from the buffer space and sent to the associated audio output source.
  • the audio service unit After the audio service unit obtains each Bluetooth audio data, it transmits each Bluetooth audio data unit to the corresponding audio output source. Specifically, the audio service unit may establish a connection with the corresponding audio output source, read the Bluetooth audio data in the buffer and transmit it to the corresponding audio output source; the audio service unit may also notify the corresponding audio output source and trigger the audio The output source actively reads the Bluetooth audio data in the buffer to complete the transmission.
  • the request message corresponds to multiple channels of Bluetooth audio data
  • multiple Bluetooth input sources are specified in the request message, and multiple processes or threads are started to obtain multiple channels of Bluetooth audio data.
  • the user needs to be reminded how many The situation of mixing Bluetooth audio; after mixing multiple channels of Bluetooth audio data, sending the mixed Bluetooth audio data to the associated audio output source.
  • the corresponding Bluetooth audio data is obtained from the audio input source according to the request instruction, and the corresponding Bluetooth audio data is transmitted to the associated audio output source, so that multiple channels are realized.
  • the audio input source obtains Bluetooth audio data to multiple applications, so as to meet the audio transmission requirements in different application scenarios.
  • the second embodiment of the present application provides a method for Bluetooth audio transmission based on the first embodiment.
  • the steps of this embodiment include:
  • step S40 when multiple requests for acquiring Bluetooth audio data are not received, it is detected whether there are audio input sources other than the default audio input source.
  • the TV program is the default audio input source of the TV.
  • the TV system starts up, it first checks whether it has received a request for Bluetooth audio data from the application. When no request for Bluetooth audio data is received from the application, it indicates that the existing audio input source cannot be known through the application's call to the Bluetooth audio transmission interface. At this time, another process needs to be entered, that is, detecting whether there is a default audio An audio input source other than the input source.
  • step S50 if an audio input source other than the default audio input source is detected, the default audio input source is closed.
  • the control module in the audio service unit controls to close the default audio input source.
  • the TV system will obtain Bluetooth audio data from the default audio input source.
  • an audio input source other than the default audio input source is not detected, it is also necessary to detect whether there is an audio output source other than the default audio output device.
  • an audio output source other than the default audio output device such as a Bluetooth headset or a Bluetooth speaker
  • the audio output function of the default audio output device is turned off.
  • the control module in the audio service unit controls to turn off the audio output function of the default audio output device.
  • a third embodiment of the present application provides a method for Bluetooth audio transmission based on the first embodiment or the second embodiment.
  • this embodiment includes:
  • step S60 when each of the audio output sources is not a default audio output device, the audio output function of the default audio output device is turned off.
  • the audio service unit After acquiring the audio input source and audio output source corresponding to each Bluetooth audio transmission request message, the audio service unit detects whether there is a default audio output device in each audio output source. When it is detected that each audio output source is not the default audio output device, the audio output function of the default audio output device is turned off. Specifically, the control module in the audio service unit controls to turn off the audio output function of the default audio output device.
  • the audio output device with the highest priority among the audio output devices can be used as the audio output source, that is, multiple channels.
  • Bluetooth audio data are all output from the highest priority audio output device.
  • the acquired audio input source is prevented from being output from the default audio output device.
  • step S20 includes:
  • Step S70 Start a corresponding process or thread for each of the request messages, and use the process or thread to read Bluetooth audio data from the Bluetooth audio input source.
  • Step S80 Obtain a cache rate corresponding to each of the requests.
  • step S90 the Bluetooth audio data is cached in a cache space at the corresponding cache rate in real time.
  • the interface parameters of the Bluetooth audio transmission interface provided by the audio service unit to the application process, in addition to the audio input source parameters and audio output source parameters, it can also include the buffer space address, that is, when the application process calls the interface, the buffer space address Specify the buffer space corresponding to the acquired Bluetooth audio data.
  • the address range of the cache space that can be specified is obtained according to the system memory hardware and memory allocation, and different levels of memory addresses can be specified according to the requirements of different applications on the transmission delay.
  • the buffer rate can also be included, that is, the application can call the interface through
  • the cache rate specifies the cache rate used when acquiring Bluetooth audio data.
  • the audio service unit receives the request transmitted by the application program through the Bluetooth audio transmission interface, it obtains the cache rate corresponding to the Bluetooth audio data from the request, obtains the Bluetooth audio data from the audio input source, and uses the Bluetooth audio data at the corresponding cache rate Cache to the corresponding cache space.
  • each channel of the Bluetooth audio data is obtained from each of the audio input sources, and each channel of the Bluetooth audio data is cached to the corresponding channel.
  • Buffer space while supporting multiple Bluetooth audio inputs, the overall performance of Bluetooth audio transmission can be improved by optimizing and upgrading the buffer space of Bluetooth audio data.
  • the application also provides a Bluetooth audio transmission device.
  • the device includes: a memory, a processor, a Bluetooth module, and a Bluetooth audio transmission control program stored on the memory and executable on the processor.
  • the Bluetooth audio When the transmission control program is executed by the processor, the steps of the Bluetooth audio transmission method are implemented.
  • an embodiment of the present application further provides a computer-readable storage medium.
  • the computer-readable storage medium stores a Bluetooth audio transmission control program, and the Bluetooth audio transmission control program implements the Bluetooth audio when the processor executes the Bluetooth audio transmission control program. Steps of the transfer method.

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Automation & Control Theory (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)

Abstract

本申请公开了一种蓝牙音频传输的方法,包括:在接收到多个应用获取蓝牙音频数据的请求消息时,分别获取每个所述请求消息中指定的蓝牙音频输入源和音频输出源,其中,每个所述请求消息中指定的所述蓝牙音频输入源与所述音频输出源相关联;为每个所述请求消息启动对应的进程或线程,以所述进程或线程从所述蓝牙音频输入源读取蓝牙音频数据,并实时将所述蓝牙音频数据缓存到缓存空间;从所述缓存空间读取每个所述请求消息对应的蓝牙音频数据,并发送给关联的所述音频输出源。本申请还公开了一种蓝牙音频传输装置和计算机可读存储介质。本申请通过实现从多路音频输入源获取蓝牙音频数据给多个应用,从而满足不同应用场景下的音频传输需求。

Description

蓝牙音频传输方法、装置及计算机可读存储介质
技术领域
本申请涉及智能电视技术领域,尤其涉及一种蓝牙音频传输方法、蓝牙音频传输装置及计算机可读存储介质。
背景技术
随着智能电视技术的发展,智能电视的音频输入源越来越多,包括智能电视节目的音频输入,带录音功能的蓝牙遥控器和带蓝牙模块的手机等。同时智能电视的音频输出源也越来越多,包括智能电视喇叭、蓝牙音箱、蓝牙耳机和软件应用等。
当智能电视拥有的音频输入源尤其是蓝牙音频输入源的增多,应用场景也变得丰富而复杂。例如用户希望在用智能电视欣赏音乐MV的同时使用蓝牙遥控器和朋友聊天,智能电视机需要同时从电视信源和蓝牙遥控器获取音频数据,并将蓝牙遥控器获取的蓝牙音频数据传输给聊天应用软件;例如蓝牙遥控器在语音识别功能实现中,语音识别应用需要获取蓝牙遥控器的蓝牙音频数据并将其传输到云端进行解析等。在现有技术中,智能电视系统还未能在软件上实现从多路音频输入源获取蓝牙音频数据给多个应用,满足不了不同应用场景下的音频传输需求。
上述内容仅用于辅助理解本申请的技术方案,并不代表承认上述内容是现有技术。
发明内容
本申请的主要目的在于提供一种蓝牙音频传输的方法、蓝牙音频传输的装置和计算机可读存储介质,旨在解决上述背景技术中所描述的现有技术在蓝牙音频传输中的技术问题。
为实现上述目的,本申请提供一种蓝牙音频传输的方法,所述蓝牙音频传输的方法包括如下步骤:
在接收到多个应用获取蓝牙音频数据的请求消息时,分别获取每个所述请求消息中指定的蓝牙音频输入源和音频输出源,其中,每个所述请求消息中指定的所述蓝牙音频输入源与所述音频输出源相关联;
为每个所述请求消息启动对应的进程或线程,以所述进程或线程从所述蓝牙音频输入源读取蓝牙音频数据,并实时将所述蓝牙音频数据缓存到缓存空间;以及
从所述缓存空间读取每个所述请求消息对应的蓝牙音频数据,并发送给关联的所述音频输出源。
可选地,所述蓝牙音频传输的方法还包括以下步骤:
当没有接收到获取蓝牙音频数据的请求时,检测是否有默认音频输入源以外的音频输入源;以及
若检测到所述默认音频输入源以外的音频输入源,关闭所述默认音频输入源。
可选地,所述当没有接收到获取蓝牙音频数据的请求时,检测是否有默认音频输入源以外的音频输入源的步骤之后还包括:
若没有检测到默认音频输入源以外的音频输入源,从所述默认的音频输入源获取音频数据。
可选地,所述当没有接收到获取蓝牙音频数据的请求时,检测是否有默认音频输入源以外的音频输入源的步骤之后还包括:
检测是否有默认音频输出设备以外的音频输出源;以及
若有所述默认音频输出设备以外的音频输出源,关闭所述默认音频输出设备的音频输出功能。
可选地,所述检测是否有默认音频输出设备以外的音频输出源的步骤之后还包括:
若没有所述默认音频输出设备以外的音频输出源,将获取的音频数据从所述默认音频输出设备输出。
可选地,所述当没有接收到获取蓝牙音频数据的请求时,检测是否有默认音频输入源以外的音频输入源的步骤之前包括:
在系统启动之后,检测是否接收来自应用程序的获取蓝牙音频数据的请求,其中,所述系统为应用所述蓝牙音频传输的方法的系统,所述应用程序运行于所述系统中。
可选地,所述若有所述默认音频输出设备以外的音频输出源,关闭所述默认音频输出设备的音频输出功能的步骤之后还包括:
若有多个所述默认音频输出设备以外的音频输出源,将优先级最高的所述音频输出源作为目标音频输出源。
可选地,所述若有多个所述默认音频输出设备以外的音频输出源,将优先级最高的所述音频输出源作为目标音频输出源的步骤之后还包括:
若有多个所述默认音频输出设备以外的音频输出源,将所述请求消息对应的多路蓝牙音频数据从所述目标音频输出源输出。
可选地,所述从所述缓存空间读取每个所述请求消息对应的蓝牙音频数据,并发送给关联的所述音频输出源的步骤包括:
当所述请求消息对应有多路蓝牙音频数据时,提示用户有多路蓝牙音频混音的情况;以及
将所述多路蓝牙音频数据进行混音,并将混音后的蓝牙音频数据发送给关联的所述音频输出源。
可选地,所述在接收到多个应用获取蓝牙音频数据的请求消息时,获取每个所述请求消息中指定的音频输入源和音频输出源的步骤之后还包括:
当所述请求消息中指定的音频输出源不是默认音频输出设备时,关闭所述默认的音频输出设备的音频输出功能。
可选地,所述从各个所述音频输入源读取各个所述请求对应的蓝牙音频数据,并实时将所述蓝牙音频数据缓存到缓存空间的步骤包括:
为每个所述请求消息启动对应的进程或线程,以所述进程或线程从所述蓝牙音频输入源读取蓝牙音频数据;
获取每个所述请求对应的缓存速率;以及
实时将所述蓝牙音频数据以所述对应的缓存速率缓存到缓存空间。
可选地,所述缓存空间为预设的内存空间。
可选地,所述根据应用所述蓝牙音频传输系统的内存硬件和内存分配的情况确定所述缓存空间。
可选地,根据发送所述请求消息的应用程序对传输延迟的要求确定所述缓存空间。
可选地,所述蓝牙音频传输的方法还包括以下步骤:
实时查询传输请求消息队列,按照时间先后顺序处理所述传输请求消息队列中的蓝牙音频传输请求消息。
可选地,所述在接收到多个应用获取蓝牙音频数据的请求消息时,分别获取每个所述请求消息中指定的蓝牙音频输入源和音频输出源的步骤包括:
在接收到多个应用获取蓝牙音频数据的请求消息时,解析所述请求消息中得到音频输入源标识和音频输出源标识;以及
根据所述音频输入源和所述音频输出源标识确定所述请求消息中指定的蓝牙音频输入源和音频输出源。
可选地,所述从所述缓存空间读取每个所述请求消息对应的蓝牙音频数据,并发送给关联的所述音频输出源的步骤之前还包括:
与关联的所述音频输出源建立连接。
可选地,所述音频输出源包括蓝牙设备和运行于系统中的应用进程。
此外,为实现上述目的,本申请还提供所述蓝牙音频传输装置,该装置包括:存储器、处理器、蓝牙模组及存储在所述存储器上并可在所述处理器上运行的蓝牙音频传输控制程序,所述蓝牙音频传输控制程序被所述处理器执行时实现如上所述的蓝牙音频传输方法的步骤。
此外,为实现上述目的,本申请还提出一种计算机可读存储介质,其中,所述计算机可读存储介质上存储有蓝牙音频传输控制程序,所述蓝牙音频传输控制程序被处理器执行时实现如上所述的蓝牙音频传输方法的步骤。
本申请实施例提出的一种蓝牙音频传输的方法、蓝牙音频传输的装置和计算机可读存储介质,在接收到多个应用获取蓝牙音频数据的请求消息时,分别获取每个所述请求消息中指定的蓝牙音频输入源和音频输出源,其中,每个所述请求消息中指定的所述蓝牙音频输入源与所述音频输出源相关联,为每个所述请求消息启动对应的进程或线程,以所述进程或线程从所述蓝牙音频输入源读取蓝牙音频数据,并实时将所述蓝牙音频数据缓存到缓存空间,从所述缓存空间读取每个所述请求消息对应的蓝牙音频数据,并发送给关联的所述音频输出源。
本申请通过接收多个获取蓝牙音频数据的请求,根据请求的指示从各个音频输入源获取对应的蓝牙音频数据,并将蓝牙音频数据传输给关联的音频输出源,实现从多路音频输入源获取蓝牙音频数据给多个应用,从而满足不同应用场景下的音频传输需求。
附图说明
图1是本申请实施例方案涉及的硬件运行环境的终端结构示意图;
图2为本申请蓝牙音频传输方法第一实施例的流程示意图;
图3为本申请蓝牙音频传输方法第二实施例的流程示意图;
图4为本申请蓝牙音频传输方法第三实施例的流程示意图;
图5为本申请蓝牙音频传输方法第四实施例的流程示意图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请实施例的主要解决方案是:在接收到多个获取蓝牙音频数据的请求时,获取各个所述请求对应的音频输入源和音频输出源;从各个所述音频输入源获取各路所述蓝牙音频数据;将各路所述蓝牙音频数据传输给所述音频输出源。
由于现有技术中,智能电视系统还未能在软件上实现从多路音频输入源获取蓝牙音频数据给多个应用,满足不了不同应用场景下的音频传输需求。
本申请提供一种解决方案,通过接收多个获取蓝牙音频数据的请求,根据请求的指示从各个音频输入源获取对应的蓝牙音频数据,并将蓝牙音频数据传输给关联的音频输出源,实现从多路音频输入源获取蓝牙音频数据给多个应用,从而满足不同应用场景下的音频传输需求。
如图1所示,图1是本申请实施例方案涉及的硬件运行环境的终端结构示意图。
本申请实施例终端为蓝牙音频传输装置。
如图1所示,该蓝牙音频传输装置可以包括:处理器1001,例如CPU,通信总线1002,蓝牙模组1003,存储器1004。其中,通信总线1002用于实现这些组件之间的连接通信。存储器1004可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1004可选的还可以是独立于前述处理器1001的存储装置。
本领域技术人员可以理解,图1中示出的终端结构并不构成对终端的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
如图1所示,作为一种计算机存储介质的存储器1004中可以包括操作系统和蓝牙音频传输控制应用程序。
在图1所示的装置中,处理器1001可以用于调用存储器1004中存储的蓝牙音频传输控制程序,并执行以下操作:
在接收到多个应用获取蓝牙音频数据的请求消息时,分别获取每个所述请求消息中指定的蓝牙音频输入源和音频输出源,其中,每个所述请求消息中指定的所述蓝牙音频输入源与所述音频输出源相关联;
为每个所述请求消息启动对应的进程或线程,以所述进程或线程从所述蓝牙音频输入源读取蓝牙音频数据,并实时将所述蓝牙音频数据缓存到缓存空间;
从所述缓存空间读取每个所述请求消息对应的蓝牙音频数据,并发送给关联的所述音频输出源。
进一步地,处理器1001可以调用存储器1004中存储的蓝牙音频传输控制程序,还执行以下操作:
当没有接收到获取蓝牙音频数据的请求时,检测是否有默认音频输入源以外的音频输入源;以及
若检测到所述默认音频输入源以外的音频输入源,关闭所述默认音频输入源。
进一步地,处理器1001可以调用存储器1004中存储的蓝牙音频传输控制程序,还执行以下操作:
若没有检测到默认音频输入源以外的音频输入源,从所述默认的音频输入源获取音频数据。
进一步地,处理器1001可以调用存储器1004中存储的蓝牙音频传输控制程序,还执行以下操作:
检测是否有默认音频输出设备以外的音频输出源;以及
若有所述默认音频输出设备以外的音频输出源,关闭所述默认音频输出设备的音频输出功能。
进一步地,处理器1001可以调用存储器1004中存储的蓝牙音频传输控制程序,还执行以下操作:
若没有所述默认音频输出设备以外的音频输出源,将获取的音频数据从所述默认音频输出设备输出。
进一步地,处理器1001可以调用存储器1004中存储的蓝牙音频传输控制程序,还执行以下操作:
在系统启动之后,检测是否接收来自应用程序的获取蓝牙音频数据的请求,其中,所述系统为应用所述蓝牙音频传输的方法的系统,所述应用程序运行于所述系统中。
进一步地,处理器1001可以调用存储器1004中存储的蓝牙音频传输控制程序,还执行以下操作:
若有多个所述默认音频输出设备以外的音频输出源,将优先级最高的所述音频输出源作为目标音频输出源。
进一步地,处理器1001可以调用存储器1004中存储的蓝牙音频传输控制程序,还执行以下操作:
若有多个所述默认音频输出设备以外的音频输出源,将所述请求消息对应的多路蓝牙音频数据从所述目标音频输出源输出。
进一步地,处理器1001可以调用存储器1004中存储的蓝牙音频传输控制程序,还执行以下操作:
当所述请求消息对应有多路蓝牙音频数据时,提示用户有多路蓝牙音频混音的情况;
将所述多路蓝牙音频数据进行混音,并将混音后的蓝牙音频数据发送给关联的所述音频输出源。
进一步地,处理器1001可以调用存储器1004中存储的蓝牙音频传输控制程序,还执行以下操作:
当所述请求消息中指定的音频输出源不是默认音频输出设备时,关闭所述默认的音频输出设备的音频输出功能。
进一步地,处理器1001可以调用存储器1004中存储的蓝牙音频传输控制程序,还执行以下操作:
为每个所述请求消息启动对应的进程或线程,以所述进程或线程从所述蓝牙音频输入源读取蓝牙音频数据;
获取每个所述请求对应的缓存速率;以及
实时将所述蓝牙音频数据以所述对应的缓存速率缓存到缓存空间。
进一步地,处理器1001可以调用存储器1004中存储的蓝牙音频传输控制程序,还执行以下操作:
所述缓存空间为预设的内存空间。
进一步地,处理器1001可以调用存储器1004中存储的蓝牙音频传输控制程序,还执行以下操作:
所述根据应用所述蓝牙音频传输系统的内存硬件和内存分配的情况确定所述缓存空间。
进一步地,处理器1001可以调用存储器1004中存储的蓝牙音频传输控制程序,还执行以下操作:
根据发送所述请求消息的应用程序对传输延迟的要求确定所述缓存空间。
进一步地,处理器1001可以调用存储器1004中存储的蓝牙音频传输控制程序,还执行以下操作:
实时查询传输请求消息队列,按照时间先后顺序处理所述传输请求消息队列中的蓝牙音频传输请求消息。
进一步地,处理器1001可以调用存储器1004中存储的蓝牙音频传输控制程序,还执行以下操作:
在接收到多个应用获取蓝牙音频数据的请求消息时,解析所述请求消息中得到音频输入源标识和音频输出源标识;以及
根据所述音频输入源和所述音频输出源标识确定所述请求消息中指定的蓝牙音频输入源和音频输出源。
进一步地,处理器1001可以调用存储器1004中存储的蓝牙音频传输控制程序,还执行以下操作:
与关联的所述音频输出源建立连接。
参照图2,本申请第一实施例提供一种蓝牙音频传输的方法,所述方法包括:
步骤S10,在接收到多个应用获取蓝牙音频数据的请求消息时,分别获取每个所述请求消息中指定的蓝牙音频输入源和音频输出源,其中,每个所述请求消息中指定的所述蓝牙音频输入源与所述音频输出源相关联。
在具备音频处理功能的设备中,存在多个音频输入源和音频输出源。音频设备可以是电视机、电脑或手机等电子设备。下面以电视机为例进行说明。
电视机的音频输入源包括电视节目、具有蓝牙功能的遥控器或手机;电视机的音频输出源包括电视喇叭、蓝牙音箱、蓝牙耳机和运行于电视机操作系统中的应用进程。
和上述多音频输入源及多音频输出源相对应的,电视机处理系统包括音频输入接口单元、蓝牙处理单元和音频服务单元。音频输入接口单元负责接收到的电视信号中的蓝牙音频数据,并且音频输入接口单元和电视喇叭之间存在硬件连接,即音频输入接口单元将电视节目中的蓝牙音频数据经由该硬件连接输出到电视喇叭进行音频播放。蓝牙处理单元负责接收和处理蓝牙遥控器或手机的蓝牙音频信号。音频服务单元负责从音频输入接口单元或蓝牙处理单元获取蓝牙音频数据,并将其输出到电视喇叭、蓝牙音箱、蓝牙耳机或应用进程。
在系统中,为每个音频输入源和每个音频输出源定义唯一的标识,供各处理单元进行识别,例如:
1)音频输出设备
音频输出到电视喇叭设备标识:
AUDIO_OUT_DEVICE_SPEAKER = 0x0002;
音频输出到LINE OUT设备标识(有线耳机或音箱):
AUDIO_OUT_DEVICE_LINE_OUT = 0x0004;
音频输出到蓝牙音箱或蓝牙耳机标识:
AUDIO_OUT_DEVICE_BT_SPEAKER = 0x0008;
音频输出到应用进程标识:
AUDIO_OUT_DEVICE_APP = 0x0010。
2)音频输入设备
音频输入设备为电视:
AUDIO_IN_DEVICE_TV = 0x1002;
音频输入设备为蓝牙遥控器:
AUDIO_IN_DEVICE_BT_REMOTECONTROL = 0x1004,
音频输入设备为蓝牙手机:
AUDIO_IN_DEVICE_BT_PHONE = 0x1008。
音频服务单元提供蓝牙音频传输接口供应用进程调用,以发出蓝牙音频数据传输请求消息。该蓝牙音频传输接口参数包括音频输入源参数和音频输出源参数,其中音频输入源参数和音频输出源参数均需以上述音频设备标识进行赋值,以供接口调用方指定本次蓝牙音频传输对应的音频输入源和音频输出源。
当多个应用进程需要获取蓝牙音频数据时,各个应用进程调用该蓝牙音频传输接口向音频服务单元发出单独的蓝牙音频传输请求消息。在内存中建立传输请求消息队列,以缓存多个应用程序发出的多个蓝牙音频传输请求消息。音频服务单元实时查询该队列,并按照时间先后顺序一一处理队列中的蓝牙音频传输请求消息,获取每个蓝牙音频传输请求消息对应的音频输入源和音频输出源。
步骤S20,为每个所述请求消息启动对应的进程或线程,以所述进程或线程从所述蓝牙音频输入源读取蓝牙音频数据,并实时将所述蓝牙音频数据缓存到缓存空间。
音频服务单元在获取了每个蓝牙音频传输请求消息对应的音频输入源和音频输出源之后,从各个音频输入源获取各路蓝牙音频数据。具体地,音频服务单元可以通知音频接口输入单元,触发音频接口输入单元将接收到的音频输入源的蓝牙音频数据传输给音频服务单元或缓存到其指定的内存空间;音频服务单元也可以主动和音频接口输入单元建立连接,读取音频接口输入单元接收到的音频输入源的蓝牙音频数据,并将蓝牙音频数据缓存到预设的内存空间。
具体地,音频服务单元在接收到应用程序通过蓝牙音频传输接口传递的请求消息时,为每个请求消息所指定的音频输入源启动对应的进程或线程,以每个音频输入源对应的进程或线程获取每路蓝牙音频数据。
步骤S30,从所述缓存空间读取每个所述请求消息对应的蓝牙音频数据,并发送给关联的所述音频输出源。
音频服务单元在获取到各路蓝牙音频数据后,将各路蓝牙音频数据单元传输给对应的音频输出源。具体地,音频服务单元可以和对应的音频输出源建立连接,读取缓存中的蓝牙音频数据并将其传输给对应的音频输出源;音频服务单元也可以通知对应的音频输出源,触发该音频输出源主动读取缓存中的蓝牙音频数据,以完成传输。
进一步地,当请求消息对应有多路蓝牙音频数据时,即请求消息中指定了多个蓝牙输入源,对应启动了多个进程或线程获取到了多路蓝牙音频数据,此时需要提示用户有多路蓝牙音频混音的情况;在将多路蓝牙音频数据进行混音后,将混音后的蓝牙音频数据发送给关联的音频输出源。
在本实施例中,通过接收多个获取蓝牙音频数据的请求,根据请求的指示从音频输入源获取对应蓝牙音频数据,并将对应的蓝牙音频数据传输给关联的音频输出源,实现从多路音频输入源获取蓝牙音频数据给多个应用,从而满足不同应用场景下的音频传输需求。
进一步的,参照图3,本申请第二实施例基于第一实施例提供一种蓝牙音频传输的方法,本实施例的步骤包括:
步骤S40,当没有接收到多个获取蓝牙音频数据的请求时,检测是否有默认音频输入源以外的音频输入源。
以电视机为例,电视节目为电视机默认的音频输入源。当电视机系统启动起来之后,先检测是否收到来自应用程序的获取蓝牙音频数据的请求。当没有接收到来自应用程序的获取蓝牙音频数据的请求时,表明无法通过应用程序对蓝牙音频传输接口的调用来知晓存在的音频输入源,此时需要进入另一个流程,即检测是否有默认音频输入源以外的音频输入源。
步骤S50,若检测到所述默认音频输入源以外的音频输入源,关闭所述默认音频输入源。
当检测到默认音频输入源以外的音频输入源时,例如检测到蓝牙遥控器或蓝牙手机时,为了避免默认音频输入源和其他音频输入源的混音,需要关闭默认音频输入源。具体地,由音频服务单元中的控制模块控制关闭默认音频输入源。
如果没有检测到默认音频输入源以外的音频输入源,电视机系统将从默认的音频输入源获取蓝牙音频数据。
在本实施例中,若没有检测到默认音频输入源以外的音频输入源,还需要检测是否有默认音频输出设备以外的音频输出源。当检测到有所述默认音频输出设备以外的音频输出源,例如蓝牙耳机或蓝牙音箱时,关闭默认音频输出设备的音频输出功能。具体地,由音频服务单元中的控制模块控制关闭默认音频输出设备的音频输出功能。
若没有检测到默认音频输出设备以外的音频输出源,所有获取的蓝牙音频数据都从默认的音频输出源输出。
在本实施例中,在没有接收到多个获取蓝牙音频数据的请求时,检测是否有默认音频输入源以外的音频输入源,当检测到所述默认音频输入源以外的音频输入源时关闭默认音频输入源,避免默认音频输入源和其他音频输入源的混音。
进一步的,参照图4,本申请第三实施例基于第一实施例或第二实施例提供一种蓝牙音频传输的方法,本实施例在步骤S10之后包括:
步骤S60,当各个所述音频输出源均不是默认音频输出设备时,关闭所述默认的音频输出设备的音频输出功能。
音频服务单元在获取了各个蓝牙音频传输请求消息对应的音频输入源和音频输出源之后,检测各个音频输出源中是否有默认音频输出设备。当检测到各个音频输出源均不是默认音频输出设备时,关闭默认音频输出设备的音频输出功能。具体地,由音频服务单元中的控制模块控制关闭默认音频输出设备的音频输出功能。
此外,从简化处理和降低处理复杂度角度考虑,当各个音频输出源是多个不同的音频输出设备时,可以将各个音频输出设备中优先级最高的音频输出设备作为音频输出源,即多路的蓝牙音频数据都统一从优先级最高的音频输出设备输出。
在本实施例中,通过当各个所述音频输出源均不是默认音频输出设备时关闭所述默认的音频输出设备的音频输出功能,避免获取的音频输入源从默认的音频输出设备输出。
进一步的,参照图5,本申请第四实施例基于第一实施至第三实施例任一实施例提供一种蓝牙音频传输的方法,本实施例在步骤S20包括:
步骤S70,为每个所述请求消息启动对应的进程或线程,以所述进程或线程从所述蓝牙音频输入源读取蓝牙音频数据。
步骤S80,获取每个所述请求对应的缓存速率。
步骤S90,实时将所述蓝牙音频数据以所述对应的缓存速率缓存到缓存空间。
在音频服务单元提供给应用进程调用的蓝牙音频传输接口的接口参数中,除了音频输入源参数和音频输出源参数,还可以包括缓存空间地址,即应用进程调用该接口时可以通过该缓存空间地址指定获取的蓝牙音频数据对应的缓存空间。可指定的缓存空间地址范围根据系统内存硬件和内存分配的情况而得,并且可以根据不同应用程序对传输延迟的要求,指定不同等级的内存地址。
在音频服务单元提供给应用进程调用的蓝牙音频传输接口的接口参数中,除了音频输入源参数、音频输出源参数、缓存空间地址外,还可以包括缓存速率,即应用程序调用该接口时可以通过该缓存速率指定获取蓝牙音频数据时采用的缓存速率。音频服务单元在接收到应用程序通过蓝牙音频传输接口传递的请求时,从请求中获取蓝牙音频数据对应的缓存速率,从音频输入源获取蓝牙音频数据,并将该蓝牙音频数据以对应的缓存速率缓存到对应的缓存空间。
在本实施例中,通过获取各路所述蓝牙音频数据对应的缓存空间,从各个所述音频输入源获取各路所述蓝牙音频数据,并将各路所述蓝牙音频数据缓存到所述对应的缓存空间,在实现支持多路蓝牙音频输入同时,可通过优化和升级蓝牙音频数据的缓存空间来提高蓝牙音频传输的整体性能。
本申请还提供一种蓝牙音频传输装置,该装置包括:存储器、处理器、蓝牙模组及存储在所述存储器上并可在所述处理器上运行的蓝牙音频传输控制程序,所述蓝牙音频传输控制程序被所述处理器执行时实现所述的蓝牙音频传输方法的步骤。
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有蓝牙音频传输控制程序,所述蓝牙音频传输控制程序被处理器执行时实现所述的蓝牙音频传输方法的步骤。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种蓝牙音频传输的方法,其中,所述蓝牙音频传输的方法包括以下步骤:
    在接收到多个应用获取蓝牙音频数据的请求消息时,分别获取每个所述请求消息中指定的蓝牙音频输入源和音频输出源,其中,每个所述请求消息中指定的所述蓝牙音频输入源与所述音频输出源相关联;
    为每个所述请求消息启动对应的进程或线程,以所述进程或线程从所述蓝牙音频输入源读取蓝牙音频数据,并实时将所述蓝牙音频数据缓存到缓存空间;以及
    从所述缓存空间读取每个所述请求消息对应的蓝牙音频数据,并发送给关联的所述音频输出源。
  2. 如权利要求1所述的蓝牙音频传输的方法,其中,所述蓝牙音频传输的方法还包括以下步骤:
    当没有接收到获取蓝牙音频数据的请求时,检测是否有默认音频输入源以外的音频输入源;以及
    若检测到所述默认音频输入源以外的音频输入源,关闭所述默认音频输入源。
  3. 如权利要求2所述的蓝牙音频传输的方法,其中,所述当没有接收到获取蓝牙音频数据的请求时,检测是否有默认音频输入源以外的音频输入源的步骤之后还包括:
    若没有检测到默认音频输入源以外的音频输入源,从所述默认的音频输入源获取音频数据。
  4. 如权利要求2所述的蓝牙音频传输的方法,其中,所述当没有接收到获取蓝牙音频数据的请求时,检测是否有默认音频输入源以外的音频输入源的步骤之后还包括:
    检测是否有默认音频输出设备以外的音频输出源;以及
    若有所述默认音频输出设备以外的音频输出源,关闭所述默认音频输出设备的音频输出功能。
  5. 如权利要求4所述的蓝牙音频传输的方法,其中,所述检测是否有默认音频输出设备以外的音频输出源的步骤之后还包括:
    若没有所述默认音频输出设备以外的音频输出源,将获取的音频数据从所述默认音频输出设备输出。
  6. 如权利要求2所述的蓝牙音频传输的方法,其中,所述当没有接收到获取蓝牙音频数据的请求时,检测是否有默认音频输入源以外的音频输入源的步骤之前包括:
    在系统启动之后,检测是否接收来自应用程序的获取蓝牙音频数据的请求,其中,所述系统为应用所述蓝牙音频传输的方法的系统,所述应用程序运行于所述系统中。
  7. 如权利要求4所述的蓝牙音频传输的方法,其中,所述若有所述默认音频输出设备以外的音频输出源,关闭所述默认音频输出设备的音频输出功能的步骤之后还包括:
    若有多个所述默认音频输出设备以外的音频输出源,将优先级最高的所述音频输出源作为目标音频输出源。
  8. 如权利要求7所述的蓝牙音频传输的方法,其中,所述若有多个所述默认音频输出设备以外的音频输出源,将优先级最高的所述音频输出源作为目标音频输出源的步骤之后还包括:
    若有多个所述默认音频输出设备以外的音频输出源,将所述请求消息对应的多路蓝牙音频数据从所述目标音频输出源输出。
  9. 如权利要求1所述的蓝牙音频传输的方法,其中,所述从所述缓存空间读取每个所述请求消息对应的蓝牙音频数据,并发送给关联的所述音频输出源的步骤包括:
    当所述请求消息对应有多路蓝牙音频数据时,提示用户有多路蓝牙音频混音的情况;以及
    将所述多路蓝牙音频数据进行混音,并将混音后的蓝牙音频数据发送给关联的所述音频输出源。
  10. 如权利要求1所述的蓝牙音频传输的方法,其中,所述在接收到多个应用获取蓝牙音频数据的请求消息时,获取每个所述请求消息中指定的音频输入源和音频输出源的步骤之后还包括:
    当所述请求消息中指定的音频输出源不是默认音频输出设备时,关闭所述默认的音频输出设备的音频输出功能。
  11. 如权利要求1至10任一项所述的蓝牙音频传输的方法,其中,所述为每个所述请求消息启动对应的进程或线程,以所述进程或线程从所述蓝牙音频输入源读取蓝牙音频数据,并实时将所述蓝牙音频数据缓存到缓存空间的步骤包括:
    为每个所述请求消息启动对应的进程或线程,以所述进程或线程从所述蓝牙音频输入源读取蓝牙音频数据;
    获取每个所述请求对应的缓存速率;以及
    实时将所述蓝牙音频数据以所述对应的缓存速率缓存到缓存空间。
  12. 如权利要求11所述的蓝牙音频传输的方法,其中,所述缓存空间为预设的内存空间。
  13. 如权利要求11所述的蓝牙音频传输的方法,其中,所述根据应用所述蓝牙音频传输系统的内存硬件和内存分配的情况确定所述缓存空间。
  14. 如权利要求11所述的蓝牙音频传输的方法,其中,根据发送所述请求消息的应用程序对传输延迟的要求确定所述缓存空间。
  15. 如权利要求1所述的蓝牙音频传输的方法,其中,所述蓝牙音频传输的方法还包括以下步骤:
    实时查询传输请求消息队列,按照时间先后顺序处理所述传输请求消息队列中的蓝牙音频传输请求消息。
  16. 如权利要求1所述的蓝牙音频传输的方法,其中,所述在接收到多个应用获取蓝牙音频数据的请求消息时,分别获取每个所述请求消息中指定的蓝牙音频输入源和音频输出源的步骤包括:
    在接收到多个应用获取蓝牙音频数据的请求消息时,解析所述请求消息中得到音频输入源标识和音频输出源标识;以及
    根据所述音频输入源和所述音频输出源标识确定所述请求消息中指定的蓝牙音频输入源和音频输出源。
  17. 如权利要求1所述的蓝牙音频传输的方法,其中,所述从所述缓存空间读取每个所述请求消息对应的蓝牙音频数据,并发送给关联的所述音频输出源的步骤之前还包括:
    与关联的所述音频输出源建立连接。
  18. 如权利要求1所述的蓝牙音频传输的方法,其中,所述音频输出源包括蓝牙设备和运行于系统中的应用进程。
  19. 一种蓝牙音频传输装置,其中,所述装置包括:存储器、处理器、蓝牙模组及存储在所述存储器上并可在所述处理器上运行的蓝牙音频传输处理程序,所述蓝牙音频传输处理程序被所述处理器执行时实现如权利要求1至18中任一项所述的蓝牙音频传输方法的步骤。
  20. 一种计算机可读存储介质,其中,所述计算机可读存储介质上存储有蓝牙音频传输处理程序,所述蓝牙音频传输处理程序被处理器执行时实现如权利要求1至18中任一项所述的蓝牙音频传输方法的步骤。
PCT/CN2019/087241 2018-05-22 2019-05-16 蓝牙音频传输方法、装置及计算机可读存储介质 WO2019223600A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810498505.3 2018-05-22
CN201810498505.3A CN108848410A (zh) 2018-05-22 2018-05-22 蓝牙音频传输方法、装置及计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2019223600A1 true WO2019223600A1 (zh) 2019-11-28

Family

ID=64213256

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/087241 WO2019223600A1 (zh) 2018-05-22 2019-05-16 蓝牙音频传输方法、装置及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN108848410A (zh)
WO (1) WO2019223600A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108848410A (zh) * 2018-05-22 2018-11-20 深圳Tcl新技术有限公司 蓝牙音频传输方法、装置及计算机可读存储介质
CN112367648B (zh) * 2020-09-29 2024-03-08 深圳市汇顶科技股份有限公司 通话管理方法、芯片和音频输出装置
CN113377329B (zh) * 2021-07-01 2024-04-26 安徽文香科技股份有限公司 一种虚拟音频设备、音频数据处理方法及装置
CN115834757A (zh) * 2021-09-17 2023-03-21 北京小米移动软件有限公司 数据传输方法、电子设备、通信系统及可读存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110238407A1 (en) * 2009-08-31 2011-09-29 O3 Technologies, Llc Systems and methods for speech-to-speech translation
CN104333800A (zh) * 2014-07-21 2015-02-04 北京京东方视讯科技有限公司 一种显示系统、显示系统的蓝牙音频播放方法及装置
CN104469500A (zh) * 2013-09-18 2015-03-25 宏达国际电子股份有限公司 可携式电子装置及多媒体输出方法
CN206775720U (zh) * 2017-05-03 2017-12-19 广州国光音频科技有限公司 一种集合多功能智能音响的蓝牙连接和传输模块
CN108848410A (zh) * 2018-05-22 2018-11-20 深圳Tcl新技术有限公司 蓝牙音频传输方法、装置及计算机可读存储介质

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102611961B (zh) * 2011-01-20 2014-08-06 三星电子(中国)研发中心 一种终端的多路音频切换方法及装置
US9369852B2 (en) * 2014-09-08 2016-06-14 Toyota Motor Engineering & Manufacturing North America, Inc. Messaging for mobile devices using vehicle DCM
CN106201425A (zh) * 2016-07-12 2016-12-07 乐视控股(北京)有限公司 一种智能终端音频输出的方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110238407A1 (en) * 2009-08-31 2011-09-29 O3 Technologies, Llc Systems and methods for speech-to-speech translation
CN104469500A (zh) * 2013-09-18 2015-03-25 宏达国际电子股份有限公司 可携式电子装置及多媒体输出方法
CN104333800A (zh) * 2014-07-21 2015-02-04 北京京东方视讯科技有限公司 一种显示系统、显示系统的蓝牙音频播放方法及装置
CN206775720U (zh) * 2017-05-03 2017-12-19 广州国光音频科技有限公司 一种集合多功能智能音响的蓝牙连接和传输模块
CN108848410A (zh) * 2018-05-22 2018-11-20 深圳Tcl新技术有限公司 蓝牙音频传输方法、装置及计算机可读存储介质

Also Published As

Publication number Publication date
CN108848410A (zh) 2018-11-20

Similar Documents

Publication Publication Date Title
WO2019223600A1 (zh) 蓝牙音频传输方法、装置及计算机可读存储介质
WO2016047983A1 (ko) 통신 단말들간 무선 통신을 위한 방법 및 장치
WO2011129551A2 (en) Device capable of notifying operation state change thereof through network and communication method of the device
WO2014051367A1 (en) User terminal apparatus, electronic device, and method for controlling the same
WO2019156506A1 (en) System and method for providing conversational contents
WO2020133764A1 (zh) 语音遥控方法、系统、受控装置及计算机可读存储介质
WO2014030889A1 (en) Method and apparatus for sharing content
WO2020155359A1 (zh) 家电设备的控制方法、服务器、家电设备及存储介质
WO2017092498A1 (zh) 一种信息管理方法及用户终端
WO2020256497A1 (ko) 블루투스 통신 연결 방법 및 그 전자 장치
WO2018076840A1 (zh) 数据分享方法、装置、存储介质及服务器
WO2017067375A1 (zh) 一种视频背景设置方法及终端设备
WO2020218805A1 (en) Electronic device and method of controlling thereof
WO2016111502A1 (en) System and method for transmitting information about task to external device
WO2019107707A1 (en) Remote control, electronic apparatus and pairing method thereof
WO2020133978A1 (zh) 电子节目指南的生成方法、装置及计算机可读存储介质
WO2018076873A1 (zh) 数据分享方法、装置、介质、电子设备及系统
WO2018076888A1 (zh) 移动终端数据的同步方法、装置及系统、存储介质及移动终端
WO2017185647A1 (zh) 基于SoftSIM的IMSI号码管理及呼叫方法、服务器及网络侧设备
WO2019184436A1 (zh) 视频推送方法、装置及计算机可读存储介质
WO2017206881A1 (zh) 一种关联应用的处理方法、装置、存储介质及电子设备
WO2017113976A1 (zh) 一种无线局域网通信方法、终端及系统
WO2021145659A1 (en) Audio output device and method for controlling output speed of audio data thereof
WO2011071334A2 (en) Method and apparatus for transmitting video contents compressed by codec
WO2023090863A1 (ko) 전자 장치 및 그 동작 방법

Legal Events

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

Ref document number: 19808136

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19808136

Country of ref document: EP

Kind code of ref document: A1