è¯ããªã
http://mohayonao.herokuapp.com/d
ææãé¸ããæããããã©ãããããããªã©ã³ãã®ãã¤ã«ãã¦ã³ãã¼ãæ©è½ãã¤ããã22.05KHz,15ç§,ã¹ãã¬ãªã®wavãã¼ã¿ãåãããWebWorkerã使ã£ã¦ããã¯ã°ã©ã¦ã³ãã§wavdataãçæãã¦ãã¡ã¤ã³ã¹ã¬ããã®å´ã§ãã¼ã¿ã¸ã®ãªã³ã¯ href="data:audio/wav;base64,"+btoa(wavdata) ãã¤ãã¦ããã ããæåã¯Workerå´ã§å ¨é¨ã®ãã¼ã¿ãã¤ãã£ã¦postMessageãã¦ãããã©ãåå²ãã¦postMessageãã¦æå¾ã«ã¡ã¤ã³ã¹ã¬ããå´ã§ join ããã»ããæ©ãã£ã½ãããã¨ããã¾ã巨大ãªãã¼ã¿ãå¦çãããã¨ããã¨ãã©ã¦ã¶ãæ»ã¬ãã©ã®ãããã§æ»ã¬ãã¯ãã¶ãç°å¢ã«ããã®ã ãããã©ãããåãããªãã
å³ã¯ãªãã¯ã§ä¿åãã¦ãã ããã£ã¦åºãã¦ãããã©ãæ¡å¼µåãæå®ã§ããªããä½ãè¾ããã¯ãªãã¯ããããã¦ã³ãã¼ãããããã«ããããã©ãããæ¹ãåãããªãã
çµå±ãChrome, FireFox, Opera, iPhone ã«å¯¾å¿ããããã©ãããããããæ¹ãéãã®ã¯è¯ããªãã¨æãã
- Chrome -> Web Audio API
- FireFox -> Audio Data API
- Opera -> ãã©ã¦ã¶ã§ãªã¢ã«ã¿ã¤ã wavçæ
- iPhone -> ãµã¼ãã¼ã§wavçæ
ä¸ã®3ã¤ã«ã¤ãã¦ã¯ã¤ã³ã¿ã¼ãã§ã¤ã¹ãä½ã£ã¦ããã®ã§ãé³ãçæããé¨åã ãæ¸ãã°è¯ãããã«ãã¦ããã®ã ãã©ããã¨ãã°Web Audio APIã®è¤éãªæ©è½ã¨ãã¯ä½¿ããªãã¦ãã¨ãã§ã¯ãå¦çãèªåã§æ¸ããªãã¨ãããªãã
ãã¨ãµã³ããªã³ã°ãã¼ã¿ã使ãããå ´åãããããã§ç°ãªã£ã¦ãããæçµçã«1ãµã³ãã«ãã¨ã®æ°å¤ã®é åã欲ããã®ã ãã©ã
Chrome -> ajaxã§binaryåå¾ -> AudioContext.decodeAudioData ã§ãã¼ã¿åå¾
ãâ» åä¸ãã¡ã¤ã³ã Access-Control-Allow-Origin: ããªãã¨ã»ãã¥ãªãã£ã¨ã©ã¼
FireFox -> ajaxã§binaryåå¾ -> volume 0 ã§åç -> MozAudioAvailable ã§ãã¼ã¿åå¾
ãâ» åä¸ãã¡ã¤ã³ã§ãªãã¨ã»ãã¥ãªãã£ã¨ã©ã¼ãä¸ååçããªãã¨ãããªãï¼ï¼ï¼
Opera -> base64ã¨ã³ã³ã¼ãããããã¹ããã¡ã¤ã«ã ajax ã§åå¾ -> å¤æ
ãâ» ã ãã
è¯ããªãã