Multi-room audio playing method and system, electronic equipment and storage medium

The transmission of PCM format audio data through C/S architecture and TCP protocol solves the problem of transmission path fixation and synchronization in multi-room audio systems, and achieves a high-quality audio playback experience.

CN120263842AInactive Publication Date: 2025-07-04SHENZHEN ZIDOO TECH CO LTD +1

Patent Information

Application Number
CN202510734322.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-04
Publication Date
2025-07-04
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing multi-room audio system has fixed transmission paths and damaged sound quality in Bluetooth networking. There is a lack of global synchronization mechanism in Wi-Fi multicast and is easily disturbed, resulting in the accumulation of time difference errors between devices and data loss, affecting the continuity and synchronization of audio playback.

Method used

Adopting the C/S architecture, the server module is responsible for audio acquisition and distribution, the client module is responsible for processing and playback, transmits the original audio data in PCM format through the TCP protocol, and attaches a global time stamp to each frame of audio data using a microsecond-level system clock to ensure the integrity and synchronization of the audio data.

Benefits of technology

It avoids the sound quality degradation caused by lossy encoding, realizes seamless transmission and synchronous playback of multi-room audio systems, and provides a high-quality and stable audio experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120263842A_ABST
    Figure CN120263842A_ABST
Patent Text Reader

Abstract

The invention relates to a multi-room audio playing method and system, electronic equipment and a storage medium. The method comprises the following steps: acquiring layout information of a current playing audio space; according to the layout information, audio devices of all rooms in an audio playing space are combined into an initial playing framework; acquiring a connection relationship of each audio device in the initial playing architecture; and updating the initial playing architecture based on the connection relationship to obtain an audio playing architecture, thereby realizing multi-room audio playing through the audio playing architecture. A C / S framework is adopted, frequency domain information loss possibly occurring in the discrete cosine transform and auditory masking effect processing process is avoided, it is ensured that original sound wave harmonic details are completely reserved, a server side adds a globally unique timestamp for each frame of audio data by obtaining a microsecond-level system clock, and therefore the accuracy of audio data processing is improved. And the coded data block is transmitted to the connected client through the TCP protocol, so that the problem that the sound quality is possibly reduced during synchronous playing of a multi-room system is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of data processing, and in particular, to a multi-room audio playback method, system, electronic device, and storage medium. Background Art

[0002] A multi-room audio system is a system that can play audio content synchronously or independently in multiple rooms, and realizes flexible music distribution and control through wireless or wired technologies. The current technical implementations are mainly divided into two methods: Bluetooth networking and Wi-Fi multicast; Bluetooth networking requires pre-defining the master-slave relationship, but it can also achieve distributed interconnection networking through composite devices (acting as both the master device and the slave device). Usually, audio data is compressed using SBC / AAC encoding to support short-distance transmission, while the Wi-Fi multicast solution is based on the UDP protocol and relies on the support of protocol stacks such as IGMP (Internet Group Management Protocol) and PIM (Protocol Independent Multicast). The audio stream is sent to the group using the UDP protocol, and each terminal device in the group decodes and plays independently.

[0003] However, the pre-defined master-slave relationship in the Bluetooth networking solution results in a fixed transmission path, and the device cannot automatically switch across groups, which limits the scalability of networking; the audio is compressed using SBC / AAC encoding, which results in impaired sound quality; and it only supports short-distance transmission, with the transmission distance being limited. Although the Wi-Fi multicast solution allows clients to decode and play independently, it lacks a global synchronization mechanism. Independent decoding by each client will lead to error accumulation, and over time, the time difference error between terminals will increase linearly; in addition, the Wi-Fi multicast defaults to using the UDP protocol, and when the wireless channel is unstable, it is prone to packet loss, duplication, or out-of-order due to interference or signal attenuation, affecting the continuity of real-time services; it relies on the support of protocol stacks such as IGMP (Internet Group Management Protocol) and PIM (Protocol Independent Multicast), and requires routers, switches, and terminal devices to be configured collaboratively, which may cause multicast failures in home networks due to compatibility issues of old devices.

[0004] Therefore, it is urgent to develop a multi-room audio playback method, system, electronic device, and storage medium to solve one or more of the above problems. Summary of the Invention

[0005] In view of this, to solve the above technical problems or some of the technical problems, embodiments of the present invention provide a multi-room audio playback method, system, electronic device, and storage medium.

[0006] In a first aspect, this application provides a multi-room audio playback method, and the method includes: Obtain the layout information of the current audio-playing space, where the layout information includes the location information of each room in the space, the name of each room, and the device information of the audio devices in each room; According to the layout information, combine the audio devices in each room in the audio-playing space into an initial playing architecture; Obtain the connection relationship of each audio device in the initial playing architecture; Update the initial playing architecture based on the connection relationship to obtain an audio-playing architecture, so as to realize multi-room audio playing through the audio-playing architecture.

[0007] In a possible implementation manner, the step of combining the audio devices in each room in the audio-playing space into an initial playing architecture according to the layout information includes: Determine the location information of each room's audio device according to the layout information; Based on the location information, establish a device list of the current audio-playing space in the order of the locations of each room's audio device, where the device list records the location information and device information of each audio device; Select a target audio device from the device list as the server, and set the other audio devices in the target audio device as clients; According to the device information of each client in the device list, establish a communication connection between the server and the clients to obtain an initial playing architecture.

