Method for circularly playing song fragments and related equipment

By using a handheld microphone device to identify lyrics or human voice timestamps in audio files and combining them with user commands, the system automatically locates and plays the target sub-audio, solving the problems of cumbersome operation and inaccurate positioning in existing technologies, and achieving fast and accurate playback of song segments.

CN119046496APending Publication Date: 2024-11-29SHENZHEN TEANA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411037506.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

Existing handheld microphone devices require consumers to repeatedly drag the playback progress bar on their phones when they need to practice a line of a song. This is cumbersome and makes it difficult to accurately locate the line to practice.

Method used

The handheld microphone device identifies whether the audio file contains lyrics. If lyrics are present, a timestamp is inserted based on the lyrics. If no lyrics are present, a timestamp is inserted based on the vocals in the audio file. The device then combines these timestamps with user commands to determine the current timestamp, automatically locates and plays the target sub-audio.

Benefits of technology

This technology enables handheld microphone devices to automatically insert timestamps into audio files, quickly and accurately locate and play the corresponding audio segments, simplifying user operations and improving the accuracy and efficiency of practice.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119046496A_ABST
    Figure CN119046496A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of audio processing, in particular to a method for cyclically playing song fragments and related equipment, which can realize cyclically playing the song fragments on sound equipment or handheld microphone equipment. The method comprises the steps of receiving an audio file of a target song, judging whether a lyric file of the target song is received or not to obtain a judgment result, inserting a timestamp into the audio file according to the judgment result to obtain a target audio, responding to an operation instruction of a user, determining a current timestamp according to the operation instruction, and sending the target audio to the user. And determining a target sub-audio corresponding to the current timestamp in the target audio, and playing the target sub-audio.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of audio processing technology, and in particular to a method for looping and playing a song segment and related equipment. Background Art

[0002] With the popularity of Kugou, consumers will choose to sing in KTV or KTV machines, but because KTV or KTV machines have time limits and charge more expensively during peak hours, a number of handheld microphone devices have emerged on the market. Handheld microphone devices are small in size, easy to carry and store, allowing consumers to get the experience of singing in KTV or KTV machines without leaving home. Consumers can have more time to practice and adjust their singing. Handheld microphone devices are also being favored by more and more consumers.

[0003] Common handheld microphone devices on the market usually require consumers to use mobile phones to connect to the handheld microphone devices via Bluetooth. When consumers want to repeatedly practice a sentence of a song, they need to repeatedly drag the play progress bar on the mobile phone. The operation is very cumbersome and it is difficult to accurately locate the sentence that consumers want to practice. Summary of the invention

[0004] The present application provides a method and related equipment for looping playback of song clips, which can solve the problem that when consumers need to repeatedly practice a sentence in a song, they need to repeatedly drag the playback progress bar on the mobile phone, which makes the operation very cumbersome and difficult to accurately locate the sentence to be practiced.

[0005] A first aspect of the present application provides a method for looping a song segment, comprising: Receive the audio file of the target song; Determining whether the lyrics file of the target song is received to obtain a determination result; Inserting a timestamp into the audio file according to the determination result to obtain target audio; Responding to an operation instruction of a user, and determining a current timestamp according to the operation instruction; A target sub-audio corresponding to the current timestamp in the target audio is determined, and the target sub-audio is played.

[0006] By adopting the above technical solution, the handheld microphone device receives the user's audio file, and determines whether the audio file has a lyrics file, selects the corresponding method of inserting timestamps according to the judgment result, inserts timestamps into the audio file, and obtains the target audio, and then receives the user's operation instruction, determines the current timestamp according to the user's operation instruction, determines the target sub-audio of the target audio according to the current timestamp, and plays the target sub-audio. Therefore, the handheld microphone device can automatically insert timestamps into the audio file, and quickly locate and play the corresponding audio clip by identifying the user's instruction, so that the user can play the song clip in a loop without repeatedly dragging the play progress bar.

[0007] Optionally, inserting a timestamp into the audio file according to the judgment result to obtain the target audio file comprises the following steps: If the judgment result is that the lyrics file is not received or the content of the lyrics file is empty, inserting a timestamp into the audio file according to the human voice in the audio file to obtain the target audio; If the judgment result is that the lyrics file is received and the content of the lyrics file is not empty, a timestamp is inserted into the audio file according to the characters in each line of the lyrics file to obtain the target audio.

[0008] By adopting the above technical solution, the handheld microphone device identifies whether the audio file has a corresponding lyrics file and adopts different methods to insert timestamps into the audio file. If the audio file has a lyrics file and the lyrics file is not empty, a timestamp is inserted into the audio file according to each line of characters in the lyrics file. If the audio file has no lyrics file or the lyrics file is empty, a timestamp is inserted into the audio file according to the human voice in the audio file. Therefore, the handheld microphone can select the appropriate method of inserting timestamps according to the lyrics file and segment the audio file more accurately.

[0009] Optionally, inserting a timestamp into the audio file according to the human voice in the audio file to obtain the target audio includes: Identify the human voice in the audio file according to the time progress of the audio file; Inserting a first timestamp at the first moment when the current human voice appears in the audio file, and continuing to recognize the audio file until the current human voice in the audio file disappears; Insert a second timestamp at the second moment when the current human voice in the audio file disappears; The above steps of human voice recognition are performed sequentially according to the time progress of the audio file until the audio file is completely recognized and a timestamp is inserted at the human voice position to obtain the target audio.

[0010] By adopting the above technical solution, the handheld microphone device recognizes the human voice in the audio file, inserts a timestamp in the audio file when the human voice is recognized, and inserts a timestamp in the audio file when the current human voice disappears. Therefore, the handheld microphone device can insert timestamps before and after the human voice appears in the audio file, and accurately segment the audio file.

[0011] Optionally, inserting a timestamp into the audio file according to characters in each line of the lyrics file to obtain the target audio file includes: Determine N combinations corresponding to characters of a first target line, the target line being any line in the lyrics file, each of the N combinations comprising a time mark and text content, N being an integer greater than or equal to 1, and the end of the first target line comprising a carriage return character, and the target combination being represented by the following format, the target combination being any one of the N combinations; [mm:ss.xx]XXX; Wherein, mm is minutes, ss is seconds, xx is milliseconds, and XXX is the text content; A timestamp is inserted into the audio file according to the N combinations to obtain the target audio.

[0012] By adopting the above technical solution, the handheld microphone device inserts a timestamp into the audio file according to N specific combinations of each line in the lyrics file to obtain the target audio. A specific combination includes the following contents: time stamp, text content. Therefore, the handheld microphone device can recognize the lyrics file and find the corresponding position to segment the audio file.

[0013] Optionally, inserting a timestamp into the audio file according to the N combinations to obtain the target audio file includes: Determine whether a preset symbol appears in the text content of the first combination set, the first combination set is the N combinations of characters in the first line of the lyrics file; If the preset symbol appears in the text content of the first combination set, then the recognition of the first row of characters is stopped; If the preset symbol does not appear in the text content of the first combination set, converting the time mark of the first combination in the first combination set into a first timestamp, and inserting the first timestamp into the time position corresponding to the audio file; The above operation is repeatedly performed based on each line of characters in the lyrics file until each line of characters in the lyrics file corresponds to the insertion timestamp position to obtain the target audio.

[0014] By adopting the above technical solution, the handheld microphone device determines whether the preset symbol appears in the text content of all combinations of each line. If the preset symbol appears in the text content of the current line, it means that the current line is song information, and the handheld microphone device no longer recognizes the current line. If the preset symbol does not appear in the text content of the current line, it means that the current line is song lyrics, and the time mark in the first combination is converted into a timestamp and inserted into the audio file. Therefore, the handheld microphone device can identify the song information and song lyrics of each line in the lyrics file, discard the time mark corresponding to the song information, and convert the first time mark corresponding to the song lyrics into a timestamp and insert it into the audio file, so as to segment the audio file according to the lyrics file.

