Voice processing method, device, electronic device and storage medium

By obtaining and updating the word segmentation of the pronunciation and performing time alignment processing, the problem of poor musical effects when converting voice to rap songs in the prior art is solved, and the semantics and rhythmic sense is improved.

CN114187919BActive Publication Date: 2024-11-22BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111499834.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-09
Publication Date
2024-11-22
Estimated Expiration
2041-12-09

AI Technical Summary

Technical Problem

When converting speech into rap songs, the word-level alignment strategy is adopted in the prior art to not consider the relevance of words in the words, resulting in poor musical effects and lack of rhythm and semantic retention.

Method used

By obtaining the initial participle of the pending speech and the accompaniment rhythm timestamp of the music accompaniment, the initial participle is updated to obtain the target participle, and the time alignment of the word participle timestamp and the accompaniment rhythm timestamp are performed to generate the music corresponding to the speech.

Benefits of technology

Ensure that the target participle length is appropriate, maintains semantics and rhythm, improves the effect of generating music, avoids excessive tone gaps, and ensures the naturalness of the music.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114187919B_ABST
    Figure CN114187919B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a speech processing method, device, electronic device and storage medium, the method comprising: obtaining an initial word segmentation of a speech to be processed and an accompaniment rhythm timestamp of a musical accompaniment; the initial word segmentation is a speech recognition word of the speech to be processed; according to the accompaniment rhythm timestamp, the initial word segmentation is updated to obtain a target word segmentation of the speech to be processed; the word segmentation timestamp and the accompaniment rhythm timestamp of the target word segmentation are time-aligned to obtain a target correspondence relationship between the word segmentation timestamp of the target word segmentation and the accompaniment rhythm timestamp; according to the speech to be processed, the musical accompaniment and the target correspondence relationship, the music corresponding to the speech to be processed is generated. The use of this method is conducive to improving the musical effect of the generated music.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of audio processing, and in particular to a speech processing method, device, electronic device and storage medium. Background Art

[0002] With the development of audio processing technology, voice can be converted into rap songs by performing audio processing on the voice input by the user.

[0003] In the related art, when processing speech, a word-level alignment strategy is generally used to convert the speech into a rap song; however, when using the word-level alignment strategy, the correlation between the characters in the word is completely ignored, which not only destroys the semantics of the original speech, but also leads to the lack of rap rhythm, resulting in poor musical effect of the generated music. Summary of the invention

[0004] The present disclosure provides a speech processing method, device, electronic device and storage medium to at least solve the problem of poor music effect of music generated in the related art. The technical solution of the present disclosure is as follows:

[0005] According to a first aspect of an embodiment of the present disclosure, there is provided a speech processing method, comprising:

[0006] Obtaining an initial word segmentation of the speech to be processed and an accompaniment rhythm timestamp of the music accompaniment; the initial word segmentation is a speech recognition word of the speech to be processed;

[0007] According to the accompaniment rhythm timestamp, the initial word segmentation is updated to obtain the target word segmentation of the speech to be processed;

[0008] Performing time alignment processing on the segmentation timestamp of the target segmentation and the accompaniment rhythm timestamp to obtain a target corresponding relationship between the segmentation timestamp of the target segmentation and the accompaniment rhythm timestamp;

[0009] The music corresponding to the speech to be processed is generated according to the corresponding relationship among the speech to be processed, the music accompaniment and the target.

[0010] In an exemplary embodiment, the updating of the initial word segmentation according to the accompaniment rhythm timestamp to obtain the target word segmentation of the speech to be processed includes:

[0011] According to the accompaniment rhythm timestamp, a lower limit of a segmentation length and an upper limit of a segmentation length are obtained;

[0012] According to the lower limit of the segmentation length and the upper limit of the segmentation length, a first word sequence number set and a second word sequence number set of the current segmentation in the initial segmentation are obtained; the first word sequence number set is a set consisting of sequence numbers corresponding to segmentations that meet the lower limit of the segmentation length starting from the current segmentation, and the second word sequence number set is a set consisting of sequence numbers corresponding to segmentations that meet the upper limit of the segmentation length starting from the current segmentation;

[0013] When the intersection of the first word sequence number set and the second word sequence number set includes at least one sequence number, obtaining a target word formed between a segment corresponding to each sequence number in the intersection and the current segment;

[0014] When the word segmentation result of the speech to be processed includes the target word, the current word segmentation is updated to the target word to obtain the target word segmentation of the speech to be processed; the word segmentation result is obtained by performing word segmentation processing on the text content of the speech to be processed by a word segmentation tool.

[0015] In an exemplary embodiment, after obtaining the target word formed between the segmentation corresponding to each sequence number in the intersection and the current segmentation, the method further includes:

[0016] When the segmentation result of the speech to be processed does not include the target word, the current segmentation is updated to a word consisting of all segmentations between the segmentation corresponding to the first target sequence number in the intersection of the first sequence number set and the second sequence number set and the current segmentation;

[0017] Among them, when the number of sequence numbers included in the intersection of the first word sequence number set and the second word sequence number set is an odd number, the first target sequence number is the middle sequence number in the intersection of the first word sequence number set and the second word sequence number set; when the number of sequence numbers included in the intersection of the first word sequence number set and the second word sequence number set is an even number, the first target sequence number is any one of the two middle sequence numbers in the intersection of the first word sequence number set and the second word sequence number set.

[0018] In an exemplary embodiment, after obtaining the first word sequence number set and the second word sequence number set of the current word segmentation of the initial word segmentation according to the word segmentation length lower limit and the word segmentation length upper limit, the method further includes:

[0019] In the case where the intersection of the first word sequence number set and the second word sequence number set is empty, a second target sequence number is determined from the first sequence number in the first word sequence number set and the last sequence number in the second word sequence number set; wherein, in the case where the word segmentation result includes a word composed of all the segmentations between the segmentation corresponding to the first sequence number and the current segmentation, the second target sequence number is the first sequence number; and in the case where the word segmentation result includes a word composed of all the segmentations between the segmentation corresponding to the last sequence number and the current segmentation, the second target sequence number is the last sequence number;

[0020] The current participle is updated to a word consisting of all the participles between the participle corresponding to the second target sequence number and the current participle.

[0021] In an exemplary embodiment, the time alignment processing of the segmentation timestamp of the target segmentation and the accompaniment rhythm timestamp to obtain the target corresponding relationship between the segmentation timestamp of the target segmentation and the accompaniment rhythm timestamp includes:

[0022] Calculate the stretching ratio corresponding to the current participle according to the participle timestamp of the current participle in the target participle, the participle timestamp of the next participle of the current participle, the accompaniment rhythm timestamp to be aligned of the accompaniment rhythm timestamp, and the accompaniment rhythm timestamp next to the accompaniment rhythm timestamp to be aligned;

[0023] In the case where the stretching ratio belongs to the preset stretching ratio range, aligning the first timestamp in the word segmentation timestamp of the current word segmentation with the accompaniment rhythm timestamp to be aligned to obtain a corresponding timestamp correspondence, and aligning the word segmentation timestamps of the next word segmentation of the current word segmentation until the end condition is met; the first timestamp is the starting timestamp of the final of the first word in the current word segmentation;

[0024] The timestamp correspondences are combined to obtain the target correspondences.

[0025] In an exemplary embodiment, the method further comprises:

[0026] When the stretching ratio does not fall within the preset stretching ratio range, the first timestamp in the word segmentation timestamp of the current word segmentation is aligned with the accompaniment rhythm timestamp to be aligned to obtain a corresponding timestamp correspondence, and the second timestamp in the word segmentation timestamp of the current word segmentation is aligned with the target accompaniment rhythm timestamp to obtain a corresponding timestamp correspondence; wherein the second timestamp is the end timestamp of the current word segmentation, and the target accompaniment rhythm timestamp is the accompaniment rhythm timestamp corresponding to the end of the current word segmentation.

[0027] In an exemplary embodiment, generating music corresponding to the speech to be processed according to the speech to be processed, the music accompaniment and the target correspondence relationship includes:

[0028] According to the target corresponding relationship, the speech to be processed is scaled to the corresponding accompaniment rhythm timestamp in the music accompaniment to obtain the music corresponding to the speech to be processed.

[0029] In an exemplary embodiment, the step of obtaining the initial word segmentation of the speech to be processed and the accompaniment rhythm timestamp of the music accompaniment includes:

[0030] Performing speech recognition on the speech to be processed to obtain speech recognition words of the speech to be processed as the initial word segmentation;

[0031] Performing rhythm detection on the music accompaniment to obtain the accompaniment rhythm timestamp.

[0032] According to a second aspect of an embodiment of the present disclosure, there is provided a speech processing device, including:

[0033] An acquisition unit is configured to acquire an initial word segment of the speech to be processed and an accompaniment rhythm timestamp of the music accompaniment; the initial word segment is a speech recognition word of the speech to be processed;

