def find_files(directory, pattern='*.wav'):
 files = []
 for (root, dirnames, filenames) in os.walk(directory):
  for filename in fnmatch.filter(filenames, pattern):
   files.append(os.path.join(root, filename))
 return files

def find_files ( directory , pattern = '*.wav' ) : files = [ ] for ( root , dirnames , filenames ) in os . walk ( directory ) : for filename in fnmatch . filter ( filenames , pattern ) : files . append ( os . path . join ( root , filename ) ) return files
yield filenames .