#NEWLINE# @ actor_method #NEWLINE# def record( self , audio , timestamp ) : #NEWLINE# #INDENT# global p #NEWLINE# if ( audio != None ) : #NEWLINE# #INDENT# self . frames . append ( audio ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# wf = wave . open ( self . WAVE_OUTPUT_FILENAME , 'wb' ) #NEWLINE# wf . setnchannels ( self . CHANNELS ) #NEWLINE# wf . setsampwidth ( p . get_sample_size ( self . FORMAT ) ) #NEWLINE# wf . setframerate ( self . RATE ) #NEWLINE# wf . writeframes ( b'' . join ( wf . frames ) ) #NEWLINE# wf . close ( ) #NEWLINE# self . stop ( )