diff options
author | Nathanaël Lécaudé <natcl@hotmail.com> | 2007-08-29 00:07:30 (GMT) |
---|---|---|
committer | Nathanaël Lécaudé <natcl@hotmail.com> | 2007-08-29 00:07:30 (GMT) |
commit | 1457178256ce8b46e250b396d8b506613f68a089 (patch) | |
tree | c799fa1fa567fe08ac7080edbdbd76587089ff52 | |
parent | ab9ddea50be9228dc433e65a19d1ed9a98a77dcb (diff) |
getSoundList and path fixes
-rw-r--r-- | data/sound/getSoundList | 7 | ||||
-rw-r--r-- | data/sound/playSine | 4 | ||||
-rw-r--r-- | data/sound/playWave | 4 | ||||
-rw-r--r-- | data/sound/sequence | 4 | ||||
-rw-r--r-- | data/sound/sndInfo | 4 | ||||
-rwxr-xr-x | sound/snd.py | 3 |
6 files changed, 22 insertions, 4 deletions
diff --git a/data/sound/getSoundList b/data/sound/getSoundList new file mode 100644 index 0000000..317ba41 --- /dev/null +++ b/data/sound/getSoundList @@ -0,0 +1,7 @@ +import sys +from sugar.activity.activity import get_bundle_path +sys.path.append(get_bundle_path() + '/sound') +from snd import * + +for sound in getSoundList(): + print sound
\ No newline at end of file diff --git a/data/sound/playSine b/data/sound/playSine index 8cda42e..a641b72 100644 --- a/data/sound/playSine +++ b/data/sound/playSine @@ -1,6 +1,8 @@ import sys -sys.path.append('/usr/share/activities/Pippy.activity/sound') +from sugar.activity.activity import get_bundle_path +sys.path.append(get_bundle_path() + '/sound') from snd import * + playSine() audioOut() diff --git a/data/sound/playWave b/data/sound/playWave index 659710a..471ca31 100644 --- a/data/sound/playWave +++ b/data/sound/playWave @@ -1,6 +1,8 @@ import sys -sys.path.append('/usr/share/activities/Pippy.activity/sound') +from sugar.activity.activity import get_bundle_path +sys.path.append(get_bundle_path() + '/sound') from snd import * + playWave(sound='didjeridu', loop=True, duration=5) audioOut() diff --git a/data/sound/sequence b/data/sound/sequence index 683ea59..1bdc966 100644 --- a/data/sound/sequence +++ b/data/sound/sequence @@ -1,7 +1,9 @@ import sys import random -sys.path.append('/usr/share/activities/Pippy.activity/sound') +from sugar.activity.activity import get_bundle_path +sys.path.append(get_bundle_path() + '/sound') from snd import * + for i in range(25): pitch = random.randint(500,2000) amplitude = 5000 diff --git a/data/sound/sndInfo b/data/sound/sndInfo index f40accb..0a337f9 100644 --- a/data/sound/sndInfo +++ b/data/sound/sndInfo @@ -1,4 +1,6 @@ import sys -sys.path.append('/usr/share/activities/Pippy.activity/sound') +from sugar.activity.activity import get_bundle_path +sys.path.append(get_bundle_path() + '/sound') from snd import * + print playSine.__doc__ diff --git a/sound/snd.py b/sound/snd.py index e7217cc..3699ac6 100755 --- a/sound/snd.py +++ b/sound/snd.py @@ -133,6 +133,9 @@ def playWave(sound='horse', pitch=1, amplitude=1, loop=False, duration=1, startt orchlines.append("endin\n\n") scorelines.append("i%ld %f %f %s %s\n" % (wavnum[0], float(starttime), float(duration), str(pitenv), str(ampenv))) + +def getSoundList(): + return os.listdir('/usr/share/activities/TamTam.activity/Resources/Sounds/') def audioOut(): path = temp_path |