#638 closed defect (fixed)
"Playwave" example not working: directory not found?
Reported by: | sascha_silbe | Owned by: | lfaraone |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Pippy | Version: | Git as of bugdate |
Severity: | Major | Keywords: | r? |
Cc: | jpichon | Distribution/OS: | Unspecified |
Bug Status: | Unconfirmed |
Description (last modified by tomeu)
The "Playwave" example isn't working:
Traceback (most recent call last):
File "/home/sugar/.sugar/default/org.laptop.Pippy/tmp/pippy_app.py", line 5, in <module>
pippy.sound.playWave(sound='didjeridu', loop=True, duration=5)
File "/home/sugar/sugar-jhbuild/install/share/sugar/activities/Pippy.activity/library/pippy/sound.py", line 157, in playWave
fullname = finddir() + str(sound)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
Attachments (2)
Change History (10)
comment:1 Changed 14 years ago by tomeu
- Description modified (diff)
- Milestone changed from Unspecified by Release Team to 0.86
- Priority changed from Unspecified by Maintainer to Normal
- Severity changed from Unspecified to Major
Changed 13 years ago by jpichon
comment:2 Changed 13 years ago by jpichon
- Cc jpichon added
This is happening because PlayWave relies on TamTamEdit to provide the sound, which isn't always installed by default.
The Getsound example works around this by providing a helpful error message when finddir() returns None, so I'm attaching a patch to do the same for Playwave. Let me know if there would be a better way to deal with this.
comment:3 Changed 13 years ago by sascha_silbe
I get the same error even after installing TamTam Edit. TamTam Edit itself doesn't play any sound, but that's a different bug.
comment:4 Changed 13 years ago by jpichon
Thank you for the feedback. I was so keen on removing the stack trace and displaying an error message that I didn't properly check the validity of the message itself, sorry! It looks like the directory paths for TamTamEdit are hardcoded incorrectly in sound.py. Installing TamTamEdit doesn't work for the "Getsound" example either, I'm looking into it at the same time.
Is there a recommended way to access activity directories from Sugar? I've had some success with adding the following to finddir() in sound.py so far, though I still need to test it further and on different configurations:
tamtam_dir = "TamTamEdit.activity/common/Resources/Sounds/" if "SUGAR_PATH" in os.environ: dirs.append(os.environ["SUGAR_PATH"] + "/activities/" + tamtam_dir) dirs.append(os.path.expanduser("~") + "/Activities/" + tamtam_dir)
Changed 13 years ago by jpichon
comment:5 Changed 13 years ago by jpichon
- Keywords r? added
Here's a second patch that complements the first one and works for the "Getsoundlist" example as well. With the patch, they should both show the correct output if TamTamEdit is installed, and display an error message if it isn't.
comment:6 Changed 12 years ago by RafaelOrtiz
This should be fixed in v40 of pippy.
comment:7 Changed 12 years ago by RafaelOrtiz
- Resolution set to fixed
- Status changed from new to closed
confirmed as fixed.
Display error message when sound is not found