This sample demonstrates how to synthesize speech with C# under .NET 8.0 (Windows or Linux) using the Speech SDK. See the accompanying article on the SDK documentation page which describes how to build this sample from scratch in Visual Studio.
Note: We currently only support specific Linux distributions and target architectures.
- A subscription key for the Speech service. See Try the speech service for free.
- A PC (Windows, Linux, Mac) with a working speaker or headset. See the Speech SDK installation quickstart for details on system requirements and setup.
-
By building this sample you will download the Microsoft Cognitive Services Speech SDK. By downloading you acknowledge its license, see Speech SDK license agreement.
-
If you are using Microsoft Visual Studio on Windows:
- Start Microsoft Visual Studio and select File > Open > Project/Solution.
- Navigate to the folder containing this sample, and select the solution file contained within it.
-
Edit the
Program.cs
source:- Replace the string
YourSubscriptionKey
with your own subscription key. - Replace the string
YourServiceRegion
with the service region of your subscription. For example, replace withwestus
if you are using the 30-day free trial subscription.
- Replace the string
-
If you are using Microsoft Visual Studio on Windows, press Ctrl+Shift+B, or select Build > Build Solution.
-
If you are using the .NET Core CLI, run the following command from the directory that contains this sample:
dotnet build helloworld/helloworld.csproj
To debug the app and then run it, press F5 or use Debug > Start Debugging. To run the app without debugging, press Ctrl+F5 or use Debug > Start Without Debugging.
Run the following command from the directory that contains this sample:
dotnet helloworld/bin/Debug/net8.0/helloworld.dll