{"id":49565,"date":"2020-07-05T03:01:19","date_gmt":"2020-07-04T17:01:19","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=49565"},"modified":"2020-07-04T15:27:38","modified_gmt":"2020-07-04T05:27:38","slug":"macos-text-to-audio-share-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/macos-text-to-audio-share-tutorial\/","title":{"rendered":"MacOS Text to Audio Share Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/haiku_animated_gif.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"MacOS Text to Audio Share Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/share_say.jpg\" title=\"MacOS Text to Audio Share Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">MacOS Text to Audio Share Tutorial<\/p><\/div>\n<p>In order to share the audio file of yesterday&#8217;s <a title='MacOS Text to Audio Internationalization Tutorial' href='#mostait'>MacOS Text to Audio Internationalization Tutorial<\/a> we cannot use &#8230;<\/p>\n<ul>\n<li>client based &#8220;a&#8221; &#8220;mailto:&#8221; link approaches because &#8230;\n<ol>\n<li>the size of data is too large<\/li>\n<li>we need to be able to use HTML within Inline HTML Email if we are not happy leaving around RJM Programming web server audio files (which we are not)<\/li>\n<\/ol>\n<p> &#8230; and so we need to call on &#8230;<\/li>\n<li>server (public, not local) based code (ie. PHP, for us) that can email Inline HTML Email<\/li>\n<\/ul>\n<p> &#8230; and calling on that server (public, not local) based code you can choose to &#8230;<\/p>\n<ul>\n<li>involve <a target=_blank title='Another useful link' href='http:\/\/www.html5rocks.com\/en\/tutorials\/cors\/'>CORS<\/a> in an Ajax FormData call or an HTML Form method=POST &#8230; or &#8230;<\/li>\n<li>involve window.<a target=_blank title='PostMessage' href='https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Window\/postMessage'>PostMessage<\/a> approach (perhaps involving web server audio files that are temporary) &#8230; or, as we decided upon &#8230;<\/li>\n<li>involve popup web server &#8220;inhouse&#8221; PHP Inline HTML Email creator helper &#8230; that &#8230;\n<ul>\n<li>codes allowances for the caller situation (that situation having ensured a data-URI &#8220;copy&#8221; of the audio content in in the web browser buffer ahead of the popup window appearing, all instigated via a new &#128231; email emoji button (&amp;#128231;)) &#8230;<\/li>\n<li>sets up the PHP code &#8230;<br \/>\n&lt;?php<br \/>\n <code><br \/>\n  echo \"&lt;html&gt;&lt;head&gt;&lt;script type='text\/javascript'&gt;  function fixta() { if (document.getElementById('taready').value.indexOf('data:') == 0) { var midbit=document.getElementById('taready').value.split('data:')[1].split(';')[0] + ' src=' + \\\"'\\\"; document.getElementById('taready').value='&lt;body&gt;&lt;audio id=thisaudio controls loop&gt;&lt;source type=' + midbit + document.getElementById('taready').value.replace(\/\\ \/g,'+') + \\\"'\\\" + '&gt;&lt;\/source&gt;&lt;\/audio&gt;&lt;\/body&gt;'; }  } &lt;\/script&gt;&lt;\/head&gt;&lt;body onload=\\\"document.getElementById('taready').focus();\\\"&gt;&lt;h1 id=status&gt;Paste to lightgreen here (already copied from lightgreen there) and click yellow button to Email off ...&lt;\/h1&gt;<br \/>\n  &lt;form onsubmit='fixta(); return true;' action=.\/emailhtml.php method=POST&gt;<br \/>\n  &lt;input type=hidden name=inline value=''&gt;&lt;\/input&gt;<br \/>\n  &lt;input type=hidden name=to value='\" . str_replace(\"+\",\" \",urldecode($_GET['to'])) . \"'&gt;&lt;\/input&gt;<br \/>\n  &lt;input type=hidden name=subj value='\" . str_replace(\"+\",\" \",urldecode($_GET['subj'])) . \"'&gt;&lt;\/input&gt;<br \/>\n  &lt;textarea style=width:100%;background-color:lightgreen; cols=80 rows=10 name=tdhuhta id=taready&gt;&lt;\/textarea&gt;&lt;br&gt;<br \/>\n  &lt;input id=sub type=submit style=background-color:yellow; value='Email to \" . str_replace(\"+\",\" \",urldecode($_GET['to'])) . \" ... \" . str_replace(\"+\",\" \",urldecode($_GET['subj'])) . \"'&gt;&lt;\/input&gt;&lt;\/form&gt;<br \/>\n  &lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n  exit;<br \/>\n <\/code><br \/>\n?&gt;\n <\/li>\n<li>awaits the user clicking an interim HTML form submit button &#8230; that &#8230;<\/li>\n<li>recalls itself and really sends the Inline HTML Email containing HTML that includes an audio tag with data-URI content<\/li>\n<\/ul>\n<p> &#8230; this whole scenario only acceptable in its entirety by iOS Mail apps (but not Gmail Webmail nor macOS Mail (at least with our testing)).<\/p>\n<p>Again, given the same local web server provisions as outlined on the day before yesterday, feel free to try out <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/macos_say_record.php--GETME\" title=\"macos_say_record.php\">a changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/macos_say_record.php--GETME\" title=\"macos_say_record.php\">macos_say_record.php<\/a> macOS &#8220;say&#8221; PHP helper with better email sharing functionality.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/new-macos-text-to-audio-share-tutorial\/'>MacOS Text to Audio Share Tutorial<\/a>.<\/p-->\n<hr>\n<p id='mostait'>Previous relevant <a target=_blank title='MacOS Text to Audio Internationalization Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/macos-text-to-audio-internationalization-tutorial\/'>MacOS Text to Audio Internationalization Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/haiku_animated_gif.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"MacOS Text to Audio Internationalization Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/haiku__say_i.jpg\" title=\"MacOS Text to Audio Internationalization Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">MacOS Text to Audio Internationalization Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='MacOS Text to Audio Primer Tutorial' href='#mostapt'>MacOS Text to Audio Primer Tutorial<\/a> was very &#8220;English&#8221;, at least hereabouts.  We think it would be good to Internationalize the &#8220;say&#8221; integration with &#8220;-v&#8221; voices in other languages to choose from.<\/p>\n<p>That &#8220;Internationalization&#8221; we have <a target=_blank title='Apple' href='https:\/\/apple.com'>Apple<\/a> to thank for, because &#8220;say&#8221; documents &#8230;<\/p>\n<blockquote><p>\n$ say -v &#8216;?&#8217;<br \/>\nAlex                en_US    # Most people recognize me by my voice.<br \/>\nAlice               it_IT    # Salve, mi chiamo Alice e sono una voce italiana.<br \/>\nAlva                sv_SE    # Hej, jag heter Alva. Jag \u00e4r en svensk r\u00f6st.<br \/>\nAmelie              fr_CA    # Bonjour, je m\u2019appelle Amelie. Je suis une voix canadienne.<br \/>\nAnna                de_DE    # Hallo, ich hei\u00dfe Anna und ich bin eine deutsche Stimme.<br \/>\nCarmit              he_IL    # \u05e9\u05dc\u05d5\u05dd. \u05e7\u05d5\u05e8\u05d0\u05d9\u05dd \u05dc\u05d9 \u05db\u05e8\u05de\u05d9\u05ea, \u05d5\u05d0\u05e0\u05d9 \u05e7\u05d5\u05dc \u05d1\u05e9\u05e4\u05d4 \u05d4\u05e2\u05d1\u05e8\u05d9\u05ea.<br \/>\nClaire              nl_NL    # Hallo, mijn naam is Claire. Ik ben een Nederlandse stem.<br \/>\nDamayanti           id_ID    # Halo, nama saya Damayanti. Saya berbahasa Indonesia.<br \/>\nDaniel              en_GB    # Hello, my name is Daniel. I am a British-English voice.<br \/>\nDiego               es_AR    # Hola, me llamo Diego y soy una voz espa\u00f1ola.<br \/>\nEllen               nl_BE    # Hallo, mijn naam is Ellen. Ik ben een Belgische stem.<br \/>\nFiona               en-scotland # Hello, my name is Fiona. I am a Scottish-English voice.<br \/>\nFred                en_US    # I sure like being inside this fancy computer<br \/>\nIoana               ro_RO    # Bun\u0103, m\u0103 cheam\u0103 Ioana . Sunt o voce rom\u00e2neasc\u0103.<br \/>\nJoana               pt_PT    # Ol\u00e1, chamo-me Joana e dou voz ao portugu\u00eas falado em Portugal.<br \/>\nJorge               es_ES    # Hola, me llamo Jorge y soy una voz espa\u00f1ola.<br \/>\nJuan                es_MX    # Hola, me llamo Juan y soy una voz mexicana.<br \/>\nKanya               th_TH    # \u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e35\u0e04\u0e48\u0e30 \u0e14\u0e34\u0e09\u0e31\u0e19\u0e0a\u0e37\u0e48\u0e2dKanya<br \/>\nKaren               en_AU    # Hello, my name is Karen. I am an Australian-English voice.<br \/>\nKate                en_GB    # Hello, my name is Kate. I am a British-English voice.<br \/>\nKyoko               ja_JP    # \u3053\u3093\u306b\u3061\u306f\u3001\u79c1\u306e\u540d\u524d\u306fKyoko\u3067\u3059\u3002\u65e5\u672c\u8a9e\u306e\u97f3\u58f0\u3092\u304a\u5c4a\u3051\u3057\u307e\u3059\u3002<br \/>\nLaura               sk_SK    # Ahoj. Vol\u00e1m sa Laura . Som hlas v slovenskom jazyku.<br \/>\nLekha               hi_IN    # \u0928\u092e\u0938\u094d\u0915\u093e\u0930, \u092e\u0947\u0930\u093e \u0928\u093e\u092e \u0932\u0947\u0916\u093e \u0939\u0948. \u092e\u0948\u0902 \u0939\u093f\u0928\u094d\u0926\u0940 \u092e\u0947\u0902 \u092c\u094b\u0932\u0928\u0947 \u0935\u093e\u0932\u0940 \u0906\u0935\u093e\u091c\u093c \u0939\u0942\u0901.<br \/>\nLuca                it_IT    # Salve, mi chiamo Luca e sono una voce italiana.<br \/>\nLuciana             pt_BR    # Ol\u00e1, o meu nome \u00e9 Luciana e a minha voz corresponde ao portugu\u00eas que \u00e9 falado no Brasil<br \/>\nMaged               ar_SA    # \u0645\u0631\u062d\u0628\u064b\u0627 \u0627\u0633\u0645\u064a Maged. \u0623\u0646\u0627 \u0639\u0631\u0628\u064a \u0645\u0646 \u0627\u0644\u0633\u0639\u0648\u062f\u064a\u0629.<br \/>\nMariska             hu_HU    # \u00dcdv\u00f6zl\u00f6m! Mariska vagyok. \u00c9n vagyok a magyar hang.<br \/>\nMei-Jia             zh_TW    # \u60a8\u597d\uff0c\u6211\u53eb\u7f8e\u4f73\u3002\u6211\u8aaa\u570b\u8a9e\u3002<br \/>\nMelina              el_GR    # \u0393\u03b5\u03b9\u03b1 \u03c3\u03b1\u03c2, \u03bf\u03bd\u03bf\u03bc\u03ac\u03b6\u03bf\u03bc\u03b1\u03b9 Melina. \u0395\u03af\u03bc\u03b1\u03b9 \u03bc\u03b9\u03b1 \u03b5\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ae \u03c6\u03c9\u03bd\u03ae.<br \/>\nMilena              ru_RU    # \u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u043c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 Milena. \u042f \u2013 \u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u0433\u043e\u043b\u043e\u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<br \/>\nMoira               en_IE    # Hello, my name is Moira. I am an Irish-English voice.<br \/>\nMonica              es_ES    # Hola, me llamo Monica y soy una voz espa\u00f1ola.<br \/>\nNora                nb_NO    # Hei, jeg heter Nora. Jeg er en norsk stemme.<br \/>\nOliver              en_GB    # Hello, my name is Oliver. I am a British-English voice.<br \/>\nPaulina             es_MX    # Hola, me llamo Paulina y soy una voz mexicana.<br \/>\nSamantha            en_US    # Hello, my name is Samantha. I am an American-English voice.<br \/>\nSara                da_DK    # Hej, jeg hedder Sara. Jeg er en dansk stemme.<br \/>\nSatu                fi_FI    # Hei, minun nimeni on Satu. Olen suomalainen \u00e4\u00e4ni.<br \/>\nSerena              en_GB    # Hello, my name is Serena. I am a British-English voice.<br \/>\nSin-ji              zh_HK    # \u60a8\u597d\uff0c\u6211\u53eb Sin-ji\u3002\u6211\u8b1b\u5ee3\u6771\u8a71\u3002<br \/>\nTessa               en_ZA    # Hello, my name is Tessa. I am a South African-English voice.<br \/>\nThomas              fr_FR    # Bonjour, je m\u2019appelle Thomas. Je suis une voix fran\u00e7aise.<br \/>\nTing-Ting           zh_CN    # \u60a8\u597d\uff0c\u6211\u53ebTing-Ting\u3002\u6211\u8bb2\u4e2d\u6587\u666e\u901a\u8bdd\u3002<br \/>\nTom                 en_US    # Hello, my name is Tom. I am an American-English voice.<br \/>\nVeena               en_IN    # Hello, my name is Veena. I am an Indian-English voice.<br \/>\nVictoria            en_US    # Isn&#8217;t it nice to have a computer that will talk to you?<br \/>\nXander              nl_NL    # Hallo, mijn naam is Xander. Ik ben een Nederlandse stem.<br \/>\nYelda               tr_TR    # Merhaba, benim ad\u0131m Yelda. Ben T\u00fcrk\u00e7e bir sesim.<br \/>\nYuna                ko_KR    # \uc548\ub155\ud558\uc138\uc694. \uc81c \uc774\ub984\uc740 Yuna\uc785\ub2c8\ub2e4. \uc800\ub294 \ud55c\uad6d\uc5b4 \uc74c\uc131\uc785\ub2c8\ub2e4.<br \/>\nYuri                ru_RU    # \u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u043c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 Yuri. \u042f \u2013 \u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u0433\u043e\u043b\u043e\u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<br \/>\nZosia               pl_PL    # Witaj. Mam na imi\u0119 Zosia, jestem g\u0142osem kobiecym dla j\u0119zyka polskiego.<br \/>\nZuzana              cs_CZ    # Dobr\u00fd den, jmenuji se Zuzana. Jsem \u010desk\u00fd hlas.\n<\/p><\/blockquote>\n<p> &#8230; to go on here, as a help for this <i>level<\/i> of &#8220;Internationalization&#8221;.   Another &#8220;level&#8221; again would be to translate the webpage and menu wording, but we&#8217;ve decided against that here today.<\/p>\n<p>So we add a language dropdown and a voice dropdown to help the user explore this Text to Audio functionality accessing a macOS or Mac OS X operating system.<\/p>\n<p>Also, today, we&#8217;ve introduced &#8220;.m4a&#8221; (audio\/mp4) as the default audio file extension to use with the file created via &#8220;say&#8221; &#8220;-o&#8221; switch for all but Safari, as this works better for &#8220;all but Safari&#8221; (abs<font size=1>olutely<\/font>).<\/p>\n<p>Given the same local web server provisions as outlined yesterday feel free to try out <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/macos_say_record.php-GETME\" title=\"macos_say_record.php\">a changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/macos_say_record.php-GETME\" title=\"macos_say_record.php\">macos_say_record.php<\/a> macOS &#8220;say&#8221; PHP helper with better Internationalization functionality, thanks in large part to the great ideas from <a target=_blank title='Useful link' href='https:\/\/stackoverflow.com\/questions\/3770513\/detect-browser-language-in-php'>this useful link<\/a>.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank href='\/\/www.rjmprogramming.com.au\/ITblog\/macos-text-to-audio-internationalization-tutorial\/'>MacOS Text to Audio Internationalization Tutorial<\/a>.<\/p-->\n<hr>\n<p id='mostapt'>Previous relevant <a target=_blank title='MacOS Text to Audio Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/macos-text-to-audio-primer-tutorial\/'>MacOS Text to Audio Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/haiku_animated_gif.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"MacOS Text to Audio Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/haiku__say.jpg\" title=\"MacOS Text to Audio Primer Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">MacOS Text to Audio Primer Tutorial<\/p><\/div>\n<p>The previous <a title='Mac OS X Text to English Speech Primer Tutorial' href='#mosxtespt'>Mac OS X Text to English Speech Primer Tutorial<\/a> &#8230;<\/p>\n<ul>\n<li>lauded the &#8230;<br \/>\n<blockquote cite='\/\/www.rjmprogramming.com.au\/ITblog\/mac-os-x-text-to-english-speech-primer-tutorial\/'><p>\nText to English Speech via Mac OS X&#8217;s command line <a target=_blank title='say command information from Apple' href='https:\/\/ss64.com\/osx\/say.html'><i>say<\/i><\/a> command\n<\/p><\/blockquote>\n<\/li>\n<li>and today we write some PHP (with its very useful <a target=_blank title='PHP exec() method information' href='http:\/\/php.net\/manual\/en\/function.exec.php'><i>exec<\/i><\/a> conduit to &#8220;say&#8221;) to make use of the same (macOS) &#8220;say&#8221; and its Text to Audio talents (via its &#8220;-o&#8221; switch usage)<\/li>\n<\/ul>\n<p> &#8230; and it&#8217;s at times like this we wish that the RJM Programming domain&#8217;s web server had a macOS operating system.  Alas, &#8220;say&#8221; is a macOS and Mac OS X application, but not a Linux one.<\/p>\n<p>None the less, we integrated &#8230;<\/p>\n<ul>\n<li><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/haiku_animated_gif.html--GETME\" title=\"haiku_animated_gif.html\">today&#8217;s changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/haiku_animated_gif.html--GETME\">haiku_animated_gif.html<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/haiku_animated_gif.html\">Haiku creation and sharing web application live run<\/a> link&#8217;s workings (last talked about at <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/haiku-animated-gif-creator-tutorial\/' title='Haiku Animated Gif Creator Tutorial'>Haiku Animated Gif Creator Tutorial<\/a>) with &#8230;<\/li>\n<li><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/macos_say_record.php_GETME\" title=\"macos_say_record.php\">macos_say_record.php<\/a> macOS &#8220;say&#8221; PHP helper<\/li>\n<\/ul>\n<p> &#8230; so that if you had a <a target=_blank title='MAMP for Apache\/PHP\/MySql on Mac OS X local web server' href='http:\/\/www.mamp.info'><i>MAMP<\/i><\/a> local Apache\/PHP\/MySql web server going, and you &#8230;<\/p>\n<ul>\n<li>downloaded <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/tutorial_to_animated_gif.php---------------GETME\" title=\"tutorial_to_animated_gif.php\">tutorial_to_animated_gif.php<\/a> to same MAMP subdirectory as &#8230;<\/li>\n<li>downloaded <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/haiku_animated_gif.html--GETME\">haiku_animated_gif.html<\/a> to same MAMP place (which can be the same MAMP document root place as talked about below, in which case <i>HTTP:\/\/localhost:8888\/haiku_animated_gif.html<\/i> is what you&#8217;d type into the web browser address bar to try this for yourself on a macOS or Mac OS X system) &#8230; and &#8230;<\/li>\n<li>downloaded <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/macos_say_record.php_GETME\" title=\"macos_say_record.php\">macos_say_record.php<\/a> to MAMP document root (for us, equating to URL <i>HTTP:\/\/localhost:8888\/macos_say_record.php<\/i>)<\/li>\n<\/ul>\n<p> &#8230; then you would be in the position to see a Haiku creation scenario (where we used the Safari web browser) like with today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/haiku__say.jpg\" title=\"tutorial picture\">tutorial picture<\/a>, interesting, in our view, regarding the integration &#8220;tactics&#8221; &#8230;<\/p>\n<ul>\n<li>parent Haiku window opens &#8230;<\/li>\n<li>child (popup) PHP &#8220;say&#8221; helper web application &#8230; which &#8230;<\/li>\n<li>passes back to parent &#8230;<br \/>\n<code><br \/>\n    <a target=_blank title='window.opener information from W3Schools' href='https:\/\/www.w3schools.com\/jsref\/prop_win_opener.asp'>window.opener<\/a>.document.getElementById('aurl').value=document.getElementById('result').value;<br \/>\n    window.opener.atab(window.opener.document.getElementById('aurl'));<br \/>\n<\/code>\n<\/li>\n<\/ul>\n<p> &#8230; achieving functionality we often ask HTML <a target=_blank title='HTML iframe information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_iframe.asp'>iframe<\/a> elements achieve for our code.  HTML iframe does have a role today, though.  It uses a favoured &#8220;client pre-emptive iframe&#8221; approach to determine whether we even try to open that popup window above via &#8230;<\/p>\n<ul>\n<li>HTML &#8230;<br \/>\n<code><br \/>\n&lt;div id=dif&gt;&lt;\/div&gt;<br \/>\n<\/code>\n<\/li>\n<li>Javascript &#8230;<br \/>\n<code><br \/>\n     var mampok=false, mampprefix='';<br \/>\n<br \/>\n     if (document.URL.indexOf('\/localhost') != -1) {<br \/>\n       mampprefix=\"http:\/\/localhost\" + document.URL.split('\/localhost')[1].split('\/')[0] + \"\/\";<br \/>\n       document.getElementById('dif').innerHTML=\"&lt;iframe onload='oicheck(this);' style='display:none;' src='http:\/\/localhost\" + document.URL.split('\/localhost')[1].split('\/')[0] + \"\/'&gt;&lt;\/iframe&gt;\";<br \/>\n     }<br \/>\n<br \/>\n function oicheck(iois) {<br \/>\n  mampok=false;<br \/>\n  if (iois != null) {<br \/>\n    var aconto = (iois.contentWindow || iois.contentDocument);<br \/>\n    if (aconto != null) {<br \/>\n     if (aconto.document) { aconto = aconto.document; }<br \/>\n     if (aconto.body != null) {<br \/>\n      if (aconto.body.innerHTML.toLowerCase().indexOf('&gt;not found&lt;') == -1 && aconto.body.innerHTML.toLowerCase().indexOf(\"our home page for your perusal\") == -1) { mampok=true; }<br \/>\n     }<br \/>\n    }<br \/>\n  }<br \/>\n }<br \/>\n<br \/>\n\/\/ and then later when the textarea has text and its onblur event is triggered ...<br \/>\n if (mampok) {<br \/>\n if (wois) { wois.close(); wois=null; }<br \/>\n wois=window.open(mampprefix + \"macos_say_record.php?saythis=\" + encodeURIComponent(document.getElementById('myta').value),\"_blank\",\"top=460,left=400,width=700,height=400\");<br \/>\n }<br \/>\n<\/code>\n<\/li>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/macos-text-to-audio-primer-tutorial\/'>MacOS Text to Audio Primer Tutorial<\/a>.<\/p-->\n<hr>\n<p id='mosxtespt'>Previous relevant <a target=_blank title='Mac OS X Text to English Speech Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/mac-os-x-text-to-english-speech-primer-tutorial\/'>Mac OS X Text to English Speech Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/audio_video.html?clickit=submitmb\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Mac OS X Text to English Speech Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/say.jpg\" title=\"Mac OS X Text to English Speech Primer Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Mac OS X Text to English Speech Primer Tutorial<\/p><\/div>\n<p>We&#8217;ve got a few new ideas today &#8230;<\/p>\n<ol>\n<li>Text to English Speech via Mac OS X&#8217;s command line <a target=_blank title='say command information from Apple' href='https:\/\/ss64.com\/osx\/say.html'><i>say<\/i><\/a> command used by PHP via <a target=_blank title='PHP exec() method information' href='http:\/\/php.net\/manual\/en\/function.exec.php'><i>exec<\/i><\/a> to make <a target=_blank title='say.php' href='http:\/\/www.rjmprogramming.com.au\/PHP\/say.php_GETME'>say.php<\/a> (which is useful as a download to a Mac OS X laptop using <a target=_blank title='MAMP for Apache\/PHP\/MySql on Mac OS X local web server' href='http:\/\/www.mamp.info'>MAMP<\/a>) which, today, does not have a live run because the web server of domain <i>rjmprogramming.com.au<\/i> is a CentOS Linux server &#8230; Linux equivalent of Mac OS X&#8217;s <i>say<\/i>? &#8230; read <a target=_blank title='Useful link' href='https:\/\/github.com\/usc-isi-i2\/festival-text-to-speech-service\/blob\/master\/README.md'>here<\/a><\/li>\n<li>Trying to present this brought up the usual movie production problem with <a target=_blank title='iMovie for Mac information from Apple' href='http:\/\/www.apple.com\/au\/mac\/imovie\/'>iMovie<\/a> overlaying the audio on top of the video (though you may want to try, and you could start reading with <a target=_blank title='Semi useful link' href='http:\/\/video.stackexchange.com\/questions\/2579\/can-you-link-an-audio-track-to-a-video-track-in-imovie'>this link<\/a>) versus <a target=_blank title='QuickTime information from Apple' href='https:\/\/support.apple.com\/downloads\/quicktime'>QuickTime Player<\/a> talent to catch both audio and video tracks (and that we ended up using), but not of the &#8220;screen goings on&#8221;, alas versus <a target=_blank title='MPlayer OSX Extended information' href='http:\/\/mplayerosx.ch\/'>MPlayer OSX Extended<\/a> which can play separately but not two tracks on top and doesn&#8217;t do any reconstituting &#8230; so &#8230;<\/li>\n<li>Improved on our inhouse Video\/Audio synchronizing efforts by allowing <a target=_blank title='audio_video.html' href='http:\/\/www.rjmprogramming.com.au\/PHP\/audio_video.html---GETME'>audio_video.html<\/a> supervisor (changed in <a target=_blank title='audio_video.html' href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/audio_video.html---GETME'>this way<\/a>) be able to be called to press one of its preconceived synchronization buttons <i>onload<\/i> which we do with (the newly added) <a target=_blank title='Macbeth Act 1 Scene 1' href='http:\/\/www.rjmprogramming.com.au\/PHP\/audio_video.html?clickit=submitmb'>Macbeth Act 1 Scene 1<\/a> &#8230; in a small <a target=_blank title='Birthday of Shakespeare' href='http:\/\/www.shakespeare.org.uk\/visit-the-houses\/whats-on.html\/birthday-celebrations.html'>celebration<\/a> of the Bard &#8230; who, am thinking (in that Falstaff way), would have got a huge chuckle out of &#8220;anonymous&#8221; instead of &#8220;anon&#8221; during the Three Witches scene &#8230; we <i>had<\/i> to do something to say Happy Birthday<\/li>\n<\/ol>\n<p>Along the way we tried filming the MacBook Pro with the iPad to a <a target=_blank title='YouTube' href='http:\/\/youtube.com'>YouTube<\/a> &#8230;<\/p>\n<p><iframe loading=\"lazy\" width=\"420\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/9-Hvlz8g1Mg\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p> &#8230; but weren&#8217;t happy with the audio quality, alas (too\/two).<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d21904' onclick='var dv=document.getElementById(\"d21904\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/text-to-speech\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d21904' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d49544' onclick='var dv=document.getElementById(\"d49544\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/audio\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d49544' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d49558' onclick='var dv=document.getElementById(\"d49558\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/audio\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d49558' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d49565' onclick='var dv=document.getElementById(\"d49565\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/email\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d49565' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In order to share the audio file of yesterday&#8217;s MacOS Text to Audio Internationalization Tutorial we cannot use &#8230; client based &#8220;a&#8221; &#8220;mailto:&#8221; link approaches because &#8230; the size of data is too large we need to be able to &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/macos-text-to-audio-share-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,37],"tags":[91,113,3349,265,275,380,405,587,3351,620,1560,3173,714,725,2178,744,760,885,907,932,967,997,1083,2350,1133,1137,3350,1258,1262,1319,2648,1411,1583,1433,3010],"class_list":["post-49565","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-apple","tag-audio","tag-client-pre-emptive-iframe","tag-copy","tag-cross-browser","tag-email","tag-exec","tag-iframe","tag-inline-html-email","tag-internationalization","tag-language","tag-language-code","tag-local-web-server","tag-mac-os-x","tag-macos","tag-mamp","tag-media","tag-operating-system-2","tag-paste","tag-php","tag-popup","tag-programming","tag-safari","tag-say","tag-share","tag-sharing","tag-text-to-audio","tag-text-to-speech","tag-textarea","tag-tutorial","tag-voice","tag-web-server","tag-window","tag-window-open","tag-window-opener"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/49565"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=49565"}],"version-history":[{"count":6,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/49565\/revisions"}],"predecessor-version":[{"id":49571,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/49565\/revisions\/49571"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=49565"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=49565"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=49565"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}