WO2020063047A1 - Audio playback method and apparatus, electronic device and storage medium - Google Patents

Audio playback method and apparatus, electronic device and storage medium Download PDF

Info

Publication number
WO2020063047A1
WO2020063047A1 PCT/CN2019/096216 CN2019096216W WO2020063047A1 WO 2020063047 A1 WO2020063047 A1 WO 2020063047A1 CN 2019096216 W CN2019096216 W CN 2019096216W WO 2020063047 A1 WO2020063047 A1 WO 2020063047A1
Authority
WO
WIPO (PCT)
Prior art keywords
playback device
audio playback
wireless audio
audio data
wireless
Prior art date
Application number
PCT/CN2019/096216
Other languages
French (fr)
Chinese (zh)
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 WO2020063047A1 publication Critical patent/WO2020063047A1/en

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/165Management of the audio stream, e.g. setting of volume, audio stream path

Definitions

  • the present application relates to the field of communication technology, and more particularly, to an audio playing method, device, electronic device, and storage medium.
  • wireless audio playback devices to play audio data in electronic devices can reduce the inconvenience caused by wired headphones.
  • electronic devices use wireless audio playback devices to play music
  • a wireless audio playback device may cause the music being played to be paused or a pause that may be paused for a certain period of time, requiring the user to manually start and continue to play, which is cumbersome and the user experience is not high.
  • the present application proposes an audio playback method, device, electronic device, and storage medium to improve the above defects.
  • an embodiment of the present application provides an audio playback method, which is applied to an electronic device, and the electronic device can be connected to a first wireless audio playback device and a second wireless audio playback device simultaneously.
  • the method includes: when detecting that the electronic device is playing audio data through the first wireless audio playback device, determining whether a switching instruction is acquired; and if the switching instruction is acquired, maintaining the first wireless audio playback device to continue Playing the audio data, and sending the audio data to the second wireless audio playback device, instructing the second wireless audio playback device to store the acquired audio data; obtaining a playback progress of the audio data; sending The playback progress reaches the second wireless audio playback device, and instructs the second wireless audio playback device to play the stored audio data according to the playback progress.
  • an embodiment of the present application further provides an audio playback device, which is applied to an electronic device, and the electronic device can be connected to a first wireless audio playback device and a second wireless audio playback device simultaneously.
  • the playback device includes a judgment unit, a storage unit, an acquisition unit, and a playback unit.
  • a judging unit is configured to determine whether a switching instruction is acquired when it is detected that the electronic device is playing audio data through the first wireless audio playback device.
  • a storage unit configured to, if a switching instruction is obtained, keep the first wireless audio playback device to continue playing the audio data, and send the audio data to the second wireless audio playback device to instruct the second wireless audio playback device
  • the audio playback device stores the acquired audio data.
  • An obtaining unit is configured to obtain a playback progress of the audio data.
  • the playback unit is configured to send the playback progress to the second wireless audio playback device, and instruct the second wireless audio playback device to play the stored audio data according to the playback progress.
  • an embodiment of the present application further provides an electronic device, including: one or more processors capable of simultaneously connecting the first wireless audio playback device and the second wireless audio playback device; Memory; one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured for Perform the above method.
  • an embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores program code, and the program code can be called by a processor to execute the foregoing method.
  • FIG. 1 shows a module block diagram of a voice system provided by an embodiment of the present application
  • FIG. 2 shows a block diagram of a voice system according to another embodiment of the present application
  • FIG. 3 shows a method flowchart of an audio playback method according to an embodiment of the present application
  • FIG. 4 is a schematic diagram of a device management interface according to an embodiment of the present application.
  • FIG. 5 shows a schematic diagram of an audio playback interface provided by an embodiment of the present application
  • FIG. 6 is a schematic diagram of an audio playback progress bar provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of an audio playback progress bar according to another embodiment of the present application.
  • FIG. 8 shows a method flowchart of an audio playback method according to another embodiment of the present application.
  • FIG. 9 shows a method flowchart of an audio playback method according to another embodiment of the present application.
  • FIG. 10 is a schematic diagram of an audio playback progress bar according to another embodiment of the present application.
  • FIG. 11 shows a module block diagram of an audio playback device according to an embodiment of the present application.
  • FIG. 12 shows a module block diagram of an electronic device according to an embodiment of the present application.
  • FIG. 13 shows a storage unit for storing or carrying program code for implementing an audio playing method according to an embodiment of the present application, provided by an embodiment of the present application.
  • audio playback devices With the increase in the types of audio playback devices and the improvement of playback sound effects, more users will choose to output audio to be played by electronic devices such as mobile phones and tablets to the audio playback device for playback.
  • electronic devices such as mobile phones and tablets
  • audio playback devices include car music players, speakers, and headphones.
  • audio playback devices can be divided into wired audio playback devices and wireless audio playback devices.
  • the electronic device can interact with the wireless audio playback device through a wireless network to transmit signals.
  • the wireless network may be Bluetooth. , Wifi, LTE network or NFC, etc.
  • the voice system 1 includes an electronic device 100, a first wireless audio playback device 210, and a second wireless audio playback device 220.
  • the electronic device 100 can be connected to the first wireless audio playback device 210 and the second wireless audio playback device 220 at the same time. .
  • an application capable of playing audio is installed in the electronic device 100.
  • the application may be audio playing software, video playing software, or calling software.
  • the electronic device 100 sends the audio to be played to the first wireless audio playback device 210 or the second wireless audio playback device 220, and the first wireless audio playback device 210 or the second wireless audio playback device 220 plays the voice.
  • the first wireless audio playback device 210 and the second wireless audio playback device 220 may both be Bluetooth speakers or Bluetooth headsets.
  • the first wireless audio playback device 210 and the second wireless audio playback device 220 may be enabled with the Bluetooth function.
  • a connection with the electronic device 100 is achieved, and after the connection is established, the electronic device 100 sends the voice that it needs to play to the Bluetooth audio, and the Bluetooth audio implements voice playback.
  • the electronic device 100 can be connected to the first wireless audio playback device 210 and the second wireless audio playback device 220 through the Bluetooth module at the same time.
  • the Bluetooth module in the electronic device may support multipoint connection, so that the electronic device shown in FIG. 1 can be connected to the first wireless audio playback device 210 and the second wireless audio playback device 220, respectively.
  • the electronic device 100 can obtain the identities of the first wireless audio playback device 210 and the second wireless audio playback device 220, and the identifications may be MAC addresses.
  • the Bluetooth function of the electronic device is turned on, the electronic device scans the Bluetooth devices within a certain distance from the surrounding area.
  • the preset Scan in the order of channel scanning. For example, scan the common channels 1, 7, and 13 first, and then scan the other unused channels, so as to obtain the identification of all Bluetooth devices in the current range and display them in the Bluetooth list interface of the electronic device. .
  • the electronic device will automatically connect with the Bluetooth device, and the user can also select a Bluetooth device in the Bluetooth list interface to connect.
  • the system of the electronic device obtains a status value, which indicates that the electronic device is currently connected to the Bluetooth device. Therefore, the electronic device can detect the Bluetooth device that has been connected, thereby obtaining the device identification of the Bluetooth device.
  • the electronic device 100 is connected to the first wireless audio playback device 210 through Bluetooth, and then the first wireless audio playback device 210 is connected to the second wireless audio playback device 220 through Bluetooth. Therefore, the electronic device 100, The first wireless audio playback device 210 and the second wireless audio playback device 220 are connected at the same time through networking, that is, the first wireless audio playback device 210 serves as a repeater of the electronic device 100 and the second wireless audio playback device 220.
  • different audio playback devices can play different audio data. Of course, it can also be played by different audio playback devices. Same audio data to achieve effects like stereo. It is also possible to use one of the wireless audio playback devices to play audio data while the other wireless audio playback device is on standby without playing audio.
  • an embodiment of the present application provides an audio playback method, which is applied to the above-mentioned electronic device.
  • FIG. 3 illustrates an audio playback method provided by an embodiment of the present application.
  • a schematic flowchart of the method includes: S301 to S304.
  • the electronic device is connected to the first wireless audio playback device and the second wireless audio playback device at the same time.
  • the user can select the music to be played on the audio playback interface of the electronic device, as shown in Figures 1 and 2.
  • the displayed interface of the electronic device shown below select one or more audio data, and click the play button to play the selected audio data.
  • the user can also select a wireless audio playback device for playing audio data through the electronic device.
  • a device management interface of an electronic device is shown.
  • an operation interface of two wireless audio playback devices connected to the electronic device is displayed, and specifically includes two wireless audio playback devices.
  • a device selection button which is a selection button corresponding to each device in FIG. 4, for example, when the round button is on the left, the electronic device selects a wireless audio playback device to play audio data. After the connection is established, the audio data played by the electronic device can play the audio data through the connected wireless audio playback device.
  • each wireless audio playback device also corresponds to a drop-down menu.
  • the user can use the drop-down menu to configure the user's audio playback application for the wireless audio playback device. For example, configure the first application for device 1 as Device 2 is configured with a second application program, and if the electronic device can control the first application program to play the first audio data and control the second application program to play the second audio data, the device 1 can cause the device 1 to play the first application program.
  • the first audio data causes the device 2 to play the second audio data of the second application.
  • the electronic device is connected to the first wireless audio playback device can be determined through the button status in the interface.
  • whether the device connected by the electronic device through Bluetooth is an audio playback device can be detected.
  • the type of the device currently connected via Bluetooth can be determined based on the return value obtained by instantiating the BluetoothClass.Device class.
  • the returned value is AUDIO_VIDEO_CAMCORDER, it is characterized as an image capture device; if the returned value is AUDIO_VIDEO_CAR_AUDIO, it is characterized as a car device; if the returned value is AUDIO_VIDEO_HIFI_AUDIO, it is characterized as an audio playback device or a video playback device, such as a Bluetooth headset; If the returned value is AUDIO_VIDEO_MICROPHONE, it indicates that it is a microphone.
  • the electronic device When it is determined that the electronic device is connected to the wireless audio playback device, that is, after the electronic device is connected to the wireless audio playback device, it is detected whether the electronic device has received a playback request, and the playback request is a request for playing audio data.
  • the electronic device is connected to the first wireless audio playback device and the first wireless audio playback device is selected as a device for playing audio data of the electronic device, it is determined whether a playback request for audio data of the data is obtained when the user operates the electronic device, and if Upon the playback request, it is determined that the electronic device is playing audio data through the first wireless audio playback device.
  • the playback request may be reminder information or a voice playback request.
  • the reminder information includes call reminder information, short message reminder information, and alarm reminder information to remind the user that certain events have been triggered.
  • the call reminder information is used to remind the user of an incoming call.
  • the utterance request may be a request to play a voice each time during the utterance of the electronic device.
  • the utterance request may be an audio utterance request, or a video utterance request or a call utterance request.
  • the software may be a music playback APP, a video playback APP, a recording APP, or the like.
  • the video playback interface is provided with a video playback button. By detecting the touch of the video playback button, it can be determined whether the electronic device currently receives a playback request for audio data. For example, the user selects a video, enters the video playback interface, and clicks.
  • the playback button of the playback interface allows the application to detect what type of video the user is currently clicking by monitoring the user ’s touch operation.
  • the playback button is set with preset attributes to detect the acquired touch
  • the user can determine the video to be played selected by the user, and then obtain a playback request and the audio corresponding to the playback request.
  • the electronic device obtains the switching instruction.
  • the electronic device uses one wireless audio playback device to play audio data
  • the user can use another wireless audio playback device to play audio data.
  • the electronic device is using the first wireless audio playback device.
  • the wireless audio playback device plays audio data
  • the audio data of the electronic device may be switched in an interface of the electronic device.
  • the user uses the first wireless audio playback device, the user selects the selected data in the interface.
  • the wireless audio selected in the selection menu bar The playback device is used to play audio data, and the user switches from device 1 to device 2 and inputs a request to play audio data using the second wireless audio playback device, that is, a switching instruction is input.
  • S302 Keep the first wireless audio playback device to continue playing the audio data, and send the audio data to the second wireless audio playback device, and instruct the second wireless audio playback device to send the acquired audio data. storage.
  • the first wireless audio playback device After detecting the acquisition switching instruction, the first wireless audio playback device does not pause the audio data playback, that is, the user can still listen to the audio data in the first wireless audio playback device. At this time, the user will not play the first wireless audio playback The device is turned off, and if the first wireless audio playback device is a Bluetooth headset, the user will not remove the first wireless audio playback device from the ear. As an implementation manner, the user can successfully switch to the second wireless audio device. When the playback device plays audio data, a prompt voice is played by the first wireless audio playback device, for example, "Please switch headphones".
  • the electronic device sends all audio data and playback progress to the second wireless audio playback device according to a certain Bluetooth protocol.
  • the audio data encodes the audio data according to a coding format supported by the Bluetooth protocol. For example, For audio, Apt-X, SBC, AAC, and LDAC encoding algorithms are often used to encode audio data to generate audio data packets.
  • the audio data packets are then sent to the Bluetooth transmission channel between the electronic device and the second wireless audio playback device.
  • a second wireless audio playback device A second wireless audio playback device.
  • part of the audio data after the playback progress in the audio data can also be sent to the second wireless audio playback device.
  • the time point at which the switching instruction is obtained is determined as the first playback time node, and the first in the audio data is The audio data after the playback time node is used as the audio data to be sent, and the audio data to be sent is sent to the second wireless audio playback device.
  • the second wireless audio playback device After acquiring the audio data, the second wireless audio playback device decodes the audio data through a transmission protocol to obtain audio data to be played, and stores the audio data to be played.
  • the audio data to be played needs to be decoded according to a certain audio encoding. For example, music in MP3 format or HQV format needs to be decoded into audio data in PCM format first. Then, the audio data in the PCM format is played. Therefore, after the audio data is obtained, the audio data can be audio decoded, and the decoded audio data can be stored.
  • a certain audio encoding For example, music in MP3 format or HQV format needs to be decoded into audio data in PCM format first. Then, the audio data in the PCM format is played. Therefore, after the audio data is obtained, the audio data can be audio decoded, and the decoded audio data can be stored.
  • the specific embodiment of sending the audio data to the second wireless audio playback device and instructing the second wireless audio playback device to store the acquired audio data is: sending the audio data to the second wireless audio playback device.
  • the second wireless audio playback device instructs the second wireless audio playback device to perform audio decoding on the acquired audio data, and store the decoded audio data.
  • the second wireless audio playback device decodes the audio data to obtain the audio data to be played, and then treats the audio data to be played. Perform audio decoding to obtain audio decoded audio data, and then store the audio decoded audio data into a preset storage space. Then, when the second audio playback device is playing, the decoded audio data can be obtained directly from the preset storage space and played directly, reducing the delay caused by the audio decoding process.
  • the electronic device is currently connected to the first wireless audio playback device and the second wireless audio playback device at the same time, that is, when it is determined that the switching instruction is obtained, the electronic device is already connected to the second wireless audio playback device.
  • the operations of maintaining the first wireless audio playback device to continue playing the audio data and sending the audio data to the second wireless audio playback device may be performed.
  • the electronic device if the electronic device is not connected to the second wireless audio playback device, it is necessary to first establish a connection, and then execute and keep the first wireless audio playback device to continue playing the audio data, and Operation of sending audio data to the second wireless audio playback device. Because a certain point of time is required in the process of establishing a connection, and audio data is being played, after the connection is established, the first wireless audio playback device is maintained to continue playing the audio data, and the The operation of sending audio data to the second wireless audio playback device can avoid the time required to establish the connection and increase the time delay added by the handover.
  • the first wireless audio playback device is kept playing the audio data, and the audio data is sent to the second wireless audio playback device, and the second wireless audio playback device is instructed to send the acquired audio data.
  • the specific implementation of data storage is:
  • connection play instruction when not connected, it may send a connection play instruction to the second wireless audio playback device, instructing the second wireless audio playback device to connect to the electronic device, and detecting whether a return from the second wireless audio playback device is received.
  • Successful connection information which is used to indicate that the second wireless audio playback device has successfully connected with the electronic device, and if the successful connection information is received, executing and maintaining the first wireless audio playback device to continue playing the audio data
  • sending the audio data to the second wireless audio playback device instructing the second wireless audio playback device to store the acquired audio data.
  • t1 is the current playback time point of the audio data
  • the current playback time point of the audio data is obtained as the playback progress of the audio data obtained this time. For example, if the total playback time of an audio data is 3:56, the current playback time point is 1:03, and 0 to 1:03 is the current playback progress.
  • a specific implementation manner of acquiring the playback progress of the audio data is: acquiring the current playback time point of the audio data, and using the current playback time point minus a preset value as the current time point. Playing progress of the acquired audio data. As shown in FIG. 7, t1 is the current playback time point of the audio data, and t2 is the playback time point before the current playback time point of the audio data. Then the time difference between t1 and t2 is ⁇ t, and the time length of ⁇ t is Set value.
  • the preset value is a value set by the user according to requirements. For example, the value is 4-10 seconds, and specifically, it can be 6 seconds.
  • a piece of speech is "I am from Sichuan, I love hot and sour noodles”
  • the current playback time point is the time point corresponding to "Person”
  • the preset playback time point before the current playback time point is "I”
  • the playback progress of the audio data obtained this time is not the time point corresponding to "person”, but the time point corresponding to "me”.
  • the current time has been played to "person”, it is switched to When the second audio playback device is used, it will rewind to "I” to start playback, so that when the user plays the voice using the second audio playback device, the user can recall the previously played content and improve the user experience.
  • S304 Send the playback progress to the second wireless audio playback device, and instruct the second wireless audio playback device to play the stored audio data according to the playback progress.
  • the second wireless audio playback device After the second wireless audio playback device obtains the playback progress, it locates a time point corresponding to the playback progress, and continues to play the audio data with the time point as a starting point. Therefore, before the second wireless audio playback device is instructed to play audio data, the audio data has been stored in the storage space in the second wireless audio playback device, to avoid delaying the acquisition of audio data from the electronic device when the playback is instructed to play. , And cause the phenomenon of stuttering.
  • the electronic device when the electronic device sends the playback progress to the second wireless audio playback device, a reminder message is sent, and the reminder information is used to instruct the user to switch the audio playback device, for example, the above-mentioned "Please switch headphones” voice.
  • the user gives up using the first wireless audio playback device to play audio data, and uses the second wireless audio playback device to seamlessly switch audio playback.
  • the first Bluetooth headset when the electronic device sends the playback progress to the second wireless audio playback device, the first Bluetooth headset sends a reminder message of "Please switch the headset", and the user removes the first Bluetooth headset Or turn off, and then the second Bluetooth headset can continue to play following the playback progress of the first Bluetooth headset.
  • a warning voice may be played in the first wireless audio playback device when it is determined that a switching instruction is obtained, so as to remind the user to switch the wireless audio playback device later according to the prompt.
  • the first wireless audio playback device may also be controlled to no longer output a sound corresponding to the audio data.
  • the specific implementation manner of controlling the first wireless audio playback device to no longer output the sound corresponding to the audio data may be:
  • the first wireless audio playback device may be muted.
  • the electronic device may send a sound suppression instruction to the first wireless audio playback device, so as to minimize the volume output by the first wireless audio playback device.
  • the first wireless audio playback device is muted.
  • the first wireless audio playback device may be controlled to stop playing audio data, and specifically, a pause instruction is sent to the first wireless audio playback device, so that the first wireless audio playback device pauses playing audio data. It may be that, when the user operates the selection button corresponding to the first wireless audio device in the interface shown in FIG. 4, the selection button is switched to an unselected state, and the electronic device sends a pause instruction to the change when it detects the change. A first wireless audio playback device.
  • the first wireless audio playback device may also be turned off. Specifically, the electronic device sends a shutdown instruction to the first wireless audio playback device, so that the first wireless audio playback device is turned off.
  • the first wireless audio playback device and the second wireless audio playback device are both Bluetooth speakers
  • the first wireless audio playback device continues to play audio data
  • the user can continue to listen to the audio
  • the electronic device sends the audio data to the second wireless audio playback device for storage, and then obtains the playback progress of the audio data played by the first wireless audio playback device, and then controls the second wireless audio playback device to continue playing audio according to the playback progress.
  • Data it enables users to listen to audio data uninterruptedly and continuously.
  • the first wireless audio playback device and the second wireless audio playback device are both Bluetooth headsets
  • the first wireless audio playback device continues to play audio data, and the user can continue to pass the first
  • the wireless audio playback device plays audio data, so the user will not take off, turn off or mute the first wireless audio playback device.
  • the above warning voice may be used to remind the user not to switch, and at the same time, the electronic device sends audio data Save to the second wireless audio playback device, and then obtain the playback progress of the audio data played by the first wireless audio playback device, and then control the second wireless audio playback device to continue playing audio data according to the playback progress, and then the user can save the first wireless audio
  • the playback device is taken off, turned off, or muted, so that the user can also listen to the audio data uninterruptedly and continuously.
  • FIG. 8 illustrates an audio playback method provided by another embodiment of the present application, which is applied to the foregoing.
  • the electronic device specifically, the method includes: S801 to S806.
  • S802 Keep the first wireless audio playback device to continue playing the audio data, and send the audio data to the second wireless audio playback device, and instruct the second wireless audio playback device to send the acquired audio data. storage.
  • S804 Send the playback progress to the second wireless audio playback device, and instruct the second wireless audio playback device to play the stored audio data according to the playback progress.
  • S805 Acquire a distance value between the first wireless audio playback device and the electronic device.
  • the first wireless audio playback device and the second wireless audio playback device are both wireless headphones. Specifically, they may be Bluetooth headphones and two Bluetooth devices supporting A2dp / HFP.
  • the electronic device obtains a strength value of a wireless signal between the electronic device and a first wireless audio playback device, and determines a value between the first wireless audio playback device and the electronic device according to the strength value of the wireless signal.
  • the distance value between Specifically, if the correspondence between the strength value of the wireless signal and the distance value is stored in the electronic device, the strength value of the wireless signal between the electronic device and the first wireless audio playback device is obtained, and the search is performed in the correspondence relationship.
  • the distance value corresponding to the strength value of the wireless signal between the electronic device and the first wireless audio playback device, and the found distance value is used as the distance value between the first wireless audio playback device and the electronic device.
  • a positioning device is provided in both the second wireless audio playback device and the first wireless audio playback device.
  • the first wireless audio playback device can determine its own position information, and the first A distance value between a wireless audio playback device and the electronic device, for example, detecting a change in position information of the first wireless audio playback device to determine a change in the distance between the first wireless audio playback device and the electronic device, The determined distance change is recorded as the distance value.
  • the electronic device may also send a test signal to the first wireless audio playback device. After the first wireless audio playback device obtains the test signal, it returns a test result signal to the electronic device. Obtain a time length between sending a test signal and receiving a test result signal, and determine a distance value between the first wireless audio playback device and the electronic device according to the time length.
  • the preset threshold is a value set by the user according to his needs. When the distance is greater than the preset threshold, it indicates that the distance between the electronic device and the first wireless audio playback device is sufficiently far, which indicates that the user may have given up using the first threshold.
  • the wireless audio playback device plays audio data. For example, when a user uses an electronic device, the first wireless audio playback device plays audio data, and then the user switches to the second wireless audio playback device to play audio data. However, the first wireless audio playback device does not stop playing audio data, and Is left behind by the user, and usually, the user of the electronic device will carry it with him, and the distance between the first wireless audio playback device and the electronic device will become longer.
  • the distance between the electronic devices is greater than a preset threshold, and turning off the first wireless audio playback device can reduce the unnecessary consumption of power between the first wireless audio playback device and the electronic device.
  • the first wireless audio playback device includes a casing, a first audio playback module, and a pressure sensor.
  • the first audio playback module is disposed in the casing.
  • the pressure sensor is arranged on the surface of the housing, when the first wireless audio playback device is put into the ear, the pressure sensor will contact the user's ear, and the pressure value detected at this time is large, then When the first wireless audio playback device is removed from the user's ear, the detected pressure value is small, and whether the first wireless audio playback device is still worn in the user's ear can be determined through the change in pressure value. If not, turn off the first wireless audio playback device.
  • a specific implementation manner of acquiring the playback progress of the audio data is to detect whether the storage is obtained Success information.
  • the storage success information is indication information sent after the second wireless audio playback device successfully stores audio data.
  • the storage success information may be a text message or a voice message. If the storage success information is obtained, the playback progress of the audio data is obtained.
  • a delay may be performed for a certain time, and the playback progress of the audio data may be acquired after the delay ends.
  • FIG. 9 shows an audio playing method provided by another embodiment of the present application, which is applied to the above electronic device. Specifically, the method includes: S901 to S905.
  • S902 Keep the first wireless audio playback device to continue playing the audio data, and send the audio data to the second wireless audio playback device, and instruct the second wireless audio playback device to send the acquired audio data. storage.
  • the electronic device starts the timing function.
  • the electronic device may be provided with a timing device or a timing program. After executing S902, the timing device or the timing program is started to start timing.
  • the electronic device may also send a timing instruction to the second wireless audio playback device. After receiving the timing instruction, the second wireless audio playback device starts an internal timer to perform timing.
  • the electronic device or the second wireless audio playback device monitors the timing length and determines whether the timing length is greater than or equal to a preset time length, and if the timing length is greater than or equal to the preset time length, acquiring the playback progress of the audio data, and
  • the playback volume of the second wireless audio playback device may also be adjusted to a preset volume.
  • the preset volume is greater than the silence volume, and may be a default playback volume value of the electronic device or the second wireless audio playback device.
  • the second wireless audio playback device starts the internal timer to perform timing after receiving the timing instruction in S903
  • the second wireless audio playback device determines that the timing length is greater than or equal to a preset time length, and obtains The first wireless audio playback device plays the playback progress of the audio data.
  • the volume value of the second wireless audio playback device can also be adjusted to a preset volume and the timing result is fed back to the electronic device.
  • the user can pass the second When the wireless audio playback device hears audio, the user may choose to take off the first wireless audio playback device or stop the first wireless audio playback device from playing audio data.
  • S905 Send the playback progress to the second wireless audio playback device, and instruct the second wireless audio playback device to play the stored audio data according to the playback progress.
  • the audio data is a piece of speech, that is, "I am from Sichuan, I love hot and sour noodles, and I also like hot pot.”
  • the schematic diagram of the progress bar of the audio data is shown in FIG. 10.
  • t1 is the first playback time point corresponding to the playback progress of the audio data when it is determined that the switching instruction is obtained. Assume that the content of the audio data corresponding to t1 is "human”. When the electronic device obtains the switching instruction, the user The voice of "I am a Sichuanese" has been heard through the first wireless audio playback device.
  • the electronic device sends the audio data to the second wireless audio playback device, and the second wireless audio playback device stores the audio data after the decoding operation.
  • the timing function When it is determined that the timing length is greater than or equal to a preset time length, wherein the preset time length is ⁇ t ′ in FIG. 10, and the time point corresponding to t1 plus ⁇ t ′ is t3, then at t3 At the position, it is assumed that the corresponding content is "pink", that is, the phrase "I love hot and sour powder" can be heard by the user through the first wireless audio playback device, but not through the second wireless audio playback device. It can be heard because, during this time period, the second wireless audio playback device is still receiving audio data without playing audio data.
  • the electronic device obtains the playback progress of the audio data played by the first wireless audio playback device, records it as the second playback progress, that is, t3, and then sends t3 to the second wireless audio playback device.
  • the second wireless audio playback device plays audio data at the position of T3, that is, the position of t3, and then, at this time, the electronic device controls the first wireless audio playback device to pause playback, and "after t3" and I also like to eat The "hot pot" voice can be heard by the user through the second wireless audio playback device.
  • FIG. 11 shows a structural block diagram of an audio playback apparatus 1100 provided in an embodiment of the present application.
  • the apparatus is applied to an electronic device that can simultaneously connect a first wireless audio playback device and a second wireless audio device.
  • Playback device Specifically, the audio playback device 1100 may include a determination unit 1101, a storage unit 1102, an acquisition unit 1103, and a playback unit 1104.
  • a determining unit 1101 is configured to determine whether a switching instruction is acquired when it is detected that the electronic device is playing audio data through the first wireless audio playback device.
  • the storage unit 1102 is configured to, if a switching instruction is obtained, keep the first wireless audio playback device to continue playing the audio data, and send the audio data to the second wireless audio playback device to instruct the second wireless audio playback device
  • the wireless audio playback device stores the acquired audio data.
  • the obtaining unit 1103 is configured to obtain a playback progress of the audio data.
  • the playback unit 1104 is configured to send the playback progress to the second wireless audio playback device, and instruct the second wireless audio playback device to play the stored audio data according to the playback progress.
  • the coupling between the modules may be electrical, mechanical, or other forms of coupling.
  • each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist separately physically, or two or more modules may be integrated into one module.
  • the above integrated modules may be implemented in the form of hardware or software functional modules.
  • the electronic device 100 may be an electronic device capable of running an application program, such as a smart phone, a tablet computer, or an e-book.
  • the electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, a Bluetooth module 140, and one or more application programs.
  • One or more of the application programs may be stored in the memory 120 and stored in the memory 120. It is configured to be executed by one or more processors 110, and one or more programs are configured to execute the method as described in the foregoing method embodiment.
  • the processor 110 may include one or more processing cores.
  • the processor 110 uses various interfaces and lines to connect various parts in the entire electronic device 100, and executes or executes instructions, programs, code sets, or instruction sets stored in the memory 120 by calling or executing data stored in the memory 120 to execute Various functions and processing data of the electronic device 100.
  • the processor 110 may use at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). To implement a hardware form.
  • the processor 110 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), and a modem.
  • CPU Central Processing Unit
  • GPU Graphics Processing Unit
  • modem modem
  • the CPU mainly handles the operating system, user interface, and application programs; the GPU is responsible for rendering and rendering of the displayed content; the modem is used for wireless communication. It can be understood that the modem may not be integrated into the processor 110, and may be implemented by a single communication chip.
  • the processor 110 can connect the first wireless audio playback device and the second wireless audio playback device at the same time, and can send audio data to be played by the electronic device to the first wireless audio playback device and the second wireless audio playback device for playback. It can send some instructions to the first wireless audio playback device and the second wireless audio playback device for playback, and can also receive some data and instructions from the first wireless audio playback device and the second wireless audio playback device for playback.
  • the memory 120 may include Random Access Memory (RAM), and may also include Read-Only Memory.
  • the memory 120 may be used to store instructions, programs, codes, code sets, or instruction sets.
  • the memory 120 may include a storage program area and a storage data area, where the storage program area may store instructions for implementing an operating system and instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , Instructions for implementing the following method embodiments, and the like.
  • the storage data area may also store data (such as phonebook, audio and video data, and chat history data) created by the terminal 100 during use.
  • the Bluetooth module 140 is configured to implement a Bluetooth connection between the electronic device and the Bluetooth device, and data interaction with the Bluetooth device. Specifically, it can communicate with Bluetooth devices through the Bluetooth protocol 5.0 / 4.2 / 4.1 / 2.1 / 2.0, or through Bluetooth Low Energy (BLE), Enhanced Data Rate (EDR), or Bluetooth basic rate. (Base, Rate, BR) and so on.
  • the Bluetooth module 140 may include a power amplifier, a wireless transceiver, a transceiver switch, a low-noise amplifier, and an antenna.
  • the transceiver When transmitting a signal, the transceiver itself will output a weak RF signal of low power directly, send it to a Power Amplifier (PA) for power amplification, and then radiate it to the antenna via Antenna through the Transmit / Receive Switch. space.
  • PA Power Amplifier
  • the antenna When receiving a signal, the antenna will sense the electromagnetic signal in the space, and then send it to a Low Noise Amplifier (LNA) for amplification after switching, so that the amplified signal can be sent directly to the transceiver for processing.
  • LNA Low Noise Amplifier
  • the Bluetooth module 140 can use the 2.4 GHz frequency band.
  • FIG. 13 shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application.
  • the computer-readable storage medium 1300 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 1300 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 1300 includes a non-transitory computer-readable storage medium.
  • the computer-readable storage medium 1300 has a storage space of a program code 1310 for performing any of the method steps in the above method. These program codes can be read from or written into one or more computer program products.
  • Program code 1310 may be compressed in a suitable form, for example.

Abstract

The present application belongs to the technical field of communications, and disclosed are an audio playback method and apparatus, an electronic device and a storage medium. Said method comprises: when it is detected that an electronic device is playing back audio data by means of a first wireless audio playback device, determining whether a switching instruction is acquired; if the switching instruction is acquired, keeping the first wireless audio playback device to continue to play back the audio data, sending the audio data to a second wireless audio playback device, and instructing the second wireless audio playback device to store the acquired audio data; acquiring the playback progress of the audio data; and sending the playback progress to the second wireless audio playback device, and instructing the second wireless audio playback device to play back the stored audio data according to the playback progress. The present application can avoid stutter and pause during playback of the audio data by the second wireless audio playback device due to the fact that the audio data has not been sent to the second wireless audio playback device after the switching instruction is acquired.

Description

音频播放方法、装置、电子设备及存储介质Audio playing method, device, electronic equipment and storage medium
相关申请的交叉引用Cross-reference to related applications
本申请要求于2018年9月30日提交的申请号为201811161323.3的中国申请的优先权,其在此出于所有目的通过引用将其全部内容并入本文。This application claims priority from a Chinese application with an application number of 201811161323.3, filed on September 30, 2018, which is hereby incorporated by reference herein in its entirety for all purposes.
技术领域Technical field
本申请涉及通信技术领域,更具体地,涉及一种音频播放方法、装置、电子设备及存储介质。The present application relates to the field of communication technology, and more particularly, to an audio playing method, device, electronic device, and storage medium.
背景技术Background technique
目前,使用无线音频播放设备播放电子设备内的音频数据,能够减少有线耳机所带来的不便,但是,在电子设备使用无线音频播放设备播放音乐的时候,如果从一个无线音频播放设备切换到另一个无线音频播放设备,会导致正在播放的音乐暂停播放或者出现段时间暂停播放的卡顿现象,需要用户手动开启继续播放,操作繁琐,用户体验不高。At present, the use of wireless audio playback devices to play audio data in electronic devices can reduce the inconvenience caused by wired headphones. However, when electronic devices use wireless audio playback devices to play music, if you switch from one wireless audio playback device to another A wireless audio playback device may cause the music being played to be paused or a pause that may be paused for a certain period of time, requiring the user to manually start and continue to play, which is cumbersome and the user experience is not high.
发明内容Summary of the Invention
本申请提出了一种音频播放方法、装置、电子设备及存储介质,以改善上述缺陷。The present application proposes an audio playback method, device, electronic device, and storage medium to improve the above defects.
第一方面,本申请实施例提供了一种音频播放方法,应用于电子设备,所述电子设备能够同时连接第一无线音频播放设备和第二无线音频播放设备。所述方法包括:当检测到所述电子设备正在通过所述第一无线音频播放设备播放音频数据时,判断是否获取到切换指令;若获取到切换指令,保持所述第一无线音频播放设备继续播放所述音频数据,并将所述音频数据发送至所述第二无线音频播放设备,指示所述第二无线音频播放设备将所获取的音频数据存储;获取所述音频数据的播放进度;发送所述播放进度至所述第二无线音频播放设备,指示所述第二无线音频播放设备根据所述播放进度播放所存储的音频数据。In a first aspect, an embodiment of the present application provides an audio playback method, which is applied to an electronic device, and the electronic device can be connected to a first wireless audio playback device and a second wireless audio playback device simultaneously. The method includes: when detecting that the electronic device is playing audio data through the first wireless audio playback device, determining whether a switching instruction is acquired; and if the switching instruction is acquired, maintaining the first wireless audio playback device to continue Playing the audio data, and sending the audio data to the second wireless audio playback device, instructing the second wireless audio playback device to store the acquired audio data; obtaining a playback progress of the audio data; sending The playback progress reaches the second wireless audio playback device, and instructs the second wireless audio playback device to play the stored audio data according to the playback progress.
第二方面,本申请实施例还提供了一种音频播放装置,应用于电子设备,所述电子设备能够同时连接第一无线音频播放设备和第二无线音频播放设备。所述播放装置包括:判断单元、存储单元、获取单元和播放单元。判断单元,用于当检测到所述电子设备正在通过所述第一无线音频播放设备播放音频数据时,判断是否获取到切换指令。存储单元,用于若获取到切换指令,保持所述第一无线音频播放设备继续播放所述音频数据,并将所述音频数据发送至所述第二无线音频播放设备,指示所述第二无线音频播放设备将所获取的音频数据存储。获取单元,用于获取所述音频数据的播放进度。播放单元,用于发送所述播放进度至所述第二无线音频播放设备,指示所述第二无线音频播放设备根据所述播放进度播放所存储的音频数据。In a second aspect, an embodiment of the present application further provides an audio playback device, which is applied to an electronic device, and the electronic device can be connected to a first wireless audio playback device and a second wireless audio playback device simultaneously. The playback device includes a judgment unit, a storage unit, an acquisition unit, and a playback unit. A judging unit is configured to determine whether a switching instruction is acquired when it is detected that the electronic device is playing audio data through the first wireless audio playback device. A storage unit configured to, if a switching instruction is obtained, keep the first wireless audio playback device to continue playing the audio data, and send the audio data to the second wireless audio playback device to instruct the second wireless audio playback device The audio playback device stores the acquired audio data. An obtaining unit is configured to obtain a playback progress of the audio data. The playback unit is configured to send the playback progress to the second wireless audio playback device, and instruct the second wireless audio playback device to play the stored audio data according to the playback progress.
第三方面,本申请实施例还提供了一种电子设备,包括:一个或多个处理器,所述一个或多个处理器能够同时连接第一无线音频播放设备和第二无线音频播放设备;存储器;一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行上述方法。According to a third aspect, an embodiment of the present application further provides an electronic device, including: one or more processors capable of simultaneously connecting the first wireless audio playback device and the second wireless audio playback device; Memory; one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured for Perform the above method.
第四方面,本申请实施例还提供了一种计算机可读取存储介质,所述计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行上述方法。According to a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores program code, and the program code can be called by a processor to execute the foregoing method.
=
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions in the embodiments of the present application more clearly, the drawings used in the description of the embodiments are briefly introduced below. Obviously, the drawings in the following description are just some embodiments of the application. For those skilled in the art, other drawings can be obtained based on these drawings without paying creative labor.
图1示出了本申请一实施例提供的语音系统的模块框图;FIG. 1 shows a module block diagram of a voice system provided by an embodiment of the present application;
图2示出了本申请另一实施例提供的语音系统的模块框图;FIG. 2 shows a block diagram of a voice system according to another embodiment of the present application;
图3示出了本申请一实施例提供的一种音频播放方法的方法流程图;FIG. 3 shows a method flowchart of an audio playback method according to an embodiment of the present application;
图4示出了本申请实施例提供的设备管理界面的示意图;FIG. 4 is a schematic diagram of a device management interface according to an embodiment of the present application; FIG.
图5示出了本申请实施例提供的音频播放界面的示意图;FIG. 5 shows a schematic diagram of an audio playback interface provided by an embodiment of the present application;
图6示出了本申请一实施例提供的音频播放进度条的示意图;FIG. 6 is a schematic diagram of an audio playback progress bar provided by an embodiment of the present application; FIG.
图7示出了本申请另一实施例提供的音频播放进度条的示意图;FIG. 7 is a schematic diagram of an audio playback progress bar according to another embodiment of the present application; FIG.
图8示出了本申请另一实施例提供的一种音频播放方法的方法流程图;FIG. 8 shows a method flowchart of an audio playback method according to another embodiment of the present application;
图9示出了本申请又一实施例提供的一种音频播放方法的方法流程图;FIG. 9 shows a method flowchart of an audio playback method according to another embodiment of the present application;
图10示出了本申请又一实施例提供的音频播放进度条的示意图;FIG. 10 is a schematic diagram of an audio playback progress bar according to another embodiment of the present application; FIG.
图11示出了本申请实施例提供的一种音频播放装置的模块框图;FIG. 11 shows a module block diagram of an audio playback device according to an embodiment of the present application; FIG.
图12示出了本申请实施例提供的电子设备的模块框图;FIG. 12 shows a module block diagram of an electronic device according to an embodiment of the present application; FIG.
图13示出了本申请实施例提供的用于保存或者携带实现根据本申请实施例的音频播放方法的程序代码的存储单元。FIG. 13 shows a storage unit for storing or carrying program code for implementing an audio playing method according to an embodiment of the present application, provided by an embodiment of the present application.
具体实施方式detailed description
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application.
随着音频播放设备的种类增多以及播放音效的提升,更多的用户会选择将手机、平板电脑等电子设备待播放的音频输出到音频播放设备进行播放。其中,常见的音频播放设备包括车载音乐播放器、音箱以及耳机等。With the increase in the types of audio playback devices and the improvement of playback sound effects, more users will choose to output audio to be played by electronic devices such as mobile phones and tablets to the audio playback device for playback. Among them, common audio playback devices include car music players, speakers, and headphones.
而音频播放设备根据连接方式不同,可以分为有线音频播放设备和无线音频播放设备,则电子设备可以与无线音频播放设备之间通过无线网络进行交互以传输信号,其中,该无线网络可以是蓝牙、wifi、LTE网络或者NFC等等。According to different connection methods, audio playback devices can be divided into wired audio playback devices and wireless audio playback devices. The electronic device can interact with the wireless audio playback device through a wireless network to transmit signals. The wireless network may be Bluetooth. , Wifi, LTE network or NFC, etc.
示例性地,如图1所示,示出了本申请实施例提供的语音系统1的模块图。具体地,该语音系统1包括电子设备100、第一无线音频播放设备210和第二无线音频播放设备220,电子设备100能够同时与第一无线音频播放设备210和第二无线音频播放设备220连接。Exemplarily, as shown in FIG. 1, a block diagram of a voice system 1 provided by an embodiment of the present application is shown. Specifically, the voice system 1 includes an electronic device 100, a first wireless audio playback device 210, and a second wireless audio playback device 220. The electronic device 100 can be connected to the first wireless audio playback device 210 and the second wireless audio playback device 220 at the same time. .
在本发明实施例中,电子设备100内安装有能够播放音频的应用程序,具体地,该应用程序可以是音频播放软件、视频播放软件或者通话软件等。电子设备100将需要播放的音频发送给第一无线音频播放设备210或第二无线音频播放设备220,由第一无线音频播放设备210或第二无线音频播放设备220播放语音。In the embodiment of the present invention, an application capable of playing audio is installed in the electronic device 100. Specifically, the application may be audio playing software, video playing software, or calling software. The electronic device 100 sends the audio to be played to the first wireless audio playback device 210 or the second wireless audio playback device 220, and the first wireless audio playback device 210 or the second wireless audio playback device 220 plays the voice.
本发明实施例中,第一无线音频播放设备210和第二无线音频播放设备220均可以是蓝牙音响或者蓝牙耳机,第一无线音频播放设备210和第二无线音频播放设备220可以通过开启蓝牙功能实现与电子设备100的连接,且在建立连接之后,电子设备100将其需要播放的语音发送给蓝牙音响,由蓝牙音响实现语音播放。In the embodiment of the present invention, the first wireless audio playback device 210 and the second wireless audio playback device 220 may both be Bluetooth speakers or Bluetooth headsets. The first wireless audio playback device 210 and the second wireless audio playback device 220 may be enabled with the Bluetooth function. A connection with the electronic device 100 is achieved, and after the connection is established, the electronic device 100 sends the voice that it needs to play to the Bluetooth audio, and the Bluetooth audio implements voice playback.
当第一无线音频播放设备210和第二无线音频播放设备220均为蓝牙设备时,电子设备100能够通过蓝牙模块同时与第一无线音频播放设备210和第二无线音频播放设备220连接,作为一种实施方式,可以是电子设备内的蓝牙模块可以支持多点连接,从而能够实现图1所示的电子设备分别与第一无线音频播放设备210和第二无线音频播放设备220连接,则在建立连接之后,电子设备100能够获取到第一无线音频播放设备210和第二无线音频播放设备220的标识,该标识可以是MAC地址。具体地,当电子设备的蓝牙功能开启的时候,电子设备会对周围一定距离范围内的蓝牙设备扫描,具体地,由电子设备的蓝牙芯片或者其他底层网络模块接收到扫描命令后,按照预设的信道扫描顺序进行扫描,如先扫描常用信道1、7、13信道,再扫描其他的非常用信道,由此获得当前范围内的所有蓝牙设备的标识,并显示在电子设备的蓝牙列表界面内。When the first wireless audio playback device 210 and the second wireless audio playback device 220 are both Bluetooth devices, the electronic device 100 can be connected to the first wireless audio playback device 210 and the second wireless audio playback device 220 through the Bluetooth module at the same time. In an implementation manner, the Bluetooth module in the electronic device may support multipoint connection, so that the electronic device shown in FIG. 1 can be connected to the first wireless audio playback device 210 and the second wireless audio playback device 220, respectively. After the connection, the electronic device 100 can obtain the identities of the first wireless audio playback device 210 and the second wireless audio playback device 220, and the identifications may be MAC addresses. Specifically, when the Bluetooth function of the electronic device is turned on, the electronic device scans the Bluetooth devices within a certain distance from the surrounding area. Specifically, after receiving the scan command from the electronic device's Bluetooth chip or other underlying network module, the preset Scan in the order of channel scanning. For example, scan the common channels 1, 7, and 13 first, and then scan the other unused channels, so as to obtain the identification of all Bluetooth devices in the current range and display them in the Bluetooth list interface of the electronic device. .
如果在所扫描到的蓝牙设备的标识中存在已经连接过且信号强度较好的蓝牙设备,电子设备会自动与该蓝牙设备连接,则用户也可以在蓝牙列表界面内选择一个蓝牙设备进行连接。If there is a connected Bluetooth device with a better signal strength in the scanned Bluetooth device identification, the electronic device will automatically connect with the Bluetooth device, and the user can also select a Bluetooth device in the Bluetooth list interface to connect.
当电子设备与外部的蓝牙设备连接时,则电子设备的系统会获取到一个状态值,该状态值表示电子设备当前已经连接蓝牙设备。从而,电子设备能够检测到已经连接上的蓝牙设备,从而获取到蓝牙设备的设备标识。When the electronic device is connected to an external Bluetooth device, the system of the electronic device obtains a status value, which indicates that the electronic device is currently connected to the Bluetooth device. Therefore, the electronic device can detect the Bluetooth device that has been connected, thereby obtaining the device identification of the Bluetooth device.
作为另一种实施方式,电子设备100与第一无线音频播放设备210通过蓝牙连接,然后,第一无线音频播放设备210再通过蓝牙和第二无线音频播放设备220连接,从而,电子设备100、第一无线音频播放设备210和第二无线音频播放设备220通过组网的方式实现同时连接,即第一无线音频播放设备210作为电子设备100和第二无线音频播放设备220的中继器。As another implementation manner, the electronic device 100 is connected to the first wireless audio playback device 210 through Bluetooth, and then the first wireless audio playback device 210 is connected to the second wireless audio playback device 220 through Bluetooth. Therefore, the electronic device 100, The first wireless audio playback device 210 and the second wireless audio playback device 220 are connected at the same time through networking, that is, the first wireless audio playback device 210 serves as a repeater of the electronic device 100 and the second wireless audio playback device 220.
因此,在电子设备100同时与第一无线音频播放设备210和第二无线音频播放设备220连接之后,可以实现不同的音频播放设备播放不同的音频数据,当然,也可以是不同的音频播放设备播放相同的音频数据,以实现立体声等效果。也可以是使用其中一个无线音频播放设备播放音频数据,而另一个无线音频播放设备处于待机状态而不播放音频。Therefore, after the electronic device 100 is connected to the first wireless audio playback device 210 and the second wireless audio playback device 220 at the same time, different audio playback devices can play different audio data. Of course, it can also be played by different audio playback devices. Same audio data to achieve effects like stereo. It is also possible to use one of the wireless audio playback devices to play audio data while the other wireless audio playback device is on standby without playing audio.
但是,发明人在研究中发现,如果从一个无线音频播放设备切换到另一个无线音频播放设备,而另一个无线音频播放设备此时并没有要播放的音频数据,则需要电子设备将音频数据发送至无线音频播放设备,则音频数据的传输过程以及解码过程都需要消耗一定的时间,因为,如果在切换之后里面播放,可能会导致另一个无线音频播放设备由于还未获取到音频数据或者还未解压完全,导致无法播放,则就会出现卡顿的现象,会影响用户体验。However, the inventor found in research that if one wireless audio playback device is switched to another wireless audio playback device and the other wireless audio playback device does not have audio data to play at this time, the electronic device is required to send the audio data To the wireless audio playback device, the audio data transmission process and decoding process need to take a certain amount of time, because if it is played inside after switching, it may cause another wireless audio playback device because the audio data has not been acquired or has not yet been acquired. If the decompression is complete, and it cannot be played, a freeze phenomenon will occur, which will affect the user experience.
因此,为了解决上述技术缺陷,本申请实施例提供了一种音频播放方法,应用于上述电子设备,具体地,请参阅图3,图3示出了本申请一个实施例提供的音频播放方法的流程示意图,该方法包括:S301至S304。Therefore, in order to solve the above technical defects, an embodiment of the present application provides an audio playback method, which is applied to the above-mentioned electronic device. Specifically, please refer to FIG. 3, which illustrates an audio playback method provided by an embodiment of the present application. A schematic flowchart of the method includes: S301 to S304.
S301:当检测到所述电子设备正在通过所述第一无线音频播放设备播放音频数据 时,判断是否获取到切换指令。S301: When it is detected that the electronic device is playing audio data through the first wireless audio playback device, determine whether a switching instruction is obtained.
其中,电子设备同时与第一无线音频播放设备和第二无线音频播放设备连接,则用户在播放音频数据的时候,能够在电子设备的音频播放界面选中要播放的音乐,如图1和2所示的电子设备的显示的界面,选中其中一个或者多个音频数据,点击播放按钮就能够播放所选中的音频数据。另外,用户还能够通过电子设备选中用于播放音频数据的无线音频播放设备。The electronic device is connected to the first wireless audio playback device and the second wireless audio playback device at the same time. When the user plays audio data, the user can select the music to be played on the audio playback interface of the electronic device, as shown in Figures 1 and 2. The displayed interface of the electronic device shown below, select one or more audio data, and click the play button to play the selected audio data. In addition, the user can also select a wireless audio playback device for playing audio data through the electronic device.
例如,图4所示,示出了电子设备的设备管理界面,在该设备管理界面内,显示有电子设备所连接的两个无线音频播放设备的操作界面,具体地,包括两个无线音频播放设备的选择按钮,图4中的每个设备对应的选择按钮,例如,在圆形按钮位于左侧时,电子设备选中无线音频播放设备播放音频数据。则在建立连接之后,电子设备所播放的音频数据就能够通过所连接的无线音频播放设备播放该音频数据。For example, as shown in FIG. 4, a device management interface of an electronic device is shown. In the device management interface, an operation interface of two wireless audio playback devices connected to the electronic device is displayed, and specifically includes two wireless audio playback devices. A device selection button, which is a selection button corresponding to each device in FIG. 4, for example, when the round button is on the left, the electronic device selects a wireless audio playback device to play audio data. After the connection is established, the audio data played by the electronic device can play the audio data through the connected wireless audio playback device.
另外,在该界面内,每个无线音频播放设备还对应一个下拉菜单,用户能够通过该下拉菜单为无线音频播放设备配置用户播放音频的应用程序,例如,为设备1配置第一应用程序,为设备2配置第二应用程序,则在如果电子设备能够分别控制第一应用程序播放第一音频数据以及控制第二应用程序播放第二音频数据的时候,就能够使得设备1播放第一应用程序的第一音频数据,而使设备2播放第二应用程序的第二音频数据。In addition, in this interface, each wireless audio playback device also corresponds to a drop-down menu. The user can use the drop-down menu to configure the user's audio playback application for the wireless audio playback device. For example, configure the first application for device 1 as Device 2 is configured with a second application program, and if the electronic device can control the first application program to play the first audio data and control the second application program to play the second audio data, the device 1 can cause the device 1 to play the first application program. The first audio data causes the device 2 to play the second audio data of the second application.
因此,通过该界面内的按钮状态能够确定电子设备是否与第一无线音频播放设备连接,另外,还可以对电子设备通过蓝牙连接的设备是否为音频播放设备进行检测,其中,在基于android操作系统的电子设备中,可以通过基于实例化BluetoothClass.Device类所得到的返回值来确定当前通过蓝牙连接的设备类型。若返回的值为AUDIO_VIDEO_CAMCORDER,则表征为图像采集设备;若返回的值为AUDIO_VIDEO_CAR_AUDIO,则表征为车载设备;若返回的值为AUDIO_VIDEO_HIFI_AUDIO,则表征为音频播放设备或者视频播放设备,例如,蓝牙耳机;若返回的值为AUDIO_VIDEO_MICROPHONE,则表征其为麦克风。Therefore, whether the electronic device is connected to the first wireless audio playback device can be determined through the button status in the interface. In addition, whether the device connected by the electronic device through Bluetooth is an audio playback device can be detected. In an electronic device, 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 capture device; if the returned value is AUDIO_VIDEO_CAR_AUDIO, it is characterized as a car device; if the returned value is AUDIO_VIDEO_HIFI_AUDIO, it is characterized as an audio playback device or a video playback device, such as a Bluetooth headset; If the returned value is AUDIO_VIDEO_MICROPHONE, it indicates that it is a microphone.
在确定电子设备连接无线音频播放设备的时候,也就是说,在电子设备连接无线音频播放设备之后,检测电子设备是否接收到播放请求,该播放请求为用于请求播放音频数据的请求,则如果在电子设备与第一无线音频播放设备连接,并且选中第一无线音频播放设备作为播放电子设备的音频数据的设备时,确定是否获取到用户操作电子设备而数据的音频数据的播放请求,如果获取到播放请求,则就确定电子设备在通过第一无线音频播放设备播放音频数据。When it is determined that the electronic device is connected to the wireless audio playback device, that is, after the electronic device is connected to the wireless audio playback device, it is detected whether the electronic device has received a playback request, and the playback request is a request for playing audio data. When the electronic device is connected to the first wireless audio playback device and the first wireless audio playback device is selected as a device for playing audio data of the electronic device, it is determined whether a playback request for audio data of the data is obtained when the user operates the electronic device, and if Upon the playback request, it is determined that the electronic device is playing audio data through the first wireless audio playback device.
具体地,播放请求可以是提醒信息,也可以是语音播放请求。其中,提醒信息包括通话提醒信息、短信提醒信息以及闹铃提醒信息等用于提醒用户某些事件已经触发的信息。例如,通话提醒信息用于提醒用户当前有来电。Specifically, the playback request may be reminder information or a voice playback request. The reminder information includes call reminder information, short message reminder information, and alarm reminder information to remind the user that certain events have been triggered. For example, the call reminder information is used to remind the user of an incoming call.
作为另一种实施方式,发声请求可以是在电子设备发声的过程中,每次播放语音的请求。则该发声请求可以是音频发声请求,也可以是视频发声请求或者通话发声请求。As another implementation manner, the utterance request may be a request to play a voice each time during the utterance of the electronic device. The utterance request may be an audio utterance request, or a video utterance request or a call utterance request.
具体地,电子设备内安装有多个音频播放软件,则该软件可以是音乐播放APP、视频播放APP或者录音APP等。例如,视频播放界面设置有视频播放按键,通过对该视频播放按键的触控的检测,能够确定电子设备当前是否接收到音频数据的播放请求,例如,用户选中视频,进入视频的播放界面,点击该播放界面的播放按钮,应用程序通过对用户触控操作的监听,能够检测到用户当前所点击的是什么类型的视频,具体地,播放按钮设置有预设属性,检测到所获取的触控操作对应的播放按钮的属性,就能够确定用户所选中的待播放视频,进而获取到播放请求,以及该播放请求对应的音频。Specifically, if multiple audio playback software is installed in the electronic device, the software may be a music playback APP, a video playback APP, a recording APP, or the like. For example, the video playback interface is provided with a video playback button. By detecting the touch of the video playback button, it can be determined whether the electronic device currently receives a playback request for audio data. For example, the user selects a video, enters the video playback interface, and clicks. The playback button of the playback interface allows the application to detect what type of video the user is currently clicking by monitoring the user ’s touch operation. Specifically, the playback button is set with preset attributes to detect the acquired touch By operating the properties of the corresponding playback button, the user can determine the video to be played selected by the user, and then obtain a playback request and the audio corresponding to the playback request.
然后,检测电子设备是否获取到切换指令,具体地,电子设备在使用一个无线音频播放设备播放音频数据的时候,用户可以使用另外一个无线音频播放设备播放音频数 据,例如,电子设备在使用第一无线音频播放设备播放音频数据的时候,检测是否请求使用第二无线音频播放设备播放音频数据,如果是,则判定获取到切换指令。Then, it is detected whether the electronic device obtains the switching instruction. Specifically, when the electronic device uses one wireless audio playback device to play audio data, the user can use another wireless audio playback device to play audio data. For example, the electronic device is using the first wireless audio playback device. When the wireless audio playback device plays audio data, it is detected whether the second wireless audio playback device is requested to play audio data, and if so, it is determined that a switching instruction is obtained.
作为一种实施方式,可以是在电子设备的某个界面内切换用于播放电子设备的音频数据的,如图4所示,用户在使用第一无线音频播放设备的时候,在该界面内选中第一无线音频播放设备,而在切换的时候,选中第二无线音频播放设备,则通过对第二无线音频播放设备对应的选择按钮检测,就能够确定是否请求使用第二无线音频播放设备播放音频数据,如果是,则判定获取到切换指令。As an implementation manner, the audio data of the electronic device may be switched in an interface of the electronic device. As shown in FIG. 4, when the user uses the first wireless audio playback device, the user selects the selected data in the interface. The first wireless audio playback device, and when the second wireless audio playback device is selected when switching, by detecting the selection button corresponding to the second wireless audio playback device, it can be determined whether the second wireless audio playback device is requested to play audio Data, if yes, it is determined that a switching instruction is obtained.
作为另一种实施方式,还可以是在电子设备的音频播放界面内就可以选择使用哪种无线音频播放设备播放音频数据,具体地,如图5所示,在选择菜单栏所选中的无线音频播放设备就用于播放音频数据,则用户从设备1切换选择到设备2,就输入了请求使用第二无线音频播放设备播放音频数据,即输入了切换指令。As another implementation manner, it is also possible to select which wireless audio playback device is used to play audio data in the audio playback interface of the electronic device. Specifically, as shown in FIG. 5, the wireless audio selected in the selection menu bar The playback device is used to play audio data, and the user switches from device 1 to device 2 and inputs a request to play audio data using the second wireless audio playback device, that is, a switching instruction is input.
S302:保持所述第一无线音频播放设备继续播放所述音频数据,并将所述音频数据发送至所述第二无线音频播放设备,指示所述第二无线音频播放设备将所获取的音频数据存储。S302: Keep the first wireless audio playback device to continue playing the audio data, and send the audio data to the second wireless audio playback device, and instruct the second wireless audio playback device to send the acquired audio data. storage.
在检测到获取切换指令之后,不暂停第一无线音频播放设备对音频数据的播放,即用户依然能够在第一无线音频播放设备内收听音频数据,此时,用户不会将第一无线音频播放设备关闭,而如果第一无线音频播放设备为蓝牙耳机的情况下,则用户不会将第一无线音频播放设备从耳朵内摘下,作为一种实施方式,可以在成功切换到第二无线音频播放设备来播放音频数据的时候,由第一无线音频播放设备播放一段提示语音,例如,“请切换耳机”。After detecting the acquisition switching instruction, the first wireless audio playback device does not pause the audio data playback, that is, the user can still listen to the audio data in the first wireless audio playback device. At this time, the user will not play the first wireless audio playback The device is turned off, and if the first wireless audio playback device is a Bluetooth headset, the user will not remove the first wireless audio playback device from the ear. As an implementation manner, the user can successfully switch to the second wireless audio device. When the playback device plays audio data, a prompt voice is played by the first wireless audio playback device, for example, "Please switch headphones".
具体地,电子设备遵照一定的蓝牙协议将全部音频数据以及播放进度发送至第二无线音频播放设备,具体地,将该音频数据根据所支持的蓝牙协议下的编码格式将音频数据编码,例如,针对音频,常采用Apt-X、SBC、AAC、LDAC编码算法,将音频数据编码之后生成音频数据包,再通过电子设备与第二无线音频播放设备之间的蓝牙传输通道将音频数据包发送至第二无线音频播放设备。Specifically, the electronic device sends all audio data and playback progress to the second wireless audio playback device according to a certain Bluetooth protocol. Specifically, the audio data encodes the audio data according to a coding format supported by the Bluetooth protocol. For example, For audio, Apt-X, SBC, AAC, and LDAC encoding algorithms are often used to encode audio data to generate audio data packets. The audio data packets are then sent to the Bluetooth transmission channel between the electronic device and the second wireless audio playback device. A second wireless audio playback device.
另外,还可以是将音频数据中播放进度之后的部分音频数据发送至第二无线音频播放设备,具体地,将确定获取到切换指令的时间点作为第一播放时间节点,将音频数据中第一播放时间节点之后的音频数据作为待发送的音频数据,将待发送的音频数据发送至第二无线音频播放设备。In addition, part of the audio data after the playback progress in the audio data can also be sent to the second wireless audio playback device. Specifically, the time point at which the switching instruction is obtained is determined as the first playback time node, and the first in the audio data is The audio data after the playback time node is used as the audio data to be sent, and the audio data to be sent is sent to the second wireless audio playback device.
第二无线音频播放设备在获取到音频数据之后,将音频数据通过传输协议解码,得到待播放的音频数据,将待播放的音频数据存储。After acquiring the audio data, the second wireless audio playback device decodes the audio data through a transmission protocol to obtain audio data to be played, and stores the audio data to be played.
另外,第二无线音频播放设备播放音频数据的时候,需要根据一定的音频编码对要播放的音频数据进行音频解码,例如,MP3格式或者HQV格式的音乐,都需要先解码成PCM格式的音频数据,再将PCM格式的音频数据播放,因此,可以在获取到音频数据,将音频数据进行音频解码,将音频解码后的音频数据存储。In addition, when the second wireless audio playback device plays audio data, the audio data to be played needs to be decoded according to a certain audio encoding. For example, music in MP3 format or HQV format needs to be decoded into audio data in PCM format first. Then, the audio data in the PCM format is played. Therefore, after the audio data is obtained, the audio data can be audio decoded, and the decoded audio data can be stored.
具体地,将所述音频数据发送至所述第二无线音频播放设备,指示所述第二无线音频播放设备将所获取的音频数据存储的具体实施方式为:将所述音频数据发送至所述第二无线音频播放设备,指示所述第二无线音频播放设备将所获取的音频数据进行音频解码,将音频解码后的音频数据存储。作为一种实施方式,可以是第二无线音频播放设备获取到电子设备发送的经过传输协议编码后的音频数据之后,对音频数据解码以获得待播放的音频数据,然后,再对待播放的音频数据进行音频解码,从而获得音频解码后的音频数据,再将音频解码后的音频数据存储至预设存储空间。则在第二音频播放设备播放的时候,可以直接从预设存储空间内获取到音频解码后的音频数据而直接播放,减少音频解码过程带来的延时。Specifically, the specific embodiment of sending the audio data to the second wireless audio playback device and instructing the second wireless audio playback device to store the acquired audio data is: sending the audio data to the second wireless audio playback device. The second wireless audio playback device instructs the second wireless audio playback device to perform audio decoding on the acquired audio data, and store the decoded audio data. As an implementation manner, after the second wireless audio playback device obtains the audio data encoded by the transmission protocol and sent by the electronic device, the second wireless audio playback device decodes the audio data to obtain the audio data to be played, and then treats the audio data to be played. Perform audio decoding to obtain audio decoded audio data, and then store the audio decoded audio data into a preset storage space. Then, when the second audio playback device is playing, the decoded audio data can be obtained directly from the preset storage space and played directly, reducing the delay caused by the audio decoding process.
在一些实施例中,电子设备当前已经与第一无线音频播放设备和第二无线音频播放设备同时连接,也就是说,在判定获取到切换指令的时候,电子设备已经与第二无线音频播放设备连接,则可以执行保持所述第一无线音频播放设备继续播放所述音频数据,并将所述音频数据发送至所述第二无线音频播放设备的操作。In some embodiments, the electronic device is currently connected to the first wireless audio playback device and the second wireless audio playback device at the same time, that is, when it is determined that the switching instruction is obtained, the electronic device is already connected to the second wireless audio playback device. When connected, the operations of maintaining the first wireless audio playback device to continue playing the audio data and sending the audio data to the second wireless audio playback device may be performed.
而在另一些实施例中,如果电子设备未与第二无线音频播放设备连接,则需要先建立连接之后,再执行保持所述第一无线音频播放设备继续播放所述音频数据,并将所述音频数据发送至所述第二无线音频播放设备的操作。由于,在建立连接的过程中需要一定的时间点,而音频数据正在被播放,因此,在确保建立连接之后再执行保持所述第一无线音频播放设备继续播放所述音频数据,并将所述音频数据发送至所述第二无线音频播放设备的操作,能够避免建立连接所需要的时间而增加切换所增加的时间延误。In other embodiments, if the electronic device is not connected to the second wireless audio playback device, it is necessary to first establish a connection, and then execute and keep the first wireless audio playback device to continue playing the audio data, and Operation of sending audio data to the second wireless audio playback device. Because a certain point of time is required in the process of establishing a connection, and audio data is being played, after the connection is established, the first wireless audio playback device is maintained to continue playing the audio data, and the The operation of sending audio data to the second wireless audio playback device can avoid the time required to establish the connection and increase the time delay added by the handover.
具体地,保持所述第一无线音频播放设备继续播放所述音频数据,并将所述音频数据发送至所述第二无线音频播放设备,指示所述第二无线音频播放设备将所获取的音频数据存储的具体实施方式为:Specifically, the first wireless audio playback device is kept playing the audio data, and the audio data is sent to the second wireless audio playback device, and the second wireless audio playback device is instructed to send the acquired audio data. The specific implementation of data storage is:
判断所述电子设备与所述第二无线音频播放设备是否已连接,若已连接,则保持所述第一无线音频播放设备继续播放所述音频数据,并将所述音频数据发送至所述第二无线音频播放设备,指示所述第二无线音频播放设备将所获取的音频数据存储;若未连接,则发送连接播放指令至所述第二无线音频播放设备,保持所述第一无线音频播放设备继续播放所述音频数据,并将所述音频数据发送至所述第二无线音频播放设备,指示所述第二无线音频播放设备将所获取的音频数据存储,其中,所述连接播放指令用于指示第二无线音频播放设备与所述电子设备连接。具体地,在未连接时,可以是发送连接播放指令至所述第二无线音频播放设备,指示第二无线音频播放设备与所述电子设备连接;检测是否接收到第二无线音频播放设备返回的成功连接信息,所述成功连接信息用于指示第二无线音频播放设备已经与电子设备成功连接,如果接收到该成功连接信息,则执行保持所述第一无线音频播放设备继续播放所述音频数据,并将所述音频数据发送至所述第二无线音频播放设备,指示所述第二无线音频播放设备将所获取的音频数据存储的操作。Determine whether the electronic device and the second wireless audio playback device are connected, and if connected, keep the first wireless audio playback device to continue playing the audio data, and send the audio data to the first Two wireless audio playback devices, instructing the second wireless audio playback device to store the acquired audio data; if not connected, sending a connection playback instruction to the second wireless audio playback device to maintain the first wireless audio playback The device continues to play the audio data, and sends the audio data to the second wireless audio playback device, instructing the second wireless audio playback device to store the acquired audio data, wherein the connection playback instruction is used for And instructing the second wireless audio playback device to be connected to the electronic device. Specifically, when not connected, it may send a connection play instruction to the second wireless audio playback device, instructing the second wireless audio playback device to connect to the electronic device, and detecting whether a return from the second wireless audio playback device is received. Successful connection information, which is used to indicate that the second wireless audio playback device has successfully connected with the electronic device, and if the successful connection information is received, executing and maintaining the first wireless audio playback device to continue playing the audio data And sending the audio data to the second wireless audio playback device, instructing the second wireless audio playback device to store the acquired audio data.
S303:获取所述音频数据的播放进度。S303: Acquire the playback progress of the audio data.
在将音频数据发送至所述第二无线音频播放设备之后,获取当前电子设备播放音频数据的播放进度。After the audio data is sent to the second wireless audio playback device, a playback progress of the audio data currently played by the electronic device is obtained.
如图6所示,t1为音频数据的当前播放时间点,则获取所述音频数据的当前播放时间点,作为本次所获取的所述音频数据的播放进度。例如,一个音频数据的总播放时间为3:56,则当前的播放时间点为1:03,0至1:03为当前的播放进度。As shown in FIG. 6, t1 is the current playback time point of the audio data, and then the current playback time point of the audio data is obtained as the playback progress of the audio data obtained this time. For example, if the total playback time of an audio data is 3:56, the current playback time point is 1:03, and 0 to 1:03 is the current playback progress.
作为另一种实施方式,获取所述音频数据的播放进度的具体实施方式为:获取所述音频数据的当前播放时间点,将所述当前播放时间点减去预设值之后的时间点作为本次所获取的所述音频数据的播放进度。如图7所示,t1为音频数据的当前播放时间点,t2为音频数据的当前播放时间点t1之前的播放时间点,则t1与t2之间的时间差为Δt,则Δt的时间长度为预设值。其中,预设值为用户根据需求而设定的数值,例如,该数值为4-10秒,具体地,可以是6秒。As another implementation manner, a specific implementation manner of acquiring the playback progress of the audio data is: acquiring the current playback time point of the audio data, and using the current playback time point minus a preset value as the current time point. Playing progress of the acquired audio data. As shown in FIG. 7, t1 is the current playback time point of the audio data, and t2 is the playback time point before the current playback time point of the audio data. Then the time difference between t1 and t2 is Δt, and the time length of Δt is Set value. The preset value is a value set by the user according to requirements. For example, the value is 4-10 seconds, and specifically, it can be 6 seconds.
例如,一段语音为“我是四川人,我爱吃酸辣粉”,当前播放时间点为“人”对应的时间点,而当前播放时间点之前的预设值的播放时间点为“我”对应的时间点,则本次所获取的音频数据的播放进度不是“人”对应的时间点,而是“我”对应的时间点,则虽然,当前已经播放到了“人”,但是在切换到第二音频播放设备的时候,会倒退至“我”开始播放,使得用户能够在使用第二音频播放设备播放该语音的时候,能够回忆之前播放的内容,提高用户体验度。For example, a piece of speech is "I am from Sichuan, I love hot and sour noodles", the current playback time point is the time point corresponding to "Person", and the preset playback time point before the current playback time point is "I" Corresponding time point, the playback progress of the audio data obtained this time is not the time point corresponding to "person", but the time point corresponding to "me". Although the current time has been played to "person", it is switched to When the second audio playback device is used, it will rewind to "I" to start playback, so that when the user plays the voice using the second audio playback device, the user can recall the previously played content and improve the user experience.
S304:发送所述播放进度至所述第二无线音频播放设备,指示所述第二无线音频播放设备根据所述播放进度播放所存储的音频数据。S304: Send the playback progress to the second wireless audio playback device, and instruct the second wireless audio playback device to play the stored audio data according to the playback progress.
第二无线音频播放设备获取到播放进度之后,再定位到该播放进度所对应的时间点,以该时间点为起点继续播放该音频数据。因此,在第二无线音频播放设备被指示播放音频数据之前,音频数据已经被存储在第二无线音频播放设备内的存储空间,避免被指示播放的时候,再从电子设备获取音频数据而延误时间,而造成卡顿的现象。After the second wireless audio playback device obtains the playback progress, it locates a time point corresponding to the playback progress, and continues to play the audio data with the time point as a starting point. Therefore, before the second wireless audio playback device is instructed to play audio data, the audio data has been stored in the storage space in the second wireless audio playback device, to avoid delaying the acquisition of audio data from the electronic device when the playback is instructed to play. , And cause the phenomenon of stuttering.
另外,在电子设备发送所述播放进度至所述第二无线音频播放设备的时候,发出提醒信息,该提醒信息用于指示用户切换音频播放设备,例如,上述的“请切换耳机”语音。此时用户放弃使用第一无线音频播放设备播放音频数据,而使用第二无线音频播放设备,能够无缝切换音频播放。以蓝牙耳机为例,在在电子设备发送所述播放进度至所述第二无线音频播放设备的时候,第一蓝牙耳机发出“请切换耳机”的提醒信息,则用户将第一蓝牙耳机摘下或者关闭,然后,第二蓝牙耳机能够接着第一蓝牙耳机的播放进度继续播放。In addition, when the electronic device sends the playback progress to the second wireless audio playback device, a reminder message is sent, and the reminder information is used to instruct the user to switch the audio playback device, for example, the above-mentioned "Please switch headphones" voice. At this time, the user gives up using the first wireless audio playback device to play audio data, and uses the second wireless audio playback device to seamlessly switch audio playback. Taking a Bluetooth headset as an example, when the electronic device sends the playback progress to the second wireless audio playback device, the first Bluetooth headset sends a reminder message of "Please switch the headset", and the user removes the first Bluetooth headset Or turn off, and then the second Bluetooth headset can continue to play following the playback progress of the first Bluetooth headset.
另外,虽然在S302的操作中,保持第一蓝牙耳机继续播放所述音频数据的时候,用户在第一蓝牙耳机能够听到声音的情况下,很大概率不会将第一蓝牙耳机关闭,但是,为了避免用户在切换的时候就将第一蓝牙耳机摘下,可以在判定获取到切换指令时,在第一无线音频播放设备内播放警示语音,以提醒用户稍后根据提示切换无线音频播放设备。In addition, although in the operation of S302, when the first Bluetooth headset is kept playing the audio data, the user may not turn off the first Bluetooth headset when the first Bluetooth headset can hear sound. In order to prevent the user from taking off the first Bluetooth headset when switching, a warning voice may be played in the first wireless audio playback device when it is determined that a switching instruction is obtained, so as to remind the user to switch the wireless audio playback device later according to the prompt. .
再者,在切换至第二无线隐僻播放设备播放音频数据之后,还可以控制控制第一无线音频播放设备不再输出与音频数据对应的声音。具体地,控制第一无线音频播放设备不再输出与音频数据对应的声音的具体实施方式可以是:Furthermore, after switching to the second wireless remote playback device to play audio data, the first wireless audio playback device may also be controlled to no longer output a sound corresponding to the audio data. Specifically, the specific implementation manner of controlling the first wireless audio playback device to no longer output the sound corresponding to the audio data may be:
作为一种实施方式,可以是将所述第一无线音频播放设备禁音。具体地,电子设备可以发送禁音指令至第一无线音频播放设备,以使第一无线音频播放设备输出的音量最低。当然,也可以是用户点击图4中的禁音按钮,而输入禁音指令,则电子设备将禁音指令发送至第一无线音频播放设备,以使第一无线音频播放设备输出的音量最低,即将第一无线音频播放设备禁音。As an implementation manner, the first wireless audio playback device may be muted. Specifically, the electronic device may send a sound suppression instruction to the first wireless audio playback device, so as to minimize the volume output by the first wireless audio playback device. Of course, it is also possible that the user clicks the mute button in FIG. 4 and enters a mute instruction, and the electronic device sends the mute instruction to the first wireless audio playback device to minimize the volume output by the first wireless audio playback device. The first wireless audio playback device is muted.
作为另一种实施方式,还可以是控制第一无线音频播放设备停止播放音频数据,具体地,发送暂停指令至第一无线音频播放设备,以使第一无线音频播放设备暂停播放音频数据。则可以是,用户在图4所示的界面中,操作第一无线音频设备对应的选择按钮,则将选择按钮切换为未选中的状态,则电子设备在检测到该变化时,发送暂停指令至第一无线音频播放设备。As another implementation manner, the first wireless audio playback device may be controlled to stop playing audio data, and specifically, a pause instruction is sent to the first wireless audio playback device, so that the first wireless audio playback device pauses playing audio data. It may be that, when the user operates the selection button corresponding to the first wireless audio device in the interface shown in FIG. 4, the selection button is switched to an unselected state, and the electronic device sends a pause instruction to the change when it detects the change. A first wireless audio playback device.
作为又一种实施方式,还可以是将所述第一无线音频播放设备关闭。具体地,电子设备发送关闭指令至第一无线音频播放设备,以使第一无线音频播放设备关闭。As another implementation manner, the first wireless audio playback device may also be turned off. Specifically, the electronic device sends a shutdown instruction to the first wireless audio playback device, so that the first wireless audio playback device is turned off.
示例性的,如果第一无线音频播放设备和第二无线音频播放设备均为蓝牙音箱,则在用户输入切换指令的时候,第一无线音频播放设备继续播放音频数据,则用户能够继续收听到音频数据,同时,电子设备将音频数据发送至第二无线音频播放设备保存,然后,获取第一无线音频播放设备播放音频数据的播放进度,再控制第二无线音频播放设备根据该播放进度继续播放音频数据,则能够使用户不间断且连续的在收听音频数据。Exemplarily, if the first wireless audio playback device and the second wireless audio playback device are both Bluetooth speakers, when the user inputs a switching instruction, the first wireless audio playback device continues to play audio data, and the user can continue to listen to the audio At the same time, the electronic device sends the audio data to the second wireless audio playback device for storage, and then obtains the playback progress of the audio data played by the first wireless audio playback device, and then controls the second wireless audio playback device to continue playing audio according to the playback progress. Data, it enables users to listen to audio data uninterruptedly and continuously.
再示例性的,如果第一无线音频播放设备和第二无线音频播放设备均为蓝牙耳机,则在用户输入切换指令的时候,第一无线音频播放设备继续播放音频数据,用户能够继续通过第一无线音频播放设备播放音频数据,则用户不会将第一无线音频播放设备摘下、关闭或禁音,进一步地,可以通过上述警示语音提醒用户不要切换,然后,同时,电子设备将音频数据发送至第二无线音频播放设备保存,然后,获取第一无线音频播放设备播放音频数据的播放进度,再控制第二无线音频播放设备根据该播放进度继续播放 音频数据,然后用户可以将第一无线音频播放设备摘下、关闭或禁音,从而,也能够实现用户不间断且连续的在收听音频数据。As another example, if the first wireless audio playback device and the second wireless audio playback device are both Bluetooth headsets, when the user inputs a switching instruction, the first wireless audio playback device continues to play audio data, and the user can continue to pass the first The wireless audio playback device plays audio data, so the user will not take off, turn off or mute the first wireless audio playback device. Further, the above warning voice may be used to remind the user not to switch, and at the same time, the electronic device sends audio data Save to the second wireless audio playback device, and then obtain the playback progress of the audio data played by the first wireless audio playback device, and then control the second wireless audio playback device to continue playing audio data according to the playback progress, and then the user can save the first wireless audio The playback device is taken off, turned off, or muted, so that the user can also listen to the audio data uninterruptedly and continuously.
另外,将所述第一无线音频播放设备关闭的具体实施方式可以参考图8所示的步骤,具体地,图8示出了本申请另一实施例提供的一种音频播放方法,应用于上述电子设备,具体地,该方法包括:S801至S806。In addition, for a specific implementation manner of turning off the first wireless audio playback device, reference may be made to the steps shown in FIG. 8. Specifically, FIG. 8 illustrates an audio playback method provided by another embodiment of the present application, which is applied to the foregoing. The electronic device, specifically, the method includes: S801 to S806.
S801:当检测到所述电子设备正在通过所述第一无线音频播放设备播放音频数据时,判断是否获取到切换指令。S801: When it is detected that the electronic device is playing audio data through the first wireless audio playback device, determine whether a switching instruction is obtained.
S802:保持所述第一无线音频播放设备继续播放所述音频数据,并将所述音频数据发送至所述第二无线音频播放设备,指示所述第二无线音频播放设备将所获取的音频数据存储。S802: Keep the first wireless audio playback device to continue playing the audio data, and send the audio data to the second wireless audio playback device, and instruct the second wireless audio playback device to send the acquired audio data. storage.
S803:获取所述音频数据的播放进度。S803: Obtain a playback progress of the audio data.
S804:发送所述播放进度至所述第二无线音频播放设备,指示所述第二无线音频播放设备根据所述播放进度播放所存储的音频数据。S804: Send the playback progress to the second wireless audio playback device, and instruct the second wireless audio playback device to play the stored audio data according to the playback progress.
S805:获取所述第一无线音频播放设备与所述电子设备之间的距离值。S805: Acquire a distance value between the first wireless audio playback device and the electronic device.
于本申请实施例中,第一无线音频播放设备与第二无线音频播放设备均为无线耳机,具体地,可以是蓝牙耳机,且是2个支持A2dp/HFP的蓝牙设备。In the embodiment of the present application, the first wireless audio playback device and the second wireless audio playback device are both wireless headphones. Specifically, they may be Bluetooth headphones and two Bluetooth devices supporting A2dp / HFP.
作为一种实施方式,电子设备获取所述电子设备与第一无线音频播放设备之间的无线信号的强度值,根据所述无线信号的强度值确定第一无线音频播放设备与所述电子设备之间的距离值。具体地,电子设备内存储有无线信号的强度值与距离值的对应关系,则在获取到所述电子设备与第一无线音频播放设备之间的无线信号的强度值,在该对应关系内查找电子设备与第一无线音频播放设备之间的无线信号的强度值所对应的距离值,将所查找到的距离值作为第一无线音频播放设备与所述电子设备之间的距离值。As an implementation manner, the electronic device obtains a strength value of a wireless signal between the electronic device and a first wireless audio playback device, and determines a value between the first wireless audio playback device and the electronic device according to the strength value of the wireless signal. The distance value between. Specifically, if the correspondence between the strength value of the wireless signal and the distance value is stored in the electronic device, the strength value of the wireless signal between the electronic device and the first wireless audio playback device is obtained, and the search is performed in the correspondence relationship. The distance value corresponding to the strength value of the wireless signal between the electronic device and the first wireless audio playback device, and the found distance value is used as the distance value between the first wireless audio playback device and the electronic device.
作为另一种实施方式,第二无线音频播放设备和第一无线音频播放设备内均设置有定位装置,通过该定位装置第一无线音频播放设备能够确定自己的位置信息,根据位置信息能够确定第一无线音频播放设备与所述电子设备之间的距离值,例如,检测第一无线音频播放设备的位置信息的变化,能够确定第一无线音频播放设备与所述电子设备之间的距离变化,将所确定的距离变化记为该距离值。As another implementation manner, a positioning device is provided in both the second wireless audio playback device and the first wireless audio playback device. By using the positioning device, the first wireless audio playback device can determine its own position information, and the first A distance value between a wireless audio playback device and the electronic device, for example, detecting a change in position information of the first wireless audio playback device to determine a change in the distance between the first wireless audio playback device and the electronic device, The determined distance change is recorded as the distance value.
作为又一种实施方式,还可以是电子设备发送一个测试信号至第一无线音频播放设备,第一无线音频播放设备在获取到该测试信号之后会返回一个测试结果信号至电子设备,则电子设备获取发送测试信号至接收到测试结果信号之间的时间长度,根据该时间长度确定第一无线音频播放设备与所述电子设备之间的距离值。As another implementation manner, the electronic device may also send a test signal to the first wireless audio playback device. After the first wireless audio playback device obtains the test signal, it returns a test result signal to the electronic device. Obtain a time length between sending a test signal and receiving a test result signal, and determine a distance value between the first wireless audio playback device and the electronic device according to the time length.
S806:若所述距离值大于预设阈值,则将所述第一无线音频播放设备关闭。S806: If the distance value is greater than a preset threshold, turn off the first wireless audio playback device.
其中,预设阈值为用户根据需求而设定的数值,在距离大于该预设阈值的时候,表示电子设备与第一无线音频播放设备的距离已经足够远,则表示用户可能已经放弃使用第一无线音频播放设备播放音频数据。例如,用户在使用电子设备的时候,使用第一无线音频播放设备播放音频数据,然后,切换至第二无线音频播放设备播放音频数据,但是,第一无线音频播放设备未停止播放音频数据,而是被用户丢在一旁,而通常,电子设备用户会随身携带,则第一无线音频播放设备与电子设备之间的距离会变的比较远,则电子设备判定第一无线音频播放设备与所述电子设备之间的距离值大于预设阈值,将第一无线音频播放设备关闭,能够减少第一无线音频播放设备和电子设备的电量无谓消耗。The preset threshold is a value set by the user according to his needs. When the distance is greater than the preset threshold, it indicates that the distance between the electronic device and the first wireless audio playback device is sufficiently far, which indicates that the user may have given up using the first threshold. The wireless audio playback device plays audio data. For example, when a user uses an electronic device, the first wireless audio playback device plays audio data, and then the user switches to the second wireless audio playback device to play audio data. However, the first wireless audio playback device does not stop playing audio data, and Is left behind by the user, and usually, the user of the electronic device will carry it with him, and the distance between the first wireless audio playback device and the electronic device will become longer. The distance between the electronic devices is greater than a preset threshold, and turning off the first wireless audio playback device can reduce the unnecessary consumption of power between the first wireless audio playback device and the electronic device.
另外,还可以检测第一无线音频播放设备是非被佩戴在用户的耳机内,具体地,第一无线音频播放设备包括壳体、第一音频播放模块和压力传感器,第一音频播放模块设置在壳体内部,而压力传感器设置在壳体表面,则在将第一无线音频播放设备戴入耳朵 内的时候,压力传感器会与用户的耳部接触,此时所检测到的压力值较大,则将第一无线音频播放设备从用户的耳朵内摘掉时,所检测到的压力值较小,则通过压力值的变化能够确定第一无线音频播放设备是否还被佩戴在用户的耳朵内。如果未佩戴,则将所述第一无线音频播放设备关闭。In addition, it is also possible to detect whether the first wireless audio playback device is worn in a user's headset. Specifically, the first wireless audio playback device includes a casing, a first audio playback module, and a pressure sensor. The first audio playback module is disposed in the casing. Inside the body, and the pressure sensor is arranged on the surface of the housing, when the first wireless audio playback device is put into the ear, the pressure sensor will contact the user's ear, and the pressure value detected at this time is large, then When the first wireless audio playback device is removed from the user's ear, the detected pressure value is small, and whether the first wireless audio playback device is still worn in the user's ear can be determined through the change in pressure value. If not, turn off the first wireless audio playback device.
具体地,可以是获取所述第一无线音频播放设备与所述电子设备之间的距离值,判断该距离值是否大于预设阈值,若所述距离值大于预设阈值,则检测第一无线音频播放设备是否还被佩戴在用户的耳朵内,如果未佩戴,则将所述第一无线音频播放设备关闭。Specifically, it may be to obtain a distance value between the first wireless audio playback device and the electronic device, determine whether the distance value is greater than a preset threshold, and if the distance value is greater than a preset threshold, detect the first wireless Whether the audio playback device is still worn in the user's ear, and if not, turn off the first wireless audio playback device.
需要说明的是,上述步骤中未详细描述的部分,可参考前述实施例,在此不再赘述。It should be noted that, for the parts that are not described in detail in the foregoing steps, reference may be made to the foregoing embodiments, and details are not described herein again.
其中,为了保证在执行获取所述音频数据的播放进度的时候,第二无线音频播放设备已经成功将音频数据存储,则获取所述音频数据的播放进度的具体实施方式为:检测是否获取到存储成功信息,所述存储成功信息为所述第二无线音频播放设备成功存储音频数据之后发送的指示信息,具体地,该存储成功信息可以是一个文字信息,也可以是语音信息。若获取到存储成功信息,则获取所述音频数据的播放进度。Wherein, in order to ensure that the second wireless audio playback device has successfully stored the audio data when performing the acquisition progress of the audio data, a specific implementation manner of acquiring the playback progress of the audio data is to detect whether the storage is obtained Success information. The storage success information is indication information sent after the second wireless audio playback device successfully stores audio data. Specifically, the storage success information may be a text message or a voice message. If the storage success information is obtained, the playback progress of the audio data is obtained.
作为另一种实施方式,可以是将所述音频数据发送至所述第二无线音频播放设备之后,延时一定的时间,延时结束再获取所述音频数据的播放进度。具体地,请参阅图9,示出了本申请又一实施例提供的一种音频播放方法,应用于上述电子设备,具体地,该方法包括:S901至S905。As another implementation manner, after sending the audio data to the second wireless audio playback device, a delay may be performed for a certain time, and the playback progress of the audio data may be acquired after the delay ends. Specifically, please refer to FIG. 9, which shows an audio playing method provided by another embodiment of the present application, which is applied to the above electronic device. Specifically, the method includes: S901 to S905.
S901:当检测到所述电子设备正在通过所述第一无线音频播放设备播放音频数据时,判断是否获取到切换指令。S901: When it is detected that the electronic device is playing audio data through the first wireless audio playback device, determine whether a switching instruction is obtained.
S902:保持所述第一无线音频播放设备继续播放所述音频数据,并将所述音频数据发送至所述第二无线音频播放设备,指示所述第二无线音频播放设备将所获取的音频数据存储。S902: Keep the first wireless audio playback device to continue playing the audio data, and send the audio data to the second wireless audio playback device, and instruct the second wireless audio playback device to send the acquired audio data. storage.
S903:启动计时。S903: Start timing.
具体地,电子设备启动计时功能,具体地,可以是电子设备内部设置一个计时装置或者计时程序,在执行S902之后,启动该及时装置或者计时程序,从而启动计时。Specifically, the electronic device starts the timing function. Specifically, the electronic device may be provided with a timing device or a timing program. After executing S902, the timing device or the timing program is started to start timing.
作为另一种实施方式,还可以是,电子设备发送计时指令至第二无线音频播放设备,第二无线音频播放设备在接收到计时指令之后,启动内部的计时器进行计时。As another implementation manner, the electronic device may also send a timing instruction to the second wireless audio playback device. After receiving the timing instruction, the second wireless audio playback device starts an internal timer to perform timing.
S904:如果计时长度大于或等于预设时间长度,则获取所述音频数据的播放进度。S904: If the timing length is greater than or equal to a preset time length, obtain a playback progress of the audio data.
则电子设备或者第二无线音频播放设备监测计时长度,并且判断该计时长度是否大于或等于预设时间长度,如果计时长度大于或等于预设时间长度,则获取所述音频数据的播放进度,同时也可以将所述第二无线音频播放设备的播放音量调整为预设音量。其中,预设音量大于禁音音量,可以是电子设备或者第二无线音频播放设备的默认播放音量值。Then, the electronic device or the second wireless audio playback device monitors the timing length and determines whether the timing length is greater than or equal to a preset time length, and if the timing length is greater than or equal to the preset time length, acquiring the playback progress of the audio data, and The playback volume of the second wireless audio playback device may also be adjusted to a preset volume. Wherein, the preset volume is greater than the silence volume, and may be a default playback volume value of the electronic device or the second wireless audio playback device.
需要说明的是,如果S903中是第二无线音频播放设备在接收到计时指令之后,启动内部的计时器进行计时,则在第二无线音频播放设备判断计时长度大于或等于预设时间长度,获取第一无线音频播放设备播放所述音频数据的播放进度,同时也可以将第二无线音频播放设备的音量值调整为预设音量,并反馈计时结果至电子设备,则此时用户能够通过第二无线音频播放设备收听到音频,则用户可以选择摘下第一无线音频播放设备,或者停止第一无线音频播放设备播放音频数据。It should be noted that if the second wireless audio playback device starts the internal timer to perform timing after receiving the timing instruction in S903, the second wireless audio playback device determines that the timing length is greater than or equal to a preset time length, and obtains The first wireless audio playback device plays the playback progress of the audio data. At the same time, the volume value of the second wireless audio playback device can also be adjusted to a preset volume and the timing result is fed back to the electronic device. At this time, the user can pass the second When the wireless audio playback device hears audio, the user may choose to take off the first wireless audio playback device or stop the first wireless audio playback device from playing audio data.
S905:发送所述播放进度至所述第二无线音频播放设备,指示所述第二无线音频播放设备根据所述播放进度播放所存储的音频数据。S905: Send the playback progress to the second wireless audio playback device, and instruct the second wireless audio playback device to play the stored audio data according to the playback progress.
具体地,假设音频数据为一段语音,即“我是四川人,我爱吃酸辣粉,并且我还喜欢吃火锅。”则该音频数据的播放进度条的示意图如图10所示。Specifically, it is assumed that the audio data is a piece of speech, that is, "I am from Sichuan, I love hot and sour noodles, and I also like hot pot." The schematic diagram of the progress bar of the audio data is shown in FIG. 10.
其中,t1为判定获取到切换指令时,音频数据的播放进度对应的第一播放时间点, 假设,t1对应的音频数据的内容是“人”,则电子设备在获取到切换指令的时候,用户通过第一无线音频播放设备已经收听到“我是四川人”这一段语音。Among them, t1 is the first playback time point corresponding to the playback progress of the audio data when it is determined that the switching instruction is obtained. Assume that the content of the audio data corresponding to t1 is "human". When the electronic device obtains the switching instruction, the user The voice of "I am a Sichuanese" has been heard through the first wireless audio playback device.
然后,电子设备将音频数据发送至第二无线音频播放设备,则第二无线音频播放设备对音频数据解码操作之后存储。Then, the electronic device sends the audio data to the second wireless audio playback device, and the second wireless audio playback device stores the audio data after the decoding operation.
然后,启动计时功能,在判定计时长度大于或等于预设时间长度时,其中,预设时间长度为图10中的Δt’,而t1加上Δt’对应的时间点为t3,则在t3的位置处,假设对应的内容是“粉”,也就是说,“我爱吃酸辣粉”这一段话,用户通过第一无线音频播放设备可以收听到,但是,通过第二无线音频播放设备不可以收听到,因为,在这个时间段内第二无线音频播放设备还在接收音频数据而未播放音频数据。Then, start the timing function. When it is determined that the timing length is greater than or equal to a preset time length, wherein the preset time length is Δt ′ in FIG. 10, and the time point corresponding to t1 plus Δt ′ is t3, then at t3 At the position, it is assumed that the corresponding content is "pink", that is, the phrase "I love hot and sour powder" can be heard by the user through the first wireless audio playback device, but not through the second wireless audio playback device. It can be heard because, during this time period, the second wireless audio playback device is still receiving audio data without playing audio data.
然后,在t3的时间点处,电子设备获取第一无线音频播放设备播放的音频数据的播放进度,记为第二播放进度,即t3,然后,将t3发送至第二无线音频播放设备,第二无线音频播放设备在T3的位置处,即t3的位置处为时间点播放音频数据,然后,此时,电子设备控制第一无线音频播放设备暂停播放,则t3之后的“并且我还喜欢吃火锅”的语音,用户可以通过第二无线音频播放设备收听到。Then, at time point t3, the electronic device obtains the playback progress of the audio data played by the first wireless audio playback device, records it as the second playback progress, that is, t3, and then sends t3 to the second wireless audio playback device. The second wireless audio playback device plays audio data at the position of T3, that is, the position of t3, and then, at this time, the electronic device controls the first wireless audio playback device to pause playback, and "after t3" and I also like to eat The "hot pot" voice can be heard by the user through the second wireless audio playback device.
则在t3的时间点,用户不再通过第一无线音频播放设备收听“并且我还喜欢吃火锅”的语音,由此,能够实现在第一无线音频播放设备切换至第二无线音频播放设备时,音频数据的播放能够更加无缝衔接,而避免卡顿或者暂停。Then at time t3, the user no longer listens to the "and I like to eat hot pot" voice through the first wireless audio playback device, so that when the first wireless audio playback device is switched to the second wireless audio playback device, , Audio data playback can be more seamlessly connected, avoiding stuttering or pausing.
需要说明的是,上述步骤中未详细描述的部分,可参考前述实施例,在此不再赘述。It should be noted that, for the parts that are not described in detail in the foregoing steps, reference may be made to the foregoing embodiments, and details are not described herein again.
请参阅图11,其示出了本申请实施例提供的一种音频播放装置1100的结构框图,该装置应用于电子设备,所述电子设备能够同时连接第一无线音频播放设备和第二无线音频播放设备。具体地,音频播放装置1100可以包括:判断单元1101、存储单元1102、获取单元1103和播放单元1104。Please refer to FIG. 11, which shows a structural block diagram of an audio playback apparatus 1100 provided in an embodiment of the present application. The apparatus is applied to an electronic device that can simultaneously connect a first wireless audio playback device and a second wireless audio device. Playback device. Specifically, the audio playback device 1100 may include a determination unit 1101, a storage unit 1102, an acquisition unit 1103, and a playback unit 1104.
判断单元1101,用于当检测到所述电子设备正在通过所述第一无线音频播放设备播放音频数据时,判断是否获取到切换指令。A determining unit 1101 is configured to determine whether a switching instruction is acquired when it is detected that the electronic device is playing audio data through the first wireless audio playback device.
存储单元1102,用于若获取到切换指令,保持所述第一无线音频播放设备继续播放所述音频数据,并将所述音频数据发送至所述第二无线音频播放设备,指示所述第二无线音频播放设备将所获取的音频数据存储。The storage unit 1102 is configured to, if a switching instruction is obtained, keep the first wireless audio playback device to continue playing the audio data, and send the audio data to the second wireless audio playback device to instruct the second wireless audio playback device The wireless audio playback device stores the acquired audio data.
获取单元1103,用于获取所述音频数据的播放进度。The obtaining unit 1103 is configured to obtain a playback progress of the audio data.
播放单元1104,用于发送所述播放进度至所述第二无线音频播放设备,指示所述第二无线音频播放设备根据所述播放进度播放所存储的音频数据。The playback unit 1104 is configured to send the playback progress to the second wireless audio playback device, and instruct the second wireless audio playback device to play the stored audio data according to the playback progress.
还包括关闭单元,用于将所述第一无线音频播放设备关闭。具体地,用于获取所述第一无线音频播放设备与所述电子设备之间的距离值;若所述距离值大于预设阈值,则将所述第一无线音频播放设备关闭。更具体地,若所述距离值大于预设阈值,获取所述第一无线音频播放设备的佩戴状态;如果所述第一无线音频播放设备位于未佩戴状态,则将所述第一无线音频播放设备关闭。It further includes a shutdown unit, configured to turn off the first wireless audio playback device. Specifically, it is configured to obtain a distance value between the first wireless audio playback device and the electronic device; if the distance value is greater than a preset threshold, the first wireless audio playback device is turned off. More specifically, if the distance value is greater than a preset threshold, the wearing state of the first wireless audio playback device is acquired; if the first wireless audio playback device is in an unworn state, the first wireless audio playback device is played The device is off.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述装置和模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working processes of the devices and modules described above may refer to the corresponding processes in the foregoing method embodiments, and are not repeated here.
在本申请所提供的几个实施例中,模块相互之间的耦合可以是电性,机械或其它形式的耦合。In the several embodiments provided in this application, the coupling between the modules may be electrical, mechanical, or other forms of coupling.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist separately physically, or two or more modules may be integrated into one module. The above integrated modules may be implemented in the form of hardware or software functional modules.
请参考图12,其示出了本申请实施例提供的一种电子设备的结构框图。该电子设备100可以是智能手机、平板电脑、电子书等能够运行应用程序的电子设备。本申请中的 电子设备100可以包括一个或多个如下部件:处理器110、存储器120、蓝牙模块140以及一个或多个应用程序,其中一个或多个应用程序可以被存储在存储器120中并被配置为由一个或多个处理器110执行,一个或多个程序配置用于执行如前述方法实施例所描述的方法。Please refer to FIG. 12, which shows a structural block diagram of an electronic device according to an embodiment of the present application. The electronic device 100 may be an electronic device capable of running an application program, such as a smart phone, a tablet computer, or an e-book. The electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, a Bluetooth module 140, and one or more application programs. One or more of the application programs may be stored in the memory 120 and stored in the memory 120. It is configured to be executed by one or more processors 110, and one or more programs are configured to execute the method as described in the foregoing method embodiment.
处理器110可以包括一个或者多个处理核。处理器110利用各种接口和线路连接整个电子设备100内的各个部分,通过运行或执行存储在存储器120内的指令、程序、代码集或指令集,以及调用存储在存储器120内的数据,执行电子设备100的各种功能和处理数据。可选地,处理器110可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器110可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器110中,单独通过一块通信芯片进行实现。具体地,处理器110能够同时连接第一无线音频播放设备和第二无线音频播放设备,能够将电子设备待播放的音频数据发送至第一无线音频播放设备和第二无线音频播放设备播放,也能够发送一些指令至第一无线音频播放设备和第二无线音频播放设备播放,也可以从第一无线音频播放设备和第二无线音频播放设备播放接收一些数据和指令。The processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts in the entire electronic device 100, and executes or executes instructions, programs, code sets, or instruction sets stored in the memory 120 by calling or executing data stored in the memory 120 to execute Various functions and processing data of the electronic device 100. Optionally, the processor 110 may use at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). To implement a hardware form. The processor 110 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), and a modem. Among them, the CPU mainly handles the operating system, user interface, and application programs; the GPU is responsible for rendering and rendering of the displayed content; the modem is used for wireless communication. It can be understood that the modem may not be integrated into the processor 110, and may be implemented by a single communication chip. Specifically, the processor 110 can connect the first wireless audio playback device and the second wireless audio playback device at the same time, and can send audio data to be played by the electronic device to the first wireless audio playback device and the second wireless audio playback device for playback. It can send some instructions to the first wireless audio playback device and the second wireless audio playback device for playback, and can also receive some data and instructions from the first wireless audio playback device and the second wireless audio playback device for playback.
存储器120可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。存储器120可用于存储指令、程序、代码、代码集或指令集。存储器120可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等。存储数据区还可以存储终端100在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。The memory 120 may include Random Access Memory (RAM), and may also include Read-Only Memory. The memory 120 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 120 may include a storage program area and a storage data area, where the storage program area may store instructions for implementing an operating system and instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , Instructions for implementing the following method embodiments, and the like. The storage data area may also store data (such as phonebook, audio and video data, and chat history data) created by the terminal 100 during use.
蓝牙模块140用于实现电子设备与蓝牙设备之间的蓝牙连接,以及与蓝牙设备之间的数据交互。具体地,可以与蓝牙设备通过蓝牙协议5.0/4.2/4.1/2.1/2.0,也可以通过蓝牙低能耗技术(Bluetooh Low Energy,BLE)、蓝牙增强速率技术(Enhanced Data Rate,EDR)或者蓝牙基本速率(Base Rate,BR)等。则蓝牙模块140可以包括功率放大器、无线收发器、收发切换器、低噪声放大器以及天线等。发送信号时,收发器本身会直接输出小功率的微弱的射频信号,送至功率放大器(Power Amplifier,PA)进行功率放大,然后通过收发切换器(Transmit/Receive Switch)经由天线(Antenna)辐射至空间。接收信号时,天线会感应到空间中的电磁信号,通过切换器之后送至低噪声放大器(Low Noise Amplifier,LNA)进行放大,这样,放大后的信号就可以直接送给收发器进行处理,进行解调,该蓝牙模块140可以使用2.4GHz频段。The Bluetooth module 140 is configured to implement a Bluetooth connection between the electronic device and the Bluetooth device, and data interaction with the Bluetooth device. Specifically, it can communicate with Bluetooth devices through the Bluetooth protocol 5.0 / 4.2 / 4.1 / 2.1 / 2.0, or through Bluetooth Low Energy (BLE), Enhanced Data Rate (EDR), or Bluetooth basic rate. (Base, Rate, BR) and so on. The Bluetooth module 140 may include a power amplifier, a wireless transceiver, a transceiver switch, a low-noise amplifier, and an antenna. When transmitting a signal, the transceiver itself will output a weak RF signal of low power directly, send it to a Power Amplifier (PA) for power amplification, and then radiate it to the antenna via Antenna through the Transmit / Receive Switch. space. When receiving a signal, the antenna will sense the electromagnetic signal in the space, and then send it to a Low Noise Amplifier (LNA) for amplification after switching, so that the amplified signal can be sent directly to the transceiver for processing. For demodulation, the Bluetooth module 140 can use the 2.4 GHz frequency band.
请参考图13,其示出了本申请实施例提供的一种计算机可读取存储介质的结构框图。该计算机可读取存储介质1300中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。Please refer to FIG. 13, which shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application. The computer-readable storage medium 1300 stores program code, and the program code can be called by a processor to execute the method described in the foregoing method embodiment.
计算机可读取存储介质1300可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读取存储介质1300包括非易失性计算机可读介质(non-transitory computer-readable storage medium)。计算机可读取存储介质1300具有执行上述方法中的任何方法步骤的程序代码1310的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码1310可以例如以适当形式进行压缩。The computer-readable storage medium 1300 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. Alternatively, the computer-readable storage medium 1300 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 1300 has a storage space of a program code 1310 for performing any of the method steps in the above method. These program codes can be read from or written into one or more computer program products. Program code 1310 may be compressed in a suitable form, for example.
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to describe the technical solution of the present application, rather than limiting it. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still Modifications to the technical solutions described in the foregoing embodiments, or equivalent replacements of some of the technical features thereof; and these modifications or replacements do not drive the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (20)

  1. 一种音频播放方法,其特征在于,应用于电子设备,所述电子设备能够同时连接第一无线音频播放设备和第二无线音频播放设备,所述方法包括:An audio playback method, which is characterized in that it is applied to an electronic device capable of connecting a first wireless audio playback device and a second wireless audio playback device at the same time. The method includes:
    当检测到所述电子设备正在通过所述第一无线音频播放设备播放音频数据时,判断是否获取到切换指令;When detecting that the electronic device is playing audio data through the first wireless audio playback device, determining whether a switching instruction is obtained;
    若获取到切换指令,保持所述第一无线音频播放设备继续播放所述音频数据,并将所述音频数据发送至所述第二无线音频播放设备,指示所述第二无线音频播放设备将所获取的音频数据存储;If a switching instruction is obtained, the first wireless audio playback device keeps playing the audio data, and sends the audio data to the second wireless audio playback device, instructing the second wireless audio playback device to send all audio data. Acquired audio data storage;
    获取所述音频数据的播放进度;Acquiring playback progress of the audio data;
    发送所述播放进度至所述第二无线音频播放设备,指示所述第二无线音频播放设备根据所述播放进度播放所存储的音频数据。Sending the playback progress to the second wireless audio playback device, and instructing the second wireless audio playback device to play the stored audio data according to the playback progress.
  2. 根据权利要求1所述的方法,其特征在于,所述将所述音频数据发送至所述第二无线音频播放设备,指示所述第二无线音频播放设备将所获取的音频数据存储,包括:The method according to claim 1, wherein the sending the audio data to the second wireless audio playback device and instructing the second wireless audio playback device to store the acquired audio data comprises:
    将所述音频数据发送至所述第二无线音频播放设备,指示所述第二无线音频播放设备将所获取的音频数据进行音频解码,将音频解码后的音频数据存储。Sending the audio data to the second wireless audio playback device, instructing the second wireless audio playback device to perform audio decoding on the acquired audio data, and to store the decoded audio data.
  3. 根据权利要求1所述的方法,其特征在于,所述获取所述音频数据的播放进度,包括:The method according to claim 1, wherein the obtaining the playback progress of the audio data comprises:
    检测是否获取到存储成功信息,所述存储成功信息为所述第二无线音频播放设备成功存储音频数据之后发送的指示信息;Detecting whether storage success information is obtained, where the storage success information is indication information sent after the second wireless audio playback device successfully stores audio data;
    若获取到存储成功信息,则获取所述音频数据的播放进度。If the storage success information is obtained, the playback progress of the audio data is obtained.
  4. 根据权利要求1所述的方法,其特征在于,所述获取所述音频数据的播放进度,包括:The method according to claim 1, wherein the obtaining the playback progress of the audio data comprises:
    启动计时;Start timing
    如果计时长度大于或等于预设时间长度,则获取所述音频数据的播放进度。If the timing length is greater than or equal to the preset time length, the playback progress of the audio data is obtained.
  5. 根据权利要求1-4任一所述的方法,其特征在于,在所述发送所述播放进度至所述第二无线音频播放设备,指示所述第二无线音频播放设备根据所述播放进度播放所存储的音频数据之后,还包括:The method according to any one of claims 1-4, wherein, after sending the playback progress to the second wireless audio playback device, instructing the second wireless audio playback device to play according to the playback progress After the stored audio data, it also includes:
    将所述第一无线音频播放设备关闭。Turn off the first wireless audio playback device.
  6. 根据权利要求5所述的方法,其特征在于,所述将所述第一无线音频播放设备关闭,包括:The method according to claim 5, wherein the turning off the first wireless audio playback device comprises:
    获取所述第一无线音频播放设备与所述电子设备之间的距离值;Acquiring a distance value between the first wireless audio playback device and the electronic device;
    若所述距离值大于预设阈值,则将所述第一无线音频播放设备关闭。If the distance value is greater than a preset threshold, the first wireless audio playback device is turned off.
  7. 根据权利要求6所述的方法,其特征在于,所述若所述距离值大于预设阈值,则将所述第一无线音频播放设备关闭,包括:The method according to claim 6, wherein, if the distance value is greater than a preset threshold, turning off the first wireless audio playback device comprises:
    若所述距离值大于预设阈值,获取所述第一无线音频播放设备的佩戴状态;If the distance value is greater than a preset threshold, obtaining a wearing state of the first wireless audio playback device;
    如果所述第一无线音频播放设备位于未佩戴状态,则将所述第一无线音频播放设备关闭。If the first wireless audio playback device is in an unworn state, the first wireless audio playback device is turned off.
  8. 根据权利要求6或7所述的方法,其特征在于,所述获取所述第一无线音频播放设备与所述电子设备之间的距离值,包括:The method according to claim 6 or 7, wherein the obtaining a distance value between the first wireless audio playback device and the electronic device comprises:
    获取所述第一无线音频播放设备与所述电子设备之间的无线信号的强度值;Acquiring a strength value of a wireless signal between the first wireless audio playback device and the electronic device;
    根据存储的无线信号的强度值与距离值的对应关系,获取所述第一无线音频播放设备与所述电子设备之间的无线信号的强度值所对应的距离值,作为本次所获取的所述第一无线音频播放设备与所述电子设备之间的距离值。According to the corresponding relationship between the stored wireless signal strength value and the distance value, the distance value corresponding to the wireless signal strength value between the first wireless audio playback device and the electronic device is obtained as the acquired current value. The distance between the first wireless audio playback device and the electronic device.
  9. 根据权利要求6或7所述的方法,其特征在于,所述获取所述第一无线音频播放设备与所述电子设备之间的距离值,包括:The method according to claim 6 or 7, wherein the obtaining a distance value between the first wireless audio playback device and the electronic device comprises:
    发送测试信号至所述第一无线音频播放设备,指示所述第一无线音频播放设备返回测试结果信号;Sending a test signal to the first wireless audio playback device, instructing the first wireless audio playback device to return a test result signal;
    当接收到所述测试结果信号时,获取发送所述测试信号至接收到所述测试结果信号之间的时间长度;When the test result signal is received, acquiring a length of time between sending the test signal and receiving the test result signal;
    根据所述时间长度确定所述第一无线音频播放设备与所述电子设备之间的距离值。Determining a distance value between the first wireless audio playback device and the electronic device according to the time length.
  10. 根据权利要求1-4任一所述的方法,其特征在于,在所述发送所述播放进度至所述第二无线音频播放设备,指示所述第二无线音频播放设备根据所述播放进度播放所存储的音频数据之后,还包括:The method according to any one of claims 1-4, wherein, after sending the playback progress to the second wireless audio playback device, instructing the second wireless audio playback device to play according to the playback progress After the stored audio data, it also includes:
    发送暂停指令至所述第一无线音频播放设备,指示所述第一无线音频播放设备暂停播放所述音频数据。Sending a pause instruction to the first wireless audio playback device, instructing the first wireless audio playback device to pause playing the audio data.
  11. 根据权利要求10所述的方法,其特征在于,所述发送暂停指令至所述第一无线音频播放设备,指示所述第一无线音频播放设备暂停播放所述音频数据,包括:The method according to claim 10, wherein the sending a pause instruction to the first wireless audio playback device to instruct the first wireless audio playback device to pause playback of the audio data comprises:
    当检测到所述第一无线音频设备对应的选择按钮为未选中状态时,发送暂停指令至所述第一无线音频播放设备,指示所述第一无线音频播放设备暂停播放所述音频数据。When it is detected that the selection button corresponding to the first wireless audio device is not selected, a pause instruction is sent to the first wireless audio playback device to instruct the first wireless audio playback device to pause playing the audio data.
  12. 根据权利要求1-11任一所述的方法,其特征在于,所述将所述音频数据发送至所述第二无线音频播放设备,指示所述第二无线音频播放设备将所获取的音频数据存储,包括:The method according to any one of claims 1-11, wherein the sending the audio data to the second wireless audio playback device instructs the second wireless audio playback device to send the acquired audio data Storage, including:
    将确定获取到切换指令的时间点作为第一播放时间节点;Determining the time point at which the switching instruction is obtained as the first playback time node;
    获取所述音频数据中所述第一播放时间节点之后的音频数据,作为本次待发送的音频数据;Acquiring audio data after the first playback time node in the audio data as the audio data to be sent this time;
    将所述待发送的音频数据发送至所述第二无线音频播放设备,指示所述第二无线音频播放设备将所获取的音频数据存储。Sending the audio data to be sent to the second wireless audio playback device, and instructing the second wireless audio playback device to store the acquired audio data.
  13. 根据权利要求1-12任一所述的方法,其特征在于,所述若获取到切换指令,保持所述第一无线音频播放设备继续播放所述音频数据,并将所述音频数据发送至所述第二无线音频播放设备,指示所述第二无线音频播放设备将所获取的音频数据存储,包括:The method according to any one of claims 1-12, wherein, if a switching instruction is obtained, the first wireless audio playback device is kept to continue playing the audio data, and the audio data is sent to all The second wireless audio playback device instructing the second wireless audio playback device to store the acquired audio data includes:
    若获取到切换指令,则检测所述电子设备是否与所述第二无线音频播放设备连接;If a switching instruction is obtained, detecting whether the electronic device is connected to the second wireless audio playback device;
    若所述电子设备与所述第二无线音频播放设备连接,则保持所述第一无线音频播放设备继续播放所述音频数据,并将所述音频数据发送至所述第二无线音频播放设备,指示所述第二无线音频播放设备将所获取的音频数据存储。If the electronic device is connected to the second wireless audio playback device, keeping the first wireless audio playback device to continue playing the audio data, and sending the audio data to the second wireless audio playback device, Instruct the second wireless audio playback device to store the acquired audio data.
  14. 根据权利要求13所述的方法,其特征在于,所述方法还包括:The method according to claim 13, further comprising:
    若所述电子设备与所述第二无线音频播放设备未连接,则发送连接播放指令至所述第二无线音频播放设备,所述连接播放指令用于指示所述第二无线音频播放设备与所述电子设备连接;If the electronic device is not connected to the second wireless audio playback device, a connection playback instruction is sent to the second wireless audio playback device, and the connection playback instruction is used to instruct the second wireless audio playback device to communicate with the Mentioned electronic equipment connection;
    检测是否接收到所述第二无线音频播放设备返回的成功连接信息,所述成功连接信息用于指示所述第二无线音频播放设备与电子设备成功连接;Detecting whether the successful connection information returned by the second wireless audio playback device is received, and the successful connection information is used to indicate that the second wireless audio playback device is successfully connected to the electronic device;
    若接收到所述成功连接信息,则执行保持所述第一无线音频播放设备继续播放所述音频数据,并将所述音频数据发送至所述第二无线音频播放设备,指示所述第二无线音频播放设备将所获取的音频数据存储的操作。If the successful connection information is received, executing the first wireless audio playback device to continue playing the audio data, and sending the audio data to the second wireless audio playback device, instructing the second wireless audio playback device An operation in which the audio playback device stores the acquired audio data.
  15. 根据权利要求1-14任一所述的方法,其特征在于,所述获取所述音频数据的 播放进度,包括:The method according to any one of claims 1 to 14, wherein the obtaining the playback progress of the audio data comprises:
    获取所述音频数据的当前播放时间点;Obtaining the current playback time point of the audio data;
    将所述当前播放时间点减去预设值之后的时间点作为本次所获取的所述音频数据的播放进度。The time point after the current playback time point is subtracted from the preset value is used as the playback progress of the audio data acquired this time.
  16. 根据权利要求1-15任一所述的方法,其特征在于,所述当检测到所述电子设备正在通过所述第一无线音频播放设备播放音频数据时,判断是否获取到切换指令,包括:The method according to any one of claims 1-15, wherein the determining whether to obtain a switching instruction when detecting that the electronic device is playing audio data through the first wireless audio playback device comprises:
    当检测到所述电子设备正在通过所述第一无线音频播放设备播放音频数据时,检测是否请求使用所述第二无线音频播放设备播放音频数据;When detecting that the electronic device is playing audio data through the first wireless audio playback device, detecting whether it is requested to use the second wireless audio playback device to play audio data;
    若请求使用所述第二无线音频播放设备播放音频数据,则获取到切换指令。If it is requested to use the second wireless audio playback device to play audio data, a switching instruction is obtained.
  17. 根据权利要求16所述的方法,其特征在于,所述检测是否请求使用所述第二无线音频播放设备播放音频数据,包括:The method according to claim 16, wherein the detecting whether to request to use the second wireless audio playback device to play audio data comprises:
    检测是否有对所述第二无线音频播放设备对应的选择按钮的选中操作。Detect whether there is a selection operation on a selection button corresponding to the second wireless audio playback device.
  18. 一种音频播放装置,其特征在于,应用于电子设备,所述电子设备能够同时连接第一无线音频播放设备和第二无线音频播放设备,所述音频播放装置包括:An audio playback device is characterized in that it is applied to an electronic device, and the electronic device can be connected to a first wireless audio playback device and a second wireless audio playback device at the same time. The audio playback device includes:
    判断单元,用于当检测到所述电子设备正在通过所述第一无线音频播放设备播放音频数据时,判断是否获取到切换指令;A judging unit, configured to determine whether a switching instruction is acquired when detecting that the electronic device is playing audio data through the first wireless audio playback device;
    存储单元,用于若获取到切换指令,保持所述第一无线音频播放设备继续播放所述音频数据,并将所述音频数据发送至所述第二无线音频播放设备,指示所述第二无线音频播放设备将所获取的音频数据存储;A storage unit configured to, if a switching instruction is obtained, keep the first wireless audio playback device to continue playing the audio data, and send the audio data to the second wireless audio playback device to instruct the second wireless audio playback device The audio playback device stores the acquired audio data;
    获取单元,用于获取所述音频数据的播放进度;An obtaining unit, configured to obtain a playback progress of the audio data;
    播放单元,用于发送所述播放进度至所述第二无线音频播放设备,指示所述第二无线音频播放设备根据所述播放进度播放所存储的音频数据。The playback unit is configured to send the playback progress to the second wireless audio playback device, and instruct the second wireless audio playback device to play the stored audio data according to the playback progress.
  19. 一种电子设备,其特征在于,包括:An electronic device, comprising:
    一个或多个处理器,所述一个或多个处理器能够同时连接第一无线音频播放设备和第二无线音频播放设备;One or more processors capable of simultaneously connecting the first wireless audio playback device and the second wireless audio playback device;
    存储器;Memory
    一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行如权利要求1-17任一项所述的方法。One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute as The method according to any one of claims 1-17.
  20. 一种计算机可读取存储介质,其特征在于,所述计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行所述权利要求1-17任一项所述方法。A computer-readable storage medium, characterized in that the computer-readable storage medium stores program code, and the program code can be called by a processor to execute the method according to any one of claims 1-17. .
PCT/CN2019/096216 2018-09-30 2019-07-16 Audio playback method and apparatus, electronic device and storage medium WO2020063047A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811161323.3A CN109445739B (en) 2018-09-30 2018-09-30 Audio playing method and device, electronic equipment and computer readable medium
CN201811161323.3 2018-09-30

Publications (1)

Publication Number Publication Date
WO2020063047A1 true WO2020063047A1 (en) 2020-04-02

Family

ID=65544642

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/096216 WO2020063047A1 (en) 2018-09-30 2019-07-16 Audio playback method and apparatus, electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN109445739B (en)
WO (1) WO2020063047A1 (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109445739B (en) * 2018-09-30 2020-05-19 Oppo广东移动通信有限公司 Audio playing method and device, electronic equipment and computer readable medium
CN110347248B (en) * 2019-06-24 2023-01-24 歌尔科技有限公司 Interactive processing method, device, equipment and audio equipment
CN111182456B (en) * 2019-09-12 2020-12-25 广东小天才科技有限公司 Audio playing switching method and system based on intelligent sound box and related equipment
CN110782909A (en) * 2019-10-10 2020-02-11 惠州迪芬尼声学科技股份有限公司 Method for switching audio decoder and intelligent sound box
CN111208969A (en) * 2020-01-03 2020-05-29 海信视像科技股份有限公司 Selection control method of sound output equipment and display equipment
CN111177453B (en) * 2020-01-07 2023-11-14 百度在线网络技术(北京)有限公司 Method, apparatus, device and computer readable storage medium for controlling audio playing
CN112764710A (en) * 2021-01-22 2021-05-07 维沃移动通信有限公司 Audio playing mode switching method and device, electronic equipment and storage medium
CN113079246B (en) * 2021-03-23 2023-02-17 Oppo广东移动通信有限公司 Audio playing method and device, equipment and storage medium
CN113157238A (en) * 2021-04-19 2021-07-23 深圳市艾酷通信软件有限公司 Audio playing method and device, earphone, electronic equipment and storage medium
CN115243236A (en) * 2021-04-23 2022-10-25 华为技术有限公司 Seamless switching method for audio data
CN114430528B (en) * 2021-12-17 2023-08-11 珠海格力电器股份有限公司 Sound data playing method and device, electronic equipment and storage medium
CN115277921B (en) * 2022-06-20 2023-07-07 荣耀终端有限公司 Audio control method, electronic equipment, bluetooth headset and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150189421A1 (en) * 2014-01-02 2015-07-02 Zippy Technology Corp. Headphone wireless expansion device capable of switching among multiple targets and voice control method thereof
CN105679350A (en) * 2016-01-11 2016-06-15 广东欧珀移动通信有限公司 Audio playing method and device
CN106341546A (en) * 2016-09-29 2017-01-18 广东欧珀移动通信有限公司 Audio playing method, device and mobile terminal
CN206147589U (en) * 2016-08-05 2017-05-03 深圳中电长城信息安全系统有限公司 Audio playback equipment and because audio frequency control circuit of desktop optical drive
CN109445739A (en) * 2018-09-30 2019-03-08 Oppo广东移动通信有限公司 Audio frequency playing method, device, electronic equipment and computer-readable medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103780943B (en) * 2014-01-24 2017-04-12 华为技术有限公司 Audio channel switching method, device and system
CN106452512B (en) * 2016-09-30 2019-02-12 Oppo广东移动通信有限公司 A kind of role transforming method and device based on bluetooth connection
CN106649484B (en) * 2016-09-30 2019-08-06 Oppo广东移动通信有限公司 A kind of storage method and device of audio log
CN107707742B (en) * 2017-09-15 2020-01-03 维沃移动通信有限公司 Audio file playing method and mobile terminal
CN107894881A (en) * 2017-10-18 2018-04-10 恒玄科技(上海)有限公司 The method that principal and subordinate link switching, conversation monitoring and the Mike of bluetooth earphone switch

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150189421A1 (en) * 2014-01-02 2015-07-02 Zippy Technology Corp. Headphone wireless expansion device capable of switching among multiple targets and voice control method thereof
CN105679350A (en) * 2016-01-11 2016-06-15 广东欧珀移动通信有限公司 Audio playing method and device
CN206147589U (en) * 2016-08-05 2017-05-03 深圳中电长城信息安全系统有限公司 Audio playback equipment and because audio frequency control circuit of desktop optical drive
CN106341546A (en) * 2016-09-29 2017-01-18 广东欧珀移动通信有限公司 Audio playing method, device and mobile terminal
CN109445739A (en) * 2018-09-30 2019-03-08 Oppo广东移动通信有限公司 Audio frequency playing method, device, electronic equipment and computer-readable medium

Also Published As

Publication number Publication date
CN109445739B (en) 2020-05-19
CN109445739A (en) 2019-03-08

Similar Documents

Publication Publication Date Title
WO2020063047A1 (en) Audio playback method and apparatus, electronic device and storage medium
WO2020063046A1 (en) Audio playback method and device, electronic device and storage medium
CN109379490B (en) Audio playing method and device, electronic equipment and computer readable medium
US6944287B2 (en) Portable terminal
US11032675B2 (en) Electronic accessory incorporating dynamic user-controlled audio muting capabilities, related methods and communications terminal
US10950238B2 (en) Bluetooth speaker base, method and system for controlling thereof
CN109151566B (en) Audio playing method and device, electronic equipment and computer readable medium
WO2013060109A1 (en) Processing method for call of terminal, terminal and processing system
CN109150399A (en) Data transmission method, device, electronic equipment and computer-readable medium
WO2017045453A1 (en) Monitoring method and device based on earphone
CN110189753B (en) Bluetooth sound box and control method, system and storage medium thereof
CN109271131B (en) Earphone control method and device, electronic equipment and storage medium
WO2020063065A1 (en) Audio transmission method and apparatus, electronic device, and storage medium
CN107621933B (en) Audio playing method and device and related medium product
US20220286538A1 (en) Earphone device and communication method
JP6005476B2 (en) Receiver, control program, recording medium
CN109923848B (en) Method and device for controlling volume of device and server
CN114501239A (en) Master-slave switching method and device of earphone, Bluetooth earphone and storage medium
JP4835911B2 (en) Voice input device, method, program, and wireless communication device
WO2015098196A1 (en) Electronic device, sound output control method, and program
JP2008092210A (en) Reproducing device
WO2024012072A1 (en) Intercom method and apparatus for earphones, bluetooth earphones, and storage medium
JP2007104184A (en) Information storage device, and information processing method
WO2024066648A1 (en) Device control method and apparatus, bluetooth earphone, and storage medium
KR100691373B1 (en) A method for outputting the character message of wireless headset

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

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

Country of ref document: EP

Kind code of ref document: A1