Skip to content
This repository has been archived by the owner on Dec 21, 2021. It is now read-only.

Commit

Permalink
removed embedded synthplayer, pin library versions
Browse files Browse the repository at this point in the history
  • Loading branch information
irmen committed Jul 3, 2019
1 parent 2855ab9 commit 82b2d31
Show file tree
Hide file tree
Showing 19 changed files with 21 additions and 4,234 deletions.
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ A Boulder Dash (tm) clone in pure python. Includes a cave editor so you can make

Requirements to run this:
- Python 3.5 or newer
- ``pillow`` (or ``pil``) python library
- a supported audio playback library, if you want to play with sound. Supported are:
- ``pillow`` (to deal with images)
- ``synthplayer`` (software FM synthesizer)
- one of the supported audio playback libraries:
- ``miniaudio``
- ``soundcard``
- ``sounddevice``
Expand Down Expand Up @@ -74,7 +75,7 @@ You can choose between *sampled sounds* and *synthesized sounds* via a command l

The sampled sounds require the 'oggdec' tool and the sound files. If you use the
sound synthesizer however, both of these are not needed at all - all sounds are generated
by the program. For this I'm using an included copy of [my software FM-synthesizer](https://github.com/irmen/synthesizer).
by the program.

The Python zip app script creates two versions of this game, one with the sound files included,
and another one ()that is much smaller) without the sound files because it uses the synthesizer.
Expand Down Expand Up @@ -129,7 +130,8 @@ in the 'caves' folder.
Did you download only a ```*.pyz``` file? Do this:
1. install Python 3.5 or newer from https://www.python.org/downloads/
1. open a command prompt and type:
``pip install --user pillow miniaudio`` (or ``sounddevice``, or ``soundcard`` instead of ``miniaudio`` if you prefer that audio api)
``pip install --user pillow "synthplayer==2.2.1" "miniaudio<=1.3"``
(or use "``sounddevice``" or "``soundcard``" instead of "``miniaudio``" if you prefer another audio api)
1. double-click on the ``*.pyz`` file that you downloaded.

If you downloaded the source code, you can simply launch the game
Expand All @@ -151,11 +153,12 @@ just launch the ``startgame-venv.py`` script and it will take care of that for y

Alternatively:

1. make sure you have installed the python libraries: ``pillow`` (or ``pil``) and ``miniaudio`` (or one of the other supported
sound libraries). You can often find them in your package manager or install them with pip.
1. make sure you have installed the python libraries: ``pillow``, ``synthplayer==2.2.1`` and ``miniaudio<=1.3``
(or one of the other supported sound libraries). You can often find them in your package manager or install them with pip.
This can be done easily with ``pip install -r requirements.txt``
1. if you want to play the version with synthesized sounds, you're all set.
1. if you want to play the version with sampled sounds, make sure you have the
``oggdec`` tool installed as well (usually available as part of the ``vorbis-tools`` package)
or use the ``miniaudio`` sound library (which has ogg decoding built in)
1. if you want to play the version with sampled sounds, make sure you're using the ``miniaudio``
library (which has ogg decoding built in). Otherwise you'll need the external
``oggdec`` tool (usually available as part of the ``vorbis-tools`` package).
1. type ``python3 startgame.py`` or just execute the python zip app ``*.pyz`` file if you
downloaded that. If ``python3`` doesn't work just try ``python`` instead.
6 changes: 3 additions & 3 deletions bouldercaves/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
import os
import subprocess
from typing import Union, Dict, Tuple
from .synthplayer import streaming, params as synth_params
from .synthplayer.sample import Sample
from .synthplayer.playback import Output, best_api
from synthplayer import streaming, params as synth_params
from synthplayer.sample import Sample
from synthplayer.playback import Output, best_api
from . import user_data_dir


Expand Down
4 changes: 1 addition & 3 deletions bouldercaves/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
from .gamelogic import GameState, Direction, GameStatus, HighScores
from .caves import colorpalette, Palette
from . import audio, synthsamples, tiles, objects, bdcff
from .synthplayer import sample

__version__ = "5.7"
__version__ = "5.7.1"


class BoulderWindow(tkinter.Tk):
Expand Down Expand Up @@ -406,7 +405,6 @@ def update_game(self) -> None:
self.gamestate.update(self.graphics_frame)
self.gamestate.update_scorebar()
music_sample = audio.samples["music"]
assert isinstance(music_sample, sample.Sample)
if self.gamestate.game_status == GameStatus.WAITING and \
self.last_demo_or_highscore_frame + self.update_fps * max(15, music_sample.duration) < self.graphics_frame:
self.gamestate.tile_music_ended()
Expand Down
2 changes: 0 additions & 2 deletions bouldercaves/synthplayer/__init__.py

This file was deleted.

Loading

0 comments on commit 82b2d31

Please sign in to comment.