Audio playing method, audio playing device, electronic equipment and medium

By enabling online switching of audio devices under a WiFi point-to-point network, the problem of fixed audio source devices in wireless multi-speaker networking is solved, realizing flexible switching and continuity of audio playback and improving the user experience.

CN121056793APending Publication Date: 2025-12-02HENGXUAN TECHNOLOGY (CHENGDU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511218239.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-28
Publication Date
2025-12-02

AI Technical Summary

Technical Problem

In existing technologies, when playing music via wireless multi-speaker networking, the audio source device is fixed, which cannot meet the needs of audio source switching.

Method used

Online switching of audio devices is achieved through WiFi point-to-point network, and the roles between devices can be flexibly adjusted. The host mode and slave mode can be switched to dynamically adjust the roles of providing and receiving audio source data.

Benefits of technology

It enables flexible switching and continuity of audio playback, adapting to different usage scenarios and needs, and improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121056793A_ABST
    Figure CN121056793A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of audio playing, in particular to an audio playing method, an audio playing device, electronic equipment and a medium. The audio playing method applied to a first device comprises the following steps: determining at least one second device establishing networking connection with the first device and a device mode of each device based on first networking information in a WiFi point-to-point network; in response to the fact that the device mode of the first device is a host mode and the device mode of each second device is a slave mode, sending the first sound source data; and in the process of sending the first sound source data, in response to the change of the device mode of the first device to the slave mode and the change of the device mode of the first target device to the host mode, stopping sending the first sound source data, receiving second sound source data sent by the first target device, and performing audio playing. Therefore, each device in the network can flexibly adjust the own role in the process of executing audio playing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of audio playback technology, specifically to audio playback methods, audio playback devices, electronic devices, and computer-readable storage media. Background Technology

[0002] With the development of technology, wireless multi-speaker networking has become widely used. Related technologies utilize peer-to-peer (P2P) networking to combine multiple wireless speakers for audio playback. Since P2P networking does not require a router, one device can act as the group owner (GO) and establish a master-slave relationship with other devices to achieve network connectivity.

[0003] However, when using this method for audio playback, the audio source device is fixed, which cannot meet the need for switching audio sources. Summary of the Invention

[0004] To overcome the problems existing in related technologies, an exemplary embodiment of this disclosure provides an audio playback method applied to a first device. The method includes: determining at least one second device and the device mode of each device to establish a network connection with the first device based on first network information under a WiFi point-to-point network; in response to the first device's device mode being a host mode and each second device's device mode being a slave mode, sending first audio source data to enable multiple second devices to play audio based on the first audio source data; during the sending of the first audio source data, in response to the first network information being updated, re-determining the device mode of each device; in response to the first device's device mode changing to slave mode and the first target device's device mode changing to host mode, stopping the sending of the first audio source data and receiving second audio source data sent by the first target device, wherein the first target device is one of at least one second device; and playing audio based on the second audio source data.

[0005] In some embodiments, the process of determining the first network information includes: determining multiple candidate devices to establish a network connection with the first device based on multiple beacons received in a WiFi point-to-point network; in response to a received device selection instruction, selecting the candidate device as a second device and establishing a network connection with the second device; determining the device mode of the first device and each second device respectively; and determining the first network information based on the device mode of the first device and each second device.

[0006] In some embodiments, in response to a received device selection instruction, the selected candidate device is designated as a second device and networked with the second device, including: in response to the received device selection instruction, sending a network request to the selected candidate device; and in response to the selected candidate device agreeing to network, designating the selected candidate device as a second device to network with the first device.

[0007] In some embodiments, determining first network information based on the device modes of the first device and each of the second devices includes: determining the device functions of the first device and each of the second devices respectively; and determining the first network information in response to the fact that the device functions of the first device and each of the second devices match the functional requirements of the corresponding device mode to be executed.

[0008] In some embodiments, in response to the first device being in host mode and each of the second devices being in slave mode, sending first audio source data to enable multiple second devices to play audio based on the first audio source data includes: in response to the first device being in host mode and each of the second devices being in slave mode, determining the device state of each second device; and in response to each second device being in power-on state, sending the first audio source data via WiFi protocol based on the network connection with each second device to enable multiple second devices to play audio based on the first audio source data.

[0009] In some embodiments, based on the network connection with each second device, first audio source data is sent via WiFi protocol to enable multiple second devices to play audio based on the first audio source data, including: acquiring the first audio source data through a digital audio interface; negotiating playback parameters of the first audio source data based on the network connection with each second device to enable each second device to configure playback parameters; and sending the first audio source data via WiFi protocol to enable multiple second devices to play audio based on the first audio source data and the playback parameters.

[0010] In some embodiments, the method further includes: receiving third audio source data sent by the second target device in response to the first device being in slave mode and the second target device being in master mode, wherein the second target device is one of at least one second device; and playing audio based on the third audio source data.

[0011] In some embodiments, the method further includes: in response to the first network information being updated, re-determining the device mode of each device; in response to the device mode of the first device changing to host mode and the device mode of the target device changing to slave mode, stopping receiving the third audio source data and sending fourth audio source data so that the multiple second devices can play audio based on the fourth audio source data.

[0012] Secondly, this disclosure also provides an audio playback method applied to a third device. The method includes: determining a first device, at least one second device, and the device mode of each device based on second network information under a WiFi point-to-point network; receiving audio source data sent by the first device and playing audio based on the audio source data sent by the first device in response to the first device being in host mode and the at least one second device and the third device being in slave mode; during the process of receiving audio source data sent by the first device, re-determining the device mode of each device in response to the second network information being updated; and receiving audio source data sent by the first target device and playing audio based on the audio source data sent by the first target device in response to the first target device being in slave mode and the device mode of the first target device being in host mode, wherein the first target device is one of the at least one second device.

[0013] Thirdly, this disclosure also provides an audio playback device applied to a first device. The device includes: a first determining module, configured to determine at least one second device and the device mode of each device based on first network information under a WiFi point-to-point network; a first sending module, configured to send first audio source data in response to the first device's device mode being a host mode and each second device's device mode being a slave mode, so that multiple second devices can play audio based on the first audio source data; a second determining module, configured to re-determine the device mode of each device in response to the first network information being updated during the sending of the first audio source data; a first receiving module, configured to stop sending the first audio source data and receive second audio source data sent by the first target device in response to the first device's device mode changing to slave mode and the first target device's device mode changing to host mode, wherein the first target device is one of at least one second device; and a playback module, configured to play audio based on the second audio source data.

[0014] Fourthly, this disclosure also provides an audio playback device applied to a third device. The device includes: a third determining module, configured to determine, based on second network information under a WiFi point-to-point network, a first device establishing a network connection with the third device, at least one second device, and the device mode of each device; a third receiving module, configured to receive audio source data sent by the first device in response to the first device's device mode being a host mode and the at least one second device and the third device both being in slave mode, and to perform audio playback based on the audio source data sent by the first device; a fourth determining module, configured to, in the process of receiving audio source data sent by the first device, re-determine the device mode of each device in response to the second network information being updated; the third receiving module is further configured to receive audio source data sent by the first target device in response to the first device's device mode changing to slave mode and the first target device's device mode changing to host mode, and to perform audio playback based on the audio source data sent by the first target device, wherein the first target device is one of at least one second device.

[0015] Fifthly, this disclosure also provides an electronic device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the audio playback method provided in any of the above aspects.

[0016] Sixthly, this disclosure also provides a computer-readable storage medium storing a program for performing the audio playback method provided in any of the foregoing aspects.

[0017] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure.

[0018] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects: According to the audio playback method provided by this disclosure, online switching of audio devices can be realized based on WiFi point-to-point network, so that each device in the network can flexibly adjust its own role during the audio playback process to adapt to different usage scenarios and needs, which helps to improve the user experience. Attached Figure Description

[0019] This disclosure can be better understood by describing exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, in which:

[0020] Figure 1 This is a schematic diagram of the structure of an audio playback system provided according to an embodiment of the present disclosure;

[0021] Figure 2 This is a flowchart illustrating the audio playback method provided according to an embodiment of the present disclosure;

[0022] Figure 3 This is a flowchart illustrating the method for determining the first network information according to an embodiment of this disclosure;

[0023] Figure 4 This is a flowchart illustrating another audio playback method provided according to an embodiment of this disclosure;

[0024] Figure 5 This is a flowchart illustrating yet another audio playback method provided according to an embodiment of the present disclosure;

[0025] Figure 6 This is a schematic diagram of data transmission direction according to an embodiment of the present disclosure;

[0026] Figure 7 This is a schematic diagram of another data transmission direction provided according to an embodiment of the present disclosure;

[0027] Figure 8 This is a structural block diagram of an audio playback device provided according to an embodiment of the present disclosure;

[0028] Figure 9 This is a structural block diagram of another audio playback device provided according to an embodiment of the present disclosure;

[0029] Figure 10 This is a schematic diagram of the hardware structure of an electronic device provided according to an embodiment of the present disclosure. Detailed Implementation

[0030] The following describes specific embodiments of this disclosure. It should be noted that, in order to provide a concise description, this specification cannot exhaustively describe all features of the actual embodiments. It should be understood that, in the actual implementation of any embodiment, just as in any engineering or design project, various specific decisions are often made to achieve the developer's specific goals and to meet system-related or business-related constraints, and this can change from one embodiment to another. Furthermore, it is understood that although the efforts made in this development process may be complex and lengthy, for those skilled in the art related to the content disclosed in this disclosure, changes in design, manufacturing, or production based on the technical content disclosed in this disclosure are merely conventional technical means and should not be construed as insufficient content of this disclosure.

[0031] Unless otherwise defined, the technical or scientific terms used in this disclosure shall have the ordinary meaning understood by one of ordinary skill in the art to which this disclosure pertains. The terms “first,” “second,” and similar terms used in this disclosure do not indicate any order, quantity, or importance, but are merely used to distinguish different components. The terms “a” or “one,” etc., do not indicate a quantity limitation, but rather indicate the presence of at least one. The terms “comprising,” “including,” etc., mean that the element or object preceding “comprising” or “including” encompasses the elements or objects listed following “comprising” or “including” and their equivalents, and do not exclude other elements or objects. The terms “connected,” “linked,” etc., are not limited to physical or mechanical connections, nor are they limited to direct or indirect connections.

[0032] In related technologies, multiple wireless speakers are combined for audio playback through peer-to-peer (P2P) networking. Since P2P networking does not require a router, one device can act as the master device and establish a master-slave relationship with other devices to achieve network connectivity.

[0033] When playing audio in this network architecture, only the master device can provide the audio source data, and other slave devices connected to the master device act as the audio source data receivers for audio playback. If it is necessary to switch the audio source data provider, the network topology needs to be re-established.

[0034] To address the aforementioned problems, an exemplary embodiment of this disclosure provides an audio playback system. For example... Figure 1 As shown, the audio playback system 100 may include multiple devices 110. A communication connection is established based on a WiFi peer-to-peer network (AdHoc) to enable the multiple devices 110 to quickly form a network. Under the WiFi peer-to-peer network, all devices 110 have equal status, and thus, in this audio playback system 100, each device 110 can act as an audio source data provider, providing audio source data to be played to other devices 110.

[0035] like Figure 2 As shown, the audio playback method applied to the first device may include the following steps:

[0036] Step S210: Based on the first network information under the WiFi point-to-point network, determine at least one second device that establishes a network connection with the first device and the device mode of each device.

[0037] The first network information can be understood as configuration information used to determine whether a device has a network connection with the first device in a WiFi network. Through the first network information, at least one second device that currently has a network connection with the first device in a WiFi peer-to-peer network can be identified. The first or second device can be, but is not limited to, any of the following electronic devices: mobile phone, tablet, speaker, headphones, or other devices that support WiFi peer-to-peer communication. The device types of the first and second devices can be the same or different, depending on the requirements. It should be noted that the terms "first device" and "second device" are used only for ease of description and are unrelated to their corresponding device modes.

[0038] Since the first device and all second devices have audio data transmission and reception capabilities, to ensure the orderly transmission of audio data, the first network information also includes the device mode for each device. This allows each device to clearly identify its role during audio playback, determining whether it is a provider or receiver of audio data, thus guaranteeing smooth playback. The device modes include host mode and slave mode. Host mode involves controlling the WiFi point-to-point network connection and providing audio data to be played to other devices. Slave mode involves receiving audio data and playing the audio.

[0039] By determining at least one second device and the device mode of each device, the transmission path of the audio source data during audio playback can be clearly defined, enabling the audio source data to be played through the required second device.

[0040] In step S220, in response to the first device being in host mode and each second device being in slave mode, first audio source data is sent so that the multiple second devices can play audio based on the first audio source data.

[0041] In response to the fact that the device mode of the first device is master mode and the device mode of each second device is slave mode, it indicates that the first device is a device for providing audio source data and each second device is a device for receiving audio source data for audio playback. Therefore, in order to meet the audio playback requirements, the first device sends the first audio source data to each second device so that each second device can play audio based on the received first audio source data.

[0042] In step S230, during the transmission of the first audio source data, in response to the update of the first network information, the device mode of each device is redefined.

[0043] During the transmission of the first audio source data, in response to the update of the first network information, it indicates that the device mode of each device may change when audio is played through multiple second devices. For example, a device that was originally a master may become a slave, or vice versa. Therefore, based on the updated first network information, the device mode of each device is redefined so that each device can clearly understand its role in the updated network connection relationship (audio source data provider or receiver). This allows for seamless switching of audio playback without interruption due to changes in network configuration, thus helping to ensure the stability of audio stream transmission.

[0044] In step S240, in response to the first device changing its device mode to slave mode and the first target device changing its device mode to master mode, the transmission of the first audio source data is stopped, and the second audio source data transmitted by the first target device is received.

[0045] In response to the first device changing its device mode to slave mode and the first target device changing its device mode to master mode, it indicates that the first device is switched to be a device for receiving audio source data, and the first target device is switched to be a device for receiving audio source data for audio playback. The first target device is one of at least one second device.

[0046] Since the information of the first network group is updated online, in order to ensure the continuity of audio playback, the first device stops sending the first audio source data after it realizes that its own device mode has changed from host mode to slave mode, and receives the second audio source data transmitted from the first target device. This allows the second audio source data to be seamlessly transmitted to the first device, thereby helping to ensure the continuity of audio playback and avoid data interference.

[0047] Step S250: Play audio based on the second audio source data.

[0048] The first device performs audio playback processing on the received second audio source data so that the audio content corresponding to the second audio source data can be played through the first device, making it easier for users to clearly understand the audio content corresponding to the second audio data through the first device, thus meeting the user's needs for audio playback through the first device.

[0049] According to the audio playback method provided in this disclosure, online switching of audio devices can be realized based on WiFi peer-to-peer network, so that each device in the network can flexibly adjust its own role during the audio playback process to adapt to different usage scenarios and needs, thereby improving the user experience.

[0050] The following will explain in detail the process of determining the first group of network information. For example... Figure 3As shown, the determination process may include the following steps:

[0051] Step S310: Based on multiple beacons received in the WiFi peer-to-peer network, determine multiple candidate devices to establish a network connection with the first device.

[0052] To determine the existence of other devices capable of establishing a network connection in a WiFi peer-to-peer network, beacons are broadcast. These beacons are then used to identify multiple candidate devices that can establish a network connection. In a WiFi peer-to-peer network, each device can broadcast a beacon to inform other devices deployed within the same network that it is ready to establish a network connection.

[0053] Therefore, when the first device receives multiple beacons in a WiFi peer-to-peer network, it indicates that the first device can establish a network connection with the sender of each beacon, and thus the sender of each beacon can be regarded as multiple candidate devices to establish a network connection with the first device.

[0054] In step S320, in response to the received device selection instruction, the selected candidate device is designated as the second device and networked with the second device.

[0055] In response to the received device selection command, indicating that the device screening process for establishing a network connection has been completed, the selected candidate device is determined, the selected candidate device is designated as the second device, and a network connection is established with the second device.

[0056] In one example, the device selection command can be manually triggered. For instance, the first device has a display device that can show the user multiple candidate devices to be networked with the first device, allowing the user to select the second device that can be networked with the first device according to their needs. These candidate devices can be displayed as a list on the first device's display device. Upon selection of a candidate device, a device selection command is triggered to instruct the first device to establish a network connection with the selected candidate device, ensuring that the connected network architecture meets the user's requirements.

[0057] In another example, the device selection command can be automatically triggered. For instance, based on pre-defined configuration information, the devices to be connected to establish a network connection with the first device are identified. Multiple candidate devices are matched against the device to be connected. In response to the existence of a candidate device that matches the device to be connected, that candidate device is selected, and the device selection command is triggered to achieve automated networking and improve networking efficiency.

[0058] Step S330: Determine the device mode of the first device and each of the second devices respectively.

[0059] To ensure that each device can clearly define its role during operation, the device modes for the first device and each second device are determined separately.

[0060] Step S340: Determine the first network information based on the device modes of the first device and each of the second devices.

[0061] After determining the first device, at least one second device that establishes a network connection with the first device, and the device model of each device, the first network information is constructed so that the first device can determine the role of each device and the transmission direction of the audio source data during the audio playback process through the first network information, thereby ensuring the continuity and smoothness of audio playback.

[0062] In some embodiments, step S320 may include:

[0063] Step a1: In response to the received device selection instruction, send a network request to the selected candidate device;

[0064] Step a2: In response to the selected candidate device agreeing to network formation, the selected candidate device is designated as the second device for network connection with the first device.

[0065] Specifically, based on the received device selection instruction, the selected candidate devices that need to establish a network connection with the first device can be identified. To inform the selected candidate devices so that they can establish a network connection with the first device, a network request is sent to the selected candidate devices.

[0066] In response to the selected candidate device agreeing to form a network, it indicates that the selected candidate device has received the network request and agrees to establish a network connection. Therefore, the selected candidate device can be used as the second device to form a network connection with the first device, and a communication channel can be established between the first device and the second device.

[0067] In some embodiments, step S340 above may include:

[0068] Step b1: Determine the device functions of the first device and each of the second devices respectively;

[0069] Step b2: In response to the fact that the device functions of the first device and each of the second devices match the functional requirements of the corresponding device mode to be executed, the first network information is determined.

[0070] Specifically, due to the diversity of device types capable of establishing network connections in a WiFi point-to-point network, and the fact that some devices only possess audio playback or audio data transmission capabilities, the device functions of the first device and each second device are determined separately to ensure the rational allocation of device modes and the smooth operation of audio playback. For example, if the first device is required to provide audio source data, it means that the first device needs to have the device function of acquiring and forwarding audio source data. If the second device is required to receive audio source data, it means that the second device needs to have the device function of receiving audio source data and playing audio.

[0071] Therefore, when it is determined that the device functions of the first device and each of the second devices match the functional requirements of the corresponding device mode to be executed, the network structure can be considered valid. Then, based on the determined first device, second device and device mode of each device, the first network information is determined.

[0072] If the functionality of a device does not match the functional requirements of the corresponding device mode to be executed, the network result can be changed by replacing the device or switching the device mode, so that all devices after networking can meet the functional requirements of the corresponding device mode to be executed, thus ensuring the reliability of the network connection.

[0073] In some embodiments, step S220 above may include the following steps:

[0074] Step c1: In response to the first device being in master mode and each second device being in slave mode, determine the device state of each second device.

[0075] The fact that the first device is in master mode and each of the second devices is in slave mode indicates that the first device can manage the device status of each of the second devices. Since all the second devices need to be online during audio playback, the device status of each second device is determined separately to ascertain whether the first audio source data can be received by each of the second devices.

[0076] Step c2: In response to the fact that the device status of each second device is power-on, based on the network connection with each second device, the first audio source data is sent via WiFi protocol so that multiple second devices can play audio based on the first audio source data.

[0077] If each of the second devices is in a powered-on state, it indicates that the first device and each of the second devices can communicate normally. Therefore, based on the network connection between the first device and each of the second devices, the first device sends the first audio source data to each of the second devices via the WiFi protocol, so that each of the second devices can play audio based on the received first audio source data.

[0078] In some embodiments, step c2 above may include the following steps:

[0079] Step c21: Obtain the first sound source data through the digital audio interface;

[0080] Step c22: Based on the network connection with each second device, negotiate the playback parameters of the first audio source data so that each second device can configure the playback parameters;

[0081] Step c23: Send the first audio source data via WiFi protocol so that multiple second devices can play audio based on the first audio source data and playback parameters.

[0082] Specifically, the first device can be the first audio source data obtained from the host computer via a digital audio interface to ensure the transmission quality of the first audio source data. The digital audio interface can include, but is not limited to, USB, S / PDIF, or a network interface. The acquisition method can include, but is not limited to, time-division multiplexing (TDM) technology or integrated circuit built-in audio bus (I2S).

[0083] To ensure that each second device can be correctly configured and play audio, the first device negotiates playback parameters with each second device to guarantee playback quality. These playback parameters may include, but are not limited to, volume, playback mode (such as sequential, random, or repeat playback), and audio format.

[0084] After each second device has its playback parameters configured, the first audio source data is sent via WiFi protocol, so that each second device can process the received first audio source data according to its own configured playback parameters to meet the audio playback requirements.

[0085] By negotiating playback parameters through a network connection and transmitting the first audio source data to multiple second devices via a wireless network, smooth playback of audio content and collaborative operation of devices can be ensured.

[0086] In some embodiments, such as Figure 4 As shown, the audio playback method may also include the following steps:

[0087] Step S260: In response to the first device being in slave mode and the second target device being in master mode, the third audio source data sent by the second target device is received.

[0088] In response to the first device being in slave mode and the second target device being in master mode, indicating that the first device is for receiving audio source data and the second target device is for providing audio source data for audio playback, the third audio source data is received from the second target device to satisfy the functional requirements corresponding to the slave mode. The second target device is one of at least one second device.

[0089] Step S270: Play audio based on the third audio source data.

[0090] According to the audio playback method provided in this disclosure, the first device can operate in a targeted manner according to its corresponding device mode to meet the functional requirements of the corresponding device mode, so as to adapt to different usage scenarios and needs, thereby improving the user experience.

[0091] In other embodiments, such as Figure 4 As shown, the audio playback method may also include the following steps:

[0092] In step S280, in response to the update of the first network information, the device mode of each device is redefined.

[0093] In step S290, in response to the first device changing its device mode to host mode and the second target device changing its device mode to slave mode, the receiving of the third audio source data is stopped, and the fourth audio source data is sent, so that the multiple second devices can play audio based on the fourth audio source data.

[0094] In response to the first device changing its device mode to host mode and the second target device changing its device mode to slave mode, it indicates that the first device is switched to be a device for providing audio source data and the second target device is switched to be a device for receiving audio source data for audio playback.

[0095] Since the information of the first network group is updated online, in order to ensure the continuity of audio playback, the first device stops receiving the third audio source data after it realizes that its own device mode has changed from slave mode to master mode, and sends the fourth audio source data to each of the second devices. This allows the fourth audio source data to be seamlessly transmitted to each of the second devices, thereby helping to ensure the continuity of audio playback and avoid data interference.

[0096] According to the audio playback method provided in this disclosure, online switching of audio devices can be realized based on WiFi peer-to-peer network, so that each device in the network can flexibly adjust its own role during the audio playback process to adapt to different usage scenarios and needs, thereby improving the user experience.

[0097] Based on the same inventive concept, this disclosure also provides an audio playback method applied to a third device.

[0098] like Figure 5 As shown, the audio playback method may include the following steps:

[0099] Step S410: Based on the second network information under the WiFi point-to-point network, determine the first device that establishes a network connection with the third device, at least one second device, and the device mode of each device. The third device is a device capable of establishing a network connection with the first device and each of the second devices.

[0100] In step S420, in response to the first device being in host mode and at least one second device and the third device being in slave mode, the system receives audio source data sent by the first device and plays audio based on the audio source data sent by the first device.

[0101] The fact that the device mode of the first device is master mode and the device modes of at least one second device and the third device are both slave mode indicates that in this network structure, the first device is the provider of audio source data, and the second and third devices are both receivers of audio source data. Therefore, during audio playback, the third device can play audio based on the audio source data sent by the first device.

[0102] In step S430, during the process of receiving audio source data sent by the first device, in response to the update of the second network information, the device mode of each device is redefined.

[0103] In step S440, in response to the device mode of the first device changing to slave mode and the device mode of the first target device changing to master mode, the device receives the audio source data sent by the first target device and plays audio based on the audio source data sent by the first target device.

[0104] In response to the first device changing its device mode to slave mode and the first target device changing its device mode to master mode, the device corresponding to the master mode in this network structure has switched from the first device to the first target device. This results in a change in the provider of the audio source data. During audio playback, the device sending audio source data to the third device changes from the first device to the first target device. The first target device is one of at least one second device.

[0105] The third device can play audio based on the audio source data sent by the first target device, thus achieving seamless switching of audio playback. The third device can be considered a device that always operates in slave mode within the network architecture. For example, if a device only has playback functionality and cannot acquire audio data, then that device can only function as a slave device in the network architecture.

[0106] According to the audio playback method provided in this disclosure, the third device can determine the provider of the audio source data based on the changes in the second network information, and play audio based on the received audio data, so that the playback content can be flexibly switched to meet user needs.

[0107] In some optional application scenarios, the process of implementing online audio switching playback according to the audio playback method provided by the present invention can be as follows:

[0108] The first device can determine the multiple second devices connected to it in the WiFi point-to-point network and the device modes of each device based on the built-in first network information. In response to the first device being in host mode and each second device being in slave mode, the relationship of audio transmission between the first device and the multiple second devices during audio playback can be determined as follows: Figure 6 As shown, the first device sends first audio source data to multiple second devices, and each second device plays audio based on the received first audio source data.

[0109] During the transmission of the first audio source data, if the first network information is updated, the device mode of each device is redefined. In response to the first device's device mode changing to slave mode and the first target device's device mode changing to master mode, this indicates a change in the audio transmission relationship between the first device and multiple second devices. The first target device then sends the second audio source data to the first device and the other second devices respectively. The audio transmission relationship can be as follows: Figure 7 As shown, the first device and other second devices play audio based on the received second audio source data. Specifically, for the first device, after switching from host mode to slave mode, it immediately stops sending the first audio source data to avoid data interference and ensure the effectiveness and accuracy of audio reception.

[0110] Based on the same inventive concept, this disclosure also provides an audio playback device applied to the first device.

[0111] like Figure 8 As shown, the audio playback device 500 may include:

[0112] The first determining module 510 is used to determine, based on the first networking information under the WiFi point-to-point network, at least one second device that establishes a networking connection with the first device and the device mode of each device.

[0113] The first sending module 520 is used to send first audio source data in response to the first device being in host mode and each second device being in slave mode, so that multiple second devices can play audio based on the first audio source data;

[0114] The second determining module 530 is used to redetermine the device mode of each device in response to the update of the first network information during the transmission of the first audio source data.

[0115] The first receiving module 540 is configured to stop sending the first audio source data and receive the second audio source data sent by the first target device in response to the device mode of the first device changing to slave mode and the device mode of the first target device changing to master mode, wherein the first target device is one of at least one second device;

[0116] The playback module 550 is used for audio playback based on the second audio source data.

[0117] In some embodiments, the module for determining the first network information may include: a first determining unit, configured to determine multiple candidate devices to establish a network connection with the first device based on multiple beacons received in a WiFi point-to-point network; a first processing unit, configured to, in response to a received device selection instruction, designate the selected candidate device as a second device and establish a network connection with the second device; a second determining unit, configured to determine the device mode of the first device and each of the second devices respectively; and a third determining unit, configured to determine the first network information based on the device mode of the first device and each of the second devices.

[0118] In some embodiments, the first processing unit may include: a first execution unit, configured to send a networking request to a selected candidate device in response to a received device selection instruction; and a second execution unit, configured to, in response to the selected candidate device agreeing to network, designate the selected candidate device as a second device for networking with the first device.

[0119] In some embodiments, the third determining unit may include: a third execution unit, configured to determine the device function of the first device and the device function of each second device respectively; and a fourth execution unit, configured to determine the first network information in response to the fact that the device function of the first device and the device function of each second device match the functional requirements of the corresponding device mode to be executed.

[0120] In some embodiments, the first sending module 520 may include: a fourth determining unit, configured to determine the device state of each second device in response to the device mode of the first device being master mode and the device mode of each second device being slave mode; and a first sending unit, configured to send first audio source data via WiFi protocol based on the network connection between the first and second devices in response to the device state of each second device being power-on, so that the multiple second devices can play audio based on the first audio source data.

[0121] In some embodiments, the first sending unit may include: an acquisition unit, configured to acquire first audio source data through a digital audio interface; a negotiation unit, configured to negotiate playback parameters of the first audio source data based on the network connection with each second device, so that each second device can configure playback parameters; and a transmission unit, configured to send the first audio source data through a WiFi protocol, so that multiple second devices can play audio based on the first audio source data and the playback parameters.

[0122] In some embodiments, the audio playback device 500 may further include: a second receiving module, configured to receive third audio source data sent by the second target device in response to the device mode of the first device being slave mode and the device mode of the second target device being master mode, wherein the second target device is one of at least one second device; and a playback module, configured to perform audio playback based on the third audio source data.

[0123] In some embodiments, the audio playback device 500 may further include: an update module, configured to re-determine the device mode of each device in response to the first network information being updated; and a second transmission module, configured to stop receiving third audio source data and transmit fourth audio source data in response to the device mode of the first device changing to host mode and the device mode of the second target device changing to slave mode, so that the multiple second devices can perform audio playback based on the fourth audio source data.

[0124] Regarding the audio playback device in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0125] Based on the same inventive concept, this disclosure also provides an audio playback device for use in a third device.

