Creating a WAV file from raw PCM data using the Android SDK

OK, I’ve got this figured out. This post was crucial in helping me: http://computermusicblog.com/blog/2008/08/29/reading-and-writing-wav-files-in-java Basically, I used ByteArrayOutputStream to write the raw PCM data from AudioRecord, which then lets me get the byte array and its size when the process is done. I can then use that data in conjunction with the SampleRate, BitRate, and … Read more

PCM -> AAC (Encoder) -> PCM(Decoder) in real-time with correct optimization

After testing this is what I came up with from modifying your code: package com.example.app; import android.app.Activity; import android.media.AudioManager; import android.media.MediaCodecInfo; import android.media.MediaFormat; import android.os.Bundle; import android.media.AudioFormat; import android.media.AudioRecord; import android.media.AudioTrack; import android.media.MediaCodec; import android.media.MediaRecorder.AudioSource; import android.util.Log; import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; import java.net.SocketAddress; import java.net.SocketException; import java.nio.ByteBuffer; public class MainActivity extends … Read more