Please consider a donation to the Higher Intellect project. See or the Donate to Higher Intellect page for more info.

SoundMachine 2.1

From Higher Intellect Vintage Wiki
Jump to navigation Jump to search
SoundMachine 2.1
April 1994
Copyright © Rod Kennedy, 1993-1994.

For the Macintosh.

Play and record SND/AU (mu-law, A-law, linear) and AIFF/AIFC (MACE3, MACE6) sound
files.   Plethora of buttons during play to change speed, play backwards, loop
sounds, switch formats, etc.  No restriction on file size; playing can take place
in background.
For Impatient New Users:

Use Balloon help (you really only need to use it during the learning phase).
Sound Formats Supported (Play and Record):

Ą Ulaw/Mu-law/µ-law: (SND_FORMAT_MULAW_8)
TalkRadio (Geek of the week), or International Telephony format, i.e., 8Khz at 8
bit mono making 64kbits/s (as defined in CCITT G711), or Sun Sparc station
format, or Next format, blah blah.  With SoundMachine you can record in the µ-law
format at any sample rate from 4kHz up to 22.3kHz (the mac hardware rate, at
least on the older macs).   Stick to the preferred 8kHz rate (default) if
exporting a µ-law sound to the Sun platform or you haven't got a clue about what
you are doing. 

Ą AIFF/AIFC (none, MACE3 and MACE6 compression supported)
Preferred mac format for big sound sound files; all sound data is in the data
fork (no resource fork information). When playing, SoundMachine hunts for the
sampled data chunk and plays that and ignores things like the  MIDI chunk.  Since
compression schemes such as MACE3 are dynamical in nature (have a state or
memory) then playing such a sound backwards causes sound artefacts.  I rely on
the Sound Manager to expand (convert) in real time rather than do the conversion
manually (whereby I could cleanup the backward playing).  Stereo play supported. 
When recording (mono and 8 bits), the sample rate is the hardware rate of 22.3kHz
but you can select from the three standard compression schemes.   MACE3 is
recommended for the 8 bit mac platform since it outperforms µ-law which is
memoryless and designed for speech.  

This is roughly speaking the European equivalent of µ-law.  Everything is the
same as for the µ-law description above (just replace µ with A and Bob's your
uncle). Play and record facility.

Ą Linear 8 bit 2's complement: (SND_FORMAT_LINEAR_8)
Just like µ-law and A-law this is another one of the SND/AU formats. 
SoundMachine supports play and record.  

Ą FSSD non-compressed (play only)
For example, the sound format supplied with Sound Source's Star Trek.  There is a
Huffman endoded FSSD format but I don't have enough info about it yet to support
it.  SoundMachine relies on information in the resource fork to determine the
sample rate.
Data is offset binary 8 bit mono (just like 'snd ' resource format).

Ą Other 8 bit formats (override any header)
You can switch to 2's complement or offset binary representation, µ-law, A-law to
hear if an unknown sound type is in one of the formats above.

Needs System 7.  Can use the Speech Manager if present.  Currently requires a
68020 or better.  I recommend that you use the new Sound Manager 3.0.  Really
needs the Apple Sound Chip or better (AV) to work.
Technical Aspects:

Ą µ-law recording is generated indirectly and not in real time (however, the
conversion can be put in the background).  SoundMachine records to an
uncompressed AIFF 22.3kHz file; applies an approximate ideal low pass, digital,
antialias filter (approximate delayed truncated sinc impulse response filter)
then linearly interpolates and resamples to the user specified sample rate (which
is twice the cut-off frequency of the low pass filter).  The AIFF linear data is
overwritten by µ-law converted data and the file is truncated if necessary; and
finally the AIFF header is overwritten with a SND/AU header.]

Ą Uses a custom double buffering technique to play arbitrarily large files
continuously from disk.  It relies on other applications being multitasking
friendly to give a continuous sound output.  SoundMachine does not prime its
buffers at interrupt time.

Ą The size of the buffers it allocates depends on the application memory size;
increase this if you think there is a problem with the quality of the sound
(especially if use use very high sampling rates, e.g., 44.1kHz (CD) or 48.0kHz
(DAT)).  The very minimum application size is 256K and is suitable for most 8kHz
µ-law sounds.

Ą Be very wary about using the high quality Speech Manager voices as they are
system memory hogs.  If your memory is limited you should consider using Mr
Hughes or Boris (best of the robotic voices) or disabling the voices altogether
using the preferences file.

Ą This is not intended to be a sound format converter (that task is
straightforward but very painful to implement, see "SOX") but rather a player for
the most common (mac-orientated) SAMPLED SOUND sound formats (let's face it,
primarily 8 bit µ-law).

Sounds can be fastforwarded; reversed and sped-up; paused and looped.  Clicking 
within the progress bar skips to that portion of the sound.  There are some
keyboard equivalents like:
 Ą g (go) meaning play
 Ą p (pause)
 Ą f (fast forward)
 Ą b (backwards)
 Ą <right arrow> next file in queue
 Ą <left arrow> previous file in queue
 Ą <down arrow> volume down (unrelated to the control panel setting; A and µ-law
 Ą <up arrow> volume up
 Ą s (stop)
 Ą l (loop)
 Ą u (uh?) sound format change
 Ą i (information) cycle through the information fields
 Ą command period
If you forget just use balloon help.
Additional Features: 

Any number of files (max 100) can be dragged and dropped onto the application
icon and SoundMachine will queue and (try to) play every file.  For help on how
to drive SoundMachine use Balloon Help.  If there is no data in the data fork of
the file, then the file is just skipped (with a warning alert).

The preferences are kept in a file called "SoundMachine Prefs" (this is different
previous versions of SoundMachine which used "SoundMachine Preferences"; this
older preferences file should be discarded since the data is in a slightly
different format; no harm will come if you don't discard it).
Future Things to do:

1. ADPCM formats.
2. Sound level display.
3. 'snd ' resource playing capability.
4. Play text files using the Speech voice.
5. 16 bit sound.
6. Greater than 2 channel (stereo) support.

Please report any bugs or info on any other sound format you want supported (no
promises).  With bugs try and describe a precisely as possible the nature of the
problem.  Also forward a binhexed version of the sound file if you think this
might be the problem.

SoundMachine is freeware.  I retain the copyright, including the right to alter
or sell the program.  You may use and copy SoundMachine freely only on a
non-commercial basis.  SoundMachine cannot be distributed with any commercial
package without my permission.   An exception is that SoundMachine may be
included on any CD ROM provided I get a free copy of that CD ROM (this applies
also to any updates of SoundMachine that are later included on any CD ROM).  You
may not alter or sell this program without my permission.  This ReadMe file must
accompany SoundMachine.

Many thanks to a bunch of Northern Hemispherian beta testers.
Obscure Stuff:

unsigned char UlawToSnd[] = // x1 (default)
  3,  7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63,
 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96,
 98, 99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,

This table is actually not the best conversion possible if higher quality sound
is desired.  After conversion of a µ-law number to a 16 bit linear number,
SoundMachine has a facility to scale this number and extract the any 8 bits (with
saturation) to send to the sound channel (after lookup table conversion).

Currently SoundMachine supports numbers 1, 2 and 27

The intention is to support also 3 and 23 to 26; most of the rest are insane.

0       SND_FORMAT_UNSPECIFIED  unspecified format 
1       SND_FORMAT_MULAW_8      8-bit mu-law samples
2       SND_FORMAT_LINEAR_8     8-bit linear samples
3       SND_FORMAT_LINEAR_16    16-bit linear samples
4       SND_FORMAT_LINEAR_24    24-bit linear samples
5       SND_FORMAT_LINEAR_32    32-bit linear samples
6       SND_FORMAT_FLOAT        floating-point samples
7       SND_FORMAT_DOUBLE       double-precision float samples
8       SND_FORMAT_INDIRECT     fragmented sampled data
9       SND_FORMAT_NESTED       ?
10      SND_FORMAT_DSP_CORE     DSP program
11      SND_FORMAT_DSP_DATA_8   8-bit fixed-point samples
12      SND_FORMAT_DSP_DATA_16  16-bit fixed-point samples
13      SND_FORMAT_DSP_DATA_24  24-bit fixed-point samples
14      SND_FORMAT_DSP_DATA_32  32-bit fixed-point samples
15      ?
16      SND_FORMAT_DISPLAY      non-audio display data
18      SND_FORMAT_EMPHASIZED   16-bit linear with emphasis
19      SND_FORMAT_COMPRESSED   16-bit linear with compression
20      SND_FORMAT_COMPRESSED_EMPHASIZED        A combination of the two above
21      SND_FORMAT_DSP_COMMANDS Music Kit DSP commands
25      SND_FORMAT_ADPCM_G723_3
26      SND_FORMAT_ADPCM_G723_5