How to use Microsoft's sample speech synthesis and speech recognition program (oxford-speech-api).

Asked 2 years ago, Updated 2 years ago, 32 views

I am a beginner in a program planning to read English using Microsoft's oxford-speech-api.
I got the Primary Key and Secondary Key from Microsoft Azure and ran a sample. The error appears in "require'oxford-speech-api'" in line 1.
Please tell me the cause and countermeasures.

■ Sample Program (oxford-speech-api-sample.rb)

require'oxford-speech-api'
api=OxfordSpeechApi.new("clientId", "secret")
# Note) ClientId and secret are replaced with Primary Key and Secondary Key (32-digit alphanumeric characters) respectively

# api.speech2text("file.wav", "audio/wav", "8000") # returns json
api.text2speech("hello world")#returnwav

■Error Message

ruby oxford-speech-api-sample.rb
C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in 'require':cannot load Such file --rest-client (LoadError)
from C: /Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in'require'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/oxford-speech-api-0.0.1/lib/oxford-speech-api.rb:1:in' [top(required)]'   Note) Top(required) replaces the inequality with [ ] because it is actually surrounded by inequality but does not appear.
from C: /Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb: 135: in 'require'
from C: /Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb: 135: in 'resque in require'
from C: /Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb: 144: in 'require'
from oxford-speech-api.rb:1:in '[main]'

■ Calculation conditions

 ruby-v: ruby 2.1.7p400 (2015-08-18 revision 51632) [i386-mingw32]
gem list —oxford-speech-api (0.0.1)

Windows 7 HomePremium Service Pack 1
Model: VAIO Series Processor: Pentium® Dual-Core CPU E6300 @ 2.80 GHz 2.80 GHz Implementation Memory (RAM): 4.00GB System Type: 64-bit OS

Thank you for your cooperation

ruby

2022-09-29 22:26

1 Answers

This is because oxford-speech-api(0.0.1) specifies rest-client>=0 and an older version (most recently 1.8.0), but uses the new name require'rest-client'.
Rewriting oxford-speech-api.rb to the old calling require'rest_client' seems to work


2022-09-29 22:26

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.