I\'m trying to implement
AudioRecord (MIC) ->
PCM -> AAC Encoder
AAC -> PCM Decode
-> AudioTrack?? (SPEAKER)
with Me
I have tested with your souce. there are some points.
Bit Rate is a natural number of K, but not computer K. 64k = 64000, but not 64 * 1024
It's not recommended to write a long code that shares some variables. A. separate Encoder Thread and Decoder Thread into 2 independet classes. B. The DatagramSocket is shared by Sender and Receiver, it not good.
Enumerate Audio Format need more values. i.e. sample rates should be picked from : 8000, 11025, 22050, 44100