Cascade playback method and device, electronic equipment and storage medium
By sending broadcast messages and fast UDP network connections, the automated configuration and audio sharing of cascading sound playback technology are realized, solving the problem of complex configuration processes in the existing technology, and improving the security and user convenience of audio streams.
Patent Information
- Application Number
- CN202310706380.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-14
- Publication Date
- 2024-12-27
AI Technical Summary
The configuration process of existing cascading sound playback technology is complex and it is difficult to achieve automated and efficient audio sharing.
By sending broadcast messages carrying multicast addresses and IP addresses, all players in the cascading mode are allowed to join the multicast group, and control the player in the slave mode to play audio while playing audio, realizing automated configuration and audio Forwarding, using the fast UDP network connection protocol to generate a secure real-time transmission protocol key to encrypt audio streams, establish a competition mechanism adjustment mode, and simplify the configuration process.
The configuration process of cascading sound playback has been greatly simplified, automated configuration and positive response have been achieved, the security and stability of audio streams have been improved, user convenience and synchronous playback capabilities between devices have been improved.
Smart Images

Figure CN119211207A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of streaming media, and in particular to a cascaded sound playback method, device, electronic device and storage medium. Background Art
[0002] As streaming media technology matures, the demand for audio sharing is also becoming more and more apparent. Whether in shopping malls, schools, or homes, audio sharing technology has a huge application market. Cascade playback technology can provide audio sharing functions very well. By forwarding the audio to be shared through the main control device, multiple devices can be played synchronously. At present, the mainstream cascade playback technology is divided into wired cascade and wireless cascade.
[0003] The inventors have discovered that there are at least the following problems in the related art: the current cascade playback technology has the problem of complex configuration process. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a cascaded sound playback method, device, electronic device and storage medium, so that the configuration process of the cascaded sound playback is greatly simplified.
[0005] In order to solve the above technical problems, an embodiment of the present invention provides a cascaded sound playback method, comprising:
[0006] Send a broadcast message carrying a multicast address and an IP address so that all players in slave mode in cascade mode can join a multicast group according to the broadcast message, and the multicast group is used to forward audio to the players in slave mode; while playing the audio, control all players in slave mode to play the audio.
[0007] An embodiment of the present invention also provides a cascade playback device, including: an information broadcast module, used to send a broadcast message carrying a multicast address and an IP address, so that all players in the cascade mode and in slave mode can join the multicast group according to the broadcast message, and the multicast group is used to forward audio to the players in the slave mode; a playback control module, used to control all the players in the slave mode to play the audio while playing the audio.
[0008] An embodiment of the present invention also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned cascade playback method.
[0009] An embodiment of the present invention further provides a computer-readable storage medium storing a computer program, wherein the computer program implements the above-mentioned cascade playback method when executed by a processor.
[0010] In the embodiment of the present invention, a broadcast message carrying a multicast address and an IP address is sent so that all players in the cascade mode and in the slave mode can join the multicast group according to the broadcast message. The multicast group is used to forward the audio to the players in the slave mode. Then, while playing the audio, all the players in the slave mode are controlled to play the audio. The configuration process is greatly simplified, and through the multicast group, the cascade playback is automatically configured and the playback process is actively responded to and adjusted. There is no need to manually adjust the cascade setting process for each player to join, and a stable cascade method is provided.
[0011] In addition, before forwarding the audio to the player in slave mode, a secure real-time transport protocol key for encrypting the audio is generated, so that the player in slave mode can obtain the secure real-time transport protocol key through the fast UDP network connection protocol after joining the multicast group. This ensures that the audio stream is correctly sent and the security of the audio stream is guaranteed, further increasing the security in the cascading process.
[0012] In addition, before sending a broadcast message carrying a multicast address and an IP address, the players in transition mode of all cascade modes compete according to preset competition rules; when the competition is successful, the transition mode enters the master mode to send the broadcast message carrying the multicast address and the IP address; when the competition fails, the transition mode enters the slave mode to receive the broadcast message carrying the multicast address and the IP address. Establishing a competition mechanism to compete for the only control right facilitates cascade association, and at the same time, the operation of the player in the master mode can affect the player in the slave mode, which greatly improves user convenience.
[0013] In addition, when it is detected that the cascade mode of the player in the multicast group is adjusted from the slave mode to the transition mode, the cascade mode of the player is adjusted back to the slave mode; when the cascade mode is switched to the slave mode, the player whose cascade mode is adjusted from the slave mode to the transition mode will compete with all the players in the transition mode again. The freely adjustable mode provides users with more diverse choices.
[0014] In addition, the preset competition rules include: determining the result of the competition by the final value carried in the message sent by each player in the transition mode participating in the competition.
[0015] In addition, the sending of the broadcast message carrying the multicast address and the IP address for all players in the cascade mode in the slave mode to join the multicast group according to the broadcast message, and the multicast group is used to forward the audio to the players in the slave mode, including: after receiving the request message sent by the player in the slave mode through broadcast, sending the broadcast message carrying the multicast address and the IP address through unicast for the players in the slave mode to join the multicast group. The active request by the slave mode device can speed up the process of joining the multicast group and make the cascade process more accurate.
[0016] In addition, the player in slave mode sends a request message via broadcast, including: the player in slave mode sends a request message via broadcast, and if the broadcast message is not received, the request message is sent again after a preset time to request a multicast address, until the broadcast message is received or the number of times the request message is sent reaches a preset number of times. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0018] Figure 1 is a flow chart of a cascade playback method provided according to an embodiment of the present application;
[0019] Figure 2 is a flow chart of a cascade mode switching method provided according to an embodiment of the present application;
[0020] Figure 3 is a schematic structural diagram of a cascade sound playback device provided according to another embodiment of the present application;
[0021] Figure 4 It is a schematic diagram of the structure of an electronic device provided according to another embodiment of the present application. DETAILED DESCRIPTION
[0022] To make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the embodiments of the present invention, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can be implemented. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined and referenced with each other without contradiction.
[0023] One embodiment of the present invention relates to a cascade playback method, which can be applied to a playback device whose cascade mode is a master mode. The playback device can be a speaker, a sound, a buzzer, etc. In this embodiment, a broadcast message carrying a multicast address and an IP address is sent so that all players in the cascade mode and in slave mode can join the multicast group according to the broadcast message. The multicast group is used to forward audio to the players in slave mode; while playing the audio, all players in slave mode are controlled to play the audio, which greatly simplifies the configuration process. In addition, through the multicast group, the cascade playback is automatically configured and the playback process is actively responded to and adjusted. There is no need to manually adjust each player to join the cascade setting process, which provides a stable cascade method. The implementation details of the cascade playback method of this embodiment are described in detail below. The following content is only for the convenience of understanding the implementation details provided, and is not necessary for the implementation of this solution.
[0024] like Figure 1 As shown, in step 101, the playback device in the cascade mode and the master mode sends a broadcast message carrying a multicast address and an IP address, so that all players in the cascade mode and the slave mode can join the multicast group according to the broadcast message, and the multicast group is used to forward audio to the players in the slave mode.
[0025] For ease of understanding, the playback device in the cascade mode and master mode is referred to as the active master, the broadcast message carrying the multicast address and IP address is also referred to as the broadcast message, and the player in the cascade mode and slave mode is referred to as the slave device (slave). This will not be elaborated on below.
[0026] The master device sends a broadcast message carrying the multicast address and the local IP address in broadcast mode. After receiving the broadcast message, the slave device parses the content and joins the multicast group by specifying the multicast source mode.
[0027] In a more detailed example, after receiving the broadcast message, the slave device parses the content and obtains the multicast address, multicast port, IP protocol version and IP address of the master device. Then, the slave device joins the multicast group by specifying the multicast source as the IP address of the master device and listens to the audio stream sent to the multicast group.
[0028] In one example, after all slave devices join the multicast group, the master device encodes the audio stream to be forwarded into L16 format and sends it to the multicast group according to the multicast address.
[0029] In a detailed example, after all slave devices join the multicast group, the master device resamples the audio stream to be forwarded to 48khz sampling rate and then encodes it into L16 format. The L16 format is not compressed and can better ensure the quality of the audio stream.
[0030] In one example, the cascade mode is a master mode playback device that generates a secure real-time transport protocol key for encrypting the audio, so that the player in the slave mode can obtain the secure real-time transport protocol key through the fast UDP network connection protocol after joining the multicast group, and the secure real-time transport protocol key is used to encrypt the audio.
[0031] The master device can generate a secure real-time transport protocol key (SRTP key) for encrypting audio streams while sending broadcast messages. After receiving the broadcast message, the slave device parses the content and joins the multicast group by specifying the multicast source mode. The SRTP key is obtained from the master device through the fast UDP network connection protocol (quic protocol). After that, the master device encrypts the audio stream to be forwarded through SRTP and then sends it to the multicast address. The slave device receives the audio stream sent by the master device, decrypts it through the SRTP key, and then decodes and plays it.
[0032] In a detailed example, while the slave device monitors the audio stream sent to the multicast group, it connects to the master device through the QUIC protocol to establish a secure transmission channel, and obtains the SRTP key from the master device through the secure transmission channel for decrypting the received audio stream.
[0033] In one example, before sending a broadcast message carrying a multicast address and an IP address, the players in all cascade modes in transition mode compete according to preset competition rules; when the competition is successful, the transition mode enters the master mode to send the broadcast message carrying the multicast address and the IP address; when the competition fails, the transition mode enters the slave mode to receive the broadcast message carrying the multicast address and the IP address.
[0034] The player in transition mode is referred to as the transition device (master). The initial cascade mode of all players is configured as the slave mode by default. The user can configure the cascade mode on the web page. If it is configured as the transition device mode, the multicast address and forwarding type must also be configured. When only one player participates in the competition, the player directly wins the competition.
[0035] In one example, the result of the competition is determined by the final value carried in the message sent by each player in the transition mode participating in the competition.
[0036] The final value is generated by the player in the corresponding transition mode, and the player in the transition mode with the highest final value is deemed to have won the competition.
[0037] It can be understood that the final value here can be randomly generated, calculated based on the performance of the player device, or set by the user. In an example, the final value here is a random value (tiebreaker). After the transition device enters the competition phase, it broadcasts an alert message carrying a random value every 30ms to detect whether there are other players participating in the competition in the same subnet. In a detailed example, the transition device generates a 32-bit random value tiebreaker for competing with other transition devices in the conflict detection phase. The transition device broadcasts an alert message carrying a random value tiebreaker every 30ms, and sends a total of 31 alert messages. If an alert message from other transition devices is received during this period, the random value tiebreaker carried in the message is parsed and compared with the random value tiebreaker of the local device. If the random value tiebreaker of the local device is larger, it is selected as the master device. If the random value tiebreaker of the local device is smaller, it switches to the slave device mode.
[0038] In addition, if the two random values are the same, a 32-bit random value tiebreaker is regenerated and packaged into an alert message for sending. The number of alert messages sent is also recalculated. The transition device that fails in the competition will pop up a window to prompt the reason for the failure to switch the transition device and display the IP address of the current master device.
[0039] In one example, when it is detected that the cascade mode of the player in the multicast group is adjusted from the slave mode to the transition mode, the cascade mode of the player is adjusted back to the slave mode; when the cascade mode is switched to the slave mode, the player whose cascade mode is adjusted from the slave mode to the transition mode will re-start the competition with all the players in the transition mode.
[0040] In a specific example, after any transition device enters the competition phase, it will broadcast an alert message carrying a random value tiebreaker every 30ms. Since only one master device is supported in the same subnet, if the master device receives the alert message, it will reply with an exist message carrying the IP protocol version and the local IP address, indicating that a master device already exists in the current network environment. If the transition device receives the exist message, it will automatically fail in the competition and become a slave device. If the master device detects that the mode has been converted to a slave device, it will broadcast a bye message to inform all players and become a slave device. After receiving the bye message, the slave device needs to detect whether the sender of the bye message is the current master device. If so, it will exit the cascade mode and become a slave device again. If not, it will not do anything. If the slave device detects that the mode has been converted to a transition device at this time, it will exit the multicast group and generate a 32-bit random value tiebreaker to compete with other transition devices in the conflict detection phase.
[0041] In one example, a broadcast message carrying a multicast address and an IP address is sent so that all players in cascade mode and in slave mode can join the multicast group according to the broadcast message. The multicast group is used to forward audio to the players in slave mode. After receiving a request message sent by the player in slave mode via broadcast, the broadcast message carrying the multicast address and the IP address is sent via unicast so that the players in slave mode can join the multicast group.
[0042] After receiving the request message, the master device sends a broadcast message carrying the multicast address and the local IP address to the requesting slave device in unicast mode. This prevents the slave devices that have joined the multicast group from repeatedly updating the monitoring parameters, which may cause disconnection, freezes, and other problems.
[0043] In one example, the player in slave mode sends a request message by broadcasting, including:
[0044] The player in slave mode sends a request message by broadcasting. If the broadcast message is not received, the player sends the request message again after a preset time to request the multicast address, until the broadcast message is received or the number of times the request message is sent reaches a preset number of times.
[0045] Specifically, the player in slave mode sends a request message (request for short) via broadcast to request the multicast address. If a broadcast message is received, the content is parsed to join the multicast group. Otherwise, the delay is increased by 2 times and the request is sent again. If a total of four requests are sent and no broadcast message is received, no request will be sent again, and only the broadcast message actively sent by the transition device will be waited for.
[0046] In a specific example, the first request message is sent after 1s in the configuration of slave mode. If no broadcast message response is received, the request message is sent again after a delay of 2s. If no broadcast message response is received, the broadcast message is sent again after a delay of 4s and 8s. If no broadcast message response is received, it means that there is no master device in the same subnet in the current environment, and no request message is sent.
[0047] In step 102, the sound player in the cascade mode and in the master mode controls all the players in the slave mode to play the audio while playing the audio.
[0048] Specifically, since the multicast group has been established, the master device resamples the audio stream to be forwarded to 48khz sampling rate, encodes it into L16 format, and then encrypts it through srtp and sends it to the multicast address. At the same time, the audio stream to be forwarded is played through the local speaker. The slave device receives the audio stream sent by the master device, decrypts it through the srtp key, and then decodes and plays it synchronously. This achieves the purpose of cascading playback of multiple devices.
[0049] In a specific example, Figure 2 As shown, you need to select the cascade mode first. All players are configured as slave devices by default. Only one active master device is supported in the same subnet, and multiple slave devices are supported. When switching modes, users need to configure the cascade mode on the web page first. If the slave device needs to be configured as a transition device (master), the multicast address and forwarding type must also be configured.
[0050] If configured as a transition device, a 32-bit random value tiebreaker is generated to compete with other transition devices in the conflict detection phase. The transition device broadcasts alert messages carrying random values of tiebreaker every 30ms, and sends a total of 31 alert messages. If an alert message from another transition device is received during this period, the tiebreaker value carried in the message is parsed and compared with the tiebreaker value of the local device. If the tiebreaker value of the local device is larger, it is selected as the master device. If the tiebreaker value of the local device is smaller, it switches to the slave device mode.
[0051] If selected as the master device, it will send a broadcast message carrying the multicast address, multicast port, IP protocol version and local IP address through broadcast. At the same time, it will generate a random srtp key for encrypting the audio stream. Then it will start the quic server listening process to wait for the client to connect. If the master device detects that the multicast address has changed, it will re-send a broadcast message carrying the new multicast address, new multicast port, IP protocol version and local IP address through broadcast, and generate a new random srtp key.
[0052] If it is not configured as a transition device or does not compete to become the master device during the above mode switching, it becomes a slave device and sends a request message to request the multicast address through broadcast. If the request is not successful, the request is sent again after increasing the delay by 2 times. If no broadcast message is received after sending four requests in total, the request will no longer be sent, and only the broadcast message actively sent by the transition device will be waited for. After receiving the request message, the master device sends a broadcast message carrying the multicast address, multicast port, IP protocol version and local IP address to the requested slave device through unicast. After receiving the broadcast message, the slave device parses the content, obtains the multicast address, multicast port, IP protocol version and IP address of the master device, and then joins the multicast group by specifying the multicast source as the IP address of the master device, and listens to the audio stream sent to the multicast group. At the same time, the slave device connects to the master device through the quic protocol to establish a secure transmission channel, and obtains the srtp key from the master device through the secure transmission channel to decrypt the received audio stream.
[0053] The master device resamples the audio stream to be forwarded to 48khz sampling rate, and then encodes it into L16 format. L16 format is not compressed, which can better ensure the quality of the audio stream. Then it is encrypted by srtp and sent to the multicast address. At the same time, the audio stream to be forwarded is played through the local speaker. The slave device receives the audio stream sent by the master device, decrypts it through the srtp key, and then decodes and plays it. This achieves the purpose of cascading playback of multiple devices.
[0054] Users can freely adjust the cascade mode at any time. If the master device detects that the mode is converted to a slave device, it broadcasts a bye message and becomes a slave device. At this time, after receiving the bye message, the slave device needs to detect whether the sender of the bye message is the current master device. If it is, it exits the cascade mode and re-broadcasts the request message to request a new multicast address. If it is not, it does not do anything. If the slave device detects that the mode is converted to a transition device, it exits the multicast group and sends an alert message carrying a random value tiebreaker to compete with other transition devices in the conflict detection phase. If the master device receives the alert message, it means that a slave device has been adjusted to a transition device in the presence of the master device. At this time, it replies with an exist message carrying the IP protocol version and the local IP address, indicating that a master device already exists in the current network environment. If an exist message is received from other transition devices during the alert message, it switches to the slave mode. The transition device that fails in the competition will pop up a window to prompt the reason for the failure to switch the transition device and display the IP address of the current master device.
[0055] In this embodiment, a broadcast message carrying a multicast address and an IP address is sent so that all players in slave mode in the cascade mode can join the multicast group according to the broadcast message. The multicast group is used to forward the audio to the players in slave mode, and then control all players in slave mode to play the audio while playing the audio. The configuration process is greatly simplified, and through the multicast group, the cascade playback is automatically configured and the playback process is actively responded to and adjusted, without the need to manually adjust the cascade setting process for each player, providing a stable cascade method.
[0056] The steps of the above method are divided only for the purpose of clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the scope of protection of this patent.
[0057] Another embodiment of the present invention relates to a cascade sound playback device, such as Figure 3As shown, it includes: an information broadcast module 301, which is used to send a broadcast message carrying a multicast address and an IP address, so that all players in the cascade mode and in the slave mode can join the multicast group according to the broadcast message, and the multicast group is used to forward the audio to the players in the slave mode; a playback control module 302, which is used to control all the players in the slave mode to play the audio while playing the audio.
[0058] In one example, the cascade playback device also includes: a security encryption module, used to generate a secure real-time transport protocol key for encrypting the audio, so that the player in slave mode can obtain the secure real-time transport protocol key through the fast UDP network connection protocol after joining the multicast group, and the secure real-time transport protocol key is used to encrypt the audio.
[0059] In one example, the cascade playback device also includes: a competition control module, which is used to compete with all players in the transition mode of the cascade mode according to preset competition rules before sending a broadcast message carrying the multicast address and the IP address; when the competition is successful, the transition mode enters the master mode to send the broadcast message carrying the multicast address and the IP address; when the competition fails, the transition mode enters the slave mode to receive the broadcast message carrying the multicast address and the IP address.
[0060] In one example, the cascade playback device also includes: a mode adjustment module, which is used to adjust the player whose cascade mode is adjusted from the slave mode to the transition mode back to the slave mode when there is a player in the master mode in the multicast group; when the cascade mode of the player in the master mode is switched to the slave mode, the player whose cascade mode is adjusted from the slave mode to the transition mode will re-compete with all the players in the transition mode.
[0061] In one example, the preset competition rules include: determining the result of the competition by the final value carried in the message sent by each player in the transition mode participating in the competition.
[0062] In one example, a broadcast message carrying a multicast address and an IP address is sent so that all players in cascade mode and in slave mode can join the multicast group according to the broadcast message, including: after receiving a request message sent by the player in slave mode via broadcast, the broadcast message carrying the multicast address and the IP address is sent via unicast so that the player in slave mode can join the multicast group.
[0063] In one example, the player in slave mode sends a request message via broadcast, including: the player in slave mode sends a request message via broadcast, and if the broadcast message is not received, sends the request message again after a preset time to request a multicast address, until the broadcast message is received or the number of times the request message is sent reaches a preset number of times.
[0064] In this embodiment, a broadcast message carrying a multicast address and an IP address is sent so that all players in slave mode in the cascade mode can join the multicast group according to the broadcast message. The multicast group is used to forward the audio to the players in slave mode. Then, while playing the audio, all players in slave mode are controlled to play the audio. The configuration process is greatly simplified, and through the multicast group, the cascade playback is automatically configured and the playback process is actively responded to and adjusted. There is no need to manually adjust the cascade setting process for each player to join, providing a stable cascade method.
[0065] It is not difficult to find that this embodiment is a device embodiment corresponding to the above method embodiment, and this embodiment can be implemented in conjunction with the above method embodiment. Since the above method embodiment of the present application can be applied to a series of sound playback devices such as speakers and stereos, the device embodiment corresponding to the method embodiment can also carry the various modules involved on a series of sound playback devices such as speakers, stereos, headphones, etc. to produce corresponding technical effects. The relevant technical details mentioned in the above method embodiment are still valid in this embodiment. In order to reduce repetition, they will not be repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied in the above method embodiment.
[0066] It is worth mentioning that all modules involved in this embodiment are logic modules. In practical applications, a logic unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, this embodiment does not introduce units that are not closely related to solving the technical problem proposed by the present invention, but this does not mean that there are no other units in this embodiment.
[0067] Another embodiment of the present invention relates to an electronic device, such as Figure 4 As shown, it includes at least one processor 401; and a memory 402 that is communicatively connected to the at least one processor; wherein the memory 402 stores instructions that can be executed by the at least one processor 401, and the instructions are executed by the at least one processor 401 so that the at least one processor 401 can execute a cascade playback method as described above.
[0068] The memory 402 and the processor 401 are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors 401 and the memory 402 together. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor 401 is transmitted on a wireless medium via an antenna, and further, the antenna also receives data and transmits the data to the processor 401.
[0069] The processor 401 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management and other control functions. The memory can be used to store data used by the processor when performing operations.
[0070] Another embodiment of the present invention relates to a computer-readable storage medium storing a computer program, which implements the above method embodiment when executed by a processor.
[0071] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0072] Those skilled in the art will appreciate that the above embodiments are specific embodiments for implementing the present invention, and that in actual applications, various changes may be made in form and detail without departing from the spirit and scope of the present invention.
Claims
1. A cascade playback method, characterized in that: include: Send a broadcast message carrying a multicast address and an IP address, so that all players in the cascade mode and in slave mode can join a multicast group according to the broadcast message, and the multicast group is used to forward audio to the players in the slave mode; While playing the audio, all the players in slave mode are controlled to play the audio.
2. The cascade playback method according to claim 1, characterized in that: Before forwarding the audio to the player in slave mode, the method further includes: A secure real-time transport protocol key for encrypting the audio is generated so that the player in slave mode can obtain the secure real-time transport protocol key through a fast UDP network connection protocol after joining the multicast group.
3. The cascade playback method according to claim 1, characterized in that: The method further comprises: Before sending the broadcast message carrying the multicast address and the IP address, competing with all players in the transition mode of the cascade mode according to a preset competition rule; When the competition is successful, the transition mode enters the master mode, and the broadcast message carrying the multicast address and the IP address is sent; When the competition fails, the transition mode enters the slave mode to receive the broadcast message carrying the multicast address and the IP address.
4. The cascade playback method according to claim 3, characterized in that: The method further comprises: When it is detected that the cascade mode of the player in the multicast group is adjusted from the slave mode to the transition mode, adjusting the cascade mode of the player back to the slave mode; When the cascade mode is switched to the slave mode, the player whose cascade mode is adjusted from the slave mode to the transition mode will start the competition with all the players in the transition mode again.
5. The cascade playback method according to claim 3, characterized in that: The preset competition rules include: The result of the competition is determined by the final value carried in the message sent by each player in the transition mode participating in the competition.
6. The cascade playback method according to claim 1, characterized in that: The sending of a broadcast message carrying a multicast address and an IP address so that all players in slave mode in the cascade mode can join the multicast group according to the broadcast message includes: After receiving the request message sent by the player in the slave mode via broadcast, the broadcast message carrying the multicast address and the IP address is sent via unicast, so that the player in the slave mode can join the multicast group according to the broadcast message.
7. The cascade playback method according to claim 6, characterized in that: The player in slave mode sends a request message by broadcasting, including: The player in slave mode sends a request message by broadcasting. If the broadcast message is not received, the player sends the request message again after a preset time to request the multicast address until the broadcast message is received or the number of times the request message is sent reaches a preset number of times.
8. A cascade sound playback device, characterized in that: include: Information broadcast module for Send a broadcast message carrying a multicast address and an IP address, so that all players in the cascade mode and in slave mode can join a multicast group according to the broadcast message, and the multicast group is used to forward audio to the players in the slave mode; The audio playback control module is used to control all the players in slave mode to play the audio while playing the audio.
9. An electronic device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the cascade playback method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the cascade playback method according to any one of claims 1 to 7 is implemented.
