VirtualMachine Sound Methods
[VirtualMachine Related Documentations]


Detailed Description

Sound Classes and Methods for VirtualMachine. We use a very special way to support sound streams: We provide SoundInterface, a pure virtual class. You just got to extend it to another class and implement ProcessSoundInterupt() yourself. Then you must register an instance of it to the machine with EnableMediaSound(). as soon as it is registered, the machine will send your ProcessSoundInterupt(), which ask to * add * a stereo signal to a float sound stream described with class SoundBufferToAddYourSignal. And your signal will be instantly heard. To stop it, call EnableMediaSound() with false. Of course, the sound interupt is managed privately by the machine. Look this Minimal Example.


Classes

class  VirtualMachine::SoundBufferToAddYourSignal
 Defines the sound buffer to be mixed by SoundInterface::ProcessSoundInterupt(). More...
class  VirtualMachine::SoundInterface
 Virtual base class for any kind of object that need to generate a sound signal. You have to extend it and implement ProcessSoundInterupt(). (see exemple in VirtualMedia.cpp) For more informations, look VirtualMachine::EnableMediaSound(). More...
class  VirtualMachine::SoundBufferToAddYourSignal
 Defines the sound buffer to be mixed by SoundInterface::ProcessSoundInterupt(). More...
class  VirtualMachine::SoundInterface
 Virtual base class for any kind of object that need to generate a sound signal. You have to extend it and implement ProcessSoundInterupt(). (see exemple in VirtualMedia.cpp) For more informations, look VirtualMachine::EnableMediaSound(). More...

Functions

virtual float VirtualMachine::GetPlayFrequency ()=0
 Return the machine main play frequency, in herz, (tick per sec).
virtual void VirtualMachine::EnableMediaSound (SoundInterface *_pNoisyObject, bool _enable=true)
 Register a SoundInterface object that will then generate a mixed sound through SoundInterface::ProcessSoundInterupt(). The sound will start instantly. if false, Unregister a media object previously registered with EnableMediaSound(,true). The sound stops instantly. Note, that if you choose to use the BaseObject implementation, class VirtualMedia will manage the sound in its own way, and you will not need to use this method.
virtual void VirtualMachine::SetSoundCurrentTime (int _seconds, unsigned int _fraction)=0
 force a date to the clock passed to the sound objects.
virtual void VirtualMachine::SetSoundVolume (float _newVolumeValue)=0
 tool: change main volume [0,1]. Yes, you can saturate when >1.
virtual float VirtualMachine::GetSoundVolume ()=0
 tool: get main volume value [0,1].
virtual void VirtualMachine::GetCurrentSoundBufferImage (float **const _ppSoundBuffer, unsigned int *_pLength) const =0
 return an image of the current short sound buffer which is currently played. This is always a 2 float(stereo left,right) table. the play frequency of this sound signal is given by GetPlayFrequency() . The buffer size may vary in time and implementation, and this table is refresh on an undefined rate. It can be used by sound preview methods or live effects.
virtual void VirtualMachine::ShutTheFuckUp ()
 Now, AzurVeda virtual machine implements a very efficient BASS technology known as "ShutTheFuckUp" ! Yes, it will unregister all sound objects to silent the machine.


Function Documentation

virtual void EnableMediaSound SoundInterface _pNoisyObject,
bool  _enable = true
[virtual, inherited]
 

Register a SoundInterface object that will then generate a mixed sound through SoundInterface::ProcessSoundInterupt(). The sound will start instantly. if false, Unregister a media object previously registered with EnableMediaSound(,true). The sound stops instantly. Note, that if you choose to use the BaseObject implementation, class VirtualMedia will manage the sound in its own way, and you will not need to use this method.

Parameters:
_pNoisyObject the object that can generate noise.
_enable true if you want to enable, false to disable.

virtual void GetCurrentSoundBufferImage float **const   _ppSoundBuffer,
unsigned int *  _pLength
const [pure virtual, inherited]
 

return an image of the current short sound buffer which is currently played. This is always a 2 float(stereo left,right) table. the play frequency of this sound signal is given by GetPlayFrequency() . The buffer size may vary in time and implementation, and this table is refresh on an undefined rate. It can be used by sound preview methods or live effects.

Parameters:
_ppSoundBuffer pointer on pointer on the buffer to return.
_pLength pointer on a unsigned int that return the length.

Implemented in OGLMachineWinDxSound, OGLMachineLinux, and VedaMachineDreamcast.

virtual float GetPlayFrequency  )  [pure virtual, inherited]
 

Return the machine main play frequency, in herz, (tick per sec).

Returns:
freq (44100.0,22050.0,...)

Implemented in OGLMachineWinDxSound, OGLMachineLinux, and VedaMachineDreamcast.

virtual float GetSoundVolume  )  [pure virtual, inherited]
 

tool: get main volume value [0,1].

Returns:
VolumeValue [0,1]

Implemented in OGLMachineWinDxSound, OGLMachineLinux, and VedaMachineDreamcast.

virtual void SetSoundCurrentTime int  _seconds,
unsigned int  _fraction
[pure virtual, inherited]
 

force a date to the clock passed to the sound objects.

Parameters:
_seconds in second units.
_fraction the following after-the-point-units of _seconds, like if the whole were a 64 bits integer.

Implemented in OGLMachineWinDxSound, OGLMachineLinux, and VedaMachineDreamcast.

virtual void SetSoundVolume float  _newVolumeValue  )  [pure virtual, inherited]
 

tool: change main volume [0,1]. Yes, you can saturate when >1.

Parameters:
_newVolumeValue [0,1]

Implemented in OGLMachineWinDxSound, OGLMachineLinux, and VedaMachineDreamcast.

virtual void ShutTheFuckUp  )  [virtual, inherited]
 

Now, AzurVeda virtual machine implements a very efficient BASS technology known as "ShutTheFuckUp" ! Yes, it will unregister all sound objects to silent the machine.


      /\/\        4         N         k         !         N         D
                      _______  _ __ ___  _____            ___ _ _  ____
     ___________  __//___   /________  |/    / ___________\_______/    \
    /   _   _   \/   _     /    _   /      _/_/____/    _       __     /
   /    /   /       /     /    /    \      \/     /    /    \   \     /
  \\___/___/___/    ¯    _____/_____/       ______\___/_____/\________\\
               \________/_ ___ __ l____\      /elD!  
                 http://www.m4nkind.com \____/