Snack sound extension commands v1.3

(Last updated October 15, 1998)

Important notice: the -file option of the sound command has been renamed -load since v1.2.

Manual for version 1.2


audio
initSnack
sound
spectrogram
spectrogram canvas item
spectrum section canvas item
waveform canvas item

NAME

audio - Get/set properties of the audio device

SYNOPSIS

audio property ?arg?

DESCRIPTION

audio formats audio frequencies audio input ?jack? audio inputs audio output ?jack? audio outputs audio play_gain ?value? audio record_gain ?value?

BUGS

        This command is in a state of development. Solaris, Linux, and HP-UX have the most complete implementation. SGI users should use the system audio panel.

NAME

initSnack - Initialize the Snack extension

SYNOPSIS

initSnack

OPTIONS

None.

DESCRIPTION

This command should be run before any features of the Snack extension are used. It makes sure that the Snack library is actually loaded into memory before any of the non-command features (e.g. canvas items) are used.



NAME
        sound - Create and manipulate sounds
SYNOPSIS
        sound ?name? ?options?
DESCRIPTION
CREATING SOUNDS
        sound ?name? ?-load filename?  ?-file filename?  ?-channel channelname? ?-frequency f? ?-channels n? ?-format fmt?
SOUND COMMAND
soundName append variable ?-frequency f? ?-channels n? ?-format fmt? ?-skipHead n? ?-byteOrder endianess? ?-start start? ?-end end?
soundName byteswap
soundName cget option
soundName concatenate sound
soundName configure option value
soundName copy sound ?-start start? ?-end end?
soundName cut sound
soundName crop start end
soundName data variable ?-frequency f? ?-channels n? ?-format fmt? ?-skipHead n? ?-byteOrder endianess? ?-start start? ?-end end?
soundName data ?-start start? ?-end end? ?-fileFormat fileformat?-byteOrder ?endianess?
soundName destroy
soundName flush
soundName info
soundName insert sound sample ?-start start? ?-end end?
soundName max
soundName min
soundName length ?n? ?-units u?
soundName play ?-start start? ?-end end? ?-output jack? ?-blocking boolean?
soundName read filename ?-frequency f? ?-channels n? ?-format fmt? ?-skipHead n? ?-byteOrder endianess? ?-start start? ?-end end?
soundName record ?-frequency f? ?-channels n? ?-format fmt? ?-input jack?
soundName sample n ?value? ...
soundName stop
soundName write filename ?-start start? ?-end end?


NAME

sound - Create and manipulate sounds

SYNOPSIS

sound soundName

soundName option ?arg arg ...?

DESCRIPTION

A sound is an object which handles audio data. Sound objects can interact with files, variables, canvas items and the audio hardware.

CREATING SOUNDS

The sound command is used to create, delete, and operate on sound objects. It can take several different forms, depending on the option argument. The legal forms are:

sound ?soundName? ?-load filename?  ?-file filename?  ?-channel channelname? ?-frequency f? ?-channels n? ?-format fmt?

soundName specifies the name of the sound. If it is omitted then Snack picks a name of the form soundn, where n is an integer. The -load option specifies that the file filename should be read into memory after creating the sound. The -file option specifies an on-disk file which should be linked to the sound. The -channel options specifies that audio data resides on a channel which should be linked to the sound. In these cases the audio data is not loaded into memory, which is useful when playing large files or when using streaming audio. However, the Snack canvas item types, e.g. waveform, can not be linked to sounds of these types.

SOUND COMMAND

When a sound is created, Tcl also creates a new command whose name is the same as the sound name specified. This command may be used to invoke various operations on the sound. The following commands are possible for sounds:

soundName append variable ?-frequency f? ?-channels n? ?-format fmt? ?-skipHead n? ?-byteOrder endianess? ?-start start? ?-end end?

soundName byteswap soundName cget option soundName concatenate sound soundName configure option value ... soundName copy sound ?-start start? ?-end end? soundName crop start end soundName cut start end soundName data ?variable? ?option value? ... soundName destroy soundName flush soundName info soundName insert sound sample ?-start start? ?-end end? soundName length ?n? ?-units u? soundName max soundName min soundName play ?option value? ... soundName record ?option value? ... soundName read filename ?-frequency f? ?-channels n? ?-format fmt? ?-skipHead n? ?-byteOrder endianess? ?-start start? ?-end end? soundName sample n ?value? ... soundName stop soundName write filename ?-start start? ?-end end?


NAME

spectrogram - Real time spectrogram widget

SYNOPSIS

spectrogram pathName ?options value option value ...?

OPTIONS

-height size
-width size
-sound name
-winlength length
-fftlength length
-preemphasisfactor factor
-pixelspersecond value
-xscrollcommand value
-scrollincrement value
-brightness value
-contrast value
-topfrequency frequency

DESCRIPTION

See the code examples in the widget demonstration.
 


NAME

spectrogram - Spectrogram canvas item

SYNOPSIS

pathName create spectrogram x y ?options value option value ...?

OPTIONS

-height size
-width size
-sound name
-winlength length
-fftlength length
-preemphasisfactor factor
-pixelspersecond value
-tags tagList
-start sample
-end sample
-channel value
-brightness value
-contrast value
-topfrequency frequency
-gridtspacing value
-gridfspacing value

DESCRIPTION

See the code examples in the widget demonstration.


NAME

section - Spectrum section canvas item

SYNOPSIS

pathName create section x y ?options value option value ...?

OPTIONS

-height size
-width size
-sound name
-winlength length
-fftlength length
-preemphasisfactor factor
-tags tagList
-start sample
-end sample
-channel value
-fill value
-stipple value
-topfrequency frequency
-frame boolean

DESCRIPTION

See the code examples in the widget demonstration.


NAME

waveform - Waveform canvas item

SYNOPSIS

pathName create waveform x y ?option value option value ...?

OPTIONS

-height size
-width size
-sound name
-fill color
-stipple bitmap
-start sample
-end sample
-channel value
-pixelspersecond value
-zerolevel boolean
-tags tagList
-frame boolean
-limit value

DESCRIPTION

See the code examples in the widget demonstration.



SNACK home