# Path: pyskool/skoolsound.py
# def create_sounds(game, odir, verbose=True, force=False, sample_rate=44100, max_amplitude=65536):
#     wrote_wavs = False
#     for sound in SOUNDS[game]:
#         delays_f, subdir, fname = FILES[sound]
#         sounds_dir = os.path.join(odir, subdir)
#         if not os.path.isdir(sounds_dir):
#             os.makedirs(sounds_dir)
#         wav = os.path.join(sounds_dir, fname + '.wav')
#         if force or not os.path.isfile(wav):
#             if verbose:
#                 print('Writing {0}'.format(wav))
#             samples = delays_to_samples(delays_f(), sample_rate, max_amplitude)
#             write_wav(samples, wav, sample_rate)
#             wrote_wavs = True
#     if verbose and not wrote_wavs:
#         print("All sound files present")
# 
# SKOOL_DAZE = 'skool_daze'
# 
# BACK_TO_SKOOL = 'back_to_skool'
# 
# SKOOL_DAZE_TAKE_TOO = 'skool_daze_take_too'
# 
# EZAD_LOOKS = 'ezad_looks'
# 
# BACK_TO_SKOOL_DAZE = 'back_to_skool_daze'


import sys
import os
from pyskool.skoolsound import (create_sounds, SKOOL_DAZE, BACK_TO_SKOOL,
                                SKOOL_DAZE_TAKE_TOO, EZAD_LOOKS, BACK_TO_SKOOL_DAZE)
            verbose = False
        elif arg.startswith('-'):
            print_usage()
        else:
            p_args.append(arg)
        i += 1
    if len(p_args) != 1:
        print_usage()
    return p_args[0], verbose

def print_usage():
    sys.stderr.write("""Usage: {0} [options] DIRECTORY

  Creates the stock Pyskool sound files in a subdirectory named 'sounds' in
  DIRECTORY.

Options:
  -q  Be quiet
""".format(os.path.basename(sys.argv[0])))
    sys.exit(1)

###############################################################################
# Begin
###############################################################################
odir, verbose = parse_args(sys.argv[1:])
sounds_dir = os.path.join(odir, 'sounds')
create_sounds(SKOOL_DAZE, sounds_dir, verbose)
create_sounds(BACK_TO_SKOOL, sounds_dir, verbose)
create_sounds(SKOOL_DAZE_TAKE_TOO, sounds_dir, verbose)
create_sounds(EZAD_LOOKS, sounds_dir, verbose)

# Path: pyskool/skoolsound.py
# def create_sounds(game, odir, verbose=True, force=False, sample_rate=44100, max_amplitude=65536):
#     wrote_wavs = False
#     for sound in SOUNDS[game]:
#         delays_f, subdir, fname = FILES[sound]
#         sounds_dir = os.path.join(odir, subdir)
#         if not os.path.isdir(sounds_dir):
#             os.makedirs(sounds_dir)
#         wav = os.path.join(sounds_dir, fname + '.wav')
#         if force or not os.path.isfile(wav):
#             if verbose:
#                 print('Writing {0}'.format(wav))
#             samples = delays_to_samples(delays_f(), sample_rate, max_amplitude)
#             write_wav(samples, wav, sample_rate)
#             wrote_wavs = True
#     if verbose and not wrote_wavs:
#         print("All sound files present")
# 
# SKOOL_DAZE = 'skool_daze'
# 
# BACK_TO_SKOOL = 'back_to_skool'
# 
# SKOOL_DAZE_TAKE_TOO = 'skool_daze_take_too'
# 
# EZAD_LOOKS = 'ezad_looks'
# 
# BACK_TO_SKOOL_DAZE = 'back_to_skool_daze'


# Path: utils/create-sounds.py
import sys
import os
from pyskool.skoolsound import (create_sounds, SKOOL_DAZE, BACK_TO_SKOOL,
                                SKOOL_DAZE_TAKE_TOO, EZAD_LOOKS, BACK_TO_SKOOL_DAZE)

            verbose = False
        elif arg.startswith('-'):
            print_usage()
        else:
            p_args.append(arg)
        i += 1
    if len(p_args) != 1:
        print_usage()
    return p_args[0], verbose

def print_usage():
    sys.stderr.write("""Usage: {0} [options] DIRECTORY

  Creates the stock Pyskool sound files in a subdirectory named 'sounds' in
  DIRECTORY.

Options:
  -q  Be quiet
""".format(os.path.basename(sys.argv[0])))
    sys.exit(1)

###############################################################################
# Begin
###############################################################################
odir, verbose = parse_args(sys.argv[1:])
sounds_dir = os.path.join(odir, 'sounds')
create_sounds(SKOOL_DAZE, sounds_dir, verbose)
create_sounds(BACK_TO_SKOOL, sounds_dir, verbose)
create_sounds(SKOOL_DAZE_TAKE_TOO, sounds_dir, verbose)
create_sounds(EZAD_LOOKS, sounds_dir, verbose)

create_sounds(BACK_TO_SKOOL_DAZE, sounds_dir, verbose)