Invention content
In view of this, the present invention provides a kind of music shuffle method and apparatus, can one of shuffle withSame a piece of music is repeated playing in machine cycle.
To achieve the above object, the present invention provides a kind of music shuffle method, the method includes:
It is that weight is respectively set in each music file, and determines each sound respectively according to the weight of each music file in advanceTo be played number of the music file in a random rotation;
Create shuffle playlist, the shuffle playlist includes the link of each music file, wherein described inThe number and each music file itself of the link for each music file that machine playlist includes are in a random rotationNumber to be played it is identical;
The corresponding each music file of link in shuffle playlist described in shuffle.
Preferably, described that weight is respectively set for each music file in advance, including:
User is collected to be accustomed to the broadcasting of each music file;
It is accustomed to according to the broadcasting of collection, weight is respectively set for each music file.
Preferably, the corresponding each music file of link in shuffle playlist described in the shuffle, including:
After the corresponding music file of any link in the shuffle playlist is played, the link is deleted, andObtain updated shuffle playlist;
Continue the corresponding each music file of link in updated shuffle playlist described in shuffle.
Preferably, the method further includes:
When receiving after cutting song instruction of user's triggering, music file currently playing in the shuffle playlist is deletedCorresponding link.
Preferably, the method further includes:
After deleting any link in the shuffle playlist, the corresponding music file of link described in synchronized update existsNumber to be played in one random rotation.
The present invention also provides a kind of music shuffle device, described device includes:
Setup module, for being that weight is respectively set in each music file in advance;
Determining module, for determining each music file in a random rotation respectively according to the weight of each music fileIn number to be played;
Creation module, for creating shuffle playlist, the shuffle playlist includes the chain of each music fileIt connects, wherein the number of the link for each music file that the shuffle playlist includes and each music file itself are oneNumber to be played in a random rotation is identical;
Playing module, for the corresponding each music file of link in shuffle playlist described in shuffle.
Preferably, the setup module, including:
Submodule is collected, the broadcasting of each music file is accustomed to for collecting user;
Submodule is set, for being accustomed to according to the broadcasting of collection, weight is respectively set for each music file.
Preferably, the playing module, including:
Submodule is deleted, is used for after the corresponding music file of any link in the shuffle playlist is played,The link is deleted, and obtains updated shuffle playlist;
Submodule is played, for the corresponding each music of link in updated shuffle playlist described in shuffleFile.
Preferably, described device further includes:
Removing module, for when receiving after cutting song instruction of user's triggering, deleting current in the shuffle playlistThe corresponding link of music file of broadcasting.
Preferably, described device further includes:
Update module is used for after deleting any link in the shuffle playlist, link pair described in synchronized updateTo be played number of the music file answered in a random rotation.
The present invention is that weight is respectively set in each music file, and is determined respectively according to the weight of each music file firstTo be played number of each music file in a random rotation.Secondly, shuffle playlist, the shuffle row are createdTable includes the link of each music file, wherein of the link for each music file that the shuffle playlist includesNumber is identical as to be played number of each music file in a random rotation itself.Finally, with machine sowing described in shuffleEmplace the corresponding each music file of link in table.Compared with prior art, the present invention can be in music shuffle play modeUnder, realize the multiple broadcasting to same first song in a random rotation, that improves user listens song to experience.
Specific implementation mode
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present inventionIn attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment isA part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the artThe every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Currently, there are itself for the music random play features of various common music players (such as Koowo music box)Limitation.For example, when user want in a random rotation it is secondary broadcasting with a piece of music when, existing music player isIt is irrealizable.So affecting the listening experience of user to a certain extent.The present inventor proposes following scheme,Music random play features in existing music player can be carried out it is perfect, improve user listen song experience.
In the present invention, weight is respectively set for each music file that music player to be played first, secondly, according to eachThe weight of a music file is respectively that each music file determines the number to be played in a random rotation.Again, it createsOne shuffle playlist, the link for storing each music file, each music in the specific shuffle playlistNumber to be played is identical in a random rotation with itself for the number of the connection of file.Finally, according to traditional music withMachine playback method plays the corresponding each music file of link in the shuffle playlist.
The embodiment of the present invention is described below.
It is provided in an embodiment of the present invention one that an embodiment of the present invention provides a kind of music shuffle methods with reference to figure 1Kind music shuffle method flow diagram, wherein the method includes:(S101-S104)
S101:It is that weight is respectively set in each music file in advance.
S102:Determine that each music file waits broadcasting in a random rotation respectively according to the weight of each music filePut number.
S103:Shuffle playlist is created, the shuffle playlist includes the link of each music file, wherein instituteThe number for stating the link for each music file that shuffle playlist includes is followed with each music file itself at one at randomNumber to be played in ring is identical.
S104:The corresponding each music file of link in shuffle playlist described in shuffle.
It wherein,, can be to difference in a random rotation in order to realize under music shuffle play mode in S101Music file play different numbers, in other words, in order to meet listen to demand of the user to different music files, the present inventionEmbodiment is that different weights is arranged in different music files in advance.
In practical application, a kind of realization method is that directly according to user, this demand for listening to music is each music textWeight is arranged in part.Another realization method is to be accustomed to the broadcasting of each music file by constantly collecting user, be each soundWeight is respectively set in music file.For example, then it is music text when user actively selects some music file and finishesPart increases weight, as weight increases by 1;When repeatedly selecting some music file in user's short time and finishing, for the soundMusic file increases weight, as weight increases broadcasting time;When some music file is cut song in playing process, by the musicThe weight of file is reduced, and weight subtracts 1 if being cut song once, and being cut song, then weight subtracts 3 twice;In addition, the embodiment of the present inventionIt can be combined with user and its weight determined to the integrated degree of listening to of every first song, such as whether certain head song hears out or major part is heard outEtc. a variety of conditions.
In S102, after the weight of each music file determines, determine it one according to the weight of each music fileNumber to be played in a random rotation.That is, the weight of each music file determines it in a random rotationPlayed number.Specifically, more for the played number that the larger music file of weight determines.It, can in practical applicationTo pre-set different weighting levels, that is to say, that according to the weighted of music file, different music files are assigned toIn different weighting levels, and pre-set weighting levels and music file in a random rotation number to be played it is correspondingRelationship can determine to be played number of each music file in a random rotation according to the correspondence.
In S103, a shuffle playlist is created, wherein the shuffle playlist includes each music fileLink, the usually title of music file, such as song title.It is worth noting that, the sound that the shuffle playlist includesThere is the link repeated in the link of music file.Specifically, the number of the repetition of the link of each music file and each music textTo be played number of the part in a random rotation itself is identical.
The embodiment of the present invention is in order to realize repeatedly being played to same a piece of music in a random rotation of initially proposingGoal of the invention replicates the song title of this song several times, to obtain multiple song titles of this song, and by theseThe shuffle playlist is added in song title.In addition, the embodiment of the present invention can also be multiple song titles of same first songIncrease mark, such as works as song《Like that I am Chinese》When number to be played in a random rotation is 3, in shuffle playlistIn the link of the song be respectively《Like my China 1》、《Like my China 2》、《Like my China 3》.
In S104, after the completion of shuffle playlist establishment, the link pair in shuffle playlist described in shuffleThe each music file answered.Specifically, being broadcast when any one in the shuffle playlist links corresponding music fileAfter the completion of putting, the link is deleted from the shuffle playlist directly, obtains updated shuffle playlist.ButIt is deleted to link with this and belongs to other of same music file and link and will not be involved, that is to say, that other are linked at subsequentlyShuffle in still be able to selected and play.In this way, the embodiment of the present invention is realized in a random rotationIn multiple broadcasting to the same music file.
In a kind of realization method, when user cuts song operation to the music file execution being currently played, system receivesCut song instruction to what user triggered, while song instruction is cut described in execution, delete in the shuffle playlist it is currentThe corresponding link of music file of broadcasting.That is, system can adjust in real time according to the demand of user it is described with machine sowingTable is emplaced, experience is sung to further increase listening for user.
In addition, after any one link in the shuffle playlist is deleted, the synchronized update deleted chainTo be played number of the corresponding music file in a random rotation is connect, to ensure that the shuffle playlist includes eachThe number of the link of a music file is identical as to be played number of each music file in a random rotation itself.
To sum up, weight is respectively set for each music file first in the embodiment of the present invention, and according to each music fileWeight determines to be played number of each music file in a random rotation respectively.Secondly, shuffle playlist, institute are createdThe link that shuffle playlist includes each music file is stated, wherein each music text that the shuffle playlist includesThe number of the link of part is identical as to be played number of each music file in a random rotation itself.Finally, with machine sowingPut the corresponding each music file of link in the shuffle playlist.Compared with prior art, the embodiment of the present invention canUnder music shuffle play mode, the multiple broadcasting to same first song in a random rotation is realized, that improves user listens song bodyIt tests.
Music shuffle method provided in an embodiment of the present invention can be applied in music player, be broadcast with improving musicPut the random play features of device.In addition, the music shuffle method can also be installed on webpage version music in the form of plug-in unitIn player, to improve the random play features of webpage version music player.
The embodiment of the present invention additionally provides a kind of music shuffle device, and with reference to figure 2, Fig. 2 carries for the embodiment of the present inventionA kind of music shuffle apparatus structure schematic diagram supplied, described device include:(201-204)
Setup module 201, for being that weight is respectively set in each music file in advance.
Determining module 202, for determining that each music file is random at one respectively according to the weight of each music fileNumber to be played in cycle.
Creation module 203, for creating shuffle playlist, the shuffle playlist includes each music fileLink, wherein the number of the link for each music file that the shuffle playlist includes and each music file itself existNumber to be played in one random rotation is identical.
Playing module 204, for the corresponding each music file of link in shuffle playlist described in shuffle.
Music shuffle device provided in an embodiment of the present invention can be each by the custom of collection user listened to musicWeight is arranged in a music file.Specifically, the setup module, including:
Submodule is collected, the broadcasting of each music file is accustomed to for collecting user;
Submodule is set, for being accustomed to according to the broadcasting of collection, weight is respectively set for each music file.
In addition, the playing module, including:
Submodule is deleted, is used for after the corresponding music file of any link in the shuffle playlist is played,The link is deleted, and obtains updated shuffle playlist;
Submodule is played, for the corresponding each music of link in updated shuffle playlist described in shuffleFile.
Experience is sung in order to further increase listening for user, the embodiment of the present invention can adjust according to the demand of user in real timeThe shuffle playlist.
Described device further includes:
Removing module, for when receiving after cutting song instruction of user's triggering, deleting current in the shuffle playlistThe corresponding link of music file of broadcasting.
In order to ensure each music file that the shuffle playlist includes link number and each music textTo be played number of the part in a random rotation itself is identical, and described device further includes:
Update module is used for after deleting any link in the shuffle playlist, link pair described in synchronized updateTo be played number of the music file answered in a random rotation.
In random music playing device provided in an embodiment of the present invention, weight is respectively set for each music file in advance,And to be played number of each music file in a random rotation is determined according to the weight of each music file respectively.It createsShuffle playlist, the shuffle playlist include the link of each music file, wherein in the shuffle playlistIncluding each music file link number to be played in a random rotation of number and each music file itselfIt is identical.The corresponding each music file of link in shuffle playlist described in shuffle.Compared with prior art, of the inventionEmbodiment can be realized the multiple broadcasting to same first song in a random rotation, improve and use under music shuffle play modeSong is listened to experience in family.
For device embodiments, since it corresponds essentially to embodiment of the method, so related place is referring to method realityApply the part explanation of example.The apparatus embodiments described above are merely exemplary, wherein described be used as separating componentThe unit of explanation may or may not be physically separated, and the component shown as unit can be or can alsoIt is not physical unit, you can be located at a place, or may be distributed over multiple network units.It can be according to actualIt needs that some or all of module therein is selected to achieve the purpose of the solution of this embodiment.Those of ordinary skill in the art are notIn the case of making the creative labor, you can to understand and implement.
It should be noted that herein, relational terms such as first and second and the like are used merely to a realityBody or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operationIn any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended toNon-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including thoseElement, but also include other elements that are not explicitly listed, or further include for this process, method, article or equipmentIntrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded thatThere is also other identical elements in process, method, article or equipment including the element.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the artFor member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answeredIt is considered as protection scope of the present invention.