[0015] Optionally, the timestamp includes a start timestamp and an end timestamp, and determining the target sub-audio corresponding to the current timestamp in the target audio includes: If the operation instruction is a loop operation instruction, and the current timestamp is an end timestamp, determining a first timestamp corresponding to the current timestamp, the first timestamp being a start timestamp adjacent to the current timestamp, and the first timestamp being earlier than the current timestamp; Determine the sub-audio between the current timestamp and the first timestamp as the target sub-audio; If the operation instruction is an instruction to play the previous segment, then determining a second timestamp and a third timestamp corresponding to the first timestamp, the third timestamp is an end timestamp adjacent to the first timestamp, and the third timestamp is earlier than the first timestamp, and the second timestamp is a start timestamp adjacent to the third timestamp, and the second timestamp is earlier than the third timestamp; Determine the sub-audio between the second timestamp and the third timestamp as the target sub-audio; If the operation instruction is an instruction to play the next segment, a fourth timestamp and a fifth timestamp corresponding to the current timestamp are determined, wherein the fourth timestamp is a start timestamp adjacent to the current timestamp and the current timestamp is earlier than the fourth timestamp, and the fifth timestamp is an end timestamp adjacent to the fourth timestamp and the fourth timestamp is earlier than the fifth timestamp; Determine the sub-audio between the fourth timestamp and the fifth timestamp as the target sub-audio; By adopting the above technical solution, the handheld microphone device recognizes the instruction input by the user. If the instruction input by the user is to play the song segment in a loop and the current timestamp is the end timestamp, the start timestamp before and adjacent to the current timestamp is found, and the audio segment between the start timestamp and the current timestamp is played to play the current audio segment in a loop. If the instruction input by the user is to play the next segment and the current timestamp is the end timestamp, the start timestamp after and adjacent to the current timestamp is found, and the end timestamp after and adjacent to the start timestamp is found, and the audio segment between the start timestamp and the end timestamp is played to play the next audio segment. If the instruction input by the user is to play the previous segment and the current timestamp is the end timestamp, the end timestamp before and closest to the current timestamp is found, and the start timestamp before and adjacent to the end timestamp is found, and the audio segment between the start timestamp and the end timestamp is played to play the previous audio segment. Therefore, the handheld microphone device can recognize the user instruction, determine the start timestamp and the end timestamp of the song segment that the user needs to play according to the current timestamp, so as to play the corresponding song segment.

[0016] A second aspect of the present application provides a handheld microphone device, which adopts the following technical solution: A handheld microphone device for playing song clips in a loop, comprising: A receiving module, used for receiving an audio file of a target song; A judgment module, used to judge whether the lyrics file of the target song is received to obtain a judgment result; An inserting module, used for inserting a timestamp into the audio file according to the judgment result, so as to obtain a target audio file; A response module, used for responding to the user's operation instruction and determining the current timestamp according to the operation instruction; The playing module is used to determine the target sub-audio corresponding to the current timestamp in the target audio and play the target sub-audio.

[0017] Optionally, the insertion module is specifically used for: If the judgment result is that the lyrics file is not received or the content of the lyrics file is empty, inserting a timestamp into the audio file according to the human voice in the audio file to obtain the target audio; If the judgment result is that the lyrics file is received and the content of the lyrics file is not empty, a timestamp is inserted into the audio file according to the characters in each line of the lyrics file to obtain the target audio.

[0018] A third aspect of the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of a method for looping a song segment as described in the first aspect are implemented.

[0019] The fourth aspect of the present application provides a computer storage medium, which includes instructions, which, when executed on a computer, enable the computer to execute the steps of a method for looping a song segment as described in any of the above aspects.

