Sie sind auf Seite 1von 85

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

A PROJECT REPORT ON

VOICE BASED SECURITY SYSTEM


Submitted in partial fulfillment of the requirements
for the award of the degree of

Bachelor of Engineering
In
Computer Science & Engineering
By

GIRISH - 1BG07CS023
NIKHIL R - 1BG07CS054

Under the guidance of

Mr. NAVEEN B.M.


Lecturer, Dept. of CSE, BNMIT

Department of Computer Science & Engineering


12th Main, 27th Cross, Banashankari II Stage, Bangalore 560070
May, 2011
VISVESVARAYA TECHNOLOGICAL UNIVERSITY

A PROJECT REPORT ON

VOICE BASED SECURITY SYSTEM


Submitted in partial fulfillment of the requirements
for the award of the degree of

Bachelor of Engineering
In
Computer Science & Engineering
By

GIRISH - 1BG07CS023
NIKHIL R - 1BG07CS054

Under the guidance of

Mr. NAVEEN B.M.


Lecturer, Dept. of CSE, BNMIT

Department of Computer Science & Engineering


12th Main, 27th Cross, Banashankari II Stage, Bangalore 560070
May, 2011
12th Main, 27th Cross, Banashankari II Stage, Bangalore - 560070
Department of Computer Science & Engineering

Certificate
Certified that the project work entitled Voice based security system (VBSS) is a
bonafide work carried out by

1. GIRISH 1BG07CS023

2. NIKHIL.R 1BG07CS054

in partial fulfillment for the award of Bachelor of Engineering in Computer Science


& Engineering degree of the Visvesvaraya Technological University, Belgaum during the
year 2010-11. It is certified that all corrections / suggestions indicated for the internal
assessment have been incorporated in the report deposited in the departmental library. The
report has been approved as it satisfies the academic requirements in respect of project work
prescribed for the said degree.

Mr. NAVEEN B.M Dr. B. G. Prasad Dr. K. UdayKumar

Project Guide HOD, Dept of CSE Principal, BNMIT

Name of the examiners Signature with date


1.

2.
ACKNOWLEDGEMENT
Acknowledging the efforts of everyone involved in the project is a difficult job, albeit a very
interesting one. Words cannot completely convey our heart feeling.

We consider it a privilege to whole-heartedly express our gratitude and respect to


each and every one who guided and helped us in the successful completion of this project.

We would greatly mention the enthusiastic influence provided by


Mr. Naveen B.M. Our Project Guide, for his ideas and co-operation showed on us during my
venture and making this project a great success.

We also thankful to Dr. B. G. Prasad Professor & HOD, Department of Computer


Science, for his co-operation and encouragement at all moments of my approach.

We also sincerely thank our beloved Dr. Ranga Dean, for his co-operation and
encouragement at all moments of my approach.

We very thankful to the Director, Prof T.J.Ramamurthy and


Dr. K. UdayKumar Principal, BNMIT, Bangalore, for being kind enough to provide me an
opportunity to work on a project in this institution.

We would also like to thank our parents and well-wishers as well as our dear
classmates for their guidance and their kind co-operation.

Finally, it is a pleasure and happiness to the friendly co-operation showed by all


the staff members of computer science department, BNMIT.

NIKHIL .R GIRISH
ABSTRACT
Today password is going to be the major security factor which is porn to hackers. The
password is not sufficient enough today to secure critical data. The security system based on
the voice will analyze the pitch and word and compares it with the data inside the system and
recognizes the user and shows his own data. Personal information like the banking passwords,
Bank amount details, Intelligence Data, Criminal data, Case Files of the Lawyers, Critical
Defense information… etc., can be stored based on the Voice data.

In this project we present two voice-to-phoneme conversion algorithms that extract


voice-tag abstractions for speaker independent voice-tag applications in embedded platforms,
which are very sensitive to memory and CPU consumptions. In the first approach, a voice-to-
phoneme conversion in batch mode manages this task by preserving the commonality of input
feature vectors of multiple voice-tag example utterances. Given multiple example utterances, a
developed feature combination strategy produces an “average” utterance, which is converted
to phonetic strings as a voice-tag representation via a speaker-independent phonetic decoder.
In the second approach, a sequential voice-to-phoneme conversion algorithm uncovers the
hierarchy of phonetic consensus embedded among multiple phonetic hypotheses generated by
a speaker-independent phonetic decoder from multiple example utterances of a voice-tag. The
most relevant phonetic hypotheses are then chosen to represent the voice-tag.

The voice-tag representations obtained by these two voice-to-phoneme conversion


algorithms are compared in speech recognition experiments to phonetic transcriptions of
voice-tag reference prepared by an expert phonetician. Both algorithms either perform
comparably to or significantly better than the manual transcription approach. We conclude
from this that both algorithms are very effective for the targeted purposes.

Department of CSE, BNMIT 2010-2011 Page


Illustration

VBSS DATA BASE


USER
GRANT/DENY
ACCESS

Block Diagram

VOICE BASED SECURITY SYSTEM (VBSS)

User Voice Data Base


Interface Processor

Department of CSE, BNMIT 2010-2011 Page


CONTENTS
Page#

Acknowledgement I

Abstract II

List of Figures VI

1. Introduction 1

1.1 VBSS Modules 2


1.2 Existing System 3
1.3 Proposed System 3
1.4 Overview of the project 4
2. Literature Survey 5

2.1 Overview of java 7


2.2 Object oriented 10
2.3 JDBC Connectivity 13
2.4 Java Development Tool Kit 16
2.5 Oracle 17
2.6 MySql 21
2.7 Netbeans 22
2.8 Threads 23
2.9 Exception Handling 24
2.10 Normalizations 25
3. System Analysis and Specification

3.1 Introduction 27

3.2 Functional Requirements 29

3.3 Non Functional Requirements 29

3.4 Hardware and Software Requirements 30

3.5 System Models 31

Department of CSE, BNMIT 2010-2011 Page


4. System design

4.1 Introduction 38

4.2 VBSS Software Architecture 38

4.3 Subsystem Decomposition 39

5. Implementation

5.1 User Interface 43

5.2 Voice Processing 44

5.3 Capturing Real Time Data 45

5.4 Classes in VBSS Project 46

5.5 Algorithm used in VBSS 59

6. System Testing

6.1 Introduction 62

6.2 3 Levels of Software Testing 65

6.3 Testing and Results 67

7. User Manual

7.1 Supporting Software 69

7.2 Usage Instructions 69

7.3 Using Oracle 10g XE 70

7.4 MySql 73

8. Screen Shots 75

9. Limitations & Future Enhancements 83

10. Conclusions 85

11. Bibliography 87

Department of CSE, BNMIT 2010-2011 Page


LIST OF FIGURES

Figure# Page#

Fig 2.1 Picture showing the development process of JAVA Program 9

Fig 2.2 Picture showing the code for JDBC connection. 13

Fig 2.3 Picture showing two tier and Three tier models 15

Fig 2.4 Picture showing loading screen of Netbeans. 22

Fig 2.5 Picture showing the steps involved in catching an exception. 24

Fig 3.1 Picture showing Admin use case 32

Fig 3.2 Picture showing user usecase. 33

Fig 3.3 Class diagram will show association between the classes. 33

Fig 3.4 Sequential diagram for the user 34

Fig 3.5 Sequential diagram for the admin 34

Fig 3.6 UML Diagram of VBSS 35

Fig 3.7 UML diagram showing the working of VBSS 35

Fig 4.1 Control Flow diagram of VBSS 38

Fig 4.2 User interface diagram of Admin 40

Fig 4.3 User interface diagram of user 41

Fig 5.1 Control flow diagram of Java media framework 44

Fig 5.2 Picture showing the code for phoneme conversion stage of the algorithm 59

Fig 5.3 Picture showing the code for setting different security levels 60

Fig 7.1 Picture showing the different stages for running Oracle 10g XE 72

Fig 7.2 Picture showing the different stages for running MySql 73

Department of CSE, BNMIT 2010-2011 Page


CHAPTER 1

INTRODUCTION
Chapter 1 Introduction

INTRODUCTION

A voice-tag (or name-tag) application, which converts human speech into an


