Show More
@@ -18,8 +18,12 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 |
|
21 | Can be one of | |
|
22 | ||||
22 | * Numpy 1d array containing the desired waveform (mono) |
|
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 | |||
23 | * List of float or integer representing the waveform (mono) |
|
27 | * List of float or integer representing the waveform (mono) | |
24 | * String containing the filename |
|
28 | * String containing the filename | |
25 | * Bytestring containing raw PCM data or |
|
29 | * Bytestring containing raw PCM data or | |
@@ -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