[0034] An updating unit is configured to update the initial word segmentation according to the accompaniment rhythm timestamp to obtain a target word segmentation of the speech to be processed;

[0035] An alignment unit is configured to perform time alignment processing on the segmentation timestamp of the target segmentation and the accompaniment rhythm timestamp to obtain a target corresponding relationship between the segmentation timestamp of the target segmentation and the accompaniment rhythm timestamp;

[0036] The generating unit is configured to generate music corresponding to the speech to be processed according to the speech to be processed, the music accompaniment and the target corresponding relationship.

[0037] In an exemplary embodiment, the updating unit is further configured to execute, according to the accompaniment rhythm timestamp, obtaining a lower limit and an upper limit of a word segmentation length; according to the lower limit and the upper limit of the word segmentation length, obtaining a first word sequence number set and a second word sequence number set of the current word segmentation in the initial word segmentation; the first word sequence number set is a set consisting of sequence numbers corresponding to word segmentations that meet the lower limit of the word segmentation length starting from the current word segmentation, and the second word sequence number set is a set consisting of sequence numbers corresponding to word segmentations that meet the upper limit of the word segmentation length starting from the current word segmentation; in the case where the intersection of the first word sequence number set and the second word sequence number set includes at least one sequence number, obtaining a target word formed between the word segmentation corresponding to each sequence number in the intersection and the current word segmentation; in the case where the word segmentation result of the speech to be processed contains the target word, updating the current word segmentation to the target word to obtain the target word of the speech to be processed; the word segmentation result is obtained by performing word segmentation processing on the text content of the speech to be processed by a word segmentation tool.

[0038] In an exemplary embodiment, the updating unit is further configured to update the current participle to a word consisting of all participles between the participle corresponding to the first target sequence number in the intersection of the first word sequence number set and the second word sequence number set and the current participle when the segmentation result of the speech to be processed does not include the target word;

[0039] Among them, when the number of sequence numbers included in the intersection of the first word sequence number set and the second word sequence number set is an odd number, the first target sequence number is the middle sequence number in the intersection of the first word sequence number set and the second word sequence number set; when the number of sequence numbers included in the intersection of the first word sequence number set and the second word sequence number set is an even number, the first target sequence number is any one of the two middle sequence numbers in the intersection of the first word sequence number set and the second word sequence number set.

[0040] In an exemplary embodiment, the updating unit is further configured to determine a second target sequence number from the first sequence number in the first word sequence number set and the last sequence number in the second word sequence number set when the intersection of the first word sequence number set and the second word sequence number set is empty; wherein, when the word segmentation result includes a word consisting of all the segmentations between the segmentation corresponding to the first sequence number and the current segmentation, the second target sequence number is the first sequence number; when the word segmentation result includes a word consisting of all the segmentations between the segmentation corresponding to the last sequence number and the current segmentation, the second target sequence number is the last sequence number; and the current segmentation is updated to a word consisting of all the segmentations between the segmentation corresponding to the second target sequence number and the current segmentation.

[0041] In an exemplary embodiment, the alignment unit is further configured to calculate the stretching ratio corresponding to the current participle according to the participle timestamp of the current participle in the target participle, the participle timestamp of the next participle of the current participle, the accompaniment rhythm timestamp to be aligned of the accompaniment rhythm timestamp, and the next accompaniment rhythm timestamp of the accompaniment rhythm timestamp to be aligned; when the stretching ratio belongs to a preset stretching ratio range, align the first timestamp in the participle timestamp of the current participle with the accompaniment rhythm timestamp to be aligned to obtain a corresponding timestamp correspondence relationship, and align the participle timestamp of the next participle of the current participle until an end condition is met; the first timestamp is the start timestamp of the final of the first word in the current participle; and the timestamp correspondence relationships are combined to obtain the target correspondence relationship.

[0042] In an exemplary embodiment, the alignment unit is further configured to align the first timestamp in the segmentation timestamp of the current word with the accompaniment rhythm timestamp to be aligned to obtain a corresponding timestamp correspondence when the stretching ratio does not fall within a preset stretching ratio range, and to align the second timestamp in the segmentation timestamp of the current word with the target accompaniment rhythm timestamp to obtain a corresponding timestamp correspondence; wherein the second timestamp is the end timestamp of the current word segmentation, and the target accompaniment rhythm timestamp is the accompaniment rhythm timestamp corresponding to the end of the current word segmentation.

[0043] In an exemplary embodiment, the generating unit is further configured to execute scaling of the speech to be processed to a corresponding accompaniment rhythm timestamp in the music accompaniment according to the target corresponding relationship, so as to obtain the music corresponding to the speech to be processed.

[0044] In an exemplary embodiment, the acquisition unit is further configured to perform speech recognition on the speech to be processed to obtain speech recognition words of the speech to be processed as the initial word segmentation; and perform rhythm detection on the music accompaniment to obtain the accompaniment rhythm timestamp.

[0045] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the speech processing method as described in any one of the embodiments of the first aspect.

[0046] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the speech processing method described in any one of the embodiments of the first aspect.

[0047] According to a fifth aspect of the embodiments of the present disclosure, a computer program product is provided, wherein the computer program product comprises instructions, and when the instructions are executed by a processor of an electronic device, the electronic device is enabled to perform the speech processing method described in any one of the embodiments of the first aspect.

[0048] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0049] By obtaining the initial word segmentation of the speech to be processed and the accompaniment rhythm timestamp of the music accompaniment; the initial word segmentation is the speech recognition word of the speech to be processed; then according to the accompaniment rhythm timestamp, the initial word segmentation is updated to obtain the target word segmentation of the speech to be processed; and the word segmentation timestamp of the target word segmentation and the accompaniment rhythm timestamp are time-aligned to obtain the target corresponding relationship between the word segmentation timestamp and the accompaniment rhythm timestamp of the target word segmentation; finally, according to the corresponding relationship between the speech to be processed, the music accompaniment and the target, the music corresponding to the speech to be processed is generated. In this way, when converting speech to music, not only the initial word segmentation of the speech to be processed is considered, but also the initial word segmentation is updated according to the accompaniment rhythm timestamp of the music accompaniment, which can ensure that the length of the target word segmentation is appropriate, thereby ensuring the accuracy of the target word segmentation, so that the target word segmentation has good performance in both semantics and rhythm, thereby improving the music effect of the subsequently generated music, and avoiding the defect of poor music effect of the generated music caused by adopting the word-level alignment strategy. At the same time, the segmentation timestamp of the target word and the accompaniment rhythm timestamp are time-aligned, and the obtained target correspondence is used to generate music corresponding to the speech to be processed. This can avoid a large difference between the pitch of the generated music and the original pitch of the speech to be processed, thereby ensuring the naturalness of the generated music and further improving the musical effect of the generated music.

[0050] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0052] Figure 1 The present invention is a flowchart of a speech processing method according to an exemplary embodiment.

[0053] Figure 2 The present invention is a flowchart showing the steps of text content segmentation based on speech recognition and word segmentation technology according to an exemplary embodiment.

[0054] Figure 3 The figure is a flowchart showing the steps of obtaining target word segmentation of speech to be processed according to an exemplary embodiment.

[0055] Figure 4 The figure is a flowchart showing the steps of word segmentation with time limit according to an exemplary embodiment.

[0056] Figure 5 The figure is a flowchart showing steps of voice-rap timestamp alignment according to an exemplary embodiment.

[0057] Figure 6 The invention is a block diagram of a speech processing device according to an exemplary embodiment.

[0058] Figure 7 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0059] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0060] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0061] It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.

[0062] Figure 1 is a flow chart of a speech processing method according to an exemplary embodiment. Figure 1 As shown, the voice processing method is used in a terminal; it can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through interaction between the terminal and the server. In this exemplary embodiment, the method includes the following steps:

[0063] In step S110, the initial word segmentation of the speech to be processed and the accompaniment rhythm timestamp of the music accompaniment are obtained; the initial word segmentation is the speech recognition word of the speech to be processed.

[0064] Among them, the voice to be processed refers to the free speech that needs to be converted into music, such as a voice with normal speaking speed uploaded by a user, "Many sports events around the world have been held safely in the past year."

[0065] Among them, the initial word segmentation refers to the word segmentation obtained after speech recognition of the processed speech through speech recognition technology. For example, if the processed speech is a voice file with the content of "many sports events around the world were held safely in the past year", the initial word segmentation obtained after speech recognition is [past, year, global, many, sports, events, held safely].

[0066] The music accompaniment refers to the music accompaniment corresponding to the speech to be processed, such as the music accompaniment selected by the user, which can be a rap accompaniment or other types of music accompaniment, which is not specifically limited here.

