Skip to content

Commit

Permalink
fix samples/tetrico no sound defect due to pyglet 1.5.8 changes, #338
Browse files Browse the repository at this point in the history
  • Loading branch information
ccanepa committed Nov 8, 2020
1 parent aaac2ce commit 90b9350
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
v0.6.9 - November 7, 2020

- fix samples/tetrico no sound defect due to pyglet 1.5.8 changes, #338
- fix tiles crash in py39 due to xml removed method, thanks JJ1SLR for bug report
- fix custom_clocks compat py2, py34
- euclid bugfixes and two new methods for Vector2: angle_oriented and determinant
Expand Down
10 changes: 8 additions & 2 deletions samples/tetrico/soundex.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@
print("While trying to use ffmpeg audio from package pyglet_ffmpeg2 an exception was rised:")
print(ex)

try:
if hasattr(pyglet.media.codecs, "_decoder_extensions"):
# pyglet <1.5.8
decoders = pyglet.media.codecs._decoder_extensions.get(".mp3", [])
except Exception:
elif hasattr(pyglet.media.codecs, "_codecs"):
# pyglet 1.5.8+
decoders = pyglet.media.codecs._codecs._decoder_extensions.get(".mp3", [])
else:
# ?
print("*** pyglet changed access to decoders. No sound.")
decoders = None

if decoders:
Expand Down

0 comments on commit 90b9350

Please sign in to comment.