abstract representation and then uses this representation to recognize (or classify) subsequent
speech, is the first widely used speech recognition application deployed in embedded platforms,
such as mobile devices. Traditionally, Voice technology is directly used as the abstract speech
representations in voice-tag applications. This approach has enjoyed considerable success as it
is language independent and achieves low speech recognition accuracy while maintaining the
low CPU requirement for the HMM-based voice-tag. As long as the targeted number of voice-
tags is restricted to two or three dozen in an application, the memory consumption of this
strategy is acceptable. Another attribute of the HMM based voice-tag is its speaker-
dependence. A typical enrollment session in a speaker-dependent context is very convenient for
the user in that it requires only a few example utterances to train a voice-tag HMM that
captures both the speech abstraction and the speaker characteristics. Today, speaker-
independent and phoneme HMM-based speech recognizers are being deployed in mobile
devices. A name dialing application can recognize thousands of names downloaded from a
phonebook via grapheme-to phoneme conversion, and voice-tag technology is a very
convenient way of dynamically extending the voice enabled phonebook. Thus, in name dialing
speech recognition applications, voice-tag entries and name entries with phonetic transcriptions
are jointly used in a speaker-independent manner. In this scenario, limiting voice-tags to two or
three dozen may no longer be viable; but extending the number significantly in a traditional
HMM-based voice-tag application could easily surpass the maximum memory consumption
threshold for embedded platforms. Indeed, the speaker-dependency of the traditional approach
may actually prevent the combined use of the voice-tag HMM technology and phonetically
transcribed name entries. Assuming that a set of speaker-independent HMMs already resides in
an embedded platform, it is natural to think of utilizing a phonetic representation (phoneme
strings or lattices) created from example utterances as the abstract representation of a voice-tag,
i.e. voice-to-phoneme conversion. The phonetic representation of a voice-tag can be stored as
cheaply as storing a name entry with a phonetic transcription, and it can be readily used in
conjunction with the name entries obtained via grapheme to- phoneme conversion, as long as
such a voice-tag is speaker-

1|Page
Department of CSE, BNMIT 2010-2011
Chapter 1 Introduction

Independent.Voice-to-phoneme conversion, then, enhances speech recognition capability in


embedded platforms by greatly extending recognition coverage. As will be shown below, it
also improves speech recognition performance in general over the traditional manual
transcription approach Voice-to-phoneme conversion has been investigated in modeling
pronunciation variations for speech recognition, spoken document retrieval and word spotting
with noteworthy success. However, the optimal conversion in the sense of maximum likelihood
presented in these prior works requires prohibitively high computation, which prevents their
direct deployment to an embedded platform.

VBSS – VOICE BASED SECURITY SYSTEM


VBSS is security software that uses voice as password, as VBSS uses 5 modules to make the best
security software. They are :-

 ADMIN MODULE – This module is used for administrator to add, modify remove and

view user’s log.

 ADMIN1MODULE – This module is used to login to admin window and change

admin password.

 LOGIN - This module is used for users to login via voice.

 UTILITY - This module is to generate voice tags and compare voice tags.

 USERDAO - This module is used to interact with the Database.

 USERLOCKER1 -This module is dedicated to all users who login successfully and

can store their files in Personal Locker Folder.

 LOGFILE - This module is used for administrator to view users logs.

2|Page
Department of CSE, BNMIT 2010-2011
Chapter 1 Introduction

1.2 Overview of the project


Voice based security system which authenticates the users based on voice instead
of password which can be easily hacked. It is given with a user interface where user gets to
choose from a list of operations and modules which converts human speech into abstract
representation and retrieves the same when the user wants to login for the next time. And it
checks the deviation of the present voice with the stored voice, if it is well within the limits
access is granted otherwise will be denied. All these activities is done without the notice of the
user at the background without any user intervention.
It is developed using Java Development Tool Kit on the windows platform using
oracle/MySQL and NetBeans IDE using java as the language for coding. Java comes with
various API’s , using these API’s voice is processed. The system is speaker independent that
means that more than one user can use the system at a time.
The construction of the voice based security system involves in the development of two major
activities:
User interface
Voice processing
User Interface
User interface is basically an interface between end user and the engine. The UI is a client. It
deals with the outlook of the application. We construct an interface where we can perform
actions like:
 Adding a new user
 Modifying the existing the user
 Removing the user
 Authenticate the user
Voice processing
 It is responsible for
 Recording the voice
 Converting the voice into an abstract representation
 Retrieving the representation during logging
 Checking the deviation

3|Page
Department of CSE, BNMIT 2010-2011
CHAPTER 2

LITERATURE SURVEY
Chapter 2 Literature Survey

LITERATURE SURVEY
For the successful completion of the project, requisite amount of knowledge about the
domain and tools to be used is very essential. A brief overview of the literature survey for the
project is given below:

Overview of java.

Object oriented.

JDBC Connectivity.

Java Development Tool Kit.

Oracle.

MySql.

Netbeans.

Threads.

Exception handling.

Normalization.

Java is a programming language originally developed by James Gosling at


Sun Microsystems (which is now a subsidiary of Oracle Corporation) and released in 1995 as
a core component of Sun Microsystems' Java platform. The language derives much of its
syntax from C and C++ but has a simpler object model and fewer low-level facilities. Java
applications are typically compiled to bytecode (class file) that can run on any Java Virtual
Machine (JVM) regardless of computer architecture. Java is a general-purpose, concurrent,
class-based, object-oriented language that is specifically designed to have as few
implementation dependencies as possible. It is intended to let application developers "write
once, run anywhere". Java is currently one of the most popular programming languages in
use, and is widely used from application software to web applications.

4|Page
Department of CSE, BNMIT 2010-2011
Chapter 2 Literature Survey

2.1 Overview of java


Initially the language was called as “oak” but it was renamed as “Java” in 1995. The
primary motivation of this language was the need for a platform-independent (i.e.,
architecture neutral) language that could be used to create software to be embedded in various
consumer electronic devices.

Java is a programmer’s language.

Java is cohesive and consistent.

Except for those constraints imposed by the Internet environment, Java gives the
programmer, full control.

Finally, Java is to Internet programming where C was to system programming.

Portability

For programs to be dynamically downloaded to all the various types of platforms


connected to the Internet, some means of generating portable executable code is needed .As
you will see, the same mechanism that helps ensure security also helps create portability.
Indeed, Java’s solution to these two problems is both elegant and efficient.

The Byte code

The key that allows the Java to solve the security and portability problems is that the
output of Java compiler is Byte code. Byte code is a highly optimized set of instructions
designed to be executed by the Java run-time system, which is called the Java Virtual
Machine (JVM). That is, in its standard form, the JVM is an interpreter for byte code.

Although Java was designed for interpretation, there is technically nothing about Java
that prevents on-the-fly compilation of byte code into native code. Sun has just completed its
Just In Time (JIT) compiler for byte code. When the JIT compiler is a part of JVM, it
compiles byte code into executable code in real time, on a piece-by-piece, demand basis. It is
not possible to compile an entire Java program into executable code all at once, because Java
performs various run-time checks that can be done only at run time. The JIT compiles code,
as it is needed, during execution.

5|Page
Department of CSE, BNMIT 2010-2011
Chapter 2 Literature Survey

Java Virtual Machine (JVM)

Beyond the language, there is the Java virtual machine. The Java virtual machine is an
important element of the Java technology. The virtual machine can be embedded within a web
browser or an operating system. Once a piece of Java code is loaded onto a machine, it is
verified. As part of the loading process, a class loader is invoked and does byte code
verification makes sure that the code that’s has been generated by the compiler will not
corrupt the machine that it’s loaded on. Byte code verification takes place at the end of the
compilation process to make sure that is all accurate and correct. So byte code verification is
integral to the compiling and executing of Java code.

Overall Description

JAVA SOURCE CODE JAVA BYTE CODE JAVA VM

JAVA IDE CLASSES BINARY

CODE
Picture showing the development process of JAVA Program

Java programming uses to produce byte codes and executes them. The first box
indicates that the Java source code is located in a. Java file that is processed with a Java
compiler called javac. The Java compiler produces a file called a. class file, which contains
the byte code. The. Class file is then loaded across the network or loaded locally on your
machine into the execution environment is the Java virtual machine, which interprets and
executes the byte code.

6|Page
Department of CSE, BNMIT 2010-2011
Chapter 2 Literature Survey

Two-tier and three-tier Models

The JDBC API supports both two-tier and three-tier models for database access. In the
two-tier model, a Java applet or application talks directly to the database. This requires a
JDBC driver that can communicate with the particular database management system being
accessed. A user's SQL statements are delivered to the database, and the results of those
statements are sent back to the user. The database may be located on another machine to
which the user is connected via a network. This is referred to as a client/server configuration,
with the user's machine as the client, and the machine housing the database as the server.

Java applet or Html


browser Client machine (GUI)

HTTP, RMI, or CORBA calls


Application
Server (Java) Server machine (business Logic)
JDBC

DBMS-proprietary protocol

