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

Commit

Permalink
new release 5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
irmen committed Nov 14, 2018
1 parent 5be2e52 commit 3ca66e0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bouldercaves/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from . import audio, synthsamples, tiles, objects, bdcff
from .synthplayer import sample

__version__ = "5.1.dev0"
__version__ = "5.2"


class BoulderWindow(tkinter.Tk):
Expand Down
5 changes: 3 additions & 2 deletions bouldercaves/synthplayer/playback.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def initialize(self):
else:
msg = """
Cannot determine suitable audio output device. Portaudio devices: input={input} output={output}
Please specify the desired output device number using the
Please specify the desired output device number using the
PY_SYNTHPLAYER_AUDIO_DEVICE environment variable, or by setting the
default_output_device parameter to a value >= 0 in your code).
""".format(input=default_input, output=default_output)
Expand Down Expand Up @@ -566,7 +566,7 @@ def initialize(self):
if default_audio_device < 0:
msg = """
Cannot determine suitable audio output device. Portaudio devices: input={input} output={output}
Please specify the desired output device number using the
Please specify the desired output device number using the
PY_SYNTHPLAYER_AUDIO_DEVICE environment variable, or by setting the
default_output_device parameter to a value >= 0 in your code).
""".format(input=default_input["index"], output=default_output["index"])
Expand Down Expand Up @@ -594,6 +594,7 @@ def find_default_output_device(self):
warnings.warn("chosen output device: "+str(best_device), category=ResourceWarning)
return best_device


class PyAudio_Mix(AudioApi, PyAudioUtils):
"""Api to the somewhat older pyaudio library (that uses portaudio)"""
def __init__(self, samplerate: int=0, samplewidth: int=0, nchannels: int=0, frames_per_chunk: int=0) -> None:
Expand Down
3 changes: 2 additions & 1 deletion bouldercaves/synthplayer/streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ def probe_format(cls, filename: str) -> AudioFormatProbe:
# first check if it's a .wav we can open ourselves
with wave.open(filename, "rb") as wf:
duration = wf.getnframes() / wf.getframerate()
return AudioFormatProbe(wf.getframerate(), wf.getnchannels(), str(wf.getsampwidth()*8), wf.getsampwidth()*8, "wav", duration)
return AudioFormatProbe(wf.getframerate(), wf.getnchannels(),
str(wf.getsampwidth()*8), wf.getsampwidth()*8, "wav", duration)
except wave.Error:
pass
# no wav, try the probe tool
Expand Down

0 comments on commit 3ca66e0

Please sign in to comment.