本文介绍了MediaPlayer的认为AAC *音频文件是视频文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在code运行良好,但我是不可能歌厅这个埃罗日志

埃罗日志:

  8月8日至28日:44:24.281:E / MediaPlayer的(32454):mOnVideoSizeChangedListener为空。发送失败MEDIA_SET_VIDEO_SIZE消息。

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

日志:

  8月8日至28日:44:24.121:V / MediaPlayer的-JNI(32454):native_setup
8月8日至28日:44:24.131:V / MediaPlayer的(32454):构造
8月8日至28日:44:24.146:D / dalvikvm(32454):GC_CONCURRENT释放193K,4%免​​费9397K / 9735K,暂停2MS + 2ms的
8月8日至28日:44:24.146:V / MediaPlayer的-JNI(32454):native_finalize
8月8日至28日:44:24.146:V / MediaPlayer的-JNI(32454)发布
8月8日至28日:44:24.146:V / MediaPlayer的-JNI(32454):native_finalize
8月8日至28日:44:24.146:V / MediaPlayer的-JNI(32454)发布
8月8日至28日:44:24.186:V / MediaPlayer的(32454):使用setListener
8月8日至28日:44:24.186:V / MediaPlayer的-JNI(32454):setDataSourceFD:FD 47
8月8日至28日:44:24.186:V / MediaPlayer的(32454)的setDataSource(47,740,14519)
8月8日至28日:44:24.216:V / MediaPlayer的(32454):setVideoSurfaceTexture
8月8日至28日:44:24.216:V / MediaPlayer的(32454):prepare
8月8日至28日:44:24.246:V / MediaPlayer的(32454):收到的消息味精= 5,外部1 = 0,EXT2 = 0
8月8日至28日:44:24.246:V / MediaPlayer的(32454):新的视频大小为0×0
8月8日至28日:44:24.246:V / MediaPlayer的(32454):回调应用
8月8日至28日:44:24.246:V / MediaPlayer的(32454):从执行回调
8月8日至28日:44:24.246:V / MediaPlayer的(32454):收到的消息味精= 1,外部1 = 0,EXT2 = 0
8月8日至28日:44:24.246:V / MediaPlayer的(32454):prepared
8月8日至28日:44:24.246:V / MediaPlayer的(32454):信号应用程序线程
8月8日至28日:44:24.246:V / MediaPlayer的(32454):回调应用
8月8日至28日:44:24.246:V / MediaPlayer的(32454):从执行回调
8月8日至28日:44:24.246:V / MediaPlayer的(32454):prepare完成 - 状态= 0
8月8日至28日:44:24.246:V / MediaPlayer的-JNI(32454):启动
8月8日至28日:44:24.246:V / MediaPlayer的(32454):启动
8月8日至28日:44:24.281:E / MediaPlayer的(32454):mOnVideoSizeChangedListener为空。发送失败MEDIA_SET_VIDEO_SIZE消息。
8月8日至28日:44:24.281:I / MediaPlayer的(32454):不要发送意图。 msg.arg1 = 0,msg.arg2 = 0
8月8日至28日:44:24.281:E / MediaPlayer的(32454):周一至preparedListener为空。发送失败MEDIA_ prePARED消息。
8月8日至28日:44:25.661:V / MediaPlayer的(32454):收到的消息味精= 2,外部1 = 0,EXT2 = 0
8月8日至28日:44:25.661:V / MediaPlayer的(32454):完整播放
8月8日至28日:44:25.661:V / MediaPlayer的(32454):回调应用
8月8日至28日:44:25.661:V / MediaPlayer的(32454):从执行回调
8月8日至28日:44:25.666:E / MediaPlayer的(32454):mOnCompletionListener为空。发送失败MEDIA_PLAYBACK_COMPLETE消息。
8月8日至28日:49:24.211:V / MediaPlayer的-JNI(32454)发布
8月8日至28日:49:24.211:V / MediaPlayer的(32454):使用setListener
8月8日至28日:49:24.211:V / MediaPlayer的(32454):断开
8月8日至28日:49:24.226:V / MediaPlayer的(32454):析构函数
8月8日至28日:49:24.226:V / MediaPlayer的(32454):断开

和Java的code。

Java的code:

 公共类MainActivity延伸活动{
    MediaPlayer的TestingAudio;
    @覆盖
    公共无效的onCreate(捆绑savedInstanceState){
        super.onCreate(savedInstanceState);
        初始化();
        DoStuff();
    }    私人无效初始化(){
        的setContentView(R.layout.activity_main);
        TestingAudio = MediaPlayer.create(MainActivity.this,R.raw.samlagnin);
    }    私人无效DoStuff(){
        TestingAudio.start();
    }    @覆盖
    保护无效的onPause(){
        super.onPause();
        TestingAudio.release();
        TestingAudio = NULL;
    }


解决方案

我设法通过附加一些空听众摆脱错误的。塞顿见preparedListener()和similiar方法在

The code runs fine but way am I geting this Erro log

Erro log:

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

I try to convert the audio file to different format set up listeners and so on ...I really need a help with this one. Her is the whole MediaPlayer Log:

Log:

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

And Java code.

Java code:

 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;
    }
解决方案

I managed to get rid of the errors by attaching some empty listeners. See setOnPreparedListener() and similiar methods at http://developer.android.com/reference/android/media/MediaPlayer.html

这篇关于MediaPlayer的认为AAC *音频文件是视频文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 13:41