Component representing outgoing audio stream in scene. More...
Inherits VoiceComponent.
Public Types | |
enum | InputSourceType |
enum | MicType |
Public Member Functions | |
bool | RestartRecording () |
Restarts recording if Recorder.RecordingEnabled is true 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 background noise level. More... | |
bool | SetIosAudioSessionParameters (IOS.AudioSessionParameters asp) |
Sets the AudioSessionParameters for iOS audio initialization when Photon MicrophoneType is used. More... | |
bool | SetIosAudioSessionParameters (IOS.AudioSessionCategory category, IOS.AudioSessionMode mode, IOS.AudioSessionCategoryOption[] options) |
Sets the AudioSessionParameters for iOS audio initialization when Photon MicrophoneType is used. More... | |
bool | SetAndroidNativeMicrophoneSettings (bool aec=false, bool agc=false, bool ns=false) |
Sets the native Android audio input settings when the Photon microphone type is used. More... | |
bool | ResetLocalAudio () |
Resets audio session and parameters locally to fix broken recording due to system configuration modifications or audio interruptions or audio routing changes. More... | |
Static Public Attributes | |
const int | MIN_OPUS_BITRATE = 6000 |
const int | MAX_OPUS_BITRATE = 510000 |
Protected Member Functions | |
virtual void | SendPhotonVoiceCreatedMessage () |
void | Update () |
Protected Member Functions inherited from VoiceComponent | |
virtual void | Awake () |
Properties | |
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< IAudioDesc > | InputFactory [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... | |
byte | InterestGroup [get, set] |
Target interest group that will receive transmitted audio. More... | |
int[] | TargetPlayers [get, set] |
Target players which 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... | |
AudioClip | AudioClip [get, set] |
Source audio clip. More... | |
bool | LoopAudioClip [get, set] |
Loop playback for audio clip sources. More... | |
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 | RecordingEnabled [get, set] |
Gets or sets whether this Recorder is recording audio to be transmitted. More... | |
bool | StopRecordingWhenPaused [get, set] |
If true, stop recording when paused resume/restart when un-paused. More... | |
bool | UseOnAudioFilterRead [get, set] |
If true, recording will make use of Unity's OnAudioFitlerRead callback from a muted local AudioSource. More... | |
bool | UseMicrophoneTypeFallback [get, set] |
If true, if recording fails to start with Unity microphone type, Photon microphone type is used -if available- as a fallback and vice versa. More... | |
bool | RecordWhenJoined [get, set] |
If true, recording starts when joining the room and stops when leaving the room. More... | |
DeviceInfo | MicrophoneDevice [get, set] |
bool | AndroidMicrophoneAGC [get] |
bool | AndroidMicrophoneAEC [get] |
bool | AndroidMicrophoneNS [get] |
Properties inherited from VoiceComponent | |
string | Name [set] |
Additional Inherited Members | |
Public Attributes inherited from VoiceComponent | |
VoiceLogger | VoiceLogger => impl.VoiceLogger |
Protected Attributes inherited from VoiceComponent | |
Voice.ILogger | Logger => impl.Logger |
Component representing outgoing audio stream in scene.
bool ResetLocalAudio | ( | ) |
Resets audio session and parameters locally to fix broken recording due to system configuration modifications or audio interruptions or audio routing changes.
bool RestartRecording | ( | ) |
Restarts recording if Recorder.RecordingEnabled is true
bool SetAndroidNativeMicrophoneSettings | ( | bool | aec = false , |
bool | agc = false , |
||
bool | ns = false |
||
) |
Sets the native Android audio input settings when the Photon microphone type is used.
aec | Acoustic Echo Cancellation |
agc | Automatic Gain Control |
ns | Noise Suppression |
bool SetIosAudioSessionParameters | ( | IOS.AudioSessionCategory | category, |
IOS.AudioSessionMode | mode, | ||
IOS.AudioSessionCategoryOption[] | options | ||
) |
Sets the AudioSessionParameters for iOS audio initialization when Photon MicrophoneType is used.
category | Audio session category to be used. |
mode | Audio session mode to be used. |
options | Audio session category options to be used |
bool SetIosAudioSessionParameters | ( | IOS.AudioSessionParameters | asp | ) |
Sets the AudioSessionParameters for iOS audio initialization when Photon MicrophoneType is used.
asp | You can use custom value or one from presets, IOS.AudioSessionParametersPresets |
void VoiceDetectorCalibrate | ( | int | durationMs, |
Action< float > | detectionEndedCallback = null |
||
) |
Trigger voice detector calibration process. While calibrating, keep silence. Voice detector sets threshold basing on measured background noise level.
durationMs | Duration of calibration in milliseconds. |
detectionEndedCallback | Callback when VAD calibration ends. |
|
getset |
Source audio clip.
|
getset |
Outgoing audio stream bitrate.
|
getset |
If true, outgoing stream routed back to client via server same way as for remote client's streams.
Initialized with serialized field and can be updated by Editor at runtime.
|
getset |
If true, voice stream is sent encrypted.
Initialized with serialized field and can be updated by Editor at runtime.
|
getset |
Outgoing audio stream encoder delay.
|
getset |
Set the method returning new Voice.IAudioDesc instance to be assigned to a new voice created with Source set to Factory
|
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. Initialized with serialized field and can be updated by Editor at runtime.
|
get |
Returns true if audio stream broadcasts.
|
get |
Level meter utility.
|
getset |
Loop playback for audio clip sources.
|
getset |
Which microphone API to use when the Source is set to Microphone.
|
getset |
Gets or sets whether this Recorder is recording audio to be transmitted.
|
getset |
If true, recording starts when joining the room and stops when leaving the room.
|
getset |
If true, stream data sent in reliable mode.
Initialized with serialized field and can be updated by Editor at runtime.
|
getset |
Outgoing audio stream sampling rate.
|
getset |
Audio data source.
|
getset |
If true, stop recording when paused resume/restart when un-paused.
|
getset |
Target players which will receive transmitted audio.
Initialized with serialized field and can be updated by Editor at runtime
|
getset |
If true, audio transmission is enabled.
|
getset |
|
getset |
If true, recording will make use of Unity's OnAudioFitlerRead callback from a muted local AudioSource.
If enabled, 3D sounds and voice positioning can be lost.
|
getset |
Custom user object to be sent in the voice stream info event.
|
getset |
If true, voice detection enabled.
|
getset |
Keep detected state during this time after signal level dropped below threshold. Default is 500ms
|
getset |
Voice detection threshold (0..1, where 1 is full amplitude).
|
get |
Returns voice activity detector for recorder's audio stream.
|
get |
If true, voice detector calibration is in progress.