[0067] The accompaniment rhythm timestamp refers to the timestamp corresponding to the accompaniment rhythm point in the music accompaniment, such as t0, t1, t2, etc., which can be obtained by performing rhythm detection on the music accompaniment.

[0068] Specifically, the terminal obtains the voice uploaded by the user as the voice to be processed, and performs voice recognition processing on the voice to be processed to obtain the text content of the voice to be processed and each voice recognition word of the voice to be processed, and determines each voice recognition word as the initial word segmentation of the voice to be processed; at the same time, the rhythm of the music accompaniment selected by the user is detected to obtain the accompaniment rhythm timestamp of the music accompaniment.

[0069] In step S120, the initial word segmentation is updated according to the accompaniment rhythm timestamp to obtain the target word segmentation of the speech to be processed.

[0070] The target word segmentation refers to the updated short phrase of appropriate length to ensure that the generated music has sufficient rhythm while maintaining good semantic properties.

[0071] Specifically, the terminal uses a word segmentation tool to perform word segmentation on the text content of the speech to be processed, and obtains the word segmentation result of the speech to be processed; for example, the text content "Many sports events around the world were held safely in the past year" is segmented to obtain the word segmentation result of "Many sports events were held safely in the past year". Then, the terminal updates the initial word segmentation of the speech to be processed according to the accompaniment rhythm timestamp and the word segmentation result, so as to limit the length of the initial word segmentation of the speech to be processed and obtain a short phrase of appropriate length as the target word segmentation of the speech to be processed.

[0072] In step S130, the word segmentation timestamp of the target word segmentation and the accompaniment rhythm timestamp are time-aligned to obtain a target corresponding relationship between the word segmentation timestamp of the target word segmentation and the accompaniment rhythm timestamp.

[0073] Among them, the segmentation timestamp of the target segmentation includes the start timestamp of the target segmentation, the start timestamp of the final of the first word in the target segmentation, and the end timestamp of the target segmentation, which is expressed as <target segmentation sequence number, start timestamp of the target segmentation, start timestamp of the final of the first word in the target segmentation, end timestamp of the target segmentation>.

[0074] The time alignment processing of the segmentation timestamp of the target segmentation and the accompaniment rhythm timestamp refers to aligning the segmentation timestamp of the target segmentation to the corresponding accompaniment rhythm point.

[0075] Among them, the target correspondence relationship refers to the alignment relationship between the segmentation timestamp of the target segmentation in the speech to be processed and the accompaniment rhythm timestamp of the music accompaniment, specifically refers to the alignment relationship between the vowel start timestamp of the first word of the target segmentation in the speech to be processed and the accompaniment rhythm timestamp of the music accompaniment. It should be noted that if there are two or more target segmentations, then the target correspondence relationship between the segmentation timestamp of the target segmentation and the accompaniment rhythm timestamp of the music accompaniment is also two or more groups.

[0076] Specifically, the terminal performs time alignment processing on the segmentation timestamp of the target word segmentation and the accompaniment rhythm timestamp of the music accompaniment according to the speech-music timestamp alignment instruction, and obtains the target corresponding relationship between the segmentation timestamp of the target word segmentation and the accompaniment rhythm timestamp of the music accompaniment.

[0077] In step S140, music corresponding to the speech to be processed is generated according to the correspondence between the speech to be processed, the music accompaniment and the target.

[0078] The type of the generated music matches the music accompaniment. For example, if the selected music accompaniment is a rap accompaniment, the generated music is a rap song.

[0079] Specifically, the terminal uses the pitch-invariant time-domain audio scaling technology to scale the speech to be processed to the corresponding accompaniment rhythm timestamp in the music accompaniment based on the target correspondence between the word segmentation timestamp of the target word segmentation and the accompaniment rhythm timestamp of the music accompaniment, and obtains the complete music as the music corresponding to the speech to be processed. In this way, the generated music can be kept pitch-invariant and the original pitch of the speech to be processed can be maintained, thereby improving the musical effect of the generated music.

[0080] For example, after obtaining the "voice-rap" time alignment, the terminal uses the pitch-invariant time-domain audio scaling technology to scale the original voice and paste it onto the rap accompaniment, thereby generating a complete rap song.

[0081] In the above-mentioned speech processing method, the initial word segmentation of the speech to be processed and the accompaniment rhythm timestamp of the music accompaniment are obtained; the initial word segmentation is the speech recognition word of the speech to be processed; then the initial word segmentation is updated according to the accompaniment rhythm timestamp to obtain the target word segmentation of the speech to be processed; and the word segmentation timestamp of the target word segmentation and the accompaniment rhythm timestamp are time-aligned to obtain the target corresponding relationship between the word segmentation timestamp and the accompaniment rhythm timestamp of the target word segmentation; finally, according to the speech to be processed, the music corresponding to the speech to be processed is generated. In this way, when converting speech to music, not only the initial word segmentation of the speech to be processed is considered, but also the initial word segmentation is updated according to the accompaniment rhythm timestamp of the music accompaniment, which can ensure that the length of the target word segmentation is appropriate, thereby ensuring the accuracy of the target word segmentation, so that the target word segmentation has good performance in both semantics and rhythm, thereby improving the music effect of the subsequently generated music, and avoiding the defect of poor music effect of the generated music caused by adopting the word-level alignment strategy. At the same time, the segmentation timestamp of the target word and the accompaniment rhythm timestamp are time-aligned, and the obtained target correspondence is used to generate music corresponding to the speech to be processed. This can avoid a large difference between the pitch of the generated music and the original pitch of the speech to be processed, thereby ensuring the naturalness of the generated music and further improving the musical effect of the generated music.

[0082] In an exemplary embodiment, the above step S110, obtaining the initial word segmentation of the speech to be processed and the accompaniment rhythm timestamp of the musical accompaniment, specifically includes: performing speech recognition on the speech to be processed to obtain the speech recognition words of the speech to be processed as the initial word segmentation; performing rhythm detection on the musical accompaniment to obtain the accompaniment rhythm timestamp.

[0083] Specifically, the terminal performs speech recognition on the speech to be processed according to the speech recognition instruction, obtains the text content of the speech to be processed, each speech recognition word of the speech to be processed, and the text timestamp corresponding to each speech recognition word; wherein the text timestamp indicates the start and end time of each speech recognition word and the start time of the vowel of the first word therein; each speech recognition word of the speech to be processed is determined as the initial word segmentation of the speech to be processed; the text timestamp corresponding to each speech recognition word is used as the word segmentation timestamp of each initial word segmentation. Then, the terminal performs rhythm detection on the selected music accompaniment according to the rhythm detection instruction, and obtains the accompaniment rhythm timestamp of the music accompaniment.

[0084] For example, see Figure 2, the terminal recognizes the "user input voice" and obtains the "text timestamp" and "text content" respectively. For example, if the user inputs a voice file with the content "many global sports events were held safely in the past year", the "text timestamp" indicates the start and end time of each voice recognition word and the start time of the final of the first word in it, and is given in the following form: "<past, b0, v0, e0>, <year, b1, v1, e1>, <in, b2, v2, e2>, <global, b3, v3, e3>, <many, b4, v4, e4>, <sports, b5, v5, e5>, <event, b6, v6, e6>, <safe, b7, v7, e7>, <held, b8, v8, e8>", where b_i indicates the start timestamp of the current voice recognition word, vi_i indicates the start timestamp of the final of the first word in the current voice recognition word, and e_i indicates the end timestamp of the current voice recognition word. "Text content" refers to the text content of the current voice file obtained by voice recognition, which in this case is "In the past year, many global sports events were held safely." At the same time, the terminal performs rhythm detection on the "rap accompaniment" and outputs the "accompaniment rhythm timestamp," which is represented by "t0, t1, t2,..." Generally speaking, rap songs have a strong sense of rhythm, and accompaniments with a strong sense of rhythm will also be selected to generate rap songs during the implementation of the algorithm. In addition, after obtaining the text content, the terminal uses a word segmentation tool to perform word segmentation on the "text content" obtained by voice recognition to obtain a "word segmentation result." In this case, the word segmentation result obtained by the word segmentation tool is "In the past, one year, many, global, sports events, were held safely," and the voice recognition words obtained by voice recognition are "In the past, one year, one, global, many, sports, events, were held safely." In short, through Figure 2 , you can get the text timestamp, text content, word segmentation results and accompaniment rhythm timestamp.

[0085] It should be noted that the words obtained by speech recognition are not consistent with the segmentation results obtained by the word segmentation tool. The latter has better semantic properties, but may be too long or too short, so the above segmentation results need to be optimized in combination with the accompaniment rhythm points.

[0086] The technical solution provided by the disclosed embodiment, by obtaining the initial word segmentation of the speech to be processed and the accompaniment rhythm timestamp of the musical accompaniment, is conducive to the subsequent updating of the initial word segmentation according to the accompaniment rhythm timestamp, so as to adjust the length of the initial word segmentation and ensure that the length of the obtained target word segmentation is appropriate, thereby ensuring that the subsequently generated music has sufficient rhythm while maintaining good semantic properties, thereby improving the musical effect of the generated music.

