GetSoundInLevelXtra
current version 0.9f
Copyright Geoff Smith 1999-20003
page last updated:18th March 2003

 


and
 

Description

This is a cross platform Xtra for Macromedia Director™ to determine the volume level at the microphone input. It should work in Director 5, 6,7 & 8. Although it has only been tested in 6,7 & 8. It can be used with Shockwave - but cannot be automatically downloaded.
The input device is selected via the system control panel, so this can be used to check CD, microphone or line inputs.
For updates on this and my other XObjects/Xtras check out my web page:

 

Compatibility

OS
Version
Yes
No
Untested

Microsoft© Windows

Requires DirectX 6 or above

95
   
98
   
2000
   
XP
   
NT 4    
Apple Macintosh Classic (OS9)
   
OSX    
 

Files

Mac  
  GetsoundInLevelXtra.ppc
PC  
  GSILXTRA.X32


Installation

There are two methods to install and use this Xtra for Macromedia Director.

Copy the GSILXtra.x32 (PC) or GetsoundInLevelXtra.ppc (Mac) into the Xtras folder inside the folder with the Director main program. When you start Director it looks inside, and makes available, any xtras inside the Xtras folder.

The other method is to place the xtra in some folder, and use Directors openxlib command before trying to use it. I use this method in my demo movies. If you put the xtra in the Xtras folder you do not need to use the openxlib command. Refer to the Director documentation for further information.

To check that the xtra is loaded enter lingo "showxlib" command into Directors message window, this lists all the available xtras. If the xtra is not named in the list some error has occured. Check the location of the file or use the openxlib command (see above). The figure below shows the presence of the xtra, "-- Xtra: GetSoundInLevel", and because openxlib was used the name of the file that it was read from is shown.
Is the xtra is on the list use "put interface(xtra "GetSoundInLevel")" to list all the messages available in the xtra. It also shows the version of the xtra and if it can be used in a projector.


Example of message window afer openxlib and interface lingo commands have been executed
(Varies with different versions)

Commands

General  
  New
Access  
 

GetLevel
GetLeftLevel
GetRightLevel
GetChan
nelCount

Control  
 

SetAverageingPeriod (PC only)
GetAudioFormats (PC only)

Version release history

New

Command format new xtraRef
Description Standard command to create a new instance of an object.
Parameters

None

Example set theObject to new ( xtra "GetSoundInLevel")
if ObjectP( theObject) then -- is ok
Return value instance value or error number. Test with Lingo objectP command


GetLevel

Command format GetLevel object me
Description Obtain the current volume level, if more than one channel is available the left channel value if returned.
Parameters me: the identifier returned from new.
Example

put GetLevel( theObject)

Return value either "Ok" or error message starting with the word "Error :"


GetLeftLevel

Command format GetLeftLevel object me
Description Obtain the current volume level of the left channel, if only one channel is available then that is returned.
Parameters me: the identifier returned from new.
Example

put GetLeftLevel( theObject)

Return value either "Ok" or error message starting with the word "Error :"
 

GetRightLevel

Command format GetRightLevel object me
Description Obtain the current volume level of the right channel, if only one channel is available then that is returned.
Parameters me: the identifier returned from new.
Example

put GetRightLevel( theObject)

Return value either "Ok" or error message starting with the word "Error :"

 

GetChannelCount

Command format GetChannelCount object me
Description Obtain the numbers of audio channels available on the current device
Parameters me: the identifier returned from new.
Example

put GetChannelCount( theObject)

Return value either "Ok" or error message starting with the word "Error :"

SetAverageingPeriod (PC only)

Command format SetAverageingPeriod object me, integer periodInMilliSeconds
Description Set the period over which the sound level is calculated. Shorter is more responsive, but jumpy. Range is 1-1000
Parameters me: the identifier returned from new.
periodInMilliSeconds: the period to average over.
Example

SetAverageingPeriod( theXtra, 10)

Return value either "Ok" or error message starting with the word "Error :"

GetAudioFormats (PC only)

Command format GetAudioFormats object me
Description Returns a comma delinerated list of the audio formats supported by the system. eg 8 bit 11.025 Mono
Parameters me: the identifier returned from new.
Example

put GetAudioFormats( theXtra)

Return value either list of audio formats or error message starting with the word "Error :"

 

Version History

Version Date Notes
0.9f (PC) 1/1/03 Increased compatiability with motherboard audio systems. Added new message to return list of supported formats
0.9e (PC) 6/10/02 SetAverageingPeriod added to PC version
0.9d (Mac) 11/00 Corrected a bug in the GetLeftChannel message
0.9c 6/00 Initial release of the PC version
0.9b  

Marked as safe for Shockwave use

0.9a   Initial

 

 

Contact details

Email: support@physicalbits.com

 

Conditions of use

In this document Xtra refers to this Xtra, and me refers to Geoff Smith. All rights to the XObject/Xtra are retained by me. The XObject may be used in any MacroMedia Director document for personal use and given to your friends. All documentation must be included when passing on the XObject/Xtra. Unless licensed you may NOT do the following ·distribute for profit without prior permission. ·distribute for profit within a Director presentation without prior permission ·distribute by CD-ROM without prior permission. ·distribute as part of a collection without prior permission ·be used in a public presentation without prior permission.Financial liabilty for this product is limited to the purchase price or $1, whichever is greater.
All legal proceeding must be carried out under the auspices of the court of Santa Clara, California, USA. These conditions may be modified at any time. Please refer to the physicalbits website for the latest conditions.