Photon Voice  v2.8
English | 日本語 | 한국
Classes | Public Types | Public Member Functions | Protected Member Functions | Properties | List of all members
Recorder Class Reference

Component representing outgoing audio stream in scene. More...

Inherits VoiceComponent.

Classes

class  PhotonVoiceCreatedParams
 

Public Types

enum  InputSourceType
 
enum  MicType
 
enum  SampleTypeConv
 

Public Member Functions

void Init (VoiceClient voiceClient, object customObj=null)
 Initializes the Recorder component to be able to transmit audio. More...
 
void ReInit ()
 
void RestartRecording ()
 Restarts recording if something has changed that requires this. More...
 
void VoiceDetectorCalibrate (int durationMs, Action< float > detectionEndedCallback=null)
 Trigger voice detector calibration process. While calibrating, keep silence. Voice detector sets threshold basing on measured backgroud noise level. More...
 
void StartRecording ()
 Starts recording. More...
 
void StopRecording ()
 Stops recording. More...
 

Protected Member Functions

virtual void SendPhotonVoiceCreatedMessage ()
 
- Protected Member Functions inherited from VoiceComponent
virtual void Awake ()
 

Properties

static AudioInEnumerator PhotonMicrophoneEnumerator [get]
 Enumerator for the available microphone devices gathered by the Photon plugin. More...
 
bool IsInitialized [get]
 If true, this Recorder has been initialized and is ready to transmit to remote clients. Otherwise call Init. More...
 
bool RequiresInit [get]
 
bool RequiresRestart [get, protected set]
 Returns true if something has changed in the Recorder while recording that won't take effect unless recording is restarted using RestartRecording. More...
 
bool TransmitEnabled [get, set]
 If true, audio transmission is enabled. More...
 
bool Encrypt [get, set]
 If true, voice stream is sent encrypted. More...
 
bool DebugEchoMode [get, set]
 If true, outgoing stream routed back to client via server same way as for remote client's streams. More...
 
bool ReliableMode [get, set]
 If true, stream data sent in reliable mode. More...
 
bool VoiceDetection [get, set]
 If true, voice detection enabled. More...
 
float VoiceDetectionThreshold [get, set]
 Voice detection threshold (0..1, where 1 is full amplitude). More...
 
int VoiceDetectionDelayMs [get, set]
 Keep detected state during this time after signal level dropped below threshold. Default is 500ms More...
 
object UserData [get, set]
 Custom user object to be sent in the voice stream info event. More...
 
Func< IAudioDescInputFactory [get, set]
 Set the method returning new Voice.IAudioDesc instance to be assigned to a new voice created with Source set to Factory More...
 
AudioUtil.IVoiceDetector VoiceDetector [get]
 Returns voice activity detector for recorder's audio stream. More...
 
string UnityMicrophoneDevice [get, set]
 Set or get Unity microphone device used for streaming. More...
 
int PhotonMicrophoneDeviceId [get, set]
 Set or get photon microphone device used for streaming. More...
 
byte AudioGroup [get, set]
 Target interest group that will receive transmitted audio. More...
 
byte InterestGroup [get, set]
 Target interest group that will receive transmitted audio. More...
 
bool IsCurrentlyTransmitting [get]
 Returns true if audio stream broadcasts. More...
 
AudioUtil.ILevelMeter LevelMeter [get]
 Level meter utility. More...
 
bool VoiceDetectorCalibrating [get]
 If true, voice detector calibration is in progress. More...
 
ILocalVoiceAudio voiceAudio [get]
 
InputSourceType SourceType [get, set]
 Audio data source. More...
 
MicType MicrophoneType [get, set]
 Which microphone API to use when the Source is set to Microphone. More...
 
SampleTypeConv TypeConvert [get, set]
 Force creation of 'short' pipeline and convert audio data to short for 'float' audio sources. More...
 
AudioClip AudioClip [get, set]
 Source audio clip. More...
 
bool LoopAudioClip [get, set]
 Loop playback for audio clip sources. More...
 
POpusCodec.Enums.SamplingRate SamplingRate [get, set]
 Outgoing audio stream sampling rate. More...
 
OpusCodec.FrameDuration FrameDuration [get, set]
 Outgoing audio stream encoder delay. More...
 
int Bitrate [get, set]
 Outgoing audio stream bitrate. More...
 
bool IsRecording [get, set]
 Gets or sets whether this Recorder is actively recording audio to be transmitted. More...
 
bool ReactOnSystemChanges [get, set]
 
bool AutoStart [get, set]
 If true, automatically start recording when initialized. More...
 
- Properties inherited from VoiceComponent
VoiceLogger Logger [get, protected set]
 
DebugLevel LogLevel [get, set]
 
- Properties inherited from ILoggable
DebugLevel LogLevel [get, set]
 
VoiceLogger Logger [get]
 

Additional Inherited Members

- Protected Attributes inherited from VoiceComponent
DebugLevel logLevel = DebugLevel.ERROR
 

Detailed Description

Component representing outgoing audio stream in scene.

Member Function Documentation

void Init ( VoiceClient  voiceClient,
object  customObj = null 
)

Initializes the Recorder component to be able to transmit audio.

Parameters
voiceClientThe VoiceClient to be used with this Recorder.
customObjOptional user data object to be transmitted with the voice stream info
void RestartRecording ( )

Restarts recording if something has changed that requires this.

void StartRecording ( )

Starts recording.

void StopRecording ( )

Stops recording.

void VoiceDetectorCalibrate ( int  durationMs,
Action< float >  detectionEndedCallback = null 
)

Trigger voice detector calibration process. While calibrating, keep silence. Voice detector sets threshold basing on measured backgroud noise level.

Parameters
durationMsDuration of calibration in milliseconds.

Property Documentation

AudioClip AudioClip
getset

Source audio clip.

byte AudioGroup
getset

Target interest group that will receive transmitted audio.

If AudioGroup != 0, recorder's audio data is sent only to clients listening to this group.

bool AutoStart
getset

If true, automatically start recording when initialized.

int Bitrate
getset

Outgoing audio stream bitrate.

bool DebugEchoMode
getset

If true, outgoing stream routed back to client via server same way as for remote client's streams.

bool Encrypt
getset

If true, voice stream is sent encrypted.

OpusCodec.FrameDuration FrameDuration
getset

Outgoing audio stream encoder delay.

Func<IAudioDesc> InputFactory
getset

Set the method returning new Voice.IAudioDesc instance to be assigned to a new voice created with Source set to Factory

byte InterestGroup
getset

Target interest group that will receive transmitted audio.

If InterestGroup != 0, recorder's audio data is sent only to clients listening to this group.

bool IsCurrentlyTransmitting
get

Returns true if audio stream broadcasts.

bool IsInitialized
get

If true, this Recorder has been initialized and is ready to transmit to remote clients. Otherwise call Init.

bool IsRecording
getset

Gets or sets whether this Recorder is actively recording audio to be transmitted.

AudioUtil.ILevelMeter LevelMeter
get

Level meter utility.

bool LoopAudioClip
getset

Loop playback for audio clip sources.

MicType MicrophoneType
getset

Which microphone API to use when the Source is set to Microphone.

int PhotonMicrophoneDeviceId
getset

Set or get photon microphone device used for streaming.

AudioInEnumerator PhotonMicrophoneEnumerator
staticget

Enumerator for the available microphone devices gathered by the Photon plugin.

bool ReliableMode
getset

If true, stream data sent in reliable mode.

bool RequiresRestart
getprotected set

Returns true if something has changed in the Recorder while recording that won't take effect unless recording is restarted using RestartRecording.

Think of this as a "isDirty" flag.

POpusCodec.Enums.SamplingRate SamplingRate
getset

Outgoing audio stream sampling rate.

InputSourceType SourceType
getset

Audio data source.

bool TransmitEnabled
getset

If true, audio transmission is enabled.

SampleTypeConv TypeConvert
getset

Force creation of 'short' pipeline and convert audio data to short for 'float' audio sources.

string UnityMicrophoneDevice
getset

Set or get Unity microphone device used for streaming.

object UserData
getset

Custom user object to be sent in the voice stream info event.

bool VoiceDetection
getset

If true, voice detection enabled.

int VoiceDetectionDelayMs
getset

Keep detected state during this time after signal level dropped below threshold. Default is 500ms

float VoiceDetectionThreshold
getset

Voice detection threshold (0..1, where 1 is full amplitude).

AudioUtil.IVoiceDetector VoiceDetector
get

Returns voice activity detector for recorder's audio stream.

bool VoiceDetectorCalibrating
get

If true, voice detector calibration is in progress.