Skip to content

Commit

Permalink
Added metadata to google speech2text
Browse files Browse the repository at this point in the history
  • Loading branch information
DatSpace authored and randaz81 committed Mar 30, 2022
1 parent a54479c commit 6d20fb9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions speechInteraction/modules/googleSpeech/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,14 @@ class Processing : public yarp::os::TypedReaderCallback<yarp::sig::Sound>
config->set_language_code(language.c_str());
config->set_sample_rate_hertz(sample_rate);
config->set_encoding(RecognitionConfig::LINEAR16);

config->set_use_enhanced(true); // Can be used with the correct model. If true but no model specified, it does nothing.
auto metadata = config->mutable_metadata();

metadata->set_microphone_distance(google::cloud::speech::v1::RecognitionMetadata_MicrophoneDistance_MIDFIELD);
metadata->set_recording_device_type(google::cloud::speech::v1::RecognitionMetadata_RecordingDeviceType_OTHER_INDOOR_DEVICE);
metadata->set_interaction_type(google::cloud::speech::v1::RecognitionMetadata_InteractionType_VOICE_COMMAND);
metadata->set_original_media_type(google::cloud::speech::v1::RecognitionMetadata_OriginalMediaType_AUDIO);
}

/********************************************************/
Expand Down

0 comments on commit 6d20fb9

Please sign in to comment.