Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

C# Rev.ai transcription

using System;
using System.Net.Http;
using System.Threading.Tasks;
using System.Text;
using Newtonsoft.Json.Linq;

public class Program
{
  public static async Task Main(string[] args)
  {
    using (var client = new HttpClient())
    {
      client.DefaultRequestHeaders.Add("Authorization", "Bearer <YOUR_TOKEN_HERE>");
      JObject json = JObject.Parse(@"{
        metadata: 'example metadata',
        notification_config: {
          url: 'https://www.example.com/callback',
          auth_headers: {
            Authorization: 'Bearer <notification-url-token>'
          }
        },
        source_config: {
          url: 'https://www.rev.ai/FTC_Sample_1.mp3',
          auth_headers: {
            Authorization: 'Bearer <source-url-token>'
          }
        },
        transcriber: 'machine',
        skip_diarization: false,
        skip_punctuation: false,
        remove_disfluencies: false,
        filter_profanity: false,
        speaker_channel_count: 1,
        delete_after_seconds: 2592000,
        custom_vocabulary_id: 'cvgnDwmB6iXevn',
        language: 'en'
      }");
      var postData = new StringContent(json.ToString(), Encoding.UTF8, "application/json");
      var request = await client.PostAsync("https://api.rev.ai/speechtotext/v1/jobs", postData);
      var response = await request.Content.ReadAsStringAsync();

      Console.WriteLine(response);
    }
  }
}
Source by docs.rev.ai #
 
PREVIOUS NEXT
Tagged: #transcription
ADD COMMENT
Topic
Name
8+2 =