{'fraction_non_alphanumeric': 0.023784430455464724, 'fraction_numerical': 0.010111943487053864, 'mean_word_length': 5.132401746724891, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Controllable speech synthesis by learning discrete phoneme-level prosodic representations

In this paper, we present a novel method for phoneme-level prosody control of F0 and duration using intuitive discrete labels. We propose an unsupervised prosodic clustering process which is used to discretize phoneme-level F0 and duration features from a multispeaker speech dataset. These features are fed as an input sequence of prosodic labels to a prosody encoder module which augments an autoregressive attention-based text-to-speech model. We utilize various methods in order to improve prosodic control range and coverage, such as augmentation, F0 normalization, balanced clustering for duration and speaker-independent clustering. The final model enables fine-grained phoneme-level prosody control for all speakers contained in the training set, while maintaining the speaker identity. Instead of relying on reference utterances for inference, we introduce a prior prosody encoder which learns the style of each speaker and enables speech synthesis without the requirement of reference audio. We also fine-tune the multispeaker model to unseen speakers with limited amounts of data, as a realistic application scenario and show that the prosody control capabilities are maintained, verifying that the speaker-independent prosodic clustering is effective. Experimental results show that the model has high output speech quality and that the proposed method allows efficient prosody control within each speaker's range despite the variability that a multispeaker setting introduces.


Introduction
Since state-of-the-art neural text-to-speech (TTS) systems have achieved high speech quality and naturalness in both single speaker [1,2] and multispeaker [3,4] setups, more specialized tasks concerning the prosody of synthesized speech have arisen as major challenges. Some of these include prosody transfer, prosody control and even the production of expressive speech based on human emotions. In this work, we focus on the task of prosody control/manipulation and specifically the representation of two important aspects of prosody, F0 and duration at the phoneme level.

Related Work
The first approaches towards manipulating the prosody of synthesized speech in a neural TTS system consist of global prosody embeddings [5]. These trainable embeddings are extracted from the utterances of the training set and aim at transferring the utterance-level prosody of a reference audio to the synthesized speech. A milestone in this domain is the introduction of Global Style Tokens (GSTs) [6], a codebook learned in an unsupervised manner, which allows control of many different aspects of prosody by using a weighted sum of disentangled style embeddings. It is also shown that Variational Autoencoders (VAEs) can very effectively learn latent prosodic representations in an unsupervised way. These representations can either be learned with a single Gaussian distribution [7] or even with a Gaussian mixture model by modeling it as two hierarchical levels of latent variables [8]. Such a model can also effectively incorporate the capacity of the learned embeddings [9], which measures the amount of information contained in the latent variables, or even be adapted to a semi-supervised setting [10].
Apart from the general style that the utterance-level approaches can offer, a more fine-grained approach can be also achieved in multiple resolutions such as word-level, 2 phoneme-level or even frame-level. In [11] variable-length speech prosody embeddings are learned, allowing frame-level control of pitch and energy. Text-side prosody embeddings are also learned by first aligning the reference spectrogram and the corresponding utterance phonemes with the help of an attention mechanism. By utilizing the latter method, more sophisticated methods are possible such as representing word and phoneme-level aspects of prosody as a hierarchical fine-grained variable model [12]. [13] shows that discretizing phoneme-level latent features and using an autoregressive prior generates more natural samples instead of simply sampling from a standard VAE prior. Extending the idea of GSTs, a pretrained wav2vec 2.0 [14] model can be used to capture local style patterns in a transformer-based architecture [15]. In [16], prosody is controlled by incorporating a word-level GST module in a non-attentive Tacotron model [17], with the addition of an autoregressive prior which allows high quality speech synthesis without requiring a reference audio.
Explicit prosodic features such as phoneme duration, F0 or energy can be efficiently calculated by modules which are based on common signal processing methods. These features can be used as labels in a supervised setting as they contain rich information that can facilitate convergence and provide direct control over the corresponding aspect of prosody. Integrating phoneme durations extracted from a phoneme aligner in a Tacotron architecture enables phoneme-level duration control during inference [18]. Non-attentive Tacotron [17] and FastSpeech [19] introduce non-autoregressive TTS architectures with integrated phoneme-level duration control. Combining explicit duration information in a speaker embedding network can also improve the rhythm of synthesized utterances in a multispeaker setup [20].
Extending to other prosodic features, FastPitch [21] incorporates pitch control by also predicting F0 contours and FastPitchFormant [22] utilizes the predicted F0 in an excitation generator inspired by the source-filter theory in order to provide more robust and accurate pitch control. Since TTS decoders are conditioned on phoneme encoder representations, in FastSpeech 2 [23] and FCL-Taco2 [24] prosody prediction modules are introduced, which add prosodic information to these representations and are trained in a supervised manner utilizing ground truth values. In these cases, prosody information can be represented in various ways. For example, FastSpeech 2 uses the Continuous Wavelet Transformation for F0, whereas [25] uses Mixture Density Networks. [26] utilizes handcrafted prosodic features from open-source packages as well as neural features learned via vector quantization to extend FastSpeech 2 for improved quality and prosody naturalness.
Mellotron [27] combines GSTs and explicit F0 values to guide a Tacotron 2 decoder and achieves variable style synthesis as well as singing. F0 and other real-valued prosodic features can also be aggregated per phoneme and enable fine-grained prosody transfer [28] and control [29], whereas in [30] F0 is represented in a discrete way using a vector quantization module.
The phonetic encoder outputs are linguistic representations of the input text, so they can be used to predict the expected prosody of the synthesized utterance. This can be achieved either by predicting prosodic features directly from the encoder outputs [31,32], or preprocessing the features with a reference encoder and use its output representation [33]. In [34], acoustic and linguistic representations are combined in multiple resolutions such as syllable, word or sentence level in order to predict F0, duration and energy as well as capture latent prosodic variations. Other text-derived features, such as part-of-speech tags or BERT embeddings can also be used to adapt prosody according to linguistic context [35,36].
In multispeaker setups, fine-grained processing of prosodic features is shown to disentangle speaker and style information. Hence, it can be successfully used in tasks such as voice conversion [37] and personalized TTS systems [38,39]. Leakage between speaker and style information must also be avoided in prosody transfer scenarios.
Fine-grained representations extracted with a variational reference encoder combined with speaker embeddings [40], as well as collaborative and adversarial learning [41] are successful in disentangling speaker and style content. Finally, apart from manipulating the aforementioned prosodic features, naturalness of synthesized speech can be improved by focusing on higher-level characteristics such as stress or intonation. This can be achieved by adapting the BERT framework [42] for speech synthesis [43] or utilizing ToBI linguistic prosodic labels [44,45].

Proposed Method
In this paper we present a method for phoneme-level prosody control of F0 and duration. Extensive research has been performed on conditioning TTS models on prosodic features, such as the continuous F0 contour at frame level [27]. Other real valued features such as duration and energy can also be used to condition a Tacotron decoder. The features used are aligned per phoneme and aggregated either by using an attention module [28] or simple forced alignment [29]. Real valued features can impose some limitations due to their one-dimensional nature. In FastSpeech 2 [23], the continuous wavelet transform is applied for representing the F0 as a spectrogram, whereas in [30] discrete F0 representations using vector quantization are shown to improve pitch-related prosody compared to their continuous counterpart.
In our work, we use discrete representations as they provide a form of regularization over the prosodic features and are shown to increase naturalness while maintaining appropriate diversity [13,30]. Instead of training a quantized fine-grained VAE in order to learn latent representations, we simply use extracted features such as F0 and duration, the values of which are determined by standard speech processing tools. The discretization is then performed at the phoneme level using simple clustering methods, such as K-Means clustering, resulting in humanly interpretable labels which are directly applied to the dataset without requiring training [46]. An additional group of encoder and attention modules learn to model the discrete sequences and disentangle their content from the corresponding phoneme-level linguistic features.
The learned labels provide great controllability in synthesized speech, however they are bounded by the speaker's range, since the outermost clusters may contain extreme values which are not frequent in the training data. The proposed method is directly applied to multispeaker TTS and enables phoneme-level prosody control for every speaker included in the training set [47]. We also introduce a prosody predictor module to enable end-to-end TTS without the need of reference audio or manually selected labels. Using ordinal labels with a limited range, e.g. 1 up to 15, in a multispeaker setup is a direct and intuitive way of controlling the prosody, while also provides an advantage over continuous values as it does not require prior knowledge of acceptable real valued intervals for each speaker in the dataset.
Several preprocessing steps are applied in order to obtain effective and meaningful representations. For F0 values, we apply per speaker normalization and K-Means clustering with the purpose of neutralizing speaker and gender variations and obtain speaker-independent labels which explain the same space. A balanced duration clustering strategy is used for the durations of each phoneme separately, assigning an equal number of samples in each cluster in order to address instabilities due to cluster imbalance, a problem which was found in our previous work [46] and we would like to alleviate. Augmentation transformations are also applied to the training data [48], in order to increase the number of samples in the outermost clusters.
The final end-to-end system allows us to control F0 and duration at the phoneme level by creating universal, speaker-independent clusters. The same model is directly used for speaker adaptation [49], extending the TTS and prosody control capabilities to previously unseen speakers after fine-tuning the model with only a few samples.
Introducing a prosody predictor module, which is trained separately and in minimal time after the main model has finished training, we also increase the flexibility of the model by enabling end-to-end TTS without requiring manually selected labels or a reference audio. The prosody predictor output can be used as is for the default rendering of any utterance, or it can be manipulated according to the desired control specification at the phoneme or any higher level.
As an additional note, in this work we consider F0 and duration as the main factors of prosody in order to present the effectiveness of our method. We leave energy and other factors as future work, where their role will be more crucial in the final result, e.g. singing synthesis.
We could summarize the contributions of our work with the following: • Prosodic clustering for fine-grained phoneme-level prosody control • Controllable end-to-end text-to-speech synthesis using intuitive discrete labels • Multispeaker prosody control, with application to unseen speaker adaptation 6

Data preprocessing
The acoustic model uses phonemes as linguistic inputs which are produced by a front-end preprocessing module from the input text. An HMM monophone acoustic model is used as a forced-alignment system [50] to obtain accurate alignments between the utterance and its corresponding phonetic transcription. The duration of each phoneme is extracted from the alignments, excluding word boundaries and pauses although they are included in the phonetic sequence to be modeled by the acoustic model.
A standard autocorrelation method is used [51] for F0 extraction followed by smoothing and interpolation in the unvoiced regions, as well as a transformation to the logarithmic domain. The proposed model uses phoneme-level F0 features, so the previously extracted alignments were utilized to obtain each phoneme's corresponding log-F0 values. Then, in order to account for the variable phoneme duration, these values are averaged. From this point on, we will refer to as F0 features the mean log-F0 values of each phoneme.
Aiming to make our model more robust, voice data augmentation is also applied in order to widen the speaker range and to increase the number of samples in each cluster, as seen in previous multispeaker [52] and singing synthesis [53,48] papers.
The twelve data transformations applied are: pitch shifting by [-6, -4, -2, 2, 4, 6] semitones, and tempo changes by altering speaking rate to [0.70, 0.80, 0.90, 1.10, 1.20, 1.30] of the original one, using the Praat Vocal Toolkit [54]. As mentioned in [48], a small augmentation does not significantly degrade speech quality in singing datasets, so we consider safe to also apply these transformations to our dataset since it contains plain speech which does not have extreme values in terms of pitch or speaking rate. The differences will be evened out more when the quality degradation from the acoustic model and the vocoder are taken into account. In our case, we do not want the augmentation to be excessive, but only adequate to make the clustering process more effective, so we did not overlap the transformations. Hence, we applied the augmentations in our dataset uniformly by splitting the dataset randomly in twelve sets and applying one transformation on each set. The resulting dataset was double in size compared to the original one. We perform clustering on our augmented dataset together with the original one to get cluster centroids that correspond to the widened F0 and duration ranges. The proposed augmentation method extends the prosodic range, while also enhancing model robustness and voice quality.

Prosodic clustering
K-Means clustering with the squared distance criterion is applied for F0. The resulting centroids can be translated as the representative values for F0 and can be used as a vocabulary of discrete tokens. Since we are interested in a multispeaker setting, where different speakers have different pitch ranges, it is not practical to cluster the F0 values of each speaker separately. In order to handle this, we first apply -score normalization to each speaker's extracted F0 values, a common method widely used in similar speech research, such as ASR and multispeaker TTS. We then cluster the normalized values of all speakers together to obtain universal F0 centroids. Thus for each phoneme's corresponding pitch in the dataset we apply: where is the unnormalized F0 and , are the mean and variance of the respective speaker's F0 values. This way, we deal with gender and speaker variation in pitch and create a mapping from each speaker's F0 values to a common prosodic space, where clustering can be performed universally. The normalization method also facilitates adding new speakers, because the new F0 values can be directly mapped to the universal centroids without the need of recomputing them.
For the duration feature, clustering is performed separately per phoneme as phoneme classes, such as vowels and consonants, differ substantially depending on their articulation characteristics. Results from our previous work [46] show that voice quality deterioration when using the outermost clusters is not so severe in F0 control compared to duration control. Thus, we have adopted a balanced clustering method for extracting duration clusters. The average phoneme duration values of all speakers are sorted in ascending order and grouped into the desired number of intervals, so that each interval contains an equal number of samples. We observe that using this grouping strategy slightly decreases the duration control range, as extreme values are averaged out by being pushed towards the bulk of more frequent phoneme durations, but more importantly increases the duration control stability. We note that our dataset contains speakers that have similar speaking rates and each speaker has a consistent speaking rate across the dataset, thus no duration normalization is necessary, as phoneme durations are similar. It must be noted that the training dataset was not specifically designed to have speakers with similar speaking rates. Moreover, the speakers that were selected for speaker adaptation were not selected based on the speaking rate, but rather include two randomly chosen internal speakers that were held out as well as benchmark open domain voices. In other cases though, where the dataset is more diverse with more varying speaking rates, normalization might be necessary.
At training time, for each phoneme in an utterance, its corresponding prosodic feature is assigned to the nearest cluster centroid, resulting in a sequence of prosodic labels. Each label is represented by an embedding vector, so that a sequence similar to the phoneme input sequence is produced, which can condition the decoder. An overview of the method is presented in Figure 1.

Acoustic model architecture
The acoustic model is based on our previous work [55,46] adapted to a multispeaker architecture [47]. It is an autoregressive attention-based text-to-speech model, that For the task of alignment, both in the case of phonemes and prosodic features, the Mixture of Logistics (MoL) attention module is chosen as it is capable of producing a robust phoneme alignment [55]. MoL attention is a purely location-based method and a direct variation of GMM attention [56] using logistic distributions [57]. This module ensures the monotonicity of the alignments and produces stable results [58,55]. The Cumulative Distribution Function (2) of the logistic distribution is used to compute the The parameters of the mixture are calculated in (4).
The parametersˆ,ˆ,ˆare predicted by 2 fully connected layers which are applied to the attention RNN hidden state ℎ as shown in (5).
The context vector is calculated as the weighted sum of the encoder representations The output acoustic frames are predicted by a feed-forward layer and when the decoding is complete, the prediction is finetuned by a 5-layer convolutional post-net identical to [2]. Finally, a feed-forward gate layer predicts the stop token that signals the end of speech generation.
Each speaker is mapped to a 64-dimensional learnable embedding, which is used to condition the decoder. A variational residual encoder [8] is implemented to model any additional information included in the audio samples other than speaker identity, text and prosodic features, like acoustic conditions and noise. An adversarial speaker classifier similar to [4] is also added, to induce disentanglement of the phoneme representations and the speakers' identity.

Prosody predictor
During inference, the proposed model would normally require predefined prosodic labels, either manually selected or extracted from a reference audio. In order to perform arbitrary synthesis without this strict requirement, we train a separate module which learns to predict the F0 and duration labels from the phoneme encoder outputs. Our method is similar to [59], but instead of predicting global style token weights we leverage the discrete nature of the representations used in our model to directly predict the phoneme-level prosodic labels.
The prosody predictor module consists of two recurrent layers followed by a linear layer, mapping the output at each timestep to the corresponding categorical distribution of F0 and duration respectively, as also shown in Figure 3. Since our proposed model is trained in a multispeaker setup, we also pass the speaker embedding as input to the prosody predictor. Experiments also showed that including the global mean and standard deviation values of each F0 and duration sequence as additional input features helped achieve faster convergence and more stable predictions. The training is performed using the cross-entropy criterion after the acoustic model is fully trained and while keeping its parameters frozen, so that the prosody prediction error does not backpropagate to the phoneme encoder.
Despite being discrete, the prosodic labels that we introduce have an ordinal structure, i.e. lower discrete values indicate a lower continuous value when translated back to F0 or duration. In order to train the predictor module more efficiently, we adapt our learning procedure to account for ordinal categories. This is implemented by assigning each label also to its lower-order categories, creating an incremental target vector of 'ones', instead of a one-hot vector for each category [60]. The sigmoid function is also used for computing the probabilities instead of softmax.

Speaker adaptation
The same method as described in the sections above was used to investigate the feasibility of fine-grained prosody control on a previously unseen speaker with a very small number of samples. Extra attention was given so that the selected sentences, that were to be used in the new training, would provide enough phonetic coverage. This means that the utterances would contain each phoneme at least once.
After applying augmentation and -score normalization to the new speaker's data, we fine-tuned our pretrained model by replacing one of the speakers in the training set with the new speaker. We experimented with various recording time lengths in order to test the model's limits and investigate how many minutes of recorded speech is needed to achieve similar quality results with the speakers in the training set. We found that even with as few as 5 minutes of recordings our model was able not only to reproduce that speaker's voice, but also to manipulate phoneme-level F0 and duration in a similar manner to the voices in our training set.

Experiments
In our experiments we aim to evaluate the speech quality and effectiveness of prosody control in a multispeaker model containing all available speakers and in a model adapted to a previously unseen speaker. The evaluation of general prosody is a difficult task, as there are no consistent prosodic similarity or correctness metrics used in the current bibliography for arbitrary text-to-speech generation. Thus, we focus on objective measurements and subjective evaluations of speech quality in order to verify our results. We also assess the capability of the introduced prosody predictor module to generate prior information about the prosodic tokens, so that effective speech synthesis is possible without the need of predefined prosody labels. In this case, we use the corresponding ground truth test utterances in order to measure prosodic correctness with commonly used metrics and directly compare with various cases, such as baseline, random labels and ground truth.

Speaker adaptation
The internal multispeaker dataset together with Cathy is firstly used to train a model, referred to as Cathy-multi, in order to generate samples from the target speaker when the speaker has been included in the initial training with the full set of its data. For the adaptation model, Cathy-adapt, we select 100 recordings from the Cathy dataset containing 7.72 minutes of speech and fine-tune the initial 5-voice multispeaker model.
In order to select a balanced group of recordings, the method introduced in [61] is utilized to maximize the phonetic coverage in a small collection of recordings, by sorting the utterances of a speech corpus in descending order of phonological diversity.
To diversify the results in target speakers and genders, the initial multispeaker model is separately adapted to another 2 female and 2 male unseen voices by applying the speaker adaptation process independently for each one. For this task, we use the LJ Speech dataset [62], an audiobook male voice and two additional internal voices, one female and one male. The corpus selection process to ensure phonetic coverage with 100 sentences for each voice resulted in 10.24, 5.7, 10.83, and 13.17 minutes of speech respectively. By using these limited data we obtain the respective speaker adapted models, namely LJ-adapt, Audiobook-male-adapt, Female-adapt and Male-adapt.
The adaptation speakers pass through the same preprocessing steps for augmentation and prosodic clustering as described above, differentiating in the F0 centroids and duration intervals, which are not recomputed, but rather kept as obtained from the full length multispeaker dataset, in order to find the corresponding target speaker values.
The model is fine-tuned for 5K iterations as a single speaker model, after replacing one of the initial speaker identities with the target speaker to obtain the desired voice characteristics.

Prosody prediction
The prosody predictor module is trained after the multispeaker model has finished training and by freezing its weights. The training utterances passed through the phoneme encoder, together with the corresponding speaker embeddings and ground truth prosodic labels form the training set of the prosody predictor.
For evaluating its performance we first train it on the Cathy-multi model by using all of the training speakers, but for the evaluation we produce samples from the Cathy voice. We also examine the speaker adaptation case, in which the predictor is firstly pretrained on the initial 5-speaker multispeaker model and then is fine-tuned on the Cathy-adapt model using only the 100 adaptation utterances. That way we ensure that the desired speaker remains unseen before the adaptation phase.

Training Details
All audio data was resampled at 24 kHz and the extracted acoustic features consist of 20 Bark-scale cepstral coefficients, the pitch period and pitch correlation, in order to match the modified LPCNet vocoder [63]. The proposed model follows the same architecture as in [46] for the phoneme encoder, prosody encoder, attention mechanism and decoder with the additions described in 2.3. The prosody predictor module consists of two 2-layered bidirectional LSTMs with 128 dimensions in each layer, followed by linear projections. The Adam optimizer is used with weight decay with value = 10 −6 .
The predictor is trained in about 2 hours in the multispeaker case, and only 10 minutes in the adaptation case.
For the objective and subjective tests we selected 100 utterances from the dataset, which were excluded from the training data. Those were used to extract the ground truth prosodic labels.

Objective evaluation
In order to evaluate the control capability of the proposed model, a test set is generated for each speaker by assigning the prosody tokens of each sentence to a single cluster in an ascending order. Specifically, this process is applied at one prosodic category at a time, keeping the other category's tokens at their ground truth values.
In Figure 4 the mean values of F0 and phoneme duration are depicted, calculated over the extracted features of every synthesized test utterance modified according to the specific cluster ID shown in the horizontal axis. The depicted models belong to Figure 4: Sentence level mean F0 and phoneme duration for ascending cluster IDs with 95% confidence intervals. The left y-axis corresponds to the duration graphs while the right y-axis corresponds to the F0 graphs.
the configurations Cathy-multi, Cathy-adapt, Female-adapt and Male-adapt. We can observe that all models follow the ascending order of the cluster IDs both in F0 and duration variations, proving that controllability is retained in the multispeaker setup.
Cathy-multi and Cathy-adapt perform alike and obtain similar values for the same cluster IDs, proving that prosody control in the same range is possible even with a few data, compared to a large speaker dataset. The rest of the adaptation models present a same ascending behavior, with the male voices assuming lower F0 values from the female ones, despite being trained with a common set of prosodic labels, indicating that our method is indeed speaker and gender independent.
Since we have shown the effectiveness of our method when varying the F0 and duration for the whole utterance, but no established protocol exists for word or phonemelevel evaluation, we encourage readers to listen to the audio samples on our web site 1 .
Also, in Figure 5 a representative sample of the fine-grained control capability of our in the respective utterance segments.

Subjective evaluation
We performed listening tests in order to assess the quality of the proposed method, with respect to naturalness and speaker similarity. Regarding naturalness, a set of 100 test sentences that were modified in terms of F0 and duration were used to synthesize voice samples from Cathy-multi, Cathy-adapt and Male-adapt models. Listeners were F0 and duration modification was done by adding or subtracting an offset from the ground truth prosodic labels of each test sentence, with the offsets varying in range [−11, 11]. Regarding F0, adding or subtracting an offset from the ground truth value leads to synthesized voice with higher or lower pitch, whilst regarding duration, these offsets lead to slower or faster uttered phones, respectively. This method, which verifies the controllability of the model, is now used to evaluate naturalness.
In order to facilitate the Mean Opinion Score (MOS) results' visualization, each prosodic feature was modified independently, while the labels of the other feature retained their ground truth values. In total, 2400 test utterances were rated for naturalness, with each one receiving 20 scores by native speakers via the Amazon Mechanical Turk.
The MOS is depicted as a function of the modification offset in Figure 6 for the Cathy-multi and the Cathy-adapt models, and in Figure 7 for the Male-adapt model.
Based on the plots, it can be said that the voice samples with modified prosodic tokens retain reasonable naturalness levels in general, with the exception of very low duration offsets. These offsets correspond to extremely fast speech which is generally considered unnatural. Moreover, MOS scores of the voice samples produced by Cathy-adapt are directly comparable in naturalness with the scores of Cathy-multi, over the full modifi- Figure 7: Mean opinion scores for Male-adapt with 95% confidence intervals cation range, as it can be seen in Figure 6. Hence, it is shown that, despite being trained with very limited data, the speaker-adapted models are capable of prosodic modification that also preserves high voice naturalness, in levels similar to the multispeaker model, which was trained with the full dataset.

Prosody predictor evaluation
For evaluating the prosody predictor module we conducted listening tests on the selected 100 test utterances. Listeners were asked to score the naturalness of 5 models.
We included the multispeaker prosody control model with the ground truth labels as the upper performance bound and the same model with random labels both for F0 and duration as the lower bound. Also, a plain non-attentive model based on [17] is included as a baseline, as it does not contain any prosodic information, but is considered one of the state-of-the-art systems for end-to-end TTS. We also conducted an objective evaluation with commonly used metrics such as Mel-Cepstral Distortion (MCD) [64], 0 Frame Error (FFE), Voicing Decision Error (VDE) and Gross Pitch Error (GPE) [65]. These were calculated after the mel-spectrograms of the synthesized and ground truth sequences were aligned with dynamic time warping for each case separately.
Considering the results of Table 2, when using the ground truth labels the quality is the highest possible and very close to the ground truth, indicating that our proposed Ground Truth 4.500 ± 0.109 and duration and that it is sufficiently trained.

Conclusions
In this paper, we presented an end-to-end controllable speech synthesis system that utilizes discrete phoneme-level prosodic representations based on F0 and duration clustering. An additional encoder for the discrete prosodic representations along with a corresponding attention module were included in order to create alignments between the prosody encodings and the decoder hidden state. We apply augmentation, feature normalization and a universal clustering method for all speakers' recordings so that we can produce universal F0 and duration representations for training. The same principles are applied to new, previously unseen speakers with very few recordings, in order to test if this method can be used to create synthetic speech similar to the target voice with the same quality and level of control.
Our experiments verify that the multispeaker and speaker adapted models retain the control capability over F0 and duration and generate high quality speech, independently of gender or different voice characteristics. Moreover, the speaker adapted models' scores indicate reasonable similarity to the original speakers' audio, given the short duration and variable quality of the recordings across speakers.
A prosody prediction module is also incorporated that predicts the discrete F0 and 22 duration labels from the phoneme encoder outputs, enabling the model to produce synthetic speech which is close to the natural voice of each speaker even if specific labels are not given. This module is shown to also be effective in the speaker adaptation scenario where it is fine-tuned for very few iterations on an unseen speaker, but produces meaningful prosodic labels.