5

I searched and found that html5 does not support directly storing audio. I will convert audios to base64 strings and then I will store in the local storage.

I am developing a html5 audio player application with jplayer. I have audios in the server and I need to store them in the local storage, so I need to download audio files with javascript. Is there way to download audio files with javascript? Any help would be appreciate.

Pointy
  • 405,095
  • 59
  • 585
  • 614
Bahri Gökcan
  • 980
  • 3
  • 12
  • 20
  • Safari does local audio storage http://developer.apple.com/library/safari/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/Introduction/Introduction.html – Lloyd Dec 03 '11 at 22:07
  • I could not find how safari supports storing audio in local storage. Can you give exact section that explains it? – Bahri Gökcan Dec 07 '11 at 16:09
  • how's it going? Cracked it using Offline Application Cache? I'll be needing this functionality soon, too.. – Lloyd Dec 13 '11 at 15:29
  • Related issue http://stackoverflow.com/questions/1612116/html5-local-storage-of-audio-element-source-is-it-possible – Mike Gifford Aug 08 '14 at 18:18

2 Answers2

5

Local storage tends to be limited in size (5mb ish? can't find a reference) so this is unlikely to work well.

You might be able to look in to using the HTML5 AppCache or File system API.

AshleysBrain
  • 22,335
  • 15
  • 88
  • 124
4

You could use the HTML5 Offline Application Cache in Safari / Webkit.

Use the offline application cache to store HTML, JavaScript, CSS, and media resources locally, to create web-based applications that work even when a returning user is not connected to the Internet.

Lloyd
  • 8,204
  • 2
  • 38
  • 53