Reading meta and starting playback of m4a-files is very slow on Android -



Reading meta and starting playback of m4a-files is very slow on Android -

i utilize mediametadataretriever retrieve meta info m4a-files on android device. here code execute.

final mediametadataretriever mmr = new mediametadataretriever(); mmr.setdatasource(new file(root, audiofile).getabsolutepath()); string title = mmr.extractmetadata(mediametadataretriever.metadata_key_title); string album = mmr.extractmetadata(mediametadataretriever.metadata_key_album); string artist = mmr.extractmetadata(mediametadataretriever.metadata_key_artist); mmr.release();

the problem when phone call code mp3-files, fast. instance, 25 mp3-files analysed in under 900ms time.

but if phone call single m4a-file, same code requires 6 seconds execute. , slow.

another observation is, when utilize android mediaplayer mp3 file starts playing immediately, while between starting m4a-file , first sound there same 6 seconds delay.

i tried different android versions , different devices. there same issue.

is there way rid of delay?

have tried ffmpegmediametadataretriever:

final ffmpegmediametadataretriever mmr = new ffmpegmediametadataretriever(); mmr.setdatasource(new file(root, audiofile).getabsolutepath()); string title = mmr.extractmetadata(ffmpegmediametadataretriever.metadata_key_title); string album = mmr.extractmetadata(ffmpegmediametadataretriever.metadata_key_album); string artist = mmr.extractmetadata(ffmpegmediametadataretriever.metadata_key_artist); mmr.release();

android android-mediaplayer m4a

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -