script_download_wav_file.py 624 B

1234567891011121314151617181920
  1. # -*- coding: utf-8 -*-
  2. """script_download_mp3.ipynb
  3. Automatically generated by Colaboratory.
  4. Original file is located at
  5. https://colab.research.google.com/drive/12QC9ULnH-_nhwNOO9phzGEt57rSVysM0
  6. """
  7. # script to download the audio files:
  8. import os
  9. import re
  10. import urllib.request
  11. child_list = ['Joe','The']
  12. for child in child_list:
  13. files = os.listdir(f'Soderstrom_/{child}/')
  14. for f in files:
  15. path = f'https://media.talkbank.org/childes/Eng-NA/Soderstrom/0wav/{child}/{re.split("[.]",f)[0]}.wav'
  16. urllib.request.urlretrieve(path, f'soderstrom/recordings/raw/{child}/{re.split("[.]",f)[0]}.wav')