I am making a project in java without using any third party libraries. I have successfully established an udp connection using the DatagramSocket
. Then I started communicating using the sip protocol. I have successfully passed the registration and invitation stage. This is how I got the host and port to which the audio data stream will be transmitted. Then I successfully established a connection to the new address using DatagramSocket
. And i began to receive data in the form of rtp packets. I managed to successfully get the following data from the package: Payload type (in my case 8 or PCMA), Timestamp, Sequence number and payload data (byte array). Now I want to process the received data so that I can use it in the future. That is, save to disk, convert to any other audio format at will, play audio, and so on. I can't figure out what exactly needs to be done with the byte array received from the packet.
Let's say for a start I want to save the received data to a file in the AudioFormat.Encoding.PCM_FLOAT
8000.0 Hz, 8 bit, mono, 160 bytes / frame format. What do I need to do for this?