Skip to content

Commit

Permalink
Issue #1 added utility to create sound array
Browse files Browse the repository at this point in the history
  • Loading branch information
thompson318 committed Nov 18, 2022
1 parent 9581361 commit 90d1b14
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 3 deletions.
88 changes: 85 additions & 3 deletions scripts/sounds.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,91 @@
const soundFiles = 43
const allsounds = []
const sounds_00 = ['sounds/00_panned.mp3', 'sounds/ulysses_624_pico.mp3']

const sounds_00 = [ 'sounds/00_panned.mp3', 'sounds/00_st.mp3' ]
allsounds.push(sounds_00)

const sounds_01 = [ 'sounds/01_panned.mp3' ]
allsounds.push(sounds_01)
const sounds_02 = [ 'sounds/02_panned.mp3' ]
allsounds.push(sounds_02)
const sounds_03 = [ 'sounds/03_panned.mp3' ]
allsounds.push(sounds_03)
const sounds_04 = [ 'sounds/04_panned.mp3' ]
allsounds.push(sounds_04)
const sounds_05 = [ 'sounds/05_panned.mp3' ]
allsounds.push(sounds_05)
const sounds_06 = [ 'sounds/06_panned.mp3' ]
allsounds.push(sounds_06)
const sounds_07 = [ 'sounds/07_panned.mp3' ]
allsounds.push(sounds_07)
const sounds_08 = [ 'sounds/08_panned.mp3' ]
allsounds.push(sounds_08)
const sounds_09 = [ 'sounds/09_panned.mp3' ]
allsounds.push(sounds_09)
const sounds_10 = [ 'sounds/10_panned.mp3' ]
allsounds.push(sounds_10)
const sounds_11 = [ 'sounds/11_panned.mp3' ]
allsounds.push(sounds_11)
const sounds_12 = [ 'sounds/12_panned.mp3' ]
allsounds.push(sounds_12)
const sounds_13 = [ 'sounds/13_panned.mp3' ]
allsounds.push(sounds_13)
const sounds_14 = [ 'sounds/14_panned.mp3' ]
allsounds.push(sounds_14)
const sounds_15 = [ 'sounds/15_panned.mp3' ]
allsounds.push(sounds_15)
const sounds_16 = [ 'sounds/16_panned.mp3' ]
allsounds.push(sounds_16)
const sounds_17 = [ 'sounds/17_panned.mp3' ]
allsounds.push(sounds_17)
const sounds_18 = [ 'sounds/18_panned.mp3' ]
allsounds.push(sounds_18)
const sounds_19 = [ 'sounds/19_panned.mp3' ]
allsounds.push(sounds_19)
const sounds_20 = [ 'sounds/20_panned.mp3' ]
allsounds.push(sounds_20)
const sounds_21 = [ 'sounds/21_panned.mp3' ]
allsounds.push(sounds_21)
const sounds_22 = [ 'sounds/22_panned.mp3' ]
allsounds.push(sounds_22)
const sounds_23 = [ 'sounds/23_panned.mp3' ]
allsounds.push(sounds_23)
const sounds_24 = [ 'sounds/24_panned.mp3' ]
allsounds.push(sounds_24)
const sounds_25 = [ 'sounds/25_panned.mp3' ]
allsounds.push(sounds_25)
const sounds_26 = [ 'sounds/26_panned.mp3' ]
allsounds.push(sounds_26)
const sounds_27 = [ 'sounds/27_panned.mp3' ]
allsounds.push(sounds_27)
const sounds_28 = [ 'sounds/28_panned.mp3' ]
allsounds.push(sounds_28)
const sounds_29 = [ 'sounds/29_panned.mp3' ]
allsounds.push(sounds_29)
const sounds_30 = [ 'sounds/30_panned.mp3' ]
allsounds.push(sounds_30)
const sounds_31 = [ 'sounds/31_panned.mp3' ]
allsounds.push(sounds_31)
const sounds_32 = [ 'sounds/32_panned.mp3' ]
allsounds.push(sounds_32)
const sounds_33 = [ 'sounds/33_panned.mp3' ]
allsounds.push(sounds_33)
const sounds_34 = [ 'sounds/34_panned.mp3' ]
allsounds.push(sounds_34)
const sounds_35 = [ 'sounds/35_panned.mp3' ]
allsounds.push(sounds_35)
const sounds_36 = [ 'sounds/36_panned.mp3' ]
allsounds.push(sounds_36)
const sounds_37 = [ 'sounds/37_panned.mp3' ]
allsounds.push(sounds_37)
const sounds_38 = [ 'sounds/38_panned.mp3' ]
allsounds.push(sounds_38)
const sounds_39 = [ 'sounds/39_panned.mp3' ]
allsounds.push(sounds_39)
const sounds_40 = [ 'sounds/40_panned.mp3' ]
allsounds.push(sounds_40)
const sounds_41 = [ 'sounds/41_panned.mp3' ]
allsounds.push(sounds_41)
const sounds_42 = [ 'sounds/42_panned.mp3' ]
allsounds.push(sounds_42)
const water = document.getElementById('watersound');
const narration = document.getElementById('narration');
const startButton = document.getElementById('startbutton');
Expand Down
21 changes: 21 additions & 0 deletions utilities/createSoundArrays.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#! /bin/bash

lastSound=$(ls sounds/[0-9][0-9]_*.mp3 | sort -g | tail -n 1)
lastSound=$(basename $lastSound)
numberOfSounds=${lastSound:0:2}

echo "const soundFiles = $((numberOfSounds + 1))"
echo "const allsounds = []"

sound=0

while [ $sound -le $numberOfSounds ]
do
number=$(printf '%02d' $sound)
theseSounds=$(ls sounds/${number}_*.mp3 | sed -e "s/^/'/" | sed -e "s/$/'/" | sed -e "s/ /, /")
theseSounds=$(echo $theseSounds | sed -e "s/ /, /")
echo "const sounds_${number} = [ $theseSounds ]"
echo "allsounds.push(sounds_${number})"
sound=$(($sound + 1))
done

0 comments on commit 90d1b14

Please sign in to comment.