123456789101112131415161718192021222324 |
- # -*- coding: utf-8 -*-
- """script_download_mp3.ipynb
- Automatically generated by Colaboratory.
- Original file is located at
- https://colab.research.google.com/drive/12QC9ULnH-_nhwNOO9phzGEt57rSVysM0
- """
- # script to download the audio files:
- import os
- import re
- import urllib.request
- from pydub import AudioSegment as am
- child_list = ['Joe','The']
- for child in child_list:
- files = os.listdir(f'soderstrom/recordings/raw/{child}/')
- for file in files:
- if file.endswith('.mp3'):
- sound = am.from_file(f'soderstrom/recordings/raw/{child}/{file}', format='mp3', frame_rate=22050)
- sound = sound.set_frame_rate(16000)
- sound.export(f'recordings/raw/{child}/{file}', format='mp3')
-
|