Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

Commit

Permalink
new sheep pickup sound
Browse files Browse the repository at this point in the history
  • Loading branch information
pce committed Nov 30, 2012
1 parent 91b5228 commit 6631938
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 17 deletions.
Binary file modified src/data/sheep.ogg
Binary file not shown.
Binary file modified src/data/sheep.wav
Binary file not shown.
18 changes: 1 addition & 17 deletions src/javascript/main.js
Expand Up @@ -23,25 +23,9 @@ function rnd(min, max) {
return Math.floor((Math.random() * max) + min);
}

function audio() {
// from Modernizr.audio
var elem = document.createElement('audio'),
bool = false;
try {
if ( bool = !!elem.canPlayType ) {
bool = new Boolean(bool);
bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,'');
bool.mp3 = elem.canPlayType('audio/mpeg;') .replace(/^no$/,'');
bool.wav = elem.canPlayType('audio/wav; codecs="1"') .replace(/^no$/,'');
bool.m4a = ( elem.canPlayType('audio/x-m4a;') ||
elem.canPlayType('audio/aac;')) .replace(/^no$/,'');
}
} catch(e) { }
return bool;
}

function getExtAudio() {
if (audio().ogg) {
if ((new Audio()).canPlayType("audio/ogg; codecs=vorbis") == "probably") {
return ".ogg";
}
return ".wav";
Expand Down

0 comments on commit 6631938

Please sign in to comment.