TweetFollow Us on Twitter

December 93 - SOMEWHERE IN QUICKTIME

SOMEWHERE IN QUICKTIME

WHAT'S NEW WITH SOUND MANAGER 3.0

JIM REEKES

[IMAGE 034-038_QuickTime_column1.GIF]

Sound Manager 3.0, a vastly improved call-for-call replacement for the Sound Manager in System 7, provides QuickTime and other sound clients with a set of new and improved features, including higher frame rates and better quality sound. Sound Manager 3.0 is an extension that entirely replaces the older Sound Manager; the extension is included along with a new Sound control panel on this issue's CD. We released it as an extension without changing the API so that you won't have to recode your existing applications. With Sound Manager 3.0 installed in your system, your applications will transparently take advantage of the Sound Manager's greater dependability, speed, and other new features.

The soon-to-be-available Inside Macintosh: Sound(or Inside Macintosh Volume VI, Chapter 22) is the main source of Sound Manager documentation. This column will discuss some of the new features of Sound Manager 3.0 and describe how to use them.

OVERVIEW OF MAJOR NEW FEATURES
Sound Manager 3.0 provides four major new features:

  • support for 16-bit audio samples
  • support for third-party audio hardware
  • support for plug-in audio codecs
  • better performance and quality

Previous versions of the Sound Manager could only support stereo 8-bit audio samples with sample rates up to 22 kHz. Sound Manager 3.0 removes this limitation by allowing stereo 16-bit audio samples with sample rates up to 65 kHz, providing CD-quality audio in QuickTime movies and other audio applications. Sound Manager 3.0 will also automatically convert 16-bit sounds into 8-bit sounds on Macintosh computers that don't have 16-bit audio hardware.

Third-party sound cards can be installed in your Macintosh to allow playback and recording of CD- quality audio. Sound Manager 3.0 makes this possible by providing a driver mechanism and a new Sound control panel that allows the user to redirect sound to any available audio device. Audio card developers can license the Sound Manager 3.0 extension and bundle it for distribution with their product.

The Sound Manager previously supported only MACE audio compression at ratios of 3:1 and 6:1. Sound Manager 3.0 goes beyond MACE to support any compressed audio format with the use of plug-in audio compression/decompression software (codecs). These are simply extension files that the Sound Manager recognizes and uses when it needs to play a compressed sound. In this way, applications can play compressed sounds seamlessly without being aware of the compressed format.

Sound Manager 3.0 is much faster -- in many cases two to three times more efficient than previous versions. This means that your application can do more while sound is playing. Sound Manager 3.0 isalso more robust: many bugs have been fixed and a number of commonly requested features have been added.

SYSTEM REQUIREMENTS AND INSTALLATION
Sound Manager 3.0 requires the Component Manager, so you must have either System 7 with QuickTime or System 7.1. (The Component Manager comes with QuickTime and is built into System 7.1.) Sound Manager 3.0 supports all Macintosh models except for the "classic"-style hardware such as the Macintosh Plus, SE, and Classic.

Installing Sound Manager 3.0 consists of dragging the Sound Manager extension and the new Sound control panel to your System Folder (where they will be placed in the appropriate folders) and rebooting. You should see Sound Manager 3.0's icon during startup.

WHAT'S NEW AND IMPROVED
Here are some more details about new and improved features in Sound Manager 3.0.

Speed optimizations. While Sound Manager 3.0 can play virtually any type of sound, it has been optimized for maximum playback efficiency with a number of common sound formats. So if you're worried about performance and want to minimize Sound Manager overhead, use one of these sound formats:

  • 8-bit, mono, 22.254 kHz, full volume
  • 8-bit, mono, 11.127 kHz, full volume

Increased efficiency is a major improvement in Sound Manager 3.0. In many cases, the Sound Manager will be two to three times more efficient, which allows applications to play more simultaneous sounds and do other work while sound is playing.

For example, you can now play four channels of sound on a Macintosh LC, whereas in the past the Sound Manager would not allow this. QuickTime applications benefit from Sound Manager 3.0 by gaining an increase in the movie playback frame rate. The premiere multimedia platform is now QuickTime 1.6 and Sound Manager 3.0 on a Macintosh!

