Master-slave playback device synchronous playback method, slave playback device and playback system

By receiving indication messages from the playback device to calculate the initial time deviation and adjust the playback rate, the problem of synchronization deviation of the master-slave playback device is solved, precise synchronous playback is achieved, and user experience is improved.

CN115913431BActive Publication Date: 2025-08-08ACTIONS ZHUHAI TECH CO
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110966288.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-23
Publication Date
2025-08-08
Estimated Expiration
2041-08-23

AI Technical Summary

Technical Problem

In the prior art, the audio out of synchronization caused by the master-slave playback device leads to a decline in user experience.

Method used

By receiving an indication message from the host playback device from the playback device, the initial time deviation is calculated, and the playback rate is adjusted according to the deviation, so that the master and slave playback device can play synchronously.

Benefits of technology

It realizes accurate synchronous playback of the master and slave playback device and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115913431B_ABST
    Figure CN115913431B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for synchronous playback of a master and a slave playback device, a slave playback device, and a playback system. When it is determined that the initial time deviation is not zero, it can be considered that the master playback device and the slave playback device are not playing synchronously. At this time, the slave playback device can adjust the current first playback rate according to the initial time deviation, and when it is determined that the adjustment is completed, the first playback rate of the slave playback device is controlled so that the master playback device and the slave playback device both play the same data synchronously at the same playback rate. That is, with the time deviation as a reference, the first playback rate of the slave playback device is adjusted so that the time deviation of the master and the slave playback devices can be controlled within a sample point, achieving more precise adjustment, thereby enabling the master and the slave playback devices to effectively play synchronously.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of audio technology, and in particular to a method for synchronous playback of master and slave playback devices, a slave playback device, and a playback system. Background Art

[0002] A speaker playback system may include: a master speaker and at least one slave speaker, and the master speaker and the slave speaker can play the same audio data; however, due to factors such as the audio data transmission method or the data transmission network, the master speaker and the slave speaker may not be able to play synchronously. When the master speaker and the slave speaker are set at a close distance, the master speaker and the slave speaker interfere with each other due to the lack of synchronization, so that the user may not be able to hear the audio content played by the master speaker and the slave speaker, resulting in a reduced user experience. Summary of the Invention

[0003] The embodiment of the present invention provides a method for synchronous playback of a master and a slave playback device, a slave playback device, and a playback system, which can enable the master playback device and the slave playback device to synchronously play the same audio data.

[0004] In a first aspect, an embodiment of the present invention provides a method for synchronous playback of a master and a slave playback device, comprising:

[0005] The slave playback device determines a second sample point number and a second corresponding time upon receiving an indication message including a first sample point number and a first corresponding time sent by the master playback device; wherein the first sample point number is the number of sample points that have been played in the data currently being played by the master playback device, and the second sample point number is the number of sample points that have been played in the data currently being played by the slave playback device;

[0006] The slave playback device determines an initial time deviation according to the first number of sample points and the first corresponding time, and the second number of sample points and the second corresponding time;

[0007] When the initial time deviation is not zero, the slave playback device adjusts the current first playback rate according to the initial time deviation;

[0008] When determining that the adjustment is completed, the slave playback device controls the adjusted first playback rate, so that the master playback device and the slave playback device perform synchronous playback at the same playback rate.

[0009] In a second aspect, an embodiment of the present invention provides a slave playback device, including:

[0010] a memory for storing program instructions;

[0011] The processor is configured to call the program instructions stored in the memory and execute the above method provided by the embodiment of the present invention according to the obtained program.

[0012] In a third aspect, an embodiment of the present invention provides a playback system, comprising: a master playback device, and the slave playback device provided by the embodiment of the present invention;

[0013] The master playback device is configured to: send an indication message including a first sample point number and a first corresponding time to the slave playback device;

[0014] The slave playback device is configured to control the master playback device and the slave playback device to play synchronously at the same playback rate upon receiving the instruction message.

[0015] The beneficial effects of the present invention are as follows:

[0016] An embodiment of the present invention provides a method for synchronous playback of a master and slave playback devices, a slave playback device, and a playback system. When it is determined that the initial time deviation is not zero, it can be considered that the master playback device and the slave playback device are not playing synchronously. At this time, the slave playback device can adjust the current first playback rate according to the initial time deviation, and when it is determined that the adjustment is complete, the first playback rate of the slave playback device is controlled so that the master playback device and the slave playback device both play the same data synchronously at the same playback rate. That is, with the time deviation as a reference, the first playback rate of the slave playback device is adjusted so that the time deviation of the master and slave playback devices can be controlled within a sample point, achieving more precise adjustment, so that the master and slave playback devices can effectively play synchronously. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 A flowchart of a method for synchronous playback between master and slave playback devices provided in an embodiment of the present invention;

[0018] Figure 2 A schematic diagram of the number of sample points and corresponding time provided in an embodiment of the present invention;

[0019] Figure 3 A schematic diagram of collecting a first number of sample points and a second number of sample points provided in an embodiment of the present invention;

[0020] Figure 4 A schematic structural diagram of a slave playback device provided in an embodiment of the present invention;

[0021] Figure 5 The figure is a schematic structural diagram of a playback system provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0022] The following, in conjunction with the accompanying drawings, describes in detail the specific implementation methods of a method for synchronized playback between master and slave playback devices, a slave playback device, and a playback system provided by an embodiment of the present invention. It should be noted that the described embodiments are only some of the embodiments of the present invention, and not all of them. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort are intended to fall within the scope of protection of the present invention.

[0023] The inventors discovered in their research that when a master and slave playback devices play the same audio data, the playback of the slave playback device may slow down or speed up due to certain reasons, thereby causing the master and slave playback devices to be unable to play synchronously.

[0024] To solve this problem, the slave playback device can calculate the sample point deviation between itself and the master playback device, and adjust its own playback rate based on the sample point deviation so that the sample point deviation is zero, thereby achieving the purpose of synchronous playback.

[0025] However, this method is based on sample point deviation for adjustment, and the sample point values are discrete and have limited accuracy, making the effect of the adjustment less than ideal. That is, only when there is at least one sample point difference between the master and slave playback devices can it be determined that the master and slave playback devices are out of synchronization and misalignment.

[0026] For example, taking a sampling rate of 48k, the playback time of a sample point is 20.8us. That is, the synchronization deviation between the master and slave playback devices must reach more than 20.8us before it can be determined that the master and slave playback devices are out of synchronization.

[0027] Therefore, this method makes it impossible for the master and slave playback devices to achieve accurate and effective synchronous playback.

[0028] Based on this, an embodiment of the present invention provides a method for synchronous playback of master and slave playback devices, which is used to more accurately and effectively achieve synchronous playback of master and slave playback devices.

[0029] Specifically, an embodiment of the present invention provides a method for synchronous playback of a master and a slave playback device, such as Figure 1 As shown, this may include:

[0030] S101: Upon receiving an indication message including a first sample point number and a first corresponding time sent by a master playback device, a slave playback device determines a second sample point number and a second corresponding time; wherein the first sample point number is the number of sample points already played in data currently being played by the master playback device, and the second sample point number is the number of sample points already played in data currently being played by the slave playback device;

[0031] Specifically, the master playback device and the slave playback device mentioned in the embodiment of the present invention can both be devices that can play audio, such as speakers or headphones. The specific forms of the master and slave playback devices are not limited here.

[0032] Specifically, the data played in the embodiment of the present invention may be audio data or non-audio data. Non-audio data may be, for example but not limited to, data corresponding to the time to be played, etc., which is not limited here.

[0033] Specifically, for the main playback device, taking the playback of audio data as an example, when obtaining the first sample point number and the first corresponding time, the following method can be used:

[0034] When new audio data is received, a first sample point number and a first corresponding time are determined.

[0035] Furthermore, for the main playback device, assuming that audio data A is currently being played, and the audio data from the slave playback device is forwarded to the main playback device, then:

[0036] Upon receiving audio data B, determining the number of sample points (i.e., the first sample point number) played in audio data A and the first corresponding time;

[0037] Adding the determined first sample point number, the first corresponding time, and the current second playback rate to the header information of the audio data B to form audio data B';

[0038] The instruction message including the audio data B' is sent to the slave playback device.

[0039] It should be noted that, for the master playback device, an indication message is immediately sent to the slave playback device when the first sample point number is determined, so as to avoid a long delay between the time when the first sample point number is determined and the time when the indication message is sent. This is conducive to ensuring that the time deviation between the master and slave playback devices can be controlled within one sample point, and thus is conducive to achieving precise adjustment.

[0040] For the slave playback device, assuming that audio data A is also currently being played, then:

[0041] Upon receiving the instruction message, determining the number of sample points (i.e., the second number of sample points) played in the audio data A and the second corresponding time;

[0042] Extracting the audio data B, the first sample point number and the first corresponding time, and the current second playback rate of the main playback device from the instruction message;

[0043] Afterwards, based on S102 to S104 introduced in the subsequent content, the master and slave playback devices can play audio data B synchronously; if the master and slave playback devices have not finished playing audio data A when the adjustment of the slave playback device is completed, the master and slave playback devices will continue to play audio data A synchronously, and then play audio data B synchronously.

[0044] To clarify, the data to be played may include multiple sample points, and the sample points are played one by one. The number of sample points is discrete, while the time is continuous, and each time a sample point is played, it corresponds to a time. It should be noted that the sample point mentioned in the embodiments of the present invention refers to: the smallest unit of data processed in the playback device. For example, if it is audio data, it refers to the smallest audio data unit sent to the encoder or decoder in a mono or multi-channel audio system; if it is video data, it refers to an independent frame of data that can be decoded.

[0045] like Figure 2 As shown in the figure, the numbers "0" to "8" in the figure respectively represent the number of sample points that have been played, and t0 to t8 respectively represent the time corresponding to each sample point that has been played. When the sampling rate is 48k, the playback time of each sample point (represented by T0 in the figure) can be 20.8us.

[0046] and, Figure 2 In the figure, only 8 sample points are used as an example for explanation, but this does not mean that the actual data only includes 8 sample points. In actual situations, the number of sample points included in the data is not limited to this.

[0047] S102: The playback device determines an initial time offset based on the first number of sample points and the first corresponding time, and the second number of sample points and the second corresponding time;

[0048] S103: When the initial time deviation is not zero, the slave playback device adjusts the current first playback rate according to the initial time deviation;

[0049] S104: When determining that the adjustment is completed, the slave playback device controls the adjusted first playback rate, so that the master playback device and the slave playback device play synchronously at the same playback rate.

[0050] In this way, when it is determined that the initial time deviation is not zero, it can be considered that the master playback device and the slave playback device are not playing synchronously. At this time, the slave playback device can adjust the current first playback rate according to the initial time deviation, and when it is determined that the adjustment is completed, the first playback rate of the slave playback device is controlled, so that the master playback device and the slave playback device both play the same data synchronously at the same playback rate. That is, with the time deviation as a reference, the first playback rate of the slave playback device is adjusted, so that the time deviation of the master and slave playback devices can be controlled within a sample point, achieving more precise adjustment, so that the master and slave playback devices can effectively play synchronously.

[0051] Optionally, in the embodiment of the present invention, the second corresponding time is: the time corresponding to when the number of sample points played in the data currently played by the playback device is the second number of sample points;

[0052] The first corresponding time is: the time corresponding to when the number of sample points played in the data currently played by the main playback device is the first number of sample points.

[0053] That is, for the slave playback device, upon receiving the indication message from the playback device, it determines whether the number of sample points has changed, i.e., the receipt of the indication message is used as a trigger condition for the determination, and the determination is performed immediately upon receiving the indication message;

[0054] If a change is detected, the time of the change is immediately collected; that is, the change in the number of sample points is used as the trigger condition for collecting time;

[0055] The changed number of sample points is used as the second number of sample points, and the collected time is used as the second corresponding time.

[0056] Similarly, for the main playback device, when receiving new data, it determines whether the number of sample points has changed, that is, it uses the receipt of new data as a trigger condition for judgment, and makes a judgment immediately as soon as new data is received;

[0057] If a change is detected, the time of the change is immediately collected; that is, the change in the number of sample points is used as the trigger condition for collecting time;

[0058] The changed number of sample points is used as the first number of sample points, and the collected time is used as the first corresponding time.

[0059] In this way, the determined first number of sample points and the first corresponding time are closely bound, and the second number of sample points and the second corresponding time are also closely bound, thereby eliminating the discrete error of the sample points and improving the accuracy of adjustment.