[0020] In summary, it can be seen that in the embodiment provided by the present application, the handheld microphone device determines whether the received audio file has a corresponding lyrics file. If there is a lyrics file, the timestamp is inserted into the audio file through the lyrics file. If there is no lyrics file, the timestamp is inserted through the human voice in the video audio file, and the handheld microphone device can determine the start timestamp and the end timestamp according to the user's instructions. Thus, the handheld microphone device can accurately locate and play the song clip by inserting the timestamp of the target audio, avoiding the need for the user to repeatedly pull the progress bar when looping the song clip, simplifying the user's operation, and making the playback of the song clip faster and more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 A flowchart of a method for looping a song segment provided by an embodiment of the present application; Figure 2 A virtual structural diagram of a device for looping a song clip provided in an embodiment of the present application; Figure 3 A schematic diagram of the hardware structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0022] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.

[0023] For ease of understanding, some terms provided in the embodiments of the present application are explained below, as follows: LRC file is a common lyrics synchronization file format, mainly used to store lyrics and display the playback progress of lyrics in synchronization with audio files.

[0024] A method for looping a song segment is described below.

[0025] Combined with reference Figure 1 , Figure 1A flowchart of a method for looping a song segment provided in an embodiment of the present application includes: 101. Receive an audio file of a target song; In this embodiment, the handheld microphone device can receive an audio file. The audio file can be received in a manner that a user uses a smart device to establish a Bluetooth connection with the handheld microphone device and sends the audio file to the handheld microphone device via Bluetooth, or a user uses a removable storage device to connect to the handheld microphone device, such as a USB flash drive, a memory card, etc., and transfers the audio file to the handheld microphone device. Of course, audio files can also be received in other ways, such as the handheld microphone device directly downloading audio files via the Internet, or recording the corresponding audio files when transmitting audio files via Bluetooth, storing them in the handheld microphone device, and directly reading the files previously stored in the handheld microphone device when needed. There is no specific limitation.

[0026] 102. Determine whether the lyrics file of the target song is received to obtain a determination result; In this embodiment, the audio file has a corresponding lyrics file. After the handheld microphone device receives the audio file in step 101, it will receive the corresponding lyrics file. The receiving method can be the same as the method of receiving the audio file in step 101, or it can be matching the lyrics file stored in the handheld microphone device according to the audio file. There is no specific limitation. If the judgment result is that the lyrics file of the target song is received and the lyrics file is not empty, then in step 103, a timestamp is inserted into the target audio according to the lyrics file. If the judgment result is that the lyrics file of the target song is not received or the lyrics file is empty, then in step 103, a timestamp is inserted into the target audio through voice recognition.

[0027] 103. Insert a timestamp into the audio file according to the determination result to obtain target audio; In this embodiment, the handheld microphone device can select an appropriate method to automatically insert a timestamp into the audio file according to whether the audio file has a corresponding lyrics file. Of course, the handheld microphone device can also insert a timestamp manually. For example, when the user plays an audio file, the user can manually press a button on the handheld microphone device or click on the screen to insert a timestamp into the audio file at the current playback position. The user can also manually press a button on the handheld microphone device or click on the screen to move and delete the timestamp. There is no specific limitation.

[0028] In one embodiment, inserting a timestamp into the audio file according to the judgment result to obtain the target audio includes the following steps: If the result of the judgment is that the lyrics file is not received or the content of the lyrics file is empty, inserting a timestamp into the audio file according to the human voice in the audio file to obtain the target audio; If the judgment result is that the lyrics file is received and the content of the lyrics file is not empty, a timestamp is inserted into the audio file according to the characters in each line of the lyrics file to obtain the target audio.

[0029] In this embodiment, the handheld microphone device judges the lyrics file of the audio file. If the audio file does not have a corresponding lyrics file or the corresponding audio file is empty, a timestamp is inserted into the audio file by identifying the human voice in the audio file. If the audio file has a corresponding lyrics file, a timestamp is inserted into the audio file by identifying the characters in each line of the lyrics file. By judging the lyrics, an appropriate method of inserting timestamp is selected to obtain the target audio.

[0030] In one embodiment, inserting a timestamp into an audio file according to the human voice in the audio file to obtain the target audio includes the following steps: Identify human voices in audio files according to the time progression of the audio files; Inserting a first timestamp at the first moment when the current human voice appears in the audio file, and continuing to recognize the audio file until the current human voice in the audio file disappears; Insert a second timestamp at the second moment when the current human voice disappears in the audio file; The above steps of voice recognition are performed sequentially according to the time progress of the audio file until the audio file is completely recognized and a timestamp is inserted at the voice position to obtain the target audio.

[0031] In this embodiment, the handheld microphone device inserts a timestamp into the audio file by identifying the human voice in the audio file, inserts a first timestamp when the human voice appears, and inserts a second timestamp when the human voice disappears. After the audio file is completely identified, the target audio is obtained. At this time, the audio between the timestamp where the human voice appears and the timestamp where the human voice disappears in the target audio is a segment of the song.

[0032] In one embodiment, inserting a timestamp into an audio file according to characters in each line of a lyrics file to obtain a target audio file comprises the following steps: Determine N combinations corresponding to the characters of the first target line, the target line is any line in the lyrics file, each of the N combinations includes a time mark and text content, N is an integer greater than or equal to 1, and the end of the first target line includes a carriage return character, the target combination is represented by the following format, and the target combination is any one of the N combinations; [mm:ss.xx]XXX; Among them, mm is minutes, ss is seconds, xx is milliseconds, and XXX is text content; Insert timestamps into the audio file according to the N combinations to obtain the target audio.

[0033] In this embodiment, the lyrics file is an LRC file, each line of the LRC file has N time tags and text content, and each line has a carriage return at the end. The handheld microphone device recognizes the characters of each line of the LRC file in turn, and inserts a timestamp into the audio file according to the combination of the time tag and text content of each line to obtain the target audio.

[0034] In one embodiment, inserting timestamps into an audio file according to N combinations to obtain target audio includes the following steps: Determine whether a preset symbol appears in the text content of the first combination set, the first combination set is the N combinations of characters in the first line of the lyrics file; If a preset symbol appears in the text content of the first combination set, the recognition of the first line of characters is stopped; If the preset symbol does not appear in the text content of the first combination set, converting the time mark of the first combination in the first combination set into a first timestamp, and inserting the first timestamp into the time position corresponding to the audio file; The above operation is repeatedly performed based on each line of characters in the lyrics file until each line of characters in the lyrics file corresponds to the insertion timestamp position to obtain the target audio.

[0035] In this embodiment, the handheld microphone device inserts a timestamp into the audio file according to the collection of N combinations in each line of the lyrics file. If a preset symbol is recognized in the text content of the current collection, the recognition of the current collection is stopped. The preset symbol can be ":", "&", or "song title", "artist", "album", "producer", and there is no specific limitation. If the preset symbol is not recognized in the text content of the current collection, the time stamp of the first combination in the current collection is converted into a timestamp and inserted into the audio file. The above steps are repeated until the audio file is inserted with a timestamp according to each line of characters in the lyrics file to reach the target audio.

[0036] 104. Respond to the user's operation instruction, and determine the current timestamp according to the operation instruction; In this embodiment, the handheld microphone device can obtain the user's operating instructions, which include but are not limited to looping the current song segment, playing the next song segment, and playing the previous song segment. The method of obtaining the instructions may be that the user presses the corresponding button on the handheld microphone device, or clicks on the screen of the handheld microphone device. Of course, the user's operating instructions can also be obtained in other ways, such as the handheld microphone device receiving the user's voice instructions through the microphone, which is not specifically limited.

[0037] The handheld microphone device then determines the current timestamp according to the user's operation instruction.

[0038] 105. Determine a target sub-audio corresponding to the current timestamp in the target audio, and play the target sub-audio; In this embodiment, the handheld microphone device determines the target sub-audio in the target audio and plays the target sub-audio according to the user instruction received in step 104. If the user instruction received in step 104 is to play the current song clip in a loop, the handheld microphone can also extract the accompaniment of the target sub-audio, eliminate the original singing in the song, and obtain the accompaniment of the target sub-audio. The user can set the volume of the target sub-audio and the volume of the accompaniment in advance during the loop playback.

[0039] The following is a specific example of the specific operation of the handheld microphone device when receiving the current song segment that is played in a loop.

[0040] The handheld microphone device receives an instruction to loop and play the current song segment 4 times; The handheld microphone device extracts the accompaniment of the target sub-audio; Play the target sub-audio in a loop according to the volume set by the user in advance; In the first loop playback, the target sub-audio has 100% volume and the target sub-audio's accompaniment has 0% volume; The second loop playback is performed with 50% volume of the target sub-audio and 50% volume of the target sub-audio's accompaniment; The third loop playback, the volume of the target sub-audio is 75% and the volume of the target sub-audio's accompaniment is 25%; The fourth loop playback has the target sub-audio at 0% volume and the target sub-audio's accompaniment at 100% volume.

[0041] In one embodiment, the timestamp includes a start timestamp and an end timestamp, and determining the target sub-audio corresponding to the current timestamp in the target audio includes the following steps: If the operation instruction is a loop operation instruction, and the current timestamp is an end timestamp, then determine a first timestamp corresponding to the current timestamp, the first timestamp is a start timestamp adjacent to the current timestamp, and the first timestamp is earlier than the current timestamp; Determine the sub-audio between the current timestamp and the first timestamp as the target sub-audio; If the operation instruction is an instruction to play the previous segment, then determine the second timestamp and the third timestamp corresponding to the first timestamp, the third timestamp is an end timestamp adjacent to the first timestamp, and the third timestamp is earlier than the first timestamp, and the second timestamp is a start timestamp adjacent to the third timestamp, and the second timestamp is earlier than the third timestamp; Determine the sub audio between the second timestamp and the third timestamp as the target sub audio; If the operation instruction is an instruction to play the next segment, a fourth timestamp and a fifth timestamp corresponding to the current timestamp are determined, the fourth timestamp is a start timestamp adjacent to the current timestamp, and the current timestamp is earlier than the fourth timestamp, and the fifth timestamp is an end timestamp adjacent to the fourth timestamp, and the fourth timestamp is earlier than the fifth timestamp; The sub audio between the fourth time stamp and the fifth time stamp is determined as the target sub audio.

[0042] In this embodiment, the handheld microphone device recognizes the instruction input by the user. If the instruction input by the user is to play the song segment in a loop and the current timestamp is the end timestamp, the start timestamp before and adjacent to the current timestamp is searched, and the audio segment between the start timestamp and the current timestamp is played to play the current audio segment in a loop. If the instruction input by the user is to play the next segment and the current timestamp is the end timestamp, the start timestamp after and adjacent to the current timestamp is searched, and the end timestamp after and adjacent to the start timestamp is searched, and the audio segment between the start timestamp and the end timestamp is played to play the next audio segment. If the instruction input by the user is to play the previous segment and the current timestamp is the end timestamp, the end timestamp before and closest to the current timestamp is searched, and the start timestamp before and adjacent to the end timestamp is searched, and the audio segment between the start timestamp and the end timestamp is played to play the previous audio segment. Therefore, the handheld microphone device can recognize the user instruction, determine the start timestamp and the end timestamp of the song segment that the user needs to play according to the current timestamp, so as to play the corresponding song segment.

[0043] The handheld microphone device can also, when the user input instruction is to play a song clip in a loop, use the current timestamp and the audio clip between the timestamps after and adjacent to the current timestamp as the audio clip to be played in a loop; when the user input instruction is to play the next clip, set the current timestamp to the timestamp after and adjacent to the current timestamp to obtain an updated current timestamp, and use the updated current timestamp and the audio clip between the timestamp after and adjacent to the updated current timestamp as the next audio clip to be played; when the user input instruction is to play the previous clip, set the current timestamp to the timestamp before and adjacent to the current timestamp to obtain an updated current timestamp, and use the audio clip between the updated current timestamp and the current timestamp before the update as the previous audio clip to be played.

[0044] To sum up, it can be seen that in the embodiment provided by the present application, the handheld microphone device can insert timestamps into the audio file to segment the song, and play the current song segment, the previous song segment or the next song segment in a loop according to the user's instructions, and when repeatedly playing the current song segment, the accompaniment of the song segment can be extracted and the volume of the accompaniment and the song segment can be adjusted, so that when the user repeatedly practices the song segment, the corresponding song segment can be played quickly and accurately according to the timestamp, so as to facilitate the user to repeatedly practice singing along, and as the number of times the current song segment is repeated increases, the handheld microphone device will gradually reduce the volume of the song segment and increase the volume of the accompaniment, gradually highlighting the user's voice to achieve a better effect of singing along practice.

[0045] See also Figure 2 , Figure 2 This is a virtual structural diagram of a device for looping a song clip in the present application. The handheld microphone device 200 includes: Receiving module 201, used for receiving the audio file of the target song; The judgment module 202 is used to judge whether the lyrics file of the target song is received to obtain a judgment result; An inserting module 203, configured to insert a timestamp into the audio file according to the determination result to obtain a target audio file; A response module 204, used to respond to the user's operation instruction and determine the current timestamp according to the operation instruction; The playing module 205 is used to determine the target sub-audio corresponding to the current timestamp in the target audio, and play the target sub-audio.

[0046] See also Figure 3 , Figure 3 A schematic diagram of the structure of a computer device provided in an embodiment of the present application, the computer device 300 includes: At least one processor 301, at least one communication bus 302, at least one memory 306, a Bluetooth interface 309, a power supply 307, and a user interface 308. The user interface 308 of the terminal device 300 includes a display, a knob, a button, or a click device. The memory 306 may include a high-speed RAM memory, or may include a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 306 stores one or more computer programs 303 or data 305. When the terminal device 300 is running, the processor 301 communicates with the memory 306, and the processor 301 calls the instructions stored in the memory 306 to execute the above Figures 1 to 3The method for looping and playing a song segment as described above. The operating system 304 includes various programs for implementing various basic services and processing tasks according to hardware.

[0047] In one embodiment, the present application provides a computer device, which may be a server, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for looping and playing a song segment is implemented.

[0048] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0049] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0050] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the above-mentioned computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0051] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Therefore, any equivalent changes made according to the structure, shape, and principle of the present application should be included in the protection scope of the present application.

Claims

1. A method for looping a song segment, characterized in that: include: Receive the audio file of the target song; Determining whether the lyrics file of the target song is received to obtain a determination result; Inserting a timestamp into the audio file according to the determination result to obtain target audio; Responding to an operation instruction of a user, and determining a current timestamp according to the operation instruction; A target sub-audio corresponding to the current timestamp in the target audio is determined, and the target sub-audio is played.

2. The method according to claim 1, characterized in that The inserting a timestamp into the audio file according to the determination result to obtain the target audio file comprises: If the judgment result is that the lyrics file is not received or the content of the lyrics file is empty, inserting a timestamp into the audio file according to the human voice in the audio file to obtain the target audio; If the judgment result is that the lyrics file is received and the content of the lyrics file is not empty, a timestamp is inserted into the audio file according to the characters in each line of the lyrics file to obtain the target audio.

3. The method according to claim 2, characterized in that The inserting a timestamp into the audio file according to the human voice in the audio file to obtain the target audio comprises: Identify the human voice in the audio file according to the time progress of the audio file; Inserting a first timestamp at the first moment when the current human voice appears in the audio file, and continuing to recognize the audio file until the current human voice in the audio file disappears; Insert a second timestamp at the second moment when the current human voice in the audio file disappears; The above steps of human voice recognition are performed sequentially according to the time progress of the audio file until the audio file is completely recognized and a timestamp is inserted at the human voice position to obtain the target audio.

4. The method according to claim 2, characterized in that: The inserting a timestamp into the audio file according to the characters in each line of the lyrics file to obtain the target audio comprises: Determine N combinations corresponding to characters of a first target line, the target line being any line in the lyrics file, each of the N combinations comprising a time mark and text content, N being an integer greater than or equal to 1, and the end of the first target line comprising a carriage return character, and the target combination being represented by the following format, the target combination being any one of the N combinations; [mm:ss.xx]XXX; Wherein, mm is minutes, ss is seconds, xx is milliseconds, and XXX is the text content; A timestamp is inserted into the audio file according to the N combinations to obtain the target audio.

5. The method according to claim 4, characterized in that: The inserting a timestamp into the audio file according to the N combinations to obtain the target audio file comprises: Determine whether a preset symbol appears in the text content of the first combination set, the first combination set is the N combinations of characters in the first line of the lyrics file; If the preset symbol appears in the text content of the first combination set, then the recognition of the first row of characters is stopped; If the preset symbol does not appear in the text content of the first combination set, converting the time mark of the first combination in the first combination set into a first timestamp, and inserting the first timestamp into the time position corresponding to the audio file; The above operation is repeatedly performed based on each line of characters in the lyrics file until each line of characters in the lyrics file corresponds to the insertion timestamp position to obtain the target audio.

6. The method according to any one of claims 1 to 5, characterized in that The timestamp includes a start timestamp and an end timestamp, and determining the target sub-audio corresponding to the current timestamp in the target audio includes: If the operation instruction is a loop operation instruction, and the current timestamp is an end timestamp, determining a first timestamp corresponding to the current timestamp, the first timestamp being a start timestamp adjacent to the current timestamp, and the first timestamp being earlier than the current timestamp; Determine the sub-audio between the current timestamp and the first timestamp as the target sub-audio; If the operation instruction is an instruction to play the previous segment, then determining a second timestamp and a third timestamp corresponding to the first timestamp, the third timestamp is an end timestamp adjacent to the first timestamp, and the third timestamp is earlier than the first timestamp, and the second timestamp is a start timestamp adjacent to the third timestamp, and the second timestamp is earlier than the third timestamp; Determine the sub-audio between the second timestamp and the third timestamp as the target sub-audio; If the operation instruction is an instruction to play the next segment, a fourth timestamp and a fifth timestamp corresponding to the current timestamp are determined, wherein the fourth timestamp is a start timestamp adjacent to the current timestamp and the current timestamp is earlier than the fourth timestamp, and the fifth timestamp is an end timestamp adjacent to the fourth timestamp and the fourth timestamp is earlier than the fifth timestamp; The sub audio between the fourth time stamp and the fifth time stamp is determined as the target sub audio.

7. A device for playing a song segment in a loop, characterized in that: include: A receiving module, used for receiving an audio file of a target song; A judgment module, used to judge whether the lyrics file of the target song is received to obtain a judgment result; An inserting module, used for inserting a timestamp into the audio file according to the judgment result, so as to obtain a target audio file; A response module, used for responding to the user's operation instruction and determining the current timestamp according to the operation instruction; The playing module is used to determine the target sub-audio corresponding to the current timestamp in the target audio and play the target sub-audio.

8. The device according to claim 7, characterized in that The insertion module is specifically used for: If the judgment result is that the lyrics file is not received or the content of the lyrics file is empty, inserting a timestamp into the audio file according to the human voice in the audio file to obtain the target audio; If the judgment result is that the lyrics file is received and the content of the lyrics file is not empty, a timestamp is inserted into the audio file according to the characters in each line of the lyrics file to obtain the target audio.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method for looping a song segment as described in any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for looping a song segment as described in any one of claims 1 to 6 are implemented.