Summary of the invention
In order to overcome the weak point of the prior art of above-mentioned indication, the invention provides the lyric display method that a kind of portable terminal is implemented, think that each digital audio file provides the lyrics data of corresponding precise synchronization, make the user in the time of browsing page etc., can synchronously showing the screen display lyrics, utilize free space and make things convenient for user's lyrics browsing.
The present invention is achieved by the following technical solutions:
The lyric display method that a kind of portable terminal is implemented, described portable terminal is mounted with the audio frequency playout software audio signal that can play-over is decoded, decompressed to obtain to digital audio file, and set up the linking relationship that this digital audio file reaches the lyrics data that is complementary with it, described method comprises:
Step a, read digital audio file and begin to play the current audio frequency reproduction time of timing acquisition;
Step b, read corresponding lyrics data, the Presentation Time Stamp of record several rows lyric characters and every row lyric characters in the described lyrics data;
Step c, consistent with current audio frequency reproduction time when the displaying time of certain row lyric characters, the software background service sends a status bar notice, and the status bar prompting text of described notice is this row lyric characters;
Steps d, regularly upgrade this status bar notice according to the Presentation Time Stamp of every row lyric characters;
Step e, digital audio file are play and are finished, and delete described status bar notice.
Described status bar notice comprises unique ID identification parameter, and the action of described renewal or deletion status bar notice is by upgrading or deleting the status bar notice with this only ID identification parameter and realize.Described steps d is regularly upgraded this status bar notice according to the Presentation Time Stamp of every row lyric characters, refer to that when the displaying time of any next line lyric characters is consistent with current audio frequency reproduction time the status bar prompting text of revising described notice is this row lyric characters.
Comprise audio track, reproduction time track and ID label information in the described digital audio file, described audio frequency playout software mates lyrics data with it according to ID label information and the reproduction time information of this digital audio file.
The Presentation Time Stamp of described every row lyric characters records the initial displaying time of this row lyric characters.
Described lyrics data in the digital audio file playing process to wireless network send lyrics search request download in real time obtain or in advance copying and saving in the appointed area of portable terminal.
When user's pull-down state hurdle and when clicking described status bar notice, operation interface jumps to the broadcast interface of audio frequency playout software.
Compared with prior art, the mode of the present invention by sending notice periodically is presented at every row lyrics of digital audio file on the mobile phone state hurdle, the lyrics data of corresponding precise synchronization is provided for each digital audio file, as user at browsing page etc. the time, utilize idle status bar to show the lyrics, make things convenient for user's lyrics browsing, take full advantage of simultaneously display space.
Embodiment
For the ease of those skilled in the art's understanding, the invention will be further described below in conjunction with accompanying drawing.In preferred embodiment of the present invention, for convenience of explanation, described portable terminal is take mobile phone as example.
The lyric display method that a kind of portable terminal is implemented, described portable terminal is mounted with the audio frequency playout software audio signal that can play-over is decoded, decompressed to obtain to digital audio file, and set up the linking relationship that this digital audio file reaches the lyrics data that is complementary with it, described method comprises:
Step a, read digital audio file and begin to play the current audio frequency reproduction time of timing acquisition;
Step b, read corresponding lyrics data, the Presentation Time Stamp of record several rows lyric characters and every row lyric characters in the described lyrics data;
Step c, consistent with current audio frequency reproduction time when the displaying time of certain row lyric characters, the software background service sends a status bar notice, and the status bar prompting text of described notice is this row lyric characters;
Steps d, regularly upgrade this status bar notice according to the Presentation Time Stamp of every row lyric characters;
Step e, digital audio file are play and are finished, and delete described status bar notice.
Comprise audio track, reproduction time track and ID label information in the described digital audio file, can also comprise further the label informations such as file name.The ID label information represents to distinguish the information of respective audio file, and such as about details such as issuing date of title of song, singer, affiliated disc, types of songs, this ID label information can be inputted under off-line mode by the user.Described audio frequency playout software mates lyrics data with it according to ID label information and the reproduction time information of this digital audio file.Described digital audio file comprises WAVE(*.WAV), AIFF, AU, MP3, MIDI, the common audio formats such as WMA, RealAudio.
The Presentation Time Stamp of described every row lyric characters records the initial displaying time of this row lyric characters.Described lyrics data can adopt txt form or lrc form or other common forms, and comprise the data such as title of song, singer in the file, described audio frequency playout software is set up the linking relationship that digital audio file reaches the lyrics data that is complementary with it according to data such as its title of song, singers.
Described lyrics data in the digital audio file playing process to wireless network send lyrics search request download in real time obtain or in advance copying and saving in the appointed area of portable terminal.By download or copying and saving to the specified folder of portable terminal, described wireless network can be GPRS network, cdma network or 3G network.
The status bar notice is that an icon is dosed in the status bar of system, comprises simultaneously an optional prompting text message, and an expansion information is added in the notification window.In the Android system, when the user chooses expansion information, system will carry out one this notify defined intention request, be generally used for ejecting an Activity(and be translated as action).Can be configured notice, the sound, vibration, the flash of light that provide with equipment come reminding user. status bar notice just can play a role when background service need to send prompting and need the user to respond certain event.
At first, send a status bar notice and must use two class: NotificationManager, Notification.NotificationManager is the administrative class of status bar notice, is responsible for sending out public notice, knows notice etc., be that a Service(of system is service background), must obtain by getSystemService () method.The attribute of Notification class definition state notifying comprises some detailed information of being presented at status bar and all advice methods, icon for example, the informations such as flash of light, perhaps voice prompt.When sending the status bar notice, transmit the Notification object by notify (int, Notification) and get final product to NotificationManager.First parameter is unique ID sign of Notification, and second parameter is the Notification object.ID is identified at this Notification of unique identification in the whole range of applications.Described status bar notice of the present invention comprises unique ID identification parameter, and the action of described renewal or deletion status bar notice is by upgrading or deleting the status bar notice with this only ID identification parameter and realize.Prompting text in definition status hurdle among the present invention, namely status bar top prompting message (A ticker-text message) is the lyric characters of corresponding row.
Described steps d is regularly upgraded this status bar notice according to the Presentation Time Stamp of every row lyric characters, refer to that when the displaying time of any next line lyric characters is consistent with current audio frequency reproduction time the status bar prompting text of revising described notice is this row lyric characters.Because each notice has a unique Id sign, can pass through setLatestEventInfo () method amendment advice, then call notify() and show up-to-date notice, to cover the previous row lyrics.According to the Presentation Time Stamp of every row lyric characters in the lyrics data, when the displaying time that detects current audio frequency reproduction time and next line lyric characters and consistent, upgrade this status bar notice.
During described step e deletion Notification, remove this notice by cancel (int) method of NotificationManager, wherein parameter is exactly the unique ID of Notification.
The basic parameter that a notice is set to be needed comprises arranging clicks the page jump that notice is carried out, and in the present invention, when user's pull-down state hurdle and when clicking described status bar notice, operation interface jumps to the broadcast interface of audio frequency playout software.In preferred embodiment of the present invention, when the user has selected certain notice from notification window, can add " FLAG_AUTO_CANCEL " mark to this notice and remove this notice.
Particularly, as shown in Figure 1, disclose the better realization flow of the lyric display method of portable terminal enforcement, may further comprise the steps:
001, the user selection digital audio file begins to play;
002, reads corresponding lyrics data;
003, the current audio frequency reproduction time of backstage timing acquisition;
004, judge current audio frequency reproduction time whether with the displaying time of arbitrary row lyric characters and consistent, be execution in step 005 then, otherwise return step 003;
005, the software background service sends a status bar notice, and status bar prompting text is this row lyric characters;
006, the current audio frequency reproduction time of timing acquisition is continued on the backstage;
007, judging whether current audio frequency reproduction time reaches the total duration of audio frequency, and namely whether digital audio file plays end, is execution in step 010 then, otherwise execution in step 008;
008, judges whether current audio frequency reproduction time is consistent with the displaying time of any next line lyric characters, be execution in step 009 then, otherwise return step 006;
009, update mode hurdle notice covers the previous row lyric characters, and returns step 006;
010, the described status bar notice of deletion.
The resulting current reproduction time length of clock time when further, mentioned current audio frequency reproduction time refers to that current clock time deducts audio frequency and begins to play in the present invention.
Above content is the further description of the present invention being done in conjunction with concrete optimal way, should not assert that implementation of the present invention is confined to above explanation.For those skilled in the art, without departing from the inventive concept of the premise, can also make some simple deduction or replace, within the protection range that the claim that all should be considered as being submitted to by the present invention is determined.