##// END OF EJS Templates
added docstring about multiple channel support in Audio
Erik Tollerud -
Show More
@@ -18,12 +18,16 b' class Audio(DisplayObject):'
18 18 Parameters
19 19 ----------
20 20 data : numpy array, list, unicode, str or bytes
21 Can be a
22 * Numpy 1d array containing the desired waveform (mono)
23 * List of float or integer representing the waveform (mono)
24 * String containing the filename
25 * Bytestring containing raw PCM data or
26 * URL pointing to a file on the web.
21 Can be one of
22
23 * Numpy 1d array containing the desired waveform (mono)
24 * Numpy 2d array containing waveforms for each channel.
25 Shape=(NCHAN, NSAMPLES). For the standard channel order, see
26 http://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx
27 * List of float or integer representing the waveform (mono)
28 * String containing the filename
29 * Bytestring containing raw PCM data or
30 * URL pointing to a file on the web.
27 31
28 32 If the array option is used the waveform will be normalized.
29 33
@@ -58,6 +62,11 b' class Audio(DisplayObject):'
58 62 data = np.sin(2*np.pi*220*t) + np.sin(2*np.pi*224*t))
59 63 Audio(data,rate=framerate)
60 64
65 # Can also do stereo or more channels
66 dataleft = np.sin(2*np.pi*220*t)
67 dataright = np.sin(2*np.pi*224*t)
68 Audio([dataleft, dataright],rate=framerate)
69
61 70 Audio("http://www.nch.com.au/acm/8k16bitpcm.wav") # From URL
62 71 Audio(url="http://www.w3schools.com/html/horse.ogg")
63 72
General Comments 0
You need to be logged in to leave comments. Login now