{"id":1418,"date":"2022-07-03T16:53:19","date_gmt":"2022-07-03T23:53:19","guid":{"rendered":"https:\/\/josh-mckenzie.com\/?p=1418"},"modified":"2022-07-17T15:41:57","modified_gmt":"2022-07-17T22:41:57","slug":"converting-audio-to-text-using-assemblyais-rest-api","status":"publish","type":"post","link":"https:\/\/josh-mckenzie.com\/index.php\/2022\/07\/03\/converting-audio-to-text-using-assemblyais-rest-api\/","title":{"rendered":"Converting Audio to Text Using AssemblyAI&#8217;s REST API"},"content":{"rendered":"\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<p>This application converts an audio clip to text using AssemblyAI&#8217;s REST API. I followed the tutorial from Coding With John on YouTube and learned a lot about calling an API. You can check out the tutorial video\u00a0<a href=\"https:\/\/www.youtube.com\/watch?v=9oq7Y8n1t00\">How To Call a REST API In Java &#8211; Converting Speech to Text with AssemblyAI<\/a>. This application utilizes AssemblyAI, and they are credited in the code comments. You can sign up and get your own API key by going to their website\u00a0<a href=\"https:\/\/assemblyai.com\/\">https:\/\/AssemblyAI.com\/<\/a><\/p>\n\n\n\n<p>Below is a sample of audio that I made to test the application. Under that is a video of the application in action.<\/p>\n\n\n\n<figure class=\"wp-block-audio\"><audio controls src=\"https:\/\/josh-mckenzie.com\/wp-content\/uploads\/2022\/07\/REST-API-Test-Audio-Recording-1.mp3\"><\/audio><figcaption>The audio I used to transcribe is me saying how I learned how to use a REST API<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-video\"><video height=\"1080\" style=\"aspect-ratio: 1920 \/ 1080;\" width=\"1920\" autoplay controls loop muted preload=\"auto\" src=\"https:\/\/josh-mckenzie.com\/wp-content\/uploads\/2022\/07\/2022-07-03-REST-API-in-action.mp4\"><\/video><figcaption>Here is the console window of the application being executed<\/figcaption><\/figure>\n\n\n\n<p class=\"has-text-align-center\"><em>If you would like to test the code yourself, you\u00a0must\u00a0have an API key.<\/em><\/p>\n\n\n\n<p>This project only scratches the surface of what you could do with calling a REST API. I plan on browsing some more interesting APIs out there to code up some cool stuff. Making this project into a GUI would be the next step, where you can record and upload an audio byte. After that, it would take a few seconds to transcribe the audio on that sound clip. Finally, it would give you the transcribed text and display it back as well as give you a text file.<\/p>\n\n\n\n<p>There are many applications to this such as subtitles on videos, and the API lets you get access to exactly when the words are mentioned with a timestamp. Doing this project was fun, and I hope to tweak it more in the future.<\/p>\n\n\n\n<p>You can find the code posted on my <a href=\"https:\/\/github.com\/thecoffeeroaster?tab=repositories\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub page<\/a><sup>\u21d7<\/sup>, go check it out!<\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n<ol class=\"has-avatars has-dates has-excerpts wp-block-latest-comments\"><li class=\"wp-block-latest-comments__comment\"><img alt='' src='https:\/\/secure.gravatar.com\/avatar\/3e37295ed6925054a5c2529ec997796aeeb8690e302a71c56eb0c832010c213d?s=48&#038;d=retro&#038;r=g' srcset='https:\/\/secure.gravatar.com\/avatar\/3e37295ed6925054a5c2529ec997796aeeb8690e302a71c56eb0c832010c213d?s=96&#038;d=retro&#038;r=g 2x' class='avatar avatar-48 photo wp-block-latest-comments__comment-avatar' height='48' width='48' \/><article><footer class=\"wp-block-latest-comments__comment-meta\"><span class=\"wp-block-latest-comments__comment-author\">Nerissa G.<\/span> on <a class=\"wp-block-latest-comments__comment-link\" href=\"https:\/\/josh-mckenzie.com\/index.php\/2025\/06\/24\/blip-blop-game\/#comment-1900\">Pong-like Game<\/a><time datetime=\"2025-07-01T10:53:26-07:00\" class=\"wp-block-latest-comments__comment-date\">July 1, 2025<\/time><\/footer><div class=\"wp-block-latest-comments__comment-excerpt\"><p>Nice! Maybe you could add a computer to play against next time?<\/p>\n<\/div><\/article><\/li><\/ol>\n\n\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>This application converts an audio clip to text using AssemblyAI&#8217;s REST API. I followed the tutorial from Coding With John on YouTube [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1419,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24,16],"tags":[39,42,41,15,44,40,43],"class_list":["post-1418","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-code","category-projects","tag-assemblyai","tag-audio-to-text","tag-console-application","tag-java","tag-problem-solving","tag-rest-api","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/josh-mckenzie.com\/index.php\/wp-json\/wp\/v2\/posts\/1418","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/josh-mckenzie.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/josh-mckenzie.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/josh-mckenzie.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/josh-mckenzie.com\/index.php\/wp-json\/wp\/v2\/comments?post=1418"}],"version-history":[{"count":24,"href":"https:\/\/josh-mckenzie.com\/index.php\/wp-json\/wp\/v2\/posts\/1418\/revisions"}],"predecessor-version":[{"id":1500,"href":"https:\/\/josh-mckenzie.com\/index.php\/wp-json\/wp\/v2\/posts\/1418\/revisions\/1500"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/josh-mckenzie.com\/index.php\/wp-json\/wp\/v2\/media\/1419"}],"wp:attachment":[{"href":"https:\/\/josh-mckenzie.com\/index.php\/wp-json\/wp\/v2\/media?parent=1418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/josh-mckenzie.com\/index.php\/wp-json\/wp\/v2\/categories?post=1418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/josh-mckenzie.com\/index.php\/wp-json\/wp\/v2\/tags?post=1418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}