MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ record()

MAYAFLUX_API std::pair< std::shared_ptr< Kriya::BufferPipeline >, std::shared_ptr< Buffers::AudioBuffer > > MayaFlux::record ( const std::shared_ptr< Kakshya::DynamicSoundStream > & stream,
uint32_t input_channel,
double seconds,
std::optional< uint32_t > monitor = std::nullopt,
uint32_t channel = 0 )

Record a live input channel into a stream for a number of seconds.

Kriya::record on the engine's managers, with the length rounded up to whole audio cycles. The pipeline ends itself when the time is up.

auto [pipeline, listener] = MayaFlux::record(take, 0, 8.0);
std::pair< std::shared_ptr< Kriya::BufferPipeline >, std::shared_ptr< Buffers::AudioBuffer > > record(const std::shared_ptr< Kakshya::DynamicSoundStream > &stream, uint32_t input_channel, double seconds, std::optional< uint32_t > monitor, uint32_t channel)
Record a live input channel into a stream for a number of seconds.
Definition Rigs.cpp:262

To record again into the same listener once it has ended, use record_into with the listener. The stream keeps appending.

auto again = MayaFlux::record_into(take, listener, 0, 8.0);
std::shared_ptr< Kriya::BufferPipeline > record_into(const std::shared_ptr< Kakshya::DynamicSoundStream > &stream, Kriya::CaptureBuilder source, uint32_t channel)
Record a signal into one channel of a stream, a block at a time.
Definition Rigs.cpp:215
Parameters
monitorOutput channel to also hear the input on, or none.
Returns
The running pipeline and the listener buffer, or two null pointers if the stream is null or seconds is not positive.

Definition at line 262 of file Rigs.cpp.

265{
266 if (!(seconds > 0.0)) {
267 return { nullptr, nullptr };
268 }
269
270 const double blocks = seconds * Config::get_sample_rate() / Config::get_buffer_size();
271 return Kriya::record(get_scheduler(), get_buffer_manager(), stream, input_channel,
272 std::max<uint64_t>(1, static_cast<uint64_t>(std::ceil(blocks))), monitor, channel);
273}
uint32_t get_buffer_size()
Gets the buffer size from the default engine.
Definition Config.cpp:90
uint32_t get_sample_rate()
Gets the sample rate from the default engine.
Definition Config.cpp:81
std::pair< std::shared_ptr< BufferPipeline >, std::shared_ptr< Buffers::AudioBuffer > > 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, uint32_t stream_channel)
Record a live input channel into one channel of a stream for a number of audio cycles.
std::shared_ptr< Buffers::BufferManager > get_buffer_manager()
Gets the buffer manager from the default engine.
Definition Graph.cpp:148
std::shared_ptr< Vruta::TaskScheduler > get_scheduler()
Gets the task scheduler from the default engine.
Definition Chronie.cpp:26

References get_buffer_manager(), MayaFlux::Config::get_buffer_size(), MayaFlux::Config::get_sample_rate(), get_scheduler(), and MayaFlux::Kriya::record().

Referenced by MayaFlux::Core::SerialInputBackend::attach_readers(), bind_fly_preset(), bind_orbit_preset(), bind_pan_zoom_preset(), bind_screenspace_preset(), MayaFlux::Yantra::PhonemeExtractor< std::vector< Kakshya::DataVariant >, Kakshya::CompositeArray >::build_output(), MayaFlux::Yantra::SpeechSegmenter< std::vector< Kakshya::DataVariant >, Kakshya::RegionGroup >::build_output(), MayaFlux::Reflect::Tool::check_include(), MayaFlux::Yantra::IntervalExtractor< Eigen::MatrixXd, std::vector< std::vector< double > > >::collect(), MayaFlux::IO::collect_records(), MayaFlux::Reflect::Tool::RequestCollector::describe_nested(), MayaFlux::Nexus::StateEncoder::encode_fabric(), MayaFlux::Yantra::FeatureExtractor< std::vector< Kakshya::DataVariant >, std::vector< std::vector< double > > >::extract_implementation(), MayaFlux::Yantra::IntervalExtractor< Eigen::MatrixXd, std::vector< std::vector< double > > >::extract_implementation(), MayaFlux::Yantra::PhonemeExtractor< std::vector< Kakshya::DataVariant >, Kakshya::CompositeArray >::extract_implementation(), MayaFlux::Yantra::SpeechSegmenter< std::vector< Kakshya::DataVariant >, Kakshya::RegionGroup >::extract_implementation(), MayaFlux::Yantra::IntervalExtractor< Eigen::MatrixXd, std::vector< std::vector< double > > >::extract_intervals(), MayaFlux::Yantra::PhonemeExtractor< std::vector< Kakshya::DataVariant >, Kakshya::CompositeArray >::extract_phonemes(), MayaFlux::Yantra::IntervalExtractor< Eigen::MatrixXd, std::vector< std::vector< double > > >::extract_resident(), MayaFlux::Yantra::SpeechSegmenter< std::vector< Kakshya::DataVariant >, Kakshya::RegionGroup >::extract_segments(), MayaFlux::Nexus::StateEncoder::fill_expanse(), MayaFlux::Yantra::SpeechSegmenter< std::vector< Kakshya::DataVariant >, Kakshya::RegionGroup >::find_speech(), MayaFlux::Core::UDPBackend::get_endpoints(), MayaFlux::IO::SpatialReader::Impl::index_streams(), MayaFlux::Reflect::Tool::insert_include(), MayaFlux::Yantra::SpeechSegmenter< std::vector< Kakshya::DataVariant >, Kakshya::RegionGroup >::measure_speech(), MayaFlux::Core::UDPBackend::on_receive(), MayaFlux::Core::UDPBackend::open_endpoint(), MayaFlux::Yantra::PhonemeExtractor< std::vector< Kakshya::DataVariant >, Kakshya::CompositeArray >::pieces_of(), MayaFlux::Yantra::Vision::VisionWorkflow::process_to_stream(), MayaFlux::Kakshya::CompositeFieldCodec< std::vector< T > >::read(), MayaFlux::IO::SpatialReader::read_sample(), MayaFlux::Yantra::PhonemeExtractor< std::vector< Kakshya::DataVariant >, Kakshya::CompositeArray >::recognise_phonemes(), MayaFlux::Yantra::BitonicSorter< OutputType >::record_sort(), MayaFlux::Yantra::StandardSorter< std::vector< Kakshya::DataVariant > >::record_sort(), MayaFlux::Reflect::Tool::render_sidecar(), MayaFlux::Core::UDPBackend::resolve_endpoint_for_sender(), MayaFlux::Reflect::Tool::RequestCollector::run(), MayaFlux::Reflect::Tool::SignatureCollector::run(), MayaFlux::Yantra::SpeechSegmenter< std::vector< Kakshya::DataVariant >, Kakshya::RegionGroup >::segment(), MayaFlux::Yantra::PhonemeExtractor< std::vector< Kakshya::DataVariant >, Kakshya::CompositeArray >::selected_rows(), MayaFlux::Core::UDPBackend::send(), and MayaFlux::Core::UDPBackend::transition_state().

Here is the call graph for this function:
Here is the caller graph for this function: