CN110856152A - Method, device, electronic equipment and medium for playing audio data - Google Patents
Method, device, electronic equipment and medium for playing audio data Download PDFInfo
- Publication number
- CN110856152A CN110856152A CN201911031990.4A CN201911031990A CN110856152A CN 110856152 A CN110856152 A CN 110856152A CN 201911031990 A CN201911031990 A CN 201911031990A CN 110856152 A CN110856152 A CN 110856152A
- Authority
- CN
- China
- Prior art keywords
- audio data
- data stream
- target
- playing
- residual
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 61
- 230000005540 biological transmission Effects 0.000 claims description 56
- 238000004891 communication Methods 0.000 claims description 36
- 238000001514 detection method Methods 0.000 claims description 15
- 238000012545 processing Methods 0.000 claims description 14
- 230000002093 peripheral effect Effects 0.000 description 10
- 230000001133 acceleration Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 3
- 241001122767 Theaceae Species 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 2
- 239000000919 ceramic Substances 0.000 description 2
- 230000007547 defect Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000003672 processing method Methods 0.000 description 2
- 238000010926 purge Methods 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 230000008094 contradictory effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 230000006641 stabilisation Effects 0.000 description 1
- 238000011105 stabilization Methods 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/80—Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/16—Sound input; Sound output
- G06F3/165—Management of the audio stream, e.g. setting of volume, audio stream path
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/72—Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
- H04M1/724—User interfaces specially adapted for cordless or mobile telephones
- H04M1/72403—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
- H04M1/72409—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories
- H04M1/72412—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories using two-way short-range wireless interfaces
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/72—Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
- H04M1/724—User interfaces specially adapted for cordless or mobile telephones
- H04M1/72403—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
- H04M1/72442—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality for playing music files
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W28/00—Network traffic management; Network resource management
- H04W28/02—Traffic management, e.g. flow control or congestion control
- H04W28/10—Flow control between communication endpoints
- H04W28/14—Flow control between communication endpoints using intermediate storage
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M2250/00—Details of telephonic subscriber devices
- H04M2250/02—Details of telephonic subscriber devices including a Bluetooth interface
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Human Computer Interaction (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- General Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Reverberation, Karaoke And Other Acoustics (AREA)
Abstract
The application discloses a method, a device, electronic equipment and a medium for playing audio data. By applying the technical scheme of the application, when the Bluetooth equipment is connected with the mobile phone and plays music, all the residual data of the music can be received and stored in the cache in advance, so that when the mobile phone is disconnected with the Bluetooth equipment, the music can be continuously played according to the residual data stored in the cache. And then can avoid the problem that exists in the correlation technique when mobile terminal and bluetooth equipment disconnection, can't continue to play audio data.
Description
Technical Field
The present application relates to data processing technologies, and in particular, to a method, an apparatus, an electronic device, and a medium for playing audio data
Background
Due to the rise of the communications era and society, smart devices have been continuously developed with the use of more and more users.
With the rapid development of the internet, people have become a normal state for enjoying various videos and music by using wireless playing equipment. The wireless playing device may be a playing device connected by bluetooth. For example, there may be a bluetooth headset, a bluetooth speaker, etc. Further, for example, the bluetooth speaker is used, and during the working process of the bluetooth speaker, the speaker and the mobile phone can perform wireless communication in a bluetooth connection mode. The user can enjoy the audio through the left and right sound track player of the Bluetooth sound box.
However, in the related art, when a user connects a bluetooth device through a mobile terminal to enjoy music, when the distance between the mobile terminal and the bluetooth device is long, the mobile terminal and the bluetooth device are disconnected, and then the music cannot be played continuously, which also reduces the audiovisual experience of the user.
Disclosure of Invention
The embodiment of the application provides a method and a device for playing audio data, electronic equipment and a medium.
According to an aspect of an embodiment of the present application, there is provided a method for playing audio data, including:
when a first audio data stream transmitted by a target device in real time is received, playing a first part of target audio data based on the received first audio data stream, wherein the target audio data comprises the first part and a second part;
sending a transmission request to the target device, the transmission request being used to obtain a residual audio data stream for the target audio data, the residual audio data stream corresponding to a second portion of the target audio data;
when the residual audio data stream of the target audio data is acquired, storing the residual audio data stream into a local cache;
and when an interruption event is detected to occur, playing a second part of the target audio data by using the residual audio data stream, wherein the interruption event is an event of communication disconnection with the target equipment.
Optionally, in another embodiment based on the foregoing method of the present application, after the storing the remaining audio data stream into a local cache when the remaining audio data stream of the target audio data is acquired, the method further includes:
and when the interruption event is not detected, receiving a second audio data stream sent by the target equipment in real time, and playing a second part of the target audio data.
Optionally, in another embodiment based on the above method of the present application, the playing the second portion of the target audio data by using the remaining audio data stream when the occurrence of the interruption event is detected includes:
when an interruption event is detected to occur, determining a first playing progress corresponding to the target audio data based on the first audio data stream;
selecting a third audio data stream based on a first playing progress corresponding to the target audio data, wherein the third audio data stream is a data stream generated based on the residual audio data stream;
playing a second portion of the target audio data using the third audio data stream.
Optionally, in another embodiment based on the method described above, after the playing the second portion of the target audio data by using the third audio data stream, the method further includes:
when a connection event is detected to occur, determining a second playing progress corresponding to the second part of the target audio data by using the third audio data stream, wherein the connection disconnection event is an event in communication connection with the target equipment;
when the second part of the target audio data is determined to be not played completely according to the second playing progress, a fourth audio data stream sent by the target device in real time is obtained, wherein the fourth audio data stream is a data stream generated according to the second playing progress;
playing a second portion of the target audio data based on the fourth audio data stream.
Optionally, in another embodiment based on the foregoing method of the present application, after the playing the first portion of the target audio data, the method further includes:
detecting a transmission quality of the first audio data stream;
and when the transmission quality of the first audio data stream is determined to be lower than a preset threshold value, sending the transmission request to the target equipment.
Optionally, in another embodiment based on the foregoing method of the present application, after the playing the first portion of the target audio data, the method further includes:
detecting electric quantity information of the target equipment;
when the electric quantity information of the target device is determined to be lower than the electric quantity threshold value, the transmission request is sent to the target device.
Optionally, in another embodiment based on the foregoing method of the present application, after the playing the second portion of the target audio data, the method further includes:
and when the second part of the target audio data is determined to be played, clearing the residual audio data stream from the local cache.
According to another aspect of the embodiments of the present application, there is provided an apparatus for playing audio data, including:
the device comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for playing a first part of target audio data based on a received first audio data stream when the first audio data stream sent by a target device in real time is received, and the target audio data comprises the first part and a second part;
a sending module configured to send a transmission request to the target device, the transmission request being used to obtain a remaining audio data stream for the target audio data, the remaining audio data stream corresponding to a second portion of the target audio data;
the storage module is used for storing the residual audio data stream into a local cache when the residual audio data stream of the target audio data is acquired;
a detection module configured to play a second portion of the target audio data using the remaining audio data stream when an interruption event is detected to occur, the interruption event being an event that communication with the target device is disconnected.
According to another aspect of the embodiments of the present application, there is provided an electronic device including:
a memory for storing executable instructions; and
and the display is used for displaying with the memory to execute the executable instructions so as to complete the operation of any one of the methods for playing the audio data.
According to a further aspect of the embodiments of the present application, there is provided a computer-readable storage medium for storing computer-readable instructions, which when executed perform the operations of any one of the methods for playing audio data described above.
According to the method and device for playing the audio data, when a first audio data stream sent by a target device in real time is received, a first part of the target audio data is played, a transmission request for obtaining a residual audio data stream aiming at the target audio data is sent to the target device, when the residual audio data stream of the target audio data is obtained, the residual audio data stream is stored in a local cache, and when an interrupt event of communication disconnection with the target device is detected, a second part of the target audio data is played by using the residual audio data stream. By applying the technical scheme of the application, when the Bluetooth equipment is connected with the mobile phone and plays music, all the residual data of the music can be received and stored in the cache in advance, so that when the mobile phone is disconnected with the Bluetooth equipment, the music can be continuously played according to the residual data stored in the cache. And then can avoid the problem that exists in the correlation technique when mobile terminal and bluetooth equipment disconnection, can't continue to play audio data.
The technical solution of the present application is further described in detail by the accompanying drawings and examples.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description, serve to explain the principles of the application.
The present application may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:
FIG. 1 is a schematic diagram of a system for playing audio data according to the present application;
fig. 2 is a schematic diagram of a method for playing audio data according to the present application;
fig. 3 is a schematic diagram of another method for playing audio data according to the present application;
FIG. 4 is a schematic structural diagram of an apparatus for playing audio data according to the present application;
fig. 5 is a schematic view of an electronic device according to the present application.
Detailed Description
Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present application unless specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the application, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
In addition, technical solutions between the various embodiments of the present application may be combined with each other, but it must be based on the realization of the technical solutions by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination of technical solutions should be considered to be absent and not within the protection scope of the present application.
It should be noted that all the directional indicators (such as upper, lower, left, right, front and rear … …) in the embodiment of the present application are only used to explain the relative position relationship between the components, the motion situation, etc. in a specific posture (as shown in the drawings), and if the specific posture is changed, the directional indicator is changed accordingly.
A method for playing audio data according to an exemplary embodiment of the present application is described below in conjunction with fig. 1-3. It should be noted that the following application scenarios are merely illustrated for the convenience of understanding the spirit and principles of the present application, and the embodiments of the present application are not limited in this respect. Rather, embodiments of the present application may be applied to any scenario where applicable.
Fig. 1 shows a schematic diagram of an exemplary system architecture 100 to which a video processing method or a video processing apparatus of an embodiment of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. For example, server 105 may be a server cluster comprised of multiple servers, or the like.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may be various electronic devices having a display screen, including but not limited to smart phones, tablet computers, portable computers, desktop computers, and the like.
The terminal apparatuses 101, 102, 103 in the present application may be terminal apparatuses that provide various services. For example, when a user receives a first audio data stream sent by a target device in real time through a terminal device 103 (which may also be the terminal device 101 or 102), playing a first part of target audio data based on the received first audio data stream, where the target audio data includes the first part and a second part; sending a transmission request to the target device, the transmission request being used to obtain a residual audio data stream for the target audio data, the residual audio data stream corresponding to a second portion of the target audio data; when the residual audio data stream of the target audio data is acquired, storing the residual audio data stream into a local cache; and when an interruption event is detected to occur, playing a second part of the target audio data by using the residual audio data stream, wherein the interruption event is an event of communication disconnection with the target equipment.
It should be noted that the video processing method provided in the embodiments of the present application may be executed by one or more of the terminal devices 101, 102, and 103, and/or the server 105, and accordingly, the video processing apparatus provided in the embodiments of the present application is generally disposed in the corresponding terminal device, and/or the server 105, but the present application is not limited thereto.
The application also provides a method, a device, a target terminal and a medium for playing the audio data.
Fig. 2 schematically shows a flow chart of a method of playing audio data according to an embodiment of the present application. As shown in fig. 2, the method is applied to a bluetooth device, and includes:
s101, when a first audio data stream transmitted by a target device in real time is received, playing a first part of target audio data based on the received first audio data stream, wherein the target audio data comprises the first part and a second part.
It should be noted that, in the present application, the target device is not specifically limited, and may be, for example, an intelligent device or a server. The mobile terminal may be a PC (Personal Computer), a smart phone, a tablet PC, an e-book reader, an MP3(Moving Picture Experts Group audio Layer III) player for playing audio data, an MP4(Moving Picture Experts Group audio Layer IV) player for playing audio data, a portable Computer, and other mobile terminal devices with display functions, and so on.
Further, the bluetooth device is not specifically limited in this application, and may be, for example, various bluetooth headsets, bluetooth speakers, and the like. Similarly, the number of bluetooth devices is not specifically limited in this application, and may be, for example, 2 or more.
With the development of wireless communication and near field technologies, more and more scenes exist in which bluetooth is used by mobile terminal devices, and data transmission can be performed between mobile terminals through bluetooth. Meanwhile, the mobile terminal and the bluetooth device are connected in a matching manner in more and more scenes, for example, a user can take a bluetooth headset to answer a call more conveniently when driving, or a bluetooth sound box is used at home to play audio and video, and the like. In the related art, when the mobile terminal and the bluetooth device are connected in a pairing manner, the bluetooth device receives an audio data stream sent by the mobile terminal in real time and plays music according to the received data stream.
For example, in an office environment, most users prefer to work while listening to music while wearing a bluetooth headset. Meanwhile, the user can keep wearing the Bluetooth headset, the user needs to briefly go to a toilet to wash the face or cut tea in a tea room to pour water, and the Bluetooth headset gradually leaves the effective connection range of the mobile terminal under the condition that the place is far away, so that the Bluetooth headset is interrupted, music cannot be continuously played, and user experience is affected. Or, when the user wears the bluetooth headset to listen to music, the user just passes through an area with large interference, which also causes the mobile terminal and the bluetooth headset to be disconnected temporarily due to the interference. And then the music is paused, which affects the user experience.
Therefore, in order to solve the problems in the related art, in the present application, first, when a first audio data stream transmitted by a target device in real time is received, a first portion of target audio data is played based on the received first audio data stream. It should be noted that the present application does not specifically limit the target audio data. That is, the target audio data may be music or audio data in video. In addition, the target audio data should include two parts, i.e., a first part and a second part. The first portion and the second portion are not specifically limited in the present application, that is, the first portion may be audio data in any range of the target audio data, and the second portion may also be audio data in any range of the target audio data.
S102, sending a transmission request to the target device, wherein the transmission request is used for obtaining the residual audio data stream aiming at the target audio data, and the residual audio data stream corresponds to the second part of the target audio data.
In this application, the following description will be given taking a target device as a mobile terminal as an example: after obtaining the first audio data stream of the target device, a transmission request for obtaining a remaining audio data stream for the target audio data may be sent to the target device. Wherein the remaining audio data stream is an audio data stream corresponding to the second portion of the target audio data. It can be understood that, in order to avoid the above-mentioned disadvantage of the related art that the bluetooth device cannot continue playing music when the mobile terminal is disconnected from the bluetooth device. In the application, when the Bluetooth device starts to play music, the mobile terminal is requested to send all the residual data streams of the music to the mobile terminal. So that the music can be played continuously according to the data stream received in advance when the remaining data stream of the music cannot be received continuously.
It should be noted that, the present application does not specifically limit the time when the bluetooth device sends the transmission request to the target device, and for example, the transmission request may be sent to the target device after a preset time for playing the target audio data is detected. It may also be that a transmission request or the like is sent to the target device after detecting that the current communication status is below a preset condition.
In yet another embodiment of the present application, after playing the first portion of the target audio data, the following steps may be further implemented:
detecting electric quantity information of target equipment;
and when the power information of the target device is determined to be lower than the power threshold value, sending a transmission request to the target device.
In this application, after the first part of the target audio data is played, in order to avoid the above-mentioned disadvantage that the bluetooth device cannot continue playing music when the mobile terminal is disconnected from the bluetooth device. The method and the device can detect the electric quantity information of the target device at first to avoid the defect that the target device cannot continue playing music when the target device is powered off due to insufficient residual electric quantity.
It is understood that, when it is determined that the power information of the target device is lower than the preset power threshold, a transmission request for obtaining the remaining audio data stream for the target audio data may be sent to the target device. The electric quantity threshold is not specifically limited in the present application, and may be, for example, 10%, or 5%.
In addition, the power information of the target device is also not specifically limited, and may be, for example, remaining power information of the target device or current power information of the target device.
S103, when the residual audio data stream of the target audio data is acquired, storing the residual audio data stream into a local cache.
Further, in the present application, after the transmission request is sent to the target device, the corresponding remaining audio data stream may be ready to be received. And when receiving the residual audio data stream, the residual audio data stream can be stored in a local cache.
And S104, when the occurrence of the interrupt event is detected, playing the second part of the target audio data by using the residual audio data stream, wherein the interrupt event is an event of communication disconnection with the target equipment.
Further, when the bluetooth device detects that the communication disconnection with the target device currently occurs, it can be determined that the remaining part of the target audio data cannot be played continuously currently. In order not to affect the listening experience of the user, the method and the device can continue to play the second part of the target audio data by using the residual audio data stream stored in the local cache.
It should be noted that, in the present application, the bluetooth device continues to play the second part of the target audio data by using the remaining audio data stream. If a reconnection to the target device is detected, the remaining audio data stream may continue to be utilized to play the second portion of the target audio data. Playback of the second portion of the target audio data may also be accomplished via an audio data stream communicated to the target device.
According to the method and device for playing the audio data, when a first audio data stream sent by a target device in real time is received, a first part of the target audio data is played, a transmission request for obtaining a residual audio data stream aiming at the target audio data is sent to the target device, when the residual audio data stream of the target audio data is obtained, the residual audio data stream is stored in a local cache, and when an interrupt event of communication disconnection with the target device is detected, a second part of the target audio data is played by using the residual audio data stream. By applying the technical scheme of the application, when the Bluetooth equipment is connected with the mobile phone and plays music, all the residual data of the music can be received and stored in the cache in advance, so that when the mobile phone is disconnected with the Bluetooth equipment, the music can be continuously played according to the residual data stored in the cache. And then can avoid the problem that exists in the correlation technique when mobile terminal and bluetooth equipment disconnection, can't continue to play audio data.
In one possible implementation manner of the present application, after S103 (when the remaining audio data stream of the target audio data is acquired, the remaining audio data stream is stored in the local cache), the following steps may be further implemented:
and when the interruption event is not detected, receiving a second audio data stream transmitted by the target device in real time, and playing a second part of the target audio data.
It can be understood that, if the bluetooth device does not detect the occurrence of the interrupt event of the communication disconnection with the target device in the process of playing the target audio data this time, the remaining audio data stream stored in its own buffer may not be used. But the playing of the second part of the target audio data is realized by continuing the real-time reception of the second audio data stream sent by the target device.
In yet another possible implementation manner of the present application, in S103 (when the occurrence of the interruption event is detected, the remaining audio data stream is utilized to play the second part of the target audio data), the following steps may be further implemented:
when an interruption event is detected, determining a first playing progress corresponding to target audio data based on a first audio data stream;
selecting a third audio data stream based on the first playing progress corresponding to the target audio data, wherein the third audio data stream is a data stream generated based on the residual audio data stream;
playing a second portion of the target audio data using the third audio data stream.
Furthermore, when the bluetooth device detects that the current interrupt event of communication disconnection with the target device occurs, the remaining audio data stream is reused to play the second part of the target audio data, so as to ensure the consistency of music playing. The method and the device need to determine a first playing progress when the Bluetooth device plays the target audio data when an interrupt event occurs. Further, the method and the device can determine a first playing progress corresponding to the target audio data based on the received first audio data stream.
In addition, after the first playing progress is determined, the third audio data stream corresponding to the remaining playing part can be further determined. And may play a second portion of the target audio data based on the third audio data stream. It should be noted that the third audio stream is included in the remaining audio stream. That is, the third audio stream may be the entire data stream of the remaining audio stream, or may be a part of the remaining audio stream.
For example, the music corresponding to the target audio data is "happy birthday", and the playing time of "happy birthday" is 2 minutes. In the application, when it is detected that a disconnection event occurs currently, it may be determined that the first playing progress corresponding to the currently played target audio data is fifty percent (that is, a part of "happy birthday" played currently in the previous minute) based on the received first audio data stream. Further, based on the first playing schedule, selecting an audio data stream (i.e. a third audio data stream) with a time period range of 1 minute 01 seconds to 2 minutes corresponding to "happy birthday" from the remaining audio data streams. And based on the third audio data stream, continuing to play the part of the next minute of 'happy birthday'.
Alternatively, music corresponding to the target audio data is "happy birthday", and the data size of "happy birthday" is 20M. In the present application, when it is detected that a disconnection event currently occurs, it may be determined that the currently received first audio data stream is 10M based on the already received first audio data stream, and thus it may be determined that the corresponding first playing progress is fifty percent (that is, the first half of "happy birthday" is currently played). Further, based on the first playing schedule, selecting an audio data stream (i.e. a third audio data stream) with a playing time of 10M-20M corresponding to "happy birthday" from the remaining audio data streams. And based on the third audio data stream, the second half of the happy birthday is played continuously.
In another possible implementation manner of the present application, after playing the second portion of the target audio data by using the third audio data stream, the following steps may be further implemented:
when a connection event is detected to occur, determining a second playing progress corresponding to a second part of the playing target audio data by using a third audio data stream, wherein the connection break event is an event in communication connection with the target equipment;
when the second part of the target audio data is determined to be not completely played according to the second playing progress, a fourth audio data stream sent by the target device in real time is obtained, and the fourth audio data stream is a data stream generated according to the second playing progress;
based on the fourth audio data stream, a second portion of the target audio data is played.
Further, when the disconnection event is detected, and when the event of the communication connection between the bluetooth device and the target device is detected after the third audio data stream is used for playing the second part of the target audio data, the audio data stream obtained by the communication with the target device again can be selected to be used for playing the second part of the target audio data.
Wherein, the consistency of playing music is ensured. The second playing progress of the bluetooth device when playing the second part needs to be determined when the connection event occurs. Further, the present application may determine a second playing progress corresponding to the target audio data based on the generated third audio data stream. And receiving a fourth audio data stream sent by the target device after the second playing progress is determined. And playing the second part of the target audio data by using the fourth audio data stream.
It can be understood that, in the present application, after the second playing progress is determined, when it is determined that the playing of the second portion of the target audio data is not completed according to the second playing progress, the fourth audio data stream sent by the target device is obtained. In other words, when it is detected that the playing of the second portion of the target audio data is completed, it is determined that the playing of the target audio data is completed. The playback of the next audio data can be started.
For example, the music corresponding to the target audio data is "happy birthday", and the playing time of "happy birthday" is 2 minutes. When detecting that a disconnection event occurs currently, the present application may determine, based on the already received first audio data stream, that the first playing progress corresponding to the currently playing target audio data is fifty percent. And a third audio data stream is selected from the remaining audio data streams to continue playing the part of the next minute of Happy birthday. Further, when the bluetooth device detects that a connection event occurs, it may be determined that the second playing progress corresponding to the target audio data is seventy-five percent (i.e., playing to "happy birthday" 1 minute 30 seconds) based on the third audio data stream currently being played. And informing the mobile terminal of the second playing progress so that the mobile terminal transmits an audio data stream (namely, a fourth audio data stream) corresponding to 1 minute 31 seconds-2 minutes of Happy birthday to the Bluetooth equipment. And based on the fourth audio data stream, the rest of the happy birthday is played continuously.
Further optionally, in another embodiment of the present application, after the present application S101 (when receiving the first audio data stream transmitted by the target device in real time, playing the first portion of the target audio data based on the received first audio data stream), a specific embodiment is further included, as shown in fig. 3, including:
s201, when a first audio data stream transmitted by a target device in real time is received, playing a first part of the target audio data based on the received first audio data stream.
S202, detecting the transmission quality of the first audio data stream.
S203, when the transmission quality of the first audio data stream is determined to be lower than the preset threshold value, a transmission request is sent to the target device.
In this application, after the first part of the target audio data is played, in order to avoid the above-mentioned disadvantage that the bluetooth device cannot continue playing music when the mobile terminal is disconnected from the bluetooth device. The method and the device can firstly detect the transmission quality of the first audio data stream so as to avoid the defect that the target device cannot continuously play music when the communication is disconnected due to poor communication quality.
It will be appreciated that upon determining that the transmission quality of the first audio data stream is below a preset threshold, a transmission request for obtaining the remaining audio data stream for the target audio data may be sent to the target device. It should be noted that, the preset threshold is not specifically limited in the present application, and may be, for example, 1M/s, or 2M/s.
In addition, the method for detecting the transmission quality of the first audio data stream is not specifically limited in the present application, and for example, the data may be detected by a bluetooth device, or the data may be sent to the bluetooth device after the target device detects the data.
Optionally, in the present application, the transmission efficiency corresponding to the bluetooth device may also be determined according to the configuration parameter of the bluetooth device, and whether a transmission request needs to be sent to the target device is selected according to the size of the transmission efficiency. Furthermore, the method and the device can obtain the Bluetooth stream bit rate and the Bluetooth chip type corresponding to the Bluetooth device. It can be understood that the higher the bit rate of the bluetooth stream and the bluetooth chip type of the bluetooth device are, the higher the transmission efficiency achieved in playing audio is.
Further optionally, whether a transmission request needs to be sent to the target device may be selected according to the RSSI signal value of the bluetooth device. Wherein, rssi (received Signal Strength indication) is represented as a Strength parameter of a received Signal of the mobile terminal. Its implementation is done after the backchannel baseband receive filter. For a bluetooth device, the RSSI value may reflect the strength of the bluetooth signal of the bluetooth device received by the corresponding mobile terminal. Further, for example, the RSSI value may be obtained by the following formula: RSSI is 10 × log P, and P represents the received signal power, and bluetooth transmits a broadcast, and the received signal power is affected by the distance. It will be appreciated that the lower the RSSI signal value of the bluetooth device, the higher the likelihood that it will send a transmission request to the target device.
S204, sending a transmission request to the target equipment.
And S205, when the residual audio data stream of the target audio data is acquired, storing the residual audio data stream into a local cache.
S206, when the interruption event is detected to occur, the residual audio data stream is utilized to play the second part of the target audio data.
S207, when the second part of the playing target audio data is determined to be finished, the residual audio data stream is cleared from the local cache.
Further, in the present application, after the second part of the target audio data is determined to be played, in order to save the memory in the bluetooth device, the remaining audio data stream corresponding to the target audio data may be removed from the local cache. Thereby avoiding affecting the quality of audio playing.
According to the method and device for playing the audio data, when a first audio data stream sent by a target device in real time is received, a first part of the target audio data is played, a transmission request for obtaining a residual audio data stream aiming at the target audio data is sent to the target device, when the residual audio data stream of the target audio data is obtained, the residual audio data stream is stored in a local cache, and when an interrupt event of communication disconnection with the target device is detected, a second part of the target audio data is played by using the residual audio data stream. By applying the technical scheme of the application, when the Bluetooth equipment is connected with the mobile phone and plays music, all the residual data of the music can be received and stored in the cache in advance, so that when the mobile phone is disconnected with the Bluetooth equipment, the music can be continuously played according to the residual data stored in the cache. And then can avoid the problem that exists in the correlation technique when mobile terminal and bluetooth equipment disconnection, can't continue to play audio data.
In another embodiment of the present application, as shown in fig. 4, the present application further provides an apparatus for playing audio data. The device comprises an acquisition module 301, a sending module 302, a storage module 303, and a detection module 304, wherein:
the acquisition module 301 is configured to, when a first audio data stream sent by a target device in real time is received, play a first part of target audio data based on the received first audio data stream, where the target audio data includes the first part and a second part;
a sending module 302 configured to send a transmission request to the target device, where the transmission request is used to obtain a residual audio data stream for the target audio data, and the residual audio data stream corresponds to a second portion of the target audio data;
the storage module 303 is configured to store the remaining audio data stream into a local cache when the remaining audio data stream of the target audio data is acquired;
a detection module 304 configured to play the second portion of the target audio data using the remaining audio data stream when an interruption event is detected, the interruption event being an event that communication with the target device is disconnected.
According to the method and device for playing the audio data, when a first audio data stream sent by a target device in real time is received, a first part of the target audio data is played, a transmission request for obtaining a residual audio data stream aiming at the target audio data is sent to the target device, when the residual audio data stream of the target audio data is obtained, the residual audio data stream is stored in a local cache, and when an interrupt event of communication disconnection with the target device is detected, a second part of the target audio data is played by using the residual audio data stream. By applying the technical scheme of the application, when the Bluetooth equipment is connected with the mobile phone and plays music, all the residual data of the music can be received and stored in the cache in advance, so that when the mobile phone is disconnected with the Bluetooth equipment, the music can be continuously played according to the residual data stored in the cache. And then can avoid the problem that exists in the correlation technique when mobile terminal and bluetooth equipment disconnection, can't continue to play audio data.
In another embodiment of the present application, the detecting module 304 further includes:
a detection module 304, configured to receive a second audio data stream transmitted by the target device in real time and play a second portion of the target audio data when the interruption event is not detected.
In another embodiment of the present application, the detecting module 304 further includes:
a detection module 304, configured to determine, based on the first audio data stream, a first playing progress corresponding to the target audio data when an interrupt event is detected to occur;
a detection module 304, configured to select a third audio data stream based on a first playing progress corresponding to the target audio data, where the third audio data stream is a data stream generated based on the remaining audio data stream;
a detection module 304 configured to play a second portion of the target audio data utilizing the third audio data stream.
In another embodiment of the present application, the detecting module 304 further includes:
a detection module 304, configured to determine, by using the third audio data stream, a second playing progress corresponding to playing of the second part of the target audio data when a connection event is detected, where the connection disconnection event is an event of a communication connection with the target device;
a detection module 304, configured to, when it is determined that the playing of the second part of the target audio data is not completed according to the second playing progress, obtain a fourth audio data stream sent by the target device in real time, where the fourth audio data stream is a data stream generated according to the second playing progress;
a detection module 304 configured to play a second portion of the target audio data based on the fourth audio data stream.
In another embodiment of the present application, the detecting module 304 further includes:
a detection module 304 configured to detect a transmission quality of the first audio data stream;
a detection module 304 configured to send the transmission request to the target device when it is determined that the transmission quality of the first audio data stream is below a preset threshold.
In another embodiment of the present application, the detecting module 304 further includes:
a detection module 304 configured to detect power information of the target device;
a detection module 304 configured to send the transmission request to the target device when it is determined that the power information of the target device is lower than a power threshold.
In another embodiment of the present application, the method further comprises a clearing module 305, wherein:
a purge module 305 configured to purge the residual audio data stream from the local cache upon determining that playing the second portion of the target audio data is complete.
Fig. 5 is a block diagram illustrating a logical structure of an electronic device in accordance with an exemplary embodiment. For example, the electronic device 400 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 5, electronic device 400 may include one or more of the following components: a processor 401 and a memory 402.
Processor 401 may include one or more processing cores, such as a 4-core processor, an 8-core processor, or the like. The processor 401 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 401 may also include a main processor and a coprocessor, where the main processor is a processor for processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 401 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed by the display screen. In some embodiments, the processor 401 may further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
Memory 402 may include one or more computer-readable storage media, which may be non-transitory. Memory 402 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in the memory 402 is configured to store at least one instruction for execution by the processor 401 to implement the interactive special effect calibration method provided by the method embodiments of the present application.
In some embodiments, the electronic device 400 may further optionally include: a peripheral interface 403 and at least one peripheral. The processor 401, memory 402 and peripheral interface 403 may be connected by bus or signal lines. Each peripheral may be connected to the peripheral interface 403 via a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 404, touch screen display 405, camera 406, audio circuitry 407, positioning components 408, and power supply 409.
The peripheral interface 403 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 401 and the memory 402. In some embodiments, processor 401, memory 402, and peripheral interface 403 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 401, the memory 402 and the peripheral interface 403 may be implemented on a separate chip or circuit board, which is not limited by this embodiment.
The Radio Frequency circuit 404 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuitry 404 communicates with communication networks and other communication devices via electromagnetic signals. The rf circuit 404 converts an electrical signal into an electromagnetic signal to transmit, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 404 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuitry 404 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: metropolitan area networks, various generation mobile communication networks (2G, 3G, 4G, and 5G), Wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the rf circuit 404 may further include NFC (Near Field Communication) related circuits, which are not limited in this application.
The display screen 405 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 405 is a touch display screen, the display screen 405 also has the ability to capture touch signals on or over the surface of the display screen 405. The touch signal may be input to the processor 401 as a control signal for processing. At this point, the display screen 405 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display screen 405 may be one, providing the front panel of the electronic device 400; in other embodiments, the display screen 405 may be at least two, respectively disposed on different surfaces of the electronic device 400 or in a folded design; in still other embodiments, the display screen 405 may be a flexible display screen disposed on a curved surface or a folded surface of the electronic device 400. Even further, the display screen 405 may be arranged in a non-rectangular irregular pattern, i.e. a shaped screen. The Display screen 405 may be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), and other materials.
The camera assembly 406 is used to capture images or video. Optionally, camera assembly 406 includes a front camera and a rear camera. Generally, a front camera is disposed at a front panel of the terminal, and a rear camera is disposed at a rear surface of the terminal. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments, camera assembly 406 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
The audio circuit 407 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 401 for processing, or inputting the electric signals to the radio frequency circuit 404 for realizing voice communication. For stereo capture or noise reduction purposes, the microphones may be multiple and disposed at different locations of the electronic device 400. The microphone may also be an array microphone or an omni-directional pick-up microphone. The speaker is used to convert electrical signals from the processor 401 or the radio frequency circuit 404 into sound waves. The loudspeaker can be a traditional film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, the speaker can be used for purposes such as converting an electric signal into a sound wave audible to a human being, or converting an electric signal into a sound wave inaudible to a human being to measure a distance. In some embodiments, audio circuitry 407 may also include a headphone jack.
The positioning component 408 is used to locate a current geographic location of the electronic device 400 to implement navigation or LBS (location based Service). The positioning component 408 may be a positioning component based on the GPS (global positioning System) of the united states, the beidou System of china, the graves System of russia, or the galileo System of the european union.
The power supply 409 is used to supply power to the various components in the electronic device 400. The power source 409 may be alternating current, direct current, disposable or rechargeable. When power source 409 comprises a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, the electronic device 400 also includes one or more sensors 410. The one or more sensors 410 include, but are not limited to: acceleration sensor 411, gyro sensor 412, pressure sensor 413, fingerprint sensor 414, optical sensor 415, and proximity sensor 416.
The acceleration sensor 411 may detect the magnitude of acceleration in three coordinate axes of a coordinate system established with the electronic apparatus 400. For example, the acceleration sensor 411 may be used to detect components of the gravitational acceleration in three coordinate axes. The processor 401 may control the touch display screen 405 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 411. The acceleration sensor 411 may also be used for acquisition of motion data of a game or a user.
The gyro sensor 412 may detect a body direction and a rotation angle of the electronic device 400, and the gyro sensor 412 may cooperate with the acceleration sensor 411 to acquire a 3D motion of the user on the electronic device 400. From the data collected by the gyro sensor 412, the processor 401 may implement the following functions: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization at the time of photographing, game control, and inertial navigation.
The pressure sensors 413 may be disposed on a side bezel of the electronic device 400 and/or on a lower layer of the touch display screen 405. When the pressure sensor 413 is arranged on the side frame of the electronic device 400, a holding signal of the user to the electronic device 400 can be detected, and the processor 401 performs left-right hand identification or shortcut operation according to the holding signal collected by the pressure sensor 413. When the pressure sensor 413 is disposed at the lower layer of the touch display screen 405, the processor 401 controls the operability control on the UI interface according to the pressure operation of the user on the touch display screen 405. The operability control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 414 is used for collecting a fingerprint of the user, and the processor 401 identifies the identity of the user according to the fingerprint collected by the fingerprint sensor 414, or the fingerprint sensor 414 identifies the identity of the user according to the collected fingerprint. Upon recognizing that the user's identity is a trusted identity, processor 401 authorizes the user to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings, etc. The fingerprint sensor 414 may be disposed on the front, back, or side of the electronic device 400. When a physical button or vendor Logo is provided on the electronic device 400, the fingerprint sensor 414 may be integrated with the physical button or vendor Logo.
The optical sensor 415 is used to collect the ambient light intensity. In one embodiment, the processor 401 may control the display brightness of the touch display screen 405 based on the ambient light intensity collected by the optical sensor 415. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 405 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 405 is turned down. In another embodiment, the processor 401 may also dynamically adjust the shooting parameters of the camera assembly 406 according to the ambient light intensity collected by the optical sensor 415.
Proximity sensor 416, also known as a distance sensor, is typically disposed on the front panel of electronic device 400. The proximity sensor 416 is used to capture the distance between the user and the front of the electronic device 400. In one embodiment, the processor 401 controls the touch display screen 405 to switch from the bright screen state to the dark screen state when the proximity sensor 416 detects that the distance between the user and the front surface of the electronic device 400 gradually decreases; when the proximity sensor 416 detects that the distance between the user and the front of the electronic device 400 is gradually increased, the processor 401 controls the touch display screen 405 to switch from the breath screen state to the bright screen state.
Those skilled in the art will appreciate that the configuration shown in fig. 5 does not constitute a limitation of the electronic device 400, and may include more or fewer components than those shown, or combine certain components, or employ a different arrangement of components.
In an exemplary embodiment, there is also provided a non-transitory computer-readable storage medium, such as the memory 404, including instructions executable by the processor 420 of the electronic device 400 to perform the above-described method of playing audio data, the method including: when a first audio data stream transmitted by a target device in real time is received, playing a first part of target audio data based on the received first audio data stream, wherein the target audio data comprises the first part and a second part; sending a transmission request to the target device, the transmission request being used to obtain a residual audio data stream for the target audio data, the residual audio data stream corresponding to a second portion of the target audio data; when the residual audio data stream of the target audio data is acquired, storing the residual audio data stream into a local cache; and when an interruption event is detected to occur, playing a second part of the target audio data by using the residual audio data stream, wherein the interruption event is an event of communication disconnection with the target equipment. Optionally, the instructions may also be executable by the processor 420 of the electronic device 400 to perform other steps involved in the exemplary embodiments described above. Optionally, the instructions may also be executable by the processor 420 of the electronic device 400 to perform other steps involved in the exemplary embodiments described above. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, there is also provided an application/computer program product including one or more instructions executable by the processor 420 of the electronic device 400 to perform the above-described method of playing audio data, the method comprising: when a first audio data stream transmitted by a target device in real time is received, playing a first part of target audio data based on the received first audio data stream, wherein the target audio data comprises the first part and a second part; sending a transmission request to the target device, the transmission request being used to obtain a residual audio data stream for the target audio data, the residual audio data stream corresponding to a second portion of the target audio data; when the residual audio data stream of the target audio data is acquired, storing the residual audio data stream into a local cache; and when an interruption event is detected to occur, playing a second part of the target audio data by using the residual audio data stream, wherein the interruption event is an event of communication disconnection with the target equipment. Optionally, the instructions may also be executable by the processor 420 of the electronic device 400 to perform other steps involved in the exemplary embodiments described above. Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.
Claims (10)
1. A method for playing audio data, which is applied to a Bluetooth device, comprises the following steps:
when a first audio data stream transmitted by a target device in real time is received, playing a first part of target audio data based on the received first audio data stream, wherein the target audio data comprises the first part and a second part;
sending a transmission request to the target device, the transmission request being used to obtain a residual audio data stream for the target audio data, the residual audio data stream corresponding to a second portion of the target audio data;
when the residual audio data stream of the target audio data is acquired, storing the residual audio data stream into a local cache;
and when an interruption event is detected to occur, playing a second part of the target audio data by using the residual audio data stream, wherein the interruption event is an event of communication disconnection with the target equipment.
2. The method of claim 1, wherein after storing the remaining audio data stream to a local cache when the remaining audio data stream of the target audio data is acquired, further comprising:
and when the interruption event is not detected, receiving a second audio data stream sent by the target equipment in real time, and playing a second part of the target audio data.
3. The method of claim 1, wherein playing the second portion of the target audio data utilizing the remaining audio data stream when the occurrence of the interruption event is detected comprises:
when an interruption event is detected to occur, determining a first playing progress corresponding to the target audio data based on the first audio data stream;
selecting a third audio data stream based on a first playing progress corresponding to the target audio data, wherein the third audio data stream is a data stream generated based on the residual audio data stream;
playing a second portion of the target audio data using the third audio data stream.
4. The method of claim 3, wherein after said playing the second portion of the target audio data using the third audio data stream, further comprising:
when a connection event is detected to occur, determining a second playing progress corresponding to the second part of the target audio data by using the third audio data stream, wherein the connection disconnection event is an event in communication connection with the target equipment;
when the second part of the target audio data is determined to be not played completely according to the second playing progress, a fourth audio data stream sent by the target device in real time is obtained, wherein the fourth audio data stream is a data stream generated according to the second playing progress;
playing a second portion of the target audio data based on the fourth audio data stream.
5. The method of claim 1, wherein after the playing the first portion of the target audio data, further comprising:
detecting a transmission quality of the first audio data stream;
and when the transmission quality of the first audio data stream is determined to be lower than a preset threshold value, sending the transmission request to the target equipment.
6. The method of claim 1, wherein after the playing the first portion of the target audio data, further comprising:
detecting electric quantity information of the target equipment;
when the electric quantity information of the target device is determined to be lower than the electric quantity threshold value, the transmission request is sent to the target device.
7. The method of claim 1, wherein after said playing the second portion of the target audio data, further comprising:
and when the second part of the target audio data is determined to be played, clearing the residual audio data stream from the local cache.
8. An apparatus for playing audio data, comprising:
the device comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for playing a first part of target audio data based on a received first audio data stream when the first audio data stream sent by a target device in real time is received, and the target audio data comprises the first part and a second part;
a sending module configured to send a transmission request to the target device, the transmission request being used to obtain a remaining audio data stream for the target audio data, the remaining audio data stream corresponding to a second portion of the target audio data;
the storage module is used for storing the residual audio data stream into a local cache when the residual audio data stream of the target audio data is acquired;
a detection module configured to play a second portion of the target audio data using the remaining audio data stream when an interruption event is detected to occur, the interruption event being an event that communication with the target device is disconnected.
9. An electronic device, comprising:
a memory for storing executable instructions; and the number of the first and second groups,
a processor for display with the memory to execute the executable instructions to perform the operations of the method of playing audio data of any of claims 1-7.
10. A computer-readable storage medium storing computer-readable instructions that, when executed, perform the operations of the method of playing audio data of any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911031990.4A CN110856152A (en) | 2019-10-28 | 2019-10-28 | Method, device, electronic equipment and medium for playing audio data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911031990.4A CN110856152A (en) | 2019-10-28 | 2019-10-28 | Method, device, electronic equipment and medium for playing audio data |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110856152A true CN110856152A (en) | 2020-02-28 |
Family
ID=69598866
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911031990.4A Pending CN110856152A (en) | 2019-10-28 | 2019-10-28 | Method, device, electronic equipment and medium for playing audio data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110856152A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113179505A (en) * | 2021-03-10 | 2021-07-27 | 歌尔科技有限公司 | Bluetooth playing device restart reconnection method, Bluetooth playing device and electronic equipment |
CN113271577A (en) * | 2021-04-13 | 2021-08-17 | 荣耀终端有限公司 | Media data playing system, method and related device |
CN113543101A (en) * | 2021-07-09 | 2021-10-22 | Oppo广东移动通信有限公司 | Audio output method, Bluetooth device, mobile terminal and storage medium |
CN114827687A (en) * | 2021-01-29 | 2022-07-29 | 华为技术有限公司 | Communication method, mobile device, electronic device, and computer-readable storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108156524A (en) * | 2017-12-29 | 2018-06-12 | 北京奇宝科技有限公司 | Control method for playing back, device and the computer readable storage medium of multimedia resource |
CN110139180A (en) * | 2019-04-08 | 2019-08-16 | 努比亚技术有限公司 | Progress control method, device and computer readable storage medium |
-
2019
- 2019-10-28 CN CN201911031990.4A patent/CN110856152A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108156524A (en) * | 2017-12-29 | 2018-06-12 | 北京奇宝科技有限公司 | Control method for playing back, device and the computer readable storage medium of multimedia resource |
CN110139180A (en) * | 2019-04-08 | 2019-08-16 | 努比亚技术有限公司 | Progress control method, device and computer readable storage medium |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114827687A (en) * | 2021-01-29 | 2022-07-29 | 华为技术有限公司 | Communication method, mobile device, electronic device, and computer-readable storage medium |
CN114827687B (en) * | 2021-01-29 | 2024-04-09 | 华为技术有限公司 | Communication method, mobile device, electronic device, and computer-readable storage medium |
CN113179505A (en) * | 2021-03-10 | 2021-07-27 | 歌尔科技有限公司 | Bluetooth playing device restart reconnection method, Bluetooth playing device and electronic equipment |
CN113271577A (en) * | 2021-04-13 | 2021-08-17 | 荣耀终端有限公司 | Media data playing system, method and related device |
CN113543101A (en) * | 2021-07-09 | 2021-10-22 | Oppo广东移动通信有限公司 | Audio output method, Bluetooth device, mobile terminal and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110764730B (en) | Method and device for playing audio data | |
CN108401124B (en) | Video recording method and device | |
KR102523919B1 (en) | Audio playback and collection method, device and device and readable storage medium | |
WO2019128592A1 (en) | Method and apparatus for live broadcasting | |
CN110971930A (en) | Live virtual image broadcasting method, device, terminal and storage medium | |
CN110996305B (en) | Method and device for connecting Bluetooth equipment, electronic equipment and medium | |
CN110618805B (en) | Method and device for adjusting electric quantity of equipment, electronic equipment and medium | |
CN110740340B (en) | Video live broadcast method and device and storage medium | |
CN110830811A (en) | Live broadcast interaction method, device, system, terminal and storage medium | |
CN110856152A (en) | Method, device, electronic equipment and medium for playing audio data | |
CN111107389B (en) | Method, device and system for determining live broadcast watching time length | |
CN108881286B (en) | Multimedia playing control method, terminal, sound box equipment and system | |
CN112965683A (en) | Volume adjusting method and device, electronic equipment and medium | |
CN110708630B (en) | Method, device and equipment for controlling earphone and storage medium | |
CN111031170A (en) | Method, apparatus, electronic device and medium for selecting communication mode | |
CN107896337B (en) | Information popularization method and device and storage medium | |
CN110401898B (en) | Method, apparatus, device and storage medium for outputting audio data | |
CN111818358A (en) | Audio file playing method and device, terminal and storage medium | |
CN111092991B (en) | Lyric display method and device and computer storage medium | |
CN110868642B (en) | Video playing method, device and storage medium | |
CN110473562B (en) | Audio data processing method, device and system | |
CN108401194B (en) | Time stamp determination method, apparatus and computer-readable storage medium | |
CN109783176A (en) | Switch the method and apparatus of the page | |
CN110933454B (en) | Method, device, equipment and storage medium for processing live broadcast budding gift | |
CN110286839B (en) | Message sending method, device, terminal and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200228 |
|
RJ01 | Rejection of invention patent application after publication |