home *** CD-ROM | disk | FTP | other *** search
/ PC World 2002 May / PCWorld_2002-05_cd.bin / Software / TemaCD / activetcltk / ActiveTcl8.3.4.1-8.win32-ix86.exe / ActiveTcl8.3.4.1-win32-ix86 / demos / Snack / CSLwithAB.tcl < prev    next >
Encoding:
Text File  |  2001-10-22  |  814 b   |  33 lines

  1. #!/bin/sh
  2. # the next line restarts using wish \
  3. exec wish8.3 "$0" "$@"
  4.  
  5. # This file shows how to handle CSL/NSP files with both A and B data chunks
  6.  
  7. package require -exact snack 2.1
  8.  
  9. set filename CSL_file_with_A_and_B_chunks.nsp
  10.  
  11. # Read in file using Snack's CSL/NSP decoder, which only gets channel A
  12. # This is done in order to determine the number of samples in each channel
  13.  
  14. snack::sound s -load $filename
  15.  
  16. set end [expr [s length] - 1]
  17.  
  18. # Now read channel A by treating the file as raw data skipping initial
  19. # headers and write it out in a file of its own
  20.  
  21. s read $filename -fileformat raw -skip 60 -end $end
  22.  
  23. s write channel_A.wav
  24.  
  25. # Read channel B by skipping channel A and initial headers and write it
  26.  
  27. s read $filename -fileformat raw -skip [expr 60 + $end * 2 + 8] -end $end
  28.  
  29. s write channel_B.wav
  30.  
  31. exit
  32.  
  33.