# macOS only. Speaks every hook line of hooks-analysed.json with the Samantha voice: all 90 at say -r 155, the 30 default-fill lines also at -r 120 and -r 190.
import json, subprocess, os
d = json.load(open('hooks-analysed.json')); os.makedirs('wav', exist_ok=True)
say = lambda txt, rate, out: subprocess.run(['say', '-v', 'Samantha', '-r', str(rate), '--data-format=LEI16@22050', '-o', out, txt], check=True)
for r in d:
    say(r['text'], 155, 'wav/r155_%s_%02d.wav' % (r['fill'], r['i']))
    if r['fill'] == 'default':
        for rate in (120, 190): say(r['text'], rate, 'wav/r%d_%s_%02d.wav' % (rate, r['fill'], r['i']))
