[英]How do I know if I can play real music on Android?
I want to test the music app with automation. 我想自动化测试音乐应用程序。 However, there is no way to verify that the music actually plays. 但是,无法验证音乐是否真正在播放。 I created an app using the audio focus. 我使用音频焦点创建了一个应用程序。 I think the audio focus is not related to real play back. 我认为音频焦点与实际播放无关。 Because if it doesn't play, audio focus can hold onto the focus. 因为如果不播放,音频焦点可以保持焦点。
So, I want to create an app to confirm playback. 因此,我想创建一个应用来确认播放。 What should I do? 我该怎么办?
Make the test app listen to the microphone. 让测试应用监听麦克风。 Play some special signal (a sweep or a click of some sort) that can be easily distinguished from the noise in the recorded signal. 播放一些可以与录制信号中的噪声轻松地区分开的特殊信号(扫频或喀哒声)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.