This application provides an
HDMI audio acquisition method based on AUDIOTRACK. The method includes: obtaining a
Java Virtual Machine instance in the
Java native interface initialization function of the native
library, obtaining a reference to the target
callback method in the
Java layer based on the
Java Virtual Machine instance, responding to the start of audio acquisition, calling the target audio acquisition method in the Native layer to initialize the
HDMI capture card and configure the corresponding acquisition parameters, acquiring the corresponding audio data from the
HDMI capture card, calling the set
callback function in the Native layer, and transmitting the audio data in real time to the target player of the Android
system running in the Java layer based on the
callback function, receiving the audio data through the target player of the Android
system, and outputting the audio data to the audio device after
resampling and
clock synchronization
processing by the target player.