| In recent years,more and more devices use the Android operating system,especially terminal devices such as vehicles,TVs,and mobile phones,and users have higher demands for professional audio.However,the existing Android system cannot well support a single audio device and multiple devices to input or output at the same time,and the delay in audio playback and recording is also high,which cannot meet the needs of audio software and virtual audio.This paper proposes a low-latency audio algorithm based on Android,which provides a solution to the delay problem; at the same time,this paper also proposes a dynamic routing algorithm based on Android,which can well support the simultaneous use of multiple devices and the one-to-many of a single device use function.Finally,this paper designs and develops an Android-based audio effect system,which realizes the comprehensive verification and practice of the above algorithms.1)Android-based low-latency audio algorithm.In order to solve the delay problem of Android’s native audio recording and playback,this paper proposes an Android-based low-latency audio algorithm.According to different delay requirements,this paper proposes three different audio channels based on different system layers of Android.By inserting and extracting frames from the content of the current audio stream buffer,the XRUN event of the audio stream is greatly reduced,and the solution Solved the noise problem caused by CPU jitter.Finally,we have tested that the minimum delay of playback can reach 2 ~ 5ms,and the minimum delay of recording and playback can reach below 30 ms.2)Android-based dynamic audio routing algorithm.The Android native system has poor support for the simultaneous use of a single audio device and the simultaneous use and switching of multiple devices.This paper proposes a dynamic audio routing algorithm based on Android,which can dynamically support the switching of different physical peripherals.A comprehensive solution is proposed for audio device selection,multi-opening,switching,simultaneous recording of single sound card,and simultaneous recording of multiple sound cards.At the same time,an audio avoidance strategy is proposed to avoid the impact of low-level device switching on upper-level applications.Finally,this paper uses the Oboe Tester tool to verify the algorithm,and the audio device switching can achieve a seamless state,which proves the effectiveness of the algorithm in this paper.3)Android-based audio effect system.Since part of the audio stream is input and output through our newly added audio channel,the audio effect processing module of the system is bypassed at the software level,and the audio effect processing chip is even bypassed at the hardware level to achieve lower audio delay,so this paper designs and develops an audio effector system to obtain better sound quality.A good solution has been proposed for both the user side and the development side,and a comprehensive practice and application has been carried out in combination with the above-mentioned low-latency algorithm and dynamic routing algorithm content. |