Thanks to the help of users, it was possible to gather more information about the problem in the 24H2 update. If the user's monitor contains speakers, if the graphics card and the monitor are connected with an HDMI cable that transmits sound – this leads to unstable work of the text-to-speech program, it periodically crashes, and in the event log the MMDevApi.dll system library is specified as the cause of the crash. But if the user connects speakers or headphones to the audio jack on the motherboard of the same computer, the text-to-speech program works stably. So, the problem is neither in the MMDevApi.dll library nor in the text-to-speech program, but in some driver inside the 24H2 update. Until Microsoft developers fix the problem, here's the situation: if you installed the 24H2 update for Windows 11 and the text-to-speech application starts crashing, connect your audio output device to a different port on your computer.
Here is the information about the user's computer configuration.
1)Video Adapter-------------------------
Video Chipset: NVIDIA GeForce GTX 1650 Super
Video Memory: 4096 MBytes of GDDR6 SDRAM [Micron]
Video Card: ASUS GTX 1650 Super
Video Bus: PCIe v3.0 x16 (8.0 GT/s) @ x16 (8.0 GT/s)
GPU Type: Discrete
Video BIOS Version: 90.16.46.00.47 [UEFI]
Driver Manufacturer: NVIDIA
Driver Version: 32.0.15.6614 (GeForce 566.14)
Driver Date: 06-Nov-2024
2)Monitor----------------------------
Monitor Name: LG [Unknown Model: GSM5B08]
Monitor Name (Manuf): LG Ultra HD
Input Signal: Digital
Driver Manufacturer: Microsoft
Driver Description: Generic PnP Monitor
Driver Version: 10.0.26100.1882
Driver Date: 21-Jun-2006
- Audio--------------------------------
a) Audio Adapter: Intel Kaby Lake - High Definition Audio / cAVS (Audio, Voice, Speech)
High Definition Audio Codec: Intel
Driver Manufacturer: Intel(R) Corporation
Driver Description: Intel(R) Display Audio
Driver Version: 10.27.0.10
Driver Date: 16-Apr-2021
High Definition Audio Codec: RealTek ALC899
Driver Manufacturer: Realtek Semiconductor Corp.
Driver Version: 6.0.1.8248
Driver Date: 05-Sep-2017
b) Audio Adapter: NVIDIA TU116 - High Definition Audio Controller
High Definition Audio Codec: nVidia
Driver Manufacturer: NVIDIA Corporation
Driver Description: NVIDIA High Definition Audio
Driver Version: 1.4.2.6
Driver Date: 26-Sep-2024
A sincere request to Microsoft developers: please solve the problem! All this started after installing update 24H2, before that everything worked stable for any audio output devices.