[0087] In an exemplary embodiment, if Figure 3As shown, the above step S120, according to the accompaniment rhythm timestamp, updates the initial segmentation to obtain the target segmentation of the speech to be processed, which can be specifically achieved by the following steps:

[0088] In step S310, the lower limit and the upper limit of the word segmentation length are obtained according to the accompaniment rhythm timestamp.

[0089] The lower limit of the word segmentation length refers to the minimum time length of the word segmentation, and the upper limit of the word segmentation length refers to the maximum time length of the word segmentation.

[0090] Specifically, the terminal obtains the average time interval between adjacent accompaniment rhythm timestamps as the average time interval of the accompaniment rhythm timestamps; obtains the product of the average time interval and the first coefficient (such as 0.9) as the lower limit of the word segmentation length; obtains the product of the average time interval and the second coefficient (such as 1.1) as the upper limit of the word segmentation length.

[0091] In step S320, based on the lower limit and the upper limit of the word segmentation length, the first word sequence number set and the second word sequence number set of the current word segmentation in the initial word segmentation are obtained; the first word sequence number set is a set consisting of sequence numbers corresponding to the word segmentations that meet the lower limit of the word segmentation length starting from the current word segmentation, and the second word sequence number set is a set consisting of sequence numbers corresponding to the word segmentations that meet the upper limit of the word segmentation length starting from the current word segmentation.

[0092] Among them, reference Figure 4 , assuming that the lower limit of the word segmentation length is dur_lo, the upper limit of the word segmentation length is dur_hi, and the starting timestamp of the final of the first word in the current word segmentation is t, then starting from the current word segmentation, the sequence number corresponding to the word segmentation that meets the lower limit of the word segmentation length refers to the sequence number corresponding to the word segmentation with a timestamp greater than t+dur_lo, otherwise the length of the optimized word segmentation is too short, and these sequence numbers constitute the first word sequence number set idx_lo; starting from the current word segmentation, the sequence number corresponding to the word segmentation that meets the upper limit of the word segmentation length refers to the sequence number corresponding to the word segmentation with a timestamp less than t+dur_hi, otherwise the length of the optimized word segmentation is too long, and these sequence numbers constitute the second word sequence number set idx_hi.

[0093] Specifically, the terminal starts from the current word segmentation in the initial word segmentation, obtains the serial numbers corresponding to the word segmentations that meet the lower limit of the word segmentation length, and determines the set consisting of the serial numbers corresponding to the word segmentations that meet the lower limit of the word segmentation length as the first word sequence number set; at the same time, starting from the current word segmentation in the initial word segmentation, obtains the serial numbers corresponding to the word segmentations that meet the upper limit of the word segmentation length, and determines the set consisting of the serial numbers corresponding to the word segmentations that meet the upper limit of the word segmentation length as the second word sequence number.

[0094] In step S330, when the intersection of the first word sequence number set and the second word sequence number set includes at least one sequence number, a target word formed between the segmentation corresponding to each sequence number in the intersection and the current segmentation is obtained.

[0095] Among them, the intersection of the first word sequence number set and the second word sequence number set includes at least one sequence number, which means that the intersection is not empty. The target word formed between the participle corresponding to each sequence number in the intersection and the current participle refers to the target word corresponding to the set formed by all sequence numbers between each sequence number in the intersection and the sequence number corresponding to the current participle; the set is a left-closed and right-open set, such as [1, 2), [1, 2, 3). It should be noted that the target word corresponding to the set refers to the combination of the participles corresponding to the valid sequence numbers in the set, wherein the valid sequence numbers are the sequence numbers in the set except the last sequence number. For example, for the set [1, 2, 3), the target word is a phrase composed of the participle corresponding to sequence number 1 and the participle corresponding to sequence number 2; for the set [1, 2), the target word is the participle corresponding to sequence number 1.

[0096] Specifically, when the intersection of the first word sequence number set and the second word sequence number set is not empty, the terminal combines all sequence numbers between each sequence number in the intersection and the sequence number corresponding to the current word segmentation to obtain a set between each sequence number in the intersection and the sequence number corresponding to the current word segmentation, and obtains a phrase composed of the word segments corresponding to the valid sequence numbers in each set, corresponding to the target word formed between the word segmentation corresponding to each sequence number in the intersection and the current word segmentation.

[0097] In step S340, when the word segmentation result of the speech to be processed includes the target word, the current word segmentation is updated to the target word to obtain the target word segmentation of the speech to be processed; the word segmentation result is obtained by performing word segmentation processing on the text content of the speech to be processed by a word segmentation tool.

[0098] For example, see Figure 4According to the rhythm detection result, the terminal can obtain the average time point interval dur of the rap accompaniment, and use it to set the upper and lower limits of the word segmentation length, dur_hi and dur_lo respectively. Among them, the rhythm point detection results are similar to t1, t2, ... tn. You only need to calculate the average time of the interval to get the specific value of the average time point interval dur. For example, the i-th word currently being processed is "one year" (i.e., i=1), and according to dur_lo, the idx_lo (the set consisting of the serial numbers of the words that meet the lower limit of the length) is [2,3,4,5,6,8]. Then, according to the judgment logic, we will further consider the idx_hi corresponding to dur_hi (the set consisting of the serial numbers of the words that meet the upper limit of the length), and assume that the obtained idx_hi is [2,3]; among them, dur_hi and dur_lo represent the upper and lower limits of the length of word segmentation respectively. Word segmentation based on the upper and lower limits can ensure that the subsequent time stretching operation is within a more reasonable stretching scale range, such as dur_hi=dur×1.1, dur_lo=dur×0.9. For example, if the timestamp of the final of the first word of the current word is t, then the words with timestamps greater than t+dur_lo are considered as words that meet the lower limit of length, otherwise the length after optimized word segmentation is too short, and the set of serial numbers corresponding to these words is idx_lo; similarly, the words with timestamps less than t+dur_hi are considered as words that meet the upper limit of length, otherwise the length after optimized word segmentation is too long, and the set of serial numbers corresponding to these words is idx_hi. According to the judgment logic, considering that the intersection of idx_lo and idx_hi is [2,3], there are two new ways of optimizing word segmentation: considering [1,2), only [1] is used as the new optimized word segmentation, that is, "one year"; considering [1,2,3), "one year" is used as the new optimized word segmentation, that is, "one year"; according to the judgment logic, knowing that "one year" is in the results obtained by the word segmentation tool, this word segmentation method is adopted, i is set to 3 and word segmentation continues from the beginning of the loop. In this example, assume that the optimized word segmentation result is “in the past, in a year, there were numerous, global sports events, which were held safely”, and is given in the following form: “<past, b0, v0, e0>, <in a year, b1, v1, e1>, <numerous global, b2, v2, e2>, <sports events, b3, v3, e3>, <safe, b4, v4, e4>, <held, b5, v5, e5>”.

[0099] The technical solution provided by the embodiment of the present disclosure updates the initial word segmentation according to the lower limit and the upper limit of the word segmentation length, which can avoid the length of the updated word segmentation being too long or too short, thereby ensuring that the length of the obtained target word segmentation is appropriate; at the same time, the word segmentation result obtained by the word segmentation tool is used to optimize the initial word segmentation, thereby avoiding the situation where the relevance of words in the word is not considered when adopting a word-level alignment strategy, which not only destroys the semantics of the original speech, but also leads to the lack of rap rhythm, thereby causing the defect of poor musical effect of the generated music, so that the obtained target word segmentation performs well in both semantics and rhythm, thereby improving the musical effect of the subsequently generated music.

[0100] In an exemplary embodiment, the above step S230, after obtaining the target word formed between the segmentation corresponding to each sequence number in the intersection and the current segmentation, further includes: when the segmentation result of the speech to be processed does not include the target word, updating the current segmentation to a word formed by all segmentations between the segmentation corresponding to the first target sequence number in the intersection of the first word sequence number set and the second word sequence number set and the current segmentation; wherein, when the number of sequence numbers included in the intersection of the first word sequence number set and the second word sequence number set is an odd number, the first target sequence number is the middle sequence number in the intersection of the first word sequence number set and the second word sequence number set; when the number of sequence numbers included in the intersection of the first word sequence number set and the second word sequence number set is an even number, the first target sequence number is any one of the two middle sequence numbers in the intersection of the first word sequence number set and the second word sequence number set.

[0101] Among them, when the number of sequence numbers included in the intersection of the first word sequence number set and the second word sequence number set is an odd number, the middle sequence number in the intersection of the first word sequence number set and the second word sequence number set is called the first target sequence number; when the number of sequence numbers included in the intersection of the first word sequence number set and the second word sequence number set is an even number, any one of the two middle sequence numbers in the intersection of the first word sequence number set and the second word sequence number set is called the first target sequence number.

