Skip to content

Commit

Permalink
Parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
rupin committed Oct 5, 2019
1 parent 6433f6b commit aaa7286
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
Binary file added Row_4_45.0.wav
Binary file not shown.
27 changes: 19 additions & 8 deletions createAudio.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,29 @@ def testBlank():



def generateAllAudio(myfile):
def generateAudio(myfile,pending_row=-1):
wb = xlrd.open_workbook(myfile)
sheet = wb.sheet_by_index(0)
lastTiming=0
lastDuration=0
#sheet.cell_value(0, 0)
combined_sounds = AudioSegment.silent(duration=1)
rowcount=sheet.nrows
for row in range (1, 2):
timeslot=sheet.cell_value(row, 0)
sentence=sheet.cell_value(row, 1)
createAudioFile(row,timeslot, sentence)
#audioStream=convertTTS(sentence)
if(pending_row>0):
if(pending_row<=rowcount):
timeslot=sheet.cell_value(pending_row, 0)
sentence=sheet.cell_value(pending_row, 1)
createAudioFile(pending_row,timeslot, sentence)
else:
print("Row number "+str(pending_row)+" does not exist in the input file")
sys.exit(2)
else:

for row in range (1, 2):
timeslot=sheet.cell_value(row, 0)
sentence=sheet.cell_value(row, 1)
createAudioFile(row,timeslot, sentence)
#audioStream=convertTTS(sentence)



Expand Down Expand Up @@ -159,12 +169,13 @@ def main(argv):
#print ('Input file is "', inputfile)
#print ('Output file is "', outputfile)
if(operationType=="GENERATE_AUDIO"):
generateAllAudio(inputfile)
generateAudio(inputfile)

elif(operationType=="COMBINE_AUDIO"):
pass
elif(operationType=='GENERATE_AUDIO_FOR_ROW'):
pass
generateAudio(inputfile,rownum)
#pass

if __name__ == "__main__":
main(sys.argv[1:])

0 comments on commit aaa7286

Please sign in to comment.