This script leverages the AssemblyAI API to transcribe audio files into text. It can handle individual audio files or entire folders containing audio.
- Install Python 3.
- Install the
assemblyai
library:pip install assemblyai
- (Optional) Create a standalone executable:
pyinstaller --onefile aai.py
aai <audio_file or path to folder> <language> <api key>
- audio_file or path to folder: The path to the audio file or folder containing audio files.
- language: The language code of the audio. For example,
ru
for Russian. - api key: Your AssemblyAI API key. You can get one at https://www.assemblyai.com/.
aai /Users/john/Downloads/test en xxxxxxx
This command will transcribe the file /Users/john/Downloads/test.mp3
(or all audio files in the /Users/john/Downloads/test
folder if it's a folder) to English using the provided API key.
- .opus
- .mp3
- .wav
- .ogg
- .flac
- .m4a
- .aac
- .wma
- .oga
The script will create a text file (.txt
) with the same name as the input audio file in the same directory. For example, if you transcribe audio.mp3
, the script will create audio.mp3.txt
.
Этот скрипт использует API AssemblyAI для преобразования аудиофайлов в текст. Он может обрабатывать как отдельные аудиофайлы, так и целые папки с аудио.
- Установите Python 3.
- Установите библиотеку
assemblyai
:pip install assemblyai
- (Опционально) Создайте автономный исполняемый файл:
pyinstaller --onefile aai.py
aai <audio_file или путь к папке> <язык> <api ключ>
- audio_file или путь к папке: Путь к аудиофайлу или папке, содержащей аудиофайлы.
- язык: Код языка аудио. Например,
ru
для русского языка. - api ключ: Ваш API-ключ AssemblyAI. Вы можете получить его на сайте https://www.assemblyai.com/.
aai d:/downloads/test ru xxxxxxx
Эта команда транскрибирует файл d:/downloads/test.mp3
(или все аудиофайлы в папке d:/downloads/test
, если это папка) на русский язык, используя указанный API-ключ.
- .opus
- .mp3
- .wav
- .ogg
- .flac
- .m4a
- .aac
- .wma
- .oga
Скрипт создаст текстовый файл (.txt
) с тем же именем, что и исходный аудиофайл, в той же папке. Например, если вы транскрибируете файл audio.mp3
, скрипт создаст файл audio.mp3.txt
.