Skip to content

Commit

Permalink
bump to release version
Browse files Browse the repository at this point in the history
  • Loading branch information
mscheltienne committed Dec 21, 2022
1 parent 0185ff7 commit 455c281
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions doc/changes/0.4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ Bugs
~~~~

- Fix indentation of docstrings with a summary line (by `Mathieu Scheltienne`_)

- Fix casting of ``true_divide`` with different ``dtypes`` when loading a sound (by `Mathieu Scheltienne`_)

- Cast loaded sounds to ``np.float64`` to prevent floating point error in the volume assessment (by `Mathieu Scheltienne`_)
- Cast all sounds to ``np.float32`` since ``sounddevice`` cast them anyway (by `Mathieu Scheltienne`_)

Authors
~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = 'setuptools.build_meta'

[project]
name = 'stimuli'
version = '0.4.2'
version = '0.4.3'
description = 'Simple auditory and visual stimuli avoiding PsychoPy.'
readme = 'README.md'
license = {file = 'LICENSE'}
Expand Down
3 changes: 2 additions & 1 deletion stimuli/audio/sound.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def _check_signal(
the _set_signal method.
"""
assert signal.ndim in (1, 2)
signal = signal.astype(np.float32)
signal = signal.astype(np.float64)
if signal.ndim == 2:
assert signal.shape[1] in (1, 2)
if signal.shape[1] == 1:
Expand All @@ -139,6 +139,7 @@ def _check_signal(
if all(elt != 0 for elt in volume):
signal /= np.max(np.abs(signal), axis=0)
np.nan_to_num(signal, copy=False, nan=0.0) # sanity-check
signal = signal.astype(np.float32)
return signal, volume

@staticmethod
Expand Down

0 comments on commit 455c281

Please sign in to comment.