WO2020034780A1 - 传输控制方法、装置、电子设备及存储介质 - Google Patents

传输控制方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2020034780A1
WO2020034780A1 PCT/CN2019/093959 CN2019093959W WO2020034780A1 WO 2020034780 A1 WO2020034780 A1 WO 2020034780A1 CN 2019093959 W CN2019093959 W CN 2019093959W WO 2020034780 A1 WO2020034780 A1 WO 2020034780A1
Authority
WO
WIPO (PCT)
Prior art keywords
buffer
audio
electronic device
audio data
threshold
Prior art date
Application number
PCT/CN2019/093959
Other languages
English (en)
French (fr)
Inventor
严锋贵
龚金华
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2020034780A1 publication Critical patent/WO2020034780A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output
    • G06F3/162Interface to dedicated audio devices, e.g. audio drivers, interface to CODECs

Definitions

  • the present application relates to the technical field of electronic devices, and more particularly, to a transmission control method, device, electronic device, and storage medium.
  • Bluetooth With the development and popularization of Bluetooth technology, more audio playback devices can support data transmission with electronic devices through the Bluetooth protocol.
  • the vehicle-mounted device and the electronic device can transfer music through the Bluetooth protocol
  • the headset can receive the communication voice transmitted by the electronic device through the Bluetooth protocol.
  • the electronic device transmits audio data to other audio playback devices through Bluetooth, sometimes there is a playback delay in the audio data played by the audio playback device.
  • this application proposes a transmission control method, device, electronic device, and storage medium to achieve improvement of the above problems.
  • the present application provides a transmission control method applied to an electronic device.
  • the method includes: entering a set playback scene, and the content played in the playback scene includes audio data and image data, where all The audio data corresponds to the image data; detecting whether the electronic device is in an audio playback device connection state; if it is detected that the electronic device is in an audio playback device connection state, reducing transmission of the audio data to the audio playback device
  • the buffer threshold of the buffer node passed in the process, wherein when it is detected that the size of the audio data that has been buffered in the buffer node meets the buffer threshold, processing is started on the audio data that the buffer node has buffered.
  • the present application provides a transmission control device that runs on an electronic device, and the device includes a playback scene trigger unit for triggering the electronic device to enter a set playback scene, where
  • the played content includes audio data and image data, wherein the audio data corresponds to the image data;
  • a connection state detection unit is configured to detect whether the electronic device is in an audio playback device connection state;
  • a transmission control unit is configured to The connection state detecting unit detects that the electronic device is in an audio playback device connection state, and reduces a buffer threshold of a buffer node that passes during the process of transmitting the audio data to the audio playback device. After the size of the audio data that has been buffered in the buffer node meets the buffer threshold, processing of the audio data that has been buffered by the buffer node is started.
  • the present application provides an electronic device including one or more processors and a memory; one or more programs are stored in the memory and configured to be executed by the one or more processors, The one or more programs are configured to perform the method described above.
  • a computer-readable storage medium provided in the present application, wherein the computer-readable storage medium stores program code, and the method is executed when the program code is executed by a processor.
  • FIG. 1 shows a flowchart of a transmission control method proposed in the present application.
  • FIG. 2 shows a flowchart of another transmission control method proposed in the present application.
  • FIG. 3 shows a flowchart of another transmission control method proposed in the present application.
  • FIG. 4 shows a structural block diagram of an encoding control device proposed in the present application.
  • FIG. 5 shows a structural block diagram of another encoding control device proposed by the present application.
  • FIG. 6 shows a structural block diagram of another encoding control device proposed by the present application.
  • FIG. 7 shows a structural block diagram of an electronic device for performing a transmission control method according to an embodiment of the present application.
  • FIG. 8 is a storage unit for storing or carrying a program code for implementing a transmission control method according to an embodiment of the present application.
  • the audio architecture of an electronic device is similar to that of a computer, which is mainly completed by a processor and a built-in audio CODEC (codec).
  • the processor receives the input of the audio file, converts it into an I2S signal, transmits it to a CODEC, converts it into an analog signal, and then plays it.
  • the electronic device may be any of various types of computer system devices that are mobile or portable and perform wireless communication.
  • the electronic device may be a mobile phone or a smart phone (e.g., iPhoneTM, AndroidTM-based phone), a portable gaming device (e.g. Nintendo DSTM, PlayStation PortableTM, Gameboy AdvanceTM, iPhoneTM), laptop Computers, PDAs, portable Internet devices, music players, and data storage devices.
  • a mobile phone or a smart phone e.g., iPhoneTM, AndroidTM-based phone
  • a portable gaming device e.g. Nintendo DSTM, PlayStation PortableTM, Gameboy AdvanceTM, iPhoneTM
  • laptop Computers e.g. Nintendo DSTM, PlayStation PortableTM, Gameboy AdvanceTM, iPhoneTM
  • PDAs portable Internet devices
  • music players e.g., music players, and data storage devices.
  • the audio playback devices can receive audio data transmitted from the electronic devices and play the audio data.
  • Common audio playback devices include headphones, speakers, and car audio playback devices.
  • the electronic device can transmit audio data to an external audio playback device for playback through Bluetooth transmission.
  • the electronic device can also pass audio data to the audio playback device in a manner based on the IEEE802.11 protocol.
  • the electronic device first encodes the audio data to be transmitted in the process of transmitting audio data to an external audio playback device based on the Bluetooth method.
  • Apt-X has the advantage of lower delay compared with sbc.
  • SBC is a commonly used audio format. When audio playback equipment does not support AAC and Apt-X, SBC is used for transmission, and the sound quality is average.
  • AAC when audio playback equipment supports AAC format files, and electronic equipment also supports AAC transmission, the sound quality is much better than SBC.
  • Apt-X a lossless format for Bluetooth transmission, is promoted by csr.
  • the movement of some characters or objects will have corresponding sounds, so in this scene, it can be understood that the movement of characters or objects and their corresponding sounds can be corresponding image data and audio data.
  • the electronic device transmits the sound of the game scene to an external audio playback device for playback it may cause the user to have seen the character or object move, but have not heard the corresponding sound, which will cause a poor user experience. .
  • the inventor found that one of the reasons for the above situation is the problem of buffer processing of audio data.
  • the audio data passes through the audio decoding module, audio processing module, and Bluetooth codec encoding module of the electronic device, and then is transmitted to the audio playback device.
  • the maximum buffered data of the buffer nodes usually configured by the electronic device is fixed, and the threshold value when the buffer node starts processing is also fixed, which will cause the above problems.
  • the inventor has proposed a transmission control method, device, electronic device, and storage that can increase the frequency of data processing in the buffer node so that audio data can be played back by audio devices faster and reduce audio playback delay. medium.
  • a transmission control method provided in this application is applied to an electronic device.
  • the method includes:
  • Step S110 Enter a set playback scene, and the content played in the playback scene includes audio data and image data, where the audio data corresponds to the image data.
  • the set playback scene may be a game scene or may be a video playback scene.
  • the game screen is image data
  • the sound corresponding to the game screen is audio data.
  • the image data represents a game character walking from one place to another in a game screen
  • the sound of the footsteps corresponding to the character's walking from one place to another is audio data corresponding to the image data.
  • the content represented by the image data is that the person is talking
  • the sound emitted by the character during the speech is audio data corresponding to the image data.
  • Step S120 It is detected whether the electronic device is in an audio playback device connection state.
  • the electronic device can play audio through an audio playback module (such as a speaker or an earpiece) configured by itself, and can also transfer audio data to an external audio playback device so that the external audio playback device can play the audio data. Then, in this case, the audio playback device connection status is used to indicate that the electronic device is currently transmitting audio data to an external audio playback device for playback.
  • an audio playback module such as a speaker or an earpiece
  • the external audio device and the electronic device are in a wired or wireless connection state, and both can trigger the electronic device to enter the audio playback device connection state.
  • the wireless method includes connection based on the IEEE802.11 protocol or connection based on the Bluetooth communication protocol.
  • connection based on the Bluetooth communication protocol as a way, detecting whether the electronic device is connected to the Bluetooth device through Bluetooth, and if it is detected that the electronic device is connected to the Bluetooth device, detecting whether the type of the Bluetooth device is an audio device type, If yes, it is determined that the electronic device is in an audio playback device connection state.
  • the type of the device currently connected via Bluetooth can be determined based on the return value obtained by instantiating the BluetoothClass.Device class. If the returned value is AUDIO_VIDEO_CAMCORDER, it is characterized as an image acquisition device.
  • the returned value is AUDIO_VIDEO_CAR_AUDIO, it is characterized as a vehicle-mounted device. If the returned value is AUDIO_VIDEO_HIFI_AUDIO, it is characterized as an audio playback device or a video playback device. If the returned value is AUDIO_VIDEO_MICROPHONE, it is characterized as a microphone.
  • Step S130 if it is detected that the electronic device is in the audio playback device connection state, reduce the buffer threshold of the buffer node passed during the process of transmitting the audio data to the audio playback device, and when the buffer node is detected After the size of the buffered audio data meets the buffering threshold, processing of the buffered node's buffered audio data is started.
  • the audio data played by the electronic device may be read from a local storage or obtained from a network. After the electronic device reads the audio data from the local or the network, it will perform audio decoding, audio processing, and Bluetooth codec encoding on the audio data.
  • the buffer thresholds of the buffer nodes mentioned above may be reduced, or only the buffer thresholds of some of the buffer nodes may be reduced.
  • the electronic device starts processing the buffered 10 kb data when it detects that the size of the buffered data in the buffer node A is 10 kb. Then in this case, if the buffer threshold of buffer node A is reduced to 5kb, the electronic device will start to perform the buffered 5kb data when it detects that the size of the buffered data in buffer node A is 5kb. deal with.
  • the buffer threshold may be the value of the maximum storable data of the buffer node, or may be smaller than the value of the maximum storable data.
  • a transmission control method provided in this application after entering a set playback scene, detecting whether the electronic device is in an audio playback device connection state, and if it is detected that the electronic device is in an audio playback device connection state, reducing The buffer threshold of the buffer node in the process of audio data transmission to the audio playback device is described, so that when the electronic device plays the image data and the audio data corresponding to the image data, it can transmit the audio data to the audio playback device.
  • a transmission control method provided in this application is applied to an electronic device.
  • the method includes:
  • Step S210 Enter a set playback scene, and the content played in the playback scene includes audio data and image data, where the audio data corresponds to the image data.
  • Step S220 Detect whether the electronic device is in an audio playback device connection state.
  • Step S230 if it is detected that the electronic device is in a connected state with an audio playback device, obtain a change frequency of the screen content represented by the image data.
  • the image data includes images of multiple frames.
  • the change frequency of the picture content represents the change frequency of the content of successive multi-frame images.
  • the frequency of change of their corresponding content may be different.
  • the image data is a game scene or some video scenes (TV series or movies), because the frequency of changes in the picture in the game scene or TV series scene or movie scene is relatively high, then in this case the delay of the aforementioned audio data is The requirements are higher, which means that there can be less delay or even a delay that the user cannot recognize.
  • video scenes for example, knowledge-based explanations or video courses of a certain course type, because the pictures will remain in the same state for a long time, only the corresponding audio data will change differently.
  • the picture will freeze on a PPT page for a long time, and the audio corresponding to the presentation of the content of the PPT page will change continuously. Then in this case, the synchronization requirements for audio data and image data are relatively low, and the delay for audio data may not be too high.
  • the content characteristics of the image can be determined by obtaining the average gray value.
  • the electronic device may obtain respective grayscale average values of the continuous multi-frame images, and obtain respective content characteristics of the continuous multiframe images based on the grayscale average values.
  • the following describes the content characteristics of each of the consecutive multi-frame images obtained based on the gray average value.
  • the purpose of this step is to remove the differences in various picture sizes and picture proportions, and only retain basic information such as structure, light and shade.
  • the reduced picture is then converted into a 64-level grayscale picture. Calculate the average gray value of all pixels in the picture. Compare the gray level of each pixel with the average. If it is greater than or equal to the average, it is recorded as 1, and if it is less than the average, it is recorded as 0.
  • the comparison result of the previous step is combined to form a 64-bit binary integer. This is the fingerprint of this image. After getting the fingerprint of the image, you can compare the fingerprints of different images and calculate how many of the 64 bits are different. If the number of different data bits does not exceed 5, it means that the two images are very similar, and if it is greater than 10, it means that they are two different images.
  • Step S231 Decrease the buffer threshold of the buffer node in the process of transmitting the audio data to the audio playback device according to the change frequency. When the size of the buffered audio data in the buffer node is detected, After the buffer threshold is met, the audio data that has been buffered by the buffer node is processed.
  • a buffer threshold of a buffer node that is routed during the process of transmitting the audio data to the audio playback device is reduced to a first buffer threshold. If the change frequency is not lower than a preset value, reducing a buffer threshold of a buffer node approached during the process of transmitting the audio data to an audio playback device to a second buffer threshold, where the first buffer threshold is greater than The second buffering threshold.
  • a plurality of interval segments representing different change ranges of the change frequency may be set, and the plurality of interval segments may each correspond to a reduced buffer threshold.
  • the interval A1 to indicate the change frequency from a1 to a2
  • the interval A2 to indicate the change frequency to a2 to a3
  • the interval A3 to indicate the change frequency to a3 to a4.
  • the buffer threshold to be reduced corresponding to the interval A1 is b1
  • the buffer threshold to be reduced corresponding to the interval A2 is b2
  • the buffer threshold to be reduced corresponding to the interval A3 is b3.
  • the electronic device obtains the change frequency X it will first determine which interval section X belongs to. For example, if it is determined that the change frequency X belongs to the interval A1, the electronic device determines that the buffer threshold to be reduced by the buffer node is b1.
  • the frequency of processing the data of the buffer node by the processor will be improved to a certain extent. For example, using the previous content as an example, if the buffer threshold is 10kb, the processor only needs to process the data once for 10kb, and if the buffer threshold is reduced to 5kb, the processor needs to process 10kb of data. 2 times, therefore, it will also increase the burden on the processor to some extent, and in order to avoid affecting the processor's ability to process other data, the overall data processing capacity of the electronic device is reduced.
  • the buffer node's buffer threshold can be further reduced.
  • the original buffer threshold is still maintained or the buffer threshold is relatively small, which can make the control of the buffer threshold more flexible and can play a role While being able to reduce the delay of audio data flexibly, it can avoid affecting the processor's ability to process other data, thereby ensuring that the overall data processing ability of the electronic device is not affected.
  • a transmission control method provided in this application after entering a set playback scene, detecting whether the electronic device is in an audio playback device connection state, and if it is detected that the electronic device is in an audio playback device connection state, acquiring the image
  • the change frequency of the picture content represented by the data according to the change frequency, the buffer threshold of the buffer node that is used in the process of transmitting the audio data to the audio playback device is reduced, so that the data at the buffer node can be more updated.
  • Fast processing in order to improve the frequency of data processing in the buffer node, so that the audio data can be played out by the audio device faster, reducing the audio playback delay.
  • a transmission control method provided in this application is applied to an electronic device.
  • the method includes:
  • Step S310 Enter a set playback scene, and the content played in the playback scene includes audio data and image data, where the audio data corresponds to the image data.
  • Step S320 Detect whether the electronic device is in an audio playback device connection state.
  • Step S330 if it is detected that the electronic device is in the audio playback device connection state, reduce the buffer threshold of the buffer node that passes during the process of transmitting the audio data to the audio playback device, and when the buffer node is detected After the size of the buffered audio data meets the buffering threshold, processing of the buffered node's buffered audio data is started.
  • Step S340 if it is detected that the electronic device is in the audio playback device connection state, increase the working frequency of the processor of the electronic device.
  • a ratio of the buffer threshold after the buffer node reduction to the buffer threshold before the reduction is obtained, and based on the ratio, the working frequency of the processor of the electronic device is increased.
  • the electronic device can determine the increase in the operating frequency of the processor based on the following data table.
  • the field ratio indicates the ratio of the buffer node's reduced buffer threshold to the buffer threshold before the reduction, and the field Promotion indicates the increased operating frequency. Then when the ratio a is detected, the working frequency of bGHZ is increased, and when the ratio b is detected, the working frequency of DGHZ is increased.
  • a transmission control method provided in this application after entering a set playback scene, detecting whether the electronic device is in an audio playback device connection state, and if it is detected that the electronic device is in an audio playback device connection state, acquiring the image
  • the frequency of change in the content of the picture represented by the data according to the frequency of change, reduces the buffer threshold of the buffer node that is used in the process of transmitting the audio data to the audio playback device, and simultaneously increases the processing frequency of the processor, so that The data in the buffer node can be processed faster in order to increase the frequency of data processing in the buffer node, so that the audio data can be played out by the audio device faster, and the audio playback delay is reduced.
  • a transmission control device 400 provided in the present application runs on an electronic device.
  • the device 400 includes:
  • a playback scene trigger unit 410 is configured to trigger the electronic device to enter a set playback scene, and content played in the playback scene includes audio data and image data, where the audio data corresponds to the image data.
  • the connection state detection unit 420 is configured to detect whether the electronic device is in a connection state of an audio playback device.
  • connection state detection unit 420 is specifically configured to detect whether an electronic device is connected to a Bluetooth device via Bluetooth; if it is detected that the electronic device is connected to a Bluetooth device, detect whether the type of the Bluetooth device is an audio device type; if yes, It is determined that the electronic device is in a connected state of the audio playback device.
  • a transmission control unit 430 configured to reduce a buffer threshold of a buffer node that is passed during the process of transmitting the audio data to the audio playback device, if the connection state detection unit detects that the electronic device is in an audio playback device connection state; Wherein, when it is detected that the size of the audio data that has been buffered in the buffer node meets the buffer threshold, processing is started on the audio data that has been buffered by the buffer node.
  • a transmission control device 500 provided in the present application runs on an electronic device.
  • the device 500 includes:
  • a playback scene trigger unit 510 is configured to trigger the electronic device to enter a set playback scene, and content played in the playback scene includes audio data and image data, where the audio data corresponds to the image data.
  • the connection state detecting unit 520 is configured to detect whether the electronic device is in a connection state of an audio playback device.
  • the content detection unit 530 is configured to acquire a change frequency of the screen content represented by the image data if the connection state detection unit 520 detects that the electronic device is in a connected state of the audio playback device.
  • the content detection unit 530 includes:
  • the frame image acquisition subunit 531 is configured to acquire consecutive multi-frame images included in the image data.
  • the content feature acquisition subunit 532 is configured to acquire respective content features of the consecutive multi-frame images.
  • the content feature acquisition subunit 532 is specifically configured to acquire respective grayscale average values of the continuous multi-frame images, and acquire the content characteristics of the continuous multiframe images based on the grayscale average values.
  • a change frequency acquisition subunit 533 is configured to acquire a change frequency of the picture content represented by the image data based on the content characteristics.
  • a transmission control unit 540 configured to reduce a buffer threshold of a buffer node in a process of transmitting the audio data to an audio playback device according to the change frequency, and when a buffered node in the buffer node is detected, After the size of the audio data meets the buffering threshold, processing is started on the audio data that has been buffered by the buffer node.
  • a transmission control device 600 provided in the present application runs on an electronic device.
  • the device 600 includes:
  • the playback scene trigger unit 610 is configured to enter a set playback scene, and the content played in the playback scene includes audio data and image data, where the audio data and the image data correspond to each other.
  • the connection state detection unit 620 is configured to detect whether the electronic device is in a connection state of an audio playback device.
  • a transmission control unit 630 configured to reduce a buffer threshold of a buffer node that passes through the process of transmitting the audio data to the audio playback device if the connection state detection unit 620 detects that the electronic device is in the audio playback device connection state, wherein, after detecting that the size of the audio data that has been buffered in the buffer node meets the buffer threshold, processing is started on the audio data that has been buffered by the buffer node.
  • the processor control unit 640 is configured to increase the working frequency of the processor of the electronic device if the connection state detection unit 620 detects that the electronic device is in the audio player connection state.
  • a transmission control method, device, electronic device, and storage medium provided in this application, after entering a set playback scene, detect whether the electronic device is in an audio playback device connection state, and if the electronic device is detected, If the device is in the audio playback device connection state, the buffer threshold of the buffer node in the process of transmitting the audio data to the audio playback device is reduced, so that the electronic device plays the image data and audio data corresponding to the image data
  • the value representing the trigger to start processing the audio data that has been buffered by the buffer node can be reduced, so that the data at the buffer node can be processed faster.
  • the audio data can be played out by the audio device faster, and the audio playback delay is reduced.
  • the electronic device 100 includes one or more processors (only one shown in the figure), a memory 104, a wireless module 106, and an audio circuit 110 coupled to each other.
  • the memory 104 stores a program that can execute the content in the foregoing embodiment, and the processor 102 can execute the program stored in the memory 104.
  • the memory 104 may be used to store software programs and modules.
  • the memory 104 may store a transmission control device.
  • the transmission control device may be the foregoing device 400, device 500, or device 600.
  • the processor 102 executes various functional applications and data processing by running software programs and modules stored in the memory 104.
  • the memory 104 may include a high-speed random access memory, and may further include a non-volatile memory, such as one or more magnetic storage devices, a flash memory, or other non-volatile solid-state memory.
  • the memory 104 may further include a memory remotely disposed with respect to the processor 102.
  • the wireless module 106 is used to receive and send electromagnetic waves, and realize mutual conversion between electromagnetic waves and electrical signals, so as to communicate with a communication network or other equipment.
  • the wireless module 106 can communicate with various networks, such as the Internet, an intranet, and a wireless network, or communicate with other devices through a wireless network.
  • the wireless network may include a cellular telephone network, a wireless local area network, or a metropolitan area network.
  • the above wireless network can use various communication standards, protocols and technologies, including, but not limited to, the Global System for Mobile Communication (GSM), the IEEE 802 protocol, and the Bluetooth protocol.
  • the audio data may be obtained from the memory 104 or through the wireless module 106.
  • audio data may also be stored in the memory 104 or transmitted through the wireless module 106.
  • the wireless module 106 may be a Bluetooth communication module, a WIFI communication module, or a module supporting other wireless communication protocols.
  • the audio circuit 110 can also be used to encode audio data to be transmitted via Bluetooth (when the wireless module 106 transmits data based on the Bluetooth communication protocol), wherein the audio encoding type used in encoding can be according to the foregoing embodiment The way provided.
  • each functional unit in each embodiment of the present application may be integrated into one processing module, or each unit may exist separately physically, or two or more units may be integrated into one module.
  • the above integrated modules may be implemented in the form of hardware or software functional modules. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
  • FIG. 8 shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application.
  • the computer-readable medium 800 stores program code, and the program code can be called by a processor to execute the method described in the foregoing method embodiment.
  • the computer-readable storage medium 800 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read-Only Memory), an EPROM, a hard disk, or a ROM.
  • the computer-readable storage medium 800 includes a non-transitory computer-readable storage medium.
  • the computer-readable storage medium 800 has a storage space for program code 810 that performs any of the method steps in the above-described methods. These program codes can be read from or written into one or more computer program products.
  • the program code 810 may be compressed, for example, in a suitable form.
  • the aforementioned storage medium may be a read-only memory, a magnetic disk, or an optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)
  • Communication Control (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

本申请实施例公开了一种传输控制方法、装置、电子设备及存储介质。所述方法包括:进入设定的播放场景,在内容播放场景中所播放的内容包括音频数据和图像数据;检测电子设备是否处于音频播放设备连接状态;若检测到电子设备处于音频播放设备连接状态,减小将音频数据传输给音频播放设备的过程中所经过的缓冲节点的缓冲阈值,其中,当检测到缓冲节点中已经缓冲的音频数据的大小符合缓冲阈值后,开始对缓冲节点已经缓冲的音频数据进行处理。本方法使得在需要将音频数据传输给音频播放设备的情况下,对于在缓冲节点的数据可以被更快的处理,以提升缓冲节点中数据被处理的频率,从而使得将音频数据能够更快的被音频设备播放出来,减小音频播放延迟。

Description

传输控制方法、装置、电子设备及存储介质
相关申请的交叉引用
本申请要求于2018年8月14日提交的申请号为201810928162.X的中国申请的优先权,其在此出于所有目的通过引用将其全部内容并入本文。
技术领域
本申请涉及电子设备技术领域,更具体地,涉及一种传输控制方法、装置、电子设备及存储介质。
背景技术
随着蓝牙技术的发展与普及,更多的音频播放设备可以支持与电子设备之间通过蓝牙协议来传输数据。例如,车载设备可以和电子设备之间通过蓝牙协议来传输音乐,而耳机可以通过蓝牙协议接收电子设备所传输的通信语音。
但是,在电子设备通过蓝牙的方式向其他音频播放设备传输音频数据时,有时候音频播放设备所播放的音频数据会存在播放延时。
发明内容
鉴于上述问题,本申请提出了一种传输控制方法、装置、电子设备及存储介质,以实现改善上述问题。
第一方面,本申请提供了一种传输控制方法,应用于电子设备,所述方法包括:进入设定的播放场景,在所述播放场景中所播放的内容包括音频数据和图像数据,其中所述音频数据和所述图像数据相对应;检测所述电子设备是否处于音频播放设备连接状态;若检测到所述电子设备处于音频播放设备连接状态,减小将所述音频数据传输给音频播放设备的过程中所经过的缓冲节点的缓冲阈值,其中,当检测到所述缓冲节点中已经缓冲的音频数据的 大小符合所述缓冲阈值后,开始对所述缓冲节点已经缓冲的音频数据进行处理。
第二方面,本申请提供了一种传输控制装置,运行于电子设备,所述装置包括:播放场景触发单元,用于触发所述电子设备进入设定的播放场景,在所述播放场景中所播放的内容包括音频数据和图像数据,其中所述音频数据和所述图像数据相对应;连接状态检测单元,用于检测所述电子设备是否处于音频播放设备连接状态;传输控制单元,用于若所述连接状态检测单元检测到所述电子设备处于音频播放设备连接状态,减小将所述音频数据传输给音频播放设备的过程中所经过的缓冲节点的缓冲阈值,其中,当检测到所述缓冲节点中已经缓冲的音频数据的大小符合所述缓冲阈值后,开始对所述缓冲节点已经缓冲的音频数据进行处理。
第三方面,本申请提供了一种电子设备,包括一个或多个处理器以及存储器;一个或多个程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行上述的方法。
第四方面,本申请提供的一种计算机可读存储介质,所述计算机可读存储介质中存储有程序代码,其中,在所述程序代码被处理器运行时执行上述的方法。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1示出了本申请提出的一种传输控制方法的流程图。
图2示出了本申请提出的另一种传输控制方法的流程图。
图3示出了本申请提出的再一种传输控制方法的流程图。
图4示出了本申请提出的一种编码控制装置的结构框图。
图5示出了本申请提出的另一种编码控制装置的结构框图。
图6示出了本申请提出的另一种编码控制装置的结构框图。
图7示出了本申请的用于执行根据本申请实施例的传输控制方法的电子设备的结构框图。
图8是本申请实施例的用于保存或者携带实现根据本申请实施例的传输控制方法的程序代码的存储单元。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。
随着电子设备的用户对于音乐体验的需求,电子设备开始支持播放音频文件。而电子设备的音频架构和计算机的构架类似,主要就是由处理器、内置音频CODEC(编解码器)来完成。其中,处理器接收音频文件的输入后,转化成I2S信号,并传输至CODEC转换成模拟信号,然后进行播放。
其中,该电子设备可以为移动或便携式并执行无线通信的各种类型的计算机系统设备中的任何一种。具体的,电子设备可以为移动电话或智能电话(例如,基于iPhone TM,基于Android TM的电话),便携式游戏设备(例如Nintendo DS TM,PlayStation Portable TM,Gameboy Advance TM,iPhone TM)、膝上型电脑、PDA、便携式互联网设备、音乐播放器以及数据存储设备。
而随着用户对于音乐播放的进一步需求,出现了更多的电子设备以外的音频播放设备,该音频播放设备可以接收电子设备传输过来的音频数据,并将音频数据进行播放。常见的音频播放设备包括耳机、音箱以及车载音频播放设备等。其中,作为一种传输方式,电子设备可以通过蓝牙传输的方式,将音频数据传输给外部的音频播放设备进行播放。此外,电子设备还可以通过基于IEEE802.11协议的方式将音频数据传递给音频播放设备。
其中,电子设备在基于蓝牙的方式将音频数据传递给外部的音频播放设备的过程中,会先将待传输的音频数据进行编码。其中,蓝牙中的三种音频编码:Apt-X、SBC以及AAC。其中,Apt-X与sbc相比具有延时低的优势。SBC是常用的音频格式,在音频播放设备在不支持AAC以及Apt-X的时候都用SBC传输,音质一般。AAC,当音频播放设备支持AAC格式的文件,电子设备也支持AAC传输时,音质比SBC好很多。Apt-X,是蓝牙传输的一种无损格式,由csr推广,在设计初期,要支持Apt-X,就必须要购买这个软件费用,并且aptx并不是大多数手机都支持,一般支持的手机在背后都有Apt-X的logo,所以虽然效果好,但是真正可以支持的设备端其实不多。
而发明人在研究中发现,在一些内容播放场景中电子设备传输给音频播放设备所播放的音频数据与电子设备的显示屏所播放的画面之间存在延迟,造成音频播放设备所播放的音频数据和电子设备的显示屏所播放的图像数据之间不同步。例如,在一些游戏场景中,一些人物或者物体的移动都会有对应的声音,那么在这个场景下,可以理解的是,人物或者物体的移动和其对应的声音就可以是对应的图像数据和音频数据。而如果电子设备是将游戏场景的声音传输到外部的音频播放设备进行播放,那么就可能会造成用户已经看到人物或者物体移动了,但是还没有听到对应的声音,从而造成用户体验不好。
发明人经过进一步的长期研究发现,造成上述情况显示的一个原因是音频数据的缓冲处理问题。具体的,电子设备在将音频数据传输给音频播放设备进行播放的过程中,音频数据会经过电子设备的音频解码模块、音频处理模块以及蓝牙的codec编码模块,然后传输到音频播放设备后,又会经历蓝牙codec解码模块(在音频播放设备上),而在上述处理流程中,为了协调相邻模块之间的数据处理速度,可以在相邻模块之间都配置一个缓冲节点,该缓冲节点可以将音频数据处理的流程中前一模块所处理后的音频数据进行缓冲,然后后一个模块再从缓冲节点中读取数据进行处理。而电子设备通常配置的缓冲节点的最大缓冲数据是固定的,且当缓冲节点从缓冲了多少数据才开始进行处理的阈值也是固定的,从而会造成上述问题。
因此,发明人提出了本申请中可以提升缓冲节点中数据被处理的频率,从而使得音频数据能够更快的被音频设备播放出来,减小音频播放延迟的传输控制方法、装置、电子设备及存储介质。
下面将结合附图具体描述本申请的各实施例。
请参阅图1,本申请提供的一种传输控制方法,应用于电子设备,所述方法包括:
步骤S110:进入设定的播放场景,在所述播放场景中所播放的内容包括音频数据和图像数据,其中所述音频数据和所述图像数据相对应。
作为一种方式,设定的播放场景可以为游戏场景或者可以为视频播放场景。在游戏场景中游戏画面为图像数据,而与游戏画面对应的声音为音频数据。例如,若图像数据表征游戏画面中游戏人物从一个地方走动到另一个地方,那么对应人物从一个地方走到另一个地方的过程中的脚步的声音为与该图像数据对 应的音频数据。类似的,在视频播放场景中,若图像数据表征的内容为人物在说话,人物在说话的过程中所发出的声音为与该图像数据对应的音频数据。
可以理解的是,上面提到的游戏场景和视频播放场景以及其中的具体内容都是示例性的,任何涉及对应的图像数据和音频数据的播放场景均在本申请所要求保护的范围内。
步骤S120:检测所述电子设备是否处于音频播放设备连接状态。
需要说明的是,电子设备可以通过自身配置的音频播放模块(例如扬声器或者听筒)来播放音频,也可以将音频数据传递给外部的音频播放设备,以便外部的音频播放设备对音频数据进行播放。那么在这种情况下,音频播放设备连接状态用于表征电子设备当前是将音频数据传输给外部的音频播放设备进行播放。
其中,外部音频设备与电子设备处于有线或者无线的连接状态,均可以触发电子设备进入到音频播放设备连接状态。其中,无线的方式包括基于IEEE802.11协议连接,或者基于蓝牙通信协议连接。
那么对于基于蓝牙通信协议连接的情况下,作为一种方式,检测电子设备是否通过蓝牙连接有蓝牙设备,若检测到电子设备连接有蓝牙设备,检测所述蓝牙设备的类型是否为音频设备类型,若是,则判断电子设备处于音频播放设备连接状态。例如,在基于android操作系统的电子设备中,可以通过基于实例化BluetoothClass.Device类所得到的返回值来确定当前通过蓝牙连接的设备类型。若返回的值为AUDIO_VIDEO_CAMCORDER,则表征为图像采集设备。若返回的值为AUDIO_VIDEO_CAR_AUDIO,则表征为车载设备。若返回的值为AUDIO_VIDEO_HIFI_AUDIO,则表征为音频播放设备或者视频播放设备。若返回的值为AUDIO_VIDEO_MICROPHONE,则表征为麦克风。
步骤S130:若检测到所述电子设备处于音频播放设备连接状态,减小将所述音频数据传输给音频播放设备的过程中所经过的缓冲节点的缓冲阈值,其中,当检测到所述缓冲节点中已经缓冲的音频数据的大小符合所述缓冲阈值后,开始对所述缓冲节点已经缓冲的音频数据进行处理。
其中,需要说明的是,电子设备所播放的音频数据可以是从本地存储器中读取,也可以是从网络中获取。而当电子设备在从本地读取或者是从网络中获取到音频数据后,会先后对音频数据进行音频解码、音频处理以及蓝牙codec编码处理。而在这种过程中涉及到的缓冲节点可以有多个。例如,音频解码 模块和音频处理模块之间可以有缓冲节点,而音频处理模块以及蓝牙codec编码模块之间也可以设置缓冲节点,而蓝牙codec编码模块和执行将音频数据发送给音频播放设备的模块之前也可以设置有缓冲节点。
那么在检测到所述电子设备处于音频播放设备连接状态后,可以将上述所提及的缓冲节点的缓冲阈值均减小,或者也可以只减小其中部分缓冲节点的缓冲阈值。
下面再通过一个实例来对减小的缓冲阈值进行说明。
若在减小缓冲阈值之前缓冲节点A的缓冲阈值为10kb,那么电子设备在检测到缓冲节点A中已经缓冲的数据的大小为10kb时,即开始对该已经缓冲的10kb数据进行处理。那么在这种情况下,若减小缓冲节点A的缓冲阈值到5kb,那么电子设备在检测到缓冲节点A中已经缓冲的数据的大小为5kb时,就会开始对该已经缓冲的5kb数据进行处理。其中,需要说明的是,缓冲阈值可以为缓冲节点的最大可存储数据的值,也可以小于最大可存储数据的值。
需要说明的是,上述所提及的缓冲节点是否实际设置,可以根据实际环境所确定,而所减小缓冲阈值的缓冲节点也可以进一步的根据实际设置了的缓冲节点的数量来确定,本申请均不作限定。
本申请提供的一种传输控制方法,进入设定的播放场景后,检测所述电子设备是否处于音频播放设备连接状态,若检测到所述电子设备处于音频播放设备连接状态,则减小将所述音频数据传输给音频播放设备的过程中所途径的缓冲节点的缓冲阈值,从而使得电子设备在播放图像数据以及与该图像数据对应的音频数据时,可以在需要将音频数据传输给音频播放设备的情况下,减小表征触发开始对缓冲节点已经缓冲的音频数据进行处理的值,从而使得对于在缓冲节点的数据可以被更快的处理,以便提升缓冲节点中数据被处理的频率,从而使得将音频数据能够更快的被音频设备播放出来,减小音频播放延迟。
请参阅图2,本申请提供的一种传输控制方法,应用于电子设备,所述方法包括:
步骤S210:进入设定的播放场景,在所述播放场景中所播放的内容包括音频数据和图像数据,其中所述音频数据和所述图像数据相对应。
步骤S220:检测所述电子设备是否处于音频播放设备连接状态。
步骤S230:若检测到所述电子设备处于音频播放设备连接状态,获取所述图像数据所表征的画面内容的变化频率。
其中,可以理解的是图像数据包括多帧的图像。那么画面内容的变化频率表征的是连续多帧图像的内容的变化频率。而对于不同的图像数据其各自对应的内容的变化频率可以不同。例如,图像数据是游戏场景或者某些视频场景(电视剧或者电影),因为游戏场景或者电视剧场景或者电影场景中画面的变化频率比较高,那么在这种情况下对前述提到的音频数据延迟就要求较高,也就期望能够有较小的延迟甚至是用户无法识别的延迟。而对于另外一些视频场景,例如,知识讲解类的或者是某种课程类的视频场景中,因为画面会长期保持在相同的状态,而只是对应的音频数据会有不同的变化。例如,有些课程类的视频场景中,画面会长时间定格在一张PPT页面上,而对应的表征对PPT页面的内容进行讲解的音频会不断的变化。那么在这种情况,对于音频数据和图像数据的同步就要求相对而言不高,而对于音频数据的延迟也就可以不用太高。
那么基于上述情况,作为一种方式,可以获取所述图像数据所包括的连续多帧图像,再获取所述连续多帧图像各自的内容特征,基于所述内容特征,获取所述图像数据所表征的画面内容的变化频率。
作为一种方式,可以通过获取灰度平均值来确定图像的内容特征。在这种方式下,电子设备可以获取所述连续多帧图像各自的灰度平均值,基于所述灰度平均值获取所述连续多帧图像各自的内容特征。
下面再对上述提到的基于所述灰度平均值获取所述连续多帧图像各自的内容特征进行说明。
可以先将图像缩小到8x8的尺寸,总共64个像素。这一步的作用是去除各种图片尺寸和图片比例的差异,只保留结构、明暗等基本信息。再将缩小后的图片,转为64级灰度图片。计算图片中所有像素的灰度平均值。将每个像素的灰度与平均值进行比较,如果大于或等于平均值记为1,小于平均值记为0。将上一步的比较结果,组合在一起,就构成了一个64位的二进制整数,这就是这张图像的指纹。得到图像的指纹后,就可以对比不同的图像的指纹,计算出64位中有多少位是不一样的。如果不相同的数据位数不超过5,就说明两张图像很相似,如果大于10,说明它们是两张不同的图像。
那么如果连续检测采集n张图像后,在检测到相邻两张图像不相似后,非相似度加1,那么将比对完成该n张图像后得到的非相似度除以前述的n,所得到的值即为变化频率。
步骤S231:根据所述变化频率,减小将所述音频数据传输给音频播放设备 的过程中所途径的缓冲节点的缓冲阈值,其中,当检测到所述缓冲节点中已经缓冲的音频数据的大小符合所述缓冲阈值后,开始对所述缓冲节点已经缓冲的音频数据进行处理。
作为一种方式,若所述变化频率低于预设值,将所述音频数据传输给音频播放设备的过程中所途径的缓冲节点的缓冲阈值减小到第一缓冲阈值。若所述变化频率不低于预设值,将所述音频数据传输给音频播放设备的过程中所途径的缓冲节点的缓冲阈值减小到第二缓冲阈值,其中,所述第一缓冲阈值大于所述第二缓冲阈值。
此外,作为另外一件方式,还可以设定多个表示变化频率的不同变化范围的区间段,而多个区间段可以各自对应一个减小的缓冲阈值。例如,可以设定区间段A1表示变化频率为a1到a2,区间段A2表示变化频率为a2到a3,区间段A3表示变化频率为a3到a4。而其中区间段A1对应的所要减小的缓冲阈值为b1,而区间段A2对应的所要减小的缓冲阈值为b2,区间段A3对应的所要减小的缓冲阈值为b3。那么如果电子设备获取到变化频率X后,会先判X属于哪一个区间段。例如,若判断变化频率X属于区间段A1,那么电子设备确定缓冲节点所要减小的缓冲阈值为b1。
需要说明的是,在减小缓冲节点的缓冲阈值后,会在某种程度上提升处理器来对缓冲节点的数据进行处理的频率。例如,还是以前面的内容为例,若缓冲阈值为10kb,那么对于10kb的数据处理器只要处理1次即可,而若将缓冲阈值减小到5kb,那么对于10kb的数据,处理器需要处理2次,因此,也会在某种程度上增加了处理器的负担,而为了避免影响处理器处理其他数据的能力,造成电子设备整体的数据处理能力下降。
那么基于图像数据对应的变化频率,来确定所减小的缓冲阈值的大小的情况下,可以在当前的图像数据需要对应的音频不延迟或者延迟较小时,更多的减小缓冲节点的缓冲阈值,而在当前的图像数据对应的音频延迟要求不高时,依然保持原有的缓冲阈值或者是相对而言较小的减小缓冲阈值,进而可以使得对于缓冲阈值的控制更加灵活,能够起到在能够灵活的减小音频数据延迟的同时,可以避免影响处理器处理其他数据的能力,从而保证电子设备的整体的数据处理能力不会受到影响。
若检测到所述电子设备未处于音频播放设备连接状态,结束流程。
本申请提供的一种传输控制方法,进入设定的播放场景后,检测所述电子设备是否处于音频播放设备连接状态,若检测到所述电子设备处于音频播放设备连接状态,则获取所述图像数据所表征的画面内容的变化频率,根据所述变化频率减小将所述音频数据传输给音频播放设备的过程中所途径的缓冲节点的缓冲阈值,从而使得对于在缓冲节点的数据可以被更快的处理,以便提升缓冲节点中数据被处理的频率,从而使得将音频数据能够更快的被音频设备播放出来,减小音频播放延迟。
请参阅图3,本申请提供的一种传输控制方法,应用于电子设备,所述方法包括:
步骤S310:进入设定的播放场景,在所述播放场景中所播放的内容包括音频数据和图像数据,其中所述音频数据和所述图像数据相对应。
步骤S320:检测所述电子设备是否处于音频播放设备连接状态。
步骤S330:若检测到所述电子设备处于音频播放设备连接状态,减小将所述音频数据传输给音频播放设备的过程中所经过的缓冲节点的缓冲阈值,其中,当检测到所述缓冲节点中已经缓冲的音频数据的大小符合所述缓冲阈值后,开始对所述缓冲节点已经缓冲的音频数据进行处理。
步骤S340:若检测到所述电子设备处于音频播放设备连接状态,提升所述电子设备的处理器的工作频率。
作为一种方式,获取所述缓冲节点减小后的缓冲阈值与减小前的缓冲阈值的比值,基于所述比值提升所述电子设备的处理器的工作频率。电子设备可以基于下述数据表来确定处理器的工作频率的提升幅度。
ID ratio Promotion
1 a bGHZ
2 c dGHZ
其中,字段ratio表征所述缓冲节点减小后的缓冲阈值与减小前的缓冲阈值的比值,而字段Promotion表征所提升的工作频率。那么在检测到比值为a时,提升bGHZ的工作频率,而在检测到比值为b时,提升DGHZ的工作频率。此外,还可以以阶段值对应同一个提升工作频率,例如,若检测到比值为a到a1,均可以对应值为b的工作频率的提升。
本申请提供的一种传输控制方法,进入设定的播放场景后,检测所述电子 设备是否处于音频播放设备连接状态,若检测到所述电子设备处于音频播放设备连接状态,则获取所述图像数据所表征的画面内容的变化频率,根据所述变化频率减小将所述音频数据传输给音频播放设备的过程中所途径的缓冲节点的缓冲阈值,并同时提升处理器的处理频率,从而使得对于在缓冲节点的数据可以被更快的处理,以便提升缓冲节点中数据被处理的频率,从而使得将音频数据能够更快的被音频设备播放出来,减小音频播放延迟。
请参阅图4,本申请提供的一种传输控制装置400,运行于电子设备,所述装置400包括:
播放场景触发单元410,用于触发所述电子设备进入设定的播放场景,在所述播放场景中所播放的内容包括音频数据和图像数据,其中所述音频数据和所述图像数据相对应。
连接状态检测单元420,用于检测所述电子设备是否处于音频播放设备连接状态。
作为一种方式,连接状态检测单元420,具体用于检测电子设备是否通过蓝牙连接有蓝牙设备;若检测到电子设备连接有蓝牙设备,检测所述蓝牙设备的类型是否为音频设备类型;若是,则判断电子设备处于音频播放设备连接状态。
传输控制单元430,用于若所述连接状态检测单元检测到所述电子设备处于音频播放设备连接状态,减小将所述音频数据传输给音频播放设备的过程中所经过的缓冲节点的缓冲阈值,其中,当检测到所述缓冲节点中已经缓冲的音频数据的大小符合所述缓冲阈值后,开始对所述缓冲节点已经缓冲的音频数据进行处理。
请参阅图5,本申请提供的一种传输控制装置500,运行于电子设备,所述装置500包括:
播放场景触发单元510,用于触发所述电子设备进入设定的播放场景,在所述播放场景中所播放的内容包括音频数据和图像数据,其中所述音频数据和所述图像数据相对应。
连接状态检测单元520,用于检测所述电子设备是否处于音频播放设备连接状态。
内容检测单元530,用于若连接状态检测单元520检测到所述电子设备处于音频播放设备连接状态,获取所述图像数据所表征的画面内容的变化频率。
作为一种方式,内容检测单元530包括:
帧图像获取子单元531,用于获取所述图像数据所包括的连续多帧图像。
内容特征获取子单元532,用于获取所述连续多帧图像各自的内容特征。
作为一种方式,内容特征获取子单元532,具体用于获取所述连续多帧图像各自的灰度平均值,基于所述灰度平均值获取所述连续多帧图像各自的内容特征。
变化频率获取子单元533,用于基于所述内容特征,获取所述图像数据所表征的画面内容的变化频率。
传输控制单元540,用于根据所述变化频率,减小将所述音频数据传输给音频播放设备的过程中所途径的缓冲节点的缓冲阈值,其中,当检测到所述缓冲节点中已经缓冲的音频数据的大小符合所述缓冲阈值后,开始对所述缓冲节点已经缓冲的音频数据进行处理。
请参阅图6,本申请提供的一种传输控制装置600,运行于电子设备,所述装置600包括:
播放场景触发单元610,用于进入设定的播放场景,在所述播放场景中所播放的内容包括音频数据和图像数据,其中所述音频数据和所述图像数据相对应。
连接状态检测单元620,用于检测所述电子设备是否处于音频播放设备连接状态。
传输控制单元630,用于若连接状态检测单元620检测到所述电子设备处于音频播放设备连接状态,减小将所述音频数据传输给音频播放设备的过程中所经过的缓冲节点的缓冲阈值,其中,当检测到所述缓冲节点中已经缓冲的音频数据的大小符合所述缓冲阈值后,开始对所述缓冲节点已经缓冲的音频数据进行处理。
处理器控制单元640,用于若连接状态检测单元620检测到所述电子设备处于音频播放设备连接状态,提升所述电子设备的处理器的工作频率。
需要说明的是,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
需要说明的是,本申请中具体如何根据音频编码类型对音频数据进行编码是可以采用现有的技术,本申请就不再细述。
综上所述,本申请提供的一种传输控制方法、装置、电子设备及存储介质, 进入设定的播放场景后,检测所述电子设备是否处于音频播放设备连接状态,若检测到所述电子设备处于音频播放设备连接状态,则减小将所述音频数据传输给音频播放设备的过程中所途径的缓冲节点的缓冲阈值,从而使得电子设备在播放图像数据以及与该图像数据对应的音频数据时,可以在需要将音频数据传输给音频播放设备的情况下,减小表征触发开始对缓冲节点已经缓冲的音频数据进行处理的值,从而使得对于在缓冲节点的数据可以被更快的处理,以便提升缓冲节点中数据被处理的频率,从而使得将音频数据能够更快的被音频设备播放出来,减小音频播放延迟。
下面将结合图7对本申请提供的一种电子设备进行说明。
请参阅图7,基于上述的传输控制方法、装置,本申请实施例还提供的另一种可以执行前述终端控制方法的电子设备100。电子设备100包括相互耦合的一个或多个(图中仅示出一个)处理器102、存储器104、无线模块106以及音频电路110。其中,该存储器104中存储有可以执行前述实施例中内容的程序,而处理器102可以执行该存储器104中存储的程序。
具体的,所述存储器104可用于存储软件程序以及模块,例如,存储器104中可以存储有传输控制装置。该传输控制装置可以为前述的装置400、装置500或者装置600。所述处理器102通过运行存储在所述存储器104内的软件程序以及模块,从而执行各种功能应用以及数据处理。所述存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,所述存储器104可进一步包括相对于所述处理器102远程设置的存储器。
所述无线模块106用于接收以及发送电磁波,实现电磁波与电信号的相互转换,从而与通讯网络或者其他设备进行通讯。所述无线模块106可与各种网络如互联网、企业内部网、无线网络进行通讯或者通过无线网络与其他设备进行通讯。上述的无线网络可包括蜂窝式电话网、无线局域网或者城域网。上述的无线网络可以使用各种通信标准、协议及技术,包括但并不限于全球移动通信系统(Global System for Mobile Communication,GSM)、IEEE 802协议以及蓝牙协议。
其中,音频数据可以从所述存储器104处或者通过所述无线模块106获取。此外,音频数据也可以存储至所述存储器104中或者通过所述无线模块106进行发送。该无线模块106可以为蓝牙通信模块、WIFI通信模块或者支持其他无 线通信协议的模块。
再者,该音频电路110还可以用于对于要通过蓝牙(当无线模块106基于蓝牙通信协议传输数据时)传输的音频数据进行编码,其中,编码时所采用的音频编码类型可以根据前述实施例提供的方式得到。
本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。此外,在本申请各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。
请参考图8,其示出了本申请实施例提供的一种计算机可读存储介质的结构框图。该计算机可读介质800中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。
计算机可读存储介质800可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读存储介质800包括非易失性计算机可读介质(non-transitory computer-readable storage medium)。计算机可读存储介质800具有执行上述方法中的任何方法步骤的程序代码810的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码810可以例如以适当形式进行压缩。
上述提到的存储介质可以是只读存储器,磁盘或光盘等。尽管上面已经示出和描述了本申请的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本申请的限制,本领域的普通技术人员在本申请的范围内可以对上述实施例进行变化、修改、替换和变型。
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。

Claims (20)

  1. 一种传输控制方法,其特征在于,应用于电子设备,所述方法包括:
    进入设定的播放场景,在所述播放场景中所播放的内容包括音频数据和图像数据,其中所述音频数据和所述图像数据相对应;
    检测所述电子设备是否处于音频播放设备连接状态;
    若检测到所述电子设备处于音频播放设备连接状态,减小将所述音频数据传输给音频播放设备的过程中所经过的缓冲节点的缓冲阈值,其中,当检测到所述缓冲节点中已经缓冲的音频数据的大小符合所述缓冲阈值后,开始对所述缓冲节点已经缓冲的音频数据进行处理。
  2. 根据权利要求1所述的方法,其特征在于,所述减小将所述音频数据传输给音频播放设备的过程中所经过的缓冲节点的缓冲阈值的步骤包括:
    获取所述图像数据所表征的画面内容的变化频率,所述图像数据包括多帧的图像,所述画面内容的变化频率表征连续多帧图像的内容的变化频率,不同的图像数据其各自对应的内容的变化频率不同;
    根据所述变化频率,减小将所述音频数据传输给音频播放设备的过程中所途径的缓冲节点的缓冲阈值。
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述变化频率,减小将所述音频数据传输给音频播放设备的过程中所途径的缓冲节点的缓冲阈值的步骤包括:
    若所述变化频率低于预设值,将所述音频数据传输给音频播放设备的过程中所途径的缓冲节点的缓冲阈值减小到第一缓冲阈值;
    若所述变化频率不低于预设值,将所述音频数据传输给音频播放设备的过程中所途径的缓冲节点的缓冲阈值减小到第二缓冲阈值,其中,所述第一缓冲阈值大于所述第二缓冲阈值。
  4. 根据权利要求2所述的方法,其特征在于,所述变化频率包括不同变化范围的多个区间段的变化频率,所述多个区间段各自对应一个减小的缓冲阈值,所述根据所述变化频率,减小将所述音频数据传输给音频播放设备的过程中所途径的缓冲节点的缓冲阈值的步骤包括:
    根据所述变化频率所属区间段所对应的缓冲阈值减小将所述音频数据传输给音频播放设备的过程中所途径的缓冲节点的缓冲阈值。
  5. 根据权利要求4所述的方法,其特征在于,所述根据所述变化频率所属区间段所对应的缓冲阈值减小将所述音频数据传输给音频播放设备的过程中所途径的缓冲节点的缓冲阈值的步骤包括:
    获取所述变化频率的所属区间段;
    获取与所述所属区间段对应的缓冲阈值;
    将所述缓冲阈值作为减小将所述音频数据传输给音频播放设备的过程中所途径的缓冲节点的缓冲阈值。
  6. 根据权利要求2所述的方法,其特征在于,所述根据所述变化频率,减小将所述音频数据传输给音频播放设备的过程中所途径的缓冲节点的缓冲阈值的步骤包括:
    在当前的所述图像数据需要对应的音频不延迟或者延迟较小时,更多的减小缓冲节点的缓冲阈值,而在当前的所述图像数据对应的音频延迟要求不高时,依然保持原有的缓冲阈值或者是相对而言较小的减小缓冲阈值,进而可以使得对于缓冲阈值的控制更加灵活。
  7. 根据权利要求2所述的方法,其特征在于,所述获取所述图像数据所表征的画面内容的变化频率的步骤包括:
    获取所述图像数据所包括的连续多帧图像;
    获取所述连续多帧图像各自的内容特征;
    基于所述内容特征,获取所述图像数据所表征的画面内容的变化频率。
  8. 根据权利要求7所述的方法,其特征在于,所述获取所述连续多帧图像各自的内容特征的步骤包括:
    获取所述连续多帧图像各自的灰度平均值;
    基于所述灰度平均值获取所述连续多帧图像各自的内容特征。
  9. 根据权利要求1所述的方法,其特征在于,所述减小将所述音频数据传输给音频播放设备的过程中所经过的缓冲节点的缓冲阈值的步骤包括:
    减小将所述音频数据传输给音频播放设备的过程中所经过的全部缓冲节点的缓冲阈值或是其中部分缓冲节点的缓冲阈值。
  10. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    获取所述缓冲节点减小后的缓冲阈值与减小前的缓冲阈值的比值;
    基于所述比值提升所述电子设备的处理器的工作频率。
  11. 根据权利要求1-10任一项所述的方法,其特征在于,所述缓冲阈值包 括不大于所述缓冲节点的最大可存储数据的值。
  12. 根据权利要求1所述的方法,其特征在于,所述检测所述电子设备是否处于音频播放设备连接状态包括:
    检测电子设备是否通过蓝牙连接有蓝牙设备;
    若检测到电子设备连接有蓝牙设备,检测所述蓝牙设备的类型是否为音频设备类型;
    若是,则判断电子设备处于音频播放设备连接状态。
  13. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    若检测到所述电子设备未处于音频播放设备连接状态,取消减小将所述音频数据传输给音频播放设备的过程中所经过的缓冲节点的缓冲阈值。
  14. 一种传输控制装置,其特征在于,运行于电子设备,所述装置包括:
    播放场景触发单元,用于触发所述电子设备进入设定的播放场景,在所述播放场景中所播放的内容包括音频数据和图像数据,其中所述音频数据和所述图像数据相对应;
    连接状态检测单元,用于检测所述电子设备是否处于音频播放设备连接状态;
    传输控制单元,用于若所述连接状态检测单元检测到所述电子设备处于音频播放设备连接状态,减小将所述音频数据传输给音频播放设备的过程中所经过的缓冲节点的缓冲阈值,其中,当检测到所述缓冲节点中已经缓冲的音频数据的大小符合所述缓冲阈值后,开始对所述缓冲节点已经缓冲的音频数据进行处理。
  15. 根据权利要求14所述的装置,其特征在于,所述连接状态检测单元用于:
    检测电子设备是否通过蓝牙连接有蓝牙设备;
    若检测到电子设备连接有蓝牙设备,检测所述蓝牙设备的类型是否为音频设备类型;
    若是,则判断电子设备处于音频播放设备连接状态。
  16. 根据权利要求14所述的装置,其特征在于,所述装置还包括:
    内容检测单元,用于若所述连接状态检测单元检测到所述电子设备处于音频播放设备连接状态,获取所述图像数据所表征的画面内容的变化频率。
  17. 根据权利要求16所述的装置,其特征在于,所述内容检测单元包括:
    帧图像获取子单元,用于获取所述图像数据所包括的连续多帧图像;
    内容特征获取子单元,用于获取所述连续多帧图像各自的内容特征;
    变化频率获取子单元,用于基于所述内容特征,获取所述图像数据所表征的画面内容的变化频率。
  18. 根据权利要求14所述的装置,其特征在于,所述装置还包括:
    处理器控制单元,用于若所述连接状态检测单元检测到所述电子设备处于音频播放设备连接状态,提升所述电子设备的处理器的工作频率。
  19. 一种电子设备,其特征在于,包括一个或多个处理器以及存储器;
    一个或多个程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行权利要求1-13任一所述的方法。
  20. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有程序代码,其中,在所述程序代码被处理器运行时执行权利要求1-13任一所述的方法。
PCT/CN2019/093959 2018-08-14 2019-06-29 传输控制方法、装置、电子设备及存储介质 WO2020034780A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810928162.XA CN109144463B (zh) 2018-08-14 2018-08-14 传输控制方法、装置以及电子设备
CN201810928162.X 2018-08-14

Publications (1)

Publication Number Publication Date
WO2020034780A1 true WO2020034780A1 (zh) 2020-02-20

Family

ID=64789494

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/093959 WO2020034780A1 (zh) 2018-08-14 2019-06-29 传输控制方法、装置、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN109144463B (zh)
WO (1) WO2020034780A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114501158A (zh) * 2020-10-27 2022-05-13 海信视像科技股份有限公司 显示设备、外接音响设备及外接音响设备音频输出的方法

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109144463B (zh) * 2018-08-14 2020-08-25 Oppo广东移动通信有限公司 传输控制方法、装置以及电子设备
CN110505613B (zh) * 2019-08-19 2022-11-04 惠州Tcl移动通信有限公司 音频数据处理方法、计算机可读存储介质以及计算机设备
CN112669859B (zh) * 2019-10-16 2024-04-02 Oppo广东移动通信有限公司 一种通信模式控制方法及装置
CN114979783B (zh) * 2021-02-26 2024-04-09 华为技术有限公司 一种音视频播放方法、装置和电子设备
CN115629733B (zh) * 2022-12-20 2023-03-28 翱捷科技(深圳)有限公司 音频播放方法、芯片、系统及存储介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6744815B1 (en) * 1998-03-31 2004-06-01 Optibase Ltd. Method for synchronizing audio and video streams
CN1567971A (zh) * 2003-07-07 2005-01-19 英业达集团(南京)电子技术有限公司 利用无线终端机自无线网络即时接收并播放语音数据的方法
US20070046817A1 (en) * 2005-08-24 2007-03-01 Yoriko Yagi Processor, processing method and processing program
CN102177691A (zh) * 2008-08-08 2011-09-07 思科技术公司 减少媒体流延迟的系统和方法
CN103078810A (zh) * 2012-12-31 2013-05-01 中国科学院自动化研究所 一种高效率富媒体展现系统和方法
CN105556977A (zh) * 2013-09-04 2016-05-04 高通股份有限公司 动态及自动控制音频/视频流送的等待时间缓冲
CN109144463A (zh) * 2018-08-14 2019-01-04 Oppo广东移动通信有限公司 传输控制方法、装置以及电子设备

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20120108564A (ko) * 2011-03-24 2012-10-05 삼성전자주식회사 데이터 처리 시스템 및 그 동작 방법
CN103795950B (zh) * 2014-02-21 2017-07-28 深圳创维-Rgb电子有限公司 电视音频信号处理装置
CN105376628B (zh) * 2014-08-27 2018-09-21 深圳Tcl新技术有限公司 音视频信号同步方法和装置
CN107710754B (zh) * 2016-05-06 2020-02-21 华为技术有限公司 音视频数据同步方法和装置
CN106649586A (zh) * 2016-11-18 2017-05-10 腾讯音乐娱乐(深圳)有限公司 一种音频文件的播放方法及装置
CN108366299A (zh) * 2018-03-29 2018-08-03 上海七牛信息技术有限公司 一种媒体播放方法以及装置

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6744815B1 (en) * 1998-03-31 2004-06-01 Optibase Ltd. Method for synchronizing audio and video streams
CN1567971A (zh) * 2003-07-07 2005-01-19 英业达集团(南京)电子技术有限公司 利用无线终端机自无线网络即时接收并播放语音数据的方法
US20070046817A1 (en) * 2005-08-24 2007-03-01 Yoriko Yagi Processor, processing method and processing program
CN102177691A (zh) * 2008-08-08 2011-09-07 思科技术公司 减少媒体流延迟的系统和方法
CN103078810A (zh) * 2012-12-31 2013-05-01 中国科学院自动化研究所 一种高效率富媒体展现系统和方法
CN105556977A (zh) * 2013-09-04 2016-05-04 高通股份有限公司 动态及自动控制音频/视频流送的等待时间缓冲
CN109144463A (zh) * 2018-08-14 2019-01-04 Oppo广东移动通信有限公司 传输控制方法、装置以及电子设备

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114501158A (zh) * 2020-10-27 2022-05-13 海信视像科技股份有限公司 显示设备、外接音响设备及外接音响设备音频输出的方法

Also Published As

Publication number Publication date
CN109144463A (zh) 2019-01-04
CN109144463B (zh) 2020-08-25

Similar Documents

Publication Publication Date Title
WO2020034780A1 (zh) 传输控制方法、装置、电子设备及存储介质
CN109151194B (zh) 数据传输方法、装置、电子设备以及存储介质
CN109275129B (zh) 通信处理方法、装置、电子设备及存储介质
US11202066B2 (en) Video data encoding and decoding method, device, and system, and storage medium
JP2017515395A5 (zh)
CN109273017B (zh) 编码控制方法、装置以及电子设备
CN109819303B (zh) 数据输出方法及相关设备
WO2016018926A1 (en) Direct streaming for wireless display
CN109151212B (zh) 设备控制方法、装置以及电子设备
CN109107158B (zh) 音效处理方法、装置、电子设备及计算机可读存储介质
US20230057544A1 (en) Systems and methods for adaptively improving the perceived quality of a video conference by passive users
KR102534443B1 (ko) 비디오 증강 제어 방법, 장치, 전자 기기 및 저장 매체
CN111124351B (zh) 音频输出方法、装置、电子设备以及存储介质
US11908481B2 (en) Method for encoding live-streaming data and encoding device
CN112565876B (zh) 投屏方法、装置、设备、系统及存储介质
US11889128B2 (en) Call audio playback speed adjustment
CN112423074B (zh) 音视频同步处理方法、装置、电子设备及存储介质
US20220246133A1 (en) Systems and methods of handling speech audio stream interruptions
CN115022766B (zh) 音频数据播放方法及设备
CN109524024B (zh) 一种音频播放方法、介质、装置和计算设备
CN116155874A (zh) 音频传输方法、电子设备及存储介质
CN108616767B (zh) 一种音频数据传输方法及装置
JP5646441B2 (ja) 車載装置と携帯情報端末との間で利用される無線によるコンテンツ転送システム
CN110708417B (zh) 一种语音切换方法、装置、终端及计算机可读存储介质
CN106708463B (zh) 调节拍摄的视频文件的音量的方法及设备

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: 19850456

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: 19850456

Country of ref document: EP

Kind code of ref document: A1