Database server
DBMS
In the three-tier model, commands are sent to a "middle tier" of services, which then
send SQL statements to the database. The database processes the SQL statements and sends
the results back to the middle tier, which then sends them to the user. MIS directors find the
three-tier model very attractive because the middle tier makes it possible to maintain control
over access and the kinds of updates that can be made to corporate data. Another advantage is
that when there is a middle tier, the user can employ an easy-to-use higher-level API which is
translated by the middle tier into the appropriate low-level calls. Finally, in many cases the
three-tier architecture can provide performance advantages. Until now the middle tier has
typically been written in languages such as C or C++, which offer fast performance. However, with
the introduction of optimizing compilers that translate Java byte code into efficient machine-specific
code, it is becoming practical to implement the middle tier in Java. This is a big plus, making it
possible to take advantage of Java's robustness, multithreading, and security features. JDBC is
important to allow database access from a Java middle tier.

7|Page
Department of CSE, BNMIT 2010-2011
Chapter 2 Literature Survey

2.4 Java Development Tool Kit

The Java Development Kit (JDK) is a Sun Microsystems product aimed at Java
developers. Since the introduction of Java, it has been by far the most widely used Java SDK.
On 17 November 2006, Sun announced that it would be released under the GNU General
Public License (GPL), thus making it free software. This happened in large part on 8 May
2007; Sun contributed the source code to the OpenJDK.

The JDK has as its primary components a collection of programming tools, including:

java – the loader for Java applications. This tool is an interpreter and can interpret the
class files generated by the javac compiler. Now a single launcher is used for both
development and deployment. The old deployment launcher, jre, no longer comes with
Sun JDK.
javac – the compiler, which converts source code into Java byte code.
jar – the archiver, which packages related class libraries into a single JAR file. This
tool also helps manage JAR files.
javadoc – the documentation generator, which automatically generates documentation
from source code comments
jdb – the debugger
jps – the process status tool, which displays process information for current Java
processes
javap – the class file disassembler.
appletviewer – this tool can be used to run and debug Java applets without a web
browser

8|Page
Department of CSE, BNMIT 2010-2011
Chapter 2 Literature Survey

2.5 Oracle 10g

The idea of Oracle 10g is that the database will be able to dynamically "requisition"
resources from the grid to meet levels of peak demand.

Other enhancements for Oracle 10g are aimed at reducing costs and improving
the quality of service by making the database easier to deploy and manage including

2.5.1 JDBC

JDBC is a Java API for executing SQL statements. (As a point of interest, JDBC is a
trademarked name and is not an acronym; nevertheless, JDBC is often thought of as standing
for Java Database Connectivity. It consists of a set of classes and interfaces written in the Java
programming language. JDBC provides a standard API for tool/database developers and
makes it possible to write database applications using a pure Java API.

Using JDBC, it is easy to send SQL statements to virtually any relational database.
One can write a single program using the JDBC API, and the program will be able to send
SQL statements to the appropriate database. The combinations of Java and JDBC lets a
programmer write it once and run it anywhere.

Using JDBC (Java Data Base Connectivity) To Connect.

9|Page
Department of CSE, BNMIT 2010-2011
Chapter 2 Literature Survey

Two-tier and three-tier Models

The JDBC API supports both two-tier and three-tier models for database access. In the
two-tier model, a Java applet or application talks directly to the database. This requires a
JDBC driver that can communicate with the particular database management system being
accessed. A user's SQL statements are delivered to the database, and the results of those
statements are sent back to the user. The database may be located on another machine to
which the user is connected via a network. This is referred to as a client/server configuration,
with the user's machine as the client, and the machine housing the database as the server.

Java applet or Html


browser Client machine (GUI)

HTTP, RMI, or CORBA calls


Application
Server (Java) Server machine (business Logic)
JDBC

DBMS-proprietary protocol

Database server
DBMS

In the three-tier model, commands are sent to a "middle tier" of services, which then
send SQL statements to the database. The database processes the SQL statements and sends
the results back to the middle tier, which then sends them to the user. MIS directors find the
three-tier model very attractive because the middle tier makes it possible to maintain control
over access and the kinds of updates that can be made to corporate data. Another advantage is
that when there is a middle tier, the user can employ an easy-to-use higher-level API which is
translated by the middle tier into the appropriate low-level calls. Finally, in many cases the
three-tier architecture can provide performance advantages. Until now the middle tier has
typically been written in languages such as C or C++, which offer fast performance. However, with
the introduction of optimizing compilers that translate Java byte code into efficient machine-specific
code, it is becoming practical to implement the middle tier in Java. This is a big plus, making it
possible to take advantage of Java's robustness, multithreading, and security features. JDBC is
important to allow database access from a Java middle tier.

10 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 2 Literature Survey

2.6 MYSQL
What is MySQL?
MySQL is a open source Relational Database Management System. It is very
fast reliable and flexible Database Management System. It provides a very high performance
and it is multi-threaded and multi user Relational Database management system. It is one of
the most popular relational database Management System on the web. The MySQL Database
has become the world's most popular open source Database, because it is free and available on
almost all the platforms. The MySQL can run on Unix, window, and Mac OS. MySQL is used
for the internet applications as it provides good speed and is very secure. It was developed to
manage large volumes of data at very high speed to overcome the problems of existing
solutions. MySQL can be used for verity of applications but it is mostly used for the web
applications on the internet.

Connecting to MySQL Using the Driver Manager Interface


MySQL Connector/J is flexible in the way it handles conversions between MySQL
data types and Java data types. In general, any MySQL data type can be converted to a
java.lang.String, and any numeric type can be converted to any of the Java numeric types,
although round-off, overflow, or loss of precision may occur.

Starting with Connector/J 3.1.0, the JDBC driver will issue warnings or throw Data
Truncation exceptions as is required by the JDBC specification unless the connection was
configured not to do so by using the property jdbcCompliantTruncation and setting it to false.
When you are using JDBC outside of an application server, the DriverManager class manages
the establishment of Connections.

The DriverManager needs to be told which JDBC drivers it should try to make
Connections with. The easiest way to do this is to use Class.forName() on the class that
implements the java.sql.Driver interface. With MySQL Connector/J, the name of this class is
com.mysql.jdbc.Driver. With this method, you could use an external configuration file to supply
the driver class name and driver parameters to use when connecting to a database.

11 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 2 Literature Survey

2.7 NetBeans IDE


NetBeans refers to both a platform framework for Java desktop applications, and an integrated
development environment (IDE) for developing with Java, JavaScript, PHP, Python, Ruby,
Groovy, C, C++, Scala, Clojure, and others.

The NetBeans IDE is written in Java and can run anywhere a JVM is installed, including
Windows, Mac OS, Linux, and Solaris. A JDK is required for Java development functionality,
but is not required for development in other programming languages.

The NetBeans platform allows applications to be developed from a set of modular software
components called modules. Applications based on the NetBeans platform (including the
NetBeans IDE) can be extended by third party developers.

Applications can install modules dynamically. Any application can include the Update Center
module to allow users of the application to download digitally-signed upgrades and new
features directly into the running application. Reinstalling an upgrade or a new release does
not force users to download the entire application again.

The platform offers reusable services common to desktop applications, allowing developers to
focus on the logic specific to their application. Among the features of the platform are:

User interface management (e.g. menus and toolbars)


User settings management
Storage management (saving and loading any kind of data)
Window management
Wizard framework (supports step-by-step dialogs)
NetBeans Visual Library
Integrated Development Tools

12 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 2 Literature Survey

THREADS
A thread is a program's path of execution. Most programs written today run as a
single thread, causing problems when multiple events or actions need to occur at the same
time. Let's say, for example, a program is not capable of drawing pictures while reading
keystrokes. The program must give its full attention to the keyboard input lacking the ability
to handle more than one event at a time. The ideal solution to this problem is the seamless
execution of two or more sections of a program at the same time. Threads allow us to do this.

Multithreaded applications deliver their potent power by running many threads concurrently
within a single program. From a logical point of view, multithreading means multiple lines of
a single program can be executed at the same time, however, it is not the same as starting a
program twice and saying that there are multiple lines of a program being executed at the
same time. In this case, the operating system is treating the programs as two separate and
distinct processes. Under UNIX, forking a process creates a child process with a different
address space for both code and data. However, fork () creates a lot of overhead for the
operating system, making it a very CPU-intensive operation. By starting a thread instead, an
efficient path of execution is created while still sharing the original data area from the parent.
The idea of sharing the data area is very beneficial, but brings up some areas of concern that
we'll discuss later

Creating threads
Java's creators have graciously designed two ways of creating threads: implementing an
interface and extending a class. Extending a class is the way Java inherits methods and
variables from a parent class. In this case, one can only extend or inherit from a single parent
class. This limitation within Java can be overcome by implementing interfaces, which is the
most common way to create threads. (Note that the act of inheriting merely allows the class to
be run as a thread. It is up to the class to start () execution, etc.)

Interfaces provide a way for programmers to lay the groundwork of a class. They are used to
design the requirements for a set of classes to implement. The interface sets everything up,
and the class or classes that implement the interface do all the work. There are a few
differences between a class and an interface. First, an interface can only contain abstract
methods and/or static final variables (constants). Classes, on the other hand, can implement
methods and contain variables that are not constants. Second, an interface cannot implement
any methods. A class that implements an interface must implement all methods defined in that
interface. An interface has the ability to extend from other interfaces, and (unlike classes) can
extend from multiple interfaces. Furthermore, an interface cannot be instantiated with the new
operator; for example, Runnable a=new Runnable (); is not allowed.

13 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 2 Literature Survey

Exception Handling in JAVA


Definition: An exception is an event, which occurs during the execution of a program, which
disrupts the normal flow of the program's instructions.

When an error occurs within a method, the method creates an object and hands it off to the
runtime system. The object, called an exception object, contains information about the error,
including its type and the state of the program when the error occurred. Creating an exception
object and handing it to the runtime system is called throwing an exception.

After a method throws an exception, the runtime system attempts to find something to handle
it. The set of possible "something’s" to handle the exception is the ordered list of methods that
had been called to get to the method where the error occurred. The list of methods is known as
the call stack

SYNTAX OF EXCEPTION HANDLING


try {
// Normal execution path
} catch (ExampleException ee) {
// deal with the ExampleException
} finally {
// This optional section is executed upon termination of any of the try or catch blocks above,
// except when System.exit() is called in "try" or "catch" blocks;
}

Advantages of exceptions
 The use of exceptions to manage errors has some advantages over traditional error-
management techniques.

14 | P a g e
Department of CSE, BNMIT 2010-2011
CHAPTER 3

SYSTEM ANALYSIS
&
SPECIFICATION
Chapter 2 System analysis & specification

System analysis and specification


3.1 Introduction

The system is based on the IEEE 2005 paper Voice-to-phoneme conversion algorithms
for the speaker-independent voice-tag applications in embedded platforms. We have
implemented a security system to overcome the difficulties of CPU and Memory space.

A. Purpose of the system


To implement an voice based security system which consumes less computer resources
such as CPU and Memory. The system is based on Phoneme n-gram histogram-based
sequential hypothesis selection.

B. Scope of the System


 To implement the admin module to handle the users.
 To create a registration session for the new users
 To remove a user.
 To change the existing voice tag.
 To authorize the user.

C. Objectives and Success Criteria of the Project


The main objective of the project for implementing an optimal authentication system
which will utilize the minimum computer resources.

Definitions, acronyms and abbreviation


Phoneme: A Phoneme is the smallest unit of speech that distinguishes meaning.
Phonemes are placed between slashes
Decoder: A decoder is a device which does the reverse of encoder, undoing the
encoding so that the original information can be retrieved.
Voice: The voice consists of sounds made by a human using vocal folds for talking,
whispering, singing, laughing, crying, screaming etc., The vocal folds in combination with
the lips, the tongue, the lower jaw, and the plate are capable of producing highly intricate
array of sound.
Speech Recognition: The process of converting speech signals to a sequence of words
in the form of digital data, by means of algorithm implemented as computer program.

16 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 2 System analysis & specification

VBSS

Current System
Traditionally, HMMs are directly used as the abstract speech representations in voice-
tag applications. This approach has enjoyed considerable success as it is a language
independent and achieves high speech recognition accuracy while maintaining the low CPU
requirement for the HMM-based voice-tag. As long as the targeted number of voice-tags is
restricted to two or three dozen in an application, the memory consumption of this strategy
is acceptable. Another attribute of the HMM-based voice-tag is its speaker-dependence. A
typical enrollment session in speaker-dependent context is very convenient is very
convenient for the user in that it required only a few example utterances to train a voice-tag
HMM that captures both the speech abstraction and the speaker characteristics.

Proposed System
The proposed system is a speaker-independent voice-tag application, hundreds of
voice-tags can be entered to extend a voice enabled phonebook. For user convenience, the
number of example utterances per voice-tag during enrollment must be minimal as informal
user studies indicate that a single example utterance per voice-tag is most desirable.
However, in a speech recognition application with a large number of voice-tags, the
recognition accuracy of each voice-tag is theoretically proportional to its number of
associated example utterances. Thus, in order to achieve acceptable performance, more
than one example utterance is typically employed. For this reason, a compromise of 2-3
example utterance per voice tag is usually chosen. We describe a voice-to-phoneme
algorithm which maximizes user convenience during voice-tag enrollment while improving
recognition accuracy.

17 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 2 System analysis & specification

3.2 Functional Requirements:

Admin must be able to create, modify and delete a user from entering the system.

The user must use the microphone to enter the voice key to enter into the system.

The system must not enter a user with wrong vocal calls.

3.3 Non Functional Requirements:

The system must use the minimum CPU resources.

The system must utilize minimum memory.

1. Usability
The system is a secure system which can be usable with two user only admin and user.

2. Reliability
The system is designed as most reliable system by coding generically. All the errors
and exceptions are expected and fixed during the coding.

3. Performance
The system exhibits high performance by utilizing the minimum CPU and memory.

4. Supportability
The system can be supportable across a wide range of platforms including the
embedded platforms.

5. Implementation
The system is implemented in Microsoft Windows Xp Platform on JVM 1.6.

6. Interface
The interface is planned to be GUI on desktop system.

18 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 2 System analysis & specification

3.4 Hardware and Software Requirements

Hardware Requirements

CPU : Intel Pentium 4 Processor, Dual Core.

RAM : 512 MB (MIN)

HDD : 80 GB (MIN)

Microphone : Headphone, Any Good Quality microphone.

Software Requirements

Programming Language : Java (Version JDK 1.6), Java Media Framework, Netbeans.

Backend : Oracle 10g Release 2, MYSQL 5.4.

Technologies : Java Swings, Java Audio.

Operating System : Windows XP Professional with Service pack 3, Vista, 7.

19 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 2 System analysis & specification

System Models

3.5.1 SCENARIOS

Scenario 1: User Registration Scenario

The user will register with the system by communicating with the admin. The user will
speak the secret key and stores his profile.

Scenario 2: User Authentication Scenario

The user will speak the secret key at the system prompt in order to authenticate himself
with the system.

Scenario 3: Admin Delete User scenario

The admin will enter the system by entering the password at the login. The admin will
select the user from the list of users and selects the delete button to delete the user.

Scenario 4: Admin New User creation scenario

The admin will select add new user to add a new user with voice-tag. Then he allows the
user to speak at the voice tag.

Scenario 5: Admin Modify Voice-Tag

The admin will select the edit voice tag. He selects the user from the list. He allows the
user to speak a new voice tag.

20 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 2 System analysis & specification

3.5.2Use Case Model


3.5.2.1 Admin Use case:

: Picture showing Admin use case


Fig 3.1,

Login

Use Case Name

Participating Actor Admin

Flow of Events 1. The admin will enter the user name and password in the given fields.
2. The admin will click on the login button.
Pre Condition The admin must have a user id and password

Post Condition The admin must wait for the system.

Quality Requirements Password must be stored in the encrypted format.

21 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 2 System analysis & specification

3.5.2.2 User usecase

Fig 3.2, Picture showing user usecase

3.5.2.3 Dynamic

Fig 3.3. The class diagram will show association between the classes. That is one class holds
the reference to the other class.
22 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 2 System analysis & specification

3.5.2.4 Sequential Diagram

Fig 3.4, User Interface – Navigational Paths and Screen Mockups

3.5.2.5 User Interface – Navigational Paths and Screen Mockups

Fig 3.5, Sequential diagram for the admin

23 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 2 System analysis & specification

3.5.2.5 UML DIAGRAM OF VBSS

VBSS

User UI UserDAO Utility

user enters userid and voice


Check authentication

Ph Decoder

Speech Recognizer

Fig 3.6, UML Diagram of VBSS

VBSS CONTROL FLOW

2: Check Authentication
:UI
:UserDAO

1: User Enteres userid and voiceTag

3: Ph Decoder
:User 4: Speech Recognizer

:Utility

Fig 3.7,UML diagram showing the working of VBSS

24 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 2 System analysis & specification

3.5.2.7 DATA BASE TABLES


USERS

Table Name Data Types Size Constraint


NAME VARCHAR2 20 UINQUE
USERNAME VARCHAR2 20 PRIMARY KEY
VOICETAG VARCHAR2 4000
EMAIL VARCHAR2 20
ADDRESS VARCHAR2 50
PHONENO VARCHAR2 12
SEXINFO VARCHAR2 1
EMAILALERT VARCHAR2 1
FILEBODY LONGBLOB
FGPASSWORD VARCHAR2 15
THEME INTEGER

ADMIN1

Table Name Data Types Size Constraint


PASSWORD VARCHAR2 20
SLEVEL INTEGER

LOGUSERS

Table Name Data Types Size Constraint


NAME VARCHAR2 15
USERID VARCHAR2 15
UNAME VARCHAR2 15
LOGDATE VARCHAR2 15
FROMTIME VARCHAR2 15
TOTIME VARCHAR2 15
DURATION VARCHAR2 15

25 | P a g e
Department of CSE, BNMIT 2010-2011
CHAPTER 4

SYSTEM DESIGN
Chapter 4 System Design

SYSTEM DESIGN
4.1 INTRODUCTION
a. Purpose of the System
The main purpose of the system is to design a security system that using voice
biometrics. It must be utilize very low system resources.
b. Design Goal
 The system must utilize minimum memory.
 The system must utilize minimum CPU resources.
 The system must utilize minimum persistent store.

4.1 VBSS - SOFTWARE ARCHITECTURE


The proposed system is based on the phoneme conversion. In the registration phase
the voice is converted in to phoneme’s and then stored in database which results in less
storage. Along the phonemes the vocal levels are stored in numerical format. The
authentication can be done by receiving the voice data from the microphone and then
converts it into phoneme’s and by comparing with the phoneme’s in database. It will result is
consumption of less CPU resources in searching and authentication.

VBSS – VOICE BASED SECURITY SYSTEM ARCHITECTURE

Sequential
Store User
Hypothesis
Phonetic Profiles
Combination
Decoder database
Record Voice
Tag

Retrieve
Profiles
Speech
Recognizer

Comparator
Access Granted / Access Denied

Fig 4.1, Control Flow diagram of VBSS

`26 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 4 System Design

4.3 Subsystem Decomposition


4.3.1 Voice Tracking Module:

This entire module is implemented in a thread where it continuously listens to the voice
by switching on and off the microphone. This module will be provided with the user interface
to record a voice. It includes start, stop and record buttons. This module is support module for
the admin and authentication modules. The admin module uses it in the registration process of
the users. The authentication module will uses it in identification of the users.

4.3.2 Voice Analysis and Storage Module

This module uses the phonetic decoding using phoneme approach. This module will
analyze the voice and extracts words or sentences from the voice tags. This module is
responsible for converting the listened data into English words by the process called phonetic
decoding. After the decoding process is completed the data will be stored in a database.

4.3.3 Authentication Module

This module is responsible for the comparison of present voice tag with the existing
voice tags in the systems. It will take the support of the voice tracking module and the voice
analysis module to compare the voices and read the microphone. The phonetics will be
recognized by the voice Analysis module and speech is recognized by the Voice tracking
module for computations.

4.3.4 Admin Module

This module is used by the administrator of the security system. It is responsible for
registration of users, deleting the existing user. By passing the security for the specific users …
etc., this module will take help from the voice tracking module for registration of new users.
Voice tracking module will provide the interface to read the data and Voice analysis module
will take care of converting into phonetics and stores. This module will also measure the vocal
levels and stores in an integer format. Vocal levels will be calculated by taking the average
frequency at specific time.

`27 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 4 System Design

4.4 USER INTERFACE FOR ADMIN

START

ADDING A NEW MODIFY THE EXISTING REMOVE THE USER


USER USER

RECORD THE VOICE SELECT THE USER


AND ADD OTHER SELECT THE USER
INFORMATION

DELETE ALL THE RECORDS


SAVE ALL THE ADD THE NEW OF THE USER IN THE
INFORMATION INFORMATION DATABASE

STOP

Fig 4.2, User interface diagram of Admin

`28 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 4 System Design

4.5 USER INTERFACE FOR USER

START

ENTER THE USER ID

RECORD VOICE

UNLOCK

ACCESS DENIED

ACCESS GIVEN

STOP

Fig 4.3, User interface diagram of use

`29 | P a g e
Department of CSE, BNMIT 2010-2011
CHAPTER 5

IMPLEMENTATION
Chapter 5 Implementation

5. IMPLEMENTATION
The construction of the voice based security system involves in the development of two
major activities:

User interface
Voice processing

5.1 User Interface

User interface is basically an interface between end user and the engine. The UI is a client. It
deals with the outlook of the application. We construct an interface where we can perform
actions like:

Adding a new user


Modifying the existing the user
Removing the user
Authenticate the user

The design of UI by first understanding the various features that are needed to be implemented
for the voice based security system application like database, voice processing etc. The UI acts
like a display unit where the user can choose from the different available options.

In the first interface created is login, used to authenticate users based on their voice.
This interface has access to help window, forgot password window and admin window. This
window will authenticate the admin access by verifying admin password, this leads to main
admin window which is used to add, modify, remove and view user information into database.
This also has access to help and log file window to view users login information. As user
successfully log-in, login window will open userlocker window for each user to view user
information and provides interface to personal locker folder. VBSS provides 10 themes for
users to choose and can set different themes for each user.

30 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 5 Implementation

5.2 Voice processing


Java Media Framework

Introduction
The Java Media Framework (JMF) is a recent API for Java dealing with real-time
multimedia presentation and effects processing. JMF handles time-based media, media which changes
with respect to time. Examples of this are video from a television source, audio from a raw-audio
format file and animations. The beta JMF 2.0 specification will be used for this report, as they currently
reflect the features that will appear in the final version.

During the input stage, data is read from a source and passed in buffers to the
processing stage. The input stage may consist of reading data from a local capture device (such
as a webcam or TV capture card), a file on disk or stream from the network.

The processing stage consists of a number of codecs and effects designed to


modify the data stream to one suitable for output. These codecs may perform functions such as
compressing or decompressing the audio to a different format, adding a watermark of some
kind, cleaning up noise or applying an effect to the stream (such as echo to the audio).

Once the processing stage has applied its transformations to the stream, it
passes the information to the output stage. The output stage may take the stream and pass it to
a file on disk, output it to the local video display or transmit it over the network.

31 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 5 Implementation

5.3 Capturing Real-time Data


Video and audio data can be captured in real-time from input sources and streamed to files on
the local file-system.

5.3.1 Capturing Audio


To capture audio, the specified sampling frequency, sample size and number of channels
must be specified. JMF will attempt to locate any devices which will support this format and return a
list of all that match.

CaptureDeviceInfo di = null;

Vector deviceList = CaptureDeviceManager.getDeviceList(

new AudioFormat( "linear", 44100, 16, 2 ) );


if ( deviceList.size() > 0 )
di = (CaptureDeviceInfo)deviceList.firstElement();
Processor p = Manager.createRealizedProcessor(di.getLocator());
DataSource source = p.getDataOutput();

The source object returned from the Processor can then be turned into a Player object by calling
Manager.createPlayer(). To capture it to an audio file instead, a DataSink can take the data instead:

DataSink sink;
MediaLocator dest = new MediaLocator("file://output.wav");

try {

sink = Manager.createDataSink(source, dest);

sink.open();

sink.start();

} catch (Exception e) {

}
5.3.2Conclusions
JMF is a highly flexible multimedia architecture that shows a lot of promise. In the
future, hopefully Sun will work on making it more stable as well as on documenting the framework and
providing more example code. The support for Audio For Windows (VFW) makes it a good contender
for future multimedia applications. In its current state, it is usable, but the lack of information makes it
difficult to create a complex program.

32 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 5 Implementation

5.4 CLASSES IN VBSS PROJECT

Class AdminForm {
public class AdminForm
extends javax.swing.JFrame

java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
voice.AdminForm

All Implemented Interfaces:


java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable,
javax.accessibility.Accessible, javax.swing.RootPaneContainer,
javax.swing.WindowConstants

Adminform class is a JFrameForm class type which contains Admin window implemented
via SWINGS. Admin form has capability of Adding New users, Modifying, Deleting. It also has
ability to playback the voice recorded by USERS. Adminform has special security options for
better security, admin can view and generate users log and change security level according to
the environment of the system.

Adminform Class features :-

 Adminform has also access to VBSS help.

 It has different modes for better user interaction.

 It also gives capability for administrator to view and update user information.

 It provides flexible options to change security level.

 Adminform is well protected by ADMIN password. }

33 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 5 Implementation

Class adminform1 {
public class adminform1
extends javax.swing.JFrame

java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
voice.adminform1

All Implemented Interfaces:


java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable,
javax.accessibility.Accessible, javax.swing.RootPaneContainer,
javax.swing.WindowConstants

Adminform1 class is a JFrameForm class type which contains Adminform1 window


implemented via SWINGS. It is mainly used to login as administrator and change the
administrator password. Adminform1 has direct interaction with the database, mainly with
admin1 database table. [admin1] Table has two columns one is admin password and
other is slevel. Administrator has capability to change ADMIN password when is he feels
that old password is no more protected.

Adminform1 Class features :-

 Adminform1 has also access to VBSS help.

 It has different modes for better user interaction.

 It has simple easy to use interface .

 Admin must enter correct password to enter to adminform.

 It provides the interface for changing Admin password by successfully confirming


the old password.}

34 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 5 Implementation

Class User {
public class User
extends java.lang.Objec

java.lang.Object
voice.User

User class is a simple java class that is used to exchange information among the
different VBSS modules. As VBSS has several modules, integration and communication
among classes is difficult hence to overcome this difficulty user class is introduced. User Class
provides a common interface so that data collected by one module can be used by other
effectively.

User class provides common functionality among UTILITY, USERDAO, ADMIN. }


Class UserDAO {
public class UserDAO
extends java.lang.Object

java.lang.Object
voice.UserDAO

UserDAO class is a simple java class that is used only for data base interaction. This
class is used to insert or create a new user, update or modify existing users, delete users,
retrieve the users information when requested by other modules.

Method Summary
java.util.ArrayList<java.lang.String> getList()
User load(java.lang.String key)
void modify(User user)
void remove(java.lang.String key)
void store(User u)

void UserDAO() }

35 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 5 Implementation

Class GoogleTest {
public class GoogleTest
extends java.lang.Object
implements java.lang.Runnable

java.lang.Object
voice.GoogleTest

All Implemented Interfaces:

java.lang.Runnable

GoogleTest is a simple java class that is used to send login email alerts to the users
. As any user logs in, an email alert is sent to notify the login and also googletest class
sends email to user on 5 failed login attempts.

sendSSLMessage
public void sendSSLMessage(java.lang.String[] recipients,
java.lang.String subject,
java.lang.String message,
java.lang.String from)
throws javax.mail.MessagingException

public V put(K key, V value);

Maps the specified key to the specified value in this hashtable. Neither the key nor the value
can be null.
The value can be retrieved by calling the get method with a key that is equal to the original
key.

public static int addProvider(Provider provider)


Adds a provider to the next position available.

First, if there is a security manager, its checkSecurityAccess method is called with the
string "insertProvider."+provider.getName() to see if it's ok to add a new provider. If the
default implementation of checkSecurityAccess is used (i.e., that method is not
overriden), then this will result in a call to the security manager's checkPermission
method with a SecurityPermission("insertProvider."+provider.getName()) permission.

36 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 5 Implementation

Class SimpleAudioRecorder {
public class SimpleAudioRecorder
extends java.lang.Thread

java.lang.Object
java.lang.Thread
voice.SimpleAudioRecorder

All Implemented Interfaces:


java.lang.Runnable

SimpleAudioRecorder is simple java class that is used to record sound from


microphone. This class is the most important for recording voice via microphone i.e the
dataline from sound driver. This class provides API to interact with the sound driver, the
API’s used are.

public interface TargetDataLine extends DataLine

A target data line is a type of DataLine from which audio data can be read. The most common
example is a data line that gets its data from an audio capture device. (The device is
implemented as a mixer that writes to the target data line.)

public class AudioFileFormat extends Object

An instance of the AudioFileFormat class describes an audio file, including the file type, the file's
length in bytes, the length in sample frames of the audio data contained in the file, and the
format of the audio data.

public static int write(AudioInputStream stream,


AudioFileFormat.Type fileType,
File out)
throws IOException

Writes a stream of bytes representing an audio file of the specified file type to the external file
provided.

37 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 5 Implementation

Class Login {
public class Login
extends javax.swing.JFrame

java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
voice.Login

All Implemented Interfaces:


java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable,
javax.accessibility.Accessible, javax.swing.RootPaneContainer,
javax.swing.WindowConstants

Login class is a JFrameForm class type, this is the main class of VBSS . Login class
window is implemented via SWINGS. This class is used by users to login via voice hence this
class provides a simple user interface to record voice- generate voice tag – retrieve stored voice
tag – calculate deviation by comparing voice tags – display appropriate message to users.

Login Class features :-

 Admin login option.

 VBSS supports voice interface.

 Enable or disable voice interface.

 Login has also access to VBSS help.

 It has simple easy to use interface .

38 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 5 Implementation

THE VOICE USER INTERFACE

SpVoice SPAI
The SpVoice object brings the text-to-speech (TTS) engine capabilities to applications using
SAPI automation. An application can create numerous SpVoice objects, each independent of and
capable of interacting with the others. An SpVoice object, usually referred to simply as a voice, is
created with default property settings so that it is ready to speak immediately.

Speak Method
The Speak method initiates the speaking of a text string, a text file, an XML file, or a wave
file by the voice.
The Speak method can be called synchronously or asynchronously. When called
synchronously, the method does not return until the text has been spoken; when called asynchronously,
it returns immediately, and the voice speaks as a background process.
When synchronous speech is used in an application, the application's execution is blocked
while the voice speaks, and the user is effectively locked out. This may be acceptable for simple
applications, or those with no graphical user interface (GUI), but when sophisticated user interaction is
intended, asynchronous speaking will generally be more appropriate.
SpVoice.Speak ( Text As String, [Flags As SpeechVoiceSpeakFlags = SVSFDefault] ) As
Long

Parameters
Text
The text to be spoken, or if the SVSFIsFilename flag is included in the Flags parameter, the path of the
file to be spoken.

Flags

[Optional] Flags. Default value is SVSFDefault.


Return Value

A Long variable containing the stream number. When a voice enqueues more than one
stream by speaking asynchronously, the stream number is necessary to associate events with the
appropriate stream.

Remarks
The Speak method inserts a stream into the text-to-speech (TTS) engine's queue, and
returns a stream number, assigned by the engine. This distinguishes the stream from other streams in the
queue. This number is a temporary identifier which functions like an index into the TTS queue. The first
stream spoken into an empty queue will always have a stream number of 1.

39 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 5 Implementation

Class Utility {
public class Utility
extends java.lang.Object

java.lang.Object
voice.Utility

Utility is java class, it is the main class of VBSS. Utility class has the main functionality that is
generating voice tags from WAVE file and comparing the two voice tags. Main algorithm of
VBSS is actually implemented in Utility class.

Append
public StringBuilder append(StringBuffer sb)

Appends the specified StringBuffer to this sequence.

StringBuilder public final class StringBuilder extends Object

A mutable sequence of characters. This class provides an API compatible with


StringBuffer, but with no guarantee of synchronization. This class is designed for use as a drop-in
replacement for StringBuffer in places where the string buffer was being used by a single thread
(as is generally the case). Where possible, it is recommended that this class be used in
preference to StringBuffer as it will be faster under most implementations.

The principal operations on a StringBuilder are the append and insert methods, which
are overloaded so as to accept data of any type. Each effectively converts a given datum to a
string and then appends or inserts the characters of that string to the string builder. The append
method always adds these characters at the end of the builder; the insert method adds the
characters at a specified point.

For example, if z refers to a string builder object whose current contents are "start", then the
method call z.append("le") would cause the string builder to contain "startle", whereas z.insert(4,
"le") would alter the string builder to contain "starlet".

In general, if sb refers to an instance of a StringBuilder, then sb.append(x) has the


same effect as sb.insert(sb.length(), x). Every string builder has a capacity. As long as the length of
the character sequence contained in the string builder does not exceed the capacity, it is not
necessary to allocate a new internal buffer. If the internal buffer overflows, it is automatically
made larger.

Instances of StringBuilder are not safe for use by multiple threads. If such
synchronization is required then it is recommended that StringBuffer be used. }

40 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 5 Implementation

COMPARE FUNCTION
int compare(T o1,T o2);

Compares its two arguments for order. Returns a negative integer, zero, or a positive
integer as the first argument is less than, equal to, or greater than the second.

In the foregoing description, the notation sgn(expression) designates the mathematical


signum function, which is defined to return one of -1, 0, or 1 according to whether the
value of expression is negative, zero or positive.

The implementor must ensure that sgn(compare(x, y)) == -sgn(compare(y, x)) for all x and y.
(This implies that compare(x, y) must throw an exception if and only if compare(y, x)
throws an exception.)

The implementor must also ensure that the relation is transitive: ((compare(x, y)>0) &&
(compare(y, z)>0)) implies compare(x, z)>0.

Finally, the implementor must ensure that compare(x, y)==0 implies that sgn(compare(x,
z))==sgn(compare(y, z)) for all z.

It is generally the case, but not strictly required that (compare(x, y)==0) == (x.equals(y)).
Generally speaking, any comparator that violates this condition should clearly indicate
this fact. The recommended language is "Note: this comparator imposes orderings that
are inconsistent with equals."

Parameters:

o1 - the first object to be compared.

o2 - the second object to be compared.

Returns:

a negative integer, zero, or a positive integer as the first argument is less than, equal
to, or greater than the second.

Throws:

Class Cast Exception - if the arguments' types prevent them from being
compared by this comparator

41 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 5 Implementation

Class HELP {
public class HELP
extends javax.swing.JFrame

java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
voice.HELP

All Implemented Interfaces:


java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable,
javax.accessibility.Accessible, javax.swing.RootPaneContainer,
javax.swing.WindowConstants

HELP class is a JFrameForm class type, it is very useful for new users to get to
know VBSS software. As VBSS software provides a lot of features that is difficult to explore,
hence VBSS HELP will make it easier. HELP Class is made of jTabbedPanel Dividing the help
options. They are :-

GENERAL TAB:-
It contains general features of VBSS and its requirements to run VBSS. It can
also connect to VBSS website to check for new version and download the requirements.

USING VBSS :-
It contains instructions to Install and make VBSS working, and also using of
VBSS in detail.

VBSS SOFTWARE ARCHITECTURE :-


This tab contains the ILLUSTRATION OF VBSS.

TEST MICROPHONE :-
This tab is the most important of all because it has ability to check your
microphone automatically and manually , it also helps Users to configure microphone.

VBSS-PROJECT.CO.CC :-
This tab helps user to visit VBSS website for online help and support.

ABOUT US :-

This tab helps user to know about the VBSS project developers. }

42 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 5 Implementation

Class logfile {
public class logfile
extends javax.swing.JFrame
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
voice.logfile

All Implemented Interfaces:


java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable,
javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants.

Logfile class is a JFrameForm class type. It is used to keep track of the users login
information. This class Collects information from database. As a user logs out of
userlocker1 window, information is inserted into the databse.

The information collected by Logfile is :-

USER ID :
NAME :
DATE :
TIME FROM :
TIME TO :
DURATION :

Logfile is designed in such a way that it can sort log contents by user, i.e
administrator can search by name and generate log file.

Logfile has ability to generate logfile so the administrator can print the log file.

43 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 5 Implementation

Class userlocker1 {
public class userlocker1
extends javax.swing.JFrame

java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
voice.userlocker1

All Implemented Interfaces:


java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable,
javax.accessibility.Accessible, javax.swing.RootPaneContainer,
javax.swing.WindowConstants

userlocker1 class is a JFrameForm class type. This window is totally dedicated to


each user. As user logs in userlocker1 window shows user information and also has capability
to play back the audio recorded. Main feature of this class is capability of creating a
PERSONAL LOCKER FOLDER so the user can store and view files when necessary.

userlocker1 class has capability of sending email as soon as user logs out.

userlocker1 class has secured log out information, i.e locks user personal folder.

LOGIC BEHIND THE PERSONAL FOLDER:

userlocker1 class uses BATCH COMMANDS to create personal locker folder. userlocker1
class creates the batch file and executes it and delete as VBSS software process ends.

To Create the folder Locker:


Batch files checks for existence of the folder if not it will create new folder.

Using MD <username>

Username as folder name.

44 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 5 Implementation

Lock Personal Folder


First change the folder name to Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}

Using CMD ren "username" \"Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}

ATTRIB.exe

attrib +h +s \"Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}


Display or change file attributes. Find Filenames.
Syntax
ATTRIB [ + attribute | - attribute ] [pathname] [/S [/D]]
Key
+ : Turn an attribute ON
- : Clear an attribute OFF
pathname : Drive and/or filename e.g. C:\*.txt
/S : Search the pathname including all subfolders.
/D : Process folders as well
attributes:
R Read-only (1)
H Hidden (2)
A Archive (32)
S System (4)

And the personal locker folder is locked.

All these commands are executed via BATCH file.

UNLOCK THE LOCKER FOLDER:

The reverse engineering is done here:

"attrib -h -s \"Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"


"ren \"Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}\" "username"

Remove the folder attributes hidden and system file.


Rename the folder into username. The folder is unlocked successfully.

45 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 5 Implementation

5.5 ALGORITHMS USED IN VBSS

VOICE TO PHONEME ALGORITHM

VBSS uses voice to phoneme algorithm to generate voice tags and compare
voice tags. Voice to phoneme algorithm is an efficient algorithm to generate voice tags. In
VBSS, the recorded voice is stored in WAV audio file format because it is the only
uncompressed audio file format. It reads the WAV file using input file stream and converts into
samples i.e. phonemes. These phonemes will then be converted into voice tags using String
Builder.Append. VBSS uses this algorithm in Sequential Hypothesis mode to generate the
voice tags. Every 2500 samples, a voice tag is used.

Fig 5.2, Picture showing the code for phoneme conversion stage of the algorithm

46 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 5 Implementation

COMPARE VOICE TAGS

VBSS will generate new voice tags from user’s voice and retrieves the stored voice
tags and then compares them using string compare. String compare is an inbuilt string function
to compare two strings and returns the difference in their ASCII value, and this value is used as
deviation in voice tags. VBSS will decide to grant or deny access depending on the deviation
value. VBSS has Set security level feature, which dynamically decides the deviation allowed to
authenticate users.

Security level 0:

Security level 1:

Security level 2:

47 | P a g e
Department of CSE, BNMIT 2010-2011
CHAPTER 6

SYSTEM TESTING
Chapter 6 System Testing

SYSTEM TESTING

Software Testing is the process used to help identify the correctness, completeness,
security, and quality of developed computer software. Testing is a process of technical
investigation, performed on behalf of stakeholders, that is intended to reveal quality-related
information about the product with respect to the context in which it is intended to operate.
This includes, but is not limited to, the process of executing a program or application with the
intent of finding errors. Quality is not an absolute; it is value to some person. With that in mind,
testing can never completely establish the correctness of arbitrary computer software; testing
furnishes a criticism or comparison that compares the state and behavior of the product against
a specification. An important point is that software testing should be distinguished from the
separate discipline of Software Quality Assurance (SQA), which encompasses all business
process areas, not just testing.

There are many approaches to software testing, but effective testing of complex products is
essentially a process of investigation, not merely a matter of creating and following routine
procedure. One definition of testing is "the process of questioning a product in order to evaluate
it", where the "questions" are operations the tester attempts to execute with the product, and the
product answers with its behavior in reaction to the probing of the tester[citation needed].
Although most of the intellectual processes of testing are nearly identical to that of review or
inspection, the word testing is connoted to mean the dynamic analysis of the product—putting
the product through its paces. Some of the common quality attributes include capability,
reliability, efficiency, portability, maintainability, compatibility and usability. A good test is
sometimes described as one which reveals an error; however, more recent thinking suggests
that a good test is one which reveals information of interest to someone who matters within the
project community.

48 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 6 System Testing

6.1 Introduction

In general, software engineers distinguish software faults from software failures. In case
of a failure, the software does not do what the user expects. A fault is a programming error that
may or may not actually manifest as a failure. A fault can also be described as an error in the
correctness of the semantic of a computer program. A fault will become a failure if the exact
computation conditions are met, one of them being that the faulty portion of computer software
executes on the CPU. A fault can also turn into a failure when the software is ported to a
different hardware platform or a different compiler, or when the software gets extended.
Software testing is the technical investigation of the product under test to provide stakeholders
with

A common practice of software testing is that it is performed by an independent group


of testers after the functionality is developed but before it is shipped to the customer. This
practice often results in the testing phase being used as project buffer to compensate for project
delays. Another practice is to start software testing at the same moment the project starts and it
is a continuous process until the project finishes.

. In counterpoint, some emerging software disciplines such as extreme programming


and the agile software development movement, adhere to a "test-driven software development"
model. In this process unit tests are written first, by the programmers (often with pair
programming in the extreme programming methodology). Of course these tests fail initially; as
they are expected to. Then as code is written it passes incrementally larger portions of the test
suites. The test suites are continuously updated as new failure conditions and corner cases are
discovered, and they are integrated with any regression tests that are developed.

Unit tests are maintained along with the rest of the software source code and generally
integrated into the build process (with inherently interactive tests being relegated to a partially
manual build acceptance process).The software, tools, samples of data input and output, and
configurations are all referred to collectively as a test harness.

49 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 6 System Testing

6.2 Three levels of software testing


6.2.1 Unit testing:

In which each unit (basic component) of the software is tested to verify that
the detailed design for the unit has been correctly implemented. Unit testing verification
efforts on the smaller unit of the software design in the module. This is also known as
‘module’ testing. The modules of the system are tested separately. The testing is carried out
during programming stage itself. In this testing step each module is found to working
satisfactory as regard to the expected output from module. There are some validation checks
for verifying the data input given by the user which both the formal and validity of the
entered. It is very easy to find error debug the system.

Opening the application

This involves launching the application and providing the user with a GUI. In this we test for
actual GUI to be loaded successfully without any panic or exceptions.

Adding a user

This involves adding user ID for the user and other information’s while recording their voice
in the background using thread. After that saving all those information in the database.

Removing and modifying the user

This involves removing and modifying the voice tags and other information of the user from
the database.

Exiting the application

When the application is exited, it must not raise any panic or exception and it must intern kill
any of the processes belonging to the application. It must reset to the original profile before
application being initiated.

50 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 6 System Testing

6.2.2 Integrating Testing

Once individual program components of a system have been tested, they must be integrated to
create a partial or complete system. This integration process involves building the system and
testing the resultant system for problems that arises from component integrations. The main
difficulty that arises in integration testing is localizing errors that are discovered during the
process. There are complex interactions between system components and , when an
anomalous output is discovered, it may be hard to find the source of the errors, we should
always should use an increment approach to system integration testing.

In this testing we had to check if on creating new user, the information was stored on the
database and that there were no mistakes. And during the login, information of the legitimate
user is retrieved. On exiting we had to make sure that application traced back to its default
without any error.

6.2.3 Device Testing

This phase of testing involves running the application on the device ant testing to see if the
application is running and without any panics and errors. On device with limited memory we
had to ensure that there was no overflow error or any memory leaks. We had to check if the
API’s use were using were functional on device without any error.

Installing the project

In this phase we checked if the installations occurred successfully without any errors and all
the libraries are added.

Granting /denying the access

In this phase, the voice tags of the voice given during login is compared with the voice tags of
the voice that is given when the user was created. If the deviations are well within the limit,
access is given otherwise access is denied.

51 | P a g e
Department of CSE, BNMIT 2010-2011
Chapter 6 System Testing

6.3Testing and Results

Functionality Complete and Comments


Tested
Swings GUI Yes It allows the users to interact with
VBSS.

Voice Record and Playback Yes It reads voice from user via
microphone and play back the audio
via speakers.

Personal Locker folder Yes It provides users a protected folder to


keep their files safe and secure.

Voice User interface Yes It provides user a voice interface


generated by computer.
Email Notifications Yes It sends email to users notifying the
login, login failure and to retrieve
password.
Database Interaction Yes It is used by VBSS to store and
retrieve information.
Set Themes Yes It is used to set different themes for
vbss.

The editor has been thoroughly tested for any bugs that may have crept in our design or

implementation. So far no such bugs have been discovered.

52 | P a g e
Department of CSE, BNMIT 2010-2011
USER MANUAL
User manual

USER MANUAL

7.1 SUPPORTING SOFTWARE


 Netbeans 6.0 and above

 Oracle 10g

 Java Development Tool Kit

 My SQL.

Voice Based Secrity System


The main objective of the project is to implement an optimal authentication system which will
utilize the minimum computer resources and authenticate the users based on their voice, allow only the
legitimate users to access their account.

7.2 USAGE INSTRUCTIONS:

This user manual describes usage of .jar which are build files,

The vaious steps involved in launching the application on NetBeans are given below:

1. There are two ways to run a symbian application,they are:

1. Using JDK and IDE

2. Directly using VBSS GUI

Using the command prompt is tedious and difficult to launch and run an application and hence
we use only the Netbeans IDE for this purpose as it is very easy and simple for a user. Given
below are the steps involved for launching and running using Netbeans IDE.

53 | P a g e
Department of CSE, BNMIT 2010-2011
User manual

Steps to launch the application on the NetBeans


 Launch Netbeans v7.0 IDE by clicking on the start menu.
 Go to open project select VBSS project and open project.
 As netbeans loads the VBSS project
 Select the VBSS project in the project menu and select run on the Right click menu.
 Once it is successfully compiled, netbeans will generate JAR file which can
independently run any system using java virtual machine.
 Steps to install and configure Oracle 10g XE and MySql.

USING ORACLE 10G XE

First download and install Oracle 10g XE with any root password.

Configure Oracle 10g XE

 Open the Database Home Page login window:

On Windows, from the Start menu, select Programs (or All Programs), then Oracle
Database 10g Express Edition, and then Go To Database Home Page.
On Linux, click the Application menu (on Gnome) or the K menu (on KDE), then point
to Oracle Database 10g Express Edition, and then Go To Database Home Page.

 At the Database Home Page login window, enter the following information:

Username: Enter system for the user name.


Password: Enter the password that was specified when Oracle Database XE was installed.

 Click Login.

54 | P a g e
Department of CSE, BNMIT 2010-2011
User manual

The Oracle Database XE home page appears :

Step 1:
USERNAME: SYSTEM
PASSWORD :( SET DURING ORACLE 10G XE INSTALLATION ).

Step 2 :

55 | P a g e
Department of CSE, BNMIT 2010-2011
User manual

Step 3:

CREATE NEW USER

USERNAME: VOICE1

PASSWORD: VOICE1

HIT CREATE

56 | P a g e
Department of CSE, BNMIT 2010-2011
User manual

MYSQL
INSTALL MYSQL 5.4 or HIGHER.

CONFIGURE MYSQL:-

SET ROOT PASSWORD AS 0000

ENTER THE PASSWORD 0000 AS SET DURING THE INSTALLATION.

ENTER THE FOLLOWING COMMANDS :-

CREATE DATABASE VBSS;

USE VBSS;

RUN VBSS.

57 | P a g e
Department of CSE, BNMIT 2010-2011
SCREEN SHOTS

Department of CSE, BNMIT 2010-2011


Limitations & Future Enhancements

NETBEANS IDE 7.0 RC1

58 | P a g e
Department of CSE, BNMIT 2010-2011
Screen shots

VBSS LOGIN

VBSS ADMIN LOGIN

59 | P a g e
Department of CSE, BNMIT 2010-2011
Screen shots

VBSS ADMIN SETTINGS

60 | P a g e
Department of CSE, BNMIT 2010-2011
Screen shots

VBSS USERS LOG

61 | P a g e
Department of CSE, BNMIT 2010-2011
Screen shots

FORGOT PASSWORD

TEXTURES

62 | P a g e
Department of CSE, BNMIT 2010-2011
Screen shots

VBSS HELP

63 | P a g e
Department of CSE, BNMIT 2010-2011
LIMITATIONS
&
FUTURE
ENHANCEMENTS

Department of CSE, BNMIT 2010-2011


Limitations & Future Enhancements

LIMITATIONS & FUTURE ENHANCEMENTS

LIMITATIONS

Even though VBSS can be used instead of password, which can be easily

hacked. It also has limitations:

 It matches only the pitch of the voice and not exactly the word that is spoken.

 Very sensitive to surrounding noise.

 Administrator cannot change the database username and password, its default.

 As voice technology is not advanced, VBSS has certain limitations.

FUTURE ENHANCEMENTS

Overcoming the limitations are the future enhancements.

 VBSS can be upgraded to analyze and recognize words and pitch.

 Noise reduction Microphone can be used to reduce noise in the environment.

 Ability for admin to change the database username and password.

 Our VOICE TO PHONEME ALGORITHM can be modified for more accuracy and to

overcome limitations.

65 | P a g e
Department of CSE, BNMIT 2010-2011
CONCLUSION

Department of CSE, BNMIT 2010-2011


ŽŶĐůƵƐŝŽŶ

CONCLUSION
We have designed voice based security system which authenticates the users based on
voice instead of password which can be easily hacked. It involves user interface and modules
which converts human speech into abstract representation and retrieves the same when the
user wants to login for the next time. And it checks the deviation, if it is well within the limits
access is granted otherwise will be denied. All these activities is done without the notice of the
user at the background without any user intervention.

The project “voice based security system” was developed as per the requirements and
capabilities allowed for a third party developer. It was developed using Java Development
Tool Kit on the windows platform using oracle/MySQL and NetBeans IDE using java as the
language for coding.

Towards the completion of this project an insight into voice processing in java,
debugging and the installation of the software was gained. This will not only help us in
developing future application but also ease our understanding of new platform involved. Apart
from these, the standard software development methodologies followed gave us a sound
knowledge of how quality software can be developed. An opportunity of how to work in an
organization and to effectively interact was also gained. Finally, we would once again like to
thank everyone involved behind the completion of the project.

67 | P a g e
Department of CSE, BNMIT 2010-2011
Bibliography

Department of CSE, BNMIT 2010-2011


ŝďůŝŽŐƌĂƉŚLJ

Bibliography

Books :

1. The Complete Reference JAVA seventh edition, Herbert Schildt, TATA Mc


GrawHill
2. Fundamentals of Database Systems (5th Edition), Ramez Elmasri, Sham Navathe,
PEARSON EDUCATION.
3. J2EE: The Complete Reference, Keogh , TATA Mc GrawHill

IEEE Papers:

It is based on the IEEE 2005 paper Voice-to-phoneme conversion algorithms for


the speaker-independent voice-tag applications in embedded platforms.

Websites:

1. www.netbeans.org.

2. http://download.oracle.com/javase/tutorial/sound/index.html

3. http://www.oracle.com/

4. http://www.mysql.com/

5. http://stackoverflow.com/

6. www.javabeginner.com

69 | P a g e
Department of CSE, BNMIT 2010-2011

Das könnte Ihnen auch gefallen