나는 android.media.midi 함께 일하고 난 이런 지연 값으로 MidiInputPort에 MIDI 데이터의 무리를 보낸다 :MidiInputPort.flush()가 Android에서 버퍼를 지우지 않는 이유는 무엇입니까?
long start = System.nanoTime();
if (messages != null)
{
for (int i = 0; i < messages.length(); i++)
{
MidiNote note = MidiHelper.parseMessageForNote(messages.getString(i));
if (note != null)
{
byte[] buffer = new byte[32];
int numBytes = 0;
int channel = 1; // MIDI channels 1-16 are encoded as 0-15.
buffer[numBytes++] = (byte) (note.action + (channel - 1));
buffer[numBytes++] = (byte) note.note;
buffer[numBytes++] = (byte) note.velocity;
long delay = note.delay * 1000000;
midiInputPort.send(buffer, 0, numBytes, start + delay);
start = start + delay;
}
}
midiInputPort.flush();
}
당신은 즉시 단지 시도 (모든 데이터를 보낸 후 나는 플러시 전화 것을 알 수 있습니다 flush()를 작동 시키려면 아무런 효과가 없습니다. 데이터가 아직 플러시되지 않은 것처럼 미디 포트로 전송됩니다. 이 기능에 대한 문서는 매우 명확하고 간단합니다. "앞으로 예정된 일정을 취소하려면 flush()를 호출하십시오." 내가 빠진이 점이 뭔가 있니? 어떤 도움을 주셔서 감사합니다.