Last active
November 30, 2020 19:29
-
-
Save mikedg1/9767772 to your computer and use it in GitHub Desktop.
[wearscript] Ear, for listening to channel and playing audio in your ear.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html style="width:100%; height:100%; overflow:hidden"> | |
| <head> | |
| <!-- You can include external scripts here like so... --> | |
| <!--<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>--> | |
| </head> | |
| <body style="width:100%; height:100%; overflow:hidden; margin:0"> | |
| <canvas id="canvas" width="640" height="360" style="display:block"></canvas> | |
| <script> | |
| function server() { | |
| WS.log('Welcome to Whisper'); | |
| WS.say('Welcome to Whisper'); | |
| WS.sound('SUCCESS') | |
| WS.subscribe("whisper", listenToWhisper) | |
| } | |
| function testPub() { | |
| WS.publish("whisper", "hi"); | |
| } | |
| function listenToWhisper(text) { | |
| WS.log('Whisper logged:' + text); | |
| WS.say(text); | |
| } | |
| function main() { | |
| if (WS.scriptVersion(1)) return; | |
| ctx = document.getElementById('canvas').getContext("2d"); | |
| WS.serverConnect('{{WSUrl}}', server); | |
| } | |
| window.onload = main; | |
| </script> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"name":"Ear"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment