Changeset 1194

Show
Ignore:
Timestamp:
08/04/08 06:41:21 (4 months ago)
Author:
cdavid
Message:

Check input dtype before creating pcm device.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/audiolab/scikits/audiolab/soundio/alsa.py

    r1193 r1194  
    1313        raise ValueError("Only ndim 1 or 2 supported") 
    1414 
     15    if not input.dtype in (np.float32, np.float64): 
     16        raise ValueError("input should be array of float32 or float64 !") 
     17 
    1518    try: 
    1619        dev = Device(samplerate = samplerate, channels = nc) 
    17  
    18         assert nc == dev.channels 
    19         assert input.dtype == np.float32 or input.dtype == np.float64 
    20  
    2120        dev.play_short((16384 * input).astype(np.int16)) 
    2221    except AlsaException, e: