// ainf
events.add(new MfiEvent(new AinfMessage(false, 1, new AinfMessage.AudioInfo(0x81, new byte[] { 0x10, 0x08, 0x10, 0x10, 0x08, 0x10 })), 0l));
// audio data
AudioEngine audioEngine = Factory.getAudioEngine(0x81);
byte[] adpcm = audioEngine.encode(bits, channels, data);
AdpmMessage adpmMessage = new AdpmMessage(sampleRate / 1000, bits, false, channels);
AudioDataMessage audioData = new AudioDataMessage(AudioDataMessage.FORMAT_ADPCM_TYPE2, 0x00, adpmMessage);
audioData.setData(adpcm);
events.add(new MfiEvent(audioData, 0l));