A method comprising: receiving , by a device executing a Tacotron system with an end-to-end attention mechanism, a text input that includes a sequence of characters and/or phonemes; the method is characterised by : replacing the end-to-end attention mechanism within the Tacotron system with a duration model that predicts how long a single character and/or phoneme lasts; determining , by the device and using the duration model within the Tacotron system, respective temporal duration of each of the characters and/or phonemes, wherein the duration model is trained using a set of prediction frames of known durations and training characters and/or phonemes; determining , by the device, whether the respective temporal duration of each of the characters and/or phonemes is determined; based on determining that the respective temporal duration of each of the characters and/or phonemes is determined, generating , by the device and using the Tacotron system, a first set of spectra based on the sequence of characters and/or phonemes; based on determining that the respective temporal duration of each of the characters and/or phonemes is determined, generating , by the device and using the Tacotron system, a second set of spectra by replicating respective spectra of the first set of spectra according to the respective temporal durations of the sequence of characters and/or phonemes; generating , by the device and using the Tacotron system, a spectrogram frame based on the second set of spectra; generating , by the device and using the Tacotron system, an audio waveform based on the spectrogram frame; and providing , by the device and using the Tacotron system, the audio waveform as an output. replacing the end-to-end attention mechanism within the Tacotron system with a duration model that predicts how long a single character and/or phoneme lasts; determining , by the device and using the duration model within the Tacotron system, respective temporal duration of each of the characters and/or phonemes, wherein the duration model is trained using a set of prediction frames of known durations and training characters and/or phonemes; determining , by the device, whether the respective temporal duration of each of the characters and/or phonemes is determined; based on determining that the respective temporal duration of each of the characters and/or phonemes is determined, generating , by the device and using the Tacotron system, a first set of spectra based on the sequence of characters and/or phonemes; based on determining that the respective temporal duration of each of the characters and/or phonemes is determined, generating , by the device and using the Tacotron system, a second set of spectra by replicating respective spectra of the first set of spectra according to the respective temporal durations of the sequence of characters and/or phonemes; generating , by the device and using the Tacotron system, a spectrogram frame based on the second set of spectra; generating , by the device and using the Tacotron system, an audio waveform based on the spectrogram frame; and providing , by the device and using the Tacotron system, the audio waveform as an output. <EOS>