DR Developer's Guide
DR Interfaces |
DR Methods |
DR Types and Misc API
This file documents the IMoaDrSound2 interface.
IMoaDrSound2 has all of the methods of IMoaDrSound,
plus an additional PauseSound method.
Interface ID: IID_IMoaDrSound2
Pointer type: PIMoaDrSound2
Class ID: CID_IMoaDrSound2
Inheritance: IMoaDrSound
Header file: driservc.h
- Description
- This callback interface provides platform-independent access to the sound
mixing capabilities of Director. On the Macintosh, up to 8 sound channels
are available, each of which can simultaneously play sounds independent of
the others. There are also 8 sound channels available on Windows. On older
Windows systems, up to 4 sound channels were available for playing independent
sounds. Sound channel numbering is 1-based.
- Methods
- GetSoundChannelCount() Determines the number of available sound channels.
GetSoundChannelStatus() Returns the status of a specified sound channel.
GetFreeSoundChannel() Returns the number of the next available sound channel.
PlaySoundFormat() Plays the specified sound.
PlaySoundRaw() Similar to PlaySoundFormat,
but has an additional pRawSoundStream parameter and cue point support.
StopSoundChannel() Stops the sound in the specified channel.
SetSoundChannelVolume() Sets the volume for a particular sound channel.
GetTime() Returns the amount of time the sound in the specified channel has been playing.
PauseSound() Pauses the sound currently playing.
- Syntax
- GetFreeSoundChannel(MoaUlong * piChannel)
- Parameters
- piChannel
- Pointer to place to store the sound channel number
- Returns
- MoaError
- Description
- Call this method to get the next available sound channel.
This method works from the highest-numbered sound channel down.
- Syntax
- GetSoundChannelCount(MoaUlong * pCount)
- Parameters
- pCount
- Pointer to place to store the number of channels
- Returns
- MoaError
- Description
- Call this method to determine the number of sound channels available.
There are 8 sound channels available on both Macintosh and Windows.
- Syntax
- GetSoundChannelStatus(MoaUlong iChannel)
- Parameters
- iChannel
- Sound channel number
- Returns
- MoaDrSoundChannelPlayStatus
- Description
- Returns the current status of the specified sound channel.
- Syntax
- GetTime(MoaUlong iChannel, MoaUlong * pTime)
- Parameters
- iChannel
- Sound channel number
- pTime
- Time from beginning of sound (in milliseconds)
- Returns
- MoaError
- Description
- Returns the amount of time that the sound in the specified channel has been playing.
- Syntax
- PauseSound(MoaUlong iChannel, MoaBoolParam bPauseState)
- Parameters
- iChannel
- Sound channel number
- bPauseState
- Boolean value specifying whether to pause the sound. Enter True
to pause sound playback, enter False to resume sound playback
- Returns
- MoaError
- Description
- This method was added to the IMoaDrSound2 interface.
Pauses the sound in the specified channel.
- Syntax
- PlaySoundFormat(MoaUlong iChannel, PIMoaStream pSoundStream, ConstPMoaChar psSoundFormat, PMoaMmValue pProxyChannel)
- Parameters
- iChannel
- Sound channel number
- pSoundStream
- Stream containing sound data
- psSoundFormat
- String representing sound data format
- pProxyChannel
- Sprite channel playing the sound. This parameter can be set to NULL.
- Returns
- MoaError
- Description
- Plays the sound provided by pSoundStream. Playback
conforms to the lifetime of the sprite referred to by pProxyChannel.
If a sound is already playing in the specified channel, this sound will supersede it.
- Syntax
- PlaySoundRaw(MoaUlong iChannel, PIMoaStream pRawSoundStream, PMoaSoundFormat pSndFormat,
PMoaMmCuePoint pCuePointList, MoaUlong nCuePoints, PMoaMmValue pProxyChannel)
- Parameters
- iChannel
- Sound channel number
- pRawSoundStream
- Stream containing sound data
- psSoundFormat
- Pointer to a Moa sound format structure containing information about the structure of the sound. This parameter cannot be left blank.
- pCuePointList
- List of sound cue points
- Number of items in pCuePointList
- Stream containing sound data
- pProxyChannel
- Sprite channel playing the sound. This parameter can be set to NULL.
- Returns
- MoaError
- Description
- Plays the sound provided by pRawSoundStream.
Playback conforms to the lifetime of the sprite referred to by pProxyChannel.
If a sound is already playing in the specified channel, this sound will supersede it.
- Syntax
- SetSoundChannelVolume(MoaUlong iChannel, MoaUshort nVolume)
- Parameters
- iChannel
- Sound channel number
- nVolume
- Volume level setting (range: 0 - 255)
- Returns
- MoaError
- Description
- Sets the volume of the sound in the specified channel.
- Syntax
- StopSoundChannel(MoaUlong iChannel, MoaUlong * pTime)
- Parameters
- iChannel
- Sound channel number
- pTime
- Time until sound stops (in milliseconds)
- Returns
- MoaError
- Description
- Stops the sound in the specified channel at the specified time.
Copyright © 1995-2008 Adobe Macromedia Software LLC, Inc.