FAQ Index

1. Why does Snack seem unstable on the Macintosh?
2. How do I get printing to work on Windows?
3. I downloaded and installed Snack and Tcl on Windows, but Snack does not work.
4. I did not install Tcl and Snack in the default directories on Windows and now it does not work.
5. I can only play sound using wish, how do I do this with tclsh?
6. Can I use the Snack package with tclsh?
7. I have created a moving play marker. Why does it go out of synch?
8. I have installed the CSLU speech toolkit. Can I use Snack at the same time?
9. How do I read the NIST/Sphere file formats using Snack?
10. I have a problem with Snack which I can not solve despite the documentation, the examples, the source, or there is a feature missing.
11. I found a bug in Snack, how do I proceed?


1. You have to give Tcl scripts ample memory on the Macintosh, since audio data consume lots of memory. This is done by marking the wish icon and selecting Edit | Show info | Memory.

2. Snack creates postscript files for printing. On Windows, for example, you will need Ghostscript and GSview to view and print postscript. These tools can also be downloaded from http://www.cs.wisc.edu/~ghost/. To print a Tk generated postscript file, e.g. "out.ps", use a Tcl statement like this in your script
exec C:/gs/gs7.04/bin/gswin32 "-IC:\gs\gs7.04;C:\gs\gs7.04\fonts" -sDEVICE=laserjet -dNOPAUSE out.ps -c quit

3. Make sure you have a matching version of Snack and Tcl, see the download page.

4. The directory structure looks like this after installing Tcl and Snack in their default locations:

5. Snack uses the event loop to play sounds asynchronously, that is, in the background. Using the option -blocking yes to the play command, this can be changed to synchronous play, which makes the play command return first once the sound has finished playing. This works for both tclsh and wish. If you use Snack to play audio from tclsh instead of wish, then asynchronous play works only if the event loop has been started with, for example, the vwait command, see aserver.tcl for an example. Note that use of the after command will cause the event loop to block. If you need to use after you should make sure that the event loop is still running, for example, using after 1000 {set flag 1} ; vwait flag

6. The visualization part of Snack needs Tk. If you only need to play sound you can use the command package require sound to get only the audio functionality of Snack. Depending on your local configuration you may or may not be able to load Snack into Tcl, regardless of the fact that some parts of it requires Tk.

7. Synchronization performance is dependent on sound hardware and device drivers. On Windows, DirectSound should be used if synchronization is important, e.g. play sounds using play -device "Primary Sound Driver". The behaviour of the pause command is a bit platform dependent, on some platforms playback stops only after a short lag. If synchronization is important here, use stop and play instead, in conjunction with the snack::audio elapsed command to keep track of where to restart. See the xs.tcl script for an example of this.

8. Yes. Simply install Snack for Tcl v8.0 in the default location. Skip the installation of Tcl, as it is already contained in the CSLU toolkit distribution. Move the directory C:\Program Files\Tcl\lib\snack2.1\ to C:\CSLU\Tcl80\lib\ or correspondingly.

9. Refer to the README file in the source distribution. Linux RedHat users can obtain the shared library needed here and Windows users can obtain the DLL needed here, put the library in the same directory as libsnack.so/dll and use "package require snacksphere" in your scripts.

10. Send an e-mail with your question, try to give a full explanation, including information such as Tcl version, Snack version, platform.

11. If possible try to write a minimal script which causes the problem. You should also add the line

snack::debug 5 debug.log

at the beginning of your script. Create all sound objects and canvas items with debug flags, -debug 5, and run the script to create the log-file, debug.log. Mail me the script and the debug-log together with any related sound file.


Snack home