Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
streaming_sample_source_file.hpp File Reference

File-backed FrameReader factory for StreamingSampleSource. More...

#include <algorithm>
#include <array>
#include <cstdint>
#include <limits>
#include <memory>
#include <string>
#include <string_view>
#include <vector>
#include <pulp/audio/audio_file.hpp>
#include <pulp/audio/buffer.hpp>
#include <pulp/audio/mmap_reader.hpp>
#include <pulp/audio/streaming_sample_source.hpp>
#include <pulp/runtime/crypto.hpp>

Go to the source code of this file.

Classes

struct  pulp::audio::FileFrameReader
 A FrameReader plus the opened file's properties, ready to feed into a StreamingSampleSourceConfig (channels / total_frames / sample_rate). More...

Namespaces

namespace  pulp
namespace  pulp::audio

Functions

FileFrameReader pulp::audio::make_retained_memory_mapped_frame_reader (std::shared_ptr< MemoryMappedAudioReader > mapped, bool require_ranged_read=false, bool compute_content_identity=false, std::uint64_t maximum_mapped_bytes=std::numeric_limits< std::uint64_t >::max())
 Bind an existing immutable mapped snapshot.
FileFrameReader pulp::audio::make_memory_mapped_frame_reader (std::string_view path, bool require_ranged_read=false, bool compute_content_identity=false, std::uint64_t maximum_mapped_bytes=std::numeric_limits< std::uint64_t >::max(), std::shared_ptr< MemoryMappedAudioReader > *retained_reader=nullptr)
 Open and retain a mapped reader for path.

Detailed Description

File-backed FrameReader factory for StreamingSampleSource.

Adapts an audio file into a FrameReader so StreamingSampleSource can play it through the streaming machinery (resident preload + background-filled ring + RT-safe pull) — the audio thread never decodes or allocates.

The returned callback retains one MemoryMappedAudioReader and delegates each request to read_frames(). Seek-readable formats such as WAV therefore decode only the requested range. Formats without a ranged decoder use the reader's explicit decode-once fallback; callers can inspect supports_ranged_read before admitting a source under a strict streaming-memory policy.