{"id":70217,"date":"2023-11-09T23:01:15","date_gmt":"2023-11-09T15:01:15","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=70217"},"modified":"2023-11-09T19:28:26","modified_gmt":"2023-11-09T11:28:26","slug":"openai-text-to-speech","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/openai-text-to-speech\/","title":{"rendered":"How to Turn Text to Speech with OpenAI"},"content":{"rendered":"<p><strong>OpenAI<\/strong> has recently launched the Audio API that includes a text to speech feature called <code>speech<\/code>, based on their TTS (text-to-speech) technology. This feature offers six built-in voices named <em>Alloy<\/em>, <em>Echo<\/em>, <em>Fable<\/em>, <em>Onyx<\/em>, <em>Nova<\/em>, and <em>Shimmer<\/em>.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/openai-text-to-speech\/hero.jpg\" alt=\"OpenAI Text to Speech\" width=\"1600\" height=\"900\"><\/figure>\n<p>These voices can be incredibly useful for tasks such as narrating blog posts, creating spoken audio in various languages, adding voiceovers to video tutorials, or delivering real-time spoken feedback. In my experience, the output is impressively natural-sounding. If you are not using any <a href=\"https:\/\/www.hongkiat.com\/blog\/text-to-speech-apps\/\">text-to-speech tools<\/a>, then this offering by OpenAI is something you should consider trying.<\/p>\n<p>In this article, we\u2019ll explore <strong>how to set up OpenAI\u2019s TTS<\/strong> and <strong>create your first text-to-speech application<\/strong>. For this demonstration, we will be using the following setup:<\/p>\n<ul>\n<li>Operating System \u2013 macOS<\/li>\n<li>Application \u2013 Terminal<\/li>\n<li>Programming Language \u2013 cURL<\/li>\n<\/ul>\n<p>This guide is also applicable to Windows users. Where necessary, I\u2019ll mention any tools and commands that differ from those used on macOS.<\/p>\n<hr>\n<h2>Step 1 \u2013 Set Up cURL<\/h2>\n<p>Many operating systems come with <a rel=\"noopener\" target=\"_blank\" href=\"https:\/\/curl.se\/\">cURL<\/a> pre-installed. If not, we will first install <a href=\"https:\/\/brew.sh\/\">Homebrew<\/a>, a package manager for macOS, which we will then use to install cURL.<\/p>\n<h3>Check if cURL is Installed<\/h3>\n<p>To check if you already have cURL on your system, make sure you\u2019re connected to the Internet, then type the following command in your Terminal:<\/p>\n<p><strong>Windows users: <\/strong>Use Command Prompt or Windows PowerShell<\/p>\n<pre>curl https:\/\/platform.openai.com<\/pre>\n<p>If cURL is set up correctly and you have an Internet connection, it will send an HTTP request to retrieve the contents of <em>platform.openai.com<\/em>, and you should see output similar to this screenshot:<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/openai-text-to-speech\/curl-output.jpg\" alt=\"Example of cURL Command Output\" width=\"1593\" height=\"709\"><\/figure>\n<h3>How to Install cURL<\/h3>\n<p>If you encounter an error indicating that cURL is not installed, you can install it by following the provided steps.<\/p>\n<p><strong>Windows users:<\/strong> <a rel=\"noopener\" target=\"_blank\" href=\"https:\/\/linuxhint.com\/install-use-curl-windows\/\">How to install cURL on Windows.<\/a><\/p>\n<p>Open a new Terminal window, and enter the commands below to first install Homebrew:<\/p>\n<pre>\/bin\/bash -c \"$(curl -fsSL https:\/\/raw.githubusercontent.com\/Homebrew\/install\/HEAD\/install.sh)\"<\/pre>\n<p>After installing Homebrew, use the following command to install cURL:<\/p>\n<pre>brew install curl<\/pre>\n<p>Lastly, run the command below to set the Homebrew version of cURL as the default one in your shell:<\/p>\n<pre>\r\necho 'export PATH=\"$(brew --prefix)\/opt\/curl\/bin:$PATH\"' >> ~\/.zshrc\r\nsource ~\/.zshrc<\/pre>\n<hr>\n<h2>Step 2 \u2013 Get API Key from OpenAI<\/h2>\n<p>To obtain your API key, first go to <a rel=\"noopener nofollow\" target=\"_blank\" href=\"https:\/\/openai.com\/\">openai.com<\/a>, log in, and then click on \u201c<strong>API keys<\/strong>\u201d in the sidebar.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/openai-text-to-speech\/openai-apikeys.jpg\" alt=\"OpenAI API Keys Section\" width=\"1171\" height=\"356\"><\/figure>\n<p>On the API keys page, click \u201c<strong>+ Create new secret key<\/strong>\u201c, give it a name, and then click \u201c<strong>Create secret key<\/strong>\u201c.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/openai-text-to-speech\/create-secret-key.jpg\" alt=\"Creating OpenAI Secret Key\" width=\"1842\" height=\"830\"><\/figure>\n<p>Afterward, you will receive a new secret key. Make sure to copy and keep it somewhere safe because we will use it later.<\/p>\n<p>Store this secret key in a secure and accessible location. <strong>You will not be able to view it again<\/strong> through your OpenAI account. If you lose this secret key, you will have to create a new one.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/openai-text-to-speech\/secret-key-created.jpg\" alt=\"OpenAI New Secret Key\" width=\"2037\" height=\"940\"><\/figure>\n<hr>\n<h2>Step 3 \u2013 Create Your First Text-to-Speech<\/h2>\n<p>Now it\u2019s time to create your first text-to-speech. Refer to the code below, and replace <code>YOUR_API_KEY_HERE<\/code> with your actual API key.<\/p>\n<pre>\r\ncurl https:\/\/api.openai.com\/v1\/audio\/speech \\\r\n  -H \"Authorization: Bearer <strong>YOUR_API_KEY_HERE<\/strong>\" \\\r\n  -H \"Content-Type: application\/json\" \\\r\n  -d '{\r\n    \"model\": \"tts-1\",\r\n    \"input\": \"hello world\",\r\n    \"voice\": \"alloy\"\r\n  }' \\\r\n  --output example.mp3\r\n<\/pre>\n<p><strong>Example:<\/strong><\/p>\n<pre>\r\ncurl https:\/\/api.openai.com\/v1\/audio\/speech \\\r\n  -H \"Authorization: Bearer <strong>sk-IfClJS63a7Ny3v6yKncIT3XXXXXXXXXXXXXX\"<\/strong> \\\r\n  -H \"Content-Type: application\/json\" \\\r\n  -d '{\r\n    \"model\": \"tts-1\",\r\n    \"input\": \"hello world\",\r\n    \"voice\": \"alloy\"\r\n  }' \\\r\n  --output example.mp3\r\n<\/pre>\n<p>Copy the entire code, paste it into your terminal (Windows users can use Command Prompt or PowerShell), and press <span class=\"key\">Enter<\/span>.<\/p>\n<p>That\u2019s it! This action will create an audio file called <code>example.mp3<\/code> that says \u201chello world\u201d.<\/p>\n<hr>\n<h2>Other Changes You Can Make<\/h2>\n<p>Now that you\u2019re familiar with converting text into lifelike spoken audio using the OpenAI Audio API, let\u2019s delve into additional adjustments you can make that will influence the quality and style of your TTS output.<\/p>\n<p>Essentially, you can modify the following:<\/p>\n<ul>\n<li><a href=\"#model\">The model used, <\/a><\/li>\n<li><a href=\"#input\">the input text, <\/a><\/li>\n<li><a href=\"#voice\">the voice selected, <\/a><\/li>\n<li><a href=\"#output\">and the output file<\/a>, including its format.<\/li>\n<\/ul>\n<h3 id=\"model\">1. Model<\/h3>\n<p>The default model is <code>tts-1<\/code>, which provides quick response times but at a slightly lower quality. You can switch to the <code>tts-1-hd<\/code> model for higher definition audio output.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre>\"model\": \"<strong>tts-1-hd<\/strong>\"<\/pre>\n<h3 id=\"input\">2. Input<\/h3>\n<p>Any text enclosed within double quotes will be converted into spoken audio.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre>\"input\": \"<strong>hello there, how are you doing today?<\/strong>\"<\/pre>\n<h3 id=\"voice\">3. Voice<\/h3>\n<p>Currently, there are six different voices available: <code>alloy<\/code>, <code>echo<\/code>, <code>fable<\/code>, <code>onyx<\/code>, <code>nova<\/code>, and <code>shimmer<\/code>.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre>\"voice\": \"<strong>nova<\/strong>\"<\/pre>\n<h3 id=\"output\">4. Output<\/h3>\n<p>By default, the output will be in <span class=\"format\">.mp3<\/span> format. However, you can change the filename or choose from other supported audio formats. The currently supported formats include:<\/p>\n<ul>\n<li><strong>Opus <span class=\"format\">.opus<\/span><\/strong>: Ideal for internet streaming and communications with low latency.<\/li>\n<li><strong>AAC <span class=\"format\">.aac<\/span><\/strong>: Used for digital audio compression, preferred by platforms like YouTube and devices like Android and iOS.<\/li>\n<li><strong>FLAC <span class=\"format\">.flac<\/span><\/strong>: Provides lossless audio compression, favored by audiophiles for archiving purposes.<\/li>\n<\/ul>\n<p><strong>Example:<\/strong><\/p>\n<pre>--output <strong>myspeech<\/strong>.<strong>aac<\/strong><\/pre>\n<hr>\n<h2>FAQ<\/h2>\n<p><strong>Where do I find the created audio file?<\/strong><\/p>\n<p>The output file is located in the same folder or path where you executed the cURL script. To find out the current directory of your terminal (Windows users: PowerShell or Command Prompt), use the following command:<\/p>\n<ul>\n<li>macOS Terminal \u2013 <code>pwd<\/code><\/li>\n<li>Windows PowerShell \u2013 <code>pwd<\/code><\/li>\n<li>Windows Command Prompt \u2013 <code>cd<\/code><\/li>\n<\/ul>\n<p><strong>Can I create and use a custom copy of my voice?<\/strong><\/p>\n<p>This feature is not currently supported by OpenAI.<\/p>\n<p><strong>How do other voice options sound like?<\/strong><\/p>\n<p>You can generate audio using different voice parameters to hear how other voices sound, or you can visit <a rel=\"noopener nofollow\" target=\"_blank\" href=\"https:\/\/platform.openai.com\/docs\/guides\/text-to-speech\/voice-options\">this page<\/a> to listen to samples.<\/p>\n<p><strong>Does it support other languages?<\/strong><\/p>\n<p>Yes, it does support multiple languages. I\u2019ve tested it with Japanese, Chinese (Mandarin), Vietnamese, and Spanish, and they seem to sound quite reasonable.<\/p>","protected":false},"excerpt":{"rendered":"<p>OpenAI has recently launched the Audio API that includes a text to speech feature called speech, based on their TTS (text-to-speech) technology. This feature offers six built-in voices named Alloy, Echo, Fable, Onyx, Nova, and Shimmer. These voices can be incredibly useful for tasks such as narrating blog posts, creating spoken audio in various languages,&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3398],"tags":[3545],"topic":[],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Turn Text to Speech with OpenAI - Hongkiat<\/title>\n<meta name=\"description\" content=\"OpenAI has recently launched the Audio API that includes a text to speech feature called speech, based on their TTS (text-to-speech) technology. This\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/openai-text-to-speech\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Turn Text to Speech with OpenAI\" \/>\n<meta property=\"og:description\" content=\"OpenAI has recently launched the Audio API that includes a text to speech feature called speech, based on their TTS (text-to-speech) technology. This\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/openai-text-to-speech\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-09T15:01:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/openai-text-to-speech\/hero.jpg\" \/>\n<meta name=\"author\" content=\"Hongkiat Lim\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Hongkiat Lim\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/openai-text-to-speech\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/openai-text-to-speech\\\/\"},\"author\":{\"name\":\"Hongkiat Lim\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e3613a3bf757e4f67770f0b7a339edd0\"},\"headline\":\"How to Turn Text to Speech with OpenAI\",\"datePublished\":\"2023-11-09T15:01:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/openai-text-to-speech\\\/\"},\"wordCount\":826,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/openai-text-to-speech\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/openai-text-to-speech\\\/hero.jpg\",\"keywords\":[\"Artificial Intelligence\"],\"articleSection\":[\"Internet\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/openai-text-to-speech\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/openai-text-to-speech\\\/\",\"name\":\"How to Turn Text to Speech with OpenAI - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/openai-text-to-speech\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/openai-text-to-speech\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/openai-text-to-speech\\\/hero.jpg\",\"datePublished\":\"2023-11-09T15:01:15+00:00\",\"description\":\"OpenAI has recently launched the Audio API that includes a text to speech feature called speech, based on their TTS (text-to-speech) technology. This\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/openai-text-to-speech\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/openai-text-to-speech\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/openai-text-to-speech\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/openai-text-to-speech\\\/hero.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/openai-text-to-speech\\\/hero.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/openai-text-to-speech\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Turn Text to Speech with OpenAI\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e3613a3bf757e4f67770f0b7a339edd0\",\"name\":\"Hongkiat Lim\",\"description\":\"Founder and Editor in Chief of Hongkiat.com. Hongkiat is also a designer, developer, entrepreneur, and an active investor in the US stock market.\",\"sameAs\":[\"http:\\\/\\\/www.hongkiat.com\\\/blog\"],\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/hongkiat\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Turn Text to Speech with OpenAI - Hongkiat","description":"OpenAI has recently launched the Audio API that includes a text to speech feature called speech, based on their TTS (text-to-speech) technology. This","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hongkiat.com\/blog\/openai-text-to-speech\/","og_locale":"en_US","og_type":"article","og_title":"How to Turn Text to Speech with OpenAI","og_description":"OpenAI has recently launched the Audio API that includes a text to speech feature called speech, based on their TTS (text-to-speech) technology. This","og_url":"https:\/\/www.hongkiat.com\/blog\/openai-text-to-speech\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2023-11-09T15:01:15+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/openai-text-to-speech\/hero.jpg","type":"","width":"","height":""}],"author":"Hongkiat Lim","twitter_card":"summary_large_image","twitter_creator":"@hongkiat","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Hongkiat Lim","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/openai-text-to-speech\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/openai-text-to-speech\/"},"author":{"name":"Hongkiat Lim","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e3613a3bf757e4f67770f0b7a339edd0"},"headline":"How to Turn Text to Speech with OpenAI","datePublished":"2023-11-09T15:01:15+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/openai-text-to-speech\/"},"wordCount":826,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/openai-text-to-speech\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/openai-text-to-speech\/hero.jpg","keywords":["Artificial Intelligence"],"articleSection":["Internet"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/openai-text-to-speech\/","url":"https:\/\/www.hongkiat.com\/blog\/openai-text-to-speech\/","name":"How to Turn Text to Speech with OpenAI - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/openai-text-to-speech\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/openai-text-to-speech\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/openai-text-to-speech\/hero.jpg","datePublished":"2023-11-09T15:01:15+00:00","description":"OpenAI has recently launched the Audio API that includes a text to speech feature called speech, based on their TTS (text-to-speech) technology. This","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/openai-text-to-speech\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/openai-text-to-speech\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/openai-text-to-speech\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/openai-text-to-speech\/hero.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/openai-text-to-speech\/hero.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/openai-text-to-speech\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Turn Text to Speech with OpenAI"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e3613a3bf757e4f67770f0b7a339edd0","name":"Hongkiat Lim","description":"Founder and Editor in Chief of Hongkiat.com. Hongkiat is also a designer, developer, entrepreneur, and an active investor in the US stock market.","sameAs":["http:\/\/www.hongkiat.com\/blog"],"url":"https:\/\/www.hongkiat.com\/blog\/author\/hongkiat\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-igx","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/70217","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=70217"}],"version-history":[{"count":3,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/70217\/revisions"}],"predecessor-version":[{"id":70222,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/70217\/revisions\/70222"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=70217"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=70217"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=70217"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=70217"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}