Speech To Text using IBM Watson Studio Last Updated : 19 Feb, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report IBM Watson Studio is an integrated environment designed to develop, train, manage models, and deploy AI-powered applications and is a Software as a Service (SaaS) solution delivered on the IBM Cloud. The IBM Cloud provides lots of services like Speech To Text, Text To Speech, Visual Recognition, Natural Language Classifier, Language Translator, etc. The Speech to Text service transcribes audio to text to enable speech transcription capabilities for applications. Create an instance of the service Go to the Speech to Text page in the IBM Cloud Catalog. Sign up for a free IBM Cloud account or log in. Click Create. Copy the Credentials to Authenticate to your service instance From the IBM Cloud Resource list, click on your Speech to Text service instance to go to the Speech to Text service dashboard page. On the Manage page, click Show Credentials to view your credentials. Copy the API Key and URL values. Module Needed: Json ibm_watson: This module does not comes pre-defined with Python. To install it type the below command in the terminal. pip install ibm_watson Now you're ready to use the IBM Cloud Services. Below code illustrates the use of IBM Watson studio's Speech To Text Service using Python and web socket interface Python3 1== #Python Program To Use IBM Watson # Studio's Speech To Text Below Code # Accepts only .mp3 Format of Audio # File import json from os.path import join, dirname from ibm_watson import SpeechToTextV1 from ibm_watson.websocket import RecognizeCallback, AudioSource from ibm_cloud_sdk_core.authenticators import IAMAuthenticator # Insert API Key in place of # 'YOUR UNIQUE API KEY' authenticator = IAMAuthenticator('YOUR UNIQUE API KEY') service = SpeechToTextV1(authenticator = authenticator) #Insert URL in place of 'API_URL' service.set_service_url('API_URL') # Insert local mp3 file path in # place of 'LOCAL FILE PATH' with open(join(dirname('__file__'), r'LOCAL FILE PATH'), 'rb') as audio_file: dic = json.loads( json.dumps( service.recognize( audio=audio_file, content_type='audio/flac', model='en-US_NarrowbandModel', continuous=True).get_result(), indent=2)) # Stores the transcribed text str = "" while bool(dic.get('results')): str = dic.get('results').pop().get('alternatives').pop().get('transcript')+str[:] print(str) Output The Output will be Transcript (Text) of audio file. Comment More infoAdvertise with us Next Article Speech To Text using IBM Watson Studio H harsh_thoriya Follow Improve Article Tags : Technical Scripter Python Technical Scripter 2019 python-utility Practice Tags : python Similar Reads Text to Speech by using pyttsx3 - Python Converting text to speech can add a new level of interactivity to our Python applications. Whether we want to create a virtual assistant or simply make our program more engaging, pyttsx3 is a library used for converting text into speech. This offline tool offers flexibility with male and female voic 3 min read Text to Speech by using ttsvoice - Python TTSVoice transforms written text into spoken language. TTSVoice Python library analyses text using natural language processing algorithms to produce synthetic speech that mimics human speech. Applications for this technology range from language translators to digital assistants like Siri and Alexa, 2 min read Convert Text to Speech in Python using win32com.client There are several APIs available to convert text to speech in python. One of such APIs available in the python library commonly known as win32com library. It provides a bunch of methods to get excited about and one of them is the Dispatch method of the library. Dispatch method when passed with the a 2 min read Speak the meaning of the word using Python The following article shows how by the use of two modules named, pyttsx3 and PyDictionary, we can make our system say out the meaning of the word given as input. It is module which speak the meaning when we want to have the meaning of the particular word. Modules neededPyDictionary: It is a Dictiona 2 min read Convert PDF File Text to Audio Speech using Python Let us see how to read a PDF that is converting a textual PDF file into audio.Packages Used:pyttsx3: It is a Python library for Text to Speech. It has many functions which will help the machine to communicate with us. It will help the machine to speak to usPyPDF2: It will help to the text from the P 2 min read Like