Sound Context Manager#
in pysndlib.clm
- class Sound(output=None, channels=None, srate=None, sample_type=None, header_type=None, comment=False, verbose=False, reverb=None, revfile=None, reverb_data=None, reverb_channels=None, continue_old_file=False, statistics=None, scaled_to=False, scaled_by=False, play=None, clipped=None, finalize=None)#
context manager which handles creating output and other options
- Parameters:
output – Can be a filename string or np.ndarray
channels – number of channels in main output
srate – output sampling rate
sample_type – output sample data type
header_type – output header type
comment – any comment to store in the header
verbose – if True, print out some info (doesn’t do anything now)
reverb – reverb instrument
reverb_data – arguments passed to the reverb (dictionary)
reverb_channels – chans in the reverb intermediate file
revfile – reverb intermediate output file name
continue_old_file – if True, continue a previous computation
statistics – if True, print info at end of with-sound (compile time, maxamps)
scaled_to – if a number, scale the output to peak at that amp
scaled_by – is a number, scale output by that amp
play – if True, play the sound automatically
finalize – a function to call on exit from the context. should be a function that takes one argument, the name of the sound file or the ndarray used as output