I was trying to use google speech to text API and i read about the NuGet Google APIs packages that can be helpful in speech recognition. Here is the link complete package my code based on documentation provide on https://developers.google.com/api-client-library/dotnet/get_started
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Google.Apis.CloudSpeechAPI.v1beta1.Data;
using Google.Apis.CloudSpeechAPI.v1beta1;
using Google.Apis.Services;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Cloud Speech Api");
try
{
new Program().Run().Wait();
}
catch(AggregateException ex)
{
foreach (var e in ex.InnerExceptions)
{
Console.WriteLine("Error: "+ e.Message);
}
}
Console.WriteLine("Press any key to continue");
Console.ReadKey();
}
private async Task Run()
{
var service = new CloudSpeechAPIService(new BaseClientService.Initializer
{
ApplicationName ="Speech Recognition",
ApiKey="Api key",
});
Console.WriteLine("Executing a list request...");
var result = await service.Apis.List().ExecuteAsync();
if (result.Items != null)
{
foreach (DirectoryList.ItemsData api in result.Items)
{
Console.WriteLine(api.Id + " - " + api.Title);
}
}
}
}
}
code is showing error in line
var result = await service.Apis.List().ExecuteAsync(); //Error:'APIS ' definition not exist
also i am not sure that code is correct. please help