microsoftgraph / microsoft-graph-comms-samples

Microsoft Graph Communications Samples
MIT License
211 stars 236 forks source link

Low audio data quality #680

Closed tomcatliu2016 closed 11 months ago

tomcatliu2016 commented 12 months ago

Describe the issue I tried the EchoBot sample and made some modifications to output the received audio data as a wav file. However, I found that the quality of the received audio data is very low, almost like silence. Does anyone know what's going on? I tried both

ReceiveUnmixedMeetingAudio=false and

ReceiveUnmixedMeetingAudio=true,
EnableAudioHealingForUnmixed=true,
EnableLocalAudioMixingForUnmixed=true

but there was no change in the result.

Code Snippet Insert the code snippet if any.

Expected behavior High quality audio data

Graph SDK (please complete the following information):

<ItemGroup>
<PackageReference Include="AdaptiveCards">
  <Version>2.7.3</Version>
</PackageReference>
<PackageReference Include="Azure.Core">
  <Version>1.23.0</Version>
</PackageReference>
<PackageReference Include="DotNetEnv">
  <Version>2.3.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.ApplicationInsights">
  <Version>2.20.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.AspNet.WebApi">
  <Version>5.2.7</Version>
</PackageReference>
<PackageReference Include="Microsoft.AspNet.WebApi.Client">
  <Version>5.2.7</Version>
</PackageReference>
<PackageReference Include="Microsoft.AspNet.WebApi.Core">
  <Version>5.2.7</Version>
</PackageReference>
<PackageReference Include="Microsoft.AspNet.WebApi.Owin">
  <Version>5.2.7</Version>
</PackageReference>
<PackageReference Include="Microsoft.AspNet.WebApi.WebHost">
  <Version>5.2.7</Version>
</PackageReference>
<PackageReference Include="Microsoft.Azure.CognitiveServices.Language.LUIS.Authoring">
  <Version>3.2.0-preview.4</Version>
</PackageReference>
<PackageReference Include="Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime">
  <Version>3.1.0-preview.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.Azure.Services.AppAuthentication">
  <Version>1.6.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces">
  <Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Bot.Builder">
  <Version>4.18.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.WebApi">
  <Version>4.18.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.Bot.Connector">
  <Version>4.18.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.Bot.Connector.Streaming">
  <Version>4.18.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.Bot.Schema">
  <Version>4.18.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.Bot.Streaming">
  <Version>4.18.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.CognitiveServices.Speech">
  <Version>1.20.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration">
  <Version>6.0.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions">
  <Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration.Binder">
  <Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables">
  <Version>6.0.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions">
  <Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration.Json">
  <Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.DependencyInjection">
  <Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions">
  <Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.FileProviders.Abstractions">
  <Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical">
  <Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing">
  <Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Http">
  <Version>2.1.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging">
  <Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions">
  <Version>6.0.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.ApplicationInsights">
  <Version>2.20.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Configuration">
  <Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Console">
  <Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Options">
  <Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions">
  <Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Primitives">
  <Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Graph">
  <Version>4.54.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Graph.Communications.Calls">
  <Version>1.2.0.7270</Version>
</PackageReference>
<PackageReference Include="Microsoft.Graph.Communications.Calls.Media">
  <Version>1.2.0.7270</Version>
</PackageReference>
<PackageReference Include="Microsoft.Graph.Communications.Client">
  <Version>1.2.0.7270</Version>
</PackageReference>
<PackageReference Include="Microsoft.Graph.Communications.Common">
  <Version>1.2.0.7270</Version>
</PackageReference>
<PackageReference Include="Microsoft.Graph.Communications.Core">
  <Version>1.2.0.7270</Version>
</PackageReference>
<PackageReference Include="Microsoft.Graph.Core">
  <Version>2.0.15</Version>
</PackageReference>
<PackageReference Include="Microsoft.Identity.Client">
  <Version>4.42.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.IdentityModel.Clients.ActiveDirectory">
  <Version>5.2.9</Version>
</PackageReference>
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens">
  <Version>6.26.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.IdentityModel.Logging">
  <Version>6.26.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.IdentityModel.Protocols">
  <Version>6.26.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect">
  <Version>6.26.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.IdentityModel.Tokens">
  <Version>6.26.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream">
  <Version>2.2.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Net.Http.Headers">
  <Version>2.1.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.Platforms">
  <Version>6.0.2</Version>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.Targets">
  <Version>5.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Owin">
  <Version>4.2.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Owin.Host.HttpListener">
  <Version>4.2.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Owin.Hosting">
  <Version>4.2.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Rest.ClientRuntime">
  <Version>2.3.23</Version>
</PackageReference>
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure">
  <Version>3.3.19</Version>
</PackageReference>
<PackageReference Include="Microsoft.Skype.Bots.Media">
  <Version>1.27.0.2-alpha</Version>
</PackageReference>
<PackageReference Include="Microsoft.Win32.Primitives">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="NAudio">
  <Version>2.2.1</Version>
</PackageReference>
<PackageReference Include="NETStandard.Library">
  <Version>2.0.3</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
  <Version>13.0.1</Version>
</PackageReference>
<PackageReference Include="Owin">
  <Version>1.0.0</Version>
</PackageReference>
<PackageReference Include="Sprache">
  <Version>2.3.1</Version>
</PackageReference>
<PackageReference Include="System.AppContext">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Buffers">
  <Version>4.5.1</Version>
</PackageReference>
<PackageReference Include="System.Collections">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Collections.Concurrent">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Console">
  <Version>4.3.1</Version>
</PackageReference>
<PackageReference Include="System.Diagnostics.Debug">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Diagnostics.DiagnosticSource">
  <Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="System.Diagnostics.Tools">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Diagnostics.Tracing">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Globalization">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Globalization.Calendars">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.IdentityModel.Tokens.Jwt">
  <Version>6.26.1</Version>
</PackageReference>
<PackageReference Include="System.IO">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.IO.Compression">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.IO.Compression.ZipFile">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.IO.FileSystem">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.IO.FileSystem.Primitives">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.IO.Pipelines">
  <Version>5.0.1</Version>
</PackageReference>
<PackageReference Include="System.Linq">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Linq.Expressions">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Memory">
  <Version>4.5.4</Version>
</PackageReference>
<PackageReference Include="System.Memory.Data">
  <Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="System.Net.Http">
  <Version>4.3.4</Version>
</PackageReference>
<PackageReference Include="System.Net.Http.WinHttpHandler">
  <Version>7.0.0</Version>
</PackageReference>
<PackageReference Include="System.Net.Primitives">
  <Version>4.3.1</Version>
</PackageReference>
<PackageReference Include="System.Net.Sockets">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Numerics.Vectors">
  <Version>4.5.0</Version>
</PackageReference>
<PackageReference Include="System.ObjectModel">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Private.Uri">
  <Version>4.3.2</Version>
</PackageReference>
<PackageReference Include="System.Reflection">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Reflection.Extensions">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Reflection.Primitives">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Resources.ResourceManager">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Runtime">
  <Version>4.3.1</Version>
</PackageReference>
<PackageReference Include="System.Runtime.CompilerServices.Unsafe">
  <Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="System.Runtime.Extensions">
  <Version>4.3.1</Version>
</PackageReference>
<PackageReference Include="System.Runtime.Handles">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Runtime.InteropServices">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Runtime.Numerics">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Runtime.Serialization.Json">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Security.Cryptography.Algorithms">
  <Version>4.3.1</Version>
</PackageReference>
<PackageReference Include="System.Security.Cryptography.Encoding">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Security.Cryptography.Primitives">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Security.Cryptography.X509Certificates">
  <Version>4.3.2</Version>
</PackageReference>
<PackageReference Include="System.Text.Encoding">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Text.Encoding.Extensions">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Text.Encodings.Web">
  <Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="System.Text.Json">
  <Version>7.0.1</Version>
</PackageReference>
<PackageReference Include="System.Text.RegularExpressions">
  <Version>4.3.1</Version>
</PackageReference>
<PackageReference Include="System.Threading">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Threading.Tasks">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Threading.Tasks.Dataflow">
  <Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="System.Threading.Tasks.Extensions">
  <Version>4.5.4</Version>
</PackageReference>
<PackageReference Include="System.Threading.Timer">
  <Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.ValueTuple">
  <Version>4.5.0</Version>
</PackageReference>
<PackageReference Include="System.Xml.ReaderWriter">
  <Version>4.3.1</Version>
</PackageReference>
<PackageReference Include="System.Xml.XDocument">
  <Version>4.3.0</Version>
</PackageReference>

Call ID Provide the list call ids that encountered this issue. Include the time in UTC/GMT when these call have occurred.

Logs If required, please add logs from the SDK. (Please remove any PII from the logs before uploading)

Additional context Add any other context about the problem here.

ssulzer commented 11 months ago

Hi @tomcatliu2016, a couple questions:

  1. What is your calling scenario? Is your bot capturing audio from a Teams meeting? Or a 1:1 call? Is the audio coming from a Teams client or someone calling via PSTN (phone)?
  2. Audio is provided in the format of 16-bit signed, little-endian PCM samples with 16KHz sampling rate. Is the tool you are using to play out the audio configured appropriately for that format? Thanks.
tomcatliu2016 commented 11 months ago

Hi, @ssulzer Thank you for your response. I've just realized the issue today! It turns out I was playing an audio clip and attending the meeting on the same computer. So, is it not possible for the microphone to use the output from the same device as its input? I'm not sure. It seems quite foolish. I hope others don't repeat the same mistake.

ssulzer commented 11 months ago

@tomcatliu2016 Generally, you do not want your microphone to capture the output from your speakers, as that will cause echo. Audio input processing performs acoustic echo cancellation/suppression (AEC/AES) to subtract the signal from the local output device.

tomcatliu2016 commented 11 months ago

@ssulzer Got it,thank you very much!