Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVSpeechSynthetizer.WriteUtteranceAsync crash #20338

Closed
prollin opened this issue Mar 20, 2024 · 0 comments · Fixed by #20339
Closed

AVSpeechSynthetizer.WriteUtteranceAsync crash #20338

prollin opened this issue Mar 20, 2024 · 0 comments · Fixed by #20339
Labels
enhancement The issue or pull request is an enhancement
Milestone

Comments

@prollin
Copy link

prollin commented Mar 20, 2024

Steps to Reproduce

  1. Call AVSpeechSynthetizer.WriteUtteranceAsync

Expected Behavior

AVSpeechSynthetizer.WriteUtteranceAsync doesn't make sense since bufferCallBack gets called multiple time (the utterance data is provided in chunks)
To implement an async method that complete once the utterance is finished, AVSpeechSyntetizer.DidFinishSpeechUtterance needs to be used though it is probably better to let developers deal with this and only explose AVSpeechSynthetizer.WriteUtterance API (which should already be async)

Actual Behavior

Crash when calling AVSpeechSynthetizer.WriteUtteranceAsync

Environment

dotnet --info
.NET SDK:
 Version:           8.0.200
 Commit:            438cab6a9d
 Workload version:  8.0.200-manifests.a7f084b6

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22631
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\8.0.200\

.NET workloads installed:
 [maui-windows]
   Installation Source: VS 17.10.34707.107, VS 17.9.34714.143
   Manifest Version:    8.0.7/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.7\WorkloadManifest.json
   Install Type:        FileBased

 [maccatalyst]
   Installation Source: VS 17.10.34707.107, VS 17.9.34714.143
   Manifest Version:    17.2.8043/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maccatalyst\17.2.8043\WorkloadManifest.json
   Install Type:        FileBased

 [ios]
   Installation Source: VS 17.10.34707.107, VS 17.9.34714.143
   Manifest Version:    17.2.8043/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.ios\17.2.8043\WorkloadManifest.json
   Install Type:        FileBased

 [android]
   Installation Source: VS 17.10.34707.107, VS 17.9.34714.143
   Manifest Version:    34.0.85/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.android\34.0.85\WorkloadManifest.json
   Install Type:        FileBased

 [wasm-tools]
   Installation Source: VS 17.9.34714.143
   Manifest Version:    8.0.3/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.workload.mono.toolchain.current\8.0.3\WorkloadManifest.json
   Install Type:        FileBased


Host:
  Version:      8.0.3
  Architecture: x64
  Commit:       9f4b1f5d66

.NET SDKs installed:
  7.0.407 [C:\Program Files\dotnet\sdk]
  8.0.200 [C:\Program Files\dotnet\sdk]
  8.0.202 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.28 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 6.0.28 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  C:\Users\phili\code\infiniteflight\global.json

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Build Logs

N/A

Example Project (If Possible)

@rolfbjarne rolfbjarne added the enhancement The issue or pull request is an enhancement label Mar 20, 2024
@rolfbjarne rolfbjarne added this to the Future milestone Mar 20, 2024
rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Mar 20, 2024
…xamarin#20338.

The callback may be called multiple times, which means the async version won't
work correctly.

So obsolete and hide the Async binding for now, and remove in XAMCORE_5_0.

References:
* https://discord.com/channels/732297728826277939/732297808148824115/1219903715939582022
* https://developer.apple.com/documentation/avfaudio/avspeechsynthesizer/3141659-writeutterance?language=objc

Fixes xamarin#20338.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue or pull request is an enhancement
Projects
None yet
2 participants