【问题标题】:Playback for AMR file format播放 AMR 文件格式
【发布时间】:2012-08-17 08:01:25
【问题描述】:

当我尝试使用 AMR 文件格式播放曲目时。它会发出警告

权限失败:android.permission.ALLOW_ANY_CODEC_FOR_PLAYBACK

来自 libOpenSLES 的错误

AudioSfDecoder::onPrepare: 找不到支持的音轨。

我尝试在清单文件中设置权限。

    <!-- Allows an application to use any media decoder when decoding for playback
         @hide -->
    <permission android:name="android.permission.ALLOW_ANY_CODEC_FOR_PLAYBACK"
         android:protectionLevel="signatureOrSystem"
         android:label="@string/permlab_anyCodecForPlayback"
         android:description="@string/permdesc_anyCodecForPlayback" />

但仍然抛出同样的错误。

我是否正确设置了权限? 谁能帮帮我,我错过了什么。

【问题讨论】:

标签: android android-ndk amr


【解决方案1】:

许多设备上的 NDK 不支持 AMR。 您可以使用外部 AMR 库。 使用 PCM 录音机/播放器并使用opencore-amr 手动编码和解码。

这对我来说很好。

关于您的权限问题:

android.permission.ALLOW_ANY_CODEC_FOR_PLAYBACK

没有官方许可,为什么在这里使用它? 我所知道的 Android 上没有编解码器相关的权限。

重要的是只有Record_Audio 用于麦克风访问。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多