Sound quality. Sound Manager 3.0 uses a fast linear interpolation for 11 kHz to 22 kHz sample rate conversion, which makes audio sampled at 11 kHz sound much better. This improves the sound quality of many QuickTime movies without sacrificing performance.

16-bit sound. Sound Manager 3.0 includes full support for 16-bit audio samples, including rate conversion, mixing, and decompression. It will automatically convert between 16-bit and 8-bit samples, so you never have to worry about the hardware you're running on. If your system has a 16- bit sound output device, you'll notice an increase in sound quality.

Until now, the value of the sampleSize field of the extended or compressed sound header has been 8 to denote the number of bits per sample. To play 16-bit sounds, specify the value 16 for the sampleSize field in the header, and the Sound Manager will treat the sound data as 16 bits per sample. 16-bit sounds are always in two's complement (signed) representation while 8-bit sounds are always in offset binary (unsigned) representation. For an example of how to fill out the extended sound header so that you can play 16-bit sounds, see Play16BitSound on this issue's CD.

Playing compressed sounds. With Sound Manager 3.0, you can play sounds compressed with any algorithm when you use the CmpSoundHeader data structure. The CmpSoundHeader's old futureUse1 field is now the format field, which you can use to specify a 4-character OSType that identifies the compression algorithm. If the compressionID field of the CmpSoundHeader is set to the constant fixedCompression, the Sound Manager uses the OSType in the format field to find a codec that can decompress this type of audio. The example named PlayCompressedSound on the CD shows how to fill out the compressed sound header so that you can play compressed sounds.

The SndPlayDoubleBuffer call has a similar interface. It accepts a new SndDoubleBufferHeader data structure that's identical to the previous one with the addition of a format field at the end. If thedbhCompressionID field is set to the constant fixedCompression, the format field is used to determine the codec to use to decompress the sound. Otherwise it will work as before.

Multiple sound channels. The overall sound volume (amplitude) has been improved when multiple sound channels are being mixed. In the past the Sound Manager would average the amplitudes for all playing channels. With Sound Manager 3.0, this averaging does not occur, which gives you better individual volume control. One possible disadvantage to this is that clipping can occur when many sounds of high amplitude are used.

For those of you trying to synchronize multiple channels, syncCmd could never synchronize at a fine enough level. With Sound Manager 3.0, syncCmd synchronizes multiple channels so that independent sounds can be triggered at exactly the same time. The technique to synchronize multiple channels remains the same as before. See the PlayTwoSoundsSynched example on the CD.

Finding the sound header in a 'snd ' resource. The 'snd ' resource is a cumbersome structure to parse. The old routine SetupSndHeader can be used to create this resource. A new routine, GetSoundHeaderOffset, has been created to locate the embedded sound header, which is used with the soundCmd or bufferCmd. The resulting offset is the number of bytes into the handle to the starting point of the sound header. The handle doesn't have to be locked to get this offset. See the PlaySndHandle example on the CD.

Volume control. Two new sound commands, volumeCmd and getVolumeCmd, allow better control of a channel's output volume. You can use volumeCmd to set the volume. The param2 portion of the command contains a two-word value (four bytes) that represents a pair of volume levels; the high word is the level for the right output signal and the low word is the level for the left. A value of 0x0100 is full volume and 0x0080 is half volume. For an example of setting the volume, see ChangeVolume on the CD.

You can overdrive the volume if you want to amplify low signals. A value of 0x0200 would be twice full volume. Furthermore, you can independently control the right and left volumes. The value 0x01000000 would send the output signal to the right, and 0x00000100 would send it left. The value 0x00800100 would play out the right side at half volume and the left at full volume.

The getVolumeCmd command returns the current volume. The param2 field should be a pointer to a long, similar to getAmpCmd.

There are two new routines for controlling the volume of system beep sounds: GetSysBeepVolume and SetSysBeepVolume.

pascal OSErr GetSysBeepVolume(long *level)
    = {0x203C,0x0224,0x0018,0xA800};
pascal OSErr SetSysBeepVolume(long level)
    = {0x203C,0x0228,0x0018,0xA800};

SysBeep will create a sound channel adjusted to the volume level last set by SetSysBeepVolume. This allows for system beep sounds to play back at a lower level than the rest of the machine, so you can hear a QuickTime movie running at full volume but hear alert beeps at a softer level.

The older routines GetSoundVol and SetSoundVol were implemented as a Control call to the Sound Driver. Although we've made every effort to continue supporting them, they do not have the amount of accuracy that's available with two new Sound Manager routines GetDefaultOutputVolume and SetDefaultOutputVolume:

pascal OSErr GetDefaultOutputVolume(long *level)
    = {0x203C,0x022C,0x0018,0xA800};
pascal OSErr SetDefaultOutputVolume(long level)
    = {0x203C,0x0230,0x0018,0xA800};
The older routines used a 0-7 value range whereas the new Sound Manager has a 0-0x0100 range. These new routines use the right/left volume pair as described above for volumeCmd. Each device has its own volume level. If the user changes the selected default device from the Sound control panel, that new device will use its own volume level, originally set by a previous call to SetDefaultOutputVolume.

Better stereo support. Previous versions of the Sound Manager would drop the right channel of a stereo sound when playing on monophonic hardware, such as a Macintosh LC. Sound Manager 3.0 will automatically convert stereo sounds to mono on these machines without dropping the right channel, so you can hear what you've been missing. Certain older Macintosh models are also mono out of the internal speaker, but stereo if headphones are plugged in. Sound Manager 3.0 will automatically sense if a headphone is plugged in and do the correct conversion so that both the right and left channels of a stereo sound will always be heard. The only exception is the Macintosh IIfx, which requires you to manually select stereo or mono in the new Sound control panel.

Default output device. Sound Manager 3.0 includes the concept of a default output device, set by the user in the new Sound control panel using the Sound Out panel. All sounds will be sent to this device unless an optional device was specified with SndNewChannel. The default device is generally the built-in sound hardware. The user can choose a new device (such as a sound card the user installed), and all sounds will then be routed to the chosen device. Adjusting the volume with either the control panel or the older call to SetSoundVol adjusts the volume of the default device.

Integration with QuickTime. QuickTime 1.6 is aware of Sound Manager 3.0 and will take advantage of its new features if it's installed.

  • Option-clicking the volume control in QuickTime's movie controller allows you to overdrive the volume of the movie, giving a boost to low signals.
  • The track balance of an audio track can now be proportionally panned left and right, instead of just full left or full right.
  • QuickTime will query Sound Manager 3.0 for information on new compression types, allowing it to play compressed audio of any type. It will send 16-bit audio data directly to the Sound Manager, so QuickTime movies can play CD-quality audio.
  • QuickTime will use the Sound Manager to do rate conversion and mix multiple sound tracks into one sound for export as an AIFF file or 'snd ' resource.

Sound Driver compatibility. The old Sound Driver, including the use of SoundBase, still works with Sound Manager 3.0, but we don't know how much longer this will be true. This depends entirely on changes in the hardware, not on the Sound Manager. If you're currently using the Sound Driver, Apple strongly encourages you to use the Sound Manager instead. Future changes in the sound architecture will be transparent to your application if you use the Sound Manager; they won't be if you continue to use the Sound Driver.

CPU loading. The Sound Manager released with system software versions 6.0.7 and later contained support for CPU loading. This approach was found not to be very accurate, and is not supported in Sound Manager 3.0. Sound Manager 3.0 will return the constant 7% for any channel, no matter how it was created and initialized. The number 7% was chosen because some applications were expecting a nonzero value, and 7% is about right for a Macintosh LC playing a single 11 kHz mono sound. Since the Sound Manager doesn't have true CPU loading checks, it's possible to run out of real time and thus overload the machine. Sound will then break up or even hang the system. This problem will be addressed in a future version of the Sound Manager.

Synth modes. Previously the Sound Manager enforced a single synthesizer type to be allocated. Even if a given synthesizer type allowed for multiple channels, you still couldn't mix the types. For example, you couldn't use the wave table mode while any other mode was operating. This limitation has been eliminated. Any and all three types of channels (square, wave table, and sampled sound) can be opened and used at the same time.

Square wave sounds. Unknown to most, the square wave synthesizer never produced true square waves. It was more like a modified sine wave. This has been corrected. As a result you'll notice that the Simple Beep sounds different. It can now be heard as it was originally designed to sound.

BUG FIXES AND FEATURE ENHANCEMENTS
The following is a brief summary of bugs that have been fixed in Sound Manager 3.0. This is not a complete list. Its intention is to point out major areas of improvement that might affect a large number of applications.

Play from disk

  • Some asynchronous file I/O problems while operating under the asynchronous SCSI Manager have been fixed.
  • Incorrect calculation of the audio selection for anything other than noncompressed 8-bit sounds has been fixed. This makes MACE and 16-bit data work with selections.
  • SndStartFilePlay can now handle 16-bit sounds and any compressed format.

Sound Input Manager

  • Sample rates greater than 32 kHz, which used to create overflows of the Fixed type and produce negative results, are now allowed.
  • Record to disk works better with large file system caches. Previously, during long disk writes to flush the file system's cache, incoming sound data would occasionally be lost.
  • When opening a sound input driver, the Sound Input Manager now checks for errors returned from the driver.

Sound Output Manager

  • Sample rates greater than 32 kHz, which used to create overflows of the Fixed type and produce negative results, are now allowed.
  • MoveHHi has been patched to avoid stack-into-heap problems during sound interrupts.
  • There are fewer clicks and pops, especially when opening a sound channel.
  • When playing multiple channels of sound using the bufferCmd, the Sound Manager will no longer mix in random amounts of silence, which caused sounds to be discontinuous and get out of sync.
  • Stopping a sound or starting a new one sometimes caused the channel to fail to produce any new sounds. This has been fixed.
  • The ampCmd works for all types of sound channels (square, wave table, and sampled).
  • Loop points now work on any type of sound, including 16-bit, stereo, and compressed sounds.
  • Linear interpolation is now performed across separate buffers, so you can play a set of sounds without getting a click between sounds.
  • Machines with the Macintosh II ROM (II, IIx, IIcx, SE/30) could lose sound interrupts after playing for long periods of time. This has been fixed.

SOUNDING OFF
Sound Manager 3.0 is a vast improvement over the old Sound Manager and will enhance QuickTime applications and other applications that use sound. So check it out; from the system beep to sophisticated movies, we're sure you'll notice the difference.

ADVANCED FEATURES

An important feature of Sound Manager 3.0 is the ability to play through alternate sound output devices installed in your system. These devices will be available from third-party developers. The Sound Manager can take advantage of specialized hardware features such as sample rate conversion and audio mixing. If such features are available in the hardware (such as better sample rate conversion done by a DSP), theSound Manager will allow this support to be passed off to the hardware for better quality and efficiency.

Support for plug-in audio codecs is another significant new feature. This allows the Sound Manager to support new compression methods, which become desirable now that we're supporting 16-bit data.

Sound Manager 3.0 was developed by Jim Reekes and Kip Olson. Kip wants everyone to know that the original design document describing the Sound Manager back in 1987 was titled "Software Architecture for a Device-Independent Sound Manager," which can be abbreviated as SADISM. This explains a lot, doesn't it?*

Sound Manager 3.0 has been made widely available. The extension, control panel, and related files are not only on this issue's CD but are also included in the Sound Manager Developer's Kit v. 3.0 available from APDA, in Hardware System Update 2.0, with sound products from third parties, and on various electronic bulletin boards (such as CompuServe and America Online). Sound Manager 3.0 is built into some new Macintosh systems; you can tell it's there if Sound Out is listed in the Sound control panel. *


JIM REEKES studied music composition and theory in college, never taking a single computer science or engineering class because he knew they would pollute his brain. He taught himself programming, beginning with the Apple II and then on the Macintosh 128K in 1984. He began working in Apple's Developer Technical Support group in 1988. He took over responsibility for the Sound Manager during System 7 beta (so you can't blame that one on him!) and recently finished Sound Manager 3.0, a complete rewrite. If there's one thing he has learned while at Apple, it's that there's a fine line between amazing insight and having a bad attitude. Jim has been collecting progressive rock and electronic music recordings since the 1970s. He grew up in Pomona, California, during the 1960s and can remember when Frank Zappa performed in local bars on Mission Blvd. and Cucamonga was a vineyard. He wishes programming didn't burn out his creative drive so that he could spend more time in his MIDI studio. *

