Record(input, filename, chnls=2, fileformat=0, sampletype=0, buffering=4)
Writes input sound in an audio file on the disk.
`input` parameter must be a valid PyoObject or an addition of PyoObjects, parameters can't be in list format.
Parent class : PyoObject
Parameters:
input : PyoObject Input signal to record. filename : string Full path of the file to create. chnls : int, optional Number of channels in the audio file. Defaults to 2. fileformat : int, optional Format type of the audio file. Record will first try to set the format from the filename extension. If it's not possible, it uses the fileformat parameter. Defaults to 0. Supported formats are: 0 : WAV - Microsoft WAV format (little endian) {.wav, .wave} 1 : AIFF - Apple/SGI AIFF format (big endian) {.aif, .aiff} sampletype : int, optional Bit depth encoding of the audio file. Defaults to 0. Supported types are: 0 : 16 bits int 1 : 24 bits int 2 : 32 bits int 3 : 32 bits float 4 : 64 bits float buffering : int, optional Number of bufferSize to wait before writing samples to disk. High buffering uses more memory but improves performance. Defaults to 4.
Notes:
All parameters can only be set at intialization time. The `stop` method must be called on the object to close the file properly. The out() method is bypassed. Record's signal can not be sent to audio outs. Record has no `mul` and `add` attributes.
Examples:
>>> s = Server().boot() >>> s.start() >>> from random import uniform >>> import os >>> t = HarmTable([1, 0, 0, .2, 0, 0, 0, .1, 0, 0, .05]) >>> amp = Fader(fadein=.05, fadeout=2, dur=4, mul=.05).play() >>> osc = Osc(t, freq=[uniform(350,360) for i in range(10)], mul=amp).out() >>> home = os.path.expanduser('~') >>> rec = Record(osc, filename=home+"/example_synth.aif", fileformat=1, sampletype=1) >>> clean = Clean_objects(4.5, rec) >>> clean.start()