[0008] In a possible implementation manner, the device information includes the device type; The step of establishing a communication connection between the server and the clients according to the device information of each client in the device list includes: Divide the clients into multiple playing device clusters corresponding to multiple audio functions according to the device types of the clients in the device list; For any one of the playing device clusters, establish a communication connection with the server according to the audio function corresponding to the playing device cluster to realize the directional distribution of audio data.

[0009] In a possible implementation manner, the step of selecting a target audio device from the device list as the server includes: Select the audio device at the head of the device list, and determine whether the working state of the audio device is online; If the working state of the audio device is online, use the audio device as the server; If the working state of the audio device is offline, select an audio device in sequence according to the arrangement order of the device list, and re-execute the step of determining whether the working state of the audio device is online to select an online audio device as the server.

[0010] In a possible implementation, before obtaining the connection relationships of the audio devices in the initial playback architecture, the method further includes: Obtaining the communication link connection objects of the clients in the initial playback architecture; For any client, adding a first connection mark in the client when the corresponding communication link connection object is a server, and adding a second connection mark in the client when the corresponding communication link connection object is not a server, so as to obtain the connection relationships of the audio devices in the initial playback architecture based on the connection marks of the clients.

[0011] In a possible implementation, updating the initial playback architecture based on the connection relationships to obtain an audio playback architecture includes: Based on the connection relationships, determining whether the client is connected to other servers; If so, disconnecting the connection relationship between the client and other servers, and establishing the connection relationship between the client and the server to complete the update of the initial playback architecture and obtain an audio playback architecture.

[0012] In a possible implementation, establishing the connection relationship between the client and the server includes: In response to a join request initiated by the client, determining whether the server accepts the join request; When the server accepts the join request, sending a synchronization clock to the client according to the playback device cluster corresponding to the client to establish the connection relationship between the client and the server.

[0013] In a second aspect, the present application provides a multi-room audio playback system, and the system includes: A first acquisition module, configured to acquire the layout information of the current audio playback space, where the layout information includes the position information of each room in the space, the name of each room, and the device information of the audio devices in each room; A combination module, configured to combine the audio devices in each room in the audio playback space into an initial playback architecture according to the layout information; A second acquisition module, configured to acquire the connection relationships of the audio devices in the initial playback architecture; An update module, configured to update the initial playback architecture based on the connection relationships to obtain an audio playback architecture, so as to implement multi-room audio playback through the audio playback architecture.

[0014] In a third aspect, the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the steps of the multi-room audio playback method according to any one of the embodiments of the first aspect are implemented.

[0015] In a fourth aspect, the present application further provides a computer storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the multi-room audio playback method according to any one of the embodiments of the first aspect are implemented.

[0016] The above technical solutions provided by the embodiments of the present application have the following advantages compared with the prior art: The method provided by the embodiments of the present application adopts a C / S architecture, which consists of a server module and a client module. Among them, the server module is mainly responsible for audio acquisition and distribution, while the client module focuses on audio processing and playback. The server can directly transmit the original audio data in PCM format to ensure that the sound quality is not affected, thus skipping the compression steps of lossy coding such as SBC and AAC, avoiding the loss of frequency domain information that may occur during the discrete cosine transform and auditory masking effect processing, and ensuring the complete retention of the harmonic details of the original sound wave. In addition, the problem of sound quality degradation that may occur during synchronous playback in a multi-room system is also avoided. The server obtains a microsecond-level system clock, attaches a globally unique timestamp to each frame of audio data, and transmits the encoded data block to the connected client through the TCP protocol. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present invention and used together with the specification to explain the principles of the present invention.

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.

[0019] One or more embodiments are exemplarily illustrated by the pictures in the corresponding accompanying drawings. These exemplary illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements, unless otherwise stated, and the drawings in the figures do not constitute a proportional limitation.

[0020] Figure 1 It is a schematic flowchart of a multi-room audio playback method provided by an embodiment of the present application; Figure 2 It is a schematic flowchart of another multi-room audio playback method provided by an embodiment of the present application; Figure 3 A schematic flow chart of another multi-room audio playback method provided by an embodiment of the present application; Figure 4 A schematic diagram of the steps of a multi-room audio playback method provided by an embodiment of the present application; Figure 5 A schematic system diagram of a multi-room audio playback method based on a C / S architecture provided by an embodiment of the present application; Figure 6 A schematic structural diagram of a multi-room audio playback system provided by an embodiment of the present application; Figure 7 A schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions 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. Apparently, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.

[0022] The following disclosure provides many different embodiments or examples for implementing different structures of the present invention. To simplify the disclosure of the present invention, components and settings of specific examples are described below. Of course, they are only examples and are not intended to limit the present invention. In addition, the present invention may repeat reference numerals and / or letters in different examples. This repetition is for the purpose of simplification and clarity and does not in itself indicate the relationship between the various embodiments and / or settings discussed.

