Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7704221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:38:14+00:00 2026-05-31T23:38:14+00:00

I’ve been trying to get a certain Google API to work for two days

  • 0

I’ve been trying to get a certain Google API to work for two days now. Three different projects have been tried – one in Perl (which died very early on) one in Python (crashed and burnt at the last hurdle) and finally one in Ruby. The Ruby one actually works when called from the commandline as a standard command, i.e.:

speech2text somefile.wav

It even works if you open up irb and put in the sample code found on the project site:

require 'speech'
audio = Speech::AudioToText.new("i-like-pickles.wav")
puts audio.to_text.inspect

However, a Ruby .rb file with the above in will not work when executed with ruby -rubygems somescript.rb. It exits with this:

/Library/Ruby/Gems/1.8/gems/speech2text-0.3.4/lib/speech/audio_inspector.rb:50:in `initialize': undefined method `first' for nil:NilClass (NoMethodError)
from /Library/Ruby/Gems/1.8/gems/speech2text-0.3.4/lib/speech/audio_splitter.rb:77:in `new'
from /Library/Ruby/Gems/1.8/gems/speech2text-0.3.4/lib/speech/audio_splitter.rb:77:in `initialize'
from /Library/Ruby/Gems/1.8/gems/speech2text-0.3.4/lib/speech/audio_to_text.rb:15:in `new'
from /Library/Ruby/Gems/1.8/gems/speech2text-0.3.4/lib/speech/audio_to_text.rb:15:in `to_text'
from script/test_s2t.rb:6

Attempting to use the commandline binary speech2text from Java as a runtime process results in the same error message being fed back. The offending line it complains about is:

    def initialize(file)
  self.duration = Duration.new(`ffmpeg -i #{file} 2>&1`.strip.scan(/Duration: (.*),/).first.first)
end

But the idea of there actually being a problem in there seems unlikely to me, given that it works perfectly when executed in either irb or via the binary on a terminal.

The real problem here is that I don’t know Ruby at all – I work in Java, and I simply need this API to function. The fact that it runs in some methods tells me I probably installed it correctly, but unless I can get a .rb script to work or get it to execute externally, I can’t see how to use it. I’ve had JRuby recommended to me, but that might be too complicated for me, as it seems it would require a manual installation of the ruby gem for JRuby, which I don’t know how to do (or at least, I don’t think I know how to do it!)

Any advice on the core error message much appreciated, but if you see a clear sidestep to the problem do let me know.

EDIT – It was, indeed, a path problem – at least on the face of it. Ruby was having trouble locating the exact files involved, and speech2text/ffmpeg was failing rather obscurely as a result. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T23:38:15+00:00Added an answer on May 31, 2026 at 11:38 pm

    This smells like a path issue. You should always specify the full path to the file as other processes can change their working directory to other locations internally. Another possibility would be a changed $PATH so that ffmpeg can not be resolved to an absolute path.

    Generally, you should try to specify your paths as absolute as possible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am trying to loop through a bunch of documents I have to put
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.