LASP 1.0
Library for Acoustic Signal Processing
Loading...
Searching...
No Matches
lasp.lasp_record.Recording Class Reference

Class used to perform a recording. More...

Public Member Functions

 __init__ (self, str fn, StreamMgr streammgr, float rectime=None, bool wait=True, progressCallback=None, float startDelay=0)
 Start a recording.
 
 resetCallback (self, daq)
 Function called with initial stream data.
 
 firstFrames (self, adata)
 Set up the dataset in which to store the audio data.
 
 inCallback (self, adata)
 This method is called when a block of audio data from the stream is available.
 
 setDelete (self, bool val)
 Set the delete flag.
 
 finish (self)
 This method should be called to finish and a close a recording file, remove the queue from the stream, etc.
 

Public Attributes

 smgr
 
 metadata
 
 startDelay
 
 startDelay_passed
 
 rectime
 
 fn
 
 curT_rounded_to_seconds
 
 ablockno
 
 stop
 
 file_mtx
 
 progressCallback
 
 f
 
 deleteFile
 
 ad
 
 indh
 
 blocksize
 
 nchannels
 
 fs
 

Detailed Description

Class used to perform a recording.

Recording data can come in from a different thread, that is supposed to call the inCallback method, with audio data as an argument.

Definition at line 20 of file lasp_record.py.

Constructor & Destructor Documentation

◆ __init__()

lasp.lasp_record.Recording.__init__ (   self,
str  fn,
StreamMgr  streammgr,
float   rectime = None,
bool   wait = True,
  progressCallback = None,
float   startDelay = 0 
)

Start a recording.

Blocks if wait is set to True.

Args: fn: Filename to record to. Extension is automatically added if not provided. stream: AvStream instance to record from. Should have input channels! rectime: Recording time [s], None for infinite, in seconds. If set to None, or np.inf, the recording continues indefintely. progressCallback: callable that is called with an instance of RecordStatus instance as argument. startDelay: Optional delay added before the recording is actually started in [s].

Definition at line 27 of file lasp_record.py.

Member Function Documentation

◆ finish()

lasp.lasp_record.Recording.finish (   self)

This method should be called to finish and a close a recording file, remove the queue from the stream, etc.

Definition at line 215 of file lasp_record.py.

◆ firstFrames()

lasp.lasp_record.Recording.firstFrames (   self,
  adata 
)

Set up the dataset in which to store the audio data.

This will create the attribute self.ad

Args: adata: Numpy array with data from DAQ

Definition at line 157 of file lasp_record.py.

◆ inCallback()

lasp.lasp_record.Recording.inCallback (   self,
  adata 
)

This method is called when a block of audio data from the stream is available.

It should return either True or False.

When returning False, it will stop the stream.

Definition at line 185 of file lasp_record.py.

◆ resetCallback()

lasp.lasp_record.Recording.resetCallback (   self,
  daq 
)

Function called with initial stream data.

Definition at line 120 of file lasp_record.py.

◆ setDelete()

lasp.lasp_record.Recording.setDelete (   self,
bool  val 
)

Set the delete flag.

If set, measurement file is deleted at the end of the recording. Typically used for cleaning up after canceling a recording.

Definition at line 206 of file lasp_record.py.

Member Data Documentation

◆ ablockno

lasp.lasp_record.Recording.ablockno

Definition at line 75 of file lasp_record.py.

◆ ad

lasp.lasp_record.Recording.ad

Definition at line 104 of file lasp_record.py.

◆ blocksize

lasp.lasp_record.Recording.blocksize

Definition at line 127 of file lasp_record.py.

◆ curT_rounded_to_seconds

lasp.lasp_record.Recording.curT_rounded_to_seconds

Definition at line 72 of file lasp_record.py.

◆ deleteFile

lasp.lasp_record.Recording.deleteFile

Definition at line 95 of file lasp_record.py.

◆ f

lasp.lasp_record.Recording.f

Definition at line 87 of file lasp_record.py.

◆ file_mtx

lasp.lasp_record.Recording.file_mtx

Definition at line 81 of file lasp_record.py.

◆ fn

lasp.lasp_record.Recording.fn

Definition at line 70 of file lasp_record.py.

◆ fs

lasp.lasp_record.Recording.fs

Definition at line 129 of file lasp_record.py.

◆ indh

lasp.lasp_record.Recording.indh

Definition at line 108 of file lasp_record.py.

◆ metadata

lasp.lasp_record.Recording.metadata

Definition at line 56 of file lasp_record.py.

◆ nchannels

lasp.lasp_record.Recording.nchannels

Definition at line 128 of file lasp_record.py.

◆ progressCallback

lasp.lasp_record.Recording.progressCallback

Definition at line 83 of file lasp_record.py.

◆ rectime

lasp.lasp_record.Recording.rectime

Definition at line 67 of file lasp_record.py.

◆ smgr

lasp.lasp_record.Recording.smgr

Definition at line 55 of file lasp_record.py.

◆ startDelay

lasp.lasp_record.Recording.startDelay

Definition at line 61 of file lasp_record.py.

◆ startDelay_passed

lasp.lasp_record.Recording.startDelay_passed

Definition at line 64 of file lasp_record.py.

◆ stop

lasp.lasp_record.Recording.stop

Definition at line 78 of file lasp_record.py.


The documentation for this class was generated from the following file: