【问题标题】:Assets. Why OpenFD depends on the type of file?资产。为什么 OpenFD 取决于文件的类型?
【发布时间】:2012-03-15 08:51:35
【问题描述】:

我将文件 alma_mater.kar 放入文件夹 assets/sounds
当我尝试获取 AssetsFileDescriptor 时,出现错误

    AssetFileDescriptor afd = this.getResources().getAssets().openFd("sounds/alma_mater.kar");
]


当我把重命名的文件 alma_mater.mid ,没有错误。 为什么?
Eclipse 上基于 Google API [Android 2.2] 的项目
我的设备是 LG P500(擎天柱)更新到 V20d(Android 2.3.3)

03-15 10:23:15.959: W/System.err(32076): java.io.FileNotFoundException:此文件无法作为文件打开 描述符;它可能被压缩了
03-15 10:23:15.959: W / System.err(32076):在 android.content.res.AssetManager.openAssetFd(Native Method)
03-15 10:23:15.959:W/System.err(32076):在 android.content.res.AssetManager.openFd(AssetManager.java:330)

【问题讨论】:

    标签: android midi assets


    【解决方案1】:

    根据快速谷歌搜索和您的异常内容,我怀疑 Android 将 KAR 文件视为 "keep-it archive" files 而不是 MIDI 文件。是否有任何理由不能将其命名为 .mid 并将其解析为 KAR 文件?

    【讨论】:

      猜你喜欢
      • 2014-09-29
      • 1970-01-01
      • 2011-08-11
      • 1970-01-01
      • 2019-07-26
      • 2011-03-01
      • 1970-01-01
      • 2013-08-25
      • 1970-01-01
      相关资源
      最近更新 更多