tags:

views:

33

answers:

2

Sound Manager functions such as SndPlay() are deprecated and not available in 64-bit. The AudioServices functions are modern but only seem to deal with files and are not documented to handle this format.

A: 

Core Audio is definitely what you want. However, I believe you're mistaken on the Core Audio documentation. The table you linked to includes an entry for "NeXT/Sun Audio (.snd, .au)".

You mention that Core Audio "only seems to deal with files", but this isn't true. You can setup a graph with the source being of type kAudioUnitType_Generator and subtype kAudioUnitSubType_ScheduledSoundPlayer.

I wrote a morse code program that mixes multiple audio sources that are generated in memory. It might be a useful example. MTPlayer.m would be a reasonable place to start looking at the code.

nall
the Classic Mac OS 'snd ' resource format is not the same as the Sun/NeXT sound format with the file extension .snd.
Coxy
A: 

I'm not sure that there is a modern API to play them, perhaps because the format is both quite ancient and complicated, starting out in System 7 and being extended several times since.

What I found written about the 'snd ' resource:

System sound files are simply type 1 'snd ' resources stored with a type of 'sfil' and a creator of 'movr'. The Mac OS provides the familiar icon for them and permits playback in the Finder by double-clicking on them. An 'snd ' is a type of resource which consists of a series of commands for use by the Sound Manager. In addition to digitized sound samples, 'snd ' resources can contain direct frequency-modulated and wave table-based sounds. Any number of the three types can be combined with various effects to produce complex sound files. Simple Beep is an example of a non-digitized 'snd '. There are two types of 'snd ' resources, amazingly called type 1 and type 2. Type 1 is the format described above and is referred to as the System sound format. Type 2 is for use with HyperCard and can contain only a sampled (digitized) sound. SoundApp can play both types but will only convert sampled sounds. For more information on 'snd ' files consult Inside Macintosh VI or Inside Macintosh: Sound. A familiarity with the Resource Manager would also be helpful. 8-bit samples are stored as unsigned bytes, like SoundCap/Edit, but 16-bit samples are signed, like AIFF. Stereo 'snd ' resources are also possible, but Sound Manager 3.0 or later is required to play 16-bit samples directly. The possible types of compression for 'snd ' resources are the same MACE, IMA and µ-law types used in AIFF-C files.

Source: http://www-cs-students.stanford.edu/~franke/SoundApp/formats.html#system7

I would think that your best option is to re-record any such sounds into an intermediate lossless format for archival purposes, and then convert them into the best format for the requirements of your app.

Coxy
This is not an option because my app needs to be able to play sounds supplied by the user.
Michael Tsai