@@ -13,7 +13,7 @@ def __init__(self, kind, qsize=16, **kwargs):
1313
1414 self ._action_q = RingBuffer (_ffi .sizeof ('struct action*' ), qsize )
1515 self ._result_q = RingBuffer (_ffi .sizeof ('struct action*' ), qsize )
16- self ._userdata = _ffi .new ('struct state*' , dict (
16+ self ._state = _ffi .new ('struct state*' , dict (
1717 input_channels = 0 ,
1818 output_channels = 0 ,
1919 samplerate = 0 ,
@@ -23,8 +23,8 @@ def __init__(self, kind, qsize=16, **kwargs):
2323 ))
2424 _sd ._StreamBase .__init__ (
2525 self , kind = kind , dtype = 'float32' ,
26- callback = callback , userdata = self ._userdata , ** kwargs )
27- self ._userdata .samplerate = self .samplerate
26+ callback = callback , userdata = self ._state , ** kwargs )
27+ self ._state .samplerate = self .samplerate
2828
2929 self ._actions = set ()
3030 self ._temp_action_ptr = _ffi .new ('struct action**' )
@@ -106,7 +106,7 @@ def __init__(self, **kwargs):
106106
107107 """
108108 _Base .__init__ (self , kind = 'output' , ** kwargs )
109- self ._userdata .output_channels = self .channels
109+ self ._state .output_channels = self .channels
110110
111111 def play_buffer (self , buffer , channels , start = 0 , allow_belated = True ):
112112 """Send a buffer to the callback to be played back.
@@ -169,7 +169,7 @@ def __init__(self, **kwargs):
169169
170170 """
171171 _Base .__init__ (self , kind = 'input' , ** kwargs )
172- self ._userdata .input_channels = self .channels
172+ self ._state .input_channels = self .channels
173173
174174 def record_buffer (self , buffer , channels , start = 0 , allow_belated = True ):
175175 """Send a buffer to the callback to be recorded into.
@@ -230,8 +230,8 @@ def __init__(self, **kwargs):
230230
231231 """
232232 _Base .__init__ (self , kind = 'duplex' , ** kwargs )
233- self ._userdata .input_channels = self .channels [0 ]
234- self ._userdata .output_channels = self .channels [1 ]
233+ self ._state .input_channels = self .channels [0 ]
234+ self ._state .output_channels = self .channels [1 ]
235235
236236
237237class RingBuffer (object ):
0 commit comments