Photon C++ Client API  5.0.7.3
Public Member Functions | List of all members
ToneAudioPusher< T > Class Template Reference

IAudioPusher that provides a constant tone signal. More...

Inheritance diagram for ToneAudioPusher< T >:
Inheritance graph
[legend]
Collaboration diagram for ToneAudioPusher< T >:
Collaboration graph
[legend]

Public Member Functions

 ToneAudioPusher (int frequency=440, int bufSizeMs=100, int samplingRate=44100, int channels=2)
 Create a new ToneAudioPusher instance More...
 
virtual int getSamplingRate (void) const
 Sampling rate of the audio signal (in Hz). More...
 
virtual int getChannels (void) const
 Number of channels in the audio signal. More...
 
virtual Common::JString getError (void) const
 If not an empty string, then the audio object is in invalid state. More...
 
virtual void setCallback (void *pLocalVoice, void(*pCallback)(void *, const Buffer< T > &))
 Set the callback function used for pushing data More...
 
virtual Common::JStringtoString (Common::JString &retStr, bool withTypes=false) const
 
- Public Member Functions inherited from ToString
virtual ~ToString (void)
 
virtual JString typeToString (void) const
 
JString toString (bool withTypes=false) const
 

Detailed Description

template<typename T>
class ExitGames::Voice::AudioUtil::ToneAudioPusher< T >

IAudioPusher that provides a constant tone signal.

Constructor & Destructor Documentation

◆ ToneAudioPusher()

ToneAudioPusher ( int  frequency = 440,
int  bufSizeMs = 100,
int  samplingRate = 44100,
int  channels = 2 
)

Create a new ToneAudioPusher instance

Parameters
frequencyFrequency of the generated tone (in Hz).
bufSizeMsSize of buffers to push (in milliseconds).
samplingRateSampling rate of the audio signal (in Hz).
channelsNumber of channels in the audio signal.

Member Function Documentation

◆ getSamplingRate()

int getSamplingRate ( void  ) const
virtual

Sampling rate of the audio signal (in Hz).

Implements IAudioDesc.

◆ getChannels()

int getChannels ( void  ) const
virtual

Number of channels in the audio signal.

Implements IAudioDesc.

◆ getError()

JString getError ( void  ) const
virtual

If not an empty string, then the audio object is in invalid state.

Implements IAudioDesc.

◆ setCallback()

void setCallback ( void *  pLocalVoice,
void(*)(void *, const Buffer< T > &)  pCallback 
)
virtual

Set the callback function used for pushing data

Parameters
pLocalVoiceOutgoing audio stream, for context
pCallbackCallback function to use

Implements IAudioPusher< T >.

◆ toString()

JString & toString ( Common::JString retStr,
bool  withTypes = false 
) const
virtual
Remarks
The cost of this function depends a lot on implementation details of the implementing subclasses, but for container classes this function can become quite expensive, if the instance contains huge amounts of data, as its cost for many container class implementations increases disproportionately high to the size of the payload.
Parameters
retStrreference to a string, to store the return-value in; the information, which is generated by this function, will be attached at the end of any eventually existing previous content of the string
withTypesset to true, to include type information in the generated string
Returns
a JString representation of the instance and its contents for debugging purposes.

Implements ToString.