CRIWARE Unity Plugin Manual  Last Updated: 2024-07-12
CriAtomExAuxIn Class Reference

AuxIn for reading external sound More...

Inherits CriDisposable.

Classes

struct  Config
 A config structure for creating an AuxIn More...
 

Public Member Functions

 CriAtomExAuxIn (Config?config=null)
 Creates an AuxIn More...
 
override void Dispose ()
 Discards an AuxIn More...
 
void Start ()
 Starts the playback of AuxIn More...
 
void Stop ()
 Stops the playback of AuxIn More...
 
void SetFormat (int numChannels, int samplingRate)
 Set the format More...
 
void GetFormat (out int numChannels, out int samplingRate)
 Gets the format More...
 
void SetVolume (float volume)
 Volume setting More...
 
void SetFrequencyRatio (float frequencyRatio)
 Sets the frequency adjustment ratio More...
 
void SetBusSendLevel (string busName, float level)
 Sets the Bus Send Level More...
 
void SetInputReadStream (CriAudioReadStream stream)
 Sets the read stream More...
 

Detailed Description

AuxIn for reading external sound

Description:
AuxIn can send the sound data external to ADX to the DSP bus of ADX.
Controls the start of playing back input data, gets status, writes input data etc.

Constructor & Destructor Documentation

CriAtomExAuxIn ( Config config = null)
inline

Creates an AuxIn

Parameters
configA config structure for creating an AuxIn
Returns
AtomAuxIn handle
Description:
Creates an AuxIn for capturing sound.
AuxIn can send the sound data external to ADX to the DSP bus of ADX.

To start playing a sound, call the CriWare.CriAtomExAuxIn::Start function.
You pass the sound to be captured to AuxIn through the callback function specified to CriWare.CriAtomExAuxIn::SetInputReadStream .
Note:
This function is a return-on-complete function. The time it takes depends on the platform.
Create/discard microphone at a timing when load fluctuations is accepted such as when switching scenes.
See also
CriAtomExAuxIn::Dispose

Member Function Documentation

override void Dispose ( )
inline

Discards an AuxIn

Description:
Discard an AuxIn.
Note:
This function is a return-on-complete function. The time it takes depends on the platform.
Create/discard microphone at a timing when load fluctuations is accepted such as when switching scenes.
See also
CriAtomExAuxIn::CriAtomExAuxIn
void Start ( )
inline

Starts the playback of AuxIn

Description:
Starts the playback of AuxIn.
See also
CriAtomExAuxIn::Stop
void Stop ( )
inline

Stops the playback of AuxIn

Description:
Stops the playback of AuxIn.
See also
CriAtomExAuxIn::Start
void SetFormat ( int  numChannels,
int  samplingRate 
)
inline

Set the format

Parameters
numChannelsThe number of channels
samplingRateSampling frequency
Description:
Sets the format of the sound to be played.
It must be set before calling CriWare.CriAtomExAuxIn::Start .
See also
CriAtomExAuxIn::GetFormat
void GetFormat ( out int  numChannels,
out int  samplingRate 
)
inline

Gets the format

Parameters
numChannelsThe number of channels
samplingRateSampling frequency
Description:
Gets the format information set by CriWare.CriAtomExAuxIn::SetFormat .
See also
CriAtomExAuxIn::SetFormat
void SetVolume ( float  volume)
inline

Volume setting

Parameters
volumeVolume value
Description:
Sets the volume of the AuxIn sound.

The volume value is a scale factor for the amplitude of the sound data (the unit is not decibel).
For example, if you specify 1.0f, the original sound is played at its unmodified volume.
If you specify 0.5f, the sound is played at the volume by halving the amplitude (-6dB) of the original waveform.
If you specify 0.0f, the sound is muted (silent).
void SetFrequencyRatio ( float  frequencyRatio)
inline

Sets the frequency adjustment ratio

Parameters
frequencyRatioFrequency adjustment ratio (0.25f to 4.0f)
Description:
Sets the sound frequency adjustment ratio of AuxIn.
The frequency adjustment ratio is the ratio of the sound data frequency to the playback frequency and is equivalent to the playback speed multiplication factor.
If the frequency ratio exceeds 1.0f, the sound data is played faster than the original sound, and if the frequency ratio is less than 1.0f, the sound data is played slower than the original sound.

The frequency ratio also affects the pitch of the sound.
For example, if the sound is played with the frequency ratio of 1.0f, the sound data is played back at the pitch of the original sound, but if the frequency ratio is changed to 2.0f, the pitch goes up by one octave.
(Because the playback speed is doubled.)
Note:
If the frequency ratio higher than 1.0f is set, the sound data to be played is consumed faster than usual, so it is necessary to supply the sound data faster.
When setting the frequency ratio higher than 1.0f, set the maximum sampling rate specified when creating the AuxIn considering the frequency ratio.
(You must set maxSamplingRate in CriWare.CriAtomExAuxIn::Config structure when creating AuxIn to a value calculated with "sampling rate of original sound x frequency ratio")
void SetBusSendLevel ( string  busName,
float  level 
)
inline

Sets the Bus Send Level

Parameters
busNameBus name
levelLevel value(0.0f~1.0f)
Description:
Sets the Bus Send Level of the AuxIn sound.
The Bus Send Level is a mechanism for specifying how much sound should be sent to which bus.

For the second argument, specify the bus name in the DSP bus setting.
The third argument specifies the level (volume) when sending.

If the bus specified by the bus name as the second argument does not exist in the DSP bus settings being applied, the setting is treated as invalid.
The range and handling of the send level values are the same as for volume. Refer to the CriWare.CriAtomExAuxIn::SetVolume function.
void SetInputReadStream ( CriAudioReadStream  stream)
inline

Sets the read stream

Parameters
streamRead stream
Description:
Sets the read stream in the input direction of AuxIn.
The callback function is called from a separate thread on most platforms, so the callee must be implemented as thread-safe.

The documentation for this class was generated from the following file: