Photon Voice
v2.7
|
AudioUtil.ToneAudioReader< T > Class Template Reference
IAudioReader that provides a constant tone signal. More...
Inherits IAudioReader< T >.
Public Member Functions | |
ToneAudioReader (Func< double > clockSec=null, double frequency=440, int samplingRate=441000, int channels=2) | |
Create a new ToneAudioReader instance More... | |
void | Dispose () |
bool | Read (T[] buf) |
Fill full given frame buffer with source uncompressed data or return false if not enough such data. More... | |
Properties | |
int | Channels [get] |
Number of channels in the audio signal. More... | |
int | SamplingRate [get] |
Sampling rate of the audio signal (in Hz). More... | |
string | Error [get] |
If not null, audio object is in invalid state. More... | |
Properties inherited from IAudioDesc | |
int | SamplingRate [get] |
Sampling rate of the audio signal (in Hz). More... | |
int | Channels [get] |
Number of channels in the audio signal. More... | |
string | Error [get] |
If not null, audio object is in invalid state. More... | |
Detailed Description
IAudioReader that provides a constant tone signal.
See also MicWrapper and AudioClipWrapper Because of current resampling algorithm, the tone is distorted if SamplingRate does not equal encoder sampling rate.
Constructor & Destructor Documentation
ToneAudioReader | ( | Func< double > | clockSec = null , |
double | frequency = 440 , |
||
int | samplingRate = 441000 , |
||
int | channels = 2 |
||
) |
Create a new ToneAudioReader instance
- Parameters
-
clockSec Function to get current time in seconds. In Unity, pass in '() => AudioSettings.dspTime' for better results. frequency Frequency of the generated tone (in Hz). samplingRate Sampling rate of the audio signal (in Hz). channels Number of channels in the audio signal.
Member Function Documentation
bool Read | ( | T[] | buffer | ) |
Fill full given frame buffer with source uncompressed data or return false if not enough such data.
- Parameters
-
buffer Buffer to fill.
- Returns
- True if buffer was filled successfully, false otherwise.
Implements IDataReader< T >.
Property Documentation
|
get |
Number of channels in the audio signal.
|
get |
If not null, audio object is in invalid state.
|
get |
Sampling rate of the audio signal (in Hz).