[0102] Specifically, when the word segmentation result of the speech to be processed does not include the target word, the terminal determines the first target sequence number from the intersection of the first word sequence number set and the second word sequence number set, and updates the current word segmentation to a word composed of all the words between the word segmentation corresponding to the first target sequence number and the current word segmentation.

[0103] For example, see Figure 4 , when the constituent phrase is not in the word segmentation result, take the middle position of the intersection of the first word sequence number set idx_lo and the second word sequence number set idx_hi to form a new optimized word segmentation result, update i, and continue to segment from the beginning of the loop.

[0104] The technical solution provided by the embodiment of the present disclosure updates the current word segmentation to a word consisting of all the word segmentations between the word segmentation corresponding to the first target sequence number in the intersection of the first word sequence number set and the second word sequence number set and the current word segmentation when the word segmentation result of the speech to be processed does not contain the target word. This avoids the defect that the current word segmentation cannot be updated when the word segmentation result of the speech to be processed does not contain the target word, thereby ensuring that the length of the obtained target word segmentation is appropriate and further improving the accuracy of the obtained target word segmentation.

[0105] In an exemplary embodiment, the above step S220, after obtaining the first word sequence number set and the second word sequence number set of the current word segmentation of the initial word segmentation according to the lower limit of the word segmentation length and the upper limit of the word segmentation length, also includes: when the intersection of the first word sequence number set and the second word sequence number set is empty, determining the second target sequence number from the first sequence number in the first word sequence number set and the last sequence number in the second word sequence number set; wherein, when the word segmentation result includes words composed of all the word segmentations between the word segmentation corresponding to the first sequence number and the current word segmentation, the second target sequence number is the first sequence number; when the word segmentation result includes words composed of all the word segmentations between the word segmentation corresponding to the last sequence number and the current word segmentation, the second target sequence number is the last sequence number; and updating the current word segmentation to the word composed of the word segmentation corresponding to the second target sequence number and the current word segmentation.

[0106] The intersection of the first word sequence number set and the second word sequence number set is empty, which means that the intersection does not include the sequence number of the segmented word. The first sequence number in the first word sequence number set refers to the first sequence number in the first word sequence number set. The last sequence number in the second word sequence number set refers to the last sequence number in the second word sequence number set.

[0107] Specifically, when the intersection of the first word sequence number set and the second word sequence number set is empty, the terminal obtains a first word consisting of all the segmentations between the segmentation corresponding to the first sequence number in the first word sequence number set and the current segmentation, and a second word consisting of all the segmentations between the segmentation corresponding to the last sequence number in the second word sequence number set and the current segmentation; when the segmentation result of the speech to be processed includes the first word, the first sequence number in the first word sequence number set is determined as the second target sequence number; when the segmentation result of the speech to be processed includes the second word, the last sequence number in the second word sequence number set is determined as the second target sequence number; and the current segmentation is updated to a word consisting of all the segmentations between the segmentation corresponding to the second target sequence number and the current segmentation.

[0108] For example, see Figure 4, the terminal calculates the intersection of the first word sequence number set idx_lo and the second word sequence number set idx_hi. If the intersection is empty, it determines a more suitable position between idx_hi[-1] and idx_lo[0] as an optimized word segmentation result, updates i, and continues to segment words from the beginning of the loop. Among them, idx_lo[0] represents the first sequence number in the first word sequence number set idx_lo, and idx_hi[-1] represents the last sequence number in the second word sequence number set idx_hi.

[0109] Further, refer to Figure 4 , starting from the i-th word, calculate the word numbers covered by the lower limit of the word segmentation length dur_lo, and obtain the first word number set idx_lo; determine whether the length of the first word number set idx_lo is 0. If the length of the first word number set idx_lo is 0, merge all the remaining words as an optimized word segmentation result, and end the word segmentation optimization. If the length of the first word number set idx_lo is not 0, start from the i-th word, calculate the word numbers covered by the upper limit of the word segmentation length dur_hi, and obtain the second word number set idx_hi; determine whether the length of the second word number set idx_hi is 0. If the length of the second word number set idx_hi is 0, take the current word as an optimized word segmentation result, i=i+1.

[0110] The technical solution provided by the embodiment of the present disclosure, when the intersection of the first word sequence number set and the second word sequence number set is empty, first determines the second target sequence number from the first sequence number in the first word sequence number set and the last sequence number in the second word sequence number set according to the segmentation result of the segmentation tool, and then updates the current segmentation to a word composed of all the segmentations between the segmentation corresponding to the second target sequence number and the current segmentation, avoiding the defect that the current segmentation cannot be updated when the intersection of the first word sequence number set and the second word sequence number set is empty, thereby ensuring that the length of the obtained target segmentation is appropriate, and further improving the accuracy of the obtained target segmentation.

[0111] In an exemplary embodiment, the above step S130 performs time alignment processing on the segmentation timestamp and the accompaniment rhythm timestamp of the target segmentation to obtain the target corresponding relationship between the segmentation timestamp and the accompaniment rhythm timestamp of the target segmentation, specifically including: calculating the stretching ratio corresponding to the current segmentation according to the segmentation timestamp of the current segmentation in the target segmentation, the segmentation timestamp of the next segmentation of the current segmentation, the accompaniment rhythm timestamp to be aligned of the accompaniment rhythm timestamp, and the next accompaniment rhythm timestamp of the accompaniment rhythm timestamp to be aligned; when the stretching ratio belongs to the preset stretching ratio range, aligning the first timestamp in the segmentation timestamp of the current segmentation with the accompaniment rhythm timestamp to be aligned to obtain the corresponding timestamp correspondence, and aligning the segmentation timestamp of the next segmentation of the current segmentation until the end condition is met; the first timestamp is the starting timestamp of the final of the first word in the current segmentation; combining the timestamp correspondences to obtain the target correspondence.

[0112] The preset stretch ratio range refers to the stretch ratio range composed of the preset lower limit of the stretch ratio and the preset upper limit of the stretch ratio. The lower limit of the stretch ratio and the upper limit of the stretch ratio can be adjusted according to actual conditions and are not specifically limited here.

[0113] The first timestamp in the word segmentation timestamp of the current word segmentation refers to the starting timestamp of the final of the first word in the current word segmentation.

[0114] The end condition refers to the completion of aligning the segmentation timestamp of the last segmentation in the target segmentation with the accompaniment rhythm timestamp to be aligned.

[0115] Among them, the target correspondence is composed of multiple groups of timestamp correspondences.

[0116] For example, see Figure 5, too long or too short a stretch ratio will cause serious distortion of the generated rap song, so this scheme will specify an expected stretch ratio r, as well as the upper and lower limits of the stretch ratio r_hi and r_lo. Because the actual pronunciation of Chinese characters starts with the finals, the final timestamp of the first word in each word is mapped to the accompaniment rhythm point. In this step, assuming that the i-th phrase is being aligned to the i-th rhythm point, according to the output of the previous step, the phrase timestamp can be expressed as<wrd_i,b_i,v_i,e_i> , the next adjacent phrase is<wrd_i+1,b_i+1,v_i+1,e_i+1> ; The timestamp of the rhythm point to be aligned is t_i, and the timestamp of the next adjacent rhythm point is t_i+1. Among them, wrd_i represents the serial number corresponding to the i-th phrase, b_i represents the start timestamp of the i-th phrase, vi_i represents the start timestamp of the final of the first word in the i-th phrase, and e_i represents the end timestamp of the i-th phrase; similarly, wrd_i+1 represents the serial number corresponding to the i+1-th phrase, b_i+1 represents the start timestamp of the i+1-th phrase, vi_i+1 represents the start timestamp of the final of the first word in the i+1-th phrase, and e_i+1 represents the end timestamp of the i+1-th phrase. According to Figure 5 The formula in the flowchart is used to calculate the stretching ratio: r = (t_i + 1 - t_i) / (v_i + 1 - v_i). If the stretching ratio is between the upper and lower limits of the stretching ratio, that is, r> = r_lo and r < = r_hi, a set of "speech-rap" mapping relationships is obtained:<v_i,t_i> , i=i+1, and continue mapping the next position. Repeat the above steps to obtain n groups of "speech-rap" timestamp correspondences, which can be represented as a matrix M(n×2); M[i,0] represents the timestamp of speech in the i-th group of mappings, and M[i,1] represents the timestamp of rap in the i-th group of mappings.

[0117] The technical solution provided by the disclosed embodiment, when the stretching ratio falls within a preset stretching ratio range, aligns the first timestamp in the segmentation timestamp of the current word with the accompaniment rhythm timestamp to be aligned, so as to obtain a corresponding timestamp correspondence; in this way, when performing the speech-music alignment operation, by introducing a stretching ratio restriction, it is avoided that the speech is too long or too short, resulting in a low naturalness of the generated music, and ultimately leading to the defect of serious distortion of the generated music, thereby further improving the musical effect of the generated music.

[0118] In an exemplary embodiment, the speech processing method provided by the present disclosure further includes: when the stretching ratio does not fall within a preset stretching ratio range, aligning a first timestamp in the word segmentation timestamp of the current word segmentation with the timestamp of the accompaniment rhythm to be aligned to obtain a corresponding timestamp correspondence, and aligning a second timestamp in the word segmentation timestamp of the current word segmentation with the timestamp of the target accompaniment rhythm to obtain a corresponding timestamp correspondence; wherein, the second timestamp is the end timestamp of the current word segmentation, and the timestamp of the target accompaniment rhythm is the timestamp of the accompaniment rhythm corresponding to the end of the current word segmentation.

[0119] Among them, the second timestamp in the word segmentation timestamp of the current word segmentation refers to the end timestamp of the current word segmentation, specifically referring to the end of the current word segmentation. The timestamp of the target accompaniment rhythm = the timestamp of the accompaniment rhythm to be aligned + the stretching ratio × (the end timestamp of the current word segmentation - the start timestamp of the final sound of the first character in the current word segmentation).

[0120] Illustrate by way of example, refer to Figure 5 , in the case where the stretching ratio is too large or too small, it is necessary to calculate the timestamp of the rap corresponding to the end of the current word according to the expected stretching ratio: t_i + r × (e_i - v_i). In addition to the corresponding relationship of <v_i, t_i>, another corresponding relationship is obtained, that is, <e_i, t_i + r × (e_i - v_i)>. For example, refer to Figure 5 , in the case where the calculated stretching ratio is less than the lower limit of the stretching ratio, that is, r < r_lo, it means that the voice is too long at this time and needs to fade out. At the same time, two sets of "voice - rap" mapping relationships are obtained: <v_i, t_i> and <e_i, t_i + r × (e_i - v_i)>; i = i + 1, and continue the mapping at the next position. In the case where the calculated stretching ratio is greater than the upper limit of the stretching ratio, that is, r > r_hi, it means that the voice is too short at this time and needs to fill with zeros. At the same time, two sets of "voice - rap" mapping relationships are obtained: <v_i, t_i> and <e_i, t_i + r × (e_i - v_i)>; i = i + 1, and continue the mapping at the next position.

[0121] The technical solution provided by the embodiments of the present disclosure, when the stretching ratio does not fall within the preset stretching ratio range, calculates the timestamp of the rap corresponding to the end of the current word according to the expected stretching ratio, and obtains two sets of timestamp correspondences, so as to overcome the defect that both too long or too short stretching ratios will cause serious distortion of the generated music, thereby improving the naturalness of the generated music, and further improving the music effect of the generated music.

[0122] In an exemplary embodiment, the above step S140 generates music corresponding to the speech to be processed based on the correspondence between the speech to be processed, the musical accompaniment and the target, specifically including: according to the target correspondence, scaling the speech to be processed to the corresponding accompaniment rhythm timestamp in the musical accompaniment to obtain the music corresponding to the speech to be processed.

[0123] Among them, when scaling the speech to be processed to the corresponding accompaniment rhythm timestamp in the music accompaniment, a pitch-invariant time-domain audio scaling technology is used, such as a standard psola algorithm, to ensure that the generated music does not change pitch, thereby ensuring the naturalness of the generated music.

[0124] For example, see Figure 5 According to the "voice-rap" timestamp mapping matrix M obtained in the previous step, in this step, the voice signal is scaled to the corresponding rap timestamp through the time domain audio scaling algorithm; for example, the input is the M matrix obtained in the previous step, the voice signal y and the accompaniment a, and the standard psola algorithm is used to scale the voice signal y and superimpose the accompaniment a to obtain the final rap song.

[0125] The technical solution provided by the embodiments of the present disclosure adopts the pitch-invariant time-domain audio scaling technology, and scales the speech to be processed to the corresponding accompaniment rhythm timestamp in the musical accompaniment based on the target correspondence, so as to ensure that the generated music does not change the pitch, thereby ensuring the naturalness of the generated music, thereby improving the musical effect of the generated music, and avoiding the defect that the linear stretching used in the existing method will cause the speech pitch to change, resulting in lower naturalness of the generated music.

[0126] In order to more clearly illustrate the speech processing method provided by the embodiment of the present disclosure, the speech processing method is specifically described below with a specific embodiment. In one embodiment, the present disclosure also provides a speech processing method that can receive free speech of any content and convert it into a rap song. The following key technical means are adopted: (1) New alignment strategy: After automatic speech recognition, we can obtain word-level timestamps; in order to obtain better semantic effects and sense of rhythm, word segmentation operations are performed on this basis and certain restrictions are placed on the time length of the words; finally, "speech-rap" time alignment is performed based on the word segmentation results. (2) New scaling strategy: On the basis of obtaining the "speech-rap" time alignment, the time domain audio scaling technology without changing the pitch is used to scale the original speech and paste it onto the rap accompaniment, thereby generating a complete rap song. The method specifically includes the following contents:

[0127] Step 1: Text content segmentation based on speech recognition and word segmentation technology. In the first step of the entire technical solution, speech recognition (ASR) technology and word segmentation technology are used to obtain the segmentation of the text content corresponding to the user's input voice. The segmentation is obtained through a word segmentation method with a time limit (the time limit comes from the rhythm detection result of the rap accompaniment). The specific flow chart is as follows Figure 2 This step is before the "speech-rap" alignment, and its purpose is to obtain short phrases of appropriate length to ensure that the generated rap songs have sufficient rhythm and good semantic properties. Figure 2 The input consists of two parts: "user input voice" and "rap accompaniment", both of which are input in the form of audio files; it should be mentioned that this is also the input of the entire technical solution. Figure 2 , we can know that the words obtained by speech recognition are not consistent with the word segmentation results of the word segmentation tool. The latter (word segmentation tool) has better semantic properties, but may be too long or too short. Therefore, it is necessary to optimize the above word segmentation results in combination with the accompaniment rhythm points, such as performing word segmentation with time limits. The overall process is as follows Figure 4 shown.

[0128] Step 2: Speech-rap alignment. In this step, based on the speech segmentation results obtained in the previous step, the corresponding timestamps are aligned to the rhythm points of the rap accompaniment. The overall process is as follows: Figure 5 shown.

[0129] Step 3: Time domain audio scaling. Based on the "speech-rap" timestamp mapping matrix M obtained in the previous step, the speech signal is scaled to the corresponding rap timestamp using the time domain audio scaling algorithm in this step. For example, the input is the M matrix obtained in the previous step, the speech signal y, and the accompaniment a. The standard psola algorithm is used to scale the speech signal y and superimpose the accompaniment a to obtain the final rap song.

[0130] The above-mentioned speech processing method can achieve the following technical effects: (1) By adopting an alignment strategy based on word segmentation and time constraints, the word segmentation results of natural language and the length limit of accompaniment rhythm points are considered in the process of "speech-rap" timestamp alignment, so that word segmentation can achieve better results in terms of both semantics and rhythm. (2) By adopting a time-domain audio scaling algorithm such as the psola algorithm, which does not change the pitch, it can ensure that the generated rap pitch is stable and consistent with the original speaker in terms of listening experience.

[0131] It should be understood that although Figure 1-Figure 5 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-Figure 6 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0132] It can be understood that the same / similar parts between the various embodiments of the above method in this specification can refer to each other, and each embodiment focuses on the differences from other embodiments. For related points, please refer to the description of other method embodiments.

[0133] Figure 6 is a block diagram of a speech processing device according to an exemplary embodiment. Figure 6 The device includes an acquisition unit 610, an update unit 620, an alignment unit 630 and a generation unit 640.

[0134] The acquisition unit 610 is configured to execute acquisition of the initial word segmentation of the speech to be processed and the accompaniment rhythm timestamp of the music accompaniment; the initial word segmentation is the speech recognition word of the speech to be processed;.

[0135] The updating unit 620 is configured to update the initial word segmentation according to the accompaniment rhythm timestamp to obtain the target word segmentation of the speech to be processed.

[0136] The alignment unit 630 is configured to perform time alignment processing on the segmentation timestamp of the target segmentation and the accompaniment rhythm timestamp to obtain a target corresponding relationship between the segmentation timestamp of the target segmentation and the accompaniment rhythm timestamp.

[0137] The generating unit 640 is configured to generate music corresponding to the speech to be processed according to the corresponding relationship between the speech to be processed, the music accompaniment and the target.

