ios - How to use AudioFileStreamSeek with stream file? -


i use audiofilestream play aac music online. when user try seek, need call audiofilestreamseek know offset of stream file need seek to, because aac vbr music format, cann't know offset without audiofilestreamseek.

"after call function, parser assumes next data passed audiofilestreamparsebytes function starts byte offset returned in outabsolutebyteoffset parameter." says documents.

what do if find not have data yet need seek after called audiofilestreamseek? thing can continue parse bytes without seek. in sometime music stop sound , think because break promise give target data in right offset of file.

ok question is: if want seek time stamp 2:28, how target file offset without call audiofilestreamseek?

raw aac without container not seekable.

the best thing can needle-drop. if know time length of file , know time want seek to, divide file bytes proportionally , close. (the codec may hiccup bit this, re-sync itself.)

another common option have server-side create text file or provides offsets in file you. more work worth wrap aac in mp4 container , solve problem.


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -

matlab - How to equate a structure array to structure array -