[0023] Figure 1 A schematic flow chart of a multi-room audio playback method provided by an embodiment of the present application, as Figure 1 shown, the method specifically includes: S101. Obtain layout information of the currently playing audio space, where the layout information includes position information of each room in the space, names of each room, and device information of audio devices in each room; In this embodiment, to ensure the optimization of the audio playback experience, detailed information about the spatial layout of the currently playing audio is obtained. The layout information not only includes the specific position coordinates of each room in the space to ensure that the audio devices in each room can work in coordination, but also includes the unique identification names of each room to facilitate easy identification and management by the user, as well as the detailed device information of the audio devices distributed in these rooms, such as the type, model, and current status of the devices. This enables maintenance personnel to quickly locate problems and make corresponding adjustments, ensuring the smooth propagation of audio in the space and providing users with an immersive auditory enjoyment.

[0024] S102. Combine the audio devices in each room within the audio-playing space into an initial playback architecture according to the layout information. In this embodiment, after obtaining the layout information, the audio devices in each room within the audio-playing space are carefully combined and configured to construct an efficient and intuitive initial playback architecture, ensuring that each audio device can find its appropriate position in this architecture and achieving seamless connection between audio devices, thereby bringing a coherent and immersive auditory experience to the user.

[0025] It should be noted that in the initial playback architecture, only the audio devices are combined so that they can work together; there may be no connection relationship or an incorrect connection relationship between these audio devices, and further adjustment and optimization are required.

[0026] S103. Obtain the connection relationships of the audio devices in the initial playback architecture. In this embodiment, in the initial playback architecture, first, the connection relationships between the audio devices are obtained, including the physical connections between the audio devices, such as devices directly connected through cables, interfaces, or other hardware means, as well as network connections, to ensure that the audio signals can be correctly transmitted between the devices and ultimately achieve high-quality audio playback effects.

[0027] S104. Update the initial playback architecture based on the connection relationships to obtain an audio playback architecture for realizing multi-room audio playback.

[0028] In this embodiment, after obtaining the connection relationships, the connection relationships of the audio devices are analyzed. If there are unconnected or unreasonably connected devices in the initial playback architecture, corresponding adjustments are made to ensure the smooth transmission of audio signals. In addition, according to the connection relationships between the devices, the initial playback architecture is optimized to make it more in line with the actual playback requirements, thereby obtaining the final audio playback architecture, which can support multi-room audio playback, realize seamless transmission and synchronous playback of audio signals between rooms, and provide users with a better audio playback experience.

[0029] The multi-room audio playback method provided by the embodiments of the present application constructs an initial playback architecture and updates it based on the connection relationships of each audio device, obtaining an audio playback architecture that is efficient and meets the multi-room audio playback requirements. It not only ensures seamless transmission and synchronous playback of audio signals between rooms but also brings a coherent and immersive auditory experience to users through fine device combination and configuration.

[0030] Figure 2 The following is a schematic flowchart of another multi-room audio playback method provided by the embodiments of the present application. Combining the audio devices in each room within the audio playback space into an initial playback architecture includes: S201. Determine the position information of each room's audio device according to the layout information; In this embodiment, after obtaining the layout information of the room, the positions of the audio devices in each room are determined to play audio according to the installation of the audio devices, which can achieve uniform distribution of sound, thereby providing the best auditory experience for users. Each speaker and audio receiver can be carefully selected and positioned according to the specific needs and acoustic characteristics of the room to ensure that the audio playback devices can harmoniously integrate into the entire space while meeting the dual standards of functionality and aesthetics.

[0031] S202. Based on the position information, establish a device list of the current audio playback space in the position order of each room's audio device. The device list records the position information and device information of each audio device; In this embodiment, arrange them in the layout order of the audio devices in each room to obtain the device list of the current audio playback space.

[0032] Specifically, the position order of each room's audio device not only involves the physical position of the device but also includes their relative orientation and distance in space. Through this method, it can be ensured that the position information of each device, including their specific coordinates and directions in the room, is accurately recorded in the audio device list. At the same time, the device information describes the model, functional characteristics, connection status, and any relevant technical parameters of each audio device. Therefore, the device list not only provides a clear device layout diagram for technical personnel but also facilitates users to quickly locate and manage each audio device during use. Through this detailed recording and organization, an efficient, intuitive, and easy-to-operate audio playback environment is improved, allowing users to experience a richer and more immersive auditory enjoyment.

[0033] S203. Select a target audio device from the device list as the server and set the other audio devices in the target audio device as clients; In this embodiment, a specific target audio device is selected from the device list as the server. For example, the current audio playback space contains a list of five audio devices. One high-end audio system is selected from the list as the server, and the remaining four audio devices in this list, such as Bluetooth headsets, ordinary audio systems, TV audio systems, and car audio systems, are set as clients; Furthermore, as the core of the entire audio playback system, the server is mainly responsible for audio acquisition, processing, and distributing audio data to each client. To ensure that audio data can be transmitted to each client with high quality and in real time, the server adopts an efficient audio data processing algorithm, compresses and optimizes the audio data to reduce data transmission latency and bandwidth occupancy. At the same time, the server also has powerful device management and control capabilities, can monitor the status of each client device in real time, and make adjustments and optimizations as needed to ensure the stability and reliability of the entire audio playback system.

