CS 290: VoIP Project By Rudy Sevile. Summary AudioRecord AudioTrack UDP TCP Eclipse and LogCat.

8
CS 290: VoIP Project By Rudy Sevile

Transcript of CS 290: VoIP Project By Rudy Sevile. Summary AudioRecord AudioTrack UDP TCP Eclipse and LogCat.

Page 1: CS 290: VoIP Project By Rudy Sevile. Summary AudioRecord AudioTrack UDP TCP Eclipse and LogCat.

CS 290: VoIP Project

By Rudy Sevile

Page 2: CS 290: VoIP Project By Rudy Sevile. Summary AudioRecord AudioTrack UDP TCP Eclipse and LogCat.

Summary

• AudioRecord

• AudioTrack

• UDP

• TCP

• Eclipse and LogCat

Page 3: CS 290: VoIP Project By Rudy Sevile. Summary AudioRecord AudioTrack UDP TCP Eclipse and LogCat.

AudioRecord

• Use this class to record your voice from the microphone.

• Use startRecording() to start the recording and then “pull” data from the microphone using read(byte[] buffer, int offsetInBytes, int sizeInBytes).

• Call stop() to stop the recorder and release() to release the resources.

Page 4: CS 290: VoIP Project By Rudy Sevile. Summary AudioRecord AudioTrack UDP TCP Eclipse and LogCat.

AudioTrack

• Allows you to play audio.• As with the AudioRecord, a buffer is set.• Use play() to start playing and audio track,

then send data to be played with write(byte[] buffer, int offsetInBytes, int sizeInBytes).

• Call stop() to stop the player and release() to release the resources.

Page 5: CS 290: VoIP Project By Rudy Sevile. Summary AudioRecord AudioTrack UDP TCP Eclipse and LogCat.

UDP

• When implementing UDP, you can rely on the DatagramSocket class to make a connection. This class sends and receives DatagramPacket.

• Create a new socket using the DatagramSocket class then create a packet using the DatagramPacket class. The socket has a send() that takes a DatagramPacket as argument. The method receive() allows receiving DatagramPacket.

Page 6: CS 290: VoIP Project By Rudy Sevile. Summary AudioRecord AudioTrack UDP TCP Eclipse and LogCat.

TCP

• Use the ServerSocket class to wait on TCP connection.

• Once a ServerSocket is created, use accept(). It will wait for an incoming connection and return a socket when one arrives.

• Use a Socket to establish a TCP connection. The connection can occur in the constructor if you pass enough parameters, or through the connect() method.

Page 7: CS 290: VoIP Project By Rudy Sevile. Summary AudioRecord AudioTrack UDP TCP Eclipse and LogCat.

Eclipse and LogCat

Page 8: CS 290: VoIP Project By Rudy Sevile. Summary AudioRecord AudioTrack UDP TCP Eclipse and LogCat.

References

Some links that you may find useful:

• Hello World:http://developer.android.com/resources/tutorials/hello-world.html

• Android Library:http://developer.android.com/reference/packages.html

• Sample code examples:http://developer.android.com/resources/samples/index.html