技术领域technical field
本发明涉及同步播放技术领域,具体涉及一种时钟调节方法、装置、终端及多媒体同步播放系统。The invention relates to the technical field of synchronous playback, in particular to a clock adjustment method, device, terminal and multimedia synchronous playback system.
背景技术Background technique
随着生活水平的提高,家庭影音设备在人们的生活中扮演着重要的角色。当前,将多个多媒体播放设备(例如,音箱、播放器等)以及控制设备通过有线或无线网络互相连接,组成一个多媒体播放系统,同步播放相同的多媒体如音乐,已经得到广泛的应用。With the improvement of living standards, home audio-visual equipment plays an important role in people's lives. At present, it has been widely used to connect multiple multimedia playback devices (for example, speakers, players, etc.) and control devices to each other through a wired or wireless network to form a multimedia playback system, and to play the same multimedia such as music synchronously.
上述多媒体播放系统中,每个多媒体播放设备都具有独立的时钟系统。各个播放设备根据其自身的时钟系统来播放多媒体。然而,各个多媒体播放设备以及参考设备(一般为控制设备)的时钟系统并不总是同步的。各个播放设备以及参考设备彼此之间可能存在细微的时差。当多个多媒体播放设备播放相同的多媒体如音乐时,上述细微的时差导致各个多媒体播放设备的播放进度不一致,由此造成提高多媒体播放设备之间播放多媒体的同步性比较低。In the above multimedia playing system, each multimedia playing device has an independent clock system. Each playback device plays multimedia according to its own clock system. However, the clock systems of various multimedia playback devices and reference devices (generally control devices) are not always synchronized. There may be slight time differences between playback devices and reference devices. When multiple multimedia playback devices play the same multimedia such as music, the above-mentioned slight time difference leads to inconsistencies in the playback progress of each multimedia playback device, thus resulting in relatively low synchronization between multimedia playback devices.
发明内容Contents of the invention
本发明实施例提供一种时钟调节方法、装置、终端及多媒体同步播放系统,可以提高多媒体播放设备之间播放多媒体的同步性。Embodiments of the present invention provide a clock adjustment method, device, terminal and multimedia synchronous playback system, which can improve the synchronization of multimedia playback between multimedia playback devices.
本发明实施例提供一种时钟调节方法,包括:An embodiment of the present invention provides a clock adjustment method, including:
在播放多媒体数据的过程中,获取自身系统时钟与同步参考播放设备的系统时钟之间的时间误差;In the process of playing multimedia data, obtain the time error between the self system clock and the system clock of the synchronous reference playback device;
根据所述时间误差确定进行同步调节的调节信息进行同步调节的调节信息;determining the adjustment information for synchronous adjustment according to the time error;
检测当前是否有声音输出;Detect whether there is currently sound output;
若否,则根据所述调节信息对自身系统时钟进行调节,以使得所述时间误差为零。If not, adjust the own system clock according to the adjustment information, so that the time error is zero.
相应的,本发明实施例还提供一种时钟调节装置,包括:Correspondingly, an embodiment of the present invention also provides a clock adjustment device, including:
获取单元,用于在播放多媒体数据的过程中,获取自身系统时钟与同步参考播放设备的系统时钟之间的时间误差;The acquisition unit is used to acquire the time error between its own system clock and the system clock of the synchronous reference playback device during the process of playing multimedia data;
确定单元,用于根据所述时间误差确定进行同步调节的调节信息进行同步调节的调节信息;a determining unit, configured to determine, according to the time error, adjustment information for synchronous adjustment and adjustment information for synchronous adjustment;
第一检测单元,用于检测当前是否有声音输出;The first detection unit is used to detect whether there is sound output at present;
调节单元,用于在第一检测单元检测当前没有声音输出时,根据所述调节信息对自身系统时钟进行调节,以使得所述时间误差为零。The adjustment unit is configured to adjust the own system clock according to the adjustment information when the first detection unit detects that there is currently no sound output, so that the time error is zero.
相应的,本发明实施例还提供一种终端,包括:Correspondingly, the embodiment of the present invention also provides a terminal, including:
存储有可执行程序代码的存储器;a memory storing executable program code;
与所述存储器耦合的处理器;a processor coupled to the memory;
所述处理器调用所述存储器中存储的所述可执行程序代码,执行本发明实施例提供的任一多媒体同步播放方法。The processor invokes the executable program code stored in the memory to execute any multimedia synchronous playing method provided by the embodiments of the present invention.
相应的,本发明实施例还提供了一种多媒体同步播放系统,包括:控制设备和至少一个播放设备;所述控制设备与所述播放设备连接;所述播放设备用于执行本发明实施例提供的任一多媒体同步播放方法。Correspondingly, an embodiment of the present invention also provides a multimedia synchronous playback system, including: a control device and at least one playback device; the control device is connected to the playback device; Any multimedia synchronous playback method.
本发明实施例采用在播放多媒体数据的过程中,获取自身系统时钟与同步参考播放设备的系统时钟之间的时间误差,然后,根据该时间误差确定进行同步调节的调节信息进行同步调节的调节信息,检测当前是否有声音输出,若否,则根据该调节信息对自身系统时钟进行调节,以使得该时间误差为零。该方案可以多媒体播放过程中,且没有声音输出时对自身系统时钟进行调节,以使得自身系统时钟与同步参考播放设备的系统时钟同步,进而达到多个播放设备同步播放多媒体的效果,相对于现有技术而言,可以提高多媒体播放设备之间播放多媒体的同步性。In the embodiment of the present invention, during the process of playing multimedia data, the time error between its own system clock and the system clock of the synchronous reference playback device is obtained, and then the adjustment information for synchronous adjustment is determined according to the time error. , to detect whether there is sound output at present, and if not, adjust the own system clock according to the adjustment information so that the time error is zero. This solution can adjust its own system clock during multimedia playback and when there is no sound output, so that its own system clock is synchronized with the system clock of the synchronization reference playback device, thereby achieving the effect of multiple playback devices playing multimedia synchronously. Technically, the synchronization of playing multimedia between multimedia playing devices can be improved.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍。显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present invention more clearly, the following will briefly introduce the drawings that need to be used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to these drawings without creative work.
图1是本发明实施例一提供的时钟调节方法的流程示意图。FIG. 1 is a schematic flowchart of a clock adjustment method provided by Embodiment 1 of the present invention.
图2是本发明实施例二提供的时钟调节方法的流程示意图。FIG. 2 is a schematic flowchart of a clock adjustment method provided by Embodiment 2 of the present invention.
图3是本发明实施例三提供的第一种时钟调节装置的结构示意图。FIG. 3 is a schematic structural diagram of a first clock adjusting device provided in Embodiment 3 of the present invention.
图4是本发明实施例三提供的第二种时钟调节装置的结构示意图。FIG. 4 is a schematic structural diagram of a second clock adjustment device provided by Embodiment 3 of the present invention.
图5是本发明实施例三提供的第三种时钟调节装置的结构示意图。FIG. 5 is a schematic structural diagram of a third clock adjustment device provided by Embodiment 3 of the present invention.
图6是本发明实施例四提供的多媒体同步播放系统的场景示意图。FIG. 6 is a schematic diagram of a scene of a multimedia synchronous playback system provided by Embodiment 4 of the present invention.
图7是本发明实施例五提供的终端的结构示意图。FIG. 7 is a schematic structural diagram of a terminal provided in Embodiment 5 of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Apparently, the described embodiments are only some of the embodiments of the present invention, but not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts fall within the protection scope of the present invention.
本发明的说明书和权利要求书以及上述附图中的术语“第一”、“第二”、“第三”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应当理解,这样描述的对象在适当情况下可以互换。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含。例如,包含了一系列步骤的过程、方法或包含了一系列模块或单元的装置、终端、系统不必限于清楚地列出的那些步骤或模块或单元,还可以包括没有清楚地列出的步骤或模块或单元,也可以包括对于这些过程、方法、装置、终端或系统固有的其它步骤或模块或单元。The terms "first", "second", "third", etc. (if any) in the description and claims of the present invention and the above drawings are used to distinguish similar objects and not necessarily to describe a specific order or sequentially. It should be understood that the items so described are interchangeable under appropriate circumstances. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, a method comprising a series of steps, or a device, a terminal, a system comprising a series of modules or units are not necessarily limited to those steps or modules or units clearly listed, and may also include steps or units not clearly listed. A module or unit may also include other steps or modules or units inherent to these processes, methods, apparatuses, terminals or systems.
本发明实施例提供一种时钟调节方法、装置、终端及多媒体同步播放系统,以下将分别进行详细说明。Embodiments of the present invention provide a clock adjustment method, device, terminal, and multimedia synchronous playback system, which will be described in detail below.
实施例一Embodiment one
本实施例将从时钟调节装置的角度进行描述该时钟调节装置具体可以集成播放设备中,该播放设备可以为终端(智能手机、平板电脑等)、音箱等播放设备。This embodiment will be described from the perspective of the clock adjustment device. The clock adjustment device may be integrated into a playback device, which may be a playback device such as a terminal (smart phone, tablet computer, etc.), speaker, or the like.
一种时钟调节方法,包括:在播放多媒体数据的过程中,获取自身系统时钟与同步参考播放设备的系统时钟之间的时间误差,然后,根据该时间误差确定进行同步调节的调节信息,检测当前是否有声音输出,若否,则根据该调节信息对自身系统时钟进行调节,以使得该时间误差为零。A clock adjustment method, comprising: in the process of playing multimedia data, obtaining the time error between the own system clock and the system clock of the synchronous reference playback device, and then determining the adjustment information for synchronous adjustment according to the time error, and detecting the current Whether there is sound output, if not, then adjust the own system clock according to the adjustment information, so that the time error is zero.
如图1所示,该时钟调节方法,具体流程可以包括:As shown in Figure 1, the specific process of the clock adjustment method may include:
101、在播放多媒体数据的过程中,获取自身系统时钟与同步参考播放设备的系统时钟之间的时间误差。101. During the process of playing multimedia data, acquire a time error between the own system clock and the system clock of the synchronization reference playback device.
其中,该多媒体数据可以为音频数据、音视频数据等等。该音频数据包括但不限于CD、WAV、MP3(Moving Picture Experts Group Audio Layer III)、WMA(Windows MediaAudio)等格式的音频数据。Wherein, the multimedia data may be audio data, audio and video data, and so on. The audio data includes but not limited to CD, WAV, MP3 (Moving Picture Experts Group Audio Layer III), WMA (Windows Media Audio) and other formats.
本实施例中同步参考播放设备的系统时钟即为同步播放的参考时钟。该同步参考播放设备为同步播放的参考设备,其可以从播放设备中选定。在多媒体播放系统中控制设备也播放多媒体时,该控制设备也是播放设备,因此,该同步参考播放设备可以为播放设备,或者控制设备等。在实际应用中,可以根据实际需求从播放设备中选取一个设备作为参考设备。In this embodiment, the system clock of the synchronous reference playback device is the reference clock for synchronous playback. The synchronous reference playback device is a reference device for synchronous playback, which can be selected from playback devices. When the control device also plays multimedia in the multimedia playback system, the control device is also a playback device. Therefore, the synchronous reference playback device may be a playback device, or a control device. In practical applications, a device may be selected from the playback devices as a reference device according to actual needs.
具体地,步骤“获取自身系统时钟与同步参考播放设备的系统时钟之间的时间误差”可以包括:Specifically, the step of "obtaining the time error between the own system clock and the system clock of the synchronous reference playback device" may include:
获取同步参考播放设备当前的第一系统时间;Obtain the current first system time of the synchronous reference playback device;
获取自身当前的第二系统时间;Obtain the current second system time of itself;
根据第二系统时间和第一系统时间,获取自身系统时钟与同步参考播放设备的系统时钟之间的时间误差。According to the second system time and the first system time, the time error between the own system clock and the system clock of the synchronization reference playback device is acquired.
比如,可以计算第二系统时间与第一系统时间之间的时间差值,该时间差值即为系统时钟与参考时钟之间的时间误差;该第二系统时间与第一系统时间之间的时间差值指的是将第二系统时间减去第一系统时间得到的时间差值。For example, the time difference between the second system time and the first system time can be calculated, and the time difference is the time error between the system clock and the reference clock; the time difference between the second system time and the first system time The time difference refers to a time difference obtained by subtracting the second system time from the first system time.
在其他实施方式中,也可获取第一系统时间与第二系统时间的时间差值,即将第一系统时间减去第二系统时间得到的时间差值。In other implementation manners, a time difference between the first system time and the second system time may also be obtained, that is, a time difference obtained by subtracting the second system time from the first system time.
其中,获取参考设备当前的系统时间的方式可以有多种,比如,可以请求参考设备发送其当前的系统时间,也可以是参考设备主动推送。Among them, there are many ways to obtain the current system time of the reference device. For example, the reference device may be requested to send its current system time, or the reference device may actively push it.
102、根据该时间误差确定进行同步调节的调节信息。102. Determine adjustment information for synchronous adjustment according to the time error.
该调节信息可以为同步调节的调节参数,其可以包括:调节方向以及调节量,或者仅包括调节量。The adjustment information may be an adjustment parameter for synchronous adjustment, which may include: an adjustment direction and an adjustment amount, or only include an adjustment amount.
其中,调节方向可以包括正方向或者负方向,该正方向调节是加快系统时钟,负方向调节是减慢系统时钟。也可以是:负方向调节是加快系统时钟,正方向调节是减慢系统时钟;具体地可以根据实际需求设定。Wherein, the adjustment direction may include a positive direction or a negative direction, the positive direction adjustment is to speed up the system clock, and the negative direction adjustment is to slow down the system clock. It can also be: the adjustment in the negative direction is to speed up the system clock, and the adjustment in the positive direction is to slow down the system clock; specifically, it can be set according to actual needs.
具体地,在时间误差是自身当前时间与参考设备当前时间的时间差值,正方向调节是加快系统时钟,负方向调节是减慢系统时钟的情况下,若时间误差大于零,确定同步调节的调节方向为负方向,即需要减慢自身的系统时钟;若时间误差小于零,确定调节方向为正方向,即需要加快自身的系统时钟。Specifically, when the time error is the time difference between the current time of itself and the current time of the reference device, the adjustment in the positive direction is to speed up the system clock, and the adjustment in the negative direction is to slow down the system clock, if the time error is greater than zero, determine the synchronization adjustment If the adjustment direction is negative, it needs to slow down its own system clock; if the time error is less than zero, it is determined that the adjustment direction is positive, that is, it needs to speed up its own system clock.
其中,该调节量可为时间误差的绝对值,比如,时间误差为20ms时,调节量为20ms,时间误差为-30ms时,调节量为30ms。Wherein, the adjustment amount may be an absolute value of the time error, for example, when the time error is 20 ms, the adjustment amount is 20 ms, and when the time error is -30 ms, the adjustment amount is 30 ms.
103、检测当前是否有声音输出,若否,则执行步骤104,若否,则返回步骤103继续检测。103. Detect whether there is sound output at present, if not, execute step 104, if not, return to step 103 to continue detection.
本实施例中,可以实时或者动态地检测当前是否有声音输出。In this embodiment, whether there is currently sound output can be detected in real time or dynamically.
在实际同步播放过程中,没有声音输出的情况可以为切换曲目、暂停或是歌曲中停顿等等。In the actual synchronous playback process, the situation where there is no sound output may be switching tracks, pausing or pauses in the song, and so on.
本实施例中,检测当前是否有声音输出的方式可以有多种,比如可以基于输出信号的振幅来检测。In this embodiment, there may be multiple ways to detect whether there is currently sound output, for example, it may be detected based on the amplitude of the output signal.
具体地,可以根据输出信号振幅大小来确定是否有声音输出,比如,当输出信号的振幅小于预设振幅时,则可以认为当前没有声音输出,反之,若不小于预设振幅时,可以认为当前有声音输出。也即步骤“检测当前是否有声音输出”Specifically, whether there is sound output can be determined according to the amplitude of the output signal. For example, when the amplitude of the output signal is less than the preset amplitude, it can be considered that there is currently no sound output; otherwise, if it is not less than the preset amplitude, it can be considered that the current There is sound output. That is, the step "detect whether there is currently sound output"
判断当前播放输出的多媒体信号对应的振幅是否小于预设振幅;Judging whether the amplitude corresponding to the multimedia signal output by the current playback is smaller than the preset amplitude;
若是,则确定当前没有声音输出(如切换曲目、暂停或是歌曲中停顿);If so, determine that there is currently no sound output (such as switching tracks, pausing, or pauses in songs);
若否,则确定当前有声音输出。If not, it is determined that there is currently sound output.
该多媒体信号可以包括音频信号、图像信号等等。音频信号是(Audio)可以带有语音、音乐和音效的有规律的声波的频率、幅度变化信息载体。The multimedia signal may include an audio signal, an image signal, and the like. Audio signal is (Audio) frequency and amplitude change information carrier of regular sound waves that can carry voice, music and sound effects.
其中,多媒体信号的振幅可以为某个时间段内的平均振幅,如10ms内的平均振幅值,也可以为某个时刻的振幅,如起始时刻的振幅值;具体地,可以根据实际需求选定。Among them, the amplitude of the multimedia signal can be the average amplitude within a certain period of time, such as the average amplitude value within 10ms, or the amplitude at a certain moment, such as the amplitude value at the initial moment; specifically, it can be selected according to actual needs. Certainly.
本实施例中,预设振幅可以根据实际需求设定,比如,可以为0V、0.01V等等。In this embodiment, the preset amplitude can be set according to actual needs, for example, it can be 0V, 0.01V and so on.
应当理解的是:本实施例中检测是否有声音输出的方式不仅限于上述介绍的方式,还可以为其他方式,比如,检测播放的多媒体数据中是否有音频数据,若没有,则确定没有声音输出,如有,则确定有声音输出。It should be understood that: in this embodiment, the method of detecting whether there is sound output is not limited to the method described above, and can also be other methods, such as detecting whether there is audio data in the played multimedia data, and if not, then determine that there is no sound output , if yes, then confirm that there is sound output.
104、根据该调节信息对自身系统时钟进行调节,以使得该时间误差为零。104. Adjust the own system clock according to the adjustment information, so that the time error is zero.
具体地,可以根据调节方向和调节量对自身系统时钟进行调节。比如,按照调节方向将系统时钟调节一个调节量;如使自身系统时钟加快一个调节量,如加快10ms等。Specifically, the own system clock may be adjusted according to the adjustment direction and adjustment amount. For example, the system clock is adjusted by an adjustment amount according to the adjustment direction; for example, the own system clock is accelerated by an adjustment amount, such as by 10 ms.
例如,在时钟误差为10ms时,调节量可以为10ms,调节方向为负方向,那么可以按照负方向将自身系统时钟调节10ms,即使系统时钟减慢10ms。For example, when the clock error is 10ms, the adjustment amount can be 10ms, and the adjustment direction is the negative direction, then the own system clock can be adjusted by 10ms in the negative direction, even if the system clock is slowed down by 10ms.
可选地,为了避免一次性调节系统时钟降低多媒体输出品质,本实施例可以根据调节方向和调节量对自身系统时钟进行多次调节,以使得该时间误差为零。Optionally, in order to avoid a one-time adjustment of the system clock to reduce the multimedia output quality, this embodiment may adjust its own system clock multiple times according to the adjustment direction and adjustment amount, so that the time error is zero.
比如,可以根据调节量(此时为总调节量)、调节方向和预设调节量对系统时钟进行多次调节。预设调节量可以根据实际需求设定,比如,可以为10ms、20ms、1s等等。For example, the system clock can be adjusted multiple times according to the adjustment amount (in this case, the total adjustment amount), the adjustment direction, and the preset adjustment amount. The preset adjustment amount can be set according to actual needs, for example, it can be 10ms, 20ms, 1s and so on.
比如,时间误差为15ms,预设调节量为5ms时,可以先按照调节方向调节一个预设调节量5ms,然后间隔预设时间段之后再次按照调节方向调节一个预设调节量5ms,如此再经过三次调节后,即可使得时间误差为零。For example, when the time error is 15ms and the preset adjustment amount is 5ms, you can first adjust a preset adjustment amount for 5ms according to the adjustment direction, and then adjust a preset adjustment amount for 5ms according to the adjustment direction again after a preset period of time, and then after After three adjustments, the time error can be made zero.
可选地,为提高时钟调节的准确性,进而提高系统时钟与同步参考播放设备的系统时钟之间的同步性;本实施例可以每隔一定时长不断地获取系统时钟与参考时钟之间的时间误差,因此,在没有人声信号时,可以根据再次获取的时间误差更新调节信息(如调节方向和调节量)。也即本实施例方法还包括:在获取系统时钟与参考时钟之间的时间误差时,开始计时;Optionally, in order to improve the accuracy of clock adjustment, and then improve the synchronization between the system clock and the system clock of the synchronous reference playback device; this embodiment can continuously obtain the time between the system clock and the reference clock at regular intervals Therefore, when there is no human voice signal, the adjustment information (such as adjustment direction and adjustment amount) can be updated according to the time error acquired again. That is to say, the method in this embodiment further includes: when obtaining the time error between the system clock and the reference clock, start timing;
此时,在当前有声音输出时,判断当前计时时长是否大于预设时长;若是,则再次获取自身系统时钟与同步参考播放设备的系统时钟之间的时间误差,根据获取的时间误差更新该调节信息。At this time, when there is currently sound output, it is judged whether the current timing duration is greater than the preset duration; if so, the time error between the own system clock and the system clock of the synchronous reference playback device is obtained again, and the adjustment is updated according to the obtained time error information.
因此,本实施例可以不断循环地获取时间误差来刷新调节信息,提高了时钟调节的准确性以及及时性,进而提高了媒体播放的同步性。Therefore, in this embodiment, the time error can be acquired cyclically to refresh the adjustment information, which improves the accuracy and timeliness of clock adjustment, and further improves the synchronization of media playback.
可选地,为了能够准确地在没有声音输出时调节系统时钟,进而提高媒体播放的同步性以及媒体播放的品质,本实施例可以在检测当前没有声音输出之后,间隔一定时长,如1s、2s再次检测当前是否有声音输出,若没有,可认为当前真正没有声音输出,此时,可以对自身系统时钟进行调节。也即,本实施例方法,在检测当前没有声音输出之后,根据该调节信息对自身系统时钟进行调节之前,还可以包括:Optionally, in order to accurately adjust the system clock when there is no sound output, thereby improving the synchronization of media playback and the quality of media playback, this embodiment can detect that there is currently no sound output, and then set an interval for a certain period of time, such as 1s, 2s Check again whether there is sound output at present. If not, it can be considered that there is no sound output at present. At this time, you can adjust your own system clock. That is to say, the method of this embodiment may further include:
在间隔预设时长后,再次检测当前是否有声音输出;After a preset interval, check again whether there is sound output;
若否,则执行根据该调节信息对自身系统时钟进行调节的步骤。If not, execute the step of adjusting the own system clock according to the adjustment information.
其中,预设时长可以根据实际需求设定,如200ms、5s等等。Wherein, the preset duration can be set according to actual needs, such as 200ms, 5s and so on.
可选地,为节省资源,可以在时间误差很小的时,不进行同步调节,在实际误差达到一定值时才进行同步调节。也即在步骤“获取时间误差”之后,步骤“根据该时间误差确定进行同步调节的调节信息进行同步调节的调节信息”之前,该时钟调节方法还包括:判断该时钟误差的绝对值是否大于预设阈值;Optionally, in order to save resources, the synchronization adjustment may not be performed when the time error is small, and the synchronization adjustment may be performed only when the actual error reaches a certain value. That is, after the step "obtaining the time error" and before the step "determining the adjustment information for synchronous adjustment according to the time error", the clock adjustment method further includes: judging whether the absolute value of the clock error is greater than the preset set threshold;
若是,则执行根据该时间误差确定进行同步调节的调节信息进行同步调节的调节信息的步骤。If yes, the step of determining adjustment information for synchronous adjustment according to the time error is performed.
其中预设阈值可以根据用户对同步误差的忍耐度来设定,比如,可以为10ms、20ms等等。The preset threshold can be set according to the user's tolerance for synchronization errors, for example, it can be 10ms, 20ms and so on.
由上可知,本发明实施例采用在播放多媒体数据的过程中,获取自身系统时钟与同步参考播放设备的系统时钟之间的时间误差,然后,根据该时间误差确定进行同步调节的调节信息进行同步调节的调节信息,检测当前是否有声音输出,若否,则根据该调节信息对自身系统时钟进行调节,以使得该时间误差为零。该方案可以多媒体播放过程中,且没有声音输出时对自身系统时钟进行调节,以使得自身系统时钟与同步参考播放设备的系统时钟同步,进而达到多个播放设备同步播放多媒体的效果,相对于现有技术而言,可以提高多媒体播放设备之间播放多媒体的同步性。As can be seen from the above, the embodiment of the present invention uses the time error between its own system clock and the system clock of the synchronous reference playback device to obtain the time error between its own system clock and the system clock of the synchronous reference playback device in the process of playing multimedia data, and then determines the adjustment information for synchronous adjustment according to the time error to perform synchronization The adjusted adjustment information detects whether there is currently sound output, and if not, adjusts its own system clock according to the adjustment information so that the time error is zero. This solution can adjust its own system clock during multimedia playback and when there is no sound output, so that its own system clock is synchronized with the system clock of the synchronization reference playback device, thereby achieving the effect of multiple playback devices playing multimedia synchronously. Technically, the synchronization of playing multimedia between multimedia playing devices can be improved.
此外,本发明实施例可以在没有声音输出时对自身系统时钟进行同步调节,不易被用户感知,提高了多媒体播放的品质,大大提升了用户体验。In addition, the embodiment of the present invention can synchronously adjust its own system clock when there is no sound output, which is not easy to be perceived by the user, improves the quality of multimedia playback, and greatly improves user experience.
实施例二Embodiment two
根据实施例一所描述的时钟调节方法,以下将举例作进一步详细说明。According to the clock adjustment method described in Embodiment 1, an example will be given below for further detailed description.
在本实施例中,将以实施例一所描述的时钟调节装置集成在播放设备为例进行详细描述。In this embodiment, a detailed description will be made by taking the integration of the clock adjusting device described in Embodiment 1 into a playback device as an example.
如图2所示,一种时钟调节方法,具体流程如下:As shown in Figure 2, a clock adjustment method, the specific process is as follows:
201、播放设备在播放多媒体数据的过程中,获取系统时钟与参考时钟之间的时间误差,并开始计时。201. During the process of playing multimedia data, the playback device acquires the time error between the system clock and the reference clock, and starts timing.
其中,该多媒体数据可以为音频数据、音视频数据等等。该音频数据的格式有多种,比如,MP3格式、WMA格式等等。Wherein, the multimedia data may be audio data, audio and video data, and so on. There are many formats of the audio data, for example, MP3 format, WMA format and so on.
本实施例中参考时钟为同步参考设备的系统时钟,该同步参考设备可以播放设备,或者控制设备。In this embodiment, the reference clock is the system clock of the synchronous reference device, and the synchronous reference device can play the device or control the device.
具体地,播放设备获取同步参考设备当前的第一系统时间以及自身当前的第二系统时间,然后,根据第二系统时间和第一系统时间,获取系统时钟与参考时钟之间的时间误差。比如,第一系统时间为1:06,第二系统时间为1:00,此时可以获取时间误差为-6s。Specifically, the playback device obtains the current first system time of the synchronization reference device and its own current second system time, and then obtains the time error between the system clock and the reference clock according to the second system time and the first system time. For example, the first system time is 1:06, and the second system time is 1:00. At this time, the time error can be obtained as -6s.
202、播放设备判断时间误差的绝对值是否大于预设阈值,若是,则执行步骤203,若否,则执行步骤207。202. The playback device judges whether the absolute value of the time error is greater than a preset threshold, if yes, execute step 203, and if not, execute step 207.
203、播放设备根据时间误差确定需要进行同步调节的调节方向和调节量。203. The playback device determines an adjustment direction and an adjustment amount that need to be adjusted synchronously according to the time error.
其中,调节方向可以包括正方向或者负方向,该正方向调节是加快系统时钟,负方向调节是减慢系统时钟。其中,该调节量为时间误差的绝对值。Wherein, the adjustment direction may include a positive direction or a negative direction, the positive direction adjustment is to speed up the system clock, and the negative direction adjustment is to slow down the system clock. Wherein, the adjustment amount is the absolute value of the time error.
若时间误差大于零时,确定同步调节的调节方向为负方向,即需要减慢自身的系统时钟;若时间误差小于零,确定调节方向为正方向,即需要加快自身的系统时钟。比如,时间误差为-6s时,可以确定调节方向为正方向,调节量为6s。If the time error is greater than zero, it is determined that the adjustment direction of the synchronous adjustment is the negative direction, that is, the own system clock needs to be slowed down; if the time error is less than zero, the adjustment direction is determined to be the positive direction, that is, the own system clock needs to be accelerated. For example, when the time error is -6s, it can be determined that the adjustment direction is positive and the adjustment amount is 6s.
204、播放设备检测当前是否有声音输出,若否,则执行步骤205,若是,则继续检测当前是否有声音输出,并执行步骤206。204. The playback device detects whether there is currently sound output, and if not, executes step 205; if yes, continues to detect whether there is currently sound output, and executes step 206.
比如,播放设备可以获取当前播放输出的多媒体信号(如音频信号)对应的振幅值,判断该振幅值是否小于预设振幅值,若是,则确定当前没有声音输出,若否,则确定当前有声音输出。For example, the playback device can obtain the corresponding amplitude value of the multimedia signal (such as an audio signal) currently played and output, and judge whether the amplitude value is smaller than the preset amplitude value. output.
205、播放设备根据调节方向和调节量对系统时钟进行调节,以使得时间误差为零,转步骤207。205. The playback device adjusts the system clock according to the adjustment direction and the adjustment amount, so that the time error is zero, and goes to step 207.
比如,按照调节方向将系统时钟调节一个调节量;如使系统时钟加快一个预设调节步长,如加快20ms等。For example, the system clock is adjusted by an adjustment amount according to the adjustment direction; for example, the system clock is accelerated by a preset adjustment step, such as by 20 ms.
可选地,为了避免一次性调节系统时钟降低多媒体输出品质,本实施例播放设备可以根据调节方向和调节量对系统时钟进行多次调节,以使得该时间误差为零。如通过五次调节使时间误差为零。Optionally, in order to avoid one-time adjustment of the system clock to reduce the multimedia output quality, the playback device in this embodiment may adjust the system clock multiple times according to the adjustment direction and adjustment amount, so that the time error is zero. For example, the time error is zero through five adjustments.
206、播放设备在当前计时值大于预设阈值,再次获取系统时钟与参考时钟之间的时间误差,并根据该时间误差更新调节方向和调节量。206. The playback device obtains the time error between the system clock and the reference clock again when the current timing value is greater than the preset threshold, and updates the adjustment direction and the adjustment amount according to the time error.
其中,预设阈值为两次检测时间误差的时间间隔,其可以根据实际需求设定,如1s、3s等等。Wherein, the preset threshold is the time interval between two time error detections, which can be set according to actual needs, such as 1s, 3s and so on.
207、播放设备在当前计时值大于预设阈值时,再次获取系统时钟与参考时钟之间的时间误差,转步骤202。207. When the current timing value is greater than the preset threshold, the playback device acquires the time error between the system clock and the reference clock again, and proceeds to step 202.
具体实施时,本发明不受所描述的各个步骤的执行顺序的限制,在不产生冲突的情况下,某些步骤还可以采用其它顺序进行或者同时进行。During specific implementation, the present invention is not limited by the execution order of the described steps, and some steps may be performed in other orders or simultaneously if no conflict arises.
由上可知,本发明实施例采用播放设备在播放多媒体数据的过程中,获取自身系统时钟与同步参考播放设备的系统时钟之间的时间误差,然后,根据该时间误差确定进行同步调节的调节信息进行同步调节的调节信息,检测当前是否有声音输出,若否,则根据该调节信息对自身系统时钟进行调节,以使得该时间误差为零。该方案可以多媒体播放过程中,且没有声音输出时对自身系统时钟进行调节,以使得自身系统时钟与同步参考播放设备的系统时钟同步,进而达到多个播放设备同步播放多媒体的效果,相对于现有技术而言,可以提高多媒体播放设备之间播放多媒体的同步性。As can be seen from the above, in the embodiment of the present invention, the playback device obtains the time error between its own system clock and the system clock of the synchronous reference playback device during the playback of multimedia data, and then determines the adjustment information for synchronous adjustment according to the time error The adjustment information for synchronous adjustment is used to detect whether there is sound output at present, and if not, adjust the own system clock according to the adjustment information so that the time error is zero. This solution can adjust its own system clock during multimedia playback and when there is no sound output, so that its own system clock is synchronized with the system clock of the synchronization reference playback device, thereby achieving the effect of multiple playback devices playing multimedia synchronously. Technically, the synchronization of playing multimedia between multimedia playing devices can be improved.
此外,本发明实施例可以在没有声音输出时对自身系统时钟进行同步调节,不易被用户感知,提高了多媒体播放的品质,大大提升了用户体验。In addition, the embodiment of the present invention can synchronously adjust its own system clock when there is no sound output, which is not easy to be perceived by the user, improves the quality of multimedia playback, and greatly improves user experience.
实施例三Embodiment three
为了更好地实施以上方法,本发明实施例还提供一种时钟调节装置,该时钟调节装置可以集成在播放设备中,该播放设备可以是智能手机、平板电脑、音箱等设备。In order to better implement the above method, an embodiment of the present invention also provides a clock adjustment device, which can be integrated into a playback device, and the playback device can be a smart phone, a tablet computer, a speaker, and the like.
如图3所示,时钟调节装置300可以包括:获取单元301、确定单元302、第一检测单元303以及调节单元304,如下:As shown in FIG. 3, the clock adjustment device 300 may include: an acquisition unit 301, a determination unit 302, a first detection unit 303, and an adjustment unit 304, as follows:
获取单元301,用于在播放多媒体数据的过程中,获取自身系统时钟与同步参考播放设备的系统时钟之间的时间误差;The acquisition unit 301 is used to acquire the time error between its own system clock and the system clock of the synchronous reference playback device in the process of playing multimedia data;
确定单元302,用于根据该时间误差确定进行同步调节的调节信息进行同步调节的调节信息;A determining unit 302, configured to determine adjustment information for synchronous adjustment and adjustment information for synchronous adjustment according to the time error;
第一检测单元303,用于检测当前是否有声音输出;The first detection unit 303 is configured to detect whether there is currently sound output;
调节单元304,用于在第一检测单元303检测当前没有声音输出时,根据该调节信息对该系统时钟进行调节,以使得该时间误差为零。The adjustment unit 304 is configured to adjust the system clock according to the adjustment information when the first detection unit 303 detects that there is currently no sound output, so that the time error is zero.
其中,检测是否有声音输出的方式有多种,比如,该第一检测单元303可以具体用于:Wherein, there are multiple ways to detect whether there is sound output, for example, the first detection unit 303 can be specifically used for:
判断当前播放输出的多媒体信号对应的振幅是否小于预设振幅;Judging whether the amplitude corresponding to the multimedia signal output by the current playback is smaller than the preset amplitude;
若是,则确定当前没有声音输出;If so, determine that there is currently no sound output;
若否,则确定当前有声音输出。If not, it is determined that there is currently sound output.
可选地,参考图4,本实施例时钟调节装300还可以包括:计时单元305、判断单元306以及更新单元307;Optionally, referring to FIG. 4 , the clock adjusting device 300 in this embodiment may further include: a timing unit 305, a judging unit 306, and an updating unit 307;
计时单元305,用于在获取单元获取自身系统时钟与同步参考播放设备的系统时钟之间的时间误差时,开始计时;The timing unit 305 is used to start timing when the acquisition unit acquires the time error between its own system clock and the system clock of the synchronous reference playback device;
判断单元306,用于在第一检测单元303检测当前有声音输出时,判断当前计时时长是否大于预设时长;A judging unit 306, configured to judge whether the current timing duration is greater than a preset duration when the first detection unit 303 detects that there is currently sound output;
更新单元307,用于在判断单元306判断大于预设时长时,再次获取自身系统时钟与同步参考播放设备的系统时钟之间的时间误差,根据获取的时间误差更新该调节信息。The update unit 307 is configured to obtain the time error between the own system clock and the system clock of the synchronous reference playback device again when the judging unit 306 judges that it is greater than the preset duration, and update the adjustment information according to the obtained time error.
其中,本实施例中,该调节信息包括:调节方向和调节量;此时,该调节单元304,可以具体用于根据该调节方向和调节量对自身系统时钟进行多次调节。Wherein, in this embodiment, the adjustment information includes: an adjustment direction and an adjustment amount; at this time, the adjustment unit 304 may be specifically configured to perform multiple adjustments to its own system clock according to the adjustment direction and adjustment amount.
参考图5,本实施例时钟调节装300还可以包括:第二检测单元308;Referring to FIG. 5, the clock adjusting device 300 of this embodiment may further include: a second detection unit 308;
该第二检测单元308,还用于:在该第一检测单元303检测当前没有声音输出之后,该调节单元304根据该调节信息对自身系统时钟进行调节之前;在间隔预设时长后,再次检测当前是否有声音输出;The second detection unit 308 is also used for: after the first detection unit 303 detects that there is currently no sound output, before the adjustment unit 304 adjusts its own system clock according to the adjustment information; Whether there is sound output currently;
该调节单元304,具体用于在第二检测单元检测当前没有声音输出时,执行根据该调节信息对自身系统时钟进行调节的步骤。The adjustment unit 304 is specifically configured to perform a step of adjusting the own system clock according to the adjustment information when the second detection unit detects that there is currently no sound output.
具体实施时,以上各个单元可以作为独立的实体来实现,也可以进行任意组合,作为同一或若干个实体来实现,以上各个单元的具体实施可参见前面的方法实施例,在此不再赘述。During specific implementation, each of the above units may be implemented as an independent entity, or may be combined arbitrarily as the same or several entities. The specific implementation of each of the above units may refer to the previous method embodiments, and will not be repeated here.
由上可知,本发明实施例采用获取单元301在播放多媒体数据的过程中,获取自身系统时钟与同步参考播放设备的系统时钟之间的时间误差,然后,由确定单元302根据该时间误差确定进行同步调节的调节信息进行同步调节的调节信息,由第一检测单元303检测当前是否有声音输出,若否,则由调节单元304根据该调节信息对自身系统时钟进行调节,以使得该时间误差为零。该方案可以多媒体播放过程中,且没有声音输出时对自身系统时钟进行调节,以使得自身系统时钟与同步参考播放设备的系统时钟同步,进而达到多个播放设备同步播放多媒体的效果,相对于现有技术而言,可以提高多媒体播放设备之间播放多媒体的同步性。As can be seen from the above, the embodiment of the present invention adopts the acquisition unit 301 to acquire the time error between its own system clock and the system clock of the synchronous reference playback device during the process of playing multimedia data, and then, the determination unit 302 determines and proceeds according to the time error. Synchronously adjusted adjustment information The first detection unit 303 detects whether there is currently sound output, and if not, the adjustment unit 304 adjusts its own system clock according to the adjustment information, so that the time error is zero. This solution can adjust its own system clock during multimedia playback and when there is no sound output, so that its own system clock is synchronized with the system clock of the synchronization reference playback device, thereby achieving the effect of multiple playback devices playing multimedia synchronously. Technically, the synchronization of playing multimedia between multimedia playing devices can be improved.
此外,本发明实施例可以在没有声音输出时对自身系统时钟进行同步调节,不易被用户感知,提高了多媒体播放的品质,大大提升了用户体验。In addition, the embodiment of the present invention can synchronously adjust its own system clock when there is no sound output, which is not easy to be perceived by the user, improves the quality of multimedia playback, and greatly improves user experience.
实施例四Embodiment four
根据实施例一和二所描述的时钟调节方法,以下将举例作进一步详细说明。According to the clock adjustment methods described in Embodiments 1 and 2, an example will be given below for further detailed description.
在本实施例中,将以实施例一、二和三所描述时钟调节装置集成在从属设备中为例进行详细描述。In this embodiment, a detailed description will be made by taking the clock adjustment apparatus described in Embodiments 1, 2 and 3 integrated in a slave device as an example.
本发明实施例提供了一种多媒体同步播放系统,可以包括:控制设备和至少一个播放设备;所述控制设备与所述播放设备连接(如通过网络连接);所述播放设备用于执行上述实施例提供的任一时钟调节方法。An embodiment of the present invention provides a multimedia synchronous playback system, which may include: a control device and at least one playback device; the control device is connected to the playback device (such as through a network connection); the playback device is used to perform the above implementation Either of the clock tuning methods provided by the example.
其中,控制设备可以作为主控设备,播放设备可以作为从属设备。Wherein, the control device can be used as a master device, and the playback device can be used as a slave device.
参考图6,本实施例提供了一种多媒体同步播放系统,包括:源设备10、主控设备20、至少一个从属设备30;该源设备10、主控设备20、从属设备30之间可以通过网络相互连接。Referring to FIG. 6 , this embodiment provides a multimedia synchronous playback system, including: a source device 10, a master device 20, and at least one slave device 30; the source device 10, the master device 20, and the slave device 30 can be connected through Networks are interconnected.
其中,主控设备20用于控制从属设备,其可以为终端,如手机、平板电脑等,该主控设备也可以为播放设备,比如,音箱等播放设备;本实施例将以主控设备20为终端为例进行说明。Wherein, the main control device 20 is used to control the slave device, which can be a terminal, such as a mobile phone, a tablet computer, etc., and the main control device can also be a playback device, such as a playback device such as a speaker; this embodiment will use the main control device 20 The terminal is used as an example for description.
该从属设备30可以为受控于主控设备20的播放设备,该从属设备可以为音箱、具有播放功能的终端等播放设备。The slave device 30 may be a playback device controlled by the master device 20, and the slave device may be a playback device such as a sound box or a terminal with a playback function.
其中,源设备10用于提供待播放的多媒体数据,其可以服务器等网络设备。Wherein, the source device 10 is used to provide multimedia data to be played, which may be a network device such as a server.
在同步播放多媒体之前,本实施例可以从多个从属设备30中选取一个设备作为同步播放的参考设备,在同步播放过程中,所有从属设备的时钟均将与该参考设备的系统时钟保存同步。比如,可以由主控设备20从多个从属设备30中选取一个从属设备作为同步播放的参考设备,然后,将参考设备的标识发送给各个从属设备。Before playing multimedia synchronously, this embodiment can select a device from multiple slave devices 30 as a reference device for synchronous playback. During the process of synchronous playback, the clocks of all slave devices will be synchronized with the system clock of the reference device. For example, the master control device 20 may select a slave device from multiple slave devices 30 as a reference device for synchronous playback, and then send the identifier of the reference device to each slave device.
应当注意的是:当主控设备20若除分发媒体数据之外也接收自身分发的媒体数据播放时,该主控设备20也为从属设备。此时,可以选取主控设备20为参考播设备。It should be noted that: when the master device 20 also receives and plays the media data distributed by itself in addition to distributing media data, the master device 20 is also a slave device. At this time, the main control device 20 may be selected as the reference broadcast device.
多媒体播放的流程如下:The process of multimedia playback is as follows:
源设备10向主控设备20发送多媒体数据;主控设备20对多媒体数据进行打包,得到多个媒体数据包;主控设备20向各个从属设备30发送媒体数据包;从属设备30缓存媒体数据包并播放缓存的媒体数据包。之后从属设备30执行实施例一和二所描述的时钟调节的步骤。此处不再赘述。The source device 10 sends multimedia data to the master device 20; the master device 20 packages the multimedia data to obtain multiple media data packets; the master device 20 sends media data packets to each slave device 30; the slave device 30 buffers the media data packets and play the cached media packets. Then the slave device 30 executes the clock adjustment steps described in Embodiments 1 and 2. I won't repeat them here.
由上可知,本发明实施例多媒体播放系统中从属设备30采用在播放多媒体数据的过程中,获取自身系统时钟与同步参考播放设备的系统时钟之间的时间误差,然后,根据该时间误差确定进行同步调节的调节信息进行同步调节的调节信息,检测当前是否有声音输出,若否,则根据所述调节信息对自身系统时钟进行调节,以使得所述时间误差为零。该方案可以多媒体播放过程中,且没有声音输出时对自身系统时钟进行调节,以使得自身系统时钟与同步参考播放设备的系统时钟同步,进而达到多个播放设备同步播放多媒体的效果,相对于现有技术而言,可以提高多媒体播放设备之间播放多媒体的同步性。As can be seen from the above, in the multimedia playback system of the embodiment of the present invention, the slave device 30 adopts the time error between its own system clock and the system clock of the synchronous reference playback device to obtain the time error between its own system clock and the system clock of the synchronous reference playback device during the playback of multimedia data, and then determines to proceed according to the time error. The synchronously adjusted adjustment information performs the synchronously adjusted adjustment information to detect whether there is currently sound output, and if not, adjusts its own system clock according to the adjustment information so that the time error is zero. This solution can adjust its own system clock during multimedia playback and when there is no sound output, so that its own system clock is synchronized with the system clock of the synchronization reference playback device, thereby achieving the effect of multiple playback devices playing multimedia synchronously. Technically, the synchronization of playing multimedia between multimedia playing devices can be improved.
此外,本发明实施例从属设备30可以在没有声音输出时对自身系统时钟进行同步调节,不易被用户感知,提高了多媒体播放的品质,大大提升了用户体验。In addition, the slave device 30 in the embodiment of the present invention can synchronously adjust its own system clock when there is no sound output, which is not easily perceived by the user, improves the quality of multimedia playback, and greatly improves user experience.
实施例五Embodiment five
本发明实施例还提供一种终端,如图7所示,该终端400可以包括射频(RF,RadioFrequency)电路401、包括有一个或一个以上计算机可读存储介质的存储器402、输入单元403、显示单元404、传感器405、音频电路406、无线保真(WiFi,Wireless Fidelity)模块407、包括有一个或者一个以上处理核心的处理器408、以及电源409等部件。本领域技术人员可以理解,图7中示出的终端结构并不构成对终端的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。The embodiment of the present invention also provides a terminal. As shown in FIG. 7, the terminal 400 may include a radio frequency (RF, Radio Frequency) circuit 401, a memory 402 including one or more computer-readable storage media, an input unit 403, a display A unit 404 , a sensor 405 , an audio circuit 406 , a wireless fidelity (WiFi, Wireless Fidelity) module 407 , a processor 408 including one or more processing cores, and a power supply 409 and other components. Those skilled in the art can understand that the terminal structure shown in FIG. 7 does not constitute a limitation on the terminal, and may include more or less components than those shown in the figure, or combine some components, or arrange different components.
射频电路401可用于收发信息,或通话过程中信号的接收和发送,特别地,将基站的下行信息接收后,交由一个或者一个以上处理器408处理;另外,将涉及上行的数据发送给基站。通常,射频电路401包括但不限于天线、至少一个放大器、调谐器、一个或多个振荡器、用户身份模块(SIM,Subscriber Identity Module)卡、收发信机、耦合器、低噪声放大器(LNA,Low Noise Amplifier)、双工器等。此外,射频电路401还可以通过无线通信与网络和其他设备通信。该无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(GSM,Global System of Mobile communication)、通用分组无线服务(GPRS,GeneralPacket Radio Service)、码分多址(CDMA,Code Division Multiple Access)、宽带码分多址(WCDMA,Wideband Code Division Multiple Access)、长期演进(LTE,Long TermEvolution)、电子邮件、短消息服务(SMS,Short Messaging Service)等。The radio frequency circuit 401 can be used to send and receive information, or to receive and send signals during a call. In particular, after receiving the downlink information from the base station, it is processed by one or more processors 408; in addition, the uplink data is sent to the base station . Generally, the radio frequency circuit 401 includes but is not limited to an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM, Subscriber Identity Module) card, a transceiver, a coupler, a low noise amplifier (LNA, Low Noise Amplifier), duplexer, etc. In addition, the radio frequency circuit 401 can also communicate with the network and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to Global System for Mobile Communications (GSM, Global System of Mobile communication), General Packet Radio Service (GPRS, General Packet Radio Service), Code Division Multiple Access (CDMA, Code Division Multiple Access), Wideband Code Division Multiple Access (WCDMA, Wideband Code Division Multiple Access), Long Term Evolution (LTE, Long Term Evolution), email, Short Message Service (SMS, Short Messaging Service), etc.
存储器402可用于存储应用程序和数据。存储器402存储的应用程序中包含有可执行程序代码。应用程序可以组成各种功能模块。处理器408通过运行存储在存储器402的应用程序,从而执行各种功能应用以及数据处理。存储器402可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据终端的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器402可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器402还可以包括存储器控制器,以提供处理器408和输入单元403对存储器402的访问。Memory 402 may be used to store applications and data. The application programs stored in the memory 402 include executable program codes. Applications can be composed of various functional modules. The processor 408 executes various functional applications and data processing by running the application programs stored in the memory 402 . The memory 402 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a sound playback function, an image playback function, etc.); Data created by the use of the terminal (such as audio data, phonebook, etc.) and the like. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory 402 may further include a memory controller to provide the processor 408 and the input unit 403 with access to the memory 402 .
输入单元403可用于接收输入的数字、字符信息或用户特征信息(比如指纹),以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。具体地,输入单元403可以包括指纹识别模组。在一些实施例中,输入单元403还可以包括触敏表面。触敏表面,也称为触摸显示屏或者触控板,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触敏表面上或在触敏表面附近的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触敏表面可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器408,并能接收处理器408发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触敏表面。除了触敏表面,输入单元403还可以包括其他输入设备。具体地,其他输入设备可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。The input unit 403 can be used to receive input numbers, character information or user characteristic information (such as fingerprints), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, the input unit 403 may include a fingerprint identification module. In some embodiments, the input unit 403 may also include a touch-sensitive surface. A touch-sensitive surface, also known as a touch display or trackpad, collects user touch operations on or near it (for example, the user uses a finger, stylus, etc. any suitable object or accessory on the touch-sensitive surface or on the touch-sensitive Operation near the surface), and drive the corresponding connection device according to the preset program. Optionally, the touch-sensitive surface may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and sends it to the to the processor 408, and can receive and execute commands sent by the processor 408. In addition, touch-sensitive surfaces can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to touch-sensitive surfaces, the input unit 403 may also include other input devices. Specifically, other input devices may include, but are not limited to, one or more of physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, joysticks, and the like.
显示单元404可用于显示由用户输入的信息或提供给用户的信息以及终端的各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。显示单元404可包括显示面板。可选的,可以采用液晶显示器(LCD,Liquid Crystal Display)、有机发光二极管(OLED,Organic Light-Emitting Diode)等形式来配置显示面板。进一步的,触敏表面可覆盖显示面板,当触敏表面检测到在其上或附近的触摸操作后,传送给处理器408以确定触摸事件的类型,随后处理器408根据触摸事件的类型在显示面板上提供相应的视觉输出。虽然在图7中,触敏表面与显示面板是作为两个独立的部件来实现输入和输入功能,但是在某些实施例中,可以将触敏表面与显示面板集成而实现输入和输出功能。The display unit 404 can be used to display information input by or provided to the user and various graphical user interfaces of the terminal. These graphical user interfaces can be composed of graphics, text, icons, videos and any combination thereof. The display unit 404 may include a display panel. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light-emitting diode (OLED, Organic Light-Emitting Diode), or the like. Further, the touch-sensitive surface may cover the display panel, and when the touch-sensitive surface detects a touch operation on or near it, the touch operation is sent to the processor 408 to determine the type of the touch event, and then the processor 408 displays on the display according to the type of the touch event. The corresponding visual output is provided on the panel. Although in FIG. 7, the touch-sensitive surface and the display panel are used as two independent components to realize the input and input functions, in some embodiments, the touch-sensitive surface and the display panel can be integrated to realize the input and output functions.
终端还可包括至少一种传感器405,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板的亮度,接近传感器可在终端移动到耳边时,关闭显示面板和/或背光。作为运动传感器的一种,重力加速度传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于终端还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。The terminal may also include at least one sensor 405, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel according to the brightness of the ambient light, and the proximity sensor may turn off the display panel and/or the backlight when the terminal moves to the ear . As a kind of motion sensor, the gravitational acceleration sensor can detect the magnitude of acceleration in various directions (generally three axes), and can detect the magnitude and direction of gravity when it is stationary, and can be used for applications that recognize the attitude of mobile phones (such as horizontal and vertical screen switching, related Games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tap), etc.; as for other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc. repeat.
音频电路406可通过扬声器、传声器提供用户与终端之间的音频接口。音频电路406可将接收到的音频数据转换成电信号,传输到扬声器,由扬声器转换为声音信号输出;另一方面,传声器将收集的声音信号转换为电信号,由音频电路406接收后转换为音频数据,再将音频数据输出处理器408处理后,经射频电路401以发送给比如另一终端,或者将音频数据输出至存储器402以便进一步处理。音频电路406还可能包括耳塞插孔,以提供外设耳机与终端的通信。The audio circuit 406 can provide an audio interface between the user and the terminal through a speaker or a microphone. The audio circuit 406 can convert the received audio data into an electrical signal, transmit it to the speaker, and convert it into a sound signal output by the speaker; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is converted into The audio data, after being processed by the audio data output processor 408, is sent to another terminal through the radio frequency circuit 401, or the audio data is output to the memory 402 for further processing. The audio circuit 406 may also include an earplug jack to provide communication between an external earphone and the terminal.
无线保真(WiFi)属于短距离无线传输技术,终端通过无线保真模块407可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图7示出了无线保真模块407,但是可以理解的是,其并不属于终端的必须构成,完全可以根据需要在不改变发明的本质的范围内而省略。Wireless Fidelity (WiFi) is a short-distance wireless transmission technology. The terminal can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 407. It provides users with wireless broadband Internet access. Although FIG. 7 shows the Wi-Fi module 407, it can be understood that it is not an essential component of the terminal, and can be omitted as required without changing the essence of the invention.
处理器408是终端的控制中心,利用各种接口和线路连接整个终端的各个部分,通过运行或执行存储在存储器402内的应用程序,以及调用存储在存储器402内的数据,执行终端的各种功能和处理数据,从而对终端进行整体监控。可选的,处理器408可包括一个或多个处理核心;优选的,处理器408可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器408中。The processor 408 is the control center of the terminal. It uses various interfaces and lines to connect various parts of the entire terminal. By running or executing the application program stored in the memory 402 and calling the data stored in the memory 402, various functions of the terminal are executed. function and process data, so as to monitor the terminal as a whole. Optionally, the processor 408 may include one or more processing cores; preferably, the processor 408 may integrate an application processor and a modem processor, wherein the application processor mainly processes operating systems, user interfaces, and application programs, etc. , the modem processor mainly handles wireless communications. It can be understood that the foregoing modem processor may not be integrated into the processor 408 .
终端还包括给各个部件供电的电源409(比如电池)。优选的,电源可以通过电源管理系统与处理器408逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。电源409还可以包括一个或一个以上的直流或交流电源、再充电系统、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。The terminal also includes a power source 409 (such as a battery) for powering various components. Preferably, the power supply can be logically connected to the processor 408 through a power management system, so that functions such as charging, discharging, and power consumption management can be implemented through the power management system. The power supply 409 may also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
尽管图7中未示出,终端还可以包括摄像头、蓝牙模块等,在此不再赘述。Although not shown in FIG. 7 , the terminal may also include a camera, a Bluetooth module, etc., which will not be repeated here.
具体在本实施例中,终端中的处理器408会按照如下的指令,将一个或一个以上的应用程序的进程对应的可执行程序代码加载到存储器402中,并由处理器408来运行存储在存储器402中的应用程序,从而实现各种功能:Specifically, in this embodiment, the processor 408 in the terminal loads the executable program code corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 408 executes the executable program code stored in the The application program in memory 402, thereby realizes various functions:
在播放多媒体数据的过程中,获取自身系统时钟与同步参考播放设备的系统时钟之间的时间误差,然后,根据该时间误差确定进行同步调节的调节信息进行同步调节的调节信息,检测当前是否有声音输出,若否,则根据所述调节信息对自身系统时钟进行调节,以使得所述时间误差为零。In the process of playing multimedia data, obtain the time error between its own system clock and the system clock of the synchronous reference playback device, then determine the adjustment information for synchronous adjustment according to the time error, and detect whether there is currently Sound output, if not, adjust its own system clock according to the adjustment information, so that the time error is zero.
优选地,所述检测当前是否有声音输出,包括:Preferably, the detection of whether there is currently sound output includes:
判断当前播放输出的多媒体信号对应的振幅是否小于预设振幅;Judging whether the amplitude corresponding to the multimedia signal output by the current playback is smaller than the preset amplitude;
若是,则确定当前没有声音输出;If so, determine that there is currently no sound output;
若否,则确定当前有声音输出。If not, it is determined that there is currently sound output.
优选地,处理器408还实现以下功能:Preferably, the processor 408 also implements the following functions:
在获取自身系统时钟与同步参考播放设备的系统时钟之间的时间误差时,开始计时;When obtaining the time error between the own system clock and the system clock of the synchronous reference playback device, start timing;
在当前有声音输出时,判断当前计时时长是否大于预设时长;When there is currently sound output, determine whether the current timing duration is greater than the preset duration;
若是,则再次获取自身系统时钟与同步参考播放设备的系统时钟之间的时间误差,根据获取的时间误差更新所述调节信息。If yes, the time error between the own system clock and the system clock of the synchronous reference playback device is obtained again, and the adjustment information is updated according to the obtained time error.
优选地,所述调节信息包括:调节方向和调节量;Preferably, the adjustment information includes: adjustment direction and adjustment amount;
所述根据所述调节信息对自身系统时钟进行调节,包括:根据所述调节方向和调节量对自身系统时钟进行多次调节。The adjusting the self system clock according to the adjustment information includes: adjusting the self system clock multiple times according to the adjustment direction and adjustment amount.
优选地,处理器408还实现以下功能:Preferably, the processor 408 also implements the following functions:
在检测当前没有声音输出之后,根据所述调节信息对自身系统时钟进行调节之前,所述时钟调节方法还包括:After detecting that there is currently no sound output, before adjusting the own system clock according to the adjustment information, the clock adjustment method further includes:
在间隔预设时长后,再次检测当前是否有声音输出;After a preset interval, check again whether there is sound output;
若否,则执行根据所述调节信息对自身系统时钟进行调节的步骤。If not, perform the step of adjusting the own system clock according to the adjustment information.
上述操作具体可参见前面的方法实施例,在此不再赘述。For details of the above operations, reference may be made to the foregoing method embodiments, and details are not repeated here.
由上可知,本发明实施例提供了一种终端,该终端在播放多媒体数据的过程中,获取自身系统时钟与同步参考播放设备的系统时钟之间的时间误差,然后,根据该时间误差确定进行同步调节的调节信息进行同步调节的调节信息,检测当前是否有声音输出,若否,则根据所述调节信息对自身系统时钟进行调节,以使得所述时间误差为零。该方案可以多媒体播放过程中,且没有声音输出时对自身系统时钟进行调节,以使得自身系统时钟与同步参考播放设备的系统时钟同步,进而达到多个播放设备同步播放多媒体的效果,相对于现有技术而言,可以提高多媒体播放设备之间播放多媒体的同步性。It can be seen from the above that the embodiment of the present invention provides a terminal. During the process of playing multimedia data, the terminal obtains the time error between its own system clock and the system clock of the synchronous reference playback device, and then determines to proceed according to the time error. The synchronously adjusted adjustment information performs the synchronously adjusted adjustment information to detect whether there is currently sound output, and if not, adjusts its own system clock according to the adjustment information so that the time error is zero. This solution can adjust its own system clock during multimedia playback and when there is no sound output, so that its own system clock is synchronized with the system clock of the synchronization reference playback device, thereby achieving the effect of multiple playback devices playing multimedia synchronously. Technically, the synchronization of playing multimedia between multimedia playing devices can be improved.
需要说明的是,本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于计算机可读存储介质中,存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁盘或光盘等。It should be noted that those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. The medium may include: a read only memory (ROM, Read Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and the like.
以上对本发明实施例所提供的一种时钟调节方法、装置、终端及多媒体同步播放系统进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。A clock adjustment method, device, terminal, and multimedia synchronous playback system provided by the embodiments of the present invention have been described above in detail. In this paper, specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments It is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation and scope of application. In summary, this The content of the description should not be construed as limiting the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610882858.4ACN106385598A (en) | 2016-10-08 | 2016-10-08 | Clock adjusting method and device, terminal and multimedia synchronous playing system |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610882858.4ACN106385598A (en) | 2016-10-08 | 2016-10-08 | Clock adjusting method and device, terminal and multimedia synchronous playing system |
| Publication Number | Publication Date |
|---|---|
| CN106385598Atrue CN106385598A (en) | 2017-02-08 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201610882858.4APendingCN106385598A (en) | 2016-10-08 | 2016-10-08 | Clock adjusting method and device, terminal and multimedia synchronous playing system |
| Country | Link |
|---|---|
| CN (1) | CN106385598A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110248213A (en)* | 2018-03-08 | 2019-09-17 | 上海分众软件技术有限公司 | Multimachine real-time synchronization play system |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1579059A (en)* | 2001-09-04 | 2005-02-09 | 诺基亚有限公司 | Method and apparatus for reducing synchronization delay in packet-based voice terminals |
| CN101039145A (en)* | 2007-03-30 | 2007-09-19 | 华为技术有限公司 | Method and apparatus for realizing clock |
| CN102611918A (en)* | 2012-03-28 | 2012-07-25 | 深圳市普乐方文化科技有限公司 | Synchronous video playing control system and method |
| CN103747316A (en)* | 2013-12-23 | 2014-04-23 | 乐视致新电子科技(天津)有限公司 | Audio and video synchronizing method and electronic device |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1579059A (en)* | 2001-09-04 | 2005-02-09 | 诺基亚有限公司 | Method and apparatus for reducing synchronization delay in packet-based voice terminals |
| CN101039145A (en)* | 2007-03-30 | 2007-09-19 | 华为技术有限公司 | Method and apparatus for realizing clock |
| CN102611918A (en)* | 2012-03-28 | 2012-07-25 | 深圳市普乐方文化科技有限公司 | Synchronous video playing control system and method |
| CN103747316A (en)* | 2013-12-23 | 2014-04-23 | 乐视致新电子科技(天津)有限公司 | Audio and video synchronizing method and electronic device |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110248213A (en)* | 2018-03-08 | 2019-09-17 | 上海分众软件技术有限公司 | Multimachine real-time synchronization play system |
| Publication | Publication Date | Title |
|---|---|---|
| CN106373600B (en) | Audio synchronous playing method, device, system and terminal | |
| CN106411447B (en) | playing control method, device and terminal | |
| CN106452643B (en) | playing control method, device, terminal and playing system | |
| CN106411448A (en) | Play control method, device and terminal | |
| CN106254903B (en) | synchronous playing method, device and system of multimedia data | |
| CN103905876A (en) | Video data and audio data synchronized playing method and device and equipment | |
| CN103596017B (en) | Video downloading method and system | |
| CN106341713B (en) | Multimedia synchronous playing method, device, system and terminal | |
| CN103905878A (en) | Video data and audio data synchronized playing method and device and equipment | |
| CN103905879A (en) | Video data and audio data synchronized playing method and device and equipment | |
| US10463965B2 (en) | Control method of scene sound effect and related products | |
| CN103905881A (en) | Video data and audio data synchronized playing method and device and equipment | |
| CN106453597B (en) | Method, device and system for adjusting data synchronization period | |
| WO2017215661A1 (en) | Scenario-based sound effect control method and electronic device | |
| CN106452644A (en) | Play control method, device and terminal | |
| CN106653068A (en) | A method, device and terminal for playing audio data | |
| CN106412625B (en) | multimedia synchronous playing method, device, terminal and system | |
| CN106254924A (en) | A method, system and related equipment for playing multimedia data | |
| CN106454421B (en) | A clock adjustment method, device, terminal and multimedia synchronous playback system | |
| CN106375823B (en) | Clock adjusting method, device, terminal and multimedia synchronous playing system | |
| CN106445458B (en) | Playing control method, device and terminal | |
| CN106454420B (en) | Clock synchronization method and device | |
| CN105159655B (en) | Behavior event playing method and device | |
| CN103345930B (en) | data synthesis method, device and terminal | |
| CN106375824B (en) | Clock adjusting method, device, terminal and multimedia synchronous playing system |
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication | Application publication date:20170208 | |
| RJ01 | Rejection of invention patent application after publication |