[0138] In an exemplary embodiment, the updating unit 620 is further configured to execute, according to the accompaniment rhythm timestamp, obtaining a lower limit and an upper limit of the word segmentation length; according to the lower limit and the upper limit of the word segmentation length, obtaining a first word sequence number set and a second word sequence number set of the current word segmentation in the initial word segmentation; the first word sequence number set is a set consisting of sequence numbers corresponding to the word segmentations that meet the lower limit of the word segmentation length starting from the current word segmentation, and the second word sequence number set is a set consisting of sequence numbers corresponding to the word segmentations that meet the upper limit of the word segmentation length starting from the current word segmentation; when at least one sequence number is included in the intersection of the first word sequence number set and the second word sequence number set, obtaining a target word formed between the word segmentation corresponding to each sequence number in the intersection and the current word segmentation; when the word segmentation result of the speech to be processed contains the target word, updating the current word segmentation to the target word to obtain the target word of the speech to be processed; the word segmentation result is obtained by performing word segmentation processing on the text content of the speech to be processed by the word segmentation tool.

[0139] In an exemplary embodiment, the updating unit 620 is further configured to execute, when the segmentation result of the speech to be processed does not include the target word, updating the current segmentation to a word consisting of all segmentations between the segmentation corresponding to the first target sequence number in the intersection of the first word sequence number set and the second word sequence number set and the current segmentation;

[0140] Among them, when the number of sequence numbers included in the intersection of the first word sequence number set and the second word sequence number set is an odd number, the first target sequence number is the middle sequence number in the intersection of the first word sequence number set and the second word sequence number set; when the number of sequence numbers included in the intersection of the first word sequence number set and the second word sequence number set is an even number, the first target sequence number is any one of the two middle sequence numbers in the intersection of the first word sequence number set and the second word sequence number set.

[0141] In an exemplary embodiment, the updating unit 620 is further configured to determine a second target sequence number from the first sequence number in the first word sequence number set and the last sequence number in the second word sequence number set when the intersection of the first word sequence number set and the second word sequence number set is empty; wherein, in a case where the segmentation result includes a word consisting of all the segmentations between the segmentation corresponding to the first sequence number and the current segmentation, the second target sequence number is the first sequence number; in a case where the segmentation result includes a word consisting of all the segmentations between the segmentation corresponding to the last sequence number and the current segmentation, the second target sequence number is the last sequence number; and the current segmentation is updated to a word consisting of all the segmentations between the segmentation corresponding to the second target sequence number and the current segmentation.

[0142] In an exemplary embodiment, the alignment unit 630 is further configured to calculate the stretching ratio corresponding to the current participle according to the participle timestamp of the current participle in the target participle, the participle timestamp of the next participle of the current participle, the accompaniment rhythm timestamp to be aligned of the accompaniment rhythm timestamp, and the next accompaniment rhythm timestamp of the accompaniment rhythm timestamp to be aligned; when the stretching ratio belongs to the preset stretching ratio range, align the first timestamp in the participle timestamp of the current participle with the accompaniment rhythm timestamp to be aligned to obtain the corresponding timestamp correspondence, and align the participle timestamp of the next participle of the current participle until the end condition is met; the first timestamp is the starting timestamp of the final of the first word in the current participle; and the timestamp correspondence is combined to obtain the target correspondence.

[0143] In an exemplary embodiment, the alignment unit 630 is further configured to align the first timestamp in the segmentation timestamp of the current word with the accompaniment rhythm timestamp to be aligned to obtain a corresponding timestamp correspondence when the stretching ratio does not fall within a preset stretching ratio range, and to align the second timestamp in the segmentation timestamp of the current word with the target accompaniment rhythm timestamp to obtain a corresponding timestamp correspondence; wherein the second timestamp is the end timestamp of the current word, and the target accompaniment rhythm timestamp is the accompaniment rhythm timestamp corresponding to the end of the current word.

[0144] In an exemplary embodiment, the generating unit 640 is further configured to execute scaling of the speech to be processed to a corresponding accompaniment rhythm timestamp in the music accompaniment according to the target correspondence relationship, so as to obtain the music corresponding to the speech to be processed.

[0145] In an exemplary embodiment, the acquisition unit 610 is further configured to perform speech recognition on the speech to be processed to obtain speech recognition words of the speech to be processed as initial word segmentation; and perform rhythm detection on the music accompaniment to obtain the accompaniment rhythm timestamp.

[0146] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0147] Figure 7 1 is a block diagram of an electronic device 700 for executing a voice processing method according to an exemplary embodiment. For example, the electronic device 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0148] Reference Figure 7, the electronic device 700 may include one or more of the following components: a processing component 702 , a memory 704 , a power component 706 , a multimedia component 708 , an audio component 710 , an input / output (I / O) interface 712 , a sensor component 714 , and a communication component 716 .

[0149] The processing component 702 generally controls the overall operation of the electronic device 700, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 702 may include one or more processors 720 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 702 may include one or more modules to facilitate the interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate the interaction between the multimedia component 708 and the processing component 702.

[0150] The memory 704 is configured to store various types of data to support operations on the electronic device 700. Examples of such data include instructions for any application or method operating on the electronic device 700, contact data, phone book data, messages, pictures, videos, etc. The memory 704 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk, an optical disk, or a graphene memory.

[0151] The power supply component 706 provides power to the various components of the electronic device 700. The power supply component 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 700.

[0152] The multimedia component 708 includes a screen that provides an output interface between the electronic device 700 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front camera and / or a rear camera. When the electronic device 700 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0153] The audio component 710 is configured to output and / or input audio signals. For example, the audio component 710 includes a microphone (MIC), and when the electronic device 700 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 704 or sent via the communication component 716. In some embodiments, the audio component 710 also includes a speaker for outputting an audio signal.

[0154] I / O interface 712 provides an interface between processing component 702 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0155] The sensor assembly 714 includes one or more sensors for providing various aspects of status assessment for the electronic device 700. For example, the sensor assembly 714 can detect the open / closed state of the electronic device 700, the relative positioning of the components, such as the display and keypad of the electronic device 700, and the sensor assembly 714 can also detect the position change of the electronic device 700 or the components of the electronic device 700, the presence or absence of contact between the user and the electronic device 700, the orientation or acceleration / deceleration of the device 700, and the temperature change of the electronic device 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 714 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0156] The communication component 716 is configured to facilitate wired or wireless communication between the electronic device 700 and other devices. The electronic device 700 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0157] In an exemplary embodiment, the electronic device 700 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0158] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 704 including instructions, and the above instructions can be executed by the processor 720 of the electronic device 700 to perform the above method. For example, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0159] In an exemplary embodiment, a computer program product is further provided. The computer program product includes instructions. The instructions can be executed by the processor 720 of the electronic device 700 to complete the above method.

[0160] It should be noted that the above-mentioned devices, electronic devices, computer-readable storage media, computer program products, etc. may also include other implementation methods according to the description of the method embodiments. The specific implementation methods can refer to the description of the relevant method embodiments, which will not be described one by one here.

[0161] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

[0162] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A speech processing method, characterized in that: include: Obtain the initial word segmentation of the speech to be processed and the accompaniment rhythm timestamp of the music accompaniment; The initial segmented words are speech recognition words of the speech to be processed; According to the accompaniment rhythm timestamp, a lower limit of a segmentation length and an upper limit of a segmentation length are obtained; According to the lower limit of the segmentation length and the upper limit of the segmentation length, a first word sequence number set and a second word sequence number set of the current segmentation in the initial segmentation are obtained; the first word sequence number set is a set consisting of sequence numbers corresponding to segmentations that meet the lower limit of the segmentation length starting from the current segmentation, and the second word sequence number set is a set consisting of sequence numbers corresponding to segmentations that meet the upper limit of the segmentation length starting from the current segmentation; When the intersection of the first word sequence number set and the second word sequence number set includes at least one sequence number, obtaining a target word formed between a segment corresponding to each sequence number in the intersection and the current segment; When the word segmentation result of the speech to be processed includes the target word, the current word segmentation is updated to the target word to obtain the target word segmentation of the speech to be processed; the word segmentation result is obtained by performing word segmentation processing on the text content of the speech to be processed by a word segmentation tool; Performing time alignment processing on the segmentation timestamp of the target segmentation and the accompaniment rhythm timestamp to obtain a target corresponding relationship between the segmentation timestamp of the target segmentation and the accompaniment rhythm timestamp; The music corresponding to the speech to be processed is generated according to the corresponding relationship among the speech to be processed, the music accompaniment and the target.

2. The method according to claim 1, characterized in that: After obtaining the target word formed between the segmented word corresponding to each sequence number in the intersection and the current segmented word, the method further includes: When the word segmentation result of the speech to be processed does not include the target word, the current word segmentation is updated to a word consisting of all the word segmentations between the current word segmentation and the word segmentation corresponding to the first target number in the intersection of the first word sequence number set and the second word sequence number set; Among them, when the number of sequence numbers included in the intersection of the first word sequence number set and the second word sequence number set is an odd number, the first target sequence number is the middle sequence number in the intersection of the first word sequence number set and the second word sequence number set; when the number of sequence numbers included in the intersection of the first word sequence number set and the second word sequence number set is an even number, the first target sequence number is any one of the two middle sequence numbers in the intersection of the first word sequence number set and the second word sequence number set.

3. The method according to claim 1, characterized in that After obtaining the first word sequence number set and the second word sequence number set of the current word in the initial word segmentation according to the word segmentation length lower limit and the word segmentation length upper limit, the method further includes: In the case where the intersection of the first word sequence number set and the second word sequence number set is empty, a second target sequence number is determined from the first sequence number in the first word sequence number set and the last sequence number in the second word sequence number set; wherein, in the case where the word segmentation result includes a word composed of all the segmentations between the segmentation corresponding to the first sequence number and the current segmentation, the second target sequence number is the first sequence number; and in the case where the word segmentation result includes a word composed of all the segmentations between the segmentation corresponding to the last sequence number and the current segmentation, the second target sequence number is the last sequence number; The current participle is updated to a word consisting of all the participles between the participle corresponding to the second target sequence number and the current participle.

4. The method according to claim 1, characterized in that: The step of performing time alignment processing on the segmentation timestamp of the target segmentation and the accompaniment rhythm timestamp to obtain a target corresponding relationship between the segmentation timestamp of the target segmentation and the accompaniment rhythm timestamp includes: Calculate the stretching ratio corresponding to the current participle according to the participle timestamp of the current participle in the target participle, the participle timestamp of the next participle of the current participle, the accompaniment rhythm timestamp to be aligned of the accompaniment rhythm timestamp, and the accompaniment rhythm timestamp next to the accompaniment rhythm timestamp to be aligned; In the case where the stretching ratio belongs to the preset stretching ratio range, aligning the first timestamp in the word segmentation timestamp of the current word segmentation with the accompaniment rhythm timestamp to be aligned to obtain a corresponding timestamp correspondence, and aligning the word segmentation timestamps of the next word segmentation of the current word segmentation until the end condition is met; the first timestamp is the starting timestamp of the final of the first word in the current word segmentation; The timestamp correspondences are combined to obtain the target correspondences.

5. The method according to claim 4, characterized in that The method further comprises: When the stretching ratio does not fall within the preset stretching ratio range, the first timestamp in the word segmentation timestamp of the current word segmentation is aligned with the accompaniment rhythm timestamp to be aligned to obtain a corresponding timestamp correspondence, and the second timestamp in the word segmentation timestamp of the current word segmentation is aligned with the target accompaniment rhythm timestamp to obtain a corresponding timestamp correspondence; wherein the second timestamp is the end timestamp of the current word segmentation, and the target accompaniment rhythm timestamp is the accompaniment rhythm timestamp corresponding to the end of the current word segmentation.

6. The method according to claim 1, characterized in that The step of generating music corresponding to the speech to be processed according to the speech to be processed, the music accompaniment and the target corresponding relationship includes: According to the target corresponding relationship, the speech to be processed is scaled to the corresponding accompaniment rhythm timestamp in the music accompaniment to obtain the music corresponding to the speech to be processed.

7. The method according to claim 1, characterized in that The method of obtaining the initial word segmentation of the speech to be processed and the accompaniment rhythm timestamp of the music accompaniment includes: Performing speech recognition on the speech to be processed to obtain speech recognition words of the speech to be processed as the initial word segmentation; Performing rhythm detection on the music accompaniment to obtain the accompaniment rhythm timestamp.

8. A speech processing device, characterized in that: include: An acquisition unit is configured to acquire an initial word segmentation of the speech to be processed and an accompaniment rhythm timestamp of the music accompaniment; The initial segmented words are speech recognition words of the speech to be processed; An updating unit is configured to obtain a lower limit and an upper limit of a word segmentation length according to the accompaniment rhythm timestamp; According to the lower limit of the segmentation length and the upper limit of the segmentation length, a first word sequence number set and a second word sequence number set of the current segmentation in the initial segmentation are obtained; the first word sequence number set is a set consisting of sequence numbers corresponding to segmentations that meet the lower limit of the segmentation length starting from the current segmentation, and the second word sequence number set is a set consisting of sequence numbers corresponding to segmentations that meet the upper limit of the segmentation length starting from the current segmentation; in the case where the intersection of the first word sequence number set and the second word sequence number set includes at least one sequence number, a target word formed between the segmentation corresponding to each sequence number in the intersection and the current segmentation is obtained; in the case where the segmentation result of the speech to be processed includes the target word, the current segmentation is updated to the target word to obtain the target segmentation of the speech to be processed; the segmentation result is obtained by performing segmentation processing on the text content of the speech to be processed by a segmentation tool; An alignment unit is configured to perform time alignment processing on the segmentation timestamp of the target segmentation and the accompaniment rhythm timestamp to obtain a target corresponding relationship between the segmentation timestamp of the target segmentation and the accompaniment rhythm timestamp; The generating unit is configured to generate music corresponding to the speech to be processed according to the speech to be processed, the music accompaniment and the target corresponding relationship.

9. The speech processing device according to claim 8, characterized in that: The updating unit is further configured to update the current participle to a word consisting of all participles between the participle corresponding to the first target sequence number in the intersection of the first word sequence number set and the second word sequence number set and the current participle when the segmentation result of the speech to be processed does not include the target word; Among them, when the number of sequence numbers included in the intersection of the first word sequence number set and the second word sequence number set is an odd number, the first target sequence number is the middle sequence number in the intersection of the first word sequence number set and the second word sequence number set; when the number of sequence numbers included in the intersection of the first word sequence number set and the second word sequence number set is an even number, the first target sequence number is any one of the two middle sequence numbers in the intersection of the first word sequence number set and the second word sequence number set.

10. The speech processing device according to claim 8, characterized in that: The updating unit is further configured to determine a second target sequence number from the first sequence number in the first word sequence number set and the last sequence number in the second word sequence number set when the intersection of the first word sequence number set and the second word sequence number set is empty; wherein, when the word segmentation result includes a word consisting of all the segmentations between the segmentation corresponding to the first sequence number and the current segmentation, the second target sequence number is the first sequence number; when the word segmentation result includes a word consisting of all the segmentations between the segmentation corresponding to the last sequence number and the current segmentation, the second target sequence number is the last sequence number; and update the current segmentation to a word consisting of all the segmentations between the segmentation corresponding to the second target sequence number and the current segmentation.

11. The speech processing device according to claim 8, characterized in that: The alignment unit is further configured to calculate the stretching ratio corresponding to the current participle according to the participle timestamp of the current participle in the target participle, the participle timestamp of the next participle of the current participle, the accompaniment rhythm timestamp to be aligned of the accompaniment rhythm timestamp, and the accompaniment rhythm timestamp next to the accompaniment rhythm timestamp to be aligned; if the stretching ratio belongs to the preset stretching ratio range, align the first timestamp in the participle timestamp of the current participle with the accompaniment rhythm timestamp to be aligned to obtain a corresponding timestamp correspondence, and align the participle timestamp of the next participle of the current participle until the end condition is met; The first timestamp is the starting timestamp of the final of the first word in the current word segmentation; the timestamp correspondences are combined to obtain the target correspondence.

12. The speech processing device according to claim 11, characterized in that: The alignment unit is further configured to align the first timestamp in the segmentation timestamp of the current word with the accompaniment rhythm timestamp to be aligned to obtain a corresponding timestamp correspondence when the stretching ratio does not fall within a preset stretching ratio range, and to align the second timestamp in the segmentation timestamp of the current word with the target accompaniment rhythm timestamp to obtain a corresponding timestamp correspondence; wherein the second timestamp is the end timestamp of the current word, and the target accompaniment rhythm timestamp is the accompaniment rhythm timestamp corresponding to the end of the current word.

13. The speech processing device according to claim 8, characterized in that: The generating unit is further configured to execute scaling of the speech to be processed to a corresponding accompaniment rhythm timestamp in the music accompaniment according to the target corresponding relationship, so as to obtain the music corresponding to the speech to be processed.

14. The speech processing device according to claim 8, characterized in that: The acquisition unit is further configured to perform speech recognition on the speech to be processed to obtain speech recognition words of the speech to be processed as the initial word segmentation; and perform rhythm detection on the music accompaniment to obtain the accompaniment rhythm timestamp.

15. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the speech processing method according to any one of claims 1 to 7.

16. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the speech processing method as claimed in any one of claims 1 to 7.

17. A computer program product, comprising instructions, characterized in that: When the instruction is executed by a processor of an electronic device, the electronic device is enabled to execute the speech processing method as described in any one of claims 1 to 7.