¿ por que la clase AudioTrack ( android ) reproduce audio con errores?

Hola estoy desarrollando un app que reproduce el audio en vivo que se le envía desde una pc, ambos están desarrollados con java lo que hago es enviar un paquete de byte por un datagramSocket al cliente ( el app android ) los recibe y luego reproduce con la clase AudioTrack. El problema es que al reproducir el paquete de bytes se producen errores por ejemplo :

1- El audio se escucha con errores con pequeños cortes.

2- En la consola de Android studio me muestra estos errores :

>     I/AudioTrack: This process already got info. FadeIn[0] FadeOut[0] FadeInRing[0] >         Skip ramp >         Manually recycle bitmap >     W/AudioTrack: Use of stream types is deprecated for operations other than volume control >         See the documentation of AudioTrack() for what to use instead with android.media.AudioAttributes to qualify your playback use case 

Aquí adjunto el código de el emisor de audio (PC) y el receptor de audio( android )


public class PruebagrabacionAudio {          static TargetDataLine mic;         static DataLine.Info dLI = null;         //ejemplo de android         //static DatagramSocket socket;         static DatagramSocket skServer;         static int sampleRate = 16000,chanelConfig = 16,audioFormat = 2,minBufSize = 4096 ;         static boolean status = true;         static AudioFormat aF = new AudioFormat(sampleRate, chanelConfig, 1, true, false);         /**      * @param args the command line arguments      */     public static void main(String[] args) {         try{                   dLI= new DataLine.Info(TargetDataLine.class,aF);             mic = (TargetDataLine)AudioSystem.getLine(dLI);             new CapThread().start();          }catch(Exception e){          }      }      static class   CapThread extends Thread{        public void run(){            try{                  byte[] buffer = new byte[minBufSize];               System.out.println("INICIANDO EL SERVIDOR");                skServer = new DatagramSocket(8094);                 System.out.println("Esperando conexion");                DatagramPacket peticion = new DatagramPacket(buffer,buffer.length );                skServer.receive(peticion);                 int port_cliente = peticion.getPort();                 InetAddress IP_cliente = peticion.getAddress();                System.out.println("Peticion aceptada de la IP "+IP_cliente.getAddress());                DatagramPacket packet;                 mic.open(aF);                 mic.start();                 while(status){                     mic.read(buffer, 0, buffer.length);                     packet = new DatagramPacket(buffer,buffer.length,IP_cliente,port_cliente);                     skServer.send(packet);                 }             } catch (LineUnavailableException ex) {                Logger.getLogger(PruebagrabacionAudio.class.getName()).log(Level.SEVERE, null, ex);            } catch (IOException ex) {                Logger.getLogger(PruebagrabacionAudio.class.getName()).log(Level.SEVERE, null, ex);            }        }    }  } 


public class CompruebaConexcion  {     DatagramSocket dsServer ;     final int puetoServer = 8094;      final int minBufSize = 4096;     byte[] buffer = new byte[minBufSize];     InetAddress ipServer ;     AudioTrack audioTrack;     ByteArrayInputStream baiss ;     public void iniciaSocketPruebaConex(){          Thread compruebaConex = new Thread(new Runnable() {             @Override             public void run() {                 try {                      dsServer = new DatagramSocket();                    ipServer =  InetAddress.getByName(IPCONEXION);                     DatagramPacket paket = new DatagramPacket(buffer,buffer.length,ipServer,puetoServer);                     dsServer.send(paket);                     DatagramPacket paketRespuesta = new DatagramPacket(buffer,buffer.length);                     while(true){                         dsServer.receive(paketRespuesta);                         baiss = new ByteArrayInputStream(paketRespuesta.getData());                         buffer = paketRespuesta.getData();                         playAudio(buffer);                      }                 } catch (IOException e) {                     e.printStackTrace();                 }/* catch (ClassNotFoundException e) {                     e.printStackTrace();                 }*/             }         });         compruebaConex.start();     }      public void playAudio(byte buffer[]){         int  minBuff = buffer.length ;         audioTrack = new AudioTrack(AudioManager.STREAM_MUSIC,                 16000,                 AudioFormat.CHANNEL_OUT_MONO,                 AudioFormat.ENCODING_PCM_16BIT,                 minBuff,                 AudioTrack.MODE_STATIC);          audioTrack.write(buffer,0,minBuff);         audioTrack.setNotificationMarkerPosition(minBuff);         //audioTrack.setPlaybackPositionUpdateListener(this);         audioTrack.play();       }   } 

Audiotrack works, but at half the speed

Using an auditrack to play some pcm data stored in an short[].

I tried m_audioTrack.setPlaybackRate(64000) to double it, but it did only intruduced cracks.

Tho even i get told, it should be 32000 samplerate, im only getting 640 short variables in a frame (60frames per second). Since its 16 bits, is should be 320*60=19200 not 32000. I could completetly wrong, but tried it and its false too.

m_audioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, 32000, AudioFormat.CHANNEL_OUT_MONO,                 AudioFormat.ENCODING_PCM_16BIT, 1280,                 AudioTrack.MODE_STREAM); ....  m_audioTrack.setPlaybackRate(64000); m_audioTrack.write(data, 0, data.length, AudioTrack.WRITE_NON_BLOCKING); 

Il expect the stream to play the audio in normal speed, but im getting half the speed and it gets played slowed down. setPlaybackRat only results in crackling. Anyone got an idea?