Photon Voice not loud enough.
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation on Voice.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
Photon Voice not loud enough.
Chisely
2017-05-06 01:47:23
Hey there.
I'm using Photon Voice with Oculus Rift and HTC Vive and I've run into a problem with loudness. The voice chat is borderline unhearable .
I've checked the Rift and Vive microphones on both machines to make sure they are running with max sensitivity. I made sure that Photon Voice audiosources are set to 2D to remove any spatial falloff. The volume is set to 1 (max in unity). I tried running calibration after the player prefab is spawned, but this changes nothing. I've reduced the volume of all other audiosources in my game by 0.5, but this is still not enough to make the voicechat clearly legible.
Is there a way I can increase the volume of the Voice Speaker? It would be best if there was a multiplier of base setting, kinda like PlayOneShot works in audio source.
Comments
Hi,
You can "amplify" data in audio buffer before passing it to Photon Voice.
The simplest way is modifying MicWrapper.GetData method. Multiply each element of buffer after this.mic.GetData(...) call by amplification factor.
Or use this approach http://forum.photonengine.com/discussion/comment/32592/#Comment_32592
We changed Photon Voice "internal" api. So both solutions should be updated with next Photon Voice release. Sorry for that.
PhotonVoiceRecorder.LevelMeter allows measure current audio signal level passed to PhotonVoice.
Thanks a lot Vadim, I did just that.
Would love to have amplification factor as a property I can edit in future Photon Voice version.
Cheers.
Hi,
I have the exact same issue with HTC Vive. Would you mind sharing your coding for the amplification?
@Spaggi wrote:
Hi,
I have the exact same issue with HTC Vive. Would you mind sharing your coding for the amplification?
A long overdue, but I'm going to paste the solution here for others looking for it.
At the start of OnAudioFrame method in PhotonVoiceNetworks.cs I added these lines:
<pre class="CodeBlock"><code> for(int i =0; i < frame.Length; i++)
{
frame[i] *= (AppSettings.VoiceChatVolume * 5);
} </code></pre>
Where AppSettings.VoiceChatVolume is my static float (0-1 range) that players can change to adjust the volume of the voice chat.
@Chisely thank you for sharing your solution with us. Maybe we will add this and the amplification factor you mentioned.
What's the best way to increase volume in Voice 2.0? (As OnAudioFrame method doesn't exist anymore)
Hi @shafy,
In Photon Voice 2.x OnAudioFrame
has been moved to Speaker.OnAudioFrame
.
Cool, thanks a lot @JohnTube
I also find volume being too low even when it set to 100%. Is this OnAudioFrame hack still the only way to control the volume in Photon Voice? If so, please add it as a feature. Hacking and modifying Photon Voice code is not very good solution because they are lost whenever you update to new version.
Hi @jarileon,
Thank you for choosing Photon!
What Photon Voice version do you use?
We recommend updating to latest versions either 1.17 or 2.2.
Does this happen using Photon MicrophoneType or Unity MicrophoneType?
Also what Unity version do you use?
Do you notice the low volume in Unity Editor or in a build?
If it's a build, what is your target platform and what is the device model and OS?
I am using Photon Voice v2.1.3 (December 7th, 2018). Microphone type is set to "Unity". Unity version is 2018.1.0f2.
The volume is low both in Editor and in Standalone Windows build. I´m using Windows 10 on MSI GS63VR 7RF.
Hi @jarileon,
You should try Photon MicrophoneType first.
Then if it did not help, add this SimpleAmplifier component to the same GameObject as the Recorder to avoid having to change Photon Voice code every time.
@JohnTube wrote:
Hi @jarileon,
Then if it did not help, add this SimpleAmplifier component to the same GameObject as the Recorder to avoid having to change Photon Voice code every time.
Thanks @JohnTube, but the provided code does not work. The "public class SimpleAmplifierEditor : Editor" gives error "'Editor' is a namespace but is used like a type". This goes away by removing the "namespace Photon.Voice.Unity.UtilityScripts", but then other error emerge.
Hi @jarileon,
Could you try putting the file under "Photon/PhotonVoice/Code/UtilityScripts/SimpleAmplifier.cs"?
What Unity version are you using?
I have tested this on Unity 5.6.0f3.
@JohnTube Thanks, the script started working when it was placed in Photon/PhotonVoice/Code/UtilityScripts/. And I was able to boost the level, it just took a while to find a good value (it was 10 for me).
Now, the question is why is not a feature like this a built-in feature in Photon Voice? I would suggest you consider adding this, at least I had to use a lot of time to find out why the volume level is so low, then ask about it in the forums, then exchanging some messages etc.
hi @jarileon,
Thank you for your feedback.
The SimpleAmplifier will be added to Photon Voice in the future.
I need help please!!
I used the same scipt and it doesnt work i dragged an dropped it in the ulityScripts
juanitojones
2022-04-19 06:46:04
DXXNS
Were you able to solve it? the audio is too low and simpleAmplifier doesn't work
What do you use as audio input? For a microphone you need Automatic Gain Control in best case.
Hardware AGC is enabled when you use Photon microphone type. You can also add software AGC with WebRtcAudioDsp component.
MicAmplifier amplifies audio by a constant factor, This may result in too high volume on devices where the original level is high enough.
All additional components should be attached to the object with the Recorder component.
None of these are working for me.
Adding this to the start of the OnAudioFrame method in Speaker.CS
for(int i =0; i < frame.Length; i++)
{
frame[i] *= (AppSettings.VoiceChatVolume * 5);
}
Throws this error:
Assets\Photon\PhotonVoice\Code\Speaker.cs(342,39): error CS1061: 'FrameOut
I also tried creating the SimpleAmplifier script and adding to the
Photon/PhotonVoice/Code/UtilityScripts/SimpleAmplifier.cs
Directory, then attaching it to my VoiceManager GameObject in my project root, which is where my Recorder component is attached.
It compiles, but when I try to run the app it throws this error:
MissingMethodException: Photon.Voice.Unity.UtilityScripts.SimpleAmplifier.PhotonVoiceCreated Due to: Attempted to access a missing member.
System.RuntimeType.InvokeMember (System.String name, System.Reflection.BindingFlags bindingFlags, System.Reflection.Binder binder, System.Object target, System.Object[] providedArgs, System.Reflection.ParameterModifier[] modifiers, System.Globalization.CultureInfo culture, System.String[]
I tried the Photon microphone and it wasn't louder and was more choppy.
Running a 2020 Asus ROG with a wired headphones and mic (which have both been tested and are working)
Thanks for any help! The voice chat is working, it is just realy soft.
We do not recommend to process audio in a Speaker. Please use microphone's hardware or software AGC or IProcessor in input pipeline or ready-to-use MicAmplifier processor.
We added the WebRTC based DSP (Digital Signal Processor) and it improved our situation. Do you not recommend this?
PierreBlanc 2021-04-06T09:23:14+00:00
Hi there,
We are using Photon Voice v2.24 in a multi-platform collaborative app. Our product runs on PC/OSX VR and vrless as well as mobile IOS/Android.
Few questions:
- On which platform is it recommended to use Photon or Unity mic ?
On IOS Photon mic seems to provides echo cancellation and improves the sounds quality. Should it be used on Windows too per instance ?- Issue with switching audio output
Using the Photon Voice 2 demo we managed to reproduce something we experienced in our app.
On a laptop with AirPods connected, when switching the output from the headset to the internal speaker, the audio (output and input) is lost until we reselect a mic again (select the same one or another one). This happens with both Unity and Photon mic.- WebRtcAudioDSP AGC
Using Photon Mic we experiences some low level issues, which we fixed by adding the WebRtcAudioDSP component, with AGC enabled.- WebRtcAudioDSP VAD
This component also provides VAD. Currently we use Photon VAD, which allows us to know when the voice is detected and display info about the state of the detection in our collaborative environment.
It seems that WebRtcAudioDSP is recommended instead of Photon VAD, but is it possible to plug something to know when the voice is detected with this method ?- WebRtcAudioDSP and AEC
We do not use this option. The question is that if i understand correctly on IOS/Android we shouldnt, as photon mic already provides built in hardware AEC. But on Windows, should we enable it ?
All the best !
Pierre We turned the volume levels on our mics up to the maximum and it was still too quiet. I will research software AGC and iProcessor and a MicAmplifier and how those could be added to our game.
Yes, by software AGC I meant WebRtcAudioDsp component that comes with the Voice2 package. Disable everything in it except AGC. AGC automatically amplifies the mic signal if it's too low.
Back to top