简体   繁体   English

如何在Android中压缩音频和图像文件?

[英]How to compress audio and image files in Android?

I store my audio files in the raw folder and image files in drawable . 我将我的音频文件存储在raw文件夹中,将图像文件存储在drawable Each audio file takes about 300kb, images 50-100kb. 每个音频文件大约300kb,图像50-100kb。 The final version of the app will contain about 300 of audio files and about 1000 images. 该应用程序的最终版本将包含大约300个音频文件和大约1000个图像。 My question is how to compress them as much as possible? 我的问题是如何尽可能地压缩它们? The app should work offline so I can't store the files somewhere in web. 该应用程序应该脱机工作,因此我无法将文件存储在Web中的某个位置。

In the Android Documentation you can read the APK is a compress format, so you dont need to compress all images, maybe you need to save the images and sound in SD CARD. 在Android文档中,您可以阅读APK是压缩格式,因此您不需要压缩所有图像,也许您需要将图像和声音保存在SD卡中。

Can you imagine compress and decompress the image and sound every moment you need? 你能想象在你需要的每一刻压缩和解压缩图像和声音吗? maybe the performance no will be the best. 也许性能不是最好的。 Can you imagine the videogames? 你能想象出电子游戏吗? They have a lot of resource, the user should know if prefered download the resources of save in memory or SD data. 它们有很多资源,用户应该知道是否首选下载保存在内存或SD数据中的资源。

compress Image:'Bitmap bitmap = Bitmap.createScaledBitmap(capturedImage,width,height,true);'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM