SUPPORT  :  AUDIO XTRA TECHNOTES :  AU004
 

Limitations of axConvertToFile with MP3 and SWA Export Formats

 

Audio Xtra supports MP3 and SWA export via axConvertToFile using Director's built in MIX conversion Xtras.

However, there are a number of limitations that must be observed in order to export successfully. Most of these limitations are inherited from specific requirements in different versions of the Sound Export components used in each version of Director. This technote attempts to document all known issues with MP3 and SWA export components when invoked from a runtime Xtra (like Audio Xtra.) For some applications it may be better to export to WAVE or AIFF files and invoke a 3rd party command line utility to compress to MP3, as this offers better control over the final compression parameters. AudioXtra 6.1 can also compress directly to Ogg Vorbis files without any additional components, and this is usually a safer and more reliable solution for reducing sound files while keeping optimal quality.

 

MP3 and SWA export is available under OSX and Windows only, not Mac Classic.

 

On the Mac platform you can use both Director MX and MX 2004. On Windows we recommend using MX 2004 ONLY. Exporting from a Director 8.5 or MX projector on Windows should be avoided: this can cause errors on a small number of audio drivers, where a -1101 error message is returned. This problem does not affect projectors made with MX 2004, as they use a newer set of sound import/export Xtras.

 

Director 11 can no longer load and play sounds in MP3 or SWA format to the Audio Xtra sound list. Exporting still works in authoring with the same limitations documented for MX2004, but it is unsupported and deprecated. It is also not working in projectors or Shockwave. We recommend using an external solution that does not rely on the built-in sound xtras for increased reliability. AudioXtra 6.1 also added functions that allow export of compressed sounds in Ogg Vorbis format, with additional parameters to control the compression quality and final filesize. To reduce the size of sounds for upload in Shockwave applications we recommend having a look at the new axConvertToSFData() abd axConvertToOggData() functions.

 

Exporting is done by Director's own sound export components, so you must add the following additional Xtras to your projector:

 

MPEG3 Import Export Xtra

SWA Decompression PPC Xtra (SWADCmpr.x32 on Windows)

SWA Compression Xtra (SWACmpr.x32 on Windows)

Sound Import Export

 

Important Note: the SWA Compression Xtra is not available for autodownload in Shockwave, so you will not be able to export to MP3 or SWA in the Shockwave environment unless the Xtra is manually placed in the Shockwave Xtras folder. Attempting a conversion will return error -5, indicating that the Sound Compression services are not available.

 

The suggested conversion rate, depth and number of channels to use is 22050 KHz, 16 bits, 1 channel. You should record in mono or set at least the convertNumChannels parameter BEFORE EXPORTING to avoid a -84 error under MX 2004. This is done with the axSetEnvironmentInfo function:

 

axSetEnvironmentInfo( "convertNumChannels", 1)

--and optionally

axSetEnvironmentInfo( "convertSampleRate", 22050)

axSetEnvironmentInfo( "convertSampleDepth", 16)

 

Most audio drivers will allow exporting of stereo sounds on Windows, however this is reported to fail on at least a couple of driver versions for a popular sound card (SBLive!). For better compatibility with end user systems we recommend exporting to mono in all cases.

 

The compression rate used is 16K per second per channel, and is not adjustable.

 

 ID: PRODUCT: PLATFORM: VERSION: KEYWORDS: LAST UPDATED: AREA:
 AU004 Audio Xtra All 5.0 - 6.x MP3 SWA July 2, 2008 Audio Xtra