# Path: opensauce/snack.py
# def snack_pitch(wav_fn, method, data_len, frame_shift=1,
#                 window_size=25, max_pitch=500, min_pitch=40,
#                 tcl_shell_cmd=None):
# def snack_raw_pitch(wav_fn, method, frame_shift=1, window_size=25,
#                     max_pitch=500, min_pitch=40, tcl_shell_cmd=None):
# def snack_raw_pitch_exe(wav_fn, frame_shift, window_size, max_pitch, min_pitch): # pragma: no cover
# def snack_raw_pitch_python(wav_fn, frame_shift, window_size, max_pitch, min_pitch):
# def snack_raw_pitch_tcl(wav_fn, frame_shift, window_size, max_pitch, min_pitch, tcl_shell_cmd):
# def snack_formants(wav_fn, method, data_len, frame_shift=1,
#                    window_size=25, pre_emphasis=0.96, lpc_order=12,
#                    tcl_shell_cmd=None):
# def snack_raw_formants(wav_fn, method, frame_shift=1, window_size=25,
#                        pre_emphasis=0.96, lpc_order=12, tcl_shell_cmd=None):
# def snack_raw_formants_exe(wav_fn, frame_shift, window_size, pre_emphasis, lpc_order): # pragma: no cover
# def snack_raw_formants_python(wav_fn, frame_shift, window_size, pre_emphasis, lpc_order):
# def snack_raw_formants_tcl(wav_fn, frame_shift, window_size, pre_emphasis, lpc_order, tcl_shell_cmd):


import sys
import os
import glob
import numpy as np
from opensauce.snack import snack_raw_pitch, snack_raw_formants, sformant_names
    fn = os.path.splitext(os.path.basename(fn))[0]
    fn = '-'.join(('sample', fn, col_name, sample))
    fn = os.path.join(out_dir, fn) + '.txt'
    np.savetxt(fn, data)

def main(wav_dir, out_dir):
    # Find all .wav files in test/data directory
    wav_files = glob.glob(os.path.join(wav_dir, '*.wav'))

    # Generate Snack data for each wav file and save it to text files
    method = 'tcl'
    for wav_file in wav_files:
        print('Processing wav file {}'.format(wav_file))
        # Generate raw Snack pitch samples
        # Use VoiceSauce default parameter values
        F0_raw, V_raw = snack_raw_pitch(wav_file, method, frame_shift=1, window_size=25, max_pitch=500, min_pitch=40)

        # Save raw Snack pitch samples
        wav_basename = os.path.basename(wav_file)
        # Save F0 and V data to separate text files
        save_samples(F0_raw, wav_basename, 'sF0', '1ms', out_dir)
        save_samples(V_raw, wav_basename, 'sV', '1ms', out_dir)

        # Generate raw Snack formant samples
        # Use VoiceSauce default parameter values
        estimates_raw = snack_raw_formants(wav_file, method, frame_shift=1, window_size=25, pre_emphasis=0.96, lpc_order=12)

        # Save raw Snack formant samples
        wav_basename = os.path.basename(wav_file)
        # Save data to separate text files

# Path: opensauce/snack.py
# def snack_pitch(wav_fn, method, data_len, frame_shift=1,
#                 window_size=25, max_pitch=500, min_pitch=40,
#                 tcl_shell_cmd=None):
# def snack_raw_pitch(wav_fn, method, frame_shift=1, window_size=25,
#                     max_pitch=500, min_pitch=40, tcl_shell_cmd=None):
# def snack_raw_pitch_exe(wav_fn, frame_shift, window_size, max_pitch, min_pitch): # pragma: no cover
# def snack_raw_pitch_python(wav_fn, frame_shift, window_size, max_pitch, min_pitch):
# def snack_raw_pitch_tcl(wav_fn, frame_shift, window_size, max_pitch, min_pitch, tcl_shell_cmd):
# def snack_formants(wav_fn, method, data_len, frame_shift=1,
#                    window_size=25, pre_emphasis=0.96, lpc_order=12,
#                    tcl_shell_cmd=None):
# def snack_raw_formants(wav_fn, method, frame_shift=1, window_size=25,
#                        pre_emphasis=0.96, lpc_order=12, tcl_shell_cmd=None):
# def snack_raw_formants_exe(wav_fn, frame_shift, window_size, pre_emphasis, lpc_order): # pragma: no cover
# def snack_raw_formants_python(wav_fn, frame_shift, window_size, pre_emphasis, lpc_order):
# def snack_raw_formants_tcl(wav_fn, frame_shift, window_size, pre_emphasis, lpc_order, tcl_shell_cmd):


# Path: tools/generate_snack_samples.py
import sys
import os
import glob
import numpy as np
from opensauce.snack import snack_raw_pitch, snack_raw_formants, sformant_names

    fn = os.path.splitext(os.path.basename(fn))[0]
    fn = '-'.join(('sample', fn, col_name, sample))
    fn = os.path.join(out_dir, fn) + '.txt'
    np.savetxt(fn, data)

def main(wav_dir, out_dir):
    # Find all .wav files in test/data directory
    wav_files = glob.glob(os.path.join(wav_dir, '*.wav'))

    # Generate Snack data for each wav file and save it to text files
    method = 'tcl'
    for wav_file in wav_files:
        print('Processing wav file {}'.format(wav_file))
        # Generate raw Snack pitch samples
        # Use VoiceSauce default parameter values
        F0_raw, V_raw = snack_raw_pitch(wav_file, method, frame_shift=1, window_size=25, max_pitch=500, min_pitch=40)

        # Save raw Snack pitch samples
        wav_basename = os.path.basename(wav_file)
        # Save F0 and V data to separate text files
        save_samples(F0_raw, wav_basename, 'sF0', '1ms', out_dir)
        save_samples(V_raw, wav_basename, 'sV', '1ms', out_dir)

        # Generate raw Snack formant samples
        # Use VoiceSauce default parameter values
        estimates_raw = snack_raw_formants(wav_file, method, frame_shift=1, window_size=25, pre_emphasis=0.96, lpc_order=12)

        # Save raw Snack formant samples
        wav_basename = os.path.basename(wav_file)
        # Save data to separate text files

        for n in sformant_names: