-
Notifications
You must be signed in to change notification settings - Fork 1
AWS Transcribe
rdh edited this page Mar 28, 2024
·
8 revisions
Something like this in config/ai/asr.yml
:
aws: &aws
adapter: aws
access_key_id: <%= ENV.fetch('AWS_ACCESS_KEY_ID') %>
secret_access_key: <%= ENV.fetch('AWS_SECRET_ACCESS_KEY') %>
region: <%= ENV.fetch('AWS_REGION') %>
bucket: <%= ENV.fetch('AWS_TRANSCRIBE_BUCKET') %>
folder: <%= ENV.fetch('AWS_TRANSCRIBE_FOLDER') %>
language_code: en-US
aws_diarization: &aws_diarization
<<: *aws
settings:
show_speaker_labels: true
max_speaker_labels: 10
path = 'spec/data/audio/ebn.wav'
adapter = ActiveIntelligence::ASR::Config.new.adapter(:aws_diarization)
json = adapter.transcribe(path, raw: true)
File.write('spec/dummy/tmp/diarization.json', JSON.pretty_generate(json))