Thursday, 15 March 2012

How do I determine a Audio file's format when the file name doesn't include a mime type extension in Android? -



How do I determine a Audio file's format when the file name doesn't include a mime type extension in Android? -

i have extension-less file, named sake of post myaudiofile, know sound file's extension aac format(i have analysed programme named gspot), since file doesn't have extension, unable utilize of methods available in android determining mime type of file.

is there inbuilt utility method in android unaware of , lets me read header info of sound file , spit out extension or mime type of file?

i have tried mediametadataretriever , mimetypemap unsuccessfully, did miss other class can used here?

is possible using other external libraries excluding sox , ffmpeg?

i'm not sure understand problem here. mediametadataretriever is class utilize determine metadata (including mime type) of arbitrary media file. perhaps using wrong?

mediametadataretriever retriever = new mediametadataretriever(); retriever.setdatasource("file:///sdcard/filethatisaacbutdoesnthaveextension"); string mimetype = retriever.extractmetadata(mediametadataretriever.metadata_key_mimetype);

how trying utilize file? shouldn't need mime type utilize (and admittedly know mime type - audio/mp4)

android android-mediaplayer android-audiorecord android-mediascanner

No comments:

Post a Comment