[0126] like Figure 9 As shown, the audio playback device 600 may include:

[0127] The third determining module 610 is used to determine, based on the second networking information under the WiFi point-to-point network, the first device that establishes a networking connection with the third device, at least one second device, and the device mode of each device.

[0128] The third receiving module 620 is used to receive audio source data sent by the first device in response to the first device being in host mode and at least one second device and the third device being in slave mode, and to play audio based on the audio source data sent by the first device.

[0129] The fourth determining module 630 is used to redetermine the device mode of each device in response to the update of the second network information during the process of receiving the audio source data sent by the first device.

[0130] The third receiving module 630 is further configured to receive audio source data sent by the first target device in response to the device mode of the first device changing to slave mode and the device mode of the first target device changing to master mode, and to play audio based on the audio source data sent by the first target device, wherein the first target device is one of at least one second device.

[0131] Regarding the audio playback device in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0132] Based on the same inventive concept, such as Figure 10 As shown, one embodiment of this disclosure provides an electronic device 700. The electronic device includes one or more processors 710, a memory 720, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components are interconnected via different buses and can be mounted on a common motherboard or otherwise as required. The processors can process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In some alternative embodiments, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple electronic devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 10 Take the 710 processor as an example.

[0133] The processor 710 may be a central processing unit, a network processor, or a combination thereof. The processor 710 may further include a hardware chip. This hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.

[0134] The memory 720 stores instructions executable by at least one processor 710 to cause the at least one processor 710 to perform the audio playback method shown in the above embodiments.

[0135] The memory 720 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the electronic device. Furthermore, the memory 720 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 720 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0136] The memory 720 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 720 may also include a combination of the above types of memory.

[0137] The electronic device also includes an input device 730 and an output device 740. The processor 710, memory 720, input device 730, and output device 740 can be connected via a bus or other means. Figure 10 Taking the example of a connection between China and Israel via a bus.

[0138] Input device 730 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the electronic device, such as a touch screen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 740 may include display devices, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibration motors). The aforementioned display devices include, but are not limited to, liquid crystal displays, light-emitting diodes, displays, and plasma displays. In some alternative embodiments, the display device may be a touch screen.

[0139] Based on the same inventive concept, this disclosure also provides a computer-readable storage medium storing a program for performing the audio playback method of any of the foregoing embodiments.

[0140] This disclosure uses specific terms to describe embodiments of the present disclosure. Terms such as "an embodiment," "one embodiment," and / or "some embodiments" refer to a particular feature, structure, or characteristic associated with at least one embodiment of the present disclosure. Therefore, it should be emphasized and noted that references to "an embodiment," "one embodiment," or "an alternative embodiment" in different locations throughout this specification do not necessarily refer to the same embodiment. Furthermore, certain features, structures, or characteristics in one or more embodiments of the present disclosure can be appropriately combined.

[0141] In the context of this disclosure, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" do not specifically refer to the singular and may also include the plural. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of expressly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.

[0142] Similarly, it should be noted that, in order to simplify the description of this disclosure and thus aid in the understanding of one or more embodiments, the foregoing description of embodiments of this disclosure may sometimes combine multiple features into a single embodiment, drawing, or description thereof. However, this disclosure method does not imply that the subject matter of this disclosure requires more features than the features claimed. In fact, the embodiments contain fewer features than all the features of the single embodiments disclosed above.

[0143] The basic concepts have been described above. It is obvious that the above disclosure is merely illustrative and does not constitute a limitation of this disclosure. Although not explicitly stated herein, various modifications, improvements, and corrections may be made to this disclosure by those skilled in the art. Such modifications, improvements, and corrections are suggested in this disclosure and therefore remain within the spirit and scope of the embodiments of this disclosure.

Claims

1. An audio playback method, applied to a first device, the method comprising: Based on the first network information under the WiFi point-to-point network, at least one second device that establishes a network connection with the first device and the device mode of each device are determined. In response to the first device being in host mode and each of the second devices being in slave mode, first audio source data is sent so that the multiple second devices can play audio based on the first audio source data; During the transmission of the first audio source data, in response to the update of the first network information, the device mode of each device is redefined; In response to the first device changing its device mode to slave mode and the first target device changing its device mode to master mode, the transmission of the first audio source data is stopped, and the second audio source data transmitted by the first target device is received, wherein the first target device is one of the at least one second device; Audio is played based on the second audio source data.

2. The audio playback method according to claim 1, wherein, The process of determining the first network information includes: Based on multiple beacons received in a WiFi peer-to-peer network, multiple candidate devices are identified to establish a network connection with the first device. In response to the received device selection command, the selected candidate device is designated as the second device and networked with the second device; Determine the device mode of the first device and each of the second devices respectively; The first network information is determined based on the device mode of the first device and each of the second devices.

3. The audio playback method according to claim 2, wherein, The step of responding to the received device selection command by designating the selected candidate device as the second device and forming a network connection with the second device includes: In response to the received device selection instruction, a network formation request is sent to the selected candidate device; In response to the selected candidate device agreeing to form a network, the selected candidate device is used as the second device to form a network with the first device.

4. The audio playback method according to claim 2 or 3, wherein, The determination of the first network information based on the device modes of the first device and each of the second devices includes: Determine the device functions of the first device and each of the second devices respectively; In response to the fact that the device functions of the first device and each of the second devices match the functional requirements of the corresponding device mode to be executed, the first network information is determined.

5. The audio playback method according to claim 1, wherein, The step of sending first audio source data in response to the first device being in host mode and each of the second devices being in slave mode, so that the multiple second devices can play audio based on the first audio source data, includes: In response to the first device being in master mode and each of the second devices being in slave mode, the device state of each of the second devices is determined respectively; In response to each of the second devices being in a powered-on state, the first audio source data is sent via WiFi protocol based on the network connection with each of the second devices, so that the multiple second devices can play audio based on the first audio source data.

