whisper_ros: whisper.cpp for ROS 2
Loading...
Searching...
No Matches
whisper_ros::Whisper Class Reference

#include <whisper.hpp>

Collaboration diagram for whisper_ros::Whisper:

Public Member Functions

 Whisper (const std::string &model, const std::string &openvino_encode_device, int n_processors, const struct whisper_context_params &cparams, const struct whisper_full_params &wparams)
 
 ~Whisper ()
 
struct transcription_output transcribe (const std::vector< float > &pcmf32)
 
std::string trim (const std::string &s)
 
std::string timestamp_to_str (int64_t t, bool comma=false)
 
bool set_grammar (const std::string grammar, const std::string start_rule, float grammar_penalty)
 
void reset_grammar ()
 
void set_init_prompt (const std::string prompt)
 
void reset_init_prompt ()
 

Protected Attributes

int n_processors
 
struct whisper_full_params wparams
 
struct whisper_context * ctx
 
grammar_parser::parse_state grammar_parsed
 
std::vector< const whisper_grammar_element * > grammar_rules
 

Constructor & Destructor Documentation

◆ Whisper()

Whisper::Whisper ( const std::string & model,
const std::string & openvino_encode_device,
int n_processors,
const struct whisper_context_params & cparams,
const struct whisper_full_params & wparams )

◆ ~Whisper()

Whisper::~Whisper ( )

Member Function Documentation

◆ reset_grammar()

void Whisper::reset_grammar ( )

◆ reset_init_prompt()

void Whisper::reset_init_prompt ( )

◆ set_grammar()

bool Whisper::set_grammar ( const std::string grammar,
const std::string start_rule,
float grammar_penalty )

◆ set_init_prompt()

void Whisper::set_init_prompt ( const std::string prompt)

◆ timestamp_to_str()

std::string Whisper::timestamp_to_str ( int64_t t,
bool comma = false )

◆ transcribe()

struct transcription_output Whisper::transcribe ( const std::vector< float > & pcmf32)

◆ trim()

std::string Whisper::trim ( const std::string & s)

Member Data Documentation

◆ ctx

struct whisper_context* whisper_ros::Whisper::ctx
protected

◆ grammar_parsed

grammar_parser::parse_state whisper_ros::Whisper::grammar_parsed
protected

◆ grammar_rules

std::vector<const whisper_grammar_element *> whisper_ros::Whisper::grammar_rules
protected

◆ n_processors

int whisper_ros::Whisper::n_processors
protected

◆ wparams

struct whisper_full_params whisper_ros::Whisper::wparams
protected

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