为什么Android Studio无法识别.wav/.mp3文件 [英] Why does android studio not recognize .wav / .mp3 files

查看:409
本文介绍了为什么Android Studio无法识别.wav/.mp3文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将声音添加到我的项目中,但是android studio无法识别这些文件.该文件之前有一个问号图标,如果我播放该项目,则会出现以下屏幕:

I am trying to add sounds to my project, but android studio does not recognize these files. The file has a question mark icon before it and if i play the project, the following screen appears:

有什么办法解决这个问题?

any way to solve this?

推荐答案

添加到原始文件夹的任何文件都将带有'?',尽管这并不意味着Android Studio无法识别该文件.

Any file added to the raw folder will have a '?' over it, although that doesn't mean Android Studio doesn't recognize the file.

如果在将文件导入Android Studio后需要打开文件,请在弹出的注册新文件类型关联"窗口中选择"groovy",并确保在关联的应用程序中打开匹配文件"选项为在按确定"之前选择.当您选择它时,这将导致Window的Groovy应用程序打开您的mp3文件.

If you need to open the file after importing it into Android Studio, select 'groovy' in the 'Register New File Type Association' window that pops up, and make sure that the 'Open matching files in associated application' option is selected before pressing 'OK.' This will cause Window's Groovy application to open your mp3 file when you select it.

如果您不小心选择了Groovy以外的其他选项,或者忘记选择了"... associated application"选项,则可以通过以下方式撤消操作:转到文件"->设置"->关联"->文件类型"->(您选择的文件类型)-> .mp3->'-'->确定

If you accidentally select an option other than groovy, or forget to choose the '...associated application' option, you can undo your action by going File -> Settings -> "associate" -> File Types -> (the file type you selected) -> .mp3 -> '-' -> OK

稍后,当您调用 R.raw.soundFile 时,Android Studio应该会识别它.

Later, when you call R.raw.soundFile Android Studio should recognize it.

希望这会有所帮助.

这篇关于为什么Android Studio无法识别.wav/.mp3文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