Speech data is made up of unique acoustic units called phonemes. Any audio file can be represented as a sequence of phonemes. Both automatic speech recognition (ASR) and speech synthesis (SS) systems model these phonemes. In ASR, speech signal (wav file) is used as input and phoneme labels are predicted and in SS, phoneme labels can be input and speech signal is output.
You can use a phonetic dictionary for converting your text files into sequence of phonemes. e.g play -> P L EY
If you have phoneme boundary marked data e.g. in audio file file1.wav 0.1s to 0.5s phoneme x and 0.5s to 0.9s is phoneme y. Now you have You can use a NN to learn the mapping between phoneme labels and speech signal (400 data points as output and phoneme label of these 400 points as input).
But there are many things that affect the pronunciation. Some of them are listed below:
Context: 'to' and 'go' have the same phoneme 'o' but have very different pronunciations.
Pitch: Female speakers usually have higher pitch than male speakers.
Speaking rate: Speaking rate varies across speakers. It also depends on speaking mode while reading a text we tend to have less number of pauses as compared to conversations.
length_of_output_phoneme: The length of wav file to generate
So in the end input to your NN will look something like this
[left_context, phoneme, right_context, specking_rate, pitch, length_of_output_phoneme] and output will be corresponding speech signal. You can either use MFCC features or raw wav data as NN output. There are many other factors that affect the pronunciation.
If you don't have time marked data. You can use Hidden Markov model HMM for speech synthesis. A separate model will be learned for each phoneme. Input for HMM will be text files (sequence of phonemes) and output will be specch signal. These learned models can be used for generating speech data later.
Some speech synthesis resources are listed below:
CMU festvox
wavenet
Deep Learning in Speech Synthesis
The biggest challenge will be to make it sound like human voice.