Thanks to Ray Chiang and Bryan ("Beaker") Ressler for reviewing this column. Special thanks to Kip Olson. *

 
AAPL
$102.50
Apple Inc.
+0.25
MSFT
$45.43
Microsoft Corpora
+0.55
GOOG
$571.60
Google Inc.
+2.40

MacTech Search:
Community Search:

Software Updates via MacUpdate

VueScan 9.4.41 - Scanner software with a...
VueScan is a scanning program that works with most high-quality flatbed and film scanners to produce scans that have excellent color fidelity and color balance. VueScan is easy to use, and has... Read more
Cloud 3.0.0 - File sharing from your men...
Cloud is simple file sharing for the Mac. Drag a file from your Mac to the CloudApp icon in the menubar and we take care of the rest. A link to the file will automatically be copied to your clipboard... Read more
LibreOffice 4.3.1.2 - Free Open Source o...
LibreOffice is an office suite (word processor, spreadsheet, presentations, drawing tool) compatible with other major office suites. The Document Foundation is coordinating development and... Read more
SlingPlayer Plugin 3.3.20.505 - Browser...
SlingPlayer is the screen interface software that works hand-in-hand with the hardware inside the Slingbox to make your TV viewing experience just like that at home. It features an array of... Read more
Get Lyrical 3.8 - Auto-magically adds ly...
Get Lyrical auto-magically add lyrics to songs in iTunes. You can choose either a selection of tracks, or the current track. Or turn on "Active Tagging" to get lyrics for songs as you play them.... Read more
Viber 4.2.2 - Send messages and make cal...
Viber lets you send free messages and make free calls to other Viber users, on any device and network, in any country! Viber syncs your contacts, messages and call history with your mobile device,... Read more
Cocktail 7.6 - General maintenance and o...
Cocktail is a general purpose utility for OS X that lets you clean, repair and optimize your Mac. It is a powerful digital toolset that helps hundreds of thousands of Mac users around the world get... Read more
LaunchBar 6.1 - Powerful file/URL/email...
LaunchBar is an award-winning productivity utility that offers an amazingly intuitive and efficient way to search and access any kind of information stored on your computer or on the Web. It provides... Read more
Maya 2015 - Professional 3D modeling and...
Maya is an award-winning software and powerful, integrated 3D modeling, animation, visual effects, and rendering solution. Because Maya is based on an open architecture, all your work can be scripted... Read more
BBEdit 10.5.12 - Powerful text and HTML...
BBEdit is the leading professional HTML and text editor for the Mac. Specifically crafted in response to the needs of Web authors and software developers, this award-winning product provides a... Read more

Latest Forum Discussions

See All

This Week at 148Apps: August 25-29, 2014
Shiny Happy App Reviews   | Read more »
Qube Kingdom – Tips, Tricks, Strategies,...
Qube Kingdom is a tower defense game from DeNA. You rally your troops – magicians, archers, knights, barbarians, and others – and fight against an evil menace looking to dominate your kingdom of tiny squares. Planning a war isn’t easy, so here are a... | Read more »
Qube Kingdom Review
Qube Kingdom Review By Nadia Oxford on August 29th, 2014 Our Rating: :: KIND OF A SQUARE KINGDOMUniversal App - Designed for iPhone and iPad Qube Kingdom has cute visuals, but it’s a pretty basic tower defense game at heart.   | Read more »
Fire in the Hole Review
Fire in the Hole Review By Rob Thomas on August 29th, 2014 Our Rating: :: WALK THE PLANKUniversal App - Designed for iPhone and iPad Seafoam’s Fire in the Hole looks like a bright, 8-bit throwback, but there’s not enough booty to... | Read more »
Alien Creeps TD is Now Available Worldwi...
Alien Creeps TD is Now Available Worldwide Posted by Ellis Spice on August 29th, 2014 [ permalink ] Universal App - Designed for iPhone and iPad | Read more »
Dodo Master Review
Dodo Master Review By Jordan Minor on August 29th, 2014 Our Rating: :: NEST EGGiPad Only App - Designed for the iPad Dodo Master is tough but fair, and that’s what makes it a joy to play.   | Read more »
Motorsport Manager Review
Motorsport Manager Review By Lee Hamlet on August 29th, 2014 Our Rating: :: MARVELOUS MANAGEMENTUniversal App - Designed for iPhone and iPad Despite its depth and sense of tactical freedom, Motorsport Manager is one of the most... | Read more »
Motorsport Manager – Beginner Tips, Tric...
The world of Motorsport management can be an unforgiving and merciless one, so to help with some of the stress that comes with running a successful race team, here are a few hints and tips to leave your opponents in the dust. | Read more »
CalPal Update Brings the App to 2.0, Add...
CalPal Update Brings the App to 2.0, Adds Lots of New Stuff Posted by Ellis Spice on August 29th, 2014 [ permalink ] | Read more »
Baseball Battle Review
Baseball Battle Review By Jennifer Allen on August 29th, 2014 Our Rating: :: SIMPLE HITTINGUniversal App - Designed for iPhone and iPad Simple and cute, Baseball Battle is a fairly fun baseball game for those looking for something... | Read more »

