Module g_audioprep
[frames] | no frames]

Source Code for Module g_audioprep

 1  #!/usr/bin/env python 
 2   
 3  """This script takes the loudest channel from a multichannel 
 4  .wav file and converts it to any format known by gpkimgclass.py 
 5  Note that channel numbers start with zero. 
 6  """ 
 7  from gpk_voicing import dirty_io 
 8   
 9   
10   
11  if __name__ == '__main__': 
12          import sys 
13          channel = None 
14          arglist = sys.argv[1:] 
15          while arglist and arglist[0].startswith('-'): 
16                  arg = arglist.pop(0) 
17                  if arg == '--': 
18                          break 
19                  elif arg == '-c': 
20                          channel = int(arglist.pop(0)) 
21                  else: 
22                          die.die('Unrecognized argument: %s' % arg) 
23          if len(arglist) != 2: 
24                  print __doc__ 
25                  sys.exit(1) 
26   
27          x = dirty_io.wav_read(arglist[0], channel) 
28          x.write(arglist[1]) 
29