Sound output data analysis module (for each player/source)
More...
|
struct | Config |
| Sound output data analysis module config structure More...
|
|
Sound output data analysis module (for each player/source)
- Deprecated:
- 削除予定の非推奨APIです。 CriWare.CriAtomExOutputAnalyzer クラスの使用を検討してください。
- Description:
- Performs sound output analysis for each CriAtomSource/CriAtomExPlayer.
Provides features such as Level Meter.
- Note:
- This class is discontinued in the future. Use CriWare.CriAtomExOutputAnalyzer .
Analysis is not possible when using HCA-MX or a platform-specific sound compression codec.
Use HCA or ADX codecs.
Analysis processing type
- Description:
- A value indicating the type of analysis specified when creating the analysis module.
- See also
- CriAtomExOutputAnalyzer
Enumerator |
---|
LevelMeter |
Level Meter (RMS level measurement)
|
SpectrumAnalyzer |
Spectrum analyzer
|
PcmCapture |
Gets the waveform data
|
Creates a sound output data analysis module
- Returns
- Sound output data analysis module
- Description:
- Creates an output sound data analysis module for CriAtomSource/CriAtomExPlayer.
You use the analysis module you created by attaching it to CriAtomSource or CriAtomExPlayer.
You perform analysis on the attached sound output such as a Level Meter.
- Note:
- Only one CriAtomSource/CriAtomExPlayer can be attached to the analysis module.
If you want to reuse the analysis module, detach it.
- Note:
- This class is discontinued in the future. Use CriAtomExOutputAnalyzer .
Unmanaged resources are reserved when creating a sound output data analysis module.
When you no longer need the analysis module, be sure to call the CriAtomExPlayerOutputAnalyzer.Dispose method.
delegate void PcmCaptureCallback |
( |
float[] |
dataL, |
|
|
float[] |
dataR, |
|
|
int |
numChannels, |
|
|
int |
numData |
|
) |
| |
|
inherited |
Waveform acquisition callback
- Description:
- A callback for acquiring the output waveform data.
override void Dispose |
( |
| ) |
|
|
inlineinherited |
Discards the output data analysis module
- Description:
- Discards the output data analysis module.
At the time of calling this function, all the resources allocated in the plug-in when creating the output data analysis module are released.
To prevent memory leak, call this method when the output data analysis module is no longer required.
- Note:
- This function is a return-on-complete function.
If there are any attached AtomExPlayers, they are detached in this function.
Note that the sounds being played by the target AtomExPlayers are forcibly stopped.
- See also
- CriAtomExOutputAnalyzer::CriAtomExOutputAnalyzer
Attaching the AtomExPlayer
- Returns
- Whether the attach was successful (success: True, failure: False)
- Description:
- Attaches the AtomExPlayer that analyzes the output data.
It is not possible to attach multiple AtomExPlayers. If you attach another AtomExPlayer while one is attached, the attached AtomExPlayer is detached.
To attach CriAtomSource, use CriAtomSource::AttachToOutputAnalyzer.
- Note:
- Attachment must be done before starting playback. Attachment fails after starting playback.
If you discard the AtomExPlayer attached using this function before detaching it, an access violation occurs at the time of detachment.
Be sure to first detach the AtomExPlayer before discarding it.
- See also
- CriAtomExOutputAnalyzer::DetachExPlayer, CriAtomSource::AttachToOutputAnalyzer
Detaches the AtomExPlayer
- Description:
- Detaches the AtomExPlayer that analyzes the output data.
After detaching, the subsequent analysis will not be done.
- Note:
- If this function is called while the player already attached is playing a sound, the playback is forcibly stopped before detaching.
An access violation occurs if the attached AtomExPlayer has already been discarded.
Be sure to call this function or CriAtomExOutputAnalyzer::Dispose before discarding the AtomExPlayer.
- See also
- CriAtomExOutputAnalyzer::AttachExPlayer, CriAtomExOutputAnalyzer::Dispose
bool AttachDspBus |
( |
string |
busName | ) |
|
|
inlineinherited |
Attaching the DSP bus
- Returns
- Whether the attach was successful (success: True, failure: False)
- Description:
- Attach a DSP bus for output data analysis.
It is not possible to attach multiple DSP buses. If you attach another DSP bus while one is attached, the attached DSP bus is detached.
- See also
- CriAtomExOutputAnalyzer::DetachDspBus
float GetRms |
( |
int |
channel | ) |
|
|
inlineinherited |
void GetSpectrumLevels |
( |
ref float[] |
levels | ) |
|
|
inlineinherited |
Gets the spectrum analysis result
- Parameters
-
levels | Analysis result (amplitude of each band) |
- Description:
- Gets the amplitude for each band analyzed by the spectrum analyzer.
The number of elements in the array is the number of bands specified when the module was created.
When using this function, create a module setting enableSpectrumAnalyzer to True and a numSpectrumAnalyzerBands to a positive number equal to or smaller than MaximumSpectrumBands in Config. If you want to display the analysis result like a commercial spectrum analyzer, you need to convert the value returned by this function into a decibel value.
- Example:
public class SpectrumLevelMeter : MonoBehaviour {
private CriAtomExOutputAnalyzer analyzer;
void Start() {
this.analyzer = new CriAtomExOutputAnalyzer(config);
}
void Update() {
float[] levels = new float[8];
analyzer.GetSpectrumLevels (ref levels);
float db = 20.0f * Mathf.Log10(levels[0]);
Debug.Log (db);
}
}
- See also
- CriAtomExOutputAnalyzer::AttachExPlayer, CriAtomExOutputAnalyzer::AttachDspBus
void GetPcmData |
( |
ref float[] |
data, |
|
|
int |
ch |
|
) |
| |
|
inlineinherited |
Gets the waveform data of the sound output being attached
- Parameters
-
data | Output data |
ch | Channel |
- Description:
- Gets the waveform data of the sound output being attached.
When using this function, create a module by setting enablePcmCapture to True and a numCapturedPcmSamples to a positive number in Config.
- Note:
- If the argument array is not long enough, it is allocated in the function.
To avoid unnecessary GC, pass an array with a length longer than the number of data samples specified in the initialization config as an argument. Currently, the only channels that can be acquired are L/R. For ch, specify 0 or 1.
- See also
- CriAtomExOutputAnalyzer::AttachExPlayer, CriAtomExOutputAnalyzer::AttachDspBus
Registers the waveform data acquisition callback
- Description:
- Register the callback for acquiring output data.
When using callback for acquiring the waveform data, register the callback using this function before calling ExecutePcmCaptureCallback.
void ExecutePcmCaptureCallback |
( |
| ) |
|
|
inlineinherited |
Calls the waveform data acquisition callback
- Description:
- Call the callback for acquiring the output data.
When this function is called, the callback is called multiple times with the output difference data from the last execution as an argument.
- Note:
- When using a callback for getting the waveform data, call this function regularly.
If this function is not called for a long time, there may be a loss of acquired waveform data.
const int MaximumSpectrumBands = 512 |
|
inherited |
Maximum number of spectrum analyzer bands
- Description:
- Maximum number of bands that the spectrum analyzer can output.
The documentation for this class was generated from the following file:
- CriAtomExPlayerOutputAnalyzer.cs