|
MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
|
| MAYAFLUX_API std::pair< std::shared_ptr< BufferPipeline >, std::shared_ptr< Buffers::AudioBuffer > > MayaFlux::Kriya::record | ( | const std::shared_ptr< Vruta::TaskScheduler > & | scheduler, |
| const std::shared_ptr< Buffers::BufferManager > & | buffer_manager, | ||
| const std::shared_ptr< Kakshya::DynamicSoundStream > & | stream, | ||
| uint32_t | input_channel, | ||
| uint64_t | cycles, | ||
| std::optional< uint32_t > | monitor = std::nullopt, | ||
| uint32_t | stream_channel = 0 ) |
Record a live input channel into one channel of a stream for a number of audio cycles.
Registers a listener on input_channel, captures it once per audio cycle and appends each block to stream at the write head of stream_channel. The pipeline starts at once and ends when cycles blocks have been written, or when its end() is called. A linear stream grows and keeps the whole take; a circular one keeps the newest frames. With a monitor channel the listener is also mixed to that output channel, so the input is heard.
The listener is released through the pipeline's on_complete, so setting another on_complete on the pipeline replaces the release and leaves the listener registered.
To record again into the same listener once it has ended, use record_into, which registers the listener again. The stream keeps appending, so a linear stream then holds both takes.
| scheduler | Scheduler that runs the pipeline. |
| buffer_manager | Manager that owns the input channels. |
| stream | Destination. |
| input_channel | Input channel to record. |
| cycles | Audio cycles to record, 0 to record until the pipeline ends. |
| monitor | Output channel to also hear the input on, or none. |
| stream_channel | Channel of the stream that receives the signal. |
Definition at line 323 of file BufferPipeline.cpp.
References MayaFlux::Kriya::BufferOperation::capture_input_from(), and MayaFlux::Kriya::CaptureBuilder::get_audio_buffer().
Referenced by MayaFlux::record().