##// 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 Parameters
18 Parameters
19 ----------
19 ----------
20 data : numpy array, list, unicode, str or bytes
20 data : numpy array, list, unicode, str or bytes
21 Can be a
21 Can be one of
22 * Numpy 1d array containing the desired waveform (mono)
22
23 * List of float or integer representing the waveform (mono)
23 * Numpy 1d array containing the desired waveform (mono)
24 * String containing the filename
24 * Numpy 2d array containing waveforms for each channel.
25 * Bytestring containing raw PCM data or
25 Shape=(NCHAN, NSAMPLES). For the standard channel order, see
26 * URL pointing to a file on the web.
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 If the array option is used the waveform will be normalized.
32 If the array option is used the waveform will be normalized.
29
33
@@ -58,6 +62,11 b' class Audio(DisplayObject):'
58 data = np.sin(2*np.pi*220*t) + np.sin(2*np.pi*224*t))
62 data = np.sin(2*np.pi*220*t) + np.sin(2*np.pi*224*t))
59 Audio(data,rate=framerate)
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 Audio("http://www.nch.com.au/acm/8k16bitpcm.wav") # From URL
70 Audio("http://www.nch.com.au/acm/8k16bitpcm.wav") # From URL
62 Audio(url="http://www.w3schools.com/html/horse.ogg")
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