Voicen Python SDK
Documentation
This is Python SDK to use Speech-to-text service of Voicen. To see more about
API visit to API Documentation. You are free to
develop your own SDK for different languages using Voicen API documentation.
Installation
You can install SDK direct from pip repository running this command:
pip install --upgrade voicen-python-sdk
You can also install from source code:
python setup.py install --user
Requirements
- Python 2.7+ or Python 3.4+
Usage
Before using this SDK you must have an Access Token. To get Access Token visit
to API Token page. There is an Access Token
generated for you. Use this Access Token to create your client:
from voicen import vcnclient
voicen_client = vcnclient.VoicenClient('ACCESS_TOKEN')
Sending a file
Once you have set up your client with your Access Token you can send a file to
transcribe. You also must specify language of speech.
job = voicen_client.create_job_with_local_file('PATH_TO_FILE', 'LANGUAGE')
Sending media url
Once you have set up your client with your Access Token you can send a media URL
to transcribe. For example you can use youtube URL as a media URL. You also must
specify language of speech.
job = voicen_client.create_job_with_media_url('MEDIA_URL', 'LANGUAGE')
Checking status of job
You can check status of job using its id
job_details = voicen_client.get_job(job.id)
Getting list of jobs
You can get list of jobs.
jobs = voicen_client.get_jobs()
jobs = voicen_client.get_jobs(limit=50)
jobs = voicen_client.get_jobs(start_after=1203)
Deleting job
You can delete job using its id
voicen_client.delete_job(job.id)
Getting your transcription
You can get your transcription in these formats:
- json
- text
- srt(SubRip Text)
- Microsoft Word
transcription = voicen_client.get_transcription(job.id)
transcription_text = voicen_client.get_transcription_as_text(job.id)
transcription_srt = voicen_client.get_transcription_as_srt(job.id)
transcription_msword = voicen_client.get_transcription_as_msword(job.id)
Getting account details
You can get you account email and balance in seconds.
account = voicen_client.get_account()
Getting payment details
You can get your payment details.
payment = voicen_client.get_payments()