Changeset 1190
- Timestamp:
- 08/04/08 05:23:09 (4 months ago)
- Files:
-
- trunk/audiolab/scikits/audiolab/soundio/_alsa.pyx (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/audiolab/scikits/audiolab/soundio/_alsa.pyx
r1189 r1190 64 64 int snd_pcm_close(snd_pcm_t *) 65 65 66 int snd_pcm_set_params(snd_pcm_t *, snd_pcm_format_t, 67 snd_pcm_access_t, unsigned int, 68 unsigned int, int, unsigned int) 69 66 70 char* snd_strerror(int error) 67 71 … … 113 117 return cardname 114 118 115 cdef class Device:119 cdef class PCM: 116 120 cdef snd_pcm_t* pcmhdl 117 121 cdef public char* name … … 130 134 if self.pcmhdl: 131 135 snd_pcm_close(self.pcmhdl) 136 137 cdef class Device: 138 cdef PCM pcm 139 cdef unsigned int samplerate 140 cdef unsigned int channels 141 def __init__(self, samplerate = 48000, channels = 1, 142 format = SND_PCM_FORMAT_S16, 143 access = SND_PCM_ACCESS_RW_INTERLEAVED): 144 self.pcm = PCM() 145 146 self.samplerate = samplerate 147 self.channels = channels 148 149 st = snd_pcm_set_params(self.pcm.pcmhdl, format, access, channels, 150 samplerate, 1, 1000000) 151 if st < 0: 152 raise AlsaException() 153 154 def _get_name(self): 155 return self.pcm.name 156 name = property(_get_name)
