Octopus Speech-to-Index — C API
API Reference for the Octopus C SDK .
pv_octopus_t
Container representing the Octopus Speech-to-Index engine.
pv_octopus_match_t
Container representing a matched utterance.
pv_octopus_init()
Creates an Octopus instance. Resources should be cleaned when you are done using the pv_octopus_delete() function.
Parameters
access_key
const char * : AccessKey obtained from Picovoice Console .model_path
const char * : Absolute path to the file containing model parameters (.pv
).object
pv_octopus_t * * : Constructed instance of Octopus.
Returns
- pv_status_t : Status code.
pv_octopus_delete()
Releases resources acquired by Octopus.
Parameters
object
pv_octopus_t * : Picovoice object.
pv_octopus_index()
Indexes audio data. The audio needs to have a sample rate equal to pv_sample_rate()
and be 16-bit linearly-encoded. This function operates on single-channel audio.
Parameters
object
pv_octopus_t * : Octopus object.pcm
int16_t : Audio data.num_samples
int32_t : Number of audio samples to process.indices
void * * : Index metadata.num_indices_bytes
int32_t * : Size of index metadata in bytes.
Returns
- pv_status_t : Status code.
pv_octopus_index_file()
Indexes an audio file.
Parameters
object
pv_octopus_t * : Octopus object.path
const char * : Absolute path to the audio file.indices
void * * : Index metadata.num_indices_bytes
int32_t * : Size of index metadata in bytes.
Returns
- pv_status_t : Status code.
pv_octopus_search()
Searches index metadata for occurrences of a given phrase.
Parameters
object
pv_octopus_t * : Octopus object.indices
void * : Index metadata.num_indices_bytes
int32_t : Size of index metadata in bytes.phrase
const char * : Search phrase.matches
pv_octopus_match_t * * : Utterances matching the search phrase.num_matches
int32_t * : Numbers of matched utterances.
Returns
- pv_status_t : Status code.
pv_octopus_version()
Getter for version.
Returns
- const char * : Octopus version.
pv_sample_rate()
Audio sample rate accepted by Octopus.
Returns
- int32_t : Sample rate.
pv_status_t
Status code enum.
pv_status_to_string()
Parameters
status
int32_t : Status code.
Returns
- const char * : String representation of status code.