Webpage macOS Say Audio Commentary Access Count Tutorial

Webpage macOS Say Audio Commentary Access Count Tutorial

Webpage macOS Say Audio Commentary Access Count Tutorial

We’ve got a new player in the Webpage Audio Commentary “Intranet feeling” solution, today, on top of the progress from yesterday’s Webpage macOS Say Audio Commentary Personalization Tutorial. This new PHP intranet_access_count.php player sits in the Document Root of your (or our RJM Programming) public domain, and its simple job is to return an …

  • access count …
  • of itself

Huh?! Yes, the macOS or Mac OS X MAMP (or other) local web server can access via tweaked inhouse macos_say_record.php supervisor of macOS say command, new command line as per

<?php

$icount="0";

if (isset($_GET['docronwork'])) {
exec(str_replace('+',' ',urldecode($_GET['docronwork'])));
if (isset($_GET['andclose'])) {
echo "<html><body onload=' try { if (window.opener) { if (window.opener.callbck) { window.opener.callbck(); } } } catch(exx) { } window.close(); '></body></html>";
} else if (isset($_GET['andsoonclose'])) {
$icount=shell_exec("curl HTTP://www.rjmprogramming.com.au/intranet_access_count.php");
echo "<html><head><script type=text/javascript> function onlwo() { window.close(); } </script></head><body onload=' try { if (window.opener) { if (window.opener.callbck) { window.opener.callbck(); } } } catch(exx) { } setTimeout(onlwo, 2000); '></body></html>";
}
exit;
}

?>

As you can see above, just “getting through” to this new “access counter” ahead of involving any “client facing HTML and Javascript callback” ideas is the second side to its “lynchpin” relationship between the the changed macos_say_record.js external Javascript changed arrangements


var icountmsr=0, jcountmsr=0;
var connectionmsr=true;

function checkjmsr(iois) {
var sfsg=false;
if (iois != null) {
var aconto = (iois.contentWindow || iois.contentDocument);
console.log(11);
if (aconto != null) {
console.log(navigator.platform);
try {
if (iois.src.indexOf('/intranet_access_count.php') != -1) { console.log('aconto=' + aconto); }
if (aconto.document) { aconto = aconto.document; }
if (iois.src.indexOf('/intranet_access_count.php') != -1) { icountmsr=(aconto.body.innerText || aconto.body.contentWindow || aconto.body.contentDocument); if (jcountmsr == 0) { jcountmsr=icountmsr; } else if (eval(icountmsr - jcountmsr) < 2) { connectionmsr=false; } console.log('icountmsr,jcountmsr=' + icountmsr + ',' + jcountmsr); } console.log(1111); if (aconto.body != null) { console.log(2); if (aconto.body.innerHTML.indexOf('>') != -1) {
console.log(3);
if (iois.src.indexOf(':8888/') != -1) {
console.log(4);
//if (document.URL.indexOf('via=parenthtml') != -1) {
console.log(5);
if (aconto.body.innerHTML.toLowerCase().indexOf('not found') == -1) {
wo_ismsr.close(); //document.getElementById('macos').style.display='inline-block';
wmsrcd=true;
}
}
//}
}
}
} catch(exxx) {
console.log(exxx.message);
//wo_ismsr.close(); //alert(exxx.message);
//wmsrcd=true;
}
}
}
}

function konlmsr() {
document.getElementById('jfh').src='//www.rjmprogramming.com.au/intranet_access_count.php?rand=' + Math.floor(Math.random() * 198767543);

setTimeout(locopencheck, 2500);
setTimeout(huhmsr, 29000);
}

function jonlmsr() {
wo_ismsr=window.open('HTTP://localhost:8888/macos_say_record.php?andsoonclose=y&docronwork=ls', 'ifh', 'top=50,left=50,width=500,height=500'); //'_blank', 'top=50,left=50,width=500,height=500');
setTimeout(konlmsr, 500);
}


function onlmsr() {
if (document.body) {
if (document.body.innerHTML) {

document.body.innerHTML+="<iframe id=ifh name=ifh onload=checkmsr(this); style=display:none; src='//www.rjmprogramming.com.au/About_Us.html'></iframe><iframe id=jfh name=jfh onload=checkjmsr(this); style=display:none; src='//www.rjmprogramming.com.au/intranet_access_count.php'></iframe><a title='Download macos_say_record.php to macOS or Mac OS X MAMP Document Root' onclick=dostuffmsr(); style='position:absolute;z-index:5643;opacity:0.5;top:0px;left:0px;background-color:yellow;' id=msrae>💬</a><span id=spansel style='position:absolute;z-index:5643;opacity:0.5;top:0px;left:30px;background-color:yellow;'></span>";
setTimeout(jonlmsr, 1900);
} else {
setTimeout(onlmsr, 1000);
}
} else {
setTimeout(onlmsr, 1000);
}

}


setTimeout(onlmsr, 2000);

… to help make this a better way to not offer any functionality that disappoints the user as not available, later!


Previous relevant Webpage macOS Say Audio Commentary Personalization Tutorial is shown below.

Webpage macOS Say Audio Commentary Personalization Tutorial

Webpage macOS Say Audio Commentary Personalization Tutorial

We want more ways for the “caller HTML” and the “external called Javascript” to co-operate, on top of the quite rigid and limited rules of yesterday’s Webpage macOS Say Audio Commentary Tutorial, and thought about “ways to add intelligence” to HTML. XML is a bit more towards what we are after. To make HTML be a bit XML we like …

  • global data attributes is a client side way we like to do this, and we use them both as …
    1. data-commentary global data attribute label used for user to flag commentary directly in the HTML design … and …
    2. data-foundcommentary global data attribute label used for the second way, below, whereby the “caller HTML” can co-operate with the “external called Javascript”, flagging relevant elements not to repeat audio commentaries
  • in the local Javascript of the “caller HTML” define an array as per …

    <script type='text/javascript'>
    var commentary_array=['.tbanner', 'Tbanner is class', '.bbanner', 'Bbanner is class'];
    </script>

    … one we wrote for the changed calc_use.htm example calling web application, made up of sets of pairs of a “CSS selector” and an “audio commentary to link to” and processed via the Javascript …

    function cmgdafmsr() {
    if (event.target.outerHTML.indexOf(' data-foundcommentary=') > event.target.outerHTML.indexOf('<') && event.target.outerHTML.indexOf(' data-foundcommentary=') < event.target.outerHTML.indexOf('>')) {
    wo_ismsr=window.open('HTTP://localhost:8888/macos_say_record.php?andclose=y&docronwork=say' + encodeURIComponent(minusvmsr) + '%20' + encodeURIComponent(event.target.getAttribute('data-foundcommentary')), 'ifh', 'top=50,left=50,width=500,height=500'); //'_blank', 'top=50,left=50,width=500,height=500');
    return true;
    } else if (event.target.outerHTML.indexOf(' data-commentary=') > event.target.outerHTML.indexOf('<') && event.target.outerHTML.indexOf(' data-commentary=') < event.target.outerHTML.indexOf('>')) {
    wo_ismsr=window.open('HTTP://localhost:8888/macos_say_record.php?andclose=y&docronwork=say' + encodeURIComponent(minusvmsr) + '%20' + encodeURIComponent(event.target.getAttribute('data-commentary')), 'ifh', 'top=50,left=50,width=500,height=500'); //'_blank', 'top=50,left=50,width=500,height=500');
    return true;
    }
    return false;
    }



    function cmfmsr() {
    if (!cmgdafmsr()) {
    if (('' + event.target.title) != '') {
    wo_ismsr=window.open('HTTP://localhost:8888/macos_say_record.php?andclose=y&docronwork=say' + encodeURIComponent(minusvmsr) + '%20Title%20is%20' + encodeURIComponent(event.target.title), 'ifh', 'top=50,left=50,width=500,height=500'); //'_blank', 'top=50,left=50,width=500,height=500');
    //alert('Title=' + String.fromCharCode(10) + event.target.title);
    } else if (('' + event.target.value).replace(/^undefined$/g,'').replace(/^null$/g,'') != '') {
    wo_ismsr=window.open('HTTP://localhost:8888/macos_say_record.php?andclose=y&docronwork=say' + encodeURIComponent(minusvmsr) + '%20Value%20is%20' + encodeURIComponent(event.target.value), 'ifh', 'top=50,left=50,width=500,height=500'); //'_blank', 'top=50,left=50,width=500,height=500');
    //alert('Value=' + String.fromCharCode(10) + event.target.value);
    } else if (('' + event.target.outerHTML).indexOf('><') == -1 && ('' + event.target.outerHTML).indexOf('</') != -1) {
    wo_ismsr=window.open('HTTP://localhost:8888/macos_say_record.php?andclose=y&docronwork=say' + encodeURIComponent(minusvmsr) + '%20InnerHTML%20is%20' + encodeURIComponent((event.target.innerText || event.target.contentWindow || event.target.contentDocument)), 'ifh', 'top=50,left=50,width=500,height=500'); //'_blank', 'top=50,left=50,width=500,height=500');
    //alert('InnerHTML=' + String.fromCharCode(10) + event.target.innerHTML);
    } else {
    console.log('OuterHTML=' + String.fromCharCode(10) + event.target.outerHTML);
    }
    }
    }


    function dostuffmsr() {
    var relstrmsr='', exctheremsr=false;
    var iels=0, jels=0, kels=0;
    var elsare=document.getElementsByTagName('*');
    //commentary_array=['.tbanner', 'Tbanner is class', '.bbanner', 'Bbanner is class'];
    for (iels=0; iels<elsare.length; iels++) {
    //console.log(typeof(commentary_array));
    exctheremsr=false;
    if (typeof(commentary_array) === 'object') {
    console.log('yes, array');
    for (jels=0; jels<commentary_array.length; jels+=2) {
    if (commentary_array[jels].trim() != '') {
    if (commentary_array[jels].trim().substring(0,1) == '.') {
    relstrmsr='';
    if (elsare[iels].outerHTML.indexOf(' class="') > elsare[iels].outerHTML.indexOf('<') && elsare[iels].outerHTML.indexOf(' class="') < elsare[iels].outerHTML.indexOf('>')) {
    relstrmsr=' ' + elsare[iels].outerHTML.split(' class="')[1].split('"')[0] + ' ';
    }
    if (relstrmsr.indexOf(' ' + commentary_array[jels].substring(1) + ' ') != -1) {
    elsare[iels].setAttribute('data-foundcommentary', commentary_array[eval(1 + eval('' + jels))]);
    elsare[iels].addEventListener("contextmenu", cmgdafmsr, false);
    exctheremsr=true;
    }
    } else if (commentary_array[jels].trim().substring(0,1) == '#') {
    relstrmsr='';
    if (elsare[iels].outerHTML.indexOf(' id="') > elsare[iels].outerHTML.indexOf('<') && elsare[iels].outerHTML.indexOf(' id="') < elsare[iels].outerHTML.indexOf('>')) {
    relstrmsr=' ' + elsare[iels].outerHTML.split(' id="')[1].split('"')[0] + ' ';
    }
    if (relstrmsr.indexOf(' ' + commentary_array[jels].substring(1) + ' ') != -1) {
    elsare[iels].setAttribute('data-foundcommentary', commentary_array[eval(1 + eval('' + jels))]);
    elsare[iels].addEventListener("contextmenu", cmgdafmsr, false);
    exctheremsr=true;
    }
    } else {
    relstrmsr='';
    if (elsare[iels].outerHTML.indexOf(commentary_array[jels]) == 1) {
    if (elsare[iels].outerHTML.indexOf(commentary_array[jels] + ' ') == 1) {
    elsare[iels].setAttribute('data-foundcommentary', commentary_array[eval(1 + eval('' + jels))]);
    elsare[iels].addEventListener("contextmenu", cmgdafmsr, false);
    exctheremsr=true;
    } else if (elsare[iels].outerHTML.indexOf(commentary_array[jels] + '>') == 1) {
    elsare[iels].setAttribute('data-foundcommentary', commentary_array[eval(1 + eval('' + jels))]);
    elsare[iels].addEventListener("contextmenu", cmgdafmsr, false);
    exctheremsr=true;
    }
    }
    }
    }
    }
    }

    if (exctheremsr || (elsare[iels].outerHTML.indexOf(' data-foundcommentary=') > elsare[iels].outerHTML.indexOf('<') && elsare[iels].outerHTML.indexOf(' data-foundcommentary=') < elsare[iels].outerHTML.indexOf('>'))) {
    iels=iels;
    } else if (elsare[iels].outerHTML.indexOf(' data-commentary=') > elsare[iels].outerHTML.indexOf('<') && elsare[iels].outerHTML.indexOf(' data-commentary=') < elsare[iels].outerHTML.indexOf('>')) {
    elsare[iels].addEventListener("contextmenu", cmgdafmsr, false);
    } else {
    elsare[iels].addEventListener("contextmenu", cmfmsr, false);
    }
    }
    }

… to add a lot more flexibility in user control of “audio commentary” content, where the “say” voice is now another optional dropdown choice in the changed macos_say_record.js external Javascript.


Previous relevant Webpage macOS Say Audio Commentary Tutorial is shown below.

Webpage macOS Say Audio Commentary Tutorial

Webpage macOS Say Audio Commentary Tutorial

It’s been a tweaked PHP web application last talked about at PHP macOS say Supervisor Modes of Use Tutorial, that, consisting of …

  • any public domain (ours being RJM Programming) webpage (and today we’ve chosen calc_use.htm) that gets added into its <head></head> section the external Javascript call …

    <script type='text/javascript' src='/macos_say_record.js'></script>
  • where that (new, today) macos_say_record.js

    // macos_say_record.js
    // RJM Programming
    // Help get, to work, MAMP URLs like HTTP://localhost:8888/macos_say_record.php?andclose=y&docronwork=say%20hello%20there

    var wo_ismsr=null;

    function cmfmsr() {
    if (('' + event.target.title) != '') {
    wo_ismsr=window.open('HTTP://localhost:8888/macos_say_record.php?andclose=y&docronwork=say%20Title%20is%20' + encodeURIComponent(event.target.title), 'ifh', 'top=50,left=50,width=500,height=500'); //'_blank', 'top=50,left=50,width=500,height=500');
    //alert('Title=' + String.fromCharCode(10) + event.target.title);
    } else if (('' + event.target.value).replace(/^undefined$/g,'').replace(/^null$/g,'') != '') {
    wo_ismsr=window.open('HTTP://localhost:8888/macos_say_record.php?andclose=y&docronwork=say%20Value%20is%20' + encodeURIComponent(event.target.value), 'ifh', 'top=50,left=50,width=500,height=500'); //'_blank', 'top=50,left=50,width=500,height=500');
    //alert('Value=' + String.fromCharCode(10) + event.target.value);
    } else if (('' + event.target.outerHTML).indexOf('><') == -1 && ('' + event.target.outerHTML).indexOf('</') != -1) {
    wo_ismsr=window.open('HTTP://localhost:8888/macos_say_record.php?andclose=y&docronwork=say%20InnerHTML%20is%20' + encodeURIComponent((event.target.innerText || event.target.contentWindow || event.target.contentDocument)), 'ifh', 'top=50,left=50,width=500,height=500'); //'_blank', 'top=50,left=50,width=500,height=500');
    //alert('InnerHTML=' + String.fromCharCode(10) + event.target.innerHTML);
    } else {
    console.log('OuterHTML=' + String.fromCharCode(10) + event.target.outerHTML);
    }
    }

    function locopencheck() {
    if (wo_ismsr) {
    //alert(10);
    if (!wo_ismsr.closed) {
    wo_ismsr.close();
    wo_ismsr=null;
    document.getElementById('msrae').title='Click here so that right click or two finger gesture around webpage performs macOS say audio commentary on target HTML elements.';
    document.getElementById('msrae').style.textShadow='-4px 4px 6px #ff2d95;';
    document.getElementById('msrae').style.backgroundColor='lightgreen';
    //alert(110);
    } else {
    wo_ismsr=null;
    //alert(1110);
    }
    //} else {
    //alert(11110);
    }
    }


    function dostuffmsr() {
    var elsare=document.getElementsByTagName('*');
    for (var iels=0; iels<elsare.length; iels++) {
    elsare[iels].addEventListener("contextmenu", cmfmsr, false);
    }
    }


    function huhmsr() {
    document.getElementById('msrae').style.display='none';
    }


    function onlmsr() {
    document.body.innerHTML+="<iframe id=ifh name=ifh style=display:none; src='//www.rjmprogramming.com.au/About_Us.html'></iframe><a title='Download macos_say_record.php to MAMP Document Root' onclick=dostuffmsr(); style='position:absolute;z-index:5643;opacity:0.5;top:0px;left:0px;background-color:yellow;' id=msrae>💬</a>";
    wo_ismsr=window.open('HTTP://localhost:8888/macos_say_record.php?andJUNKclose=y&docronwork=ls', 'ifh', 'top=50,left=50,width=500,height=500'); //'_blank', 'top=50,left=50,width=500,height=500');
    setTimeout(locopencheck, 900);
    setTimeout(huhmsr, 9000);
    }


    setTimeout(onlmsr, 2000);

    … sits in that public domain’s Document Root … and …
  • looks, in an “Intranet feeling” way to see whether you, as an individual user of that public domain webpage have downloaded to a macOS MAMP local Apache/PHP/MySql web server Document Root tweaked inhouse macos_say_record.php supervisor of macOS say command

… components to a “proof of concept” webpage audio commentary is an “Intranet feeling” solution.


Previous relevant PHP macOS say Supervisor Modes of Use Tutorial is shown below.

PHP macOS say Supervisor Modes of Use Tutorial

PHP macOS say Supervisor Modes of Use Tutorial

After yesterday’s Making of Siri on iPhone Plays Spotify Song via macOS say Tutorial, today we turn back to the PHP code that started our foray into “Siri meets say” thought patterns.

It seems a bit strange to be talking about macOS and command line “say” commands, and not, on top of its …

  • usual “surfing the net” via the web browser address bar mode of use … to, today, add …
  • a “command line” mode of use … and …
  • the manufactured feeling “curl” mode of use

… to its talents so that “say” on the macOS command line can have equivalencies with …

<?php

if (isset($argv)) { // command line
$commandsofar="say ";
$numargs = sizeof($argv);
if ($numargs > 1) {
if (PHP_OS == "Darwin") {
for ($ii=1; $ii<$numargs; $ii++) {
if ($ii == 1 && strtolower($argv[$ii]) == 'say') {
$commandsofar="say ";
} else {
$commandsofar.=' ' . $argv[$ii];
}
}
passthru($commandsofar);
exit;
}
} else {
if (PHP_OS == "Darwin") {
passthru("info say");
exit;
}
}
} else if (isset($_GET['curlit'])) { // curl
$commandsofar="say ";
if (PHP_OS == "Darwin") {
passthru(str_replace("say say ","say ","say " . str_replace('+',' ',urldecode($_GET['curlit']))));
exit;
}
}

?>

  • a “command line” mode of use … where “say blah-blah-blah” on a command line can be equivalent to, say, “php ./macos_say_record.php blah-blah-blah” …
  • the manufactured feeling “curl” mode of use asks of the user a way to use a command like “curl ‘HTTP://localhost:8888/macos_say_record.php?curlit=blah-blah-blah‘” (where blah-blah-blah = encodeURIComponent(blah-blah-blah))

We also increased “say” functionality by not forcing …

  • the default output, for “say” use, of creating an audio file … and, as of today, adding that, as an alternative …
  • if the audio file is set to blank by the user the “say” operating system command is performed behind the scenes …
    <?php

    if (str_replace("+"," ",urldecode($_GET['audioname'])) == "") {
    passthru("say" . $sayprefix . " " . str_replace("\n",",,,,,,",$thewords) . " > " . dirname(__FILE__) . "/sayout.out" . " 2> " . dirname(__FILE__) . "/sayerr.err");
    exit;
    } else {

    exec("say" . $sayprefix . " -o " . dirname(__FILE__) . "/" . str_replace("+"," ",urldecode($_GET['audioname'])) . " " . str_replace("\n",",,,,,,",$thewords) . " > " . dirname(__FILE__) . "/sayout.out" . " 2> " . dirname(__FILE__) . "/sayerr.err");
    }

    ?>
    … getting us to moderate that “audiofile” textbox functionality this way
    <?php

    $audioft="";
    if (PHP_OS == "Darwin") {
    $audioft=' title="This made to be blank and the topmost say dropdown choice will cause the text to audio to play through your speakers." onblur="if (this.value.trim().length == 0 && document.getElementById(' . "'" . 'saymode' . "'" . ').value.length == 0) { document.getElementById(' . "'" . 'saysub' . "'" . ').value=document.getElementById(' . "'" . 'saysub' . "'" . ').value.replace(' . "'" . 'Record ' . "'" . ',' . "'" . 'Say ' . "'" . '); } else if (this.value.trim().length != 0 && document.getElementById(' . "'" . 'saymode' . "'" . ').value.length == 0) { document.getElementById(' . "'" . 'saysub' . "'" . ').value=document.getElementById(' . "'" . 'saysub' . "'" . ').value.replace(' . "'" . 'Say ' . "'" . ',' . "'" . 'Record ' . "'" . '); }"';
    }


    ?>
    … working with …
    <?php echo ”

    <input type=text name=audioname id=audioname value='audiocapture." . $bestext . "'" . $audioft . "></input>

    “; ?>

… to improve the user experience for those curious macOS (perhaps MAMP) local web server users of our changed inhouse macos_say_record.php (we recommend you download to macOS MAMP local web server and startup via HTTP://localhost:8888/macos_say_record.php web address URL) MacOS Text to Audio online PHP supervisor.


Previous relevant Making of Siri on iPhone Plays Spotify Song via macOS say Tutorial is shown below.

Making of Siri on iPhone Plays Spotify Song via macOS say Tutorial

Making of Siri on iPhone Plays Spotify Song via macOS say Tutorial

Making yesterday’s Siri on iPhone Plays Spotify Song via macOS say Tutorial‘s video involved three devices …

  1. this MacBook Air (using “say” commands) … and …
  2. an iPhone with Siri and Spotify … but, also …
  3. a Windows 10 laptop helped contextualize … via …

… use of …

  • Windows 10 Camera app … photographing the slide contents of yesterday’s video presentation
  • Windows 10 Photos app … turning the slides above into yesterday’s video presentation … along with its Share option Mail to email off and sftp into place

… some steps of which you can see with today’s animated GIF tutorial picture.


Previous relevant Siri on iPhone Plays Spotify Song via macOS say Tutorial is shown below.

Siri on iPhone Plays Spotify Song via macOS say Tutorial

Siri on iPhone Plays Spotify Song via macOS say Tutorial

Yesterday’s Siri on iPad Plays Apple Music Song Tutorial represented to us, regarding the …

Don’t be concerned, it will not harm you
It’s only me pursuing somethin’ I’m not sure of
Across my dreams with nets of wonder
I chase the bright elusive butterfly of love

ilk of things, a creeping up on our interest in a programmable link between …

iOS music playing (Apple Music or Spotify etcetera) … and Siri … along with … macOS say (via crontab or at (macOS command scheduling functionality), eventually) control

And our verdict, after today’s iPhone Siri setup (which gets you to “say”, modelling …

say “Hey Siri”
say “Hey Siri, send a message”
say “Hey Siri, how’s the weather today”
say “Hey Siri, set a timer for three minutes”
say “Hey Siri, play some music”

… sentences above to configure the relevant voice) along with a macOS command line “say” arrangement, is … da, da da da da da, da, da da we could go on with the whole lion bit, but we’ll spare you … yes, we can get “say” command on macOS work a …

Hey Siri, Play U2

say “Hey Siri, Play U2”

… type of Siri dictation command onto (our) iPhone’s (default Spotify) music app to play a song. It’s just that … first wooooorrrrlllldddd problem alert … the “say” command was not that flash at …

Hey Siri, Stop

say “Hey Siri, Stop”

… to stop the music, as well as our own … yoo hoo … voice is. And so, our recommendation is to setup Siri for multiple voices. How? Hard to believe, but it seems, in iPhone’s Settings -> Siri & Search screen, turning the top green (Listen for “Hey Siri”) switch in the settings to off and then back on is the go?! The resultant procedure is where you can “train” Siri to recognize a macOS “say” voice, as well as your own voice, or a bunch of other “Siri Voice” (menu) choices offered “out of the box” with the iPhone iOS installed. It may be that you should explore macOS “say” -v [VoiceName] choices, as well, here.

How does this work sit with macOS crontab “say” command thinking that goes with our changed inhouse macos_say_record.php (we recommend you download to macOS MAMP local web server and startup via HTTP://localhost:8888/macos_say_record.php web address URL) MacOS Text to Audio online PHP supervisor talked about with MacOS Text to Audio Scheduling Tutorial? Well, without reliable “stop” … first wooooorrrrlllldddd problem or not … we are going to continue research, but we’re not sure that you will be totally spared from your own voice interventions for stopping (of music) purposes … or perhaps get yourselves an Apple HomePod mini

… as a hardware style of thinking solution. Anyway, take a look at today’s iPhone Siri meets macOS “say” control of iPhone Spotify learning curve hereabouts …


Previous relevant Siri on iPad Plays Apple Music Song Tutorial is shown below.

Siri on iPad Plays Apple Music Song Tutorial

Siri on iPad Plays Apple Music Song Tutorial

We’re resetting the iOS Siri app mentioned in Siri on iPad Mail Dictate Tutorial on another iPad today. We wanted to set it up (via Settings -> Siri & Search) to play songs on Apple Music with spoken words (directed to Siri) such as …

Hey Siri, Play Brahms

… but as you can see from today’s tutorial animated GIF picture (also showing Siri’s setup) we had no Brahms in our Apple Music collection, and so tried …

Hey Siri, Play U2

… with more success!


Previous relevant Siri on iPad Mail Dictate Tutorial is shown below.

Siri on iPad Mail Dictate Tutorial

Siri on iPad Mail Dictate Tutorial

Hope you are not like me and feel like going into a cupboard to use a microphone on a mobile device. If this is not you, and you have a half recent version of iOS on an iPad or iPhone, and you have Siri available as an app, then today’s tutorial may be of interest.

Siri can be like a personal assistant, and the way we best think of it as such, is as a tool to help dictate an email, using the Mail app on our iPad. To get to that, though, if you’ve never used Siri before, you should consult this Apple webpage, or our previous Apple iOS Siri Audio Commentary Tutorial to get started. Once you’re setup for Siri in this way it is very easy to start using Siri when composing emails.

  • Open the Mail app
  • Fill in the To field via the keyboard … Siri can’t do this very well … but while you are at the keyboard, what’s the third button from the left on the bottom row? Yes, the “microphone” button gets you to Siri functionality … cute, huh?!
  • Guess we don’t need to say, but will, that this microphone button becomes useful as soon as you tap in a “keyboard” anything … Siri can be there to assist … personally!

But a word of caution here, is to check about homonyms like today’s “in all innocence” …


The rain in Spain falls mainly on the plane

… Siri faux pas. This is a small concern compared to how much it can do that is correct. Hands free dictation can be very useful for those users on the go, or those kinaesthetic thinkers, perhaps.

On the iPad latest iOS, which we’ll have to talk about soon, there are other good suggestions for Siri use to add to …

  • Mail (app) … those being …
  • Safari
  • Photos
  • Camera
  • Settings … and
  • Numerous Third Party and homegrown apps that access the keyboard, and so, Siri “microphone”

Hope this is food for thought, and we’ll leave you with today’s PDF presentation of a Mail app session using Siri to help build up the body section email content, here.


Previous relevant Apple iOS Siri Audio Commentary Tutorial is shown below.

Apple iOS Siri Audio Commentary Tutorial

Apple iOS Siri Audio Commentary Tutorial (click/touch to open and then hover, click/touch will have audio commentary)

Today we wanted to show you an idea inspired by our own previous Apple iOS Siri Primer Tutorial that combines …

… especially as Siri so much relates to audio and “voice recognition”.

Now that idea’s first, second and everything aside from ‘HTML audio elements that allow for an audio commentary of the 9 “subimages”‘ of the third parts we’ve been consistent on, but the idea to do this in the first place was secondly inspired by reading this interesting link referring to the CSS selectors :before and :after use of the content property, especially where it says …

url(url) Sets the content to be some kind of media (an image, a sound, a video, etc.)

… not quite believing it could be true … yes, an image, but “a sound, a video“? No way! Well, alas, as of this date, yes … no way … yet. Then seeing this CSS approach wasn’t working … lo and behold … this link explains more … thanks.

But this setback is not the end of the world, and the other backup plan of …

  • HTML area elements of the HTML map element will be given onmouseover and onclick event logic added to it while using the Mobilefish online map creator … and we’ll massage the resultant HTML to put this logic in as well as the HTML audio element “shells” as well as …
  • Define audio file comma separated lists in the HTML area elements’ alt attributes

… involves this Javascript DOM code to make the audio commentary be controlled by a hover (but not on mobile devices) and/or click/touch of a “subimage” of interest from the main image …


<script type='text/javascript'>

var lastomo='';
var lastoc='';
var e, prebits, bits, i;

function omo(ois) {
if (lastomo != ("" + ois.title)) {
if (ois.alt.indexOf('.') != -1) {
prebits=ois.alt.split(',');
for (i=1; i<=prebits.length; i++) {
bits=prebits[i - 1].split('.');
document.getElementById('iaudio' + i).type="audio/" + bits[1].replace('mp3','mpeg');
document.getElementById('iaudio' + i).src=prebits[i - 1];
try {
document.getElementById('iaudio' + i).play();
} catch (e) {
document.title=('problem');
}
}
}
}
lastomo="" + ois.title;
}

function oc(ois) {
if (lastoc != ("" + ois.title)) {
if (ois.alt.indexOf('.') != -1) {
prebits=ois.alt.split(',');
for (i=1; i<=prebits.length; i++) {
bits=prebits[i - 1].split('.');
document.getElementById('iaudio' + i).type="audio/" + bits[1].replace('mp3','mpeg');
document.getElementById('iaudio' + i).src=prebits[i - 1];
try {
document.getElementById('iaudio' + i).play();
} catch (e) {
document.title=('problem');
}
}
}
}
lastoc="" + ois.title;
}

</script>

You’ll see a reminder of the first CSS plan where we have …


<style>
.screenshot_1::before {
content: url('slide1.m4a');
}
</style>

… because you never know what the future holds?!

Please try our live run and/or peruse or download the HTML and Javascript and “not now” CSS you could call siri_setup_with_audio.html


Previous relevant Apple iOS Siri Primer Tutorial is shown below.

Apple iOS Siri Primer Tutorial

Apple iOS Siri Primer Tutorial

After the tutorial two days back, with Windows 10 and its Cortana voice recognition “personal assistant” (that we tested out with Windows 10 Cortana Primer Tutorial below) you’d be wondering if Apple has an equivalent, and yes, for iOS, which we are going to show today on an iPad, and there are “kind of” ways for Mac OS X El Capitan you can read about here.

Let’s see how Apple describes Siri this way …

Siri lets you use your voice to send messages, schedule meetings, place phone calls and more. Ask Siri to do things just by talking the way you talk. Siri understands what you say, knows what you mean and even talks back. Siri is so easy to use and does so much, you’ll keep finding more and more ways to use it.

This being an iPad, and this being iOS, we had no issues with microphones setting up Siri. The microphone is well integrated into iPad normal usage, and the main job for today’s iPad Siri setup that you get to via …


Settings -> General -> Siri

… relates to “voice recognition” … and which we feature some of the steps involved, with today’s tutorial picture.


Previous relevant Windows 10 Cortana Primer Tutorial is shown below.

Windows 10 Cortana Primer Tutorial

Windows 10 Cortana Primer Tutorial

In the area of robotics and artificial intelligence, perhaps the best known concept to we “mere mortals” is “voice recognition”. Perhaps because research into it goes back to 1932, before the Second World War … and 66 years before the “Worm Farm Incident of Simmons Street Disaster” … but we digress … and no … “I’m not ready to open up about this at this delicate stage of my life, yet, Brad.”.

Voice recognition has come a long way from those earliest endeavours when the speech recognition relied on training software for an individual voice. This became apparent to me trying out Cortana in Windows 10. Once working, it didn’t seem to matter who in our house asked the same question of Cortana, the speech recognition software recognized and translated the speech into the same text for all of us. Actually, Microsoft describes Cortana this way …

Cortana is your clever new personal assistant.

Cortana will help you find things on your PC, manage your calendar, track packages, find files, chat with you, and tell jokes. The more you use Cortana, the more personalized your experience will be.

To get started, type a question in the search box on the taskbar. Or select the microphone icon and talk to Cortana. (Typing works for all types of PCs, but you need a mic to talk.)

… and I see what they mean by this, because you can work Cortana without the voice recognition part, if you like, or if you have the urge to run for the nearest cupboard before being caught talking into a computer (microphone). Perhaps Cortana should have a special “Darkroom Edition” for people who …

  1. have the urge to run for the nearest cupboard before being caught talking into a computer (microphone) … and who …
  2. have a hobby developing and printing photographs

Anyway, we agree with Microsoft that Cortana is clever, and it’s nice for us to find another use for the microphone (brand called MXL Tempo) we used with WebEx work we talked about with WebEx Presentation with Microphone Tutorial below.

There is not much to setting up Cortana, except, perhaps, for the microphone bit, which we’ll talk more about later. Cortana’s “personal assistant” and interface down next to the Windows icon at the bottom left of the screen guides you well through what you have to do.

We got stuck a bit, regarding setting up the microphone, with a cycle of it presenting this voice recognition test always resulting in a message wondering whether we had the microphone set to “mute on”, which wasn’t the case. But what was the case, and remedied this problem was to use a USB 2 port rather than a USB 3 port … in case this happens to you.

Other than that, Cortana is pretty cute, and could be a good enough reason on its own to upgrade to Windows 10 from Windows 7, Windows 8.1, Windows Phone 8.1 or Windows 9 operating systems before Friday, 29th July 2016 which is the cut off day for free upgrades. Our experience of the upgrade was talked about at Windows 10 Upgrade Primer Tutorial (and backups were discussed at Windows File History Backup Primer Tutorial).

Did you know?

Sadly, some days ago saw the passing of Frank Dickens, the creator of the Bristow cartoon series, forever etched on my brain regarding The Great Tea Trolley Disaster of ’67. R.I.P.


Previous relevant WebEx Presentation with Microphone Tutorial is shown below.

WebEx Presentation with Microphone Tutorial

WebEx Presentation with Microphone Tutorial

We’ve been doing some more WebEx (by Cisco) lately, and realised, at least with using a MacBook Pro laptop, we needed to invest in a microphone, to be heard, as the inbuilt microphone systems were not up to it.

We opted for a USB connected microphone brand called MXL Tempo, sold here in Australia, and have found it to be good, especially mounted on the stand provided … well, no complaints, anyway?! Where it has a 1/8″ (3.5mm) Headphone Jack we plugged in our own speakers, though you could use headphones here as well.

Of course we’ll also be constructing a garage, and buying a guitar, and calling on “tree fellers” karaoke backing track of Peter, Paul and Mary to complete the picture of this week’s project … getting the new microphone to make breakfast in the morning before you even knew you needed breakfast get me on The Voices.

In the WebEx “Audio Connection” menu via “Call Using Computer” option have both input and output audio be handled by “USB audio CODEC” (if they are options … if not, there is a hardware (perhaps configuration) problem with your audio and microphone connection) as you can see at today’s tutorial picture. So long as you succeed and have the USB connected, the audio connection will default to this arrangement for the next time. Cute, huh?!

To make it permanent that the MXL Tempo microphone arrangement is the default device for recordings …

  1. click on System Preferences off the Apple menu
  2. click the Sound option
  3. click the Output tab
  4. pick USB audio CODEC
  5. if you intend using speakers or headphones connected off this microphone from its 1/8″ (3.5mm) Headphone Jack, click the Input tab
  6. pick USB audio CODEC

Being heard never seemed so easy!


Previous relevant WebEx Prerecording Primer Tutorial is shown below.

WebEx Prerecording Primer Tutorial

WebEx Prerecording Primer Tutorial

We’ve been trying out WebEx (by Cisco) prerecording as a video conferencing idea as an alternative to …

… regarding video conferencing products we’ve tried at this blog.

Have to say, WebEx is great, even with respect to the “wide eyed and bushy tailed” reaction “this little black duck” has to all these networky communicaty ideas on the net (at least we spelt “net” correctly).

Have to thank my wife, Maree, for her expertise and the facilities her company, Thomson Reuters, supplies for the serving of WebEx recordings … thanks everyone. Have been assured they are periodically deleted, and my lame impersonations of the old “ducks on the wall” can rest in peace shortly.

And so, we have a slideshow starting with a WebEx email link to join a meeting, and we pan down the email to show you other WebEx functionalities, such as adding a Calendar reference to the meeting time, and though we haven’t shown you detail here, rest assured it handles timezone scenarios very well, unless you lie about living in Antarctica, that is … sorry, scientists in Antarctica reading this blog posting … all 237 of you.

During this “earlier than today exploration of WebEx” session the necessary software installs just happened for this MacBook Pro Mac OS X laptop as if we were shelling peas … it’s always good to have some handy when installing any software. So we won’t show you this unless we deem it essential at a later date. You can perhaps do as I did, and ask a real WebEx user invite you to a meeting, to set yourself up. In fact, today’s session meeting creation time you may notice is well in the past from that earlier introductory learning session Maree and I had, and you can bring back up that old email, and resurrect that meeting again and again, if you like … am not sure if there is an expiry date on this too, like with server stored WebEx prerecordings.

So also rest assured, WebEx handles …

  • video via webcam on your device
  • audio via microphone on your device (“Use Computer”) or via a phone line
  • the synchronization of the two above
  • mobile devices

Did you know?

A .ics extension file, as you can see being used as an email attachment file extension in is, as explained in this link‘s sublink

ICS is a global format for calendar files widely being utilized by various calendar and email programs including Google Calendar, Apple iCal, and Microsoft Outlook. These files enable users to share and publish information directly from their calendars over email or via uploading it to the world wide web.

… as helping interface meetings to online calendar appointments. Cute, huh?!

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

This entry was posted in eLearning, Event-Driven Programming, Operating System, Tutorials and tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *