I want to program sounds on Android but I can not. I tried the java sound API but Android studio does not recognize it. I want to use MIDI too. I know it has the android.media.midi package but it only works for android versions above 23. I want a solution for all versions. Can anyone help me?
Thank you all for your attention. The code I want to do is below:
ShortMessage myMsg = new ShortMessage();
// Play the note Middle C (60) moderately loud
// (velocity = 93)on channel 4 (zero-based).
myMsg.setMessage(ShortMessage.NOTE_ON, 4, 60, 93);
Synthesizer synth = null;
synth = MidiSystem.getSynthesizer();
Receiver synthRcvr = null;
synthRcvr = synth.getReceiver();
synthRcvr.send(myMsg, -1); // -1 means no time stamp
That is, I want to edit MIDI messages. What I do not understand is why Android Studio does not recognize the Java Sound API (which I'm using). Anybody know? Hi Márcio Oliveira. About the library you posted I think this is incomplete. There is, for example, no file ShortMessage.java.