项目作者: alexemanuelol

项目描述 :
Converts an audio file to a text file.
高级语言: Python
项目地址: git://github.com/alexemanuelol/AudioToText.git
创建时间: 2021-04-25T13:52:18Z
项目社区:https://github.com/alexemanuelol/AudioToText

开源协议:GNU General Public License v3.0

下载


AudioToText

Converts an audio file to a text file.

Test result

This test is performed on ‘The Hobbit’ audio book read by Rob Inglis.

The actual speech from the audio book:

  1. Chapter one. An unexpected party. In a hole in the ground there lived a hobbit. Not a nasty,
  2. dirty, wet hole, filled with the ends of worms and an oozy smell, nor yet a dry, bare, sandy
  3. hole with nothing in it to sit down on or to eat: it was a hobbit-hole, and that means comfort.
  4. It had a perfectly round door like a porthole, painted green, with a shiny yellow brass knob in
  5. the exact middle. The door opened on to a tube-shaped hall like a tunnel: a very comfortable
  6. tunnel without smoke, with panelled walls, and floors tiled and carpeted, provided with polished
  7. chairs, and lots and lots of pegs for hats and coatsthe hobbit was fond of visitors. The tunnel
  8. wound on and on, going fairly but not quite straight into the side of the hill The Hill, as all
  9. the people for many miles round called itand many little round doors opened out of it, first on
  10. one side and then on another. No going upstairs for the hobbit: bedrooms, bathrooms, cellars,
  11. pantries (lots of these), wardrobes (he had whole rooms devoted to clothes), kitchens,
  12. dining-rooms, all were on the same floor, and indeed on the same passage. The best rooms were all
  13. on the left-hand side (going in), for these were the only ones to have windows, deep-set round
  14. windows looking over his garden, and meadows beyond, sloping down to the river. This hobbit was
  15. a very well-to-do hobbit, and his name was Baggins. The Bagginses had lived in the neighbourhood
  16. of The Hill for time out of mind, and people considered them very respectable, not only because
  17. most of them were rich, but also because they never had any adventures or did anything unexpected:
  18. you could tell what a Baggins would say on any question without the bother of asking him. This is
  19. a story of how a Baggins had an adventure, and found himself doing and saying things altogether
  20. unexpected. He may have lost the neighbours respect, but he gainedwell, you will see whether he
  21. gained anything in the end. The mother of our particular hobbitwhat is a hobbit? I suppose
  22. hobbits need some description nowadays, since they have become rare and shy of the Big People,
  23. as they call us. They are (or were) a little people, about half our height, and smaller than
  24. the bearded Dwarves. Hobbits have no beards.

The speech recognition from the script:

  1. Chapter one. An unexpected party. In a hole in the ground there lived a hobbit. Nothing nasty
  2. dirty wet hole. Chilling with the ends of worms andaloussi smell. No yes it dry bad sandy hole
  3. with nothing added to sit down on or to eat. It was a hobbit hole. And that means comfort. It
  4. had a perfectly round door like a porthole. Painted green. With a shiny yellow brass knob in the
  5. exact middle. The door opened onto a tube-shaped hole like a tunnel. A very comfortable tunnel
  6. without smoke. With paneled walls and floors tiled and carpeted. Provided was published chairs.
  7. Lots and lots of pegs for hats and coats. The hobbit was fun to visitors. The tunnel wound on and
  8. on. Going fairly but not quite straight into the side of the hill. Zeze. As all the people from
  9. many miles round coded. Anime need to surround the doors open. of it. First on one side and then
  10. on another. No going upstairs for the hobbit. Bedrooms. Bathrooms. Sellers. Pantry lots of these.
  11. Wardrobes. He had told rooms to go close. Kitchens. Dining rooms. Or on the same floor and indeed
  12. on the same passage. The best rooms were all on the left hand side going in. For these were the
  13. only ones to have windows. Deep set round windows looking over his garden and meadows beyond.
  14. Sloping down to the river. This hobbit was a very well-to-do hobbit. And his name was baggins.
  15. Lebakkens is it lived in the neighborhood of the hill for time out of mind. I'm people consider
  16. them very respectable not only because most of them were very rich. But also because they never
  17. had any adventures or did anything unexpected. You could tell what a baggins would say on any
  18. question without the bother of asking him. This is a story of how a baggins had an adventure.
  19. And found himself doing and saying things altogether unexpected. He may have lost the neighbors
  20. respect. But he gained. Well you will see whether he gained anything in the end. The mother of our
  21. particular hobbit. What is a hobbit. I suppose hobbits need some description nowadays. Since that
  22. becoming a i don't try of the big people is they call us. They are. A little people. About hoffa
  23. height. I'm smaller than the bearded dwarves. Puppies have no beards.

Dependencies

Run the following command to install the dependencies:

  1. $ pip install -r requirements

Usage

  1. usage: audio_to_text.py [-h] [-o OUTPUT] [-l LANGUAGE] input
  2. Converts an audio file to text.
  3. positional arguments:
  4. input The input audio file.
  5. optional arguments:
  6. -h, --help show this help message and exit
  7. -o OUTPUT, --output OUTPUT
  8. The output file for the text. Default 'outputText.txt'
  9. -l LANGUAGE, --language LANGUAGE
  10. See 'https://cloud.google.com/speech-to-text/docs/languages'
  11. for all possible language codes, Default is en-GB.