Disclosure of Invention
The application aims to provide a method and a terminal for playing songs, which can solve the technical problems, automatically switch playing sources to play songs when a user plays songs, and improve user experience without manually switching the playing sources.
In order to solve the above technical problems, the present application provides a method for playing songs, which is applied to a terminal, and includes:
obtaining song information of a song to be played;
searching a playing source of the song to be played according to the song information;
And playing the song to be played according to the playing source.
The searching the playing source of the song to be played according to the song information comprises the following steps:
Sending a play source query request to a cloud server, wherein the play source query request comprises the song information, so that the cloud server returns a query result according to the song information, and the cloud server stores the song information and the corresponding play source information;
and if the query result contains the play source information, taking the play source corresponding to the play source information as the play source of the song to be played.
Wherein, the searching the playing source of the song to be played according to the song information further comprises:
If the query result does not contain the playing source information, searching the playing source of the song to be played from song playing software installed in the terminal according to the song information;
and determining the playing source of the song to be played according to the searching result.
The searching the playing source of the song to be played according to the song information comprises the following steps:
Searching a playing source of the song to be played from song playing software installed in the terminal according to the song information;
and determining the playing source of the song to be played according to the searching result.
Wherein, the determining the playing source of the song to be played according to the searching result includes:
If the unique song playing software is found, taking the found song playing software as a playing source of the song to be played;
and if the searched song playing software is not unique, confirming one song playing software as a playing source of the song to be played according to a preset rule.
Wherein, the determining the playing source of the song to be played according to the searching result further comprises:
if the song playing software is not found, sending a playing source searching request to a cloud server, wherein the playing source searching request comprises the song information, so that the cloud server returns a searching result according to the song information;
and taking a playing source corresponding to the playing source information in the search result as the playing source of the song to be played.
The playing source is song playing software, and playing the song to be played according to the playing source comprises:
And controlling the corresponding song playing software to play the song to be played.
Wherein after the song to be played is played according to the playing source, the method further comprises:
And if the song information and the corresponding playing source information are not stored in the cloud server, sending the song information and the corresponding playing source information to the cloud server for storage.
Wherein, playing the song to be played according to the playing source includes:
If the playing source is song playing software installed in the terminal, controlling the song playing software to play the song to be played;
if the playing source is the song playing software which is not installed in the terminal, prompting to install the song playing software, and controlling the song playing software to play the song to be played after the song playing software is successfully installed.
The application also provides a terminal comprising a memory storing at least one program instruction and a processor implementing the method of playing a song as described above by loading and executing the at least one program instruction.
According to the method and the terminal for playing the songs, after the terminal obtains the song information of the songs to be played, the playing source of the songs to be played is searched according to the song information, and the songs to be played are played according to the playing source. By the mode, the playing source can be automatically switched to play the song when the user plays the song, the user does not need to manually switch the playing source, and the user experience is improved.
The foregoing description is only an overview of the present application, and is intended to be implemented in accordance with the teachings of the present application, as well as the preferred embodiments thereof, together with the following detailed description of the application, given by way of illustration only, together with the accompanying drawings.
Detailed Description
In order to further describe the technical means and effects adopted by the present application for achieving the purpose of booking applications, the following detailed description is given below of the positioning method of the mobile terminal, the vehicle-mounted terminal and the specific implementation, method, steps, structure, characteristics and effects of the mobile terminal according to the present application in combination with the accompanying drawings and the preferred embodiments.
The foregoing and other features, aspects, and advantages of the present application will become more apparent from the following detailed description of the preferred embodiments, which proceeds with reference to the accompanying drawings. While the application may be susceptible to further details of embodiments and their technical means and effects for the purpose of attaining a subscription, the drawings are merely to provide a further understanding of the application and are not to be construed as limiting the application.
Fig. 1 is a flow chart illustrating a method of playing songs according to a first embodiment. Referring to fig. 1, the method for playing songs in this embodiment is applied to a terminal, which may be a mobile terminal or a vehicle-mounted terminal, and the method for playing songs includes:
step 110, obtaining song information of a song to be played;
step 120, searching a playing source of the song to be played according to the song information;
And 130, playing the song to be played according to the playing source.
The embodiment is implemented by software installed on a terminal, and the software aggregates multiple types of song playing software, so that searching and playing of songs to be played can be performed through the song playing software or a playing server corresponding to the song playing software, and different song playing software, namely, different playing sources, are selected, wherein the playing sources comprise song playing software or a webpage platform corresponding to the song playing software, for example, if a song can be found and played in B software, the B software is the playing source of the a song, and if a song can be found and played in the webpage platform of the B software, the B software is the playing source of the a song.
In step 110, when the user selects the song play list to play, the terminal sequentially obtains song information of songs to be played in the song play list according to the playing progress, where the song information includes, but is not limited to, song names, singers, albums, and the like. The song play list may contain one or more songs, for example, the user may play a history of songs directly or by retrieving a determined song, the song currently to be played, i.e., the song in the play list.
In step 120, the play source may be found by a cloud server or in a terminal. In the terminal, the playing source can be confirmed by sequentially communicating with the song playing software installed in the terminal in a polling mode, and thus, the song playing software is confirmed to be the playing source when the song playing software is found. In actual implementation, after communication with each song playing software installed in the terminal, all playing sources capable of playing songs to be played are determined, and then appropriate playing sources are selected, for example, song playing software with higher use frequency of a user is selected from the sources to play, or song playing software with the largest playing times of songs to be played is selected from the sources to play.
In step 130, after the play source is found, if the play source is the song play software installed in the terminal, the song play software is controlled to play the song to be played, and if the play source is the song play software not installed in the terminal, the song play software is prompted to be installed, and after the song play software is successfully installed, the song play software is controlled to play the song to be played. In actual implementation, if the playing source is the song playing software which is not installed in the terminal, the user can also be prompted to select to skip to the corresponding webpage platform to play the song or to install the song playing software to play the song, if the user selects to skip to the corresponding webpage platform, the user skips to the webpage platform corresponding to the playing source to play the song to be played, and if the user selects to install the song playing software, the song playing software is controlled to play the song to be played after the song playing software is successfully installed. The user can set a default processing mode when the playing source is the song playing software which is not installed in the terminal, for example, default to skip to a webpage platform corresponding to the playing source for playing, so when the playing source is the song playing software which is not installed in the terminal, the song to be played is played according to the default mode set by the user and the playing source.
By the method, when the user plays the song list, the terminal can dynamically switch to different play sources for playing according to the current song to be played, and the user does not need to manually switch the play sources for searching songs and playing, so that the song listening experience of the user is optimized.
In one embodiment, after playing the song to be played according to the playing source, the method further includes:
and if the song information and the corresponding playing source information are not stored in the cloud server, sending the song information and the corresponding playing source information to the cloud server for storage.
By storing the song information and the corresponding playing source information in the cloud server, the playing source can be confirmed without executing all searching steps when the same song is played again, so that the resource consumption is reduced, and the playing efficiency is improved.
According to the method for playing songs, after the terminal obtains the song information of the songs to be played, the playing source of the songs to be played is searched according to the song information, and the songs to be played are played according to the playing source. By the mode, the playing source can be automatically switched to play the song when the user plays the song, the user does not need to manually switch the playing source, and the user experience is improved.
Fig. 2 is a flow chart illustrating a method of playing songs according to a second embodiment. Referring to fig. 2, the method for playing songs in this embodiment includes:
step 210, obtaining song information of a song to be played;
Step 220, sending a play source query request to the cloud server, wherein the play source query request comprises song information, so that the cloud server returns a query result according to the song information, and the cloud server stores the song information and the corresponding play source information;
Step 230, judging whether the query result contains playing source information, if yes, executing step 240; otherwise, executing step 250;
Step 240, taking the playing source corresponding to the playing source information as the playing source of the song to be played, and executing step 270;
step 250, searching a playing source of a song to be played from song playing software installed in the terminal according to song information;
step 260, determining a playing source of the song to be played according to the searching result;
Step 270, playing the song to be played according to the playing source.
The embodiment is implemented by software installed on a terminal, and the software aggregates multiple types of song playing software, so that searching and playing of songs to be played can be performed through the song playing software or a playing server corresponding to the song playing software, and different song playing software, namely, different playing sources, are selected, wherein the playing sources comprise song playing software or a webpage platform corresponding to the song playing software, for example, if a song can be found and played in B software, the B software is the playing source of the a song, and if a song can be found and played in the webpage platform of the B software, the B software is the playing source of the a song.
In step 210, when the user selects the song play list to play, the terminal sequentially obtains song information of songs to be played in the song play list according to the playing progress, where the song information includes, but is not limited to, song names, singers, albums, and the like. The song play list may contain one or more songs, for example, the user may play a history of songs directly or by retrieving a determined song, the song currently to be played, i.e., the song in the play list.
In step 220, the cloud server stores the song information and the corresponding play source information, which are stored after the corresponding song is played, so if the song information in the play source query request is already stored in the cloud server, the query result returned by the cloud server will include the play source information, otherwise, the query result will not include the play source information.
In step 240, if the query result includes the play source information, the play source corresponding to the play source information is directly used as the play source of the song to be played, and the play source found according to the query request is the song playing software installed in the terminal, so as to execute step 270 to control the song playing software to play the song to be played.
In step 250, if the query result does not include the playing source information, the playing source of the song to be played is searched from the song playing software installed in the terminal according to the song information. In the terminal, the playing source can be confirmed by sequentially communicating with the song playing software installed in the terminal in a polling mode, and all the playing sources capable of playing the songs to be played can be determined after communicating with each song playing software installed in the terminal.
In step 260, if the unique song playing software is found, the found song playing software is used as a playing source of the song to be played, for example, song playing software capable of playing the song to be played is found when polling. If the searched song playing software is not unique, confirming that one song playing software is used as a playing source of the song to be played according to a preset rule, wherein the preset rule comprises, but is not limited to, taking the song playing software with the highest frequency of use as the playing source or taking the song playing software with the highest frequency of playing the song to be played as the playing source. If the song playing software is not found, sending a playing source searching request to the cloud server, wherein the playing source searching request comprises song information, so that the cloud server returns a searching result according to the song information, a playing source corresponding to the playing source information in the searching result is used as a playing source of the song to be played, and the playing source searched according to the playing source searching request is the song playing software which is not installed in the terminal. Thus, in step 270, if the playing source is the song playing software installed in the terminal, the song playing software is controlled to play the song to be played, and if the playing source is the song playing software not installed in the terminal, the song playing software is prompted to be installed, and after the song playing software is successfully installed, the song playing software is controlled to play the song to be played.
In actual implementation, if the playing source is the song playing software which is not installed in the terminal, the user can also be prompted to select to skip to the corresponding webpage platform to play the song or to install the song playing software to play the song, if the user selects to skip to the corresponding webpage platform, the user skips to the webpage platform corresponding to the playing source to play the song to be played, and if the user selects to install the song playing software, the song playing software is controlled to play the song to be played after the song playing software is successfully installed. The user can set a default processing mode when the playing source is the song playing software which is not installed in the terminal, for example, default to skip to a webpage platform corresponding to the playing source for playing, so when the playing source is the song playing software which is not installed in the terminal, the song to be played is played according to the default mode set by the user and the playing source.
By the method, when the user plays the song list, the terminal can dynamically switch to different play sources for playing according to the current song to be played, and the user does not need to manually switch the play sources for searching songs and playing, so that the song listening experience of the user is optimized.
In one embodiment, after playing the song to be played according to the playing source, the method further includes:
and if the song information and the corresponding playing source information are not stored in the cloud server, sending the song information and the corresponding playing source information to the cloud server for storage.
By storing the song information and the corresponding playing source information in the cloud server, the playing source can be confirmed without executing all searching steps when the same song is played again, so that the resource consumption is reduced, and the playing efficiency is improved.
According to the method for playing songs, after the terminal obtains the song information of the songs to be played, the playing source of the songs to be played is searched according to the song information, and the songs to be played are played according to the playing source. By the mode, the playing source can be automatically switched to play the song when the user plays the song, the user does not need to manually switch the playing source, and the user experience is improved. In addition, when searching for a play source, firstly, the cloud end queries available play sources, and when playing the same song, the play sources can be confirmed without executing all the searching steps, so that the resource consumption is reduced, and meanwhile, the play efficiency is improved.
Fig. 3 is a flow chart illustrating a method of playing songs according to a third embodiment. Referring to fig. 3, the method for playing songs in this embodiment includes:
Step 310, obtaining song information of a song to be played;
step 320, searching a playing source of a song to be played from song playing software installed in the terminal according to the song information;
Step 330, determining a playing source of the song to be played according to the searching result;
Step 340, playing the song to be played according to the playing source.
The embodiment is implemented by software installed on a terminal, and the software aggregates multiple types of song playing software, so that searching and playing of songs to be played can be performed through the song playing software or a playing server corresponding to the song playing software, and different song playing software, namely, different playing sources, are selected, wherein the playing sources comprise song playing software or a webpage platform corresponding to the song playing software, for example, if a song can be found and played in B software, the B software is the playing source of the a song, and if a song can be found and played in the webpage platform of the B software, the B software is the playing source of the a song.
In step 310, when the user selects the song play list to play, the terminal sequentially obtains song information of songs to be played in the song play list according to the playing progress, where the song information includes, but is not limited to, song names, singers, albums, and the like. The song play list may contain one or more songs, for example, the user may play a history of songs directly or by retrieving a determined song, the song currently to be played, i.e., the song in the play list.
In step 320, in the terminal, the playing source may be confirmed by sequentially communicating with the song playing software installed in the terminal in a polling manner, or after communicating with each song playing software installed in the terminal, all the playing sources capable of playing the song to be played may be determined.
In step 330, if the unique song playing software is found, the found song playing software is used as a playing source of the song to be played, for example, song playing software capable of playing the song to be played is found when polling. If the searched song playing software is not unique, confirming that one song playing software is used as a playing source of the song to be played according to a preset rule, wherein the preset rule comprises, but is not limited to, taking the song playing software with the highest frequency of use as the playing source or taking the song playing software with the highest frequency of playing the song to be played as the playing source. If the song playing software is not found, sending a playing source searching request to the cloud server, wherein the playing source searching request comprises song information, so that the cloud server returns a searching result according to the song information, a playing source corresponding to the playing source information in the searching result is used as a playing source of the song to be played, and the playing source searched according to the playing source searching request is the song playing software which is not installed in the terminal.
In step 340, if the playing source is the song playing software installed in the terminal, the song playing software is controlled to play the song to be played, and if the playing source is the song playing software not installed in the terminal, the song playing software is prompted to be installed, and after the song playing software is successfully installed, the song playing software is controlled to play the song to be played. In actual implementation, if the playing source is the song playing software which is not installed in the terminal, the user can also be prompted to select to skip to the corresponding webpage platform to play the song or to install the song playing software to play the song, if the user selects to skip to the corresponding webpage platform, the user skips to the webpage platform corresponding to the playing source to play the song to be played, and if the user selects to install the song playing software, the song playing software is controlled to play the song to be played after the song playing software is successfully installed. The user can set a default processing mode when the playing source is the song playing software which is not installed in the terminal, for example, default to skip to a webpage platform corresponding to the playing source for playing, so when the playing source is the song playing software which is not installed in the terminal, the song to be played is played according to the default mode set by the user and the playing source.
According to the method for playing songs, after the terminal obtains the song information of the songs to be played, the playing source of the songs to be played is searched according to the song information, and the songs to be played are played according to the playing source. By the method, when a user plays the song list, the terminal can dynamically switch to different play sources for playing according to the current song to be played, and the user does not need to manually switch the play sources for searching and playing, so that the song listening experience of the user is optimized.
Fourth embodiment
Fig. 4 is one of schematic structural diagrams of a terminal according to a fourth embodiment. Referring to fig. 4, the terminal 10 of the present embodiment includes a memory 102 and a processor 106, where the memory 102 is configured to store at least one program instruction, and the processor 106 is configured to implement the method for playing songs according to the above embodiment by loading and executing the at least one program instruction.
Referring to fig. 5, in actual implementation, the terminal 10 includes a memory 102, a memory controller 104, one or more (only one is shown in the figure) processors 106, a peripheral interface 108, a radio frequency module 150, a positioning module 112, a camera module 114, an audio module 116, a screen 118, and a key module 160. These components communicate with each other via one or more communication buses/signal lines 122.
It will be appreciated that the configuration shown in fig. 5 is merely illustrative and that the terminal 10 may also include more or fewer components than shown in fig. 5 or have a different configuration than shown in fig. 5. The components shown in fig. 5 may be implemented in hardware, software, or a combination thereof.
The memory 102 may be used to store software programs and modules, such as program instructions/modules corresponding to the method of playing songs in the embodiments of the present application, and the processor 106 executes the software programs and modules stored in the memory controller 104 to perform various functional applications and data processing, i.e., implement the method of playing songs described above.
Memory 102 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 102 may further include memory located remotely from the processor 106, which may be connected to the terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. Access to the memory 102 by the processor 106 and possibly other components may be under the control of the memory controller 104.
The peripheral interface 108 couples various input/output devices to the CPU and memory 102. The processor 106 executes various software, instructions within the memory 102 to perform various functions of the terminal 10 and to perform data processing.
In some embodiments, the peripheral interface 108, the processor 106, and the memory controller 104 may be implemented in a single chip. In other examples, they may be implemented by separate chips.
The radio frequency module 150 is configured to receive and transmit electromagnetic waves, and to implement mutual conversion between the electromagnetic waves and the electrical signals, so as to communicate with a communication network or other devices. The radio frequency module 150 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, memory, and the like. The rf module 150 may communicate with various networks such as the internet, intranets, wireless networks, or other devices via wireless networks. The wireless network may include a cellular telephone network, a wireless local area network, or a metropolitan area network. The Wireless network may use various communication standards, protocols, and technologies including, but not limited to, global system for mobile communications (Global System for Mobile Communication, GSM), enhanced mobile communications technology (ENHANCED DATA GSM Environment, EDGE), wideband code division multiple access technology (wideband code division multiple access, W-CDMA), code division multiple access technology (Code division access, CDMA), time division multiple access technology (time division multiple access, TDMA), bluetooth, wireless Fidelity (WiFi) (such as the american society of electrical and electronic engineers standards IEEE 802.11a,IEEE 802.11b,IEEE802.11g and/or IEEE802.11 n), internet telephony (Voice over internet protocal, voIP), worldwide interoperability for microwave access (Worldwide Interoperability for Microwave Access, wi-Max), other protocols for mail, instant messaging, and short messaging, as well as any other suitable communication protocols, even those not currently developed.
The positioning module 112 is used to obtain the current position of the terminal 10. Examples of the positioning module 112 include, but are not limited to, global satellite positioning system (GPS), wireless local area network or mobile communication network based positioning technology.
The camera module 114 is used to take pictures or videos. The photographed photo or video may be stored into the memory 102 and may be transmitted through the radio frequency module 150.
The audio module 116 provides an audio interface to the user, which may include one or more microphones, one or more speakers, and audio circuitry. The audio circuit receives sound data from the peripheral interface 108, converts the sound data to electrical information, and transmits the electrical information to the speaker. The speaker converts electrical energy into sound waves that can be heard by the human ear. The audio circuit also receives electrical information from the microphone, converts the electrical signal into sound data, and transmits the sound data to the peripheral interface 108 for further processing. The audio data may be retrieved from the memory 102 or through the radio frequency module 150. In addition, audio data may also be stored in the memory 102 or transmitted through the radio frequency module 150. In some examples, the audio module 116 may also include a headphone jack for providing an audio interface to headphones or other devices.
Screen 118 provides an output interface between terminal 10 and the user. Specifically, screen 118 displays video output to the user, the content of which may include text, graphics, video, and any combination thereof. Some output results correspond to some user interface objects. It is understood that the screen 118 may also include a touch screen. The touch screen provides both an output and input interface between the terminal 10 and the user. In addition to displaying video output to users, the touch screen also receives user inputs, such as user clicks, swipes, and the like, in order for the user interface object to respond to these user inputs. The technique of detecting user input may be based on resistive, capacitive, or any other possible touch detection technique. Specific examples of touch screen display units include, but are not limited to, liquid crystal displays or light emitting polymer displays.
The key module 160 also provides an interface for a user to input to the terminal 10, which may cause the terminal 10 to perform different functions by pressing different keys.
The present application is not limited to the preferred embodiments, and the present application is described above in any way, but is not limited to the preferred embodiments, and any person skilled in the art will appreciate that the present application is not limited to the embodiments described above, while the above disclosure is directed to various equivalent embodiments, which are capable of being modified or varied in several ways, any simple modification, equivalent changes and variation of the above embodiments according to the technical principles of the present application will still fall within the scope of the present application.