Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

Commit

Permalink
sink: Change AlsaSink kwarg 'card' to 'device'
Browse files Browse the repository at this point in the history
  • Loading branch information
jodal committed May 18, 2015
1 parent 9c9b5d4 commit 4ff935d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
10 changes: 10 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
Changelog
*********

v2.0.0b6 (UNRELEASED)
=====================

ALSA sink
---------

- Changed the :class:`spotify.AlsaSink` keyword argument ``card`` to ``device``
to align with pyalsaaudio 0.8.


v2.0.0b5 (2015-05-09)
=====================

Expand Down
8 changes: 4 additions & 4 deletions spotify/sink.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class AlsaSink(Sink):
sudo apt-get install libasound2-dev
pip install pyalsaaudio
The ``card`` keyword argument is passed on to :class:`alsaaudio.PCM`.
The ``device`` keyword argument is passed on to :class:`alsaaudio.PCM`.
Please refer to the pyalsaaudio documentation for details.
Example::
Expand Down Expand Up @@ -90,9 +90,9 @@ class AlsaSink(Sink):
issue #16 <https://sourceforge.net/p/pyalsaaudio/bugs/16/>`_.
"""

def __init__(self, session, card='default'):
def __init__(self, session, device='default'):
self._session = session
self._card = card
self._device_name = device

import alsaaudio # Crash early if not available
self._alsaaudio = alsaaudio
Expand All @@ -106,7 +106,7 @@ def _on_music_delivery(self, session, audio_format, frames, num_frames):

if self._device is None:
self._device = self._alsaaudio.PCM(
mode=self._alsaaudio.PCM_NONBLOCK, card=self._card)
mode=self._alsaaudio.PCM_NONBLOCK, card=self._device_name)
if sys.byteorder == 'little':
self._device.setformat(self._alsaaudio.PCM_FORMAT_S16_LE)
else:
Expand Down

0 comments on commit 4ff935d

Please sign in to comment.