-
Notifications
You must be signed in to change notification settings - Fork 1
사운드 캐싱하기
Young Jae Sim edited this page Apr 9, 2016
·
1 revision
기어 S2에서 최초 사운드 로딩 시 렉이 발생하는 문제가 있습니다. 따라서 사운드를 캐싱해 두면 좋습니다.
캐싱하는 방법은 어렵지 않습니다. 그냥 코드 최상단에 사운드를 지정해 주기만 하면 됩니다.
READY(function() {
// sound caching
SOUND({
mp3 : 'shot.mp3'
});
EVENT('rotarydetent', function(e) {
var
// sound
sound = SOUND({
mp3 : 'shot.mp3'
});
sound.play();
});
});
이제 렉이 조금 덜합니다. 다만, 사운드 재생 자체에 성능 부하가 있으므로 조금의 렉이 발생하는 것은 어쩔 수 없습니다.