Lyric display method and device and storage medium
By encapsulating the lyrics data and time information into data structures and using multiple display controls to display in the lyrics display area, the problem of single lyrics display in the prior art is solved, and the user experience and song rhythm combination effect is improved.
Patent Information
- Application Number
- CN202311616204.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-29
- Publication Date
- 2025-05-30
AI Technical Summary
In the prior art, the lyrics are displayed in a single way, with poor interaction and immersion, and cannot effectively combine the rhythm of the song.
By obtaining the lyrics data of the current song, obtaining the time information of multiple lyrics, and encapsulating each lyrics and corresponding time information into a data structure, obtaining the target data structure according to the current song singing progress, and using one or more display controls to display in the lyrics display area.
It realizes flexibility and personalization of lyric display, enhances user experience, overcomes the problem of single scrolling lyric structure, and can effectively combine the song rhythm.
Smart Images

Figure CN120075354A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of computer and network communication technologies, and in particular, to a method, device, and storage medium for displaying lyrics. Background Art
[0002] With the development of network communication technologies, in addition to providing a music listening function, a terminal can also provide a singing function, a karaoke function, etc. In addition, it can also provide functions such as multi-person co-hosted karaoke or live karaoke. During the singing process, lyrics need to be displayed.
[0003] In the prior art, scrolling lyrics are usually used to display lyrics, but the lyric structure is single, and the interaction and immersion are poor. Summary of the Invention
[0004] Embodiments of the present disclosure provide a method, device, and storage medium for displaying lyrics to improve the lyric display effect and user experience.
[0005] In a first aspect, embodiments of the present disclosure provide a method for displaying lyrics, including:
[0006] Obtaining lyric data of the current song;
[0007] Obtaining time information of multiple lines of lyrics according to the lyric data, and encapsulating each line of lyrics and the corresponding time information into a data structure respectively according to the time information of each line of lyrics in the multiple lines of lyrics, to obtain multiple data structures;
[0008] Obtaining a target data structure from the multiple data structures according to the time information corresponding to the singing progress of the current song, and displaying the corresponding lyrics in one or more display controls in the lyric display area according to the target data structure.
[0009] In a second aspect, embodiments of the present disclosure provide a device for displaying lyrics, including:
[0010] An obtaining unit, configured to obtain lyric data of the current song;
[0011] A processing unit, configured to obtain time information of multiple lines of lyrics according to the lyric data, and encapsulate each line of lyrics and the corresponding time information into a data structure respectively according to the time information of each line of lyrics in the multiple lines of lyrics, to obtain multiple data structures;
[0012] A display unit, configured to obtain a target data structure from the multiple data structures according to the time information corresponding to the singing progress of the current song, and display the corresponding lyrics in one or more display controls in the lyric display area according to the target data structure.
[0013] In a third aspect, embodiments of the present disclosure provide an electronic device, including: at least one processor and a memory;
[0014] The memory stores computer-executable instructions;
[0015] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the lyrics display method as described in the first aspect above and various possible designs of the first aspect.
[0016] In a fourth aspect, embodiments of the present disclosure provide a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the lyrics display method as described in the first aspect above and various possible designs of the first aspect is implemented.
[0017] In a fifth aspect, embodiments of the present disclosure provide a computer program product, including computer-executable instructions. When a processor executes the computer-executable instructions, the lyrics display method as described in the first aspect above and various possible designs of the first aspect is implemented.
[0018] The lyrics display method, device, and storage medium provided by the embodiments of the present disclosure obtain the lyrics data of the current song; obtain the time information of multiple sentences of lyrics according to the lyrics data, and encapsulate each sentence of lyrics and the corresponding time information into a data structure respectively according to the time information of each sentence of lyrics in the multiple sentences of lyrics, so as to obtain multiple data structures; according to the time information corresponding to the singing progress of the current song, obtain a target data structure from the multiple data structures, and display the corresponding lyrics in one or more display controls in the lyrics display area. In the embodiments of the present disclosure, multiple data structures are obtained by encapsulating each sentence of lyrics and the corresponding time information, and one or more display controls are used in the lyrics display area to display the lyrics respectively based on the data structures. The number and / or position of the display controls can be set according to requirements, making the display of the lyrics more flexible, overcoming the problem of the single structure of scrolling lyrics, meeting the personalized needs of users for the lyrics display method, and improving the user experience. Description of the Drawings
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are some embodiments of the present disclosure. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0020] Figure 1An interface example diagram of a lyric display method in the prior art;
[0021] Figure 2 An interface schematic diagram of the lyric display method provided by an embodiment of the present disclosure;
[0022] Figure 3 A flowchart schematic diagram of the lyric display method provided by an embodiment of the present disclosure;
[0023] Figure 4 A schematic diagram of a first display control and a second display control provided by an embodiment of the present disclosure;
[0024] Figure 5 An interface schematic diagram of lyric residence provided by an embodiment of the present disclosure;
[0025] Figure 6 An interface schematic diagram of lyric residence provided by another embodiment of the present disclosure;
[0026] Figure 7 An interface schematic diagram of singing-in prompt provided by an embodiment of the present disclosure;
[0027] Figure 8 A structural block diagram of a lyric display device provided by an embodiment of the present disclosure;
[0028] Figure 9 A hardware structure schematic diagram of an electronic device provided by an embodiment of the present disclosure. Detailed implementation manners
[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are some but not all of the embodiments of the present disclosure. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present disclosure without creative efforts shall fall within the scope of protection of the present disclosure.
[0030] In the prior art, lyrics are usually displayed using scrolling lyrics. For example, a CollectionView scrolling view is used to display lyrics. As Figure 1 shown, the first line displays the currently sung lyrics (with a marquee effect), and the second line is the lyrics to be sung. However, the lyric structure is single, and the interactivity and immersion are poor. In addition, the lyric rhythm has no association with the song singing rhythm. During a long interlude, the already sung lyrics will always stay on the first line, affecting the user experience; and there is no singing-in prompt.
[0031] To solve at least one of the above technical problems, in the present disclosure, it is desired to improve the flexibility of lyric display, overcome the problem of the single structure of scrolling lyrics, and meet the personalized needs of users for lyric display methods. For example, a lyric display method similar to that of an offline KTV or other display methods can be adopted to improve the lyric display effect. Therefore, in the present disclosure, one or more display controls are used in the lyric display area for lyric display, and the number and / or position of the display controls can be set according to requirements, making the lyric display more flexible. As Figure 2 shown, to implement the lyric display method of an offline KTV, the first display control 202 and the second display control 203 are used in the lyric display area 201 to display lyrics. Among them, the first display control 202 can be located above, to the left, or to the upper left of the second display control 203. Optionally, the first display control 202 is located in the upper left of the lyric display area 201, and the second display control 203 is located in the lower right of the lyric display area 201. To support the lyric display area to display lyrics through display controls with different numbers and / or positions, in the embodiments of the present disclosure, each lyric sentence and the corresponding time information are respectively encapsulated into a data structure to obtain a plurality of data structures. In this way, each display control only needs to obtain the corresponding target data structure from the plurality of data structures according to the time information corresponding to the current song singing progress, and display the corresponding lyrics according to the target data structure, without extracting lyrics and processing time information from the original lyric data during the singing process, ensuring accurate and stable lyric display.
[0032] It should be noted that the user information and data involved in the present disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or reject.
[0033] The lyric display method of the present disclosure will be introduced in detail below in combination with specific embodiments.
[0034] Refer to Figure 3 , Figure 3 which is a schematic flowchart of the lyric display method provided by an embodiment of the present disclosure. The method of this embodiment can be applied to electronic devices such as terminal devices, specifically applicable to any application program with KTV and singing functions, and can also be applied to scenarios such as KTV in a live broadcast room connection and the host singing a song in a live broadcast room.
[0035] The lyric display method includes:
[0036] S301. Obtain the lyric data of the current song.
[0037] In this embodiment, when the lyrics of the current song need to be displayed, the lyrics data of the current song can be obtained first. The lyrics data may include the time information of each character in the lyrics. For example, the format of the lyrics data can be the KRC format or other formats, which is not limited here. Of course, the lyrics data may also include other information, such as song information, lyrics producer information, etc.
[0038] Optionally, in an application with a KTV singing and performance function, after the user selects the current song to be sung, or when starting to play the accompaniment of the current song, or when a song switch occurs, the lyrics data of the current song is obtained.
[0039] Optionally, in a live broadcast scenario, after the current song to be sung is selected, or when starting to play the accompaniment of the current song, or when a song switch occurs, the host device, the devices of other singing participants, and the audience device can obtain the lyrics data of the current song. In addition, when the audience device enters the live broadcast room, it can also obtain the lyrics data of the current song in the live broadcast room.
[0040] S302. Obtain the time information of multiple sentences of lyrics according to the lyrics data, and encapsulate each sentence of lyrics and the corresponding time information into a data structure respectively according to the time information of each sentence of lyrics in the multiple sentences of lyrics, to obtain multiple data structures.
[0041] In this embodiment, when obtaining the lyrics data of the current song, the lyrics data can be traversed to obtain the time information of each sentence of lyrics from the lyrics data. For example, for any sentence of lyrics, the following one or more time information including but not limited to the current lyrics can be obtained: the time interval between the end time of the current lyrics and the start time of the next sentence of lyrics, the start display time of the current lyrics, the end display time of the current lyrics, and the display duration of the current lyrics.
[0042] Furthermore, each sentence of lyrics and the corresponding time information can be encapsulated into a data structure respectively according to the time information of each sentence of lyrics. For example, the data structure can be a data model in the MVVM mode (model, responsible for data acquisition and storage). The data structure is an instance of the UI data source object of the lyrics display area, which includes the lyrics content and the time information of the lyrics. Of course, it also includes the time information of each character in the lyrics (used to control the marquee effect). Through the above encapsulation process, each sentence of lyrics can correspond to a data structure, and then a list of data structures modellist is obtained. By reconstructing the data structure of the lyrics information in the data layer and processing the alienation logic, the lyrics display is changed from depending on the singing duration of a single sentence of lyrics to depending on the display duration of a single sentence of lyrics.
[0043] Optionally, before encapsulation, it is also possible to determine whether the length of each lyric exceeds a preset length. The preset length can be the upper limit of the lyric length that can be displayed in one line of the lyric display area, or the preset length can be set according to requirements. If the length of any lyric sentence exceeds the preset length, then split the lyric sentence into at least two lyric sentences, and encapsulate the at least two lyric sentences obtained by splitting and their respective corresponding time information (which can be re-obtained after splitting) into at least two data structures. Each lyric sentence obtained by splitting corresponds to one data structure.
[0044] S303. According to the time information corresponding to the current song singing progress, obtain a target data structure from the multiple data structures, and display the corresponding lyric in one or more display controls in the lyric display area according to the target data structure.
[0045] In this embodiment, during the singing of the current song, according to the time information corresponding to the current song singing progress (or the accompaniment playing progress), each data structure can be consumed from the multiple data structures, that is, the data structure list modellist. According to each data structure, the lyrics are displayed in the lyric display area in sequence. Specifically, the lyric display area includes one or more display controls, and the display control can be used to display lyrics according to the target data structure. Each display control obtains a target data structure that matches the time information corresponding to the singing progress from the multiple data structures according to the time information corresponding to the current song singing progress. If there is only one display control, the lyrics are displayed by sequentially obtaining each data structure according to the time information corresponding to the singing progress; if there are multiple display controls, the lyrics are alternately displayed by each display control, that is, each display control alternately obtains a data structure from the multiple data structures as the target structure according to the time information corresponding to the current song singing progress for lyric display.
[0046] Optionally, one or more display controls may specifically include a first display control and a second display control, where the first display control may be located above, to the left, or to the upper left of the second display control. The first display control and the second display control alternately display lyrics according to the singing progress. For example, the first display control displays the first line of lyrics, the second display control displays the second line of lyrics, the first display control displays the third line of lyrics, the second display control displays the fourth line of lyrics, and so on. Optionally, similar to the lyrics in an offline KTV, the first display control is located in the upper left corner of the lyrics display area, and the second display control is located in the lower right corner of the lyrics display area. The first display control and the second display control alternately display lyrics according to the singing progress, which is more immersive and interactive than scrolling lyrics and achieves the marquee effect of the lyrics. Of course, one or more display controls are not limited to the above examples, and may also be any other layout method, which can be selected according to user needs (different layout methods may be provided for the user to choose, and in response to the user's selection instruction, the display controls are arranged in the lyrics display area), or freely set by the user (for example, in response to the user's personalized layout instruction, the display controls are arranged in the lyrics display area according to the layout instruction).
[0047] Optionally, as Figure 4 shown, the first display control and the second display control set a lyrics text content display sub-control in the container. For example, the display of the lyrics text content can be implemented through a label control, and a mask control may also be included. A mask is set on the lyrics text content display sub-control. The mask is set with a preset color and / or pattern. The mask control can adjust the width of the mask according to the current song singing progress, so that the sung part and the unsung part of each line of lyrics are displayed differently, so that the sung part and the unsung part present different display effects. For example, each word of the lyrics text content changes color and / or pattern in sequence according to the singing progress, achieving the marquee effect.
[0048] Based on this, the display of the corresponding lyrics in the display control in S303 may specifically include displaying the corresponding lyrics text content in the display control, and controlling the width of the mask set on the lyrics text content in the display control according to the time information corresponding to the current song singing progress, so that the sung part and the unsung part of each line of lyrics are displayed differently, so that the sung part and the unsung part present different display effects and achieve the lyrics marquee effect.
[0049] Optionally, after obtaining multiple data structures in S302, it is possible to determine the display position of the lyrics corresponding to any data structure in the lyrics display area, that is, to determine whether the lyrics corresponding to any data structure are displayed in the first display control or the second display control. Add the data structures corresponding to the lyrics to be displayed in the first display control to the first data structure set, and add the data structures corresponding to the lyrics to be displayed in the second display control to the second data structure set, thereby obtaining two data structure sets (or lists).
[0050] Further, when executing S303, according to the time information corresponding to the current song singing progress, obtain the corresponding first target data structure from the first data structure set, and display the corresponding lyrics in the first display control according to the first target data structure; and / or, obtain the corresponding second target data structure from the second data structure set, and display the corresponding lyrics in the second display control according to the second target data structure, so that the first display control only needs to consume data structures from the first data structure set in sequence, and the second display control only needs to consume data structures from the second data structure set in sequence, without having to determine the display position of the lyrics corresponding to any data structure in the lyrics display area during the singing of the current song, ensuring stable display of lyrics during the singing of the current song. Of course, if there are more than three display controls in the lyrics display area, correspondingly, data structure sets corresponding to each display control can be obtained, and then each display control can obtain target data structures from the corresponding data structure sets to display the corresponding lyrics.
[0051] Optionally, in an audio live broadcast scenario, the live stream data does not include video images. Therefore, for the host device and the viewer device in the live broadcast room, the above processes of S301 - S303 need to be executed separately to achieve lyrics display on the host device and the viewer device (as well as other singing participant device terminals). The live stream data is audio live stream data and can also carry the time information corresponding to the current song singing progress. When executing S303, the viewer device can obtain the time information corresponding to the current song singing progress from the live stream data, and according to the time information corresponding to the current song singing progress, obtain the corresponding target data structure from the multiple data structures obtained by the viewer device itself, and then display the corresponding lyrics in the first display control and / or the second display control.
[0052] The lyrics display method provided in this embodiment obtains the lyrics data of the current song; obtains the time information of multiple lines of lyrics according to the lyrics data, and encapsulates each line of lyrics and the corresponding time information into a data structure respectively to obtain multiple data structures; according to the time information corresponding to the singing progress of the current song, obtains the target data structure from the multiple data structures, and displays the corresponding lyrics in one or more display controls in the lyrics display area. In this embodiment, one or more display controls are used to display the lyrics in the lyrics display area, and the number and / or position of the display controls can be set according to requirements, making the display of the lyrics more flexible, overcoming the problem of the single structure of the scrolling lyrics, meeting the personalized needs of users for the lyrics display method, and improving the user experience; and in order to support the lyrics display area to display the lyrics through display controls with different numbers and / or positions, in this embodiment, each line of lyrics and the corresponding time information are respectively encapsulated into a data structure to obtain multiple data structures. In this way, each display control only needs to obtain the corresponding target data structure from the multiple data structures according to the time information corresponding to the singing progress of the current song, and display the corresponding lyrics according to the target data structure, without extracting the lyrics and processing the time information from the original lyrics data during the singing process, ensuring accurate and stable lyrics display.
[0053] In the above embodiment, in order to simulate the lyrics in an offline KTV as realistically as possible, it is also necessary to implement the retention of the lyrics before the interlude or the coda, that is, to continuously display this line of lyrics until the end of the interlude or the coda (or continuously display until n seconds before the end of the interlude or the coda).
[0054] Specifically, before obtaining multiple data structures in S302, especially before adding the data structure corresponding to the lyrics to be displayed in the first display control to the first data structure set and adding the data structure corresponding to the lyrics to be displayed in the second display control to the second data structure set, it may further include:
[0055] Determine whether any data structure is the data structure corresponding to the last line of lyrics before the interlude or the coda;
[0056] If any data structure is the data structure corresponding to the last line of lyrics before the interlude or the coda, and the lyrics corresponding to any data structure are displayed in the first display control, insert an empty data structure after any data structure, and align the end display time corresponding to the empty data structure with the end display time corresponding to any data structure; or
[0057] If any of the data structures is the data structure corresponding to the last line of lyrics before an interlude or an outro, and the lyrics corresponding to any of the data structures are displayed in the second display control, then align the end display time of the previous data structure corresponding to any of the data structures with the end display time of any of the data structures.
[0058] In this embodiment, for any data structure, to determine whether any data structure is the data structure corresponding to the last line of lyrics before an interlude or an outro, it can be determined according to the time interval between the end time of the lyrics corresponding to any data structure and the start time of the next line of lyrics, that is, to determine whether the time interval between the end time of the lyrics corresponding to any data structure and the start time of the next line of lyrics exceeds a preset time interval. If so, it is determined that any data structure is the data structure corresponding to the last line of lyrics before an interlude or an outro.
[0059] If it is determined that any data structure is the data structure corresponding to the last line of lyrics before an interlude or an outro, then the line of lyrics needs to be held, and the line of lyrics can be continuously displayed until the end of the interlude or outro (or continuously displayed until n seconds before the end of the interlude or outro). However, according to the different display positions of the last line of lyrics before an interlude or an outro in the lyrics display area, there are different processing methods.
[0060] As Figure 5 shown, if the last line of lyrics before an interlude or an outro is displayed in the first display control, then the line of lyrics is held during the interlude or outro, and at the same time, the second display control does not need to display the next line of lyrics during the interlude or outro, that is, the second display control is empty. Therefore, if any data structure is the data structure corresponding to the last line of lyrics before an interlude or an outro, and the lyrics corresponding to any data structure are displayed in the first display control, then an empty data structure can be inserted after any data structure, and the end display time corresponding to any data structure and the end display time corresponding to the empty data structure are set to the end time of the interlude or outro (or n seconds before the end of the interlude or outro), so as to realize the holding of lyrics during the interlude or outro. And the start display time corresponding to the empty data structure can be the start time of the interlude or outro, or the end display time of the previous lyrics displayed in the second display control.
[0061] As Figure 6As shown, if the last line of lyrics before the interlude or coda is displayed in the second display control, this line of lyrics will remain during the interlude or coda. At the same time, the line of lyrics before the last line of lyrics also needs to remain during the interlude or coda. The line of lyrics before the last line of lyrics is displayed in the first display control. Therefore, if any one of these data structures is the data structure corresponding to the last line of lyrics before the interlude or coda, and the lyrics corresponding to any one of these data structures are displayed in the second display control, then set the end display time corresponding to any one of these data structures and the end display time corresponding to the previous data structure of any one of these data structures to the end time of the interlude or coda (or n seconds before the end of the interlude or coda), and align the end display time of the line of lyrics before the last line of lyrics, the end display time of the last line of lyrics, and the end time of the interlude or coda (or n seconds before the end of the interlude or coda), so as to realize the retention of these two lines of lyrics during the interlude or coda.
[0062] Based on any one of the above embodiments, in order to simulate the lyrics of an offline KTV as realistically as possible, it is also necessary to implement the function of prompting the start of singing after the prelude or interlude, that is, to prompt the timing of starting to sing the first line of lyrics after the prelude or interlude.
[0063] Specifically, displaying the corresponding lyrics in one or more display controls in the lyrics display area as described in S303 may specifically further include:
[0064] If it is determined that the lyrics displayed in the display control are the first line of lyrics after the prelude or interlude, then display a countdown prompt control according to the current song singing progress and the start display time of this line of lyrics. The countdown prompt control is used to prompt the timing of starting to sing this line of lyrics.
[0065] In this embodiment, the first line of lyrics after the prelude or interlude can be determined based on the time information of each line of lyrics, and an array can be maintained to record the timing of starting to sing the first line of lyrics after the prelude or interlude.
[0066] Furthermore, during the singing process of the current song, a timer can be configured to update the time frequently to synchronize the time information corresponding to the current song singing progress, and a judgment logic can be added to the timer to judge whether the current song singing progress enters the time range of the timing of starting to sing the first line of lyrics after the prelude or interlude in the above array, for example, whether it enters the time range of 3 seconds before the timing of starting to sing the first line of lyrics after the prelude or interlude. If so, then display the countdown prompt control and refresh it once per second to achieve the effect of prompting the start of singing. As Figure 7 shown, the countdown prompt control 701 can use dots to represent the countdown. For example, 3 dots represent 3 seconds remaining, 2 dots represent 2 seconds remaining, and 1 dot represents 1 second remaining.
[0067] It should be noted that in the live broadcast scenario, for the viewer-side device, when the viewer-side device enters the live broadcast room, if it is determined that the remaining time from the current song singing progress to the start of singing the first line of lyrics after the intro or interlude exceeds a preset duration (for example, exceeds 2.5 seconds) according to the current song singing progress and the start display time of the first line of lyrics after the intro or interlude, the above countdown prompt control is displayed; however, if it is determined that the remaining time from the current song singing progress to the start of singing the first line of lyrics after the intro or interlude does not exceed the preset duration (for example, does not exceed 2.5 seconds), then the time is not sufficient to play the intro effect completely, so the above countdown prompt control may not be displayed. The preset duration may be equal to the duration of the early prompt for the start of singing, or slightly shorter than the duration of the early prompt for the start of singing.
[0068] Corresponding to the lyrics display method in the above embodiment, Figure 8 is a structural block diagram of the lyrics display device provided by an embodiment of the present disclosure. For ease of description, only parts related to the embodiment of the present disclosure are shown. Referring to Figure 8 the lyrics display device 800 includes: an acquisition unit 801, a processing unit 802, and a display unit 803.
[0069] Among them, the acquisition unit 801 is used to acquire the lyrics data of the current song;
[0070] The processing unit 802 is used to obtain the time information of multiple lines of lyrics according to the lyrics data, and encapsulate each line of lyrics and the corresponding time information into a data structure respectively according to the time information of each line of lyrics in the multiple lines of lyrics, so as to obtain multiple data structures;
[0071] The display unit 803 is used to obtain the target data structure from the multiple data structures according to the time information corresponding to the current song singing progress, and display the corresponding lyrics in one or more display controls in the lyrics display area according to the target data structure.
[0072] In one or more embodiments of the present disclosure, the one or more display controls include a first display control and a second display control, wherein the first display control is located above, to the left, or to the upper left of the second display control.
[0073] In one or more embodiments of the present disclosure, when the processing unit 802 obtains the time information of multiple lines of lyrics according to the lyrics data, it is used to:
[0074] Obtain one or more of the following time information of any line of lyrics: the time interval between the end time of the current line of lyrics and the start time of the next line of lyrics, the start display time of the current line of lyrics, the end display time of the current line of lyrics, and the display duration of the current line of lyrics.
[0075] In one or more embodiments of the present disclosure, after obtaining a plurality of data structures, the processing unit 802 is configured to:
[0076] Determine the display position of the lyrics corresponding to any one of the data structures in the lyrics display area;
[0077] Add the data structure corresponding to the lyrics displayed in the first display control to the first data structure set, and add the data structure corresponding to the lyrics displayed in the second display control to the second data structure set.
[0078] In one or more embodiments of the present disclosure, when the display unit 803 obtains a target data structure from the plurality of data structures according to the time information corresponding to the current song singing progress, and displays the corresponding lyrics in one or more display controls in the lyrics display area, it is configured to:
[0079] Obtain the corresponding first target data structure from the first data structure set according to the time information corresponding to the current song singing progress, and display the corresponding lyrics in the first display control according to the first target data structure; and / or, obtain the corresponding second target data structure from the second data structure set, and display the corresponding lyrics in the second display control according to the second target data structure.
[0080] In one or more embodiments of the present disclosure, before adding the data structure corresponding to the lyrics displayed in the first display control to the first data structure set and adding the data structure corresponding to the lyrics displayed in the second display control to the second data structure set, the processing unit 802 is further configured to:
[0081] Determine whether any one of the data structures is the data structure corresponding to the last sentence of lyrics before the interlude or the end of the song;
[0082] If any one of the data structures is the data structure corresponding to the last sentence of lyrics before the interlude or the end of the song, and the lyrics corresponding to any one of the data structures are displayed in the first display control, insert an empty data structure after any one of the data structures, and align the end display time corresponding to the empty data structure with the end display time corresponding to any one of the data structures; or
[0083] If any one of the data structures is the data structure corresponding to the last sentence of lyrics before the interlude or the end of the song, and the lyrics corresponding to any one of the data structures are displayed in the second display control, align the end display time corresponding to the previous data structure of any one of the data structures with the end display time corresponding to any one of the data structures.
[0084] In one or more embodiments of the present disclosure, when the processing unit 802 determines whether any data structure corresponds to the data structure of the last line of lyrics before an interlude or an ending, it is configured to:
[0085] Determine whether the time interval between the ending time of the lyrics corresponding to any data structure and the starting time of the next line of lyrics exceeds a preset time interval. If so, determine that the any data structure corresponds to the data structure of the last line of lyrics before an interlude or an ending.
[0086] In one or more embodiments of the present disclosure, when the processing unit 802 encapsulates each line of lyrics and the corresponding time information into a data structure respectively according to the time information of each line of lyrics in the multiple lines of lyrics, it is further configured to:
[0087] If the length of any line of lyrics exceeds a preset length, split the any line of lyrics into at least two lines of lyrics, and encapsulate the at least two lines of lyrics and their respective corresponding time information into at least two data structures respectively.
[0088] In one or more embodiments of the present disclosure, when the display unit 803 displays the corresponding lyrics in one or more display controls in the lyrics display area according to the target data structure, it is configured to:
[0089] Display the corresponding lyrics text content in the display control;
[0090] According to the time information corresponding to the current song singing progress, control the width of the mask arranged above the lyrics text content in the display control, so as to distinguish and display the sung part and the unsung part of each line of lyrics.
[0091] In one or more embodiments of the present disclosure, the method is applied to the host device and / or the viewer device in the live broadcast room.
[0092] In one or more embodiments of the present disclosure, if the method is applied to the viewer device, when the acquisition unit 801 acquires the lyrics data of the current song, it is configured to:
[0093] After the viewer device enters the live broadcast room, or after the viewer device detects a song switch according to the live stream data, acquire the lyrics data of the current song;
[0094] When the display unit 803 acquires the target data structure from the multiple data structures according to the time information corresponding to the current song singing progress, it is configured to:
[0095] Obtain the time information corresponding to the current song singing progress from the live stream data, and obtain the target data structure from the multiple data structures according to the time information corresponding to the current song singing progress.
[0096] In one or more embodiments of the present disclosure, when the display unit 803 displays the corresponding lyrics in one or more display controls in the lyrics display area according to the target data structure, it is used for:
[0097] If it is determined that the lyrics displayed by the display control are the first lyrics after the prelude or interlude, a countdown prompt control is displayed according to the current song singing progress and the start display time of this sentence of lyrics, and the countdown prompt control is used to prompt the start singing time of this sentence of lyrics.
[0098] In one or more embodiments of the present disclosure, if the method is applied to the viewer-side device, when the display unit 803 displays the countdown prompt control according to the current song singing progress and the start display time of this sentence of lyrics, it is used for:
[0099] If when the viewer-side device enters the live broadcast room, it is determined that the remaining time until the start of singing of this sentence of lyrics exceeds the preset duration according to the current song singing progress and the start display time of this sentence of lyrics, the countdown prompt control is displayed.
[0100] The lyrics display device provided in this embodiment can be used to execute the technical solutions of the above method embodiments, and its implementation principle and technical effects are similar, which will not be elaborated here in this embodiment.
[0101] Reference Figure 9 , which shows a schematic structural diagram of an electronic device 900 suitable for implementing the embodiments of the present disclosure. The electronic device 900 can be a terminal device or a server. Among them, the terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (Personal Digital Assistant, abbreviated as PDA), tablet computers (Portable Android Device, abbreviated as PAD), portable multimedia players (Portable Media Player, abbreviated as PMP), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs and desktop computers. Figure 9 The electronic device shown is only an example and should not bring any limitations to the functions and usage scopes of the embodiments of the present disclosure.
[0102] Such as Figure 9As shown, the electronic device 900 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 901, which may perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 902 or the program loaded from the storage device 908 into the random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the electronic device 900 are also stored. The processing device 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. The input / output (I / O) interface 905 is also connected to the bus 904.
[0103] Generally, the following devices may be connected to the I / O interface 905: an input device 906 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 908 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 909. The communication device 909 may allow the electronic device 900 to communicate with other devices wirelessly or wirelesly to exchange data. Although Figure 9 the electronic device 900 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices may be implemented or had.
[0104] Specifically, according to an embodiment of the present disclosure, the process described above with reference to the flowchart may be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for performing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from the network through the communication device 909, or installed from the storage device 908, or installed from the ROM 902. When the computer program is executed by the processing device 901, the above functions defined in the method of the embodiment of the present disclosure are executed.
[0105] It should be noted that the computer-readable medium described above can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program, which can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0106] The above computer-readable medium can be included in the above electronic device; or it can exist separately without being assembled into the electronic device.
[0107] The above computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device is caused to execute the method shown in the above embodiments.
[0108] Computer program code for performing the operations of this disclosure may be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also conventional procedural programming languages such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0109] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that, in some alternative implementations, the functions noted in the blocks may occur in an order different from that noted in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system that performs the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
[0110] The units involved in the embodiments described in this disclosure may be implemented in software or in hardware. Among them, the name of the unit does not constitute a limitation to the unit itself in some cases. For example, the first acquisition unit may also be described as "the unit for acquiring at least two Internet protocol addresses".
[0111] The functions described above in this document may be performed at least in part by one or more hardware logic components. For example, by way of non-limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), system on a chip (SOC), complex programmable logic devices (CPLD), and so on.
[0112] In the context of the present disclosure, a machine-readable medium may be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium would include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0113] In a first aspect, according to one or more embodiments of the present disclosure, there is provided a lyrics display method, including:
[0114] Obtaining lyrics data of a current song;
[0115] Obtaining time information of multiple sentences of lyrics according to the lyrics data, and encapsulating each sentence of lyrics and the corresponding time information into a data structure respectively according to the time information of each sentence of lyrics in the multiple sentences of lyrics, to obtain a plurality of data structures;
[0116] According to the time information corresponding to the singing progress of the current song, obtaining a target data structure from the plurality of data structures, and displaying the corresponding lyrics in one or more display controls in a lyrics display area according to the target data structure.
[0117] According to one or more embodiments of the present disclosure, the one or more display controls include a first display control and a second display control, wherein the first display control is located above, to the left, or to the upper left of the second display control.
[0118] According to one or more embodiments of the present disclosure, the obtaining time information of multiple sentences of lyrics according to the lyrics data includes:
[0119] Obtaining one or more of the following time information of any sentence of lyrics: the time interval between the end time of the current lyrics and the start time of the next sentence of lyrics, the start display time of the current lyrics, the end display time of the current lyrics, and the display duration of the current lyrics.
[0120] According to one or more embodiments of the present disclosure, after obtaining the plurality of data structures, it further includes:
[0121] Determining the display position of the lyrics corresponding to any data structure in the lyrics display area;
[0122] Add the data structure corresponding to the lyrics displayed in the first display control to the first data structure set, and add the data structure corresponding to the lyrics displayed in the second display control to the second data structure set.
[0123] According to one or more embodiments of the present disclosure, obtaining a target data structure from the multiple data structures according to the time information corresponding to the current song singing progress, and displaying corresponding lyrics in one or more display controls in the lyrics display area includes:
[0124] Obtain a corresponding first target data structure from the first data structure set according to the time information corresponding to the current song singing progress, and display corresponding lyrics in the first display control according to the first target data structure; and / or, obtain a corresponding second target data structure from the second data structure set, and display corresponding lyrics in the second display control according to the second target data structure.
[0125] According to one or more embodiments of the present disclosure, before adding the data structure corresponding to the lyrics displayed in the first display control to the first data structure set and adding the data structure corresponding to the lyrics displayed in the second display control to the second data structure set, it further includes:
[0126] Determine whether any data structure is the data structure corresponding to the last line of lyrics before the interlude or the end of the song;
[0127] If any data structure is the data structure corresponding to the last line of lyrics before the interlude or the end of the song, and the lyrics corresponding to any data structure are displayed in the first display control, insert an empty data structure after any data structure, and align the end display time corresponding to the empty data structure with the end display time corresponding to any data structure; or
[0128] If any data structure is the data structure corresponding to the last line of lyrics before the interlude or the end of the song, and the lyrics corresponding to any data structure are displayed in the second display control, align the end display time corresponding to the previous data structure of any data structure with the end display time corresponding to any data structure.
[0129] According to one or more embodiments of the present disclosure, determining whether any data structure is the data structure corresponding to the last line of lyrics before the interlude or the end of the song includes:
[0130] Determine whether the time interval between the end time of the lyrics corresponding to any data structure and the start time of the next line of lyrics exceeds a preset time interval. If so, determine that the any data structure is the data structure corresponding to the last line of lyrics before the interlude or the coda.
[0131] According to one or more embodiments of the present disclosure, the encapsulating each line of lyrics and the corresponding time information into a data structure respectively according to the time information of each line of lyrics in the multiple lines of lyrics further includes:
[0132] If the length of any line of lyrics exceeds a preset length, split the any line of lyrics into at least two lines of lyrics, and encapsulate the at least two lines of lyrics and their respective corresponding time information into at least two data structures.
[0133] According to one or more embodiments of the present disclosure, the displaying the corresponding lyrics in one or more display controls in the lyrics display area according to the target data structure includes:
[0134] Display the corresponding lyrics text content in the display control;
[0135] According to the time information corresponding to the current song singing progress, control the width of the mask arranged above the lyrics text content in the display control, so as to distinguish and display the sung part and the unsung part of each line of lyrics.
[0136] According to one or more embodiments of the present disclosure, the method is applied to the host device and / or the viewer device in the live broadcast room.
[0137] According to one or more embodiments of the present disclosure, if the method is applied to the viewer device, the obtaining the lyrics data of the current song includes:
[0138] After the viewer device enters the live broadcast room, or after the viewer device detects a song change according to the live stream data, obtain the lyrics data of the current song;
[0139] The obtaining the target data structure from the multiple data structures according to the time information corresponding to the current song singing progress includes:
[0140] Obtain the time information corresponding to the current song singing progress from the live stream data, and obtain the target data structure from the multiple data structures according to the time information corresponding to the current song singing progress.
[0141] According to one or more embodiments of the present disclosure, the displaying the corresponding lyrics in one or more display controls in the lyrics display area according to the target data structure includes:
[0142] If it is determined that the lyrics displayed by the display control are the first lyrics after the prelude or interlude, a countdown prompt control is displayed according to the current song singing progress and the start display time of this line of lyrics, and the countdown prompt control is used to prompt the start singing time of this line of lyrics.
[0143] According to one or more embodiments of the present disclosure, if the method is applied to the viewer device, the displaying a countdown prompt control according to the current song singing progress and the start display time of this line of lyrics includes:
[0144] When the viewer device enters the live broadcast room, if it is determined according to the current song singing progress and the start display time of this line of lyrics that the remaining time until the start of singing of this line of lyrics exceeds a preset duration, the countdown prompt control is displayed.
[0145] In a second aspect, according to one or more embodiments of the present disclosure, a lyrics display device is provided, including:
[0146] An acquisition unit, configured to acquire lyrics data of the current song;
[0147] A processing unit, configured to obtain time information of multiple lines of lyrics according to the lyrics data, and encapsulate each line of lyrics and the corresponding time information into a data structure respectively according to the time information of each line of lyrics in the multiple lines of lyrics, to obtain multiple data structures;
[0148] A display unit, configured to obtain a target data structure from the multiple data structures according to the time information corresponding to the current song singing progress, and display the corresponding lyrics in one or more display controls in the lyrics display area according to the target data structure.
[0149] According to one or more embodiments of the present disclosure, the one or more display controls include a first display control and a second display control, wherein the first display control is located above, to the left, or to the upper left of the second display control.
[0150] According to one or more embodiments of the present disclosure, when the processing unit obtains the time information of multiple lines of lyrics according to the lyrics data, it is configured to:
[0151] Obtain one or more of the following time information of any line of lyrics: the time interval between the end time of the current lyrics and the start time of the next line of lyrics, the start display time of the current lyrics, the end display time of the current lyrics, and the display duration of the current lyrics.
[0152] According to one or more embodiments of the present disclosure, after obtaining multiple data structures, the processing unit is further configured to:
[0153] Determine the display position of the lyrics corresponding to any data structure in the lyrics display area;
[0154] Add the data structure corresponding to the lyrics displayed in the first display control to the first data structure set, and add the data structure corresponding to the lyrics displayed in the second display control to the second data structure set.
[0155] According to one or more embodiments of the present disclosure, when the display unit obtains a target data structure from the multiple data structures according to the time information corresponding to the current song singing progress, and displays the corresponding lyrics in one or more display controls in the lyrics display area, it is used for:
[0156] Obtain the corresponding first target data structure from the first data structure set according to the time information corresponding to the current song singing progress, and display the corresponding lyrics in the first display control according to the first target data structure; and / or, obtain the corresponding second target data structure from the second data structure set, and display the corresponding lyrics in the second display control according to the second target data structure.
[0157] According to one or more embodiments of the present disclosure, before the processing unit adds the data structure corresponding to the lyrics displayed in the first display control to the first data structure set and adds the data structure corresponding to the lyrics displayed in the second display control to the second data structure set, it is further used for:
[0158] Judge whether any data structure is the data structure corresponding to the last sentence of lyrics before the interlude or the end of the song;
[0159] If any data structure is the data structure corresponding to the last sentence of lyrics before the interlude or the end of the song, and the lyrics corresponding to any data structure are displayed in the first display control, insert an empty data structure after any data structure, and align the end display time corresponding to the empty data structure with the end display time corresponding to any data structure; or
[0160] If any data structure is the data structure corresponding to the last sentence of lyrics before the interlude or the end of the song, and the lyrics corresponding to any data structure are displayed in the second display control, align the end display time corresponding to the previous data structure of any data structure with the end display time corresponding to any data structure.
[0161] According to one or more embodiments of the present disclosure, when the processing unit judges whether any data structure is the data structure corresponding to the last sentence of lyrics before the interlude or the end of the song, it is used for:
[0162] Determine whether the time interval between the end time of the lyrics corresponding to any data structure and the start time of the next line of lyrics exceeds a preset time interval. If so, determine that the any data structure is the data structure corresponding to the last line of lyrics before the interlude or the ending.
[0163] According to one or more embodiments of the present disclosure, when the processing unit encapsulates each line of lyrics and the corresponding time information into a data structure respectively according to the time information of each line of lyrics in the multiple lines of lyrics, it is further configured to:
[0164] If the length of any line of lyrics exceeds a preset length, split the any line of lyrics into at least two lines of lyrics, and encapsulate the at least two lines of lyrics and their respective corresponding time information into at least two data structures.
[0165] According to one or more embodiments of the present disclosure, when the display unit displays the corresponding lyrics in one or more display controls in the lyrics display area according to the target data structure, it is configured to:
[0166] Display the corresponding lyrics text content in the display control;
[0167] According to the time information corresponding to the current song singing progress, control the width of the mask set above the lyrics text content in the display control, so as to distinguish the sung part and the unsung part of each line of lyrics.
[0168] According to one or more embodiments of the present disclosure, the method is applied to the host device and / or the viewer device in the live broadcast room.
[0169] According to one or more embodiments of the present disclosure, if the method is applied to the viewer device, when the acquisition unit acquires the lyrics data of the current song, it is configured to:
[0170] After the viewer device enters the live broadcast room, or after the viewer device detects a song change according to the live stream data, acquire the lyrics data of the current song;
[0171] When the display unit acquires the target data structure from the multiple data structures according to the time information corresponding to the current song singing progress, it is configured to:
[0172] Acquire the time information corresponding to the current song singing progress from the live stream data, and acquire the target data structure from the multiple data structures according to the time information corresponding to the current song singing progress.
[0173] According to one or more embodiments of the present disclosure, when the display unit displays corresponding lyrics in one or more display controls in the lyrics display area according to the target data structure, it is configured to:
[0174] If it is determined that the lyrics displayed by the display control are the first lyrics after the prelude or interlude, a countdown prompt control is displayed according to the current song singing progress and the start display time of this sentence of lyrics, and the countdown prompt control is used to prompt the start singing time of this sentence of lyrics.
[0175] According to one or more embodiments of the present disclosure, if the method is applied to the viewer device, when the display unit displays the countdown prompt control according to the current song singing progress and the start display time of this sentence of lyrics, it is configured to:
[0176] If when the viewer device enters the live broadcast room, it is determined that the remaining time until the start of singing of this sentence of lyrics exceeds a preset duration according to the current song singing progress and the start display time of this sentence of lyrics, the countdown prompt control is displayed.
[0177] In a third aspect, according to one or more embodiments of the present disclosure, an electronic device is provided, including: at least one processor and a memory;
[0178] The memory stores computer-executable instructions;
[0179] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the lyrics display method described in the first aspect above and various possible designs of the first aspect.
[0180] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, in which computer-executable instructions are stored, and when the processor executes the computer-executable instructions, the lyrics display method described in the first aspect above and various possible designs of the first aspect are implemented.
[0181] In a fifth aspect, according to one or more embodiments of the present disclosure, a computer program product is provided, including computer-executable instructions, and when the processor executes the computer-executable instructions, the lyrics display method described in the first aspect above and various possible designs of the first aspect are implemented.
[0182] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of the disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the present disclosure.
[0183] In addition, although the operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, the various features described in the context of a single embodiment may also be implemented separately or in any suitable sub-combination in multiple embodiments.
[0184] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms for implementing the claims.
Claims
1. A method for displaying lyrics, characterized in that, it includes: obtaining the lyrics data of the current song; obtaining the time information of multiple lines of lyrics according to the lyrics data, and encapsulating each line of lyrics and the corresponding time information into a data structure respectively according to the time information of each line of lyrics in the multiple lines of lyrics, to obtain multiple data structures; obtaining a target data structure from the multiple data structures according to the time information corresponding to the singing progress of the current song, and displaying the corresponding lyrics in one or more display controls in the lyrics display area according to the target data structure.
2. The method according to claim 1, characterized in that, the one or more display controls include a first display control and a second display control, wherein the first display control is located above, to the left or in the upper left of the second display control.
3. The method according to claim 2, characterized in that, the obtaining the time information of multiple lines of lyrics according to the lyrics data includes: obtaining one or more of the following time information of any line of lyrics: the time interval between the end time of the current line of lyrics and the start time of the next line of lyrics, the start display time of the current line of lyrics, the end display time of the current line of lyrics, the display duration of the current line of lyrics.
4. The method according to claim 3, characterized in that, after obtaining the multiple data structures, it further includes: determining the display position of the lyrics corresponding to any data structure in the lyrics display area; adding the data structures corresponding to the lyrics displayed in the first display control to a first data structure set, and adding the data structures corresponding to the lyrics displayed in the second display control to a second data structure set.
5. The method according to claim 4, characterized in that, the obtaining a target data structure from the multiple data structures according to the time information corresponding to the singing progress of the current song, and displaying the corresponding lyrics in one or more display controls in the lyrics display area according to the target data structure includes: obtaining a corresponding first target data structure from the first data structure set according to the time information corresponding to the singing progress of the current song, and displaying the corresponding lyrics in the first display control according to the first target data structure; and / or, obtaining a corresponding second target data structure from the second data structure set, and displaying the corresponding lyrics in the second display control according to the second target data structure.
6. The method according to claim 4, characterized in that, before adding the data structures corresponding to the lyrics displayed in the first display control to the first data structure set and adding the data structures corresponding to the lyrics displayed in the second display control to the second data structure set, it further includes: judging whether any data structure is the data structure corresponding to the last line of lyrics before the interlude or the coda; If any of the data structures is the data structure corresponding to the last line of lyrics before an interlude or an outro, and the lyrics corresponding to any of the data structures are displayed in the first display control, then insert an empty data structure after any of the data structures, and align the end display time corresponding to the empty data structure with the end display time corresponding to any of the data structures; or If any of the data structures is the data structure corresponding to the last line of lyrics before an interlude or an outro, and the lyrics corresponding to any of the data structures are displayed in the second display control, then align the end display time corresponding to the previous data structure of any of the data structures with the end display time corresponding to any of the data structures.
7. The method according to claim 4, wherein,[[]] the determination of whether any data structure is the data structure corresponding to the last line of lyrics before an interlude or an outro includes: determining whether the time interval between the end time of the lyrics corresponding to any data structure and the start time of the next line of lyrics exceeds a preset time interval, and if so, determining that any data structure is the data structure corresponding to the last line of lyrics before an interlude or an outro.
8. The method according to any one of claims 1-7, wherein,[[]] the encapsulation of each line of lyrics and the corresponding time information into a data structure respectively according to the time information of each line of lyrics further includes: if the length of any line of lyrics exceeds a preset length, then split the any line of lyrics into at least two lines of lyrics, and encapsulate the at least two lines of lyrics and their respective corresponding time information into at least two data structures.
9. The method according to any one of claims 1-7, wherein,[[]] the display of the corresponding lyrics in one or more display controls in the lyrics display area according to the target data structure includes: displaying the corresponding lyric text content in the display control; controlling the width of the mask set above the lyric text content in the display control according to the time information corresponding to the current song singing progress, so as to distinguish between the sung part and the unsung part of each line of lyrics.
10. The method according to any one of claims 1-7, wherein,[[]] the method is applied to the host device and / or the viewer device in the live broadcast room.
11. The method according to claim 10, wherein,[[]] if the method is applied to the viewer device, then the obtaining of the lyric data of the current song includes: after the viewer device enters the live broadcast room, or after the viewer device detects a song switch according to the live stream data, obtaining the lyric data of the current song; the obtaining of the target data structure from the multiple data structures according to the time information corresponding to the current song singing progress includes: obtaining the time information corresponding to the current song singing progress from the live stream data, and obtaining the target data structure from the multiple data structures according to the time information corresponding to the current song singing progress.
12. The method according to any one of claims 1-7, wherein,[[]] Displaying corresponding lyrics in one or more display controls in the lyrics display area according to the target data structure includes: If it is determined that the lyrics displayed in the display control are the first lyrics after the prelude or interlude, a countdown prompt control is displayed according to the current song singing progress and the start display time of this line of lyrics, and the countdown prompt control is used to prompt the start singing time of this line of lyrics.
13. The method according to claim 12, wherein, If the method is applied to the viewer device, then the displaying a countdown prompt control according to the current song singing progress and the start display time of this line of lyrics includes: When the viewer device enters the live broadcast room, if the remaining time until the start of singing of this line of lyrics is determined to exceed a preset duration according to the current song singing progress and the start display time of this line of lyrics, the countdown prompt control is displayed.
14. A lyrics display device, wherein, comprising: an acquisition unit for acquiring lyrics data of the current song; a processing unit for obtaining time information of multiple lines of lyrics according to the lyrics data, and respectively encapsulating each line of lyrics and the corresponding time information into a data structure according to the time information of each line of lyrics in the multiple lines of lyrics, to obtain multiple data structures; a display unit for obtaining a target data structure from the multiple data structures according to the time information corresponding to the current song singing progress, and displaying corresponding lyrics in one or more display controls in the lyrics display area according to the target data structure.
15. An electronic device, wherein, comprising: at least one processor and a memory; the memory stores computer execution instructions; the at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the method according to any one of claims 1-13.
16. A computer-readable storage medium, wherein, computer execution instructions are stored in the computer-readable storage medium, and when the processor executes the computer execution instructions, the method according to any one of claims 1-13 is implemented.
17. A computer program product, wherein, comprising computer execution instructions, and when the processor executes the computer execution instructions, the method according to any one of claims 1-13 is implemented.