6. The audio playback method according to claim 5, wherein, The step of sending the first audio source data via WiFi protocol based on the network connection with each of the second devices, so that multiple second devices can play audio based on the first audio source data, includes: The first sound source data is obtained through a digital audio interface; Based on the network connection with each of the second devices, the playback parameters of the first audio source data are negotiated so that each of the second devices can configure the playback parameters. The first audio source data is sent via WiFi protocol so that multiple second devices can play audio based on the first audio source data and the playback parameters.

7. The audio playback method according to claim 1, wherein, The method further includes: In response to the first device being in slave mode and the second target device being in master mode, the third audio source data sent by the second target device is received, wherein the second target device is one of the at least one second device; Audio is played based on the third audio source data.

8. The audio playback method according to claim 7, wherein, The method further includes: In response to the update of the first network information, the device mode of each device is redefined; In response to the first device changing its device mode to host mode and the second target device changing its device mode to slave mode, the receiving of the third audio source data is stopped, and the fourth audio source data is sent, so that the multiple second devices can play audio based on the fourth audio source data.

9. An audio playback method applied to a third device, the method comprising: Based on the second network information under the WiFi point-to-point network, determine the first device that establishes a network connection with the third device, at least one second device, and the device mode of each device. In response to the first device being in host mode and the at least one second device and the third device being in slave mode, the device receives audio source data sent by the first device and plays audio based on the audio source data sent by the first device. During the process of receiving audio source data sent by the first device, in response to the update of the second network information, the device mode of each device is re-determined; In response to the first device changing its device mode to slave mode, the first target device changes its device mode to master mode, receives audio source data sent by the first target device, and plays audio based on the audio source data sent by the first target device, wherein the first target device is one of the at least one second device.

