# Mathematical Background and Algorithms of a Collection of Android Apps for a Google Play Store Page
## 3 Problem Solving
### Vocal SMS Writing and Reading App for Visually Impaired People
DeleteVoiceMessage(message)  
The designated voice message is removed using this function. TranscribeVoiceMessage(message)  
This function converts the audio message that must be sent to text. \[\text{SendTextSMS}(\text{recipient},\text{text})\]  
The text message is sent while using this function. The TTS (text-to-speech) function can be represented as TTS (text), where text is the text input that must be spoken. \[\text{TTS}(\text{text})=\text{audio}\]  
This function converts text input into audio, which is indicated by audio. Likewise, STT (audio) represents the STT (speech-to-text) function, where audio is the speech input that needs to be translated into text. \[\text{STT}(\text{audio})=\text{text}\]  
\"Text\" is the result of this function's conversion of the audio input to text. Integrating SMS messaging with these features is the function shown below. \[\text{SendSMS\_STT}(\text{recipient},\text{text})=\text{SendSMS\_STT}(\text{ recipient},\text{STT}(\text{audio}))\]  
Using STT, this function converts audio to text and sends an SMS to the designated receiver. Text to speech translates written words into spoken language using various methods. One essential model for this purpose is the Tacotron 2 architecture, which encompasses both sequence-to-sequence models and vocoders. The Tacotron 2 architecture includes the following steps:  
1. **Encoder**: As demonstrated in Equation (1), the encoder converts the character sequence \(\mathbf{c}\) into a series of hidden states \(\mathbf{h}\). \[\mathbf{h}=\text{Encoder}(\mathbf{c}) \tag{1}\]  
2. **Attention Mechanism**: The attention mechanism matches the hidden states \(\mathbf{h}\) with the decoder states, as illustrated in Equation (2). \[\mathbf{a}_{i}=\text{Attention}(\mathbf{h},\mathbf{s}_{i-1}) \tag{2}\]  
3. **Decoder**: The decoder produces Mel spectrogram frames using the attended hidden states as described in Equation (3)  
\[\mathbf{m}_{i}=\text{Decoder}(\mathbf{a}_{i},\mathbf{s}_{i-1}) \tag{3}\]  
**Vocoder (e.g., WaveNet)**: The vocoder transforms the Mel spectrogram frames into the time-domain waveform as depicted in Equation (4). \[\mathbf{y}=\text{Vocoder}(\mathbf{m}) \tag{4}\]  
Converting spoken words into written text is the essence of speech to text. A typical method employs a Recurrent Neural Network (RNN) paired with a Connectionist Temporal Classification (CTC) loss function. The following steps are involved in the RNN-CTC model:  
1. **Feature Extraction**: Derive the acoustic features \(\mathbf{x}\) from the audio signal \(\mathbf{y}\) as depicted in Equation (5). Figure 1:0  
2. **Recurrent Neural Network**: Implement an RNN to capture the temporal dependencies present in the features as demonstrated in Equation (6). Figure 1:1  
3. **CTC Loss**: Determine the likelihood of the output sequence \(\mathbf{z}\) using the CTC method as illustrated in Equation (7). Figure 1:2  
A model such as Deep Speech streamlines the process by employing a single deep learning model trained from start to finish. The Deep Speech model includes the following procedures. 1. **Feature Extraction**: Derive characteristics from the audio signal as described by Equation (5). 2. **Deep RNN**: Implement multiple layers of RNNs, including GRUs or LSTMs, as described in Equation (8). Figure 1:3  
3. **Softmax Layer**: Estimate the probability distribution of the characters at each time step as depicted in Equation (9). Figure 1:4  
4. **CTC Loss**: Employ CTC for alignment and training as described in Equation (7). SMS messages can be encoded with various character sets, including GSM 7-bit, UCS-2 (16-bit), and UTF-8. For GSM 7-bit encoding, the count of septets (7-bit characters) is crucial. The equation for the number of septets, \(N_{s}\), derived from a string \(M\) consisting of \(L\) characters, is presented in Equation (10). Figure 1:5  
For SMS messages that contain multiple parts, it is necessary to determine the maximum character count per segment and the total number of segments.