android volume gain AudioTrack DatagramPacket <p>I need help to apply a volume gain on audio stream to increase the volume output of device.</p> <p>Here is some code of my app:</p> <pre><code>private static final int SAMPLE_RATE = 8000; // Hertz private static final int BUF_SIZE = 372; //Bytes </code></pre> <p>...</p> <pre><code>AudioTrack track = new AudioTrack(AudioManager.STREAM_MUSIC, SAMPLE_RATE, AudioFormat.CHANNEL_OUT_MONO, AudioFormat.ENCODING_PCM_16BIT, BUF_SIZE, AudioTrack.MODE_STREAM); </code></pre> <p>...</p> <pre><code>DatagramPacket packet = new DatagramPacket(buf, BUF_SIZE); socket.receive(packet); </code></pre> <p>...</p> <pre><code>track.write(packet.getData(), 0, packet.getLength()); </code></pre> <p>Someone can help me?</p> <p>Thanks in advance.</p>