[0060] Specifically, in an embodiment of the present invention, the difference between the first sample point number and the second sample point number can be 1, that is: when the master playback device determines the first sample point number and the first corresponding time, it can send an indication message to the slave playback device, so that the slave playback device can determine the second sample point number and the second corresponding time when receiving the indication message. Therefore, the difference between the first sample point number and the second sample point number can be very small, that is, it can be 1, so that after adjusting the current first playback rate of the slave playback device based on this, the time deviation of the master and slave playback devices can be controlled within one sample point, achieving more precise adjustment, so that the master and slave playback devices can effectively play synchronously.

[0061] Of course, in specific implementations, in order to achieve higher accuracy and control the deviation within the microsecond level, the difference between the first sample point number and the second sample point number can be determined according to actual conditions and is not limited here.

[0062] Specifically, in the embodiment of the present invention, whether the master playback device collects the first sample points and the first corresponding time, or the slave playback device collects the second sample points and the second corresponding time, the collection method can be implemented by software or hardware;

[0063] Among them, when implemented by software, the number of sample points can be read cyclically to determine whether there is a change, and the time can be read immediately when a change occurs, so as to complete the acquisition;

[0064] When implemented through hardware, the number of sample points can be read cyclically to determine whether it has changed. When the number of sample points changes, the number of sample points and the current time are latched to complete the acquisition.

[0065] Of course, in specific implementation, it can be implemented through software or hardware according to actual needs, and is not limited here.

[0066] Optionally, in this embodiment of the present invention, the following may also be included:

[0067] When the secondary playback device determines that the initial time deviation is zero, it maintains the current first playback rate unchanged.

[0068] In this way, when it is determined that the initial time deviation is zero, it means that the playback of the master and slave playback devices is in a synchronized state, and there is no need to adjust the first playback rate of the slave playback device, so playback can continue at the current first playback rate, so that the master and slave playback devices continue to play synchronously.

[0069] Optionally, in the embodiment of the present invention, when it is determined that the adjustment is completed, controlling the adjusted first playback rate specifically includes:

[0070] When the instruction message further includes the current second playback rate of the primary playback device and it is determined that the adjustment is completed, determining the current second playback rate of the primary playback device according to the instruction message;

[0071] The adjusted first playback rate is further adjusted to the current second playback rate.

[0072] When the slave playback device completes adjusting the first playback rate, it is necessary to control the adjusted first playback rate. The reason for doing so is:

[0073] If the slave playback device does not adjust the adjusted first playback rate to the current second playback rate of the master playback device when the adjustment is completed, then:

[0074] If the first playback rate of the slave device is lower than the current second playback rate of the master device, even though the adjustment has been completed before, after a certain period of playback, the master and slave devices will still play out of sync, and the slave device will play slower than the master device;

[0075] Alternatively, if the first playback rate of the slave device is higher than the current second playback rate of the master device, even though the adjustment has been completed before, after a certain period of playback, the master and slave devices will still play out of sync, and the slave device will play faster than the master device.

[0076] Therefore, when the adjustment is completed, the slave playback device needs to adjust the first playback rate to the current second playback rate of the master playback device, so that both the master and slave playback devices play at the current second playback rate to achieve synchronous playback.

[0077] Optionally, in the embodiment of the present invention, determining the initial time offset according to the first number of sample points and the first corresponding time, and the second number of sample points and the second corresponding time, specifically includes:

[0078] The initial time deviation is determined using the following formula:

[0079] Δt=(sm) / Sr-(t s -t m );

[0080] Where Δt represents the initial time deviation, m represents the first sample point number, s represents the second sample point number, Sr represents the current first playback rate of the playback device, t m Indicates the first corresponding time, t s Indicates the second corresponding time.

