Skip to content

Instantly share code, notes, and snippets.

View kohlishivam's full-sized avatar

Shivam Kohli kohlishivam

  • Delhi, India
View GitHub Profile
filepath = "~/audio_wav/" #Input audio file path
output_filepath = "`/Transcripts/" #Final transcript path
bucketname = "upload" #Name of the bucket created in the step before
# Import libraries
from pydub import AudioSegment
import io
import os
from google.cloud import speech
from google.cloud.speech import enums
import re
def remove_special_characters(text):
pattern = r'[^a-zA-z\s]'
text = re.sub(pattern, '', text)
return text