I’m using IndexedDB for storing images and MP3 files as binary arrays but it doesn’t seem to be blazingly fast. Reading one MP3 file takes about 0.5-1 sec and it’s actually quite slow compared to streaming from server where delay is not noticeable. Any idea if it’s possible to stream data from IndexedDB or store file in two parts and then “stream” second part into already existing blob?
Asked
Active
Viewed 891 times
5
-
Have you try filesystem api? It is supporr to be for streaming I believe. Indexeddb is transactional and streaming or even partial read is not possible. – Kyaw Tun Dec 28 '13 at 15:12
-
how about support? It seems to be really poor. In chrome I can just play array buffer so it's not problem here. Problem comes with browser not supporting web audio api like IE or linux Opera (12.60) :C – Lapsio Dec 29 '13 at 04:04
-
1my findings tell me that changing buffer used for blob doesn't work so I needed to just replace URL of media element. Sux a bit but oh well... browsers without web audio api suck too xD – Lapsio Dec 29 '13 at 04:06
-
You should paste here your code which read file from indexedDB. – cuixiping Nov 01 '15 at 12:51
-
Did you ever work this out? I'm seeing the same issue (5-10s for a 1mb file via indexed storage) which seems crazy slow for reading a local file. – griffin2000 Oct 04 '18 at 17:49
-
I wanted to use IndexDB to prevent dumping the object to JSON. But it seems that in IndexDB performance is just as bad. So maybe IndexDB converts objects to JSON before storing ? :-\ – andrew.fox Jun 15 '21 at 14:29