kokolegorille

kokolegorille

Speech to text - are there are tools that can convert an audio source to text?

Hello everyone,

I would like to search/index videos by keywords.

The first step to do this is to translate audio to text. I know of some clouds providers that does speech-to-text, but before this, I would like to understand what I would need to roll my own.

I know the opposite, text-to-speech, is quite easy with some open source tools.

Did You meet similar task of converting audio source to text? If so do You know open source libraries that could help me achieve this?

Thanks for taking time

Marked As Solved

idi527

idi527

GitHub - mozilla/DeepSpeech: DeepSpeech is an open source embedded (offline, on-device) speech-to-text engine which can run in real time on devices ranging from a Raspberry Pi 4 to high power GPU servers. · GitHub is rather easy to use, but it’s very slow, at least on CPU. To transcribe a two second audio clip of me saying “hello, hello” it takes 10 seconds. But it’s quite accurate.

I also had to use ffmpeg to transcode the recording into a format deepspeech understands:

ffmpeg -i New\ Recording\ 3.m4a -acodec pcm_s16le -ac 1 -ar 16000 audio.wav

Also Liked

kokolegorille

kokolegorille

For those interested in the subject, I did some basic tests with GitHub - mozilla/DeepSpeech: DeepSpeech is an open source embedded (offline, on-device) speech-to-text engine which can run in real time on devices ranging from a Raspberry Pi 4 to high power GPU servers. · GitHub

$ deepspeech --model deepspeech-0.5.1-models/output_graph.pbmm --alphabet deepspeech-0.5.1-models/alphabet.txt --lm deepspeech-0.5.1-models/lm.binary --trie deepspeech-0.5.1-models/trie --audio audio/8455-210777-0068.wav 
Loading model from file deepspeech-0.5.1-models/output_graph.pbmm
TensorFlow: v1.13.1-10-g3e0cc5374d
DeepSpeech: v0.5.1-0-g4b29b78
2019-09-27 01:53:25.693154: E tensorflow/core/framework/op_kernel.cc:1325] OpKernel ('op: "UnwrapDatasetVariant" device_type: "GPU" host_memory_arg: "input_handle" host_memory_arg: "output_handle"') for unknown op: UnwrapDatasetVariant
2019-09-27 01:53:25.693187: E tensorflow/core/framework/op_kernel.cc:1325] OpKernel ('op: "UnwrapDatasetVariant" device_type: "CPU"') for unknown op: UnwrapDatasetVariant
2019-09-27 01:53:25.693200: E tensorflow/core/framework/op_kernel.cc:1325] OpKernel ('op: "WrapDatasetVariant" device_type: "GPU" host_memory_arg: "input_handle" host_memory_arg: "output_handle"') for unknown op: WrapDatasetVariant
2019-09-27 01:53:25.693211: E tensorflow/core/framework/op_kernel.cc:1325] OpKernel ('op: "WrapDatasetVariant" device_type: "CPU"') for unknown op: WrapDatasetVariant
Loaded model in 0.0174s.
Loading language model from files deepspeech-0.5.1-models/lm.binary deepspeech-0.5.1-models/trie
Loaded language model in 1.38s.
Running inference.
your power is sufficient i said
Inference took 1.562s for 2.590s audio file.

It looks promising and is even faster than expected. And with a compatible card, it is possible to run on GPU :slight_smile:

Thanks again @idi527 for the link. Now I need to glue ffmpeg and deepspeech with Elixir to have the beginning of a working solution.

marcelfahle

marcelfahle

Hello Christian, I’m curious about your findings as well. My Gist so far:

  • Whisper is great at speech recognition, has timing issues though and I’m not yet sure how to deal with silences in speech (I want to hide subs for example when nobody is talking.. use VAD Voice Activity Detection on top? Dunno :person_shrugging: ) I ran my own and also on replicate.com, which is pretty fast (1h file in 90 secs)
  • Sonix feels like the goat to me. Similarly good in regards of speech as whisper, but way better timings, speaker diarization, etc, etc. BUT: expensive! :slight_smile:
  • rev.ai - is what I’m currently using for my Video CMS. It’s actually pretty good and timings are very accurate. It’s much cheaper than Sonix and I feel gives me the best bang for the buck right now (I’m currently torn between sonix and rev :slight_smile: )
  • aws transcribe - feels “ok”. timings are good, speech in my examples maybe a little less accurate than rev.ai
  • fireflies - Cool tool, didn’t play with it that much yet. I think they might use whisper under the hood, as I see a bunch of weird words that whisper was able to catch successfully (none of the others did), and they caught them too. They also have timing issues.
  • deepgram - feels very similar what aws and rev give me on my first few tries. pretty cheap though and lots of features, so I will play some more with it. I give them props for good DX as well.

Anyway, that’s quickly from me. Would love a DM from you to see what your experiences are. Thank you! :slightly_smiling_face:

kokolegorille

kokolegorille

I am using erlport to communicate with python scripts.
I added poolboy to be able to process multiple files concurently, but limited to 10 workers.

Here is an example for the sample file, in french…

iex(9)> WhisperStt.speech_to_text path, "fr"
{:ok,
 %{
   language: "fr",
   segments: [
     %{end: 1.0, start: 0.0, text: "C'est le machine-machin."},
     %{
       end: 3.0,
       start: 1.0,
       text: "La machine-machin est la plus mignonne de l'automobile."
     },
     %{end: 4.0, start: 3.0, text: "Il a des détails très tristiques."},
     %{
       end: 5.0,
       start: 4.0,
       text: "Le tristique, la position, le pain, le poids,"
     },
     %{end: 6.0, start: 5.0, text: "plus un mètre incroyable."},
     %{end: 7.0, start: 6.0, text: "Le mètre machine, le poids, le place,"},
...

I have python installed on the server, and I have a requirements.txt for the plugin.

Where Next?

Popular in Questions Top

chokchit
** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2733ms. You can configure how long re...
New
New
Kurisu
For example for a current url like http://localhost:4000/cosmetic/products?_utf8=✓&query=perfume&page=2, I would like to get: ...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
JulienCorb
I am trying to implement my new.html.eex file to create new posts on my website. new.html.eex: <h1>Create Post</h1> <%= ...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: The documentation above suggests that while ...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

Other popular topics Top

hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement