Play

[ NextMusic Home Page | Sound and Music Programs Page | Program List ]

Author:         Jean Laroche
Platforms:      NeXT
Prerequisites:  NS2.2 or higher?
Price:          free
Demo:           N/A
To acquire:     ftp://ftp.eecs.umich.edu/pub/nextmusic/Play.tar.Z (25k)
Information:    ?
Entry updated:  12 November 1996
Description:    A command-line utility that plays soundfiles to the DAC or A/D64X at any sample rate.

	Play contains a function that you call from a terminal to play sounds at any sampling rate, to the DACs or to the SingularSolutions AD64X interface. The sampling rate conversion is done on the fly on the DSP. there is a man page (play.1) (to visualize it do tbl play.1 | nroff -man | more, or place play.1 in your /usr/man/cat1...

	An "object" version of this function that you can use in your applications is described under PlayObject.

	SoundScaler is an example application that demonstrates the use of the Play object.



PLAY(1)             UNIX Programmer's Manual              PLAY(1)

NAME
     play - play sounds to DAC or A/D64X at any sampling rate.

SYNOPSIS
     play [ -Svscrd ] sound

DESCRIPTION
     play plays soundfiles recorded at any sampling rate. If the
     input soundfile's sampling rate is neither 44.1kHz, nor
     48kHz, play performs a real-time sampling rate conversion
     and sends its output either to the NeXT D/A converters or to
     Singular Solutions' A/D64X converters for SPDIFF digital
     transfer to a DAT machine. When the sound is output to the
     A/D64X converters, you need to specify the SPDIFF sampling
     rate.  play can play soundfiles (with a header) or raw
     binary files containing short ints, in which case you just
     need to specify the sound's sampling rate (play can recog-
     nize soundfiles from simple binary files). When playing
     binary files, play assumes the sound is mono, unless you
     specify it is stereo.  play can play mono, stereo sound-
     files, play only one of the two channels, or add the two
     channels and play in mono (for stereo soundfile). play can
     also swap the input sound's bytes, for compatibility with
     DEC machines, PCs etc. By using the shell command `setenv
     DEFAULT_SR 8000', you can select the default sampling rate
     (used only when the sound has no header, and no sampling
     rate is specified).

OPTIONS
     -v   Verbose.  Gives additional informations.

     -S sampling rate
          Specifies the sound's original sampling rate. When
          playing a soundfile, the original sampling rate is nor-
          mally read from the header. This option overrides the
          header value. When playing a headerless file, this
          option is used to set the sampling rate at which the
          sound will be played.

     -s   This can be used to swap the input sound octets before
          playing. Use this if your sound comes either from a DEC
          machine or from a PC. This option is valid only when
          the original sound is headerless.

     -cs  plays the sound in stereo mode. Valid either when the
          input sound is a stereo soundfile or when it's a raw
          binary file.

     -cl  plays only the sound's left channel. Valid only when
          the input sound is a stereo soundfile (not valid for
          raw binary files).

     -cr  plays only the sound's right channel. Valid only when
          the input sound is a stereo soundfile (not valid for
          raw binary files).

     -c+  mixes the sound's two channels, and plays them in mono.
          Valid only when the input sound is a stereo soundfile
          (not valid for raw binary files).

     -w   This option makes it possible to rescale sound before
          playing. Use this if your sound clicks when playing.
          The default rescaling value is 0.9. This option is dis-
          abled when bit faithful playing is performed.

     -d   automatically selects the best sampling rate between
          44.1kHz and 48kHz, converts the sound accordingly and
          outputs to A/D64X converters for SPDIFF transfer. The
          A/D64X converters is initialized if the last digital
          sampling rate used differs from the one chosen automat-
          ically (see the flag -i).

     -dh  converts the sound to 48kHz and outputs to A/D64X con-
          verters for SPDIFF transfer. The A/D64X converters is
          initialized if the last digital sampling rate used
          differs from 48kHz (see the flag -i).

     -dl  converts the sound to 44.1kHz and outputs to A/D64X
          converters for SPDIFF transfer. The A/D64X converters
          is initialized if the last digital sampling rate used
          differs from 44.1kHz (see the flag -i).

     -i   used to force the initialization of the A/D64X convert-
          ers to either 44.1kHz or 48kHz. The A/D64X box it set
          to "analog input" mode so it can use its internal clock
          to send SPDIFF data to connected devices (DAT etc)...
          The clock is chosen according to which (-d -dh or -dl)
          flag is used. Once you've done this initialization, you
          can omit this option, which enables the transfer to
          start earlier. Normally, the A/D64X converters is ini-
          tialized automatically whenever the digital output sam-
          pling rate changes.

     -K filter length
          This can be used to specify the filter length you want
          to use. This length is normally calculated automati-
          cally, so you shouldn't need to use this option.

     -B   This can be use to specify the type of filter windowing
          you want to use. By default, a Hanning window is used,
          giving a rejection of about -40dB to -50dB. It may be
          necessary in some cases to use a Blackman window to get
          more rejection (about -60dB), at the expense of a wider
          transition band. This can be done by use of the -B
          flag.

     -U upward conversion factor
          upward conversion factor. Normally, you don't need to
          use this option.

     -D downward conversion factor
          downward conversion factor. Normally, you don't need to
          use this option.

EXAMPLE
     "play -S16000 file" plays a headerless file at 16kHz.

     "play -dh -i file" sends the sound to the A/D64X converters,
     after initializing it. The transfer is bit-faithful (no
     conversion, digital transfer).

     "play -dh -i -S16000 file" converts a sound from 16kHz to
     48kHz and sends it to the A/D64X converters, after
     initializing it.

SEE ALSO
     sndinfo(1), record, srconv, fromsnd, tosnd

BUG
     AES/EBU is not supported. Only SPDIFF (consumer interface)
     can be used.

AUTHOR
     Jean Laroche, June 1992, TELECOM PARIS.



Eric M. Mrozek (mrozek@umich.edu), EECS-Systems, University of Michigan