10. An audio playback device, applied to a first device, the device comprising: The first determining module is used to determine, based on the first networking information under the WiFi point-to-point network, at least one second device that establishes a networking connection with the first device and the device mode of each device. The first sending module is configured to send first audio source data in response to the first device being in host mode and each of the second devices being in slave mode, so that the multiple second devices can play audio based on the first audio source data; The second determining module is used to redetermine the device mode of each device in response to the update of the first network information during the transmission of the first audio source data. The first receiving module is configured to stop sending the first audio source data and receive the second audio source data sent by the first target device in response to the device mode of the first device changing to slave mode and the device mode of the first target device changing to master mode, wherein the first target device is one of the at least one second device; The playback module is used to play audio based on the second audio source data.

11. An audio playback device, applied to a third device, the device comprising: The third determining module is used to determine, based on the second networking information under the WiFi point-to-point network, the first device that establishes a networking connection with the third device, at least one second device, and the device mode of each device; The third receiving module is configured to receive audio source data sent by the first device in response to the first device being in host mode and the at least one second device and the third device being in slave mode, and to play audio based on the audio source data sent by the first device. The fourth determining module is used to redetermine the device mode of each device in response to the update of the second network information during the process of receiving the audio source data sent by the first device. The third receiving module is further configured to receive audio source data sent by the first target device in response to the device mode of the first device changing to slave mode and the device mode of the first target device changing to master mode, and to play audio based on the audio source data sent by the first target device, wherein the first target device is one of the at least one second device.

12. An electronic device, comprising: The system includes a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the audio playback method of any one of claims 1-8 or the audio playback method of claim 9.

13. A computer-readable storage medium storing a program for performing the audio playback method of any one of claims 1-8 or the audio playback method of claim 9.