testing with voices!
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"total_pages": 500,
|
"current_page":0,
|
||||||
"current_page": 0
|
"total_pages":500
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
[
|
||||||
|
"Albert",
|
||||||
|
"Bad News",
|
||||||
|
"Bahh",
|
||||||
|
"Boing",
|
||||||
|
"Cellos",
|
||||||
|
"Daniel",
|
||||||
|
"Wobble",
|
||||||
|
"Eddy",
|
||||||
|
"Ellen",
|
||||||
|
"Flo",
|
||||||
|
"Fred",
|
||||||
|
"Good News",
|
||||||
|
"Grandma",
|
||||||
|
"Junior",
|
||||||
|
"Karen",
|
||||||
|
"Kathy",
|
||||||
|
"Moira",
|
||||||
|
"Organ",
|
||||||
|
"Superstar",
|
||||||
|
"Ralph",
|
||||||
|
"Reed",
|
||||||
|
"Rishi",
|
||||||
|
"Rocko",
|
||||||
|
"Samantha",
|
||||||
|
"Sandy",
|
||||||
|
"Shelley",
|
||||||
|
"Tara",
|
||||||
|
"Tessa",
|
||||||
|
"Trinoids",
|
||||||
|
"Whisper",
|
||||||
|
"Yelda",
|
||||||
|
"Zarvox"
|
||||||
|
]
|
||||||
+50
-2
@@ -1,5 +1,6 @@
|
|||||||
local window_width, window_height = love.graphics.getDimensions()
|
local window_width, window_height = love.graphics.getDimensions()
|
||||||
|
|
||||||
|
-- local filament = require "lib.filament"
|
||||||
local log = require "lib.log"
|
local log = require "lib.log"
|
||||||
local lovebird = require "lib.lovebird"
|
local lovebird = require "lib.lovebird"
|
||||||
local progress_bar = require "lib.progress_bar"
|
local progress_bar = require "lib.progress_bar"
|
||||||
@@ -9,13 +10,54 @@ local utility = require "lib.utility"
|
|||||||
lovebird.whitelist[#lovebird.whitelist + 1] = "192.168.*.*" -- LAN access
|
lovebird.whitelist[#lovebird.whitelist + 1] = "192.168.*.*" -- LAN access
|
||||||
|
|
||||||
log{
|
log{
|
||||||
testing = true,
|
debug = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
local constants = require "data.constants"
|
local constants = require "data.constants"
|
||||||
local classes, class_names = require "data.classes"
|
local classes, class_names = require "data.classes"
|
||||||
local races, race_names = require "data.races"
|
local races, race_names = require "data.races"
|
||||||
|
|
||||||
|
local voices = utility.load_data("macos_say-en.json")
|
||||||
|
local voice_int = 0
|
||||||
|
local send_test_message = function()
|
||||||
|
-- local selected_voice = voices[math.random(1, #voices)]
|
||||||
|
voice_int = voice_int + 1
|
||||||
|
if voice_int > #voices then voice_int = 1 end
|
||||||
|
local selected_voice = voices[voice_int]
|
||||||
|
|
||||||
|
local test_channel = love.thread.getChannel("say")
|
||||||
|
local line = "Hello, my name is " .. selected_voice .. "."
|
||||||
|
test_channel:push({
|
||||||
|
voice = selected_voice:enquote(),
|
||||||
|
line = line:enquote(),
|
||||||
|
})
|
||||||
|
log("debug", selected_voice, line)
|
||||||
|
end
|
||||||
|
send_test_message()
|
||||||
|
|
||||||
|
-- filament.run(function()
|
||||||
|
-- local line = "Hello, my name is " .. selected_voice .. "."
|
||||||
|
-- os.execute("say -v " .. selected_voice:enquote() .. " " .. line:enquote())
|
||||||
|
-- end)
|
||||||
|
-- local test_thread = love.thread.newThread([[
|
||||||
|
-- -- local utility = require "lib.utility"
|
||||||
|
-- -- local voices = utility.load_data("macos_say-en.json")
|
||||||
|
-- -- local selected_voice = voices[math.random(1, #voices)]
|
||||||
|
-- local selected_voice = "Bells"
|
||||||
|
-- local line = "Hello, my name is " .. selected_voice .. "."
|
||||||
|
-- os.execute("say -v \"" .. selected_voice .. "\" \"" .. line .. "\"")
|
||||||
|
-- ]])
|
||||||
|
local test_thread = love.thread.newThread([[
|
||||||
|
local channel = love.thread.getChannel("say")
|
||||||
|
while true do
|
||||||
|
local message = channel:demand()
|
||||||
|
if message then
|
||||||
|
os.execute("say -v " .. message.voice .. " " .. message.line)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
]])
|
||||||
|
test_thread:start()
|
||||||
|
|
||||||
local new_character = function(name)
|
local new_character = function(name)
|
||||||
local base_stat_roll = function()
|
local base_stat_roll = function()
|
||||||
return 3 + math.random(1, 6) + math.random(1, 6) + math.random(1, 6)
|
return 3 + math.random(1, 6) + math.random(1, 6) + math.random(1, 6)
|
||||||
@@ -74,7 +116,7 @@ local test_bar = progress_bar(0, window_height - constants.progress_bar_height *
|
|||||||
local test_message = "This is a test text string of significant length. It exists to test printing over a progress bar."
|
local test_message = "This is a test text string of significant length. It exists to test printing over a progress bar."
|
||||||
test_bar:set_text(test_message)
|
test_bar:set_text(test_message)
|
||||||
|
|
||||||
local test_timer = timer.every(#test_message * constants.reading_time_multiplier, function() log("testing", "The timer completed.") end) -- TODO consider making timer not need a function; cause I don't here!
|
local test_timer = timer.every(#test_message * constants.reading_time_multiplier, function() log("debug", "The timer completed.") end) -- TODO consider making timer not need a function; cause I don't here!
|
||||||
|
|
||||||
local task_queue
|
local task_queue
|
||||||
task_queue = {
|
task_queue = {
|
||||||
@@ -99,6 +141,10 @@ love.update = function(dt)
|
|||||||
timer.update(dt)
|
timer.update(dt)
|
||||||
|
|
||||||
test_bar:set_progress(test_timer.run_time / test_timer:get_interval())
|
test_bar:set_progress(test_timer.run_time / test_timer:get_interval())
|
||||||
|
local thread_error = test_thread:getError()
|
||||||
|
if thread_error then
|
||||||
|
log("debug", thread_error)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
love.draw = function()
|
love.draw = function()
|
||||||
@@ -116,5 +162,7 @@ love.keypressed = function(key)
|
|||||||
update_book_progress(-1)
|
update_book_progress(-1)
|
||||||
elseif key == "right" then
|
elseif key == "right" then
|
||||||
update_book_progress(1)
|
update_book_progress(1)
|
||||||
|
elseif key == "v" then
|
||||||
|
send_test_message()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user