CN103309968B - A kind of playback of songs method and device - Google Patents
A kind of playback of songs method and device Download PDFInfo
- Publication number
- CN103309968B CN103309968B CN201310222675.6A CN201310222675A CN103309968B CN 103309968 B CN103309968 B CN 103309968B CN 201310222675 A CN201310222675 A CN 201310222675A CN 103309968 B CN103309968 B CN 103309968B
- Authority
- CN
- China
- Prior art keywords
- song
- uri
- uniform resource
- queue
- read
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 35
- 238000012217 deletion Methods 0.000 description 3
- 230000037430 deletion Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000003780 insertion Methods 0.000 description 3
- 230000037431 insertion Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 1
Landscapes
- Reverberation, Karaoke And Other Acoustics (AREA)
Abstract
本发明实施例公开了一种歌曲播放方法及装置,该方法包括:获取歌曲队列以及播放控制指令,歌曲队列中至少一首歌曲配置有统一资源标识符列表,所述统一资源标识符用于标识所述至少一首歌曲的存储位置;根据所述播放控制指令,从所述至少一首歌曲对应的统一资源标识符列表中读取一个统一资源标识符,判断对读取的所述统一资源标识符的链接是否成功;如果不成功,则从所述至少一首歌曲对应的统一资源标识符列表中读取下一个统一资源标识符,直到判断出对读取的所述统一资源标识符的链接成功时,播放链接成功的所述统一资源标识符标识的所述歌曲,否则切换至歌曲队列中的下一首歌曲。实施本发明实施例可以能够有效的提高歌曲的播放命中率。
The embodiment of the present invention discloses a song playing method and device. The method includes: acquiring a song queue and a playback control instruction. At least one song in the song queue is configured with a list of uniform resource identifiers, and the uniform resource identifier is used to identify The storage location of the at least one song; according to the play control instruction, read a URI from the URI list corresponding to the at least one song, and determine whether the URI is read whether the link of the character is successful; if not, read the next Uniform Resource Identifier from the list of Uniform Resource Identifiers corresponding to the at least one song until the link to the read Uniform Resource Identifier is determined If successful, play the song identified by the uniform resource identifier with a successful link; otherwise, switch to the next song in the song queue. Implementing the embodiment of the present invention can effectively improve the hit rate of playing songs.
Description
技术领域technical field
本发明涉及互联网技术领域,具体涉及一种歌曲播放方法及装置。The invention relates to the technical field of the Internet, in particular to a song playing method and device.
背景技术Background technique
目前,市场上的很多便携式音箱都集成有存储卡插槽,当存储卡插槽中插入存储卡后,这种音箱即可读取存储卡中存储的歌曲并播放,从而可以实现随时随地的歌曲播放。然而在实践中发现,存储卡中的歌曲是预先存储到存储卡的,而在存储过程中当歌曲出现错误(如歌曲不完整、歌曲格式出错等)时,音箱就无法播放该歌曲,从而降低歌曲的播放命中率。At present, many portable speakers on the market are integrated with a memory card slot. When a memory card is inserted into the memory card slot, this speaker can read and play the songs stored in the memory card, so that songs can be played anytime, anywhere. play. However, it is found in practice that the songs in the memory card are pre-stored to the memory card, and when an error occurs in the song (such as incomplete song, wrong song format, etc.) during the storage process, the speaker cannot play the song, thereby reducing the The playback hit rate of the song.
发明内容Contents of the invention
本发明实施例公开了一种歌曲播放方法及装置,能够有效的提高歌曲的播放命中率。The embodiment of the invention discloses a method and device for playing songs, which can effectively improve the hit rate of playing songs.
本发明实施例第一方面公开一种歌曲播放方法,包括:The first aspect of the embodiment of the present invention discloses a song playing method, including:
获取歌曲队列以及播放控制指令,所述歌曲队列中至少一首歌曲配置有统一资源标识符列表,所述统一资源标识符用于标识所述至少一首歌曲的存储位置;Acquiring song queues and play control instructions, at least one song in the song queue is configured with a list of uniform resource identifiers, and the uniform resource identifiers are used to identify the storage location of the at least one song;
根据所述播放控制指令,从所述至少一首歌曲对应的统一资源标识符列表中读取一个统一资源标识符,判断对读取的所述统一资源标识符的链接是否成功;如果不成功,则从所述至少一首歌曲对应的统一资源标识符列表中读取下一个统一资源标识符,直到判断出对读取的所述统一资源标识符的链接成功时,播放链接成功的所述统一资源标识符标识的所述歌曲,否则切换至所述歌曲队列中的下一首歌曲。According to the play control instruction, read a URI from the URI list corresponding to the at least one song, and judge whether the link to the read URI is successful; if not, Then read the next Uniform Resource Identifier from the Uniform Resource Identifier list corresponding to the at least one song, until it is judged that the link to the read Uniform Resource Identifier is successful, the unified resource identifier that is successfully linked is played. The song identified by the resource identifier, otherwise switch to the next song in the song queue.
本发明实施例第二方面公开一种计算机存储介质,所述计算机存储介质存储有程序,所述程序执行时包括本发明实施例第一方面公开的一种歌曲播放方法的全部步骤。The second aspect of the embodiment of the present invention discloses a computer storage medium, the computer storage medium stores a program, and when the program is executed, it includes all the steps of the song playing method disclosed in the first aspect of the embodiment of the present invention.
本发明实施例第三方面公开一种歌曲播放装置,包括:The third aspect of the embodiment of the present invention discloses a song playing device, comprising:
获取单元,用于获取歌曲队列以及播放控制指令,所述歌曲队列中至少一首歌曲配置有统一资源标识符列表,所述统一资源标识符用于标识所述至少一首歌曲的存储位置;An acquisition unit, configured to acquire a song queue and a play control instruction, where at least one song in the song queue is configured with a list of uniform resource identifiers, and the uniform resource identifier is used to identify the storage location of the at least one song;
读取单元,用于根据所述播放控制指令,从所述至少一首歌曲对应的统一资源标识符列表中读取一个统一资源标识符;A reading unit, configured to read a URI from the URI list corresponding to the at least one song according to the playback control instruction;
判断单元,用于判断对读取的所述统一资源标识符的链接是否成功;a judging unit, configured to judge whether the link to the read uniform resource identifier is successful;
播放单元,用于在所述判断单元的判断出对读取的所述统一资源标识符的链接不成功时,通知所述读取单元从所述至少一首歌曲对应的统一资源标识符列表中读取存储的下一个统一资源标识符,直到所述判断单元判断出对读取的所述统一资源标识符的链接成功时,播放链接成功的所述统一资源标识符标识的歌曲,否则切换至所述歌曲队列中的下一首歌曲。The playing unit is configured to notify the reading unit to select from the URI list corresponding to the at least one song when the judging unit determines that the link to the read URI is unsuccessful. Read the next stored URI until the judging unit judges that the link to the read URI is successful, play the song identified by the URI that is linked successfully, otherwise switch to The next song in the song queue.
本发明实施例中,在获取到歌曲队列以及播放控制指令后,可以从歌曲对应的统一资源标识符列表中读取存储的一个统一资源标识符,并判断对读取的统一资源标识符的链接是否成功;如果不成功,则从该歌曲对应的统一资源标识符列表中读取存储的下一个统一资源标识符,直到判断出对读取的统一资源标识符的链接成功时,播放链接成功的统一资源标识符标识的歌曲。可见,本发明实施例不存储歌曲本身,而是存储歌曲对应的多个统一资源标识符,这样可以确保最终对读取的统一资源标识符的链接成功,从而可以能够有效的提高歌曲的播放命中率。In the embodiment of the present invention, after the song queue and the playback control instruction are obtained, a stored URI can be read from the URI list corresponding to the song, and the link to the read URI can be determined. Whether it is successful; if it is not successful, read the stored next Uniform Resource Identifier from the corresponding Uniform Resource Identifier list of the song until it is judged that the link to the read Uniform Resource Identifier is successful, and the playback link is successful The song identified by the Uniform Resource Identifier. It can be seen that the embodiment of the present invention does not store the song itself, but stores a plurality of uniform resource identifiers corresponding to the song, which can ensure that the final link to the read uniform resource identifier is successful, thereby effectively improving the playing hit of the song Rate.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the accompanying drawings that need to be used in the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For Those of ordinary skill in the art can also obtain other drawings based on these drawings without any creative effort.
图1是本发明实施例公开的一种歌曲播放方法的流程图;Fig. 1 is a flow chart of a song playing method disclosed in an embodiment of the present invention;
图2是本发明实施例公开的一种歌曲队列的示意图;Fig. 2 is a schematic diagram of a song queue disclosed by an embodiment of the present invention;
图3是本发明实施例公开的另一种歌曲播放方法的流程图;Fig. 3 is the flow chart of another song playing method disclosed by the embodiment of the present invention;
图4是本发明实施例公开的一种歌曲播放装置的结构图。Fig. 4 is a structural diagram of a song playing device disclosed in an embodiment 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 accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
本发明实施例公开了一种歌曲播放方法及装置,能够有效的提高歌曲的播放命中率。以下分别进行详细说明。The embodiment of the invention discloses a method and device for playing songs, which can effectively improve the hit rate of playing songs. Each will be described in detail below.
请参阅图1,图1是本发明实施例公开的一种歌曲播放方法的流程图。其中,图1所描述的歌曲播放方法适用于音箱(无线或有线)、智能手机(Android手机、iOS手机等)、平板电脑、掌声电脑以及移动互联网设备(Mobile Internet Devices,MID)、PC等数字媒体播放器(Digital Media Player,DMP),本发明实施例不作限定。如图1所示,该歌曲播放方法可以包括以下步骤。Please refer to FIG. 1 . FIG. 1 is a flow chart of a song playing method disclosed in an embodiment of the present invention. Among them, the song playing method described in Figure 1 is applicable to speakers (wireless or wired), smart phones (Android phones, iOS phones, etc.), tablet computers, applause computers, mobile Internet devices (Mobile Internet Devices, MID), PCs and other digital A media player (Digital Media Player, DMP) is not limited in this embodiment of the present invention. As shown in FIG. 1 , the song playing method may include the following steps.
S101、获取歌曲队列以及播放控制指令,该歌曲队列中至少一首歌曲配置有统一资源标识符(Uniform Resource Identifier,URI)列表,URI用于标识该歌曲的存储位置。S101. Obtain a song queue and a playback control instruction. At least one song in the song queue is configured with a Uniform Resource Identifier (URI) list, and the URI is used to identify the storage location of the song.
本发明实施例中,DMP(如音箱)可以接收数字媒体控制器(Digital MediaController,DMC)发送的歌曲播放指令,该歌曲播放指令包括该歌曲的标识。In the embodiment of the present invention, the DMP (such as a sound box) may receive a song play instruction sent by a Digital Media Controller (Digital Media Controller, DMC), and the song play instruction includes an identifier of the song.
本发明实施例中,DMP(如音箱)可以接收DMC发送的歌曲队列,该歌曲队列中包括每一首歌曲的标识以及每一首歌曲的元数据,其中,每一首歌曲的元数据包括该歌曲对应的URI列表以及该歌曲的属性数据,该歌曲对应的URI列表中包括至少两种不同的URI。In the embodiment of the present invention, the DMP (such as a speaker) can receive the song queue sent by the DMC, and the song queue includes the identification of each song and the metadata of each song, wherein the metadata of each song includes the The URI list corresponding to the song and the attribute data of the song, the URI list corresponding to the song includes at least two different URIs.
S102、根据播放控制指令,从歌曲对应的URI列表中读取存储的一个统一资源标识符。S102. According to the play control instruction, read a stored Uniform Resource Identifier from the URI list corresponding to the song.
举例来说,本发明实施例中DMP(如音箱)里可以预先存储好每一首歌曲对应的URI列表,这样当DMP(如音箱)上电后,针对每一首歌曲,DMP(如音箱)可以从该歌曲对应的URI列表中读取存储的一个URI。For example, the URI list corresponding to each song can be pre-stored in the DMP (such as a speaker) in the embodiment of the present invention, so that when the DMP (such as a speaker) is powered on, for each song, the DMP (such as a speaker) A stored URI can be read from the URI list corresponding to the song.
又举例来说,本发明实施例中DMP(如音箱)里可以预先存储好每一首歌曲对应的URI列表,这样当DMP(如音箱)上电后,DMP(如音箱)可以接收手机、PC等数字媒体控制器(Digital Media Controller,DMC)发送的歌曲播放指令,该歌曲播放指令包括歌曲的标识,相应地DMP(如音箱)可以响应该歌曲播放指令,并从该歌曲对应的URI列表中读取存储的一个URI。For another example, in the embodiment of the present invention, the URI list corresponding to each song can be pre-stored in the DMP (such as a speaker), so that when the DMP (such as a speaker) is powered on, the DMP (such as a speaker) can receive information from mobile phones, PCs, etc. and other digital media controllers (Digital Media Controller, DMC) send the song play command, the song play command includes the identification of the song, correspondingly DMP (such as speakers) can respond to the song play command, and from the URI list corresponding to the song Read a stored URI.
本发明实施例中,DMP(如音箱)在接收手机、PC等DMC发送的歌曲播放指令之前,DMP(如音箱)还可以接收DMC发送的歌曲队列,该歌曲队列中包括每一首歌曲的标识以及每一首歌曲的元数据,其中,每一首歌曲的元数据包括该歌曲对应的URI列表以及该歌曲的属性数据,该歌曲对应的URI列表中包括至少两种不同的URI;相应地DMP(如音箱)可以存储DMC发送的歌曲队列。本发明实施例中,DMC可以通过通用即插即用(UniversalPlug and Play,UPnP)协议发送歌曲队列给音箱,或者,DMC可以通过蓝牙方式发送歌曲队列给DMP(如音箱),或者,DMC可以通过近场通讯(NearField Communication,NFC)发送歌曲队列给DMP(如音箱),本发明实施例不作限定。如图2所示,DMC发送给DMP(如音箱)的歌曲队列中,不仅可以包括歌曲1、歌曲2以及歌曲3等歌曲的标识,还可以包括歌曲1、歌曲2、歌曲3等歌曲的元数据。以歌曲1的元数据为例,该元数据可以包括歌曲1对应的URI列表以及歌曲1的属性数据,其中,歌曲1对应的URI列表可以包括URI-1、URI-2以及URI-3等不同的URI,歌曲1的属性数据可以包括歌曲1的名称、歌手名、专辑名、专辑封面、歌曲编号、歌曲时长、歌词以及自定义数据。在一个实施例中,歌曲1的属性数据也可以包括歌曲1的名称、歌手名、专辑名、专辑封面、歌曲编号、歌曲时长、歌词以及自定义数据中的一种或几种,本发明实施例不作限定。In the embodiment of the present invention, before the DMP (such as a speaker) receives the song play instruction sent by the DMC such as a mobile phone or a PC, the DMP (such as a speaker) can also receive the song queue sent by the DMC, and the song queue includes the identification of each song And the metadata of each song, wherein, the metadata of each song includes the URI list corresponding to the song and the attribute data of the song, and the URI list corresponding to the song includes at least two different URIs; correspondingly DMP (such as speakers) can store the queue of songs sent by DMC. In the embodiment of the present invention, the DMC can send the song queue to the speaker through the Universal Plug and Play (UPnP) protocol, or the DMC can send the song queue to the DMP (such as the speaker) through Bluetooth, or the DMC can pass The near field communication (NearField Communication, NFC) sends the song queue to the DMP (such as a speaker), which is not limited in this embodiment of the present invention. As shown in Figure 2, the song queue sent by the DMC to the DMP (such as a speaker) may not only include the identifiers of songs such as song 1, song 2, and song 3, but also include the metadata of songs such as song 1, song 2, and song 3. data. Taking the metadata of song 1 as an example, the metadata may include the URI list corresponding to song 1 and the attribute data of song 1, wherein the URI list corresponding to song 1 may include URI-1, URI-2, and URI-3, etc. The URI of song 1, the attribute data of song 1 can include the name of song 1, artist name, album name, album cover, song number, song duration, lyrics and custom data. In one embodiment, the attribute data of song 1 may also include one or more of song 1's title, singer name, album name, album cover, song number, song duration, lyrics, and custom data. Examples are not limited.
S103、判断对读取的统一资源标识符的链接是否成功;如果不成功,则从该歌曲对应的统一资源标识符列表中读取存储的下一个统一资源标识符,直到判断出对读取的统一资源标识符的链接成功时,播放链接成功的统一资源标识符标识的歌曲,否则切换至歌曲队列中的下一歌曲。S103, judging whether the link to the read URL is successful; if not, read the stored next URL from the URL list corresponding to the song until it is judged that the link to the read When the link of the uniform resource identifier is successful, the song identified by the successful linked uniform resource identifier is played; otherwise, the song is switched to the next song in the song queue.
举例来说,本发明实施例中,DMP(如音箱)可以判断对读取的URI的链接是否成功,如果成功,DMP(如音箱)可以播放链接成功的URI标识的歌曲;如果不成功,DMP(如音箱)可以从该歌曲对应的URI列表中读取存储的下一个URI,直到判断出对读取的URI的链接成功时,播放链接成功的URI标识的歌曲,否则切换至歌曲队列中的下一歌曲。For example, in the embodiment of the present invention, the DMP (such as a speaker) can judge whether the link to the read URI is successful, and if successful, the DMP (such as a speaker) can play the song identified by the URI with a successful link; if not, the DMP (such as a speaker) can read the next stored URI from the URI list corresponding to the song, until it is judged that the link to the read URI is successful, play the song identified by the URI with a successful link, otherwise switch to the song queue. next song.
举例来说,DMP(如音箱)从歌曲1对应的URI列表中读取存储的URI-1,DMP(如音箱)可以判断对读取URI-1的链接是否成功,如果成功,DMP(如音箱)可以播放链接成功的URI-1标识的歌曲;如果不成功,DMP(如音箱)可以从歌曲1对应的URI列表中读取存储的下一个URI,直到判断出对读取的URI(如URI-2或URI-3)的链接成功时,播放链接成功的URI(如URI-2或URI-3)标识的歌曲,否则切换至歌曲队列中的下一歌曲。For example, DMP (such as speaker) reads the stored URI-1 from the URI list corresponding to song 1, DMP (such as speaker) can judge whether the link to read URI-1 is successful, if successful, DMP (such as speaker ) can play the song identified by URI-1 with successful link; if it is unsuccessful, DMP (such as speaker) can read the next stored URI from the URI list corresponding to song 1 until it judges the URI to be read (such as URI -2 or URI-3) when the link is successful, play the song identified by the successful URI (such as URI-2 or URI-3), otherwise switch to the next song in the song queue.
本发明实施例中,DMP(如音箱)从歌曲对应的URI列表中读取存储的URI可以是顺序读取的;其中,URI列表中的URI按照URI标识的歌曲的品质从高到低的顺序排列。例如,歌曲1对应的URI列表中URI-1、URI-2以及URI-3顺序排序,URI-1标识的歌曲的品质最高、URI-2标识的歌曲的品质次高、URI-3标识的歌曲的品质最低。In the embodiment of the present invention, the DMP (such as a sound box) reads the stored URIs from the URI list corresponding to the song, which can be read sequentially; wherein, the URIs in the URI list follow the order of the quality of the song identified by the URI from high to low arrangement. For example, in the URI list corresponding to song 1, URI-1, URI-2, and URI-3 are sorted sequentially. The song identified by URI-1 has the highest quality, the song identified by URI-2 has the second highest quality, and the song identified by URI-3 has the highest quality. of the lowest quality.
在图1所描述的方法中,从歌曲对应的URI列表中读取存储的一个URI后,可以判断对读取的URI的链接是否成功;如果不成功,则从该歌曲对应的URI列表中读取存储的下一个URI,直到判断出对读取的URI的链接成功时,播放链接成功的URI标识的歌曲。可见,图1所描述的方法不存储歌曲本身,而是存储歌曲对应的多个URI,这样可以确保最终对读取的URI的链接成功,从而可以能够有效的提高歌曲的播放命中率。In the method described in Fig. 1, after reading a stored URI from the URI list corresponding to the song, it can be judged whether the link to the URI read is successful; The stored next URI is fetched until it is judged that the link to the read URI is successful, and the song identified by the successful URI is played. It can be seen that the method described in FIG. 1 does not store the song itself, but stores multiple URIs corresponding to the song, which can ensure that the final link to the read URI is successful, thereby effectively improving the playback hit rate of the song.
请参阅图3,图3是本发明实施例公开的另一种歌曲播放方法的流程图。在图3所示的方法中,需要手机、PC等DMC事先接入无线局域网环境并加入UPnP网络,并且需要音箱等DMP事先接入无线局域网并加入UPnP网络,这样DMC可以通过UPnP发现机制,搜索并选择DMP作为操作目标。在此基础上,图3所示的歌曲播放方法可以包括以下步骤。Please refer to FIG. 3 . FIG. 3 is a flow chart of another song playing method disclosed in an embodiment of the present invention. In the method shown in Figure 3, DMCs such as mobile phones and PCs need to be connected to the wireless LAN environment and join the UPnP network in advance, and DMPs such as speakers are required to be connected to the wireless LAN and join the UPnP network in advance, so that the DMC can use the UPnP discovery mechanism to search And select DMP as the operation target. On this basis, the song playing method shown in FIG. 3 may include the following steps.
S301、DMP接收DMC通过UPnP协议发送的歌曲队列。S301. The DMP receives the song queue sent by the DMC through the UPnP protocol.
本发明实施例中,DMC可以将歌曲队列进行UTF8编码,并组织成XML格式后通过UPnP协议发送给DMP。其中,DMC发送给DMP的歌曲队列可以如图2所示,不仅可以包括歌曲1、歌曲2以及歌曲3等歌曲的标识,还可以包括歌曲1、歌曲2、歌曲3等歌曲的元数据。以歌曲1的元数据为例,该元数据可以包括歌曲1对应的URI列表以及歌曲1的属性数据,其中,歌曲1对应的URI列表可以包括URI-1、URI-2以及URI-3等不同的URI,歌曲1的属性数据可以包括歌曲1的名称、歌手名、专辑名、专辑封面、歌曲编号、歌曲时长、歌词以及自定义数据。在一个实施例中,歌曲1的属性数据也可以包括歌曲1的名称、歌手名、专辑名、专辑封面、歌曲编号、歌曲时长、歌词以及自定义数据中的一种或几种,本发明实施例不作限定。In the embodiment of the present invention, the DMC can perform UTF8 encoding on the song queue, organize it into an XML format, and send it to the DMP through the UPnP protocol. Wherein, the song queue that DMC sends to DMP can be as shown in Figure 2, not only can include the mark of songs such as song 1, song 2 and song 3, can also include the metadata of songs such as song 1, song 2, song 3. Taking the metadata of song 1 as an example, the metadata may include the URI list corresponding to song 1 and the attribute data of song 1, wherein the URI list corresponding to song 1 may include URI-1, URI-2, and URI-3, etc. The URI of song 1, the attribute data of song 1 can include the name of song 1, artist name, album name, album cover, song number, song duration, lyrics and custom data. In one embodiment, the attribute data of song 1 may also include one or more of song 1's title, singer name, album name, album cover, song number, song duration, lyrics, and custom data. Examples are not limited.
S302、DMP接收到DMC通过UPnP协议发送的歌曲队列后,存储DMC发送的歌曲队列。S302. After receiving the song queue sent by the DMC through the UPnP protocol, the DMP stores the song queue sent by the DMC.
S303、DMP接收DMC通过UPnP协议发送的针对歌曲队列的插入、删除、替换等编辑操作指令。S303. The DMP receives editing operation instructions such as insertion, deletion, and replacement for the song queue sent by the DMC through the UPnP protocol.
其中,DMC可以根据用户操作,通过UPnP协议发送针对歌曲队列的插入、删除、替换等编辑操作指令给DMP。Wherein, the DMC can send editing operation instructions such as insertion, deletion, and replacement of the song queue to the DMP through the UPnP protocol according to user operations.
S304、DMP响应该编辑操作指令,并执行针对歌曲队列的插入、删除、替换等编辑操作。S304. The DMP responds to the editing operation instruction, and performs editing operations such as insertion, deletion, and replacement for the song queue.
需要说明的是,步骤S303~步骤S304是可选的,本发明实施例不作限定。It should be noted that steps S303 to S304 are optional, and are not limited in this embodiment of the present invention.
S305、DMP接收DMC通过UPnP协议发送的歌曲播放指令,该歌曲播放指令包括歌曲的标识。S305. The DMP receives the song play instruction sent by the DMC through the UPnP protocol, and the song play instruction includes a song identifier.
S306、DMP接收DMC发送的歌曲播放指令后,响应该歌曲播放指令,从存储的歌曲队列中的该歌曲对应的URI列表中顺序读取存储的一个URI。S306. After receiving the song play instruction sent by the DMC, the DMP responds to the song play instruction and sequentially reads a stored URI from the URI list corresponding to the song in the stored song queue.
本发明实施例中,该歌曲对应的URI列表中的URI按照URI标识的歌曲的品质从高到低的顺序排列。例如,歌曲1对应的URI列表中URI-1、URI-2以及URI-3顺序排序,URI-1标识的歌曲的品质最高、URI-2标识的歌曲的品质次高、URI-3标识的歌曲的品质最低。In the embodiment of the present invention, the URIs in the URI list corresponding to the song are arranged in descending order of the quality of the song identified by the URI. For example, in the URI list corresponding to song 1, URI-1, URI-2, and URI-3 are sorted sequentially. The song identified by URI-1 has the highest quality, the song identified by URI-2 has the second highest quality, and the song identified by URI-3 has the highest quality. of the lowest quality.
本发明实施例中,URI用于标识该歌曲在互联网中的存储位置。In the embodiment of the present invention, the URI is used to identify the storage location of the song in the Internet.
S307、DMP判断对读取的URI的链接是否成功,如果不成功,则执行步骤S308;如果成功,则执行步骤S309。S307. The DMP judges whether the link to the read URI is successful, if not, execute step S308; if successful, execute step S309.
S308、DMP判断该歌曲对应的URI列表中是否存在下一个URI,如果是,则继续执行步骤S306,以从存储的歌曲队列中的该歌曲对应的URI列表中顺序读取存储的下一个URI;如果否,则继续执行步骤S310。S308, DMP judges whether next URI exists in the URI list corresponding to this song, if yes, then continue to execute step S306, to read the next URI stored in sequence from the URI list corresponding to this song in the song queue stored; If not, proceed to step S310.
S309、DMP播放链接成功的URI标识的歌曲。S309. The DMP plays the song identified by the URI that is successfully linked.
S310、DMP判断是否还存在下一首歌曲,如果是,则执行步骤S311;如果否,结束本流程。S310, the DMP judges whether there is a next song, if yes, execute step S311; if no, end this process.
S311、DMP按顺序选择下一首歌曲,并执行步骤S306。S311. The DMP selects the next song in sequence, and executes step S306.
本发明实施例中,DMP可以接收DMC通过UPnP协议发送的针对歌曲的选择、播放、暂停、停止以及循环(单曲循环或整个列表循环)等播控指令,并响应该播控指令,执行针对歌曲的选择、播放、暂停、停止以及循环等播控操作。In the embodiment of the present invention, the DMP can receive broadcast control instructions such as selection, play, pause, stop, and cycle (single song cycle or entire list cycle) sent by the DMC through the UPnP protocol, and respond to the play control command. Song selection, play, pause, stop, loop and other playback control operations.
本发明实施例中,对于每一首歌曲,DMP会按照顺序依次尝试该歌曲对应的URI列表里的每一个URI,如果对某一个URI的链接成功,便立即播放该URI标识的歌曲;如果失败,便尝试该URI列表里的下一个URI,直到找到一个能用的URI。如果当前歌曲的所有URI的链接全部失败,则跳转到下一首歌曲继续执行本发明流程。如果当前歌曲播放结束,可以自动跳转到下一首歌曲继续执行本发明流程;或者,在单曲循环模式下,可以重复播放当前歌曲。如果歌曲队列中最后一首歌曲播放结束,就结束整个列表的播放;或在整个列表循环播放模式下,自动跳转到第一首歌曲继续播放。In the embodiment of the present invention, for each song, the DMP will try each URI in the URI list corresponding to the song in order, and if the link to a certain URI is successful, the song of the URI identification will be played immediately; , then try the next URI in the list of URIs until a usable URI is found. If the links of all URIs of the current song all fail, then jump to the next song and continue to execute the process of the present invention. If the playing of the current song ends, it can automatically jump to the next song to continue the process of the present invention; or, in the single loop mode, the current song can be played repeatedly. If the last song in the song queue is finished playing, it will end the playback of the entire list; or in the loop playback mode of the entire list, it will automatically jump to the first song to continue playing.
本发明实施例中,图3所描述的方法适用于数字家庭网络,不仅可以实现数字家庭网络中的DMC和DMP之间的互联,还可以实现DMC对DMP的控制,从而能够在数字家庭网络中有效的提高DMP的歌曲播放命中率。In the embodiment of the present invention, the method described in Fig. 3 is suitable for digital home network, not only can realize the interconnection between DMC and DMP in the digital home network, but also can realize the control of DMC to DMP, thus can be in the digital home network Effectively improve the hit rate of DMP song playback.
在图3所描述的方法中,DMP不存储歌曲本身,而是存储歌曲对应的多个URI,这样可以确保最终对读取的URI的链接成功,从而可以能够有效的提高歌曲的播放命中率。In the method described in FIG. 3 , the DMP does not store the song itself, but stores multiple URIs corresponding to the song, which can ensure that the final link to the read URI is successful, thereby effectively improving the playback hit rate of the song.
请参阅图4,图4是本发明实施例公开的一种歌曲播放装置的结构图。其中,图4所描述的歌曲播放装置适用于音箱(无线或有线)、智能手机(Android手机、iOS手机等)、平板电脑、掌声电脑以及移动互联网设备(Mobile Internet Devices,MID)、PC等数字媒体播放器(Digital Media Player,DMP),本发明实施例不作限定。如图4所示,该歌曲播放装置400可以包括:Please refer to FIG. 4 . FIG. 4 is a structural diagram of a song playing device disclosed in an embodiment of the present invention. Among them, the song playing device described in Figure 4 is suitable for speakers (wireless or wired), smart phones (Android phones, iOS phones, etc.), tablet computers, applause computers, mobile Internet devices (Mobile Internet Devices, MID), PCs and other digital A media player (Digital Media Player, DMP) is not limited in this embodiment of the present invention. As shown in Figure 4, the song player 400 may include:
获取单元401,用于获取歌曲队列以及播放控制指令,该歌曲队列中至少一首歌曲配置有URI列表,URI用于标识该歌曲的存储位置;The obtaining unit 401 is used to obtain the song queue and the play control instruction, at least one song in the song queue is configured with a URI list, and the URI is used to identify the storage location of the song;
读取单元402,用于根据播放控制指令,从歌曲对应的URI列表中读取存储的一个URI,其中,URI用于标识该歌曲的存储位置;The reading unit 402 is configured to read a stored URI from the URI list corresponding to the song according to the play control instruction, wherein the URI is used to identify the storage location of the song;
判断单元403,用于判断对读取的URI的链接是否成功;A judging unit 403, configured to judge whether the link to the read URI is successful;
播放单元404,用于在判断单元403的判断出对读取的URI的链接不成功时,通知读取单元402从该歌曲对应的URI列表中读取存储的下一个URI,直到判断单元403判断出对读取的URI的链接成功时,播放链接成功的URI标识的歌曲,否则切换至歌曲队列中的下一歌曲。The playback unit 404 is used to notify the reading unit 402 to read the next URI stored in the URI list corresponding to the song when the judging unit 403 judges that the link to the read URI is unsuccessful, until the judging unit 403 judges When the link to the read URI is successful, play the song identified by the URI with successful link, otherwise switch to the next song in the song queue.
在一个实施例中,图4所示的装置400中,获取单元401获取播放控制指令包括:In one embodiment, in the apparatus 400 shown in FIG. 4 , obtaining the playback control instruction by the obtaining unit 401 includes:
获取单元401用于接收DMC发送的歌曲播放指令,该歌曲播放指令包括歌曲的标识。The acquiring unit 401 is configured to receive a song playing instruction sent by the DMC, where the song playing instruction includes a song identifier.
在一个实施例中,图4所示的装置400中,获取单元401获取歌曲队列包括:In one embodiment, in the apparatus 400 shown in FIG. 4 , obtaining the song queue by the obtaining unit 401 includes:
获取单元401用于接收DMC发送的歌曲队列,该歌曲队列中包括每一首歌曲的标识以及每一首歌曲的元数据,其中,每一首歌曲的元数据包括该歌曲对应的URI列表以及该歌曲的属性数据,该歌曲对应的URI列表中包括至少两种不同的URI。The acquisition unit 401 is used to receive the song queue sent by the DMC, the song queue includes the identifier of each song and the metadata of each song, wherein the metadata of each song includes the URI list corresponding to the song and the The attribute data of the song, the URI list corresponding to the song includes at least two different URIs.
本发明实施例中,图4所示的装置400还可以包括:In the embodiment of the present invention, the device 400 shown in FIG. 4 may also include:
存储单元405,用于存储DMC发送的歌曲队列。The storage unit 405 is configured to store the queue of songs sent by the DMC.
相应地,读取单元402用于从存储单元405存储的该歌曲对应的URI列表中读取存储的一个URI。Correspondingly, the reading unit 402 is configured to read a stored URI from the list of URIs corresponding to the song stored in the storage unit 405 .
本发明实施例中,该歌曲的属性数据包括该歌曲的名称、歌手名、专辑名、专辑封面、歌曲编号、歌曲时长、歌词以及自定义数据中的一种或几种,本发明实施例不作限定。In the embodiment of the present invention, the attribute data of the song includes one or more of the name of the song, singer name, album name, album cover, song number, song duration, lyrics, and custom data. limited.
本发明实施例中,读取单元402从歌曲对应的URI列表中读取存储的URI是顺序读取的;其中,URI列表中的URI按照URI标识的歌曲的品质从高到低的顺序排列。In the embodiment of the present invention, the reading unit 402 reads the stored URIs from the URI list corresponding to the songs sequentially; wherein, the URIs in the URI list are arranged in descending order of the quality of the songs identified by the URIs.
在图4所描述的装置中,不存储歌曲本身,而是存储歌曲对应的多个URI,这样可以确保最终对读取的URI的链接成功,从而可以能够有效的提高歌曲的播放命中率。In the device described in FIG. 4 , instead of storing the song itself, multiple URIs corresponding to the song are stored, which can ensure that the final link to the read URI is successful, thereby effectively improving the hit rate of playing the song.
本发明实施例进一步公开了一种计算机存储介质,该计算机存储介质存储有程序,该程序执行时包括如图1、图2所示方法的全部步骤。The embodiment of the present invention further discloses a computer storage medium, the computer storage medium stores a program, and when the program is executed, it includes all the steps of the method shown in Fig. 1 and Fig. 2 .
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令音箱等播放设备相关的硬件来完成,该程序可以存储于音箱等播放设备的计算机可读存储介质中,并被播放设备中的至少一个处理器来执行,以实现歌曲的播放。其中,所述存储介质可以包括:闪存盘、只读存储器(Read-Only Memory,ROM)、随机存取器(Random AccessMemory,RAM)、磁盘或光盘等。Those of ordinary skill 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 the hardware related to playback devices such as speakers through a program, and the program can be stored in computer-readable storage of playback devices such as speakers. media, and be executed by at least one processor in the playback device, so as to realize the playback of songs. Wherein, the storage medium may include: a flash disk, a read-only memory (Read-Only Memory, ROM), a random access device (Random Access Memory, RAM), a magnetic disk or an optical disk, and the like.
以上对本发明实施例公开的一种歌曲播放方法及装置进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。A song playing method and device disclosed in the embodiment of the present invention has been introduced in detail above. The principle and implementation of the present invention have been explained by using specific examples in this paper. The description of the above embodiment is only used to help understand the present invention. method and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and application scope. Invention Limitations.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310222675.6A CN103309968B (en) | 2013-06-06 | 2013-06-06 | A kind of playback of songs method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310222675.6A CN103309968B (en) | 2013-06-06 | 2013-06-06 | A kind of playback of songs method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103309968A CN103309968A (en) | 2013-09-18 |
CN103309968B true CN103309968B (en) | 2016-08-10 |
Family
ID=49135186
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310222675.6A Active CN103309968B (en) | 2013-06-06 | 2013-06-06 | A kind of playback of songs method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103309968B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104539606B (en) * | 2014-12-24 | 2018-09-18 | 歌尔股份有限公司 | Audio file management method, device and system based on Upnp |
CN104936092B (en) * | 2015-05-20 | 2018-09-04 | 广东欧珀移动通信有限公司 | A kind of processing method of data, relevant apparatus and system |
CN105117490A (en) * | 2015-09-21 | 2015-12-02 | 广东欧珀移动通信有限公司 | Method and device for displaying lyrics of song played by intelligent sound box |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101021860A (en) * | 2006-02-13 | 2007-08-22 | 国际商业机器公司 | Method and system for invoking an audio hyperlink embedded in a markup document |
CN102682003A (en) * | 2011-03-10 | 2012-09-19 | 百度在线网络技术(北京)有限公司 | Method, device and equipment for determining sorting positions of specific resource links |
-
2013
- 2013-06-06 CN CN201310222675.6A patent/CN103309968B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101021860A (en) * | 2006-02-13 | 2007-08-22 | 国际商业机器公司 | Method and system for invoking an audio hyperlink embedded in a markup document |
CN102682003A (en) * | 2011-03-10 | 2012-09-19 | 百度在线网络技术(北京)有限公司 | Method, device and equipment for determining sorting positions of specific resource links |
Also Published As
Publication number | Publication date |
---|---|
CN103309968A (en) | 2013-09-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107146608B (en) | Playing control method and device and intelligent equipment | |
CN104934048A (en) | Sound effect regulation method and device | |
US9621945B2 (en) | Method and system for continuously playing media resource in device | |
CN104954853B (en) | A kind of broadcast information store method, system, playback terminal and control terminal | |
EP3074978B1 (en) | Interactive media system | |
CN105682011A (en) | Bluetooth module control method and device of playback device, and audio and video playback system | |
CN103309968B (en) | A kind of playback of songs method and device | |
CN107146609B (en) | Switching method and device of playing resources and intelligent equipment | |
CN105679341B (en) | A file playing method, device and mobile terminal | |
CN104080017A (en) | Method, device and system for playing tab files | |
JP5338383B2 (en) | Content playback system | |
CN105338009A (en) | Control method and system of electronic equipment, and associated equipment | |
EP3203468B1 (en) | Acoustic system, communication device, and program | |
CN104954858A (en) | Method for annotating and quickly playing multimedia playing nodes, mobile terminal and playing equipment | |
CN103475436A (en) | Method for transmitting audio playlist and play position based on DLNA technology | |
CN104991946B (en) | Information processing method, server and user equipment | |
CN105828135A (en) | Playback control method, device and playback device in audio and video playback system | |
CN105261379B (en) | A kind of playlist synchronous method, wireless sound box and DMC | |
JP2010288086A (en) | Information processing device, information processing method, operation terminal and information processing system | |
JP5418567B2 (en) | Receiver | |
JP6425158B2 (en) | Server apparatus, program, and system | |
CN105096988B (en) | Sound box playlist synchronization method and terminal | |
JP5759936B2 (en) | Electrical product receiving related data of automatic voice response system, related data acquisition method of automatic voice response system, and program | |
US20240378013A1 (en) | Speaker system, sound bar, wireless speaker, and method for controlling speaker system | |
JP5738664B2 (en) | Content reproduction control apparatus, content reproduction control method, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
C41 | Transfer of patent application or patent right or utility model | ||
TR01 | Transfer of patent right |
Effective date of registration: 20161124 Address after: 510000 Guangzhou, Tianhe District branch Yun Yun Road, No. 16, self built room 2, building 1301 Patentee after: GUANGZHOU KUGOU COMPUTER TECHNOLOGY Co.,Ltd. Address before: Shenzhen Futian District City, Guangdong province 518057 Zhenxing Road, SEG Science Park 2 East Room 403 Patentee before: TENCENT TECHNOLOGY (SHENZHEN) Co.,Ltd. |
|
CP02 | Change in the address of a patent holder |
Address after: No. 315, Huangpu Avenue middle, Tianhe District, Guangzhou City, Guangdong Province Patentee after: GUANGZHOU KUGOU COMPUTER TECHNOLOGY Co.,Ltd. Address before: Room 1301, building 2, No.16 Keyun Road, Tianhe District Patentee before: GUANGZHOU KUGOU COMPUTER TECHNOLOGY Co.,Ltd. |
|
CP02 | Change in the address of a patent holder | ||
TR01 | Transfer of patent right |
Effective date of registration: 20220329 Address after: 4119, 41st floor, building 1, No.500, middle section of Tianfu Avenue, Chengdu hi tech Zone, China (Sichuan) pilot Free Trade Zone, Chengdu, Sichuan 610000 Patentee after: Chengdu kugou business incubator management Co.,Ltd. Address before: No. 315, Huangpu Avenue middle, Tianhe District, Guangzhou City, Guangdong Province Patentee before: GUANGZHOU KUGOU COMPUTER TECHNOLOGY Co.,Ltd. |
|
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20241203 Address after: No. 315, Huangpu Avenue middle, Tianhe District, Guangzhou City, Guangdong Province Patentee after: GUANGZHOU KUGOU COMPUTER TECHNOLOGY Co.,Ltd. Country or region after: China Address before: 4119, 41st floor, building 1, No.500, middle section of Tianfu Avenue, Chengdu hi tech Zone, China (Sichuan) pilot Free Trade Zone, Chengdu, Sichuan 610000 Patentee before: Chengdu kugou business incubator management Co.,Ltd. Country or region before: China |
|
TR01 | Transfer of patent right |