Java Based Voice Recognition System


This Java based Voice recognition system project gives a solution developed to communicate between different users using both voice and message. It is an application that provides a good user interface with all the facilities of a chat and voice application. This resource includes requirements, hard requirements and java code.

System Requirement Specification:


Software Requirements:

Operating System: Windows 2000 Server/ Windows XP
Language Used: J2SDK 1.4

Hardware Requirements:

System Type: IBM compatible PC with 1GHz
RAM: 512MB
Cache: 512KB
Storage: 120GB

JAVA Code


The programming details for the client and server have been explained in this section. Initially each appliance creates two threads for the client and server as given below.


PrintThread thread1, thread2;
thread1=new PrintThread("Port_listener");
thread2=new PrintThread("Mic_listener");
thread1.start();
thread2.start();


Individual threads now open their respective target and source audio ports.


Mixer.Info[] mixinfo=AudioSystem.getMixerInfo();
int numberOfMixers=mixinfo,length;

Mixer JavaMixerSource=AudioSystem.getMixer(mixinfo[0]);
Mixer JavaMixerSource=AudioSystem.getMixer(mixinfo[1]);

Line.Info[] targetport=JavaMixerTarget.getTagetLineInfo();
Line.Info[] sourceport=JavaMixerSource.getSourceLineInfo();


Next these threads follow the following four significant steps to establish and complete a connection.

The Server side would follow these steps:

1. Create a socket.
2. Listen for incoming connections from clients.
3. Accept the client connection.
4. Send and receive information.

The java flow is as follows:


server = new ServerSocket(6600,100);
Connection = server.accept();
output = new DataOutputStream(Connection.getOutputStream());
output.flush();
input = new DataInputStream(Connection.getInputStream());
enter.setEnabled(true);


In the case of client, these steps are followed:

1. Create a socket.
2. Specify the address and services port of the server program.
3. Establish the connection with the server.
4. Send and receive information.

The Java flow is as follows:


client = new Socket(InetAddress.getByName("128.227.80.43"),7700);
output = new DataOutputStream(client.getOutputStream());
output.flush();
input = new DataInputStream(client.getInputStream());
enter.setEnabled(true);


Only steps two and three are different. depending on it's a client or server application. once the socket are bound to their respective client and server, the actual audio ports are opened for voice access.


captureFormat = new AudioFormat(8000,16,1,true,true);


This opens the target port.


TargetDataLine.Info targetInfo = new DataLine.Info(TargetDataLine.class,captureFormat);


TargetDataLine targetLine = (TargetDataLine) JavaMixerTarget.getLine(targetInfo);
targetLine.open(captureFormat);


This opens the source port.


DataLine.Info sourceInfo = new DataLine.Info(SourceDataLine.class, captureFormat);
SourceDataLine sourceLine = (SourceDataLine) JavaMixerSource.getLine(sourceInfo);
sourceLine.open();


After this is done each application is ready for bi-directional communication of voice data.


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: