
Synthesize to speaker outputįollow these steps to create a new console application and install the Speech SDK. For example, westus.įor more configuration options, see the Xcode documentation. Set SPEECH_REGION to the region of your resource. To set the environment variable for your Speech resource region, follow the same steps.
Enter SPEECH_KEY for the Name and enter your Speech resource key for the Value. Under Environment Variables select the plus (+) sign to add a new environment variable. Select Arguments on the Run (Debug Run) page. For example, follow these steps to set the environment variable in Xcode 13.4.1. Xcodeįor iOS and macOS development, you set the environment variables in Xcode. bash_profile, and add the environment variables: export SPEECH_KEY=your-keyĪfter you add the environment variables, run source ~/.bash_profile from your console window to make the changes effective. export SPEECH_KEY=your-keyĪfter you add the environment variables, run source ~/.bashrc from your console window to make the changes effective. For example, if you are using Visual Studio as your editor, restart Visual Studio before running the example.
If you only need to access the environment variable in the current running console, you can set the environment variable with set instead of setx.Īfter you add the environment variables, you may need to restart any running programs that will need to read the environment variable, including the console window.