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