Dec 20 2022 02:40 AM - edited Dec 20 2022 04:18 AM
Hi guys, I'm having issues using PsiBot project (https://github.com/microsoftgraph/microsoft-graph-comms-samples/tree/master/Samples/PublicSamples/Ps...) as base. JUST happening on some MS accounts. When I'm trying to get audio from a Teams meeting using the bot I'm not getting any data, just silence.
public void Received(AudioMediaBuffer audioFrame)
{
//Console.WriteLine("Receiving audio");
if (audioFrame.Timestamp == 0)
{
this.logger.Warn($"Audio buffer timestamp is zero.");
return;
}
var audioFormat = audioFrame.AudioFormat == Microsoft.Skype.Bots.Media.AudioFormat.Pcm44KStereo ?
Microsoft.Psi.Audio.WaveFormat.Create16BitPcm(44000, 2) :
Microsoft.Psi.Audio.WaveFormat.Create16kHz1Channel16BitPcm();
var buffers = new Dictionary<string, (AudioBuffer, DateTime)>();
try
{
unsafe
{
FileStream file = new FileStream(MediaFrameSourceComponent.BASE_PATH + "audio_" + callHandler.Call.Id + ".raw", FileMode.Append, FileAccess.Write);
UnmanagedMemoryStream ustream = new UnmanagedMemoryStream((byte*)audioFrame.Data, audioFrame.Length);
ustream.CopyTo(file);
ustream.Close();
file.Close();
}
}
catch (Exception e)
{
Console.WriteLine("Error receiving audio" + e.StackTrace);
}
}
This is the error log:
This is the list of permissions the MS app has:
At this moment I don't have any clue because as I said before this is not happening in all MS accounts, just in a few ones.
Can anyone bring any idea?
Thanks
Dec 21 2022 12:15 AM
Dec 21 2022 02:12 AM
Dec 23 2022 12:47 AM
Jan 10 2023 11:01 PM - edited Jan 10 2023 11:02 PM
@pablomoreno700 - Engieerning team has said that the sample by default is using an older version (1.19.0.25) of the Microsoft.Skype.Bots.Media SDK. Team has suggested that the user should upgrade their program to the latest version (1.24.0.36). Can you please try and confirm if it works.
Jan 11 2023 08:06 AM
@Meghana-MSFT I was using this new version already.
Jan 16 2023 09:13 PM
Jan 18 2023 02:50 PM - edited Jan 18 2023 02:52 PM
When you capture the error exception, can you please log and report the following properties:
audioFrame.Length
audioFrame.IsSilence
audioFrame.ActiveSpeakers?.Length
whether audioFrame.Data is null (IntPtr.Zero) or not
audioFrame.UnmixedAudioBuffers?.Length
and also the corresponding value of mediaSessionId from when the call session is setup:
// create media session object, this is needed to establish call connections return this.Client.CreateMediaSession( new AudioSocketSettings { StreamDirections = StreamDirection.Sendrecv, // Note! Currently, the only audio format supported when receiving unmixed audio is Pcm16K SupportedAudioFormat = AudioFormat.Pcm16K, ReceiveUnmixedMeetingAudio = true //get the extra buffers for the speakers }, videoSocketSettings, vbssSocketSettings, mediaSessionId: mediaSessionId);
Also, does your bot join the Teams meeting directly always, or do you know if it sometimes joins via the lobby? If the bot joins both ways, sometimes directly (lobby bypass) and sometimes via the lobby, do you know if there is any correlation between the join method and the problem you are observing?
Thanks
Jan 18 2023 02:58 PM