sc3nb.sc_objects.recorder
Module for recording
Module Contents
Class List
Different States |
|
Allows to record audio easily. |
Content
- class sc3nb.sc_objects.recorder.Recorder(path: str = 'record.wav', nr_channels: int = 2, rec_header: str = 'wav', rec_format: str = 'int16', bufsize: int = 65536, server: Optional[sc3nb.sc_objects.server.SCServer] = None)[source]
Allows to record audio easily.
Create and prepare a recorder.
- Parameters:
- pathstr, optional
path of recording file, by default “record.wav”
- nr_channelsint, optional
Number of channels, by default 2
- rec_headerstr, optional
File format, by default “wav”
- rec_formatstr, optional
Recording resolution, by default “int16”
- bufsizeint, optional
size of buffer, by default 65536
- serverSCServer, optional
server used for recording, by default use the SC default server
Overview:
Pepare the recorder.
Start the recording.
Pause the recording.
Resume the recording
Stop the recording.
Return repr(self).
- prepare(path: str = 'record.wav', nr_channels: int = 2, rec_header: str = 'wav', rec_format: str = 'int16', bufsize: int = 65536)[source]
Pepare the recorder.
- Parameters:
- pathstr, optional
path of recording file, by default “record.wav”
- nr_channelsint, optional
Number of channels, by default 2
- rec_headerstr, optional
File format, by default “wav”
- rec_formatstr, optional
Recording resolution, by default “int16”
- bufsizeint, optional
size of buffer, by default 65536
- Raises:
- RuntimeError
When Recorder does not needs to be prepared.
- start(timetag: float = 0, duration: Optional[float] = None, node: Union[sc3nb.sc_objects.node.Node, int] = 0, bus: int = 0)[source]
Start the recording.
- Parameters:
- timetagfloat, by default 0 (immediately)
Time (or time offset when <1e6) to start
- durationfloat, optional
Length of the recording, by default until stopped.
- nodeUnion[Node, int], optional
Node that should be recorded, by default 0
- busint, by default 0
Bus that should be recorded
- Raises:
- RuntimeError
When trying to start a recording unprepared.
- pause(timetag: float = 0)[source]
Pause the recording.
- Parameters:
- timetagfloat, by default 0 (immediately)
Time (or time offset when <1e6) to pause
- Raises:
- RuntimeError
When trying to pause if not recording.
- resume(timetag: float = 0)[source]
Resume the recording
- Parameters:
- timetagfloat, by default 0 (immediately)
Time (or time offset when <1e6) to resume
- Raises:
- RuntimeError
When trying to resume if not paused.