File tree Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 27
27
############################################################################
28
28
29
29
import os
30
+ import sox
30
31
32
+ class Music :
31
33
32
- class Musical :
34
+ _instance = None
35
+
36
+ @classmethod
37
+ def get_instance (cls ):
38
+ if cls ._instance is None :
39
+ cls ._instance = Music ()
40
+ return cls ._instance
33
41
34
42
def __init__ (self ):
35
- print ("We have create a class: MUSICAL" )
43
+ os .putenv ('AUDIODRIVER' , 'alsa' )
44
+ os .putenv ('AUDIODEV' , 'hw:1,0' )
45
+ print ("We have create a class: MUSICAL" )
46
+
47
+ def test (self ):
48
+ tfm = sox .Transformer ()
49
+ tfm .preview ('cat.wav' )
50
+
51
+ if __name__ == "__main__" :
52
+ a = Music ()
53
+
54
+ a .test ()
55
+ a .test ()
56
+ a .test ()
57
+ a .test ()
Original file line number Diff line number Diff line change @@ -44,3 +44,6 @@ setuptools==42.0.1
44
44
smbus2==0.3.0
45
45
spidev==3.4
46
46
cachetools==3.0.0
47
+
48
+ sox==1.3.7
49
+ pyalsaaudio==0.8.4
You can’t perform that action at this time.
0 commit comments