[0034] S204. Establish a communication connection between the server and the clients according to the device information of each client in the device list to obtain an initial playback architecture.

[0035] In this embodiment, referring to the device information used by each client recorded in the device list, the server can identify the specific device of each client and establish a stable and reliable communication connection based on this. Once the communication connection is successfully established, the server can effectively exchange data with the clients, thereby ensuring the smooth construction of the initial playback architecture.

[0036] Among them, the initial playback architecture is the basis for the operation of the entire playback system, which determines the data flow transmission path, processing method, and final playback effect. The device information includes but is not limited to key data such as device type, operating system version, and network connection status.

[0037] The multi-room audio playback method provided by the embodiments of this application ensures efficient communication and data transmission between the server and the clients through careful device selection and configuration; taking the server as the center of the system, it is not only responsible for audio data acquisition and processing, but also undertakes the important task of distributing optimized audio data to each client. To ensure that data can be accurately transmitted to each client, the server adopts advanced audio data processing technologies and efficient communication protocols, thereby effectively reducing data transmission latency and bandwidth occupancy. At the same time, the server also has excellent device management and control capabilities, can monitor the status of each client device in real time, and make flexible adjustments according to actual needs to ensure the stability and reliability of the entire audio playback system.

[0038] In an alternative solution of the embodiment of the present invention, the device information includes the device type; Figure 3 This is a schematic flowchart of yet another multi-room audio playback method provided by an embodiment of the present application. As Figure 3 shown, establishing a communication connection between the server and the client according to the device information of each client in the device list includes: S301. Divide the clients into multiple playback device clusters corresponding to multiple audio functions according to the device types of the clients in the device list; In this embodiment, after deeply analyzing the device types of each client presented in the device list, the clients are further carefully divided into multiple playback device clusters, where different playback device clusters respectively correspond to different audio functions; the division of clusters not only helps to better understand the characteristics of each device, but also can ensure the optimized playback of audio content, thereby providing users with a richer and higher-quality auditory experience, ensuring the accurate transmission and processing of audio signals, and enabling each device to exert its maximum efficiency in its proficient audio field.

[0039] S302. For any one of the playback device clusters, establish a communication connection with the server according to the audio function corresponding to the playback device cluster to achieve the directional distribution of audio data.

[0040] In this embodiment, for any one of the playback device clusters, establish a communication connection with the server according to the audio function corresponding to the playback device cluster to achieve the directional distribution of audio data; In this embodiment, for any one of the playback device clusters, establish a communication connection with the server according to the audio function corresponding to the playback device cluster, such as the supported multi-channel format, audio decoding ability, etc.

[0041] Specifically, the communication connection is usually based on specific protocols and technologies to ensure the stable transmission of audio data. Through this connection, the server can achieve the directional distribution of audio data according to the audio function of the playback device cluster. For example, in a playback device cluster containing multiple smart speakers, the server can identify the location, model, and supported audio formats of each speaker, and then distribute specific audio content to the corresponding speakers according to this information, thereby providing an immersive audio experience.

[0042] The multi-room audio playback method provided by the embodiments of the present application realizes the precise distribution of audio data by dividing the playback device clusters and establishing communication connections with the server in a targeted manner. This directional distribution strategy not only ensures that the audio data can be accurately transmitted to the devices with corresponding audio functions, but also avoids unnecessary bandwidth occupation and data transmission delay, thereby improving the efficiency and stability of the entire audio playback system. At the same time, since each playback device cluster is optimized according to its unique audio function, it can provide users with a richer and higher-quality auditory experience.

[0043] In an optional solution of the embodiment of the present invention, the selecting a target audio device from the device list as the server includes: Selecting the audio device at the head of the device list and determining whether the working state of the audio device is online; In this embodiment, during the process of device management, first select the audio device at the forefront of the device list, and then carefully check its working state to determine whether the audio device can normally participate in the next audio transmission task.

[0044] Specifically, when checking the working state, it is necessary to pay attention to whether the device is in an online state. Only online devices can respond to control signals and complete tasks such as audio capture, playback, or transmission. If the device is found to be offline, it will not be able to perform its duties, which may cause the interruption or loss of audio signals, thereby affecting the operation efficiency of the entire system and the user experience.

[0045] When the working state of the audio device is online, use the audio device as the server; In this embodiment, when the working state of the audio device is online, use the audio device as the server; When the working state of the audio device is online, use the audio device as the server. Taking the intelligent speaker as an example of the audio device, when the intelligent speaker is connected to the Internet and in an online state, it can be configured as a server device, and then used to receive instructions from other devices (such as mobile phones, computers, etc.) and perform corresponding operations, such as playing music, reporting the weather, etc. In this way, the intelligent speaker can not only be used as an audio output device, but also as a control center for a smart home, realizing the intelligence and automation of audio playback.

[0046] When the working state of the audio device is offline, select the audio device in sequence according to the arrangement order of the device list, and re-execute the step of determining whether the working state of the audio device is online to select an online audio device as the server.

[0047] In this embodiment, when the audio device is in an offline working state, the system will sequentially select the audio devices according to the arrangement order in the device list, and repeatedly execute the step of checking whether the audio device is in an online state. In this way, the system can select the online audio devices and use them as the server for subsequent operations.

[0048] In the multi-room audio playback method provided by the embodiment of the present application, during the process of selecting the server, by intelligently checking the working state of the devices, it is ensured that only the online and available devices can be selected as the server, which not only improves the operating efficiency of the system, but also enhances the stability and reliability of the system; at the same time, by configuring the online audio devices as the server, the intelligence and automation of audio playback are realized, bringing a more convenient and efficient audio playback experience to users.

[0049] In an alternative solution of the embodiment of the present invention, before obtaining the connection relationships of the audio devices in the initial playback architecture, the method further includes: Obtaining the communication link connection objects of the clients in the initial playback architecture; For any client, adding a first connection mark to the client when the corresponding communication link connection object is the server, and adding a second connection mark to the client when the corresponding communication link connection object is not the server, so as to obtain the connection relationships of the audio devices in the initial playback architecture based on the connection marks of the clients.

[0050] In this embodiment, first, obtain the communication link connection objects of each client in the initial playback architecture; then, for any client, check its corresponding communication link connection object. If the connection object is the server, then add a first connection mark to the client; if the connection object is not the server, then add a second connection mark to the client. In this way, the connection relationships between the audio devices in the initial playback architecture can be determined based on the connection marks of the clients.

[0051] Specifically, the first connection mark and the second connection mark are identifiers used to distinguish the connection relationships between the clients and the server, which can help the system more clearly identify the communication paths of each client, so as to ensure that the audio data can be accurately transmitted to the target device.

[0052] For example, in a complex audio playback system, there may be multiple client devices, and each device may need to communicate with the server to receive audio data. By adding connection tags to the clients, the system can quickly identify which clients are directly connected to the server and which clients are indirectly connected to the server through other clients. This tagging method not only improves the processing efficiency of the system but also enhances the reliability and stability of the system.

[0053] After determining the connection relationships of the audio devices in the initial playback architecture, the system updates the initial playback architecture according to these connection relationships to meet different audio playback requirements. For example, when the audio devices in a certain room change, such as adding a new speaker or removing an old receiver, the system automatically adjusts the playback architecture according to these changes to ensure that the audio signal can still be transmitted seamlessly and played synchronously. Through this dynamic update method, the system can always maintain the best audio playback effect and provide users with a coherent and immersive auditory experience.

[0054] In an optional solution of the embodiment of the present invention, updating the initial playback architecture based on the connection relationship to obtain an audio playback architecture includes: Based on the connection relationship, determine whether the client is connected to other servers; If so, disconnect the connection relationship between the client and other servers, and establish the connection relationship between the client and the server to complete the update of the initial playback architecture and obtain an audio playback architecture.

[0055] In this embodiment, after analyzing the connection relationship between the client and the server, it is also necessary to determine whether the client has been connected to other servers; If the client has indeed established connections with one or more other servers, these existing connection relationships need to be disconnected. Once these connections are disconnected and new connection relationships are established, that is, connecting the client to the specified server, the initial playback architecture can be updated, thereby obtaining an updated audio playback architecture.

[0056] Furthermore, to ensure the stability and reliability of the audio playback architecture, a series of checks and validations will also be performed before executing the update operation. For example, check whether the network connection between the server and the client is stable and whether the compatibility between devices is good. Only when it is confirmed that all conditions are met will the update operation be executed to avoid possible problems such as audio interruption or distortion.

[0057] In addition, the multi-room audio playback system provided by the embodiments of the present application also supports user-defined audio playback scenarios. Users can set different audio playback scenarios according to their preferences and needs, such as family gatherings, movie-watching modes, sports and fitness, etc. Each scenario can be configured with different audio devices and audio parameters to meet the user's auditory needs in different situations. For example, in the family gathering scenario, the user can connect the speakers in the living room and the TV speakers and adjust the volume and sound effect parameters to create a warm and lively atmosphere.

[0058] After realizing the customization of the audio playback scenario, the user only needs to simply select the corresponding scenario mode, and the audio playback architecture and device configuration will be automatically adjusted to adapt to different auditory needs, which not only improves the operation convenience of the user, but also brings a more personalized and immersive audio playback experience to the user.

[0059] The multi-room audio playback method provided by the embodiments of the present application ensures the flexibility and scalability of the audio playback system and can adapt to different usage scenarios and device configurations. For example, in a large residential house, the user may wish to play music or movie audio simultaneously in multiple rooms such as the living room, bedroom, and kitchen. By disconnecting unnecessary connections and establishing the correct connection relationships, it is ensured that the audio devices in each room can receive the correct audio data, thereby achieving a seamless audio playback experience. And through functional features such as an intuitive and easy-to-operate audio playback environment, efficient device selection and configuration, accurate audio data distribution, intelligent device management and control, and user-defined audio playback scenarios, it brings a richer and more immersive auditory enjoyment to the user.

[0060] In an optional solution of the embodiment of the present invention, establishing the connection relationship between the client and the server includes: In response to a join request initiated by the client, determining whether the server accepts the join request; In the case where the server accepts the join request, sending a synchronization clock to the client according to the playback device cluster corresponding to the client to establish the connection relationship between the client and the server.

