Posts: 5
Joined: Fri Nov 02, 2018 7:02 am


Postby magpa1 » Fri Nov 09, 2018 6:43 am

I'd like to hear in my telefone the input from microphone attached to ADC of ESP32, but the sound is very noicy.
I try the code in Internet : ... e#comments and I build the server on android telephone as following showed:

Code: Select all

  serverSocket = new ServerSocket(socketServerPORT);
  Socket socket = serverSocket.accept();
  AudioTrack at = new AudioTrack(AudioManager.STREAM_MUSIC, 8000, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, minBufferSize, AudioTrack.MODE_STREAM);

   DataInputStream dis = new DataInputStream(socket.getInputStream());
   while ((i =, 0, minBufferSize)) > -1)
      at.write(s, 0, i);
I modified also the at.write to pronunce instead bytes the short converting byte[] to short[], but it doesn't become better.

Besides noicy the problem is the sound starts almost intellegible and via via worst and become only rumors.

Please somebody can give me an help. Thanks

Return to “ESP32 Arduino”

Who is online

Users browsing this forum: No registered users and 12 guests