B.Text-to-Speech Technology The full name of TTS is Text To Speech, which means “from text to voice”. It mainly solves the problem of how to transform text information into audible sound information. Android has been supporting TTS since the 1.6 version of Android. Pico and iFLYTEK are common TTS products. These TTS products provides a TTS engine, language packs, and TTS interfaces. The TTS interface of these products is compatible with the TTS interface of Android system. The TTS engine and language packages of these products are separated. SL4A uses the TTS function of these products by calling the TTS interface of Android system. The advantage of these TTS products is good interface compatibility and easy expansion of multi-language. However, Android applications can not dynamically adjust speech parameters, such as language selection and speed adjustment.
C.SL4A Event Physical key is a very important device in Android system. It is an important interface for human-computer interaction. Users can accomplish various functions, such as taking pictures and adjusting volume, quickly by using physical key. The Android system defines a key value for each key, and the Android system identifies the key by value of the key. When a user presses a physical key, such as a volume key, SL4A will generate an event named click. Additional data of this event named click provides a more detailed description of the event. Additional data for the event consists of the attributes of key and action. The key attribute value is the value of the key pressed. The value of the volume-up key is integer 24 and the value of the volume-down key is integer 25. The default function of the two keys is to adjust the volume. When an Android application needs to implement custom functions with the two volume keys, the application should override the default behavior of the two volume keys. If the application does not override the default behavior of the two volume keys, Android system will be disrupted. For example, when teachers use the volume-down key of an Android mobile phone to record students’ attendance, the volume of the Android mobile phone may become smaller and smaller, and students may not be able to hear the voice of the Android mobile phone.
A.The Class Attendance System In this paper, the class attendance system reads students’ names by TTS and records attendance by physical buttons, it not only allows students to report back for class in order, but also allows teachers to quickly press or delay pressing a attendance button on hand to record attendance. When a teacher meets an unfamiliar student, the teacher can delay pressing a attendance button on his hand and spend more time observing the student so that he can know the student quickly. When the teacher meets a very familiar student, the teacher can quickly press the attendance button on his hand and record the attendance of the student quickly. The system provides two attendance buttons, and one is to record being present at classroom on time, and the other is to record being not present at classroom on time. If the system does not receive the attendance key signal within the specified time, the system will record student absenteeism. The functions of the system are shown in Fig. 1. It shows that the modules of the system consist of a module of calling the roll by voice and a module of attendance record and a module of attendance warning and a module of attendance analysis and a module of importing class data. The module of importing class data allows a teacher to import class lists and course charts. The module of calling the roll by voice can read students’ name repeatly by voice in the order of a class list. The module of attendance record can record student attendance through a attendance key. During calling the roll by voice, the module of attendance warning can alarm students according to their previous attendance and makes them know their attendance status. The module of attendance analysis reads the attendance statistics of a class with voice after the attendance is over.
B.The Architecture of the System The architecture of the system is shown in Fig. 2. It shows that the system consists of Android phones and a PC Computer. The PC computer is a server. Android phone are clients. Clients communicate with the server over the network. The modules of the system run on the PC computer and a database is also deployed on the computer. The SL4A component and a TTS application are installed and run on Android phones. One function of SL4A is to receive students’ names transferred by the PC computer and transfer the names to the TTS application that will read the names by voice. Another function of SL4A is to receive a attendance key signal in real time and pass the signal to the PC computer that will record attendance of a student.
C.Database Design The system uses excel files as a database, and the database consists of two excel files, a excel file contains only one data sheet. One is a teaching week calendar data sheet and the other is a students’ attendance data sheet. The first row of a data sheet is fields row, and the other rows are data rows. The teaching week calendar data sheet is used to describe start date, end date and teaching week number of each week. Table I shows the structure of the teaching week calendar data sheet . The cell named “A1” is start date, and the cell named “B1” is end date, and the cell named “C1” is teaching week number. The students’ attendance data sheet is used to record weekly attendance for each student. Table II shows the structure of the students’ attendance data sheet. It consists of a student name field and the weekly number fields. The weekly number fields is used to indicate a student’s weekly attendance status. The value of 0 means that a student is at present in classroom, negative numbers indicate levels of truancy.
D.The System Implementation The main code of the system is given in this paper. The system is composed of a framework  named PHPExcel 1.8, the SL4A component, a attendance database, a main program file named StudentVoiceAttendanceSys.php. The database consists of two excel files which are 2017-2018-1.xlsx and AttendanceTable.xlsx. The file named 2017-2018-1.xlsx includes the teaching week calendar data sheet, and the file named AttendanceTable.xlsx includes the students’ attendance data sheet. The main program file is to automate the process to input attendance based on PHP scripting language, and is to read or write the attendance database based on PHPExcel, and is to access mobile TTS and key signal services based on SL4A.