[0061] In this embodiment, when the client sends a join request, responsive processing is performed to determine whether the server agrees to accept the request; once the server confirms and accepts the client's join request, the next step is to send a synchronization clock signal to the client, and this signal is customized based on the specific parameters of the playback device cluster corresponding to the client, aiming to ensure that a synchronous connection relationship can be established between the client and the server.

[0062] The multi-room audio playback method provided by the embodiments of the present application not only ensures the synchronization of audio data during transmission through the clock signal, but also guarantees that the audio played by different devices can maintain the same rhythm and timing; this is particularly crucial for a multi-room audio playback system, which can avoid delays or misalignments of audio between different rooms, thereby providing users with a smoother and more coherent auditory experience.

[0063] Figure 4 It is a schematic diagram of the steps of a multi-room audio playback method provided by the embodiments of the present application. As Figure 4 shown, it includes the following steps: Step 1: When the system starts, the client reports its own status (device information, playback status) through the RxDNSSD protocol stack to form a client device list.

[0064] Step 2: The user selects a device from the client device list as the host, and this device automatically activates the server module, and the server reports service metadata.

[0065] Step 3: The host client immediately establishes a TCP connection with the host server to form an initial packet.

[0066] Step 4: The user further selects the slave device to be connected from the client list according to their own needs.

[0067] Step 5: Determine whether the slave device selected by the user is currently connected to another host server. If so, execute Step 6; otherwise, execute Step 7.

[0068] Step 6: If there are other packets in the slave client, disconnect the original connection and clear the cache data of the original host.

[0069] Step 7: Send a join request to the new host server; the host server accepts the join request, sends a synchronization clock to the client; the slave client synchronizes the host clock and playback status, joins the packet and starts receiving the audio stream.

[0070] Step 8: If the user clicks on the connected slave device, the connection between the slave client and the host server is disconnected, and the slave returns to the independent mode and resumes the playback status before connection. When the slave device restarts without being disconnected, the slave client reads the persistent storage packet ID and the last timestamp, and automatically reconnects to the host server to achieve seamless recovery.

[0071] Specifically, the control method of the multi-room audio synchronous playback system based on a distributed architecture includes the following steps: Step 1: Initialize the multi-room audio playback system, and obtain the client device list in the current local area network according to the discovery protocol. The list includes device identifiers, device status, device type information, and the current playback status; Step 2: In response to the user's selection operation of the target device in the client device list, the target device is set as the host terminal device, the server service in this device is published, and a corresponding slave device list is generated according to the currently published client service; Step 3: Receive a user's selection instruction for at least one slave device in the slave device list, and establish a communication connection between the slave device and the host terminal device, that is, the slave client connects to the host server. After the connection is successful, synchronize the current playback status of the host device to the slave device; Step 4: In response to the user clicking again on the connected slave device, the connection between the slave device and the host terminal device is terminated. After the connection is disconnected, the slave device is restored to the playing state before the connection.

[0072] Figure 5 A system diagram of a multi-room audio playback method based on a C / S architecture provided in an embodiment of the present application is shown in FIG. Figure 5 As shown in FIG. 1 , the system adopts a C / S architecture, which includes a server module and a client module. The server module is responsible for the audio collection and distribution layer, and the client module is responsible for audio processing and playback.

[0073] The server is deployed on a terminal device with audio input capability. It registers the sound card device through the ALSA driver layer and configures a dual-channel PCM audio interface to support 16bit / 48kHz sampling parameters. The audio acquisition thread polls the sound card DMA status in non-blocking mode, captures the original PCM data stream in real time and writes it into the named pipe FIFO. The FIFO pipe capacity is set to 19200 bytes, corresponding to 100ms of audio data, and adopts a dual-ring buffer management strategy: the write thread monitors the FIFO writable status to ensure that no data is lost; the read thread extracts data blocks from the FIFO, obtains the system clock, and attaches a global timestamp to each frame of audio data. The server integrates the RxDNSSD protocol stack, broadcasts the service type _server._tcp in the local area network, declares the port number, device IP / MAC address and online status. When the client accesses through a TCP connection, the server starts an independent I / O thread to send a timestamped audio data block; if there is no active connection, the current data block is discarded to release resources.

[0074] The client runs on a terminal device that supports audio output. By integrating the RxDNSSD protocol stack, it actively scans for server instances within the local area network, generates a device list that includes device identifiers, IP addresses, MAC addresses, and online status. After the user selects a target server, the client initiates a TCP connection request. After a successful three-way handshake, a stable link is established with the server. It writes to the sound card through the AudioTrack interface. During playback, it calculates the latency of each audio frame in real time to avoid cumulative latency. The latency is calculated comprehensively based on the current time of the server, the time consumed for loading an audio data block, the time consumed for loading the audio data block, and the time for output to the sound card. The calculation method is as follows: Latency = Current time of the server - Recording time of the audio data block - Time consumed for loading the audio data block + Time consumed for sound card output; Based on the calculated latency, an adaptive compensation strategy is triggered: when the latency is greater than zero, it is a positive latency, the playback progress of the current audio frame lags behind, and this audio frame is a redundant frame and is directly discarded; when the latency is less than zero, it is a negative latency, the playback progress of the current audio frame is ahead, and a silent frame needs to be inserted to wait for the playback time of the current frame. The client judges each audio frame in the audio frame queue according to this strategy to achieve precise synchronization between playback terminals.

[0075] Figure 6 The following is a schematic structural diagram of a multi-room audio playback system provided by an embodiment of the present application. As Figure 6 shown, the system specifically includes: A first acquisition module 601, configured to acquire layout information of the currently playing audio space, where the layout information includes position information of each room in the space, names of each room, and device information of audio devices in each room; A combination module 602, configured to combine audio devices in each room in the playing audio space into an initial playback architecture according to the layout information; A second acquisition module 603, configured to acquire connection relationships of each audio device in the initial playback architecture; An update module 604, configured to update the initial playback architecture based on the connection relationships to obtain an audio playback architecture, so as to implement multi-room audio playback through the audio playback architecture.

[0076] In a possible implementation manner, the combination module 602 is further configured to determine position information of each room audio device according to the layout information; based on the position information, establish a device list of the currently playing audio space in the position order of each room audio device, where the device list records the position information and device information of each audio device; select a target audio device as the server from the device list, and set other audio devices in the target audio device as clients; establish a communication connection between the server and the clients according to the device information of each client in the device list to obtain an initial playback architecture.

[0077] In a possible implementation, the filling module 402 is further configured to divide the clients into multiple playback device clusters corresponding to multiple audio functions according to the device types of the clients in the device list; for any playback device cluster, establish a communication connection with the server according to the audio function corresponding to the playback device cluster to achieve the directional distribution of audio data.

[0078] In a possible implementation, the filling module 402 is further configured to select the audio device at the head of the device list and determine whether the working state of the audio device is online; when the working state of the audio device is online, use the audio device as the server; when the working state of the audio device is offline, sequentially select audio devices according to the arrangement order of the device list, and re-execute the step of determining whether the working state of the audio device is online to select an online audio device as the server.

[0079] In a possible implementation, the second acquisition module 603 is further configured to acquire the communication link connection objects of the clients in the initial playback architecture; for any client, add a first connection mark to the client when the corresponding communication link connection object is the server, and add a second connection mark to the client when the corresponding communication link connection object is not the server, so as to obtain the connection relationship of each audio device in the initial playback architecture based on the connection marks of the clients.

[0080] In a possible implementation, the update module 604 is further configured to determine, based on the connection relationship, whether the client is connected to other servers; if so, disconnect the connection relationship between the client and other servers, and establish the connection relationship between the client and the server to complete the update of the initial playback architecture to obtain an audio playback architecture.

[0081] In a possible implementation, the update module 604 is further configured to respond to a join request initiated by a client, and determine whether the server accepts the join request; when the server accepts the join request, send a synchronous clock to the client according to the playback device cluster corresponding to the client to establish the connection relationship between the client and the server.

[0082] The multi-room audio playback system provided in this embodiment may be the multi-room audio playback system as shown in Figure 6 and can execute all the steps of multi-room audio playback as shown in Figures 1-5 to further achieve the technical effects of multi-room audio playback as shown in Figures 1-5 For details, please refer to Figures 1-5The related descriptions are not elaborated here for the sake of brevity.

[0083] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0084] Figure 7 The structural schematic diagram of an electronic device provided by an embodiment of the present application is as Figure 7 shown. An embodiment of the present application provides an electronic device, including a processor 701, a communication interface 702, a memory 703, and a communication bus 704. Among them, the processor 701, the communication interface 702, and the memory 703 complete mutual communication through the communication bus 704; the memory 703 is used to store a computer program; when the processor 701 executes the program stored on the memory 703, it implements the steps of the multi-room audio playback method provided by any one of the foregoing method embodiments: Obtain the layout information of the currently playing audio space, where the layout information includes the position information of each room in the space, the name of each room, and the device information of the audio devices in each room; according to the layout information, combine the audio devices in each room in the playing audio space into an initial playback architecture; obtain the connection relationship of each audio device in the initial playback architecture; update the initial playback architecture based on the connection relationship to obtain an audio playback architecture, so as to implement multi-room audio playback through the audio playback architecture.

[0085] In a possible implementation manner, determine the position information of each room audio device according to the layout information; based on the position information, establish a device list of the currently playing audio space in the position order of each room audio device, and the device list records the position information and device information of each audio device; select a target audio device as the server from the device list, and set the other audio devices in the target audio device as clients; according to the device information of each client in the device list, establish a communication connection between the server and the clients to obtain an initial playback architecture.

[0086] In a possible implementation manner, divide the clients into multiple playback device clusters corresponding to multiple audio functions according to the device types of each client in the device list; for any one of the playback device clusters, establish a communication connection with the server according to the audio function corresponding to the playback device cluster to achieve directional distribution of audio data.

[0087] In a possible implementation, select the audio device at the head of the device list, and determine whether the working state of the audio device is online; when the working state of the audio device is online, use the audio device as the server; when the working state of the audio device is offline, sequentially select an audio device according to the arrangement order of the device list, and re-execute the step of determining whether the working state of the audio device is online to select an online audio device as the server.

[0088] In a possible implementation, obtain the communication link connection objects of each client in the initial playback architecture; for any client, add a first connection mark to the client when the corresponding communication link connection object is the server, and add a second connection mark to the client when the corresponding communication link connection object is not the server, so as to obtain the connection relationship of each audio device in the initial playback architecture based on the connection marks of the clients.

[0089] In a possible implementation, based on the connection relationship, determine whether the client is connected to other servers; if so, disconnect the connection relationship between the client and other servers, and establish the connection relationship between the client and the server to complete the update of the initial playback architecture and obtain the audio playback architecture.

[0090] In a possible implementation, in response to a join request initiated by a client, determine whether the server accepts the join request; when the server accepts the join request, send a synchronous clock to the client according to the playback device cluster corresponding to the client to establish the connection relationship between the client and the server.

[0091] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solutions, in essence, or the part that contributes to the related technologies can be embodied in the form of a software product, and this computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disc, etc., including several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0092] It should be understood that the terms used herein are for the purpose of describing particular example embodiments only and are not intended to be limiting. Unless the context clearly dictates otherwise, the singular forms "a", "an", and "the" as used herein may also include the plural forms. The terms "comprising", "including", "containing", and "having" are inclusive and thus specify the presence of stated features, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not to be construed as necessarily requiring them to be performed in the particular order described or illustrated, unless the order of performance is explicitly stated. It should also be understood that additional or alternative steps may be used.

[0093] The foregoing are only specific embodiments of the present invention, which enable those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A multi-room audio playback method, characterized in that, Including: Obtain the layout information of the current audio-playing space, where the layout information includes the position information of each room in the space, the name of each room, and the device information of the audio devices in each room; According to the layout information, combine the audio devices in each room in the audio-playing space into an initial playing architecture; Obtain the connection relationship of each audio device in the initial playing architecture; Update the initial playing architecture based on the connection relationship to obtain an audio-playing architecture, so as to implement multi-room audio playback through the audio-playing architecture.

2. The method according to claim 1, wherein The step of combining the audio devices in each room in the audio-playing space into an initial playing architecture according to the layout information includes: Determine the position information of each room's audio device according to the layout information; Based on the position information, establish a device list of the current audio-playing space in the order of the positions of the audio devices in each room, and the device list records the position information and device information of each audio device; Select a target audio device from the device list as the server, and set the other audio devices in the target audio device as clients; According to the device information of each client in the device list, establish a communication connection between the server and the clients to obtain an initial playing architecture.

3. The method according to claim 2, wherein The device information includes the device type; The step of establishing a communication connection between the server and the clients according to the device information of each client in the device list includes: Divide the clients into multiple playing device clusters corresponding to multiple audio functions according to the device types of the clients in the device list; For any playing device cluster, establish a communication connection with the server according to the audio function corresponding to the playing device cluster to achieve the directional distribution of audio data.

4. The method according to claim 2, characterized in that, The step of selecting a target audio device from the device list as the server includes: Select the audio device at the head of the device list, and judge whether the working state of the audio device is online; In the case where the working state of the audio device is online, use the audio device as the server; In the case where the working state of the audio device is offline, select the audio device in sequence according to the arrangement order of the device list, and re-execute the step of judging whether the working state of the audio device is online to select an online audio device as the server.

5. The method according to claim 1, characterized in that, Before obtaining the connection relationship of each audio device in the initial playing architecture, the method further includes: Obtain the communication link connection object of each client in the initial playing architecture; For any client, add a first connection mark to the client in the case where the corresponding communication link connection object is the server, and add a second connection mark to the client in the case where the corresponding communication link connection object is not the server, so as to obtain the connection relationship of each audio device in the initial playing architecture based on the connection marks of the clients.

6. The method according to claim 2, characterized in that, The step of updating the initial playing architecture based on the connection relationship to obtain an audio-playing architecture includes: Based on the connection relationship, judge whether the client is connected to other servers; If so, disconnect the connection between the client and other servers, and establish the connection between the client and the server to complete the update of the initial playback architecture and obtain the audio playback architecture.

7. The method according to claim 6, characterized in that, The establishment of the connection between the client and the server includes: Respond to the join request initiated by the client and determine whether the server accepts the join request; When the server accepts the join request, send a synchronous clock to the client according to the playback device cluster corresponding to the client to establish the connection between the client and the server.

8. A multi-room audio playback system, characterized in that, It includes: A first acquisition module for acquiring the layout information of the current audio playback space, where the layout information includes the position information of each room in the space, the name of each room, and the device information of the audio devices in each room; A combination module for combining the audio devices in each room in the audio playback space into an initial playback architecture according to the layout information; A second acquisition module for acquiring the connection relationship of each audio device in the initial playback architecture; An update module for updating the initial playback architecture based on the connection relationship to obtain an audio playback architecture for realizing multi-room audio playback through the audio playback architecture.

9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the multi-room audio playback method according to any one of claims 1 to 7.

10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the multi-room audio playback method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Wireless multi-room music system synchronization mechanism based on UPnP protocol

    CN103581816A

  • Audio synchronous playing method and system and storage medium

    CN118102434A

  • Multi-room audio management method and device, equipment and storage medium

    CN118394965A

  • Configuration method, system and equipment of multi-room audio system and storage medium

    CN120091257A

Cited By

  • Low-delay multi-room audio playing optimization method and system, storage medium and equipment

    CN120812039A