我应该使用什么内容类型与 .cfa 声音文件一起使用 j2me 播放?

发布于 2024-12-01 11:41:45 字数 617 浏览 1 评论 0 原文

我使用以下代码在 j2me 中

           try
            {
        String ctype_1 = "audio/x-wav";// #LINE 1
        temp = Manager.createPlayer(this.getClass().getResourceAsStream(audioFileString),ctype_1 );
        if(temp != null){
            temp.setLoopCount(1);
            temp.realize();
            temp.prefetch() ;
            return temp;
        }
    }
    catch(Exception ex)
    {
        ex.printStackTrace();
        System.out.println("MediaException in my sound ==>"+ex);
    }

的注释 // #LINE 1 中播放声音文件,我们必须给出内容类型(在此类型适用于 .wav 文件)

我的问题是我应该给出什么内容类型声音文件.caf 扩展名。

I m using the following code for play a sound file in j2me

           try
            {
        String ctype_1 = "audio/x-wav";// #LINE 1
        temp = Manager.createPlayer(this.getClass().getResourceAsStream(audioFileString),ctype_1 );
        if(temp != null){
            temp.setLoopCount(1);
            temp.realize();
            temp.prefetch() ;
            return temp;
        }
    }
    catch(Exception ex)
    {
        ex.printStackTrace();
        System.out.println("MediaException in my sound ==>"+ex);
    }

at comment // #LINE 1 we have to give the content type (in this the type is for .wav file)

My question is that what content type i should give for the sound file .caf extension.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

就像说晚安 2024-12-08 11:41:45

AFAIK .cfa 文件不受 Java ME 支持。浏览这些文章,

MMAPI for Java ME

在 Java ME 中查找音频格式

AFAIK .cfa file isn't supported by Java ME. Go through these articles,

MMAPI for Java ME

Finding audio format in Java ME

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文