Skip to content

Commit

Permalink
Script angepasst
Browse files Browse the repository at this point in the history
  • Loading branch information
Thorsten Voß authored and Thorsten Voß committed Apr 25, 2019
1 parent fe6296d commit d5d872b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 143 deletions.
141 changes: 0 additions & 141 deletions add_lead_in_messages.py

This file was deleted.

6 changes: 4 additions & 2 deletions tools/create_audio_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
argparser.add_argument('-o', '--output', type=str, default='sd-card', help='The directory where to create the audio messages. (default: `sd-card`)')
text_to_speech.addArgumentsToArgparser(argparser)
argparser.add_argument('--skip-numbers', action='store_true', help='If set, no number messages will be generated (`0001.mp3` - `0255.mp3`)')
argparser.add_argument('--only-new', action='store_true', help='If set, only new messages will be created.')
args = argparser.parse_args()


Expand All @@ -31,7 +32,6 @@
targetDir = args.output
if os.path.isdir(targetDir):
print("Directory `" + targetDir + "` already exists.")
exit(1)
else:
os.mkdir(targetDir)
os.mkdir(targetDir + '/advert')
Expand All @@ -51,5 +51,7 @@
match = lineRe.match(line.strip())
if match:
fileName = match.group(1)
if args.only_new and os.path.isfile(targetDir + "/" + fileName):
continue
text = match.group(2)
text_to_speech.textToSpeechUsingArgs(text=text, targetFile=targetDir + '/mp3/' + fileName, args=args)
text_to_speech.textToSpeechUsingArgs(text=text, targetFile=targetDir + "/" + fileName, args=args)

0 comments on commit d5d872b

Please sign in to comment.