[0081] For example, Figure 3 As shown, the main playback device collects (i.e. Figure 3The middle dashed line 1 can represent the acquisition time of the main playback device) The first sample point number is m, and the first corresponding time is t m , collected from the playback device (ie Figure 3 The middle dashed line 2 may represent the second sample point number s from the acquisition moment of the playback device, and the second corresponding time is t s ; where t s Greater than t m , s is greater than m; then:

[0082] When the first playback rate of the slave playback device is the same as the current second playback rate of the master playback device, the calculated Δt is 0, indicating that the master and slave playback devices are currently in a synchronized playback state, and there is no playback lag or playback advance on the slave playback device;

[0083] When the first playback rate of the slave playback device is different from the current second playback rate of the master playback device, the calculated Δt is not equal to 0, indicating that the master and slave playback devices are currently in an asynchronous playback state, and the slave playback device has a playback lag or playback advance, and the first playback rate of the slave playback device needs to be adjusted.

[0084] Optionally, in the embodiment of the present invention, adjusting the current playback rate according to the initial time deviation specifically includes:

[0085] When the initial time deviation is greater than zero, the current first playback rate is reduced; or when the initial time deviation is less than zero, the current first playback rate is increased;

[0086] The adjustment result is monitored according to a preset monitoring cycle, and when it is determined that the adjustment is not completed according to the adjustment result, the adjusted first playback rate is continuously adjusted according to the adjustment result until it is determined that the adjustment is completed.

[0087] Specifically, when reducing or increasing the current first playback rate, the specific reduction value or increase value can be set according to a preset adjustment step, or can be set arbitrarily according to experience, needs and adjustment efficiency, and is not limited here.

[0088] That is, firstly, the current first playback rate is adjusted based on the initial time deviation, then the adjustment result is monitored based on the monitoring period, and whether the adjustment is completed is determined according to the adjustment, and the adjustment is continued when the adjustment is not completed.

[0089] The reason for this setting is:

[0090] It takes a certain amount of time for the playback device to adjust the first playback rate;

[0091] At a certain moment (which can be represented by tx), the slave playback device determines an initial time offset (represented by Δt). Assuming that the time interval between two consecutive instruction messages sent by the master playback device is represented by Tb, then before the moment tx+Tb, the slave playback device may have been synchronized and aligned with the master playback device. In this case, there is no need to increase or decrease the first playback rate to avoid increasing the time offset fluctuation between the master and slave playback devices.

[0092] Therefore, the adjustment results need to be monitored. When it is determined that the adjustment has been completed based on the adjustment results, no further adjustment is required to avoid time deviation occurring again during further adjustment, thereby effectively reducing the time deviation fluctuation between the master and slave playback devices.

[0093] Specifically, in the embodiment of the present invention, the monitoring period is shorter than the time interval between two consecutive transmissions of indication messages by the main playback device.

[0094] Wherein, when the monitoring period is represented by Tc and the time interval between two consecutive transmissions of the indication message by the main playback device is represented by Tb, Tc is smaller than Tb.

[0095] In addition, Tc can be set to a smaller value, so that monitoring can be done once in a short period of time, shortening the interval between monitoring, and then quickly monitoring the adjustment results. When the adjustment is determined to be complete, no further adjustment is made based on the initial time deviation, thereby effectively reducing the fluctuation of the time deviation between the master and slave playback devices and achieving the purpose of fast and effective synchronous playback.

[0096] Specifically, the time interval between two consecutive indication messages sent by the main playback device is not a fixed value but may vary randomly. Therefore, in order to achieve effective monitoring, an empirical range of the time interval may be determined based on experience, and then the size of the monitoring period may be determined based on the empirical range.

[0097] It should be noted that if the slave playback device has not completed the adjustment when receiving the next instruction message sent by the master playback device, the slave playback device will:

[0098] It is necessary to re-collect the second sample points and the second corresponding time;

[0099] Recalculating the initial time offset according to the first number of sample points and the first corresponding time in the received new indication message and the recollected second number of sample points and the first corresponding time;

[0100] Adjustment is performed based on the recalculated initial time offset, that is, the above S103 and S104 are executed again based on the recalculated initial time offset.

[0101] Optionally, in the embodiment of the present invention, monitoring the adjustment result according to a preset monitoring period specifically includes:

[0102] When the indication message further includes the current second playback rate of the primary playback device and the monitoring period is reached, determining the adjusted time offset based on the adjusted first playback rate, the current second playback rate, and the monitoring period;

[0103] Compare the adjusted time deviation with the initial time deviation to determine the adjustment result.

[0104] That is to say, when the monitoring cycle is reached, it is possible to determine how much the time deviation has been adjusted. At this time, it can be compared with the initial time deviation to determine the result of this adjustment, so as to facilitate the subsequent determination of whether the adjustment is complete, avoid the deviation between the master and slave playback devices fluctuating back and forth, and facilitate fast and effective synchronous playback.

[0105] Optionally, in the embodiment of the present invention, determining whether the adjustment is completed according to the adjustment result specifically includes:

[0106] Determine whether the adjusted time deviation is equal to the initial time deviation;

[0107] If not, it is determined that the adjustment is not completed;

[0108] If so, the adjustment is completed.

[0109] That is to say, when the adjusted time deviation is equal to the initial time deviation, it means that the initial time deviation originally determined has been adjusted, and there is no time deviation between the current master and slave playback devices. Therefore, it can be considered that the adjustment is complete and no further adjustment is required based on the adjustment result, thereby avoiding larger deviation fluctuations.

[0110] Optionally, in the embodiment of the present invention, when it is determined that the adjustment is not completed according to the adjustment result, the adjusted first playback rate is further adjusted according to the adjustment result, specifically including:

[0111] If the absolute value of the adjusted time deviation is greater than the absolute value of the initial time deviation, reducing the adjusted first playback rate;

[0112] If the absolute value of the adjusted time deviation is smaller than the absolute value of the initial time deviation, the adjusted first playback rate is maintained or increased.

[0113] That is, when the absolute value of the adjusted time deviation is greater than the absolute value of the initial time deviation, it means that the time has been adjusted too much, so it needs to be adjusted back, and then the adjusted first playback rate needs to be reduced;

[0114] When the absolute value of the adjusted time deviation is less than the absolute value of the initial time deviation, it means that the adjustment is not complete. There is still a certain time deviation between the master and slave playback devices, and further adjustment is needed. Therefore, at this time, the adjustment can be continued according to the current first playback rate or increased to continue adjusting until the adjustment is completed.

[0115] The following examples illustrate this.

[0116] For example, assume that the interval between two consecutive indication messages sent by the main playback device is 5 seconds, the monitoring period can be set to 1 second, and 1 second is less than 5 seconds; if the initial time deviation △t is -900 us, and the current second playback rate of the main playback device is 20 pieces / s, and the second playback rate of the main playback device is always maintained at 20 pieces / s, and the playback time corresponding to each sample point is 20 us; then:

[0117] Since △t < 0, it means that the slave device is currently playing slowly (assuming that the slave device is currently playing at a first playback rate of 18 frames per second). Therefore, the first playback rate of the slave device needs to be increased to synchronize and align with the main device. Then, the first playback rate of the slave device can be increased to 30 frames per second.

[0118] When the first monitoring cycle arrives, that is, when the first 1s arrives, it is determined that the absolute value of the adjusted time deviation is 200us, which is 700us less than the absolute value of Δt. This indicates that the adjustment is not yet complete, that is, the slave playback device is still playing slower than the master playback device, and the absolute value of the adjusted time deviation is significantly different from the absolute value of the initial time deviation. Therefore, the first playback rate of the slave playback device can be further increased, that is, it can be increased to 40 / s. That is, the adjustment can be continued at the first playback rate of 40 / s.

[0119] When the second monitoring cycle arrives, that is, when the second 1s arrives, during the time period from the first monitoring cycle to the second monitoring cycle, when the slave playback device plays at the first playback rate of 40 frames / s, the absolute value of the adjusted time deviation is 400 us. Adding the 200 us adjusted in the first monitoring cycle, the current total absolute value of the adjusted time deviation is 600 us, which is 300 us less than the absolute value of Δt. This indicates that the adjustment is not yet complete, that is, the slave playback device is still playing slower than the master playback device, and adjustment can continue at the current first playback rate of 40 frames / s.

[0120] When the third monitoring cycle arrives, that is, when the third 1s arrives, during the time period from the second monitoring cycle to the third monitoring cycle, when the slave playback device plays at the first playback rate of 40 frames / s, the absolute value of the adjusted time deviation is 400 us. Adding the 600 us adjusted in the first two monitoring cycles, the current total absolute value of the adjusted time deviation is 1000 us, which is 100 us more than the absolute value of △t. This indicates that the current adjustment is too much, that is, the slave playback device plays faster than the master playback device, and the first playback rate of the slave playback device needs to be reduced, that is, from 40 frames / s to 15 frames / s, that is, continue to adjust at the first playback rate of 15 / s;

[0121] When the fourth monitoring cycle arrives, that is, when the fourth 1s arrives, during the time period from the third monitoring cycle to the fourth monitoring cycle, when playing from the playback device at the first playback rate of 15 / s, the absolute value of the adjusted time deviation is 100us. The 1000us adjusted in the first three monitoring cycles is subtracted from the current adjusted 100us, and the absolute value of the current adjusted time deviation is determined to be 900us, which is the same as the absolute value of △t, indicating that the adjustment has been completed, so it can be determined at this point that the adjustment is completed.

[0122] Moreover, there is still 1 second left before receiving the next indication message sent by the master playback device, so it can be considered that the adjustment has been completed before receiving the next indication message sent by the master playback device; at this time, the slave playback device can adjust the current first playback rate (i.e., 15 / s) back to the second playback rate (i.e., 20 / s) of the master playback device to continue playback. When the next indication message sent by the master playback device arrives, it can be determined that the playback of the master and slave playback devices has been synchronized and aligned.

[0123] It should be noted that, optionally, the second playback rate of the master playback device may vary, but the variation is generally small. Therefore, under the assumption that the second playback rate of the master playback device is constant, the slave playback device can adjust based on the constant second playback rate to achieve the purpose of synchronous playback.

[0124] Alternatively, the slave playback device may also make adjustments based on the current second playback rate included in the indication message, so that the synchronization is more accurate and effective.

[0125] It should also be noted that, in an embodiment of the present invention, when adjusting the first playback rate of the slave playback device, if the playback rate of the slave playback device differs greatly from the playback rate of the master playback device, a larger adjustment range can be used for adjustment (which can also be understood as coarse adjustment); if the playback rate of the slave playback device differs little from the playback rate of the master playback device, a smaller adjustment range can be used for adjustment (which can also be understood as fine adjustment), so as to quickly and effectively adjust the playback rate of the slave playback device and synchronize the playback of the master and slave playback devices.

[0126] Based on the same inventive concept, an embodiment of the present invention provides a slave playback device. The implementation principle of the slave playback device is similar to the implementation principle of the aforementioned method for synchronous playback of a master-slave playback device. The specific implementation method of the slave playback device can be found in the specific embodiment of the aforementioned method, and the repeated parts will not be repeated.

[0127] Specifically, an embodiment of the present invention provides a slave playback device, such as Figure 4 As shown, this may include:

[0128] Memory 401, used for storing program instructions;

[0129] The processor 402 is configured to call the program instructions stored in the memory 401 and execute the above method provided by the embodiment of the present invention according to the obtained program.

[0130] Based on the same inventive concept, an embodiment of the present invention provides a playback system, such as Figure 5 As shown, it may include: a main playback device 501, and the above-mentioned slave playback device 502 provided by the embodiment of the present invention;

[0131] The master playback device 501 is configured to: send an indication message including a first sample point number and a first corresponding time to the slave playback device 502;

[0132] The slave playback device 502 is used to control the master playback device 501 and the slave playback device 502 to play synchronously at the same playback rate when receiving the instruction message.

[0133] In the playback system, the number of slave playback devices may be at least one.

[0134] and, Figure 5 There are two slave playback devices 502 shown in the figure, but this does not mean that the actual playback system only includes two slave playback devices 502. Two slave playback devices 502 are used as an example for explanation here. The specific number of slave playback devices 502 can be set according to actual needs and is not limited here.

[0135] Optionally, in an embodiment of the invention, a method for obtaining the same data played by the master and slave playback devices may include:

[0136] Method 1:

[0137] Specifically, when the master playback device obtains data from the audio output device, it sends the obtained data to the slave playback device.

[0138] That is to say, the main playback device directly obtains data from the audio output device, and the data played by the slave playback device is forwarded by the main playback device.

[0139] Method 2:

[0140] Specifically, both the master and slave playback devices directly obtain data from the audio output device.

[0141] In other words, the data played from the playback device is not forwarded by the main playback device, but is directly obtained from the audio output device.

[0142] Of course, in actual situations, the method for obtaining the data played by the master and slave playback devices can be selected from the above-mentioned method 1 and method 2 according to actual needs, and is not limited here.

[0143] Optionally, in an embodiment of the present invention, when there are K1 (i.e., K1 is an integer greater than 1) slave playback devices and there are K2 (i.e., K2 is an integer greater than 1, and K2 is less than K1) slave playback devices that play asynchronously with the master playback device, for each of the K2 slave playback devices, the above-mentioned method provided in the embodiment of the present invention can be used to adjust their respective playback rates so that each slave playback device can achieve synchronous playback with the master playback device.

[0144] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.

Claims

1. A method for synchronous playback of master and slave playback devices, characterized in that: include: The slave playback device determines a second sample point number and a second corresponding time upon receiving an indication message including a first sample point number and a first corresponding time sent by the master playback device; wherein the first sample point number is the number of sample points that have been played in the data currently being played by the master playback device, and the second sample point number is the number of sample points that have been played in the data currently being played by the slave playback device; The slave playback device determines an initial time deviation according to the first number of sample points and the first corresponding time, and the second number of sample points and the second corresponding time; When the initial time deviation is not zero, the slave playback device adjusts the current first playback rate according to the initial time deviation; When determining that the adjustment is completed, the slave playback device controls the adjusted first playback rate so that: the master playback device and the slave playback device play synchronously at the same playback rate; Determining the initial time deviation according to the first number of sample points and the first corresponding time, and the second number of sample points and the second corresponding time, includes: The initial time deviation is determined using the following formula: Δt=(s-m) / Sr-(t s -t m ); Wherein, Δt represents the initial time deviation, m represents the first sample point number, s represents the second sample point number, Sr represents the current first playback rate of the slave playback device, t m represents the first corresponding time, t s Indicates the second corresponding time.

2. The method according to claim 1, wherein The second corresponding time is: the time corresponding to when the number of sample points played in the data currently played by the playback device is the second number of sample points; The first corresponding time is: the time corresponding to when the number of sample points played in the data currently played by the main playback device is the first number of sample points.

3. The method according to claim 1, wherein Adjusting the current first playback rate according to the initial time deviation specifically includes: When the initial time deviation is greater than zero, reducing the current first playback rate; or when the initial time deviation is less than zero, increasing the current first playback rate; The adjustment result is monitored according to a preset monitoring period, and when it is determined that the adjustment is not completed according to the adjustment result, the adjusted first playback rate is continuously adjusted according to the adjustment result until it is determined that the adjustment is completed.

4. The method according to claim 3, wherein Monitor the adjustment results according to the preset monitoring cycle, including: When the indication message further includes the current second playback rate of the primary playback device and the monitoring period is reached, determining the adjusted time offset based on the adjusted first playback rate, the current second playback rate, and the monitoring period; The adjusted time offset is compared with the initial time offset to determine the adjustment result.

5. The method according to claim 4, wherein Determining whether the adjustment is complete based on the adjustment results includes: Determining whether the adjusted time offset is equal to the initial time offset; If not, it is determined that the adjustment is not completed; If so, the adjustment is completed.

6. The method according to claim 4, wherein When it is determined that the adjustment is not completed according to the adjustment result, the adjusted first playback rate is further adjusted according to the adjustment result, specifically including: If the absolute value of the adjusted time deviation is greater than the absolute value of the initial time deviation, reducing the adjusted first playback rate; If the absolute value of the adjusted time offset is smaller than the absolute value of the initial time offset, the adjusted first playback rate is maintained or increased.

7. The method according to any one of claims 3 to 6, wherein: The monitoring period is smaller than the time interval between two consecutive transmissions of the indication message by the main playback device.

8. The method according to claim 1, wherein When it is determined that the adjustment is completed, the adjusted first playback rate is controlled, specifically including: When the indication message further includes the current second playback rate of the primary playback device and it is determined that the adjustment is completed, determining the current second playback rate of the primary playback device according to the indication message; The adjusted first playback rate is further adjusted to the current second playback rate.

9. A slave playback device, characterized in that: include: a memory for storing program instructions; A processor is configured to call the program instructions stored in the memory and execute the method according to any one of claims 1 to 8 according to the obtained program.

10. A playback system, characterized in that: comprising: a master playback device, and a slave playback device as claimed in claim 9; The master playback device is configured to: send an indication message including a first sample point number and a first corresponding time to the slave playback device; The slave playback device is configured to control the master playback device and the slave playback device to play synchronously at the same playback rate upon receiving the instruction message.

Citation Information

Patent Citations

  • Multi-device synchronous playing method and system, electronic device and storage medium

    CN111405336A