{"action":"created","comment":{"url":"https://api.github.com/repos/HippieStation/HippieStation/pulls/comments/211106534","pull_request_review_id":147462444,"id":211106534,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTEwNjUzNA==","diff_hunk":"@@ -0,0 +1,175 @@\n+SUBSYSTEM_DEF(tts)\n+\tname = \"Text-to-Speech\"\n+\twait = 2\n+\trunlevels = (RUNLEVEL_INIT | RUNLEVEL_LOBBY | RUNLEVEL_SETUP | RUNLEVEL_GAME | RUNLEVEL_POSTGAME )\n+\tvar/list/queue           // List of items to process\n+\tvar/datum/tts/processing // The item we're currentl processing\n+\n+/datum/tts\n+\tvar/client/owner\n+\tvar/text = \"\"\n+\tvar/voice = \"\"\n+\tvar/filename = \"\"\n+\tvar/is_global = FALSE\n+\tvar/timeout = 10 // file shouldn't take longer than 1 second to process, delete after this much time has passed\n+\n+/datum/tts/proc/Initialize()\n+\t. = ..()\n+\n+/datum/tts/proc/say(client/C, msg, voice = \"\", is_global = FALSE)\n+\tif (!C)\n+\t\treturn\n+\tif (!msg)\n+\t\treturn\n+\towner = C\n+\ttext = msg\n+\tsrc.voice = voice\n+\tsrc.is_global = is_global\n+\n+\tLAZYADD(SStts.queue, src)\n+\n+/datum/controller/subsystem/tts/Initialize()\n+\tLAZYINITLIST(queue)\n+\n+\tif (!CONFIG_GET(flag/enable_tts))\n+\t\tcan_fire = FALSE\n+\treturn ..()\n+\n+/datum/controller/subsystem/tts/proc/check_queue(client/C)\n+\tif (!C)\n+\t\treturn FALSE\n+\n+\tfor (var/datum/tts/T in queue)\n+\t\tif (T)\n+\t\t\tif (T.owner == C)\n+\t\t\t\treturn TRUE\n+\n+\treturn FALSE\n+\n+/datum/controller/subsystem/tts/fire(resumed = FALSE)\n+\tif (processing)\n+\t\tif (!processing.owner)\n+\t\t\tmessage_admins(\"TTS request has no owner (on check)\")\n+\t\t\tprocessing = null\n+\t\t\treturn\n+\n+\t\t// file not ready\n+\t\tif (!fexists(processing.filename))\n+\t\t\tif (world.time > processing.timeout)\n+\t\t\t\tmessage_admins(\"[processing.owner]'s TTS request timed out!\")\n+\t\t\t\tprocessing = null\n+\t\t\treturn\n+\n+\t\tfor (var/mob/M in GLOB.player_list)","path":"hippiestation/code/controllers/subsystem/tts.dm","position":41,"original_position":63,"commit_id":"9af93423ad43066498acee25d9b0d8a27a30ae30","original_commit_id":"6a55836245b6d354fe5e0c8c36a009e7c09255bd","user":{"login":"JohnGinnane","id":3355198,"node_id":"MDQ6VXNlcjMzNTUxOTg=","avatar_url":"https://avatars3.githubusercontent.com/u/3355198?v=4","gravatar_id":"","url":"https://api.github.com/users/JohnGinnane","html_url":"https://github.com/JohnGinnane","followers_url":"https://api.github.com/users/JohnGinnane/followers","following_url":"https://api.github.com/users/JohnGinnane/following{/other_user}","gists_url":"https://api.github.com/users/JohnGinnane/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnGinnane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnGinnane/subscriptions","organizations_url":"https://api.github.com/users/JohnGinnane/orgs","repos_url":"https://api.github.com/users/JohnGinnane/repos","events_url":"https://api.github.com/users/JohnGinnane/events{/privacy}","received_events_url":"https://api.github.com/users/JohnGinnane/received_events","type":"User","site_admin":false},"body":"I have to loop through all players and check if they have TTS enabled before playing a local sound. `playsound` plays a single sound for all mobs","created_at":"2018-08-19T15:26:33Z","updated_at":"2018-08-19T15:26:34Z","html_url":"https://github.com/HippieStation/HippieStation/pull/8584#discussion_r211106534","pull_request_url":"https://api.github.com/repos/HippieStation/HippieStation/pulls/8584","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/HippieStation/HippieStation/pulls/comments/211106534"},"html":{"href":"https://github.com/HippieStation/HippieStation/pull/8584#discussion_r211106534"},"pull_request":{"href":"https://api.github.com/repos/HippieStation/HippieStation/pulls/8584"}},"in_reply_to_id":210580007},"pull_request":{"url":"https://api.github.com/repos/HippieStation/HippieStation/pulls/8584","id":207773412,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA3NzczNDEy","html_url":"https://github.com/HippieStation/HippieStation/pull/8584","diff_url":"https://github.com/HippieStation/HippieStation/pull/8584.diff","patch_url":"https://github.com/HippieStation/HippieStation/pull/8584.patch","issue_url":"https://api.github.com/repos/HippieStation/HippieStation/issues/8584","number":8584,"state":"open","locked":false,"title":"Adds Text-to-Speech","user":{"login":"JohnGinnane","id":3355198,"node_id":"MDQ6VXNlcjMzNTUxOTg=","avatar_url":"https://avatars3.githubusercontent.com/u/3355198?v=4","gravatar_id":"","url":"https://api.github.com/users/JohnGinnane","html_url":"https://github.com/JohnGinnane","followers_url":"https://api.github.com/users/JohnGinnane/followers","following_url":"https://api.github.com/users/JohnGinnane/following{/other_user}","gists_url":"https://api.github.com/users/JohnGinnane/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnGinnane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnGinnane/subscriptions","organizations_url":"https://api.github.com/users/JohnGinnane/orgs","repos_url":"https://api.github.com/users/JohnGinnane/repos","events_url":"https://api.github.com/users/JohnGinnane/events{/privacy}","received_events_url":"https://api.github.com/users/JohnGinnane/received_events","type":"User","site_admin":false},"body":"Players can now use text-to-speech while talking in the game. Players can disable via preferences (Preferences > Hear/Silence Midis)\r\n\r\n:cl: JohnGinnane\r\nadd: Humans now have text-to-speech\r\nadd: Admins can play global text-to-speech. Fun > Play TTS\r\n/:cl:\r\n\r\nIt is enabled by adding ENABLE_TTS to game_options.txt\r\n\r\nVoices are picked randomly when humans are created. There are 4 for females and 5 for males. If admins want to change a player's voice they can change the `tts_voice` variable on the `dna`. Default voice is \"paul\" (which is what the global TTS uses)\r\n\r\nStoring the voice on the `dna` means if a ling absorbs another player and transforms into them, they will also use their new voice\r\n\r\nThere is a cooldown that is based on the length of the message, to avoid spam\r\n\r\nI've created a subsystem which has a queue of sounds. If this queue isn't empty then the first item is taken and processed. \r\n\r\nMany thanks to Gregg for helping me figure out how to get things set up\r\n\r\nVIDEO:\r\nhttps://streamable.com/c9o4p\r\nhttps://streamable.com/ayoz0\r\nhttps://streamable.com/a3oy2\r\nhttps://streamable.com/qhkdm (speech modifier)\r\nhttps://streamable.com/ky64u\r\n\r\nSource:\r\nhttps://github.com/JohnGinnane/ss13_tts_generator","created_at":"2018-08-11T12:48:52Z","updated_at":"2018-08-19T15:26:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3aa79134803c8797ad11be43ee6dd32aaa5f525c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":701592040,"node_id":"MDU6TGFiZWw3MDE1OTIwNDA=","url":"https://api.github.com/repos/HippieStation/HippieStation/labels/Config%20Update","name":"Config Update","color":"48cea4","default":false},{"id":583740830,"node_id":"MDU6TGFiZWw1ODM3NDA4MzA=","url":"https://api.github.com/repos/HippieStation/HippieStation/labels/Feature","name":"Feature","color":"1d76db","default":false},{"id":560009475,"node_id":"MDU6TGFiZWw1NjAwMDk0NzU=","url":"https://api.github.com/repos/HippieStation/HippieStation/labels/Needs%20Head%20Input","name":"Needs Head Input","color":"f9d0c4","default":false},{"id":626170165,"node_id":"MDU6TGFiZWw2MjYxNzAxNjU=","url":"https://api.github.com/repos/HippieStation/HippieStation/labels/Ready%20for%20Review","name":"Ready for Review","color":"ffdfa2","default":false},{"id":626170202,"node_id":"MDU6TGFiZWw2MjYxNzAyMDI=","url":"https://api.github.com/repos/HippieStation/HippieStation/labels/Tools","name":"Tools","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/HippieStation/HippieStation/pulls/8584/commits","review_comments_url":"https://api.github.com/repos/HippieStation/HippieStation/pulls/8584/comments","review_comment_url":"https://api.github.com/repos/HippieStation/HippieStation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/HippieStation/HippieStation/issues/8584/comments","statuses_url":"https://api.github.com/repos/HippieStation/HippieStation/statuses/9af93423ad43066498acee25d9b0d8a27a30ae30","head":{"label":"JohnGinnane:text_to_speech","ref":"text_to_speech","sha":"9af93423ad43066498acee25d9b0d8a27a30ae30","user":{"login":"JohnGinnane","id":3355198,"node_id":"MDQ6VXNlcjMzNTUxOTg=","avatar_url":"https://avatars3.githubusercontent.com/u/3355198?v=4","gravatar_id":"","url":"https://api.github.com/users/JohnGinnane","html_url":"https://github.com/JohnGinnane","followers_url":"https://api.github.com/users/JohnGinnane/followers","following_url":"https://api.github.com/users/JohnGinnane/following{/other_user}","gists_url":"https://api.github.com/users/JohnGinnane/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnGinnane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnGinnane/subscriptions","organizations_url":"https://api.github.com/users/JohnGinnane/orgs","repos_url":"https://api.github.com/users/JohnGinnane/repos","events_url":"https://api.github.com/users/JohnGinnane/events{/privacy}","received_events_url":"https://api.github.com/users/JohnGinnane/received_events","type":"User","site_admin":false},"repo":{"id":112768404,"node_id":"MDEwOlJlcG9zaXRvcnkxMTI3Njg0MDQ=","name":"HippieStation","full_name":"JohnGinnane/HippieStation","owner":{"login":"JohnGinnane","id":3355198,"node_id":"MDQ6VXNlcjMzNTUxOTg=","avatar_url":"https://avatars3.githubusercontent.com/u/3355198?v=4","gravatar_id":"","url":"https://api.github.com/users/JohnGinnane","html_url":"https://github.com/JohnGinnane","followers_url":"https://api.github.com/users/JohnGinnane/followers","following_url":"https://api.github.com/users/JohnGinnane/following{/other_user}","gists_url":"https://api.github.com/users/JohnGinnane/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnGinnane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnGinnane/subscriptions","organizations_url":"https://api.github.com/users/JohnGinnane/orgs","repos_url":"https://api.github.com/users/JohnGinnane/repos","events_url":"https://api.github.com/users/JohnGinnane/events{/privacy}","received_events_url":"https://api.github.com/users/JohnGinnane/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JohnGinnane/HippieStation","description":"The Hippie Station branch of SS13","fork":true,"url":"https://api.github.com/repos/JohnGinnane/HippieStation","forks_url":"https://api.github.com/repos/JohnGinnane/HippieStation/forks","keys_url":"https://api.github.com/repos/JohnGinnane/HippieStation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JohnGinnane/HippieStation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JohnGinnane/HippieStation/teams","hooks_url":"https://api.github.com/repos/JohnGinnane/HippieStation/hooks","issue_events_url":"https://api.github.com/repos/JohnGinnane/HippieStation/issues/events{/number}","events_url":"https://api.github.com/repos/JohnGinnane/HippieStation/events","assignees_url":"https://api.github.com/repos/JohnGinnane/HippieStation/assignees{/user}","branches_url":"https://api.github.com/repos/JohnGinnane/HippieStation/branches{/branch}","tags_url":"https://api.github.com/repos/JohnGinnane/HippieStation/tags","blobs_url":"https://api.github.com/repos/JohnGinnane/HippieStation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JohnGinnane/HippieStation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JohnGinnane/HippieStation/git/refs{/sha}","trees_url":"https://api.github.com/repos/JohnGinnane/HippieStation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JohnGinnane/HippieStation/statuses/{sha}","languages_url":"https://api.github.com/repos/JohnGinnane/HippieStation/languages","stargazers_url":"https://api.github.com/repos/JohnGinnane/HippieStation/stargazers","contributors_url":"https://api.github.com/repos/JohnGinnane/HippieStation/contributors","subscribers_url":"https://api.github.com/repos/JohnGinnane/HippieStation/subscribers","subscription_url":"https://api.github.com/repos/JohnGinnane/HippieStation/subscription","commits_url":"https://api.github.com/repos/JohnGinnane/HippieStation/commits{/sha}","git_commits_url":"https://api.github.com/repos/JohnGinnane/HippieStation/git/commits{/sha}","comments_url":"https://api.github.com/repos/JohnGinnane/HippieStation/comments{/number}","issue_comment_url":"https://api.github.com/repos/JohnGinnane/HippieStation/issues/comments{/number}","contents_url":"https://api.github.com/repos/JohnGinnane/HippieStation/contents/{+path}","compare_url":"https://api.github.com/repos/JohnGinnane/HippieStation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JohnGinnane/HippieStation/merges","archive_url":"https://api.github.com/repos/JohnGinnane/HippieStation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JohnGinnane/HippieStation/downloads","issues_url":"https://api.github.com/repos/JohnGinnane/HippieStation/issues{/number}","pulls_url":"https://api.github.com/repos/JohnGinnane/HippieStation/pulls{/number}","milestones_url":"https://api.github.com/repos/JohnGinnane/HippieStation/milestones{/number}","notifications_url":"https://api.github.com/repos/JohnGinnane/HippieStation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JohnGinnane/HippieStation/labels{/name}","releases_url":"https://api.github.com/repos/JohnGinnane/HippieStation/releases{/id}","deployments_url":"https://api.github.com/repos/JohnGinnane/HippieStation/deployments","created_at":"2017-12-01T17:34:28Z","updated_at":"2018-08-18T16:49:55Z","pushed_at":"2018-08-19T15:25:06Z","git_url":"git://github.com/JohnGinnane/HippieStation.git","ssh_url":"git@github.com:JohnGinnane/HippieStation.git","clone_url":"https://github.com/JohnGinnane/HippieStation.git","svn_url":"https://github.com/JohnGinnane/HippieStation","homepage":"https://hippiestation.com/","size":2237213,"stargazers_count":0,"watchers_count":0,"language":"DM","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"HippieStation:master","ref":"master","sha":"fd07818c9c99c482a611121be6fb7567275d95e1","user":{"login":"HippieStation","id":25507626,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1NTA3NjI2","avatar_url":"https://avatars1.githubusercontent.com/u/25507626?v=4","gravatar_id":"","url":"https://api.github.com/users/HippieStation","html_url":"https://github.com/HippieStation","followers_url":"https://api.github.com/users/HippieStation/followers","following_url":"https://api.github.com/users/HippieStation/following{/other_user}","gists_url":"https://api.github.com/users/HippieStation/gists{/gist_id}","starred_url":"https://api.github.com/users/HippieStation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HippieStation/subscriptions","organizations_url":"https://api.github.com/users/HippieStation/orgs","repos_url":"https://api.github.com/users/HippieStation/repos","events_url":"https://api.github.com/users/HippieStation/events{/privacy}","received_events_url":"https://api.github.com/users/HippieStation/received_events","type":"Organization","site_admin":false},"repo":{"id":84665083,"node_id":"MDEwOlJlcG9zaXRvcnk4NDY2NTA4Mw==","name":"HippieStation","full_name":"HippieStation/HippieStation","owner":{"login":"HippieStation","id":25507626,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1NTA3NjI2","avatar_url":"https://avatars1.githubusercontent.com/u/25507626?v=4","gravatar_id":"","url":"https://api.github.com/users/HippieStation","html_url":"https://github.com/HippieStation","followers_url":"https://api.github.com/users/HippieStation/followers","following_url":"https://api.github.com/users/HippieStation/following{/other_user}","gists_url":"https://api.github.com/users/HippieStation/gists{/gist_id}","starred_url":"https://api.github.com/users/HippieStation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HippieStation/subscriptions","organizations_url":"https://api.github.com/users/HippieStation/orgs","repos_url":"https://api.github.com/users/HippieStation/repos","events_url":"https://api.github.com/users/HippieStation/events{/privacy}","received_events_url":"https://api.github.com/users/HippieStation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/HippieStation/HippieStation","description":"The Hippie Station branch of SS13","fork":true,"url":"https://api.github.com/repos/HippieStation/HippieStation","forks_url":"https://api.github.com/repos/HippieStation/HippieStation/forks","keys_url":"https://api.github.com/repos/HippieStation/HippieStation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HippieStation/HippieStation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HippieStation/HippieStation/teams","hooks_url":"https://api.github.com/repos/HippieStation/HippieStation/hooks","issue_events_url":"https://api.github.com/repos/HippieStation/HippieStation/issues/events{/number}","events_url":"https://api.github.com/repos/HippieStation/HippieStation/events","assignees_url":"https://api.github.com/repos/HippieStation/HippieStation/assignees{/user}","branches_url":"https://api.github.com/repos/HippieStation/HippieStation/branches{/branch}","tags_url":"https://api.github.com/repos/HippieStation/HippieStation/tags","blobs_url":"https://api.github.com/repos/HippieStation/HippieStation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HippieStation/HippieStation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HippieStation/HippieStation/git/refs{/sha}","trees_url":"https://api.github.com/repos/HippieStation/HippieStation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HippieStation/HippieStation/statuses/{sha}","languages_url":"https://api.github.com/repos/HippieStation/HippieStation/languages","stargazers_url":"https://api.github.com/repos/HippieStation/HippieStation/stargazers","contributors_url":"https://api.github.com/repos/HippieStation/HippieStation/contributors","subscribers_url":"https://api.github.com/repos/HippieStation/HippieStation/subscribers","subscription_url":"https://api.github.com/repos/HippieStation/HippieStation/subscription","commits_url":"https://api.github.com/repos/HippieStation/HippieStation/commits{/sha}","git_commits_url":"https://api.github.com/repos/HippieStation/HippieStation/git/commits{/sha}","comments_url":"https://api.github.com/repos/HippieStation/HippieStation/comments{/number}","issue_comment_url":"https://api.github.com/repos/HippieStation/HippieStation/issues/comments{/number}","contents_url":"https://api.github.com/repos/HippieStation/HippieStation/contents/{+path}","compare_url":"https://api.github.com/repos/HippieStation/HippieStation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HippieStation/HippieStation/merges","archive_url":"https://api.github.com/repos/HippieStation/HippieStation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HippieStation/HippieStation/downloads","issues_url":"https://api.github.com/repos/HippieStation/HippieStation/issues{/number}","pulls_url":"https://api.github.com/repos/HippieStation/HippieStation/pulls{/number}","milestones_url":"https://api.github.com/repos/HippieStation/HippieStation/milestones{/number}","notifications_url":"https://api.github.com/repos/HippieStation/HippieStation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HippieStation/HippieStation/labels{/name}","releases_url":"https://api.github.com/repos/HippieStation/HippieStation/releases{/id}","deployments_url":"https://api.github.com/repos/HippieStation/HippieStation/deployments","created_at":"2017-03-11T16:47:28Z","updated_at":"2018-08-19T14:19:49Z","pushed_at":"2018-08-19T15:25:09Z","git_url":"git://github.com/HippieStation/HippieStation.git","ssh_url":"git@github.com:HippieStation/HippieStation.git","clone_url":"https://github.com/HippieStation/HippieStation.git","svn_url":"https://github.com/HippieStation/HippieStation","homepage":"https://hippiestation.com/","size":2205936,"stargazers_count":18,"watchers_count":18,"language":"DM","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":67,"mirror_url":null,"archived":false,"open_issues_count":101,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":67,"open_issues":101,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/HippieStation/HippieStation/pulls/8584"},"html":{"href":"https://github.com/HippieStation/HippieStation/pull/8584"},"issue":{"href":"https://api.github.com/repos/HippieStation/HippieStation/issues/8584"},"comments":{"href":"https://api.github.com/repos/HippieStation/HippieStation/issues/8584/comments"},"review_comments":{"href":"https://api.github.com/repos/HippieStation/HippieStation/pulls/8584/comments"},"review_comment":{"href":"https://api.github.com/repos/HippieStation/HippieStation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/HippieStation/HippieStation/pulls/8584/commits"},"statuses":{"href":"https://api.github.com/repos/HippieStation/HippieStation/statuses/9af93423ad43066498acee25d9b0d8a27a30ae30"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"JohnGinnane"}}