gpt4 book ai didi

android - MediaPlayer 认为 aac* 音频文件是视频文件?

转载 作者:太空宇宙 更新时间:2023-11-03 10:26:11 29 4
gpt4 key购买 nike

代码运行正常,但我怎么会得到这个错误日志

错误日志:

08-28 08:44:24.281: E/MediaPlayer(32454): mOnVideoSizeChangedListener is null. Failed to send MEDIA_SET_VIDEO_SIZE message.

我尝试将音频文件转换为不同的格式设置听众等等......我真的需要帮助。她是整个 MediaPlayer 日志:

日志:

08-28 08:44:24.121: V/MediaPlayer-JNI(32454): native_setup
08-28 08:44:24.131: V/MediaPlayer(32454): constructor
08-28 08:44:24.146: D/dalvikvm(32454): GC_CONCURRENT freed 193K, 4% free 9397K/9735K, paused 2ms+2ms
08-28 08:44:24.146: V/MediaPlayer-JNI(32454): native_finalize
08-28 08:44:24.146: V/MediaPlayer-JNI(32454): release
08-28 08:44:24.146: V/MediaPlayer-JNI(32454): native_finalize
08-28 08:44:24.146: V/MediaPlayer-JNI(32454): release
08-28 08:44:24.186: V/MediaPlayer(32454): setListener
08-28 08:44:24.186: V/MediaPlayer-JNI(32454): setDataSourceFD: fd 47
08-28 08:44:24.186: V/MediaPlayer(32454): setDataSource(47, 740, 14519)
08-28 08:44:24.216: V/MediaPlayer(32454): setVideoSurfaceTexture
08-28 08:44:24.216: V/MediaPlayer(32454): prepare
08-28 08:44:24.246: V/MediaPlayer(32454): message received msg=5, ext1=0, ext2=0
08-28 08:44:24.246: V/MediaPlayer(32454): New video size 0 x 0
08-28 08:44:24.246: V/MediaPlayer(32454): callback application
08-28 08:44:24.246: V/MediaPlayer(32454): back from callback
08-28 08:44:24.246: V/MediaPlayer(32454): message received msg=1, ext1=0, ext2=0
08-28 08:44:24.246: V/MediaPlayer(32454): prepared
08-28 08:44:24.246: V/MediaPlayer(32454): signal application thread
08-28 08:44:24.246: V/MediaPlayer(32454): callback application
08-28 08:44:24.246: V/MediaPlayer(32454): back from callback
08-28 08:44:24.246: V/MediaPlayer(32454): prepare complete - status=0
08-28 08:44:24.246: V/MediaPlayer-JNI(32454): start
08-28 08:44:24.246: V/MediaPlayer(32454): start
08-28 08:44:24.281: E/MediaPlayer(32454): mOnVideoSizeChangedListener is null. Failed to send MEDIA_SET_VIDEO_SIZE message.
08-28 08:44:24.281: I/MediaPlayer(32454): Don't send intent. msg.arg1 = 0, msg.arg2 = 0
08-28 08:44:24.281: E/MediaPlayer(32454): mOnPreparedListener is null. Failed to send MEDIA_PREPARED message.
08-28 08:44:25.661: V/MediaPlayer(32454): message received msg=2, ext1=0, ext2=0
08-28 08:44:25.661: V/MediaPlayer(32454): playback complete
08-28 08:44:25.661: V/MediaPlayer(32454): callback application
08-28 08:44:25.661: V/MediaPlayer(32454): back from callback
08-28 08:44:25.666: E/MediaPlayer(32454): mOnCompletionListener is null. Failed to send MEDIA_PLAYBACK_COMPLETE message.
08-28 08:49:24.211: V/MediaPlayer-JNI(32454): release
08-28 08:49:24.211: V/MediaPlayer(32454): setListener
08-28 08:49:24.211: V/MediaPlayer(32454): disconnect
08-28 08:49:24.226: V/MediaPlayer(32454): destructor
08-28 08:49:24.226: V/MediaPlayer(32454): disconnect

和 Java 代码。

Java代码:

 public class MainActivity extends Activity {
MediaPlayer TestingAudio;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Initialization();
DoStuff();
}

private void Initialization() {
setContentView(R.layout.activity_main);
TestingAudio = MediaPlayer.create(MainActivity.this, R.raw.samlagnin);
}

private void DoStuff() {
TestingAudio.start();
}

@Override
protected void onPause() {
super.onPause();
TestingAudio.release();
TestingAudio = null;
}

最佳答案

我设法通过附加一些空的监听器来消除错误。请参阅 setOnPreparedListener() 和类似方法,网址为 http://developer.android.com/reference/android/media/MediaPlayer.html

关于android - MediaPlayer 认为 aac* 音频文件是视频文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12156162/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com