I have this code for Android, that plays a custom sound, it works fine:
AudioTrack output = new AudioTrack(AudioManager.STREAM_MUSIC, baudRate, AudioFormat.CHANNEL_OUT_MONO, AudioFormat.ENCODING_PCM_8BIT, bufferSize, AudioTrack.MODE_STATIC);
output.write(myGeneratedWaveform, 0, myGeneratedWaveform.length);
output.play();
How can I achieve the same with j2me?
I'm checking the API of Manager.createPlayer(...) but didn't find a sample code.
Any help would be apreciated.
EDIT: I have an array with a PCM encoded waveform. I wish to reproduce this with Nokia Series 40. But I conclude that there no such support for this format, just AMR. So, a library in open source to convert from PCM to AMR will be ok.