Speech synthesis method, electronic equipment, medium and computer program product
By combining parallel and serial processing modes in the speech synthesis system to process multiple speech synthesis requests, the problem of insufficient concurrent processing capabilities in the existing technology is solved, the concurrency and stability of the speech synthesis system are improved, and the speech synthesis is ensured. Efficient generation.
Patent Information
- Application Number
- CN202410712113.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-09-10
AI Technical Summary
It is difficult for existing speech synthesis systems to process multiple speech synthesis requests in parallel in high-concurrency scenarios, resulting in insufficient concurrent processing capabilities and inability to meet high concurrency requirements. Fully parallel processing mode can easily lead to resource competition and system crashes.
In the process of speech synthesis instance processing, it is divided into three stages: phonetic feature extraction, acoustic synthesis and speech parameter adjustment. Multiple speech synthesis requests are processed using a combination of parallel and serial processing modes to ensure effective use of resources and avoid resource competition and improve system stability.
It significantly improves the concurrent processing capabilities and efficiency of the speech synthesis system, shortens the processing time of multiple speech synthesis requests, ensures the integrity and accuracy of the generated speech, and improves the stability of the system.
Smart Images

Figure CN118629392A
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of speech synthesis technology, and in particular, to a speech synthesis method, electronic device, medium, and computer program product. Background Art
[0002] Text to Speech (TTS) technology, also known as text-to-speech technology, aims to convert text data into audible speech and is widely used in many fields such as human-computer interaction, customer service automation, and navigation guidance. Among them, in scenarios such as high-concurrency outbound calls, the speech synthesis system needs to face the situation of processing a large number of speech synthesis requests at the same time. In such scenarios, a speech synthesis instance in the related technology is often limited to processing a single speech synthesis request and cannot process multiple speech synthesis requests in parallel. If you want to achieve parallel processing of multiple speech synthesis requests, you need to stack the number of instances. This method limits the concurrent processing capability of the speech synthesis system, and it is difficult to meet high concurrency requirements. Summary of the invention
[0003] In view of this, one or more embodiments of this specification provide the following technical solutions:
[0004] According to a first aspect of one or more embodiments of this specification, a speech synthesis method is proposed, including:
[0005] A first speech synthesis request is received, and a first text to be processed carried in the first speech synthesis request is processed in three stages: phonetic feature extraction, acoustic synthesis, and speech parameter adjustment, to obtain a target speech corresponding to the first text to be processed; wherein,
[0006] In the process of performing the phonetic feature extraction phase or the speech parameter adjustment phase on the first to-be-processed text, if there is another speech synthesis request and the other speech synthesis request is in any of the three phases, the other speech synthesis request is processed in parallel with the first speech synthesis request;
[0007] During the process of performing the acoustic synthesis stage processing on the first text to be processed, if there are other speech synthesis requests that also need to be processed at the acoustic synthesis stage, the other speech synthesis requests are processed serially with the first speech synthesis request.
[0008] According to a second aspect of one or more embodiments of this specification, an electronic device is proposed, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor implements the steps of the method described in the first aspect by running the executable instructions.
[0009] According to a third aspect of one or more embodiments of the present specification, a computer-readable storage medium is provided, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in the first aspect are implemented.
[0010] According to a fourth aspect of one or more embodiments of the present specification, a computer program product is provided, comprising a computer program / instruction, which implements the steps of the method described in the first aspect when executed by a processor.
[0011] It can be seen from the above embodiments that in the process of using a speech synthesis instance to process the first speech synthesis request, the present specification is divided into three stages of processing: speech feature extraction, acoustic synthesis and speech parameter adjustment. Among them, when it is necessary to implement the processing of the speech feature extraction stage or the speech parameter adjustment stage on the first speech synthesis request, if there are other speech synthesis requests, then no matter which of the three stages the other speech synthesis requests are in, the one speech synthesis instance can realize parallel processing of the other speech synthesis requests and the first speech synthesis request. When it is necessary to implement the processing of the acoustic synthesis stage on the first speech synthesis request, if there are other speech synthesis requests in the acoustic synthesis stage at the same time, the one speech synthesis instance can perform serial processing on the other speech synthesis requests and the first speech synthesis request. Compared with the processing mode of fully serial processing or fully parallel processing of multiple speech synthesis requests, the scheme of the present specification is equivalent to a compromise processing mode. On the one hand, it realizes that one speech synthesis instance processes multiple speech synthesis requests in parallel, effectively improving the concurrent processing capability and efficiency of the speech synthesis system, significantly improving the concurrency, thereby greatly shortening the processing time of multiple speech synthesis requests. On the other hand, it avoids resource competition or resource shortage between multiple speech synthesis requests in a fully parallel processing mode, which can easily lead to system crashes. This helps to ensure the integrity and accuracy of the generated speech, while improving the stability of the speech synthesis system. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 The present invention is a schematic diagram of serially processing multiple speech synthesis requests provided by an exemplary embodiment.
[0013] Figure 2 It is a schematic diagram of the architecture of a speech synthesis system provided by an exemplary embodiment.
[0014] Figure 3 It is a flowchart of a speech synthesis method provided by an exemplary embodiment.
[0015] Figure 4 It is a schematic diagram of processing multiple speech synthesis requests provided by an exemplary embodiment.
[0016] Figure 5 It is a schematic diagram of the difference between two speech synthesis methods provided by an exemplary embodiment.
[0017] Figure 6 It is a schematic diagram of performing speech synthesis on a single text to be processed provided by an exemplary embodiment.
[0018] Figure 7 It is a structural schematic diagram of a device provided by an exemplary embodiment.
[0019] Figure 8 It is a block diagram of a speech synthesis device provided by an exemplary embodiment. DETAILED DESCRIPTION
[0020] As mentioned above, in scenarios such as high-concurrency outbound calls where a large number of speech synthesis requests need to be processed simultaneously, a speech synthesis instance in related technologies is often limited to processing a single speech synthesis request. Each speech synthesis request usually needs to go through three stages of processing: phonetic feature extraction, acoustic synthesis, and speech parameter adjustment to obtain the corresponding speech. Figure 1 FIG. 1 is a schematic diagram of a serial processing of multiple speech synthesis requests provided by an exemplary embodiment. Figure 1 In the example, there are speech synthesis requests 1-3, box ① represents the processing of the speech synthesis request at the phonetic feature extraction stage, box ② represents the processing of the speech synthesis request at the acoustic synthesis stage, and box ③ represents the processing of the speech synthesis request at the speech parameter adjustment stage. The speech synthesis system first performs the three-stage processing of speech feature extraction, acoustic synthesis and speech parameter adjustment on speech synthesis request 1 in sequence, and outputs the corresponding speech 1. Then, the speech synthesis request 2 is processed in three stages in sequence, and the corresponding speech 2 is output. Finally, the speech synthesis request 3 is processed in three stages in sequence, and the corresponding speech 3 is output. Obviously, this method of serially processing multiple speech synthesis requests limits the concurrent processing capability of the speech synthesis system and reduces the efficiency of speech synthesis. Especially for the request initiator of speech synthesis requests 2 and 3, it takes a long time to get the corresponding speech. In view of this, the present specification provides a speech synthesis method to improve the concurrency of the speech synthesis system.
[0021] Figure 2 FIG. 1 is a schematic diagram of the architecture of a speech synthesis system provided by an exemplary embodiment. Figure 2 As shown, the system may include a server 21, a network 22, and several electronic devices, such as a PC (Personal Computer) 23, a mobile phone 24, and the like.
[0022] The server 21 may be a physical server including an independent host, or the server 21 may be a virtual server carried by a host cluster. During operation, the server 21 may run a server-side program of a certain application to implement the relevant functions of the application. For example, when the server 21 runs a program of a speech synthesis service, it may be implemented as a corresponding speech synthesis service platform.
[0023] PC23 and mobile phone 24 are only some types of electronic devices that users can use. In fact, users can obviously also use electronic devices such as the following types: tablet devices, laptops, PDAs (Personal Digital Assistants), wearable devices (such as smart glasses, smart watches, etc.), etc., and one or more embodiments of this specification do not limit this. During operation, the electronic device can run a program on the client side of a certain application to implement the relevant functions of the application. For example, when the electronic device runs a program for a speech synthesis service, it can be implemented as a client of the speech synthesis service. Among them, the application program of the client of the above-mentioned speech synthesis service can be started and run on the electronic device. The program on the client side can be a native application installed on the electronic device, or the program on the client side can be a small program, a quick application or other similar forms. Of course, when using web page technologies such as HTML5 or similar, the relevant functions can be implemented through the page displayed by the browser. The browser here can be an independent browser application or a browser module embedded in certain applications.
[0024] As for the network 22 for interaction between electronic devices such as PC 23 and mobile phone 24 and server 21, it is possible to select a wired or wireless network to achieve communication based on the communication mode supported by the corresponding electronic device, and this specification does not limit this. For example, PC 23 can support both wired and wireless communication, so it can use a wired or wireless network to achieve communication as needed, while mobile phone 24 usually only supports wireless communication, so it can use a wireless network to achieve communication.
[0025] based on Figure 2 The process of speech synthesis performed by the speech synthesis system shown in the figure can be as follows: an electronic device such as PC 23 or mobile phone 24 can generate a corresponding speech synthesis request according to the text to be processed, and send the speech synthesis request to server 21. Server 21 processes the received speech synthesis request, generates corresponding speech, and returns the speech to the electronic device.
[0026] In another embodiment, the speech synthesis scheme of the present specification can be applied to Figure 2The electronic device shown in the figure is a PC 23, a mobile phone 24, etc. During operation, the electronic device can run a speech synthesis solution to achieve the purpose of speech synthesis. Among them, the application of the speech synthesis system can be pre-installed on the electronic device, so that the speech synthesis system can be started and run on the electronic device; of course, when using technology such as HTML5, it is not necessary to install the corresponding speech synthesis system on the electronic device to obtain and run the speech synthesis system.
[0027] Figure 3 FIG. 1 is a flow chart of a speech synthesis method provided by an exemplary embodiment. Figure 3 As shown, the speech synthesis method may include the following steps:
[0028] S302: Receive a first speech synthesis request, where the first speech synthesis request carries a first text to be processed.
[0029] The first speech synthesis request may be any speech synthesis request, and this specification does not limit the initiation location, time, specific content, and related fields of the first speech synthesis request. The received first speech synthesis request is parsed to obtain a first to-be-processed text. Processing the first speech synthesis request is essentially converting the first to-be-processed text into corresponding speech.
[0030] S304: sequentially perform the three-stage processing of phonetic feature extraction, acoustic synthesis and speech parameter adjustment on the first text to be processed to obtain the target speech corresponding to the first text to be processed; wherein, during the process of performing the phonetic feature extraction stage or the speech parameter adjustment stage on the first text to be processed, if there are other speech synthesis requests and the other speech synthesis requests are in any of the three stages, then the other speech synthesis requests are processed in parallel with the first speech synthesis request; during the process of performing the acoustic synthesis stage on the first text to be processed, if there are other speech synthesis requests that need to be processed by the acoustic synthesis stage at the same time, then the other speech synthesis requests are processed in series with the first speech synthesis request.
[0031] The processing of the phonetic feature extraction stage is used to extract the phonetic features of the first text to be processed. Phonetic features can be understood as attributes or characteristics used to distinguish different voice signals, including but not limited to phonemes, pitch, rhythm, etc. After the processing of the phonetic feature extraction stage, the first phonetic feature corresponding to the first text to be processed can be obtained. Then, the first phonetic feature is processed in the acoustic synthesis stage. In this stage, the first phonetic feature is first converted into a corresponding acoustic feature, and then a corresponding waveform is generated according to the acoustic feature. Then, the waveform is processed in the voice parameter adjustment stage to obtain the target voice corresponding to the first text to be processed. Voice parameters can be understood as various quantitative indicators of voice signals, such as speech speed, intonation, loudness, frequency, etc. Different request initiators may have personalized voice parameter requirements for the synthesized target voice, so that the voice parameter requirements can be added to the first voice synthesis request, so that the processor of the first voice synthesis request obtains the voice parameter requirements for the first text to be processed from the first voice synthesis request, and adjusts the voice parameters of the waveform according to the voice parameter requirements, so that the generated target voice can better meet the personalized needs of the request initiator.
[0032] The above describes the whole process of processing the first speech synthesis request, wherein, in the process of implementing the phonetic feature extraction stage or the speech parameter adjustment stage of the first text to be processed, if there are other speech synthesis requests and the other speech synthesis requests are in any of the three stages, that is, the other speech synthesis requests need to be processed in any of the three stages at the same time, then the other speech synthesis requests can be processed in parallel with the first speech synthesis request. In the process of implementing the acoustic synthesis stage of the first text to be processed, if there are other speech synthesis requests that need to be processed in the acoustic synthesis stage at the same time, then the other speech synthesis requests need to be processed serially with the first speech synthesis request.
[0033] Combination Figure 1 The three speech synthesis requests shown are implemented with the speech synthesis method of this specification. For the processing process, please refer to Figure 4 , Figure 4 The meanings of the boxes ①②③ can be found in Figure 1 .like Figure 4 As shown, in the process of performing the phonetic feature extraction phase on the speech synthesis request 1, the phonetic feature extraction phase can be performed on the speech synthesis requests 2 and 3 in parallel.
[0034] In the process of implementing the acoustic synthesis stage processing for speech synthesis request 1, if speech synthesis requests 2 and 3 have not yet completed the processing of the phonetic feature extraction stage, the phonetic feature extraction can be performed on speech synthesis requests 2-3 in parallel while performing acoustic synthesis on speech synthesis request 1. If speech synthesis requests 2 and 3 have completed the processing of the phonetic feature extraction stage (i.e., the acoustic synthesis stage processing needs to be performed on these two speech synthesis requests), since speech synthesis request 1 is still in the acoustic synthesis stage at this time, speech synthesis requests 1-3 need to be processed serially, i.e., after speech synthesis request 1 completes acoustic synthesis, speech synthesis request 2 needs to be acoustically synthesized. And after speech synthesis request 2 completes acoustic synthesis, speech synthesis request 3 needs to be acoustically synthesized.
[0035] During the process of implementing the speech parameter adjustment phase for speech synthesis request 1, acoustic synthesis and / or speech parameter adjustment may be performed in parallel on speech synthesis request 2. Also, during the process of implementing the speech parameter adjustment phase for speech synthesis request 2, acoustic synthesis and / or speech parameter adjustment may be performed in parallel on speech synthesis request 3.
[0036] Obviously, compared to Figure 1 The fully serial processing mode shown, Figure 4 The processing mode shown in the figure realizes that one speech synthesis instance processes multiple speech synthesis requests in parallel, effectively improving the concurrent processing capability and efficiency of the speech synthesis system, significantly increasing the concurrency, and thus greatly shortening the processing time of multiple speech synthesis requests (see the schematic diagram of shortening the time). Figure 5 ). In addition, compared with the fully parallel processing mode, the solution of this specification can avoid resource competition or resource shortage between multiple speech synthesis requests in the fully parallel processing mode, which can easily lead to system crashes, helping to ensure the integrity and accuracy of the generated speech, while improving the stability of the speech synthesis system.
[0037] In one embodiment, the first speech synthesis request also carries a target timbre identifier for the first text to be processed. The timbre identifier is used to distinguish different timbres, for example, the timbre id can be used as the timbre identifier. Each timbre identifier has a corresponding speech synthesis service, and each speech synthesis service is used to perform speech synthesis using a timbre that matches the timbre identifier. In the process of sequentially implementing the three stages of phonetic feature extraction, acoustic synthesis, and speech parameter adjustment on the first text to be processed, the timbre routing mechanism is first used to route to the target speech synthesis service that matches the target timbre identifier, and then the target speech synthesis service is used to perform speech synthesis on the first text to be processed to obtain a target speech corresponding to the first phonetic feature, and the timbre of the target speech matches the target timbre identifier. In this way, a speech synthesis system can support speech synthesis of multiple timbres, which improves the timbre diversity of the synthesized speech and helps to meet the timbre requirements in various speech synthesis scenarios.
[0038] In one embodiment, before the first text to be processed is subjected to the three-stage processing, the first text to be processed can be segmented, for example, the first text to be processed can be segmented according to punctuation marks or text semantics, so as to obtain a plurality of text segments to be processed. In the process of speech synthesis for each text segment to be processed, it is necessary to sequentially perform the three-stage processing of phonetic feature extraction, acoustic synthesis and speech parameter adjustment, so as to obtain target speech segments corresponding to each of the plurality of text segments to be processed. This method can realize that each time a target speech segment is generated, the target speech segment is immediately returned to the terminal. By returning all the target speech segments in sequence, the target speech corresponding to the first text to be processed is returned.
[0039] Compared with completing the target speech corresponding to the entire first to-be-processed text at one time, this embodiment can realize the simultaneous synthesis of speech and return of speech for playback, significantly reducing the waiting time for users from sending a speech synthesis request to hearing the first target speech segment. In particular, in the case of synthesizing speech corresponding to a long text, users can hear speech feedback without waiting for the entire long text to complete speech synthesis, which effectively improves the real-time nature of the interaction and helps improve the user experience.
[0040] In one embodiment, the processing of the phonetic feature extraction stage and the speech parameter adjustment stage can be implemented by a processor, and the processing of the acoustic synthesis stage can be implemented by a graphics processing unit (GPU, Graphics Processing Unit). In the case where the first to-be-processed text is segmented to obtain multiple to-be-processed text segments, speech synthesis can be performed on multiple to-be-processed text segments in parallel. That is, the processing of three stages is implemented in parallel on multiple to-be-processed text segments, and the processing implemented on any to-be-processed text segment is not limited to the influence of the stage in which other to-be-processed text segments are located. For example, the processing of the phonetic feature extraction stage is implemented on to-be-processed text segments a, b, and c at the same time by the processor. Alternatively, the processing of the acoustic synthesis stage is implemented on to-be-processed text segments a and b by the processor, and the processing of the speech parameter adjustment stage is implemented on to-be-processed text segment c by the GPU at the same time.
[0041] This method of processing multiple text segments to be processed in parallel helps to improve the efficiency of speech synthesis for multiple text segments to be processed, thereby helping to improve the efficiency of speech synthesis for a single text to be processed. It should be noted that after obtaining the target speech segments corresponding to each of the multiple text segments to be processed, it is necessary to return / output the corresponding target speech segments in the order of the multiple text segments to be processed in the first text to be processed, so as to avoid outputting a target speech that does not match the first text to be processed.
[0042] In one embodiment, the processing of the acoustic synthesis stage can be implemented by an acoustic synthesis model deployed on a GPU. In this embodiment, the acoustic synthesis model adopts a non-autoregressive architecture. The non-autoregressive architecture does not need to rely on previously generated elements when generating each element in the sequence, and can generate all elements in the sequence in parallel.
[0043] In the case where the first text to be processed is segmented to obtain multiple text segments to be processed, the scheme of this specification performs acoustic synthesis on any text segment to be processed, which actually acoustically synthesizes the text segment to be processed according to a preset step length, and then combines the speech blocks corresponding to each step length to obtain the target speech segment corresponding to the text segment to be processed. Therefore, by acoustically synthesizing the text segment to be processed through an acoustic synthesis model constructed with a non-autoregressive architecture, it is possible to acoustically synthesize the text content (i.e., multiple text contents) under each step length in parallel to generate a speech block corresponding to each step length in a text segment to be processed, without relying on the speech block corresponding to the previous step length to generate the speech block corresponding to the next step length, thereby effectively improving the speech synthesis efficiency of a single text segment to be processed, and then helping to improve the efficiency of speech synthesis for a single text to be processed, greatly reducing the real-time rate (RTF, Real Time Factor) of speech synthesis.
[0044] In one embodiment, when the first to-be-processed text is segmented to obtain multiple to-be-processed text segments, after obtaining the target speech segments corresponding to the multiple to-be-processed text segments, the corresponding target speech segments can be returned / output to the target object in sequence according to the order of the multiple to-be-processed text segments in the first to-be-processed text. The target object can be understood as the user or device that sends the first speech synthesis request.
[0045] In addition, the target speech segment whose speech segment length is greater than the length threshold can be segmented to obtain multiple target speech blocks, and then the multiple target speech blocks are sequentially returned / output to the target object, so as to realize returning / outputting the target speech segment whose speech segment length is greater than the length threshold to the target object. This method can avoid the situation where the connection load between the processing party (such as a server) of the first speech synthesis request and the target object is increased due to the excessive amount of data of the target speech segment, and helps to ensure that a stable connection is maintained between the two.
[0046] In one embodiment, an audio cache library may also be provided, in which candidate speech segments and candidate text segments corresponding to the candidate speech segments are stored. The candidate speech segments may be speech segments generated based on historical speech synthesis cases, or may be commonly used speech segments set based on experience expectations of past knowledge. The audio cache library may be deployed on a server. In the case where a plurality of text segments to be processed are obtained by segmenting the first text to be processed, in the process of speech synthesis for any text segment to be processed, it may be possible to search in the audio cache library deployed on the server whether there is a target text segment matching any text segment to be processed. If the search result indicates that there is a target text segment matching any text segment to be processed, the candidate speech segment corresponding to the target text segment may be directly determined as the target speech segment corresponding to any text segment to be processed. If the search result indicates that there is no target text segment matching any text segment to be processed, it is necessary to perform three-stage processing of phonetic feature extraction, acoustic synthesis and speech parameter adjustment on any text segment to be processed, so as to obtain a new speech segment corresponding to any text segment to be processed, and the new speech segment is the target speech segment corresponding to any text segment to be processed.
[0047] In addition, the audio cache library can also be deployed in Figure 2 On the terminal devices such as PC23 and mobile phone 24 shown. For example, in a speech synthesis scenario such as human-computer interaction, the user inputs the text to be processed in the terminal device, and the speech synthesis system running on the terminal device can directly search the local audio cache library to see whether there is a target text segment corresponding to the text segment to be processed (obtained by segmenting the text to be processed). If it exists, the candidate speech segment corresponding to the target text segment can be directly determined as the target speech segment corresponding to the text segment to be processed. If it does not exist, it is necessary to implement three stages of processing on the text segment to be processed to obtain the target speech segment corresponding to the text segment to be processed.
[0048] By setting up an audio cache library, it is possible to retrieve the target speech segment from the audio cache library without having to perform speech synthesis on repeated text. The speed of reading and writing the cache is much higher than the speed of generating speech using a speech synthesis model. Therefore, the above method greatly improves the processing speed of speech synthesis requests, reduces processing latency, and saves system resources.
[0049] In one embodiment, the candidate speech segments in the audio cache can be managed in a stack manner, and the stack is used to record the number of hits of each candidate speech segment. The number of hits refers to the number of times the candidate speech segment is determined as the target speech segment. In the case of generating a new speech segment corresponding to any text segment to be processed, if the stack is not full, the new speech segment can be pushed into the stack, and the number of hits of the new speech segment is recorded as 1. If the stack is full, it is necessary to compare the number of hits of the new speech segment (1) with the number of hits of the candidate speech segment with the least hits in the stack. In the case where the number of hits of the new speech segment is less than the number of hits of the candidate speech segment with the least hits in the stack, the new speech segment is not pushed into the stack, that is, the new speech segment does not need to be stored in the audio cache. In the case where the number of hits of the new speech segment is greater than the number of hits of the candidate speech segment with the least hits in the stack, the candidate speech segment with the least hits is popped out of the stack, and the new speech segment is pushed into the stack. When the number of hits of the new speech segment is equal to the number of hits of the candidate speech segment with the least hits in the stack, since the new speech segment is the latest generated speech segment and can better reflect the current needs of the initiator of the speech synthesis request, in this case, it is also necessary to pop the candidate speech segment with the least hits and push the new speech segment into the stack.
[0050] The above-mentioned method of managing candidate speech segments can, on the one hand, prevent the audio cache from occupying too much storage space, and on the other hand, help ensure that candidate speech segments with a large number of hits are stored within a limited storage space, thereby helping to improve the efficiency of subsequent speech synthesis.
[0051] In one embodiment, the hit count of each candidate speech segment recorded in the stack can be periodically reduced by one to obtain a new hit count of each candidate speech segment, and then the candidate speech segment with a new hit count of 0 is popped out of the stack. By dynamically updating the hit count of the candidate speech segment, it can be ensured that the candidate speech segments stored in the audio cache are those with a large hit count, thereby increasing the probability of hitting the candidate speech segment in the subsequent speech synthesis process, which helps to reduce the delay of the speech synthesis process.
[0052] In addition, in order to facilitate the processing of putting in / out of each candidate speech segment recorded in the stack, each candidate speech segment can be arranged according to the number of hits of the candidate speech segment, and the candidate speech segment with a higher number of hits is closer to the bottom of the stack.
[0053] Figure 6 FIG. 1 is a schematic diagram of performing speech synthesis on a single text to be processed provided by an exemplary embodiment. Figure 6 As shown, the process may include the following steps:
[0054] S601: Segment a first text to be processed to obtain a plurality of text segments to be processed.
[0055] The first to-be-processed text may be obtained by parsing the first speech synthesis request. The multiple to-be-processed text segments may be processed in parallel to obtain target speech segments corresponding to the multiple to-be-processed text segments.
[0056] Taking the to-be-processed text segment m as an example, the process of processing each to-be-processed text segment may include:
[0057] S602: Searching the audio cache according to the text segment m to be processed, and determining whether there is a target text segment matching the text segment m to be processed according to the search result.
[0058] If the search result indicates that there is a target text segment that matches the text segment m to be processed, the process jumps to S603.
[0059] If the search result indicates that there is no target text segment matching the to-be-processed text segment m, the process jumps to S604 to perform speech synthesis on the to-be-processed text segment m.
[0060] S603: Determine the candidate audio segment corresponding to the target text segment as the target speech segment corresponding to the text segment m to be processed.
[0061] S604: Determine, according to the timbre routing mechanism, a target speech synthesis service that matches the target timbre identifier for the text to be processed.
[0062] S605: The target speech synthesis service sequentially performs three-stage processing of phonetic feature extraction, acoustic synthesis and speech parameter adjustment on the text segment m to be processed.
[0063] Among them, the phonetic feature extraction stage is used to extract the first phonetic feature corresponding to the text segment m to be processed. The processing of the acoustic synthesis stage can be divided into two parts: using the acoustic model to convert the first phonetic feature into the corresponding acoustic feature, and using the vocoder to convert the acoustic feature into the corresponding waveform. The speech parameter adjustment stage is used to adjust the speech parameters of the waveform and output the target speech segment corresponding to the text segment m to be processed.
[0064] S606: Determine whether the speech segment length of the target speech segment is greater than a length threshold.
[0065] If yes, jump to S607; if no, jump to S608.
[0066] S607: Segment the target speech segment.
[0067] S608: Output the target speech segments or target speech blocks to the target object in sequence.
[0068] When the speech segment length of the target speech segment corresponding to the to-be-processed text segment m is not greater than the length threshold, the target speech segment corresponding to the to-be-processed text segment m can be output to the target object in the order of the to-be-processed text segment m in the first to-be-processed text.
[0069] When the target speech segment corresponding to the text segment m to be processed is segmented to obtain multiple target speech blocks, the multiple target speech blocks are output to the target object in sequence, so as to output the target speech segment corresponding to the text segment m to be processed to the target object.
[0070] Figure 7 is a schematic structural diagram of a device provided by an exemplary embodiment. Figure 7 At the hardware level, the device includes a processor 702, an internal bus 704, a network interface 706, a memory 708, and a non-volatile memory 710, and may also include hardware required for other functions. One or more embodiments of this specification may be implemented based on software, such as the processor 702 reading the corresponding computer program from the non-volatile memory 710 into the memory 708 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0071] Please refer to Figure 8 , the speech synthesis device can be applied to Figure 7 The device shown in the figure can realize the technical solution of this specification. The speech synthesis device can include: a request receiving module 802 and a processing module 804. Among them,
[0072] The request receiving module 802 is configured to receive a first speech synthesis request, wherein the first speech synthesis request carries a first text to be processed.
[0073] The processing module 804 is configured to sequentially perform three stages of processing, namely, phonetic feature extraction, acoustic synthesis and speech parameter adjustment, on the first text to be processed to obtain a target speech corresponding to the first text to be processed; wherein, in the process of performing the phonetic feature extraction stage or the speech parameter adjustment stage on the first text to be processed, if there are other speech synthesis requests and the other speech synthesis requests are in any of the three stages, then the other speech synthesis requests are processed in parallel with the first speech synthesis request; in the process of performing the acoustic synthesis stage on the first text to be processed, if there are other speech synthesis requests that also need to be processed in the acoustic synthesis stage, then the other speech synthesis requests are processed in series with the first speech synthesis request.
[0074] Optionally, the first speech synthesis request also carries a target timbre identifier for the first text to be processed; the processing module 804 is specifically used to: determine a target speech synthesis service that matches the target timbre identifier through a timbre routing mechanism; and perform the three stages of processing on the first text to be processed in sequence through the target speech synthesis service to obtain the target speech, the timbre of which matches the target timbre identifier.
[0075] Optionally, the device further comprises:
[0076] The segmentation module 806 is configured to segment the first text to be processed to obtain a plurality of text segments to be processed corresponding to the first text to be processed.
[0077] The processing module 804 is specifically used for: for each of the multiple text segments to be processed, sequentially performing the three-stage processing on each of the multiple text segments to be processed to obtain the target speech segments corresponding to each of the multiple text segments to be processed.
[0078] Optionally, the processing of the acoustic synthesis stage is implemented by a graphics processor, and the processing of the phonetic feature extraction stage and the speech parameter adjustment stage are implemented by a processor; the processing module 804 is specifically used to: implement the processing of the three stages in parallel on the multiple text segments to be processed.
[0079] Optionally, an acoustic synthesis model constructed using a non-autoregressive architecture is deployed on the graphics processor, and the non-autoregressive architecture is used to perform the acoustic synthesis stage processing on multiple text contents in each text segment to be processed in parallel.
[0080] Optionally, the device further comprises:
[0081] The output module 808 is configured to output the target speech segments corresponding to the multiple text segments to be processed to the target object in sequence; or, to split the target speech segments whose length is greater than a length threshold to obtain multiple target speech blocks, and output the multiple target speech blocks to the target object in sequence.
[0082] Optionally, the device further comprises:
[0083] The retrieval module 810 is configured to search an audio cache library for any of the multiple text segments to be processed, wherein the audio cache library stores candidate speech segments and candidate text segments corresponding to the candidate speech segments; when the retrieval result shows that there is a target text segment matching any of the text segments to be processed, the candidate speech segment corresponding to the target text segment is determined as the target speech segment corresponding to any of the text segments to be processed; when the retrieval result shows that there is no target text segment, the three stages of processing are sequentially performed on any of the text segments to be processed to obtain a new speech segment, and the new speech segment is used as the target speech segment corresponding to any of the text segments to be processed.
[0084] Optionally, the candidate speech segments are managed in the audio cache in a stack manner, and the stack is used to record the number of hits of each candidate speech segment. The device further includes:
[0085] The stack push and pop processing module 812 is configured to push the new speech segment into the stack when the stack is not full, and the hit count of the new speech segment is 1; when the stack is full, if the hit count of the new speech segment is not less than the hit count of the candidate speech segment with the least hit count in the stack, then pop the candidate speech segment with the least hit count, and push the new speech segment into the stack.
[0086] Optionally, the device further comprises:
[0087] The updating module 814 is configured to periodically reduce the hit count of each candidate speech segment recorded in the stack by one to obtain a new hit count of each candidate speech segment; and pop the candidate speech segment whose new hit count is zero out of the stack.
[0088] Based on the same concept as the above method, this specification also provides an electronic device, including: a processor; a memory for storing processor executable instructions; wherein the processor implements the steps of the method described in any of the above embodiments by running the executable instructions.
[0089] Based on the same concept as the above method, this specification also provides a computer-readable storage medium on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in any of the above embodiments are implemented.
[0090] Based on the same concept as the above method, this specification also provides a computer program product, including a computer program / instruction, which implements the steps of the method described in any of the above embodiments when executed by a processor.
Claims
1. A speech synthesis method, include: A first speech synthesis request is received, and a first text to be processed carried in the first speech synthesis request is processed in three stages: phonetic feature extraction, acoustic synthesis, and speech parameter adjustment, to obtain a target speech corresponding to the first text to be processed; wherein, In the process of performing the phonetic feature extraction phase or the speech parameter adjustment phase on the first to-be-processed text, if there is another speech synthesis request and the other speech synthesis request is in any of the three phases, the other speech synthesis request is processed in parallel with the first speech synthesis request; During the process of performing the acoustic synthesis stage processing on the first text to be processed, if there are other speech synthesis requests that also need to be processed at the acoustic synthesis stage, the other speech synthesis requests are processed serially with the first speech synthesis request.
2. The method according to claim 1, wherein the first speech synthesis request further carries a target timbre identifier for the first text to be processed; and the first text to be processed is processed in the three stages in sequence. include: Determine a target speech synthesis service matching the target timbre identifier through a timbre routing mechanism; The target speech synthesis service sequentially performs the three stages of processing on the first text to be processed to obtain the target speech, the timbre of which matches the target timbre identifier.
3. The method according to claim 1, return include: Segmenting the first to-be-processed text to obtain a plurality of to-be-processed text segments corresponding to the first to-be-processed text; The first text to be processed is sequentially subjected to three stages of processing, namely, phonetic feature extraction, acoustic synthesis and speech parameter adjustment, including: for each of the multiple text segments to be processed, the three stages of processing are sequentially subjected to each of the multiple text segments to be processed to obtain target speech segments corresponding to each of the multiple text segments to be processed.
4. The method according to claim 3, wherein the processing of the acoustic synthesis stage is implemented by a graphics processor, and the processing of the phonetic feature extraction stage and the speech parameter adjustment stage are implemented by a processor; the processing of the first to-be-processed text in three stages of phonetic feature extraction, acoustic synthesis and speech parameter adjustment is sequentially performed, include: The three stages of processing are performed in parallel on the multiple text segments to be processed.
5. According to the method of claim 4, an acoustic synthesis model constructed using a non-autoregressive architecture is deployed on the graphics processor, and the non-autoregressive architecture is used to implement the acoustic synthesis stage processing in parallel on multiple text contents in each text segment to be processed.
6. The method according to claim 3, further comprising: include: Outputting the target speech segments corresponding to the plurality of text segments to be processed to the target object in sequence; or, The target speech segment whose speech segment length is greater than the length threshold is segmented to obtain a plurality of target speech blocks, and the plurality of target speech blocks are output to the target object in sequence.
7. The method according to claim 3, further comprising: include: For any of the multiple text segments to be processed, searching in an audio cache, wherein the audio cache stores candidate speech segments and candidate text segments corresponding to the candidate speech segments; If the search result shows that there is a target text segment that matches any of the text segments to be processed, determining the candidate speech segment corresponding to the target text segment as the target speech segment corresponding to any of the text segments to be processed; When the search result indicates that the target text segment does not exist, the three stages of processing are sequentially performed on any of the text segments to be processed to obtain a new speech segment, and the new speech segment is used as the target speech segment corresponding to any of the text segments to be processed.
8. The method according to claim 7, wherein the candidate speech segments are managed in the audio cache in a stacked manner, and the stack is used to record the number of hits of each candidate speech segment. include: When the stack is not full, the new voice segment is pushed into the stack, and the hit count of the new voice segment is 1; When the stack is full, if the hit count of the new speech segment is not less than the hit count of the candidate speech segment with the least hit count in the stack, the candidate speech segment with the least hit count is popped out of the stack, and the new speech segment is pushed into the stack.
9. The method according to claim 8, further comprising: include: Periodically subtracting the hit count of each candidate speech segment recorded in the stack by one to obtain a new hit count of each candidate speech segment; The candidate speech segment with the new hit count of zero is popped out of the stack.
10. An electronic device, include: processor; A memory for storing processor-executable instructions; wherein the processor implements the steps of the method according to any one of claims 1 to 9 by executing the executable instructions.
11. A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 9.
12. A computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 9.
Citation Information
Cited By
Method, system and device for reducing reading delay based on TTS technology
CN121260142A