Price Scanner via MacPrices.net

Labor Day Weekend MacBook Pro sale; 15-inch m...
B&H Photo has the new 2014 15″ Retina MacBook Pros on sale for up to $125 off MSRP. Shipping is free, and B&H charges NY sales tax only. They’ll also include free copies of Parallels Desktop... Read more
Labor Day Weekend iPad mini sale; $50 to $100...
Best Buy has the iPad mini with Retina Display (WiFi models) on sale for $50 off MSRP on their online store for Labor Day Weekend. Choose free shipping or free local store pick up. Price is for... Read more
13-inch 1.4GHz MacBook Air on sale for $899,...
Adorama has the new 2014 13″ 1.4GHz/128GB MacBook Air on sale for $899.99 including free shipping plus NY & NJ tax only. Their price is $100 off MSRP. Read more
It’s Official: Apple Issues Invitations To Se...
Apple has issued one of its characteristically cryptic press invitations for a special event to be held at the Flint Center for the Performing Arts in hometown Cupertino on Sept. 9, 2014 at 10:00 am... Read more
Tablet Shipments To See First On-year Decline...
TrendForce analyst Caroline Chen notes that when the iPad launched in 2010, it was an instant hit and spurred a tablet PC revolution, with tablets so popular that that notebook PC sales stagnated and... Read more
SOBERLINK Releases Apple iOS Compatible Handh...
Cypress, California based SOBERLINK, Inc., creator of the first handheld Breathalyzer designed to improve recovery outcomes, continues to show prominence in the mobile alcohol monitoring space with... Read more
New 21″ 1.4GHz iMac on sale again for $999, s...
Best Buy has the new 21″ 1.4GHz iMac on sale for $999.99 on their online store. Their price is $100 off MSRP. Choose free shipping or free local store pick up. Price is for online orders only, in-... Read more
Smartphone Outlook Remains Strong for 2014, U...
According to a new mobile phone forecast from the International Data Corporation (IDC) Worldwide Quarterly Mobile Phone Tracker, more than 1.25 billion smartphones will be shipped worldwide in 2014,... Read more
Save up to $60 with Apple refurbished iPod to...
The Apple Store has Apple Certified Refurbished 5th generation iPod touches available starting at $149. Apple’s one-year warranty is included with each model, and shipping is free. Many, but not all... Read more
12-Inch MacBook Air Coming in 4Q14 or 2015 –...
Digitimes’ Aaron Lee and Joseph Tsai report that according to Taiwan-based upstream supply chain insiders, Apple plans to launch a thinner MacBook model either at year end 2014 or in 2015, and that... Read more

Jobs Board

*Apple* Retail - Multiple Positions (US) - A...
Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, you're also the Read more
*Apple* Retail - Multiple Positions (US) - A...
Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, you're also the Read more
*Apple* Retail - Multiple Positions (US) - A...
Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, you're also the Read more
*Apple* Retail - Multiple Positions (US) - A...
Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, you're also the Read more
Senior Event Manager, *Apple* Retail Market...
…This senior level position is responsible for leading and imagining the Apple Retail Team's global event strategy. Delivering an overarching brand story; in-store, Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.