I have a problem with playing sounds.
The purpose is making a text to speech program that talks with my voice.
I recorded a lot of phonemes (.wav files with parts of speech) that need to play after each other in the right order. each sound must play ONLY if the previous sound finished playing. so if my program needs to say 'hello' then it does this:
**play("h.wav")
if "h.wav":isStopped() then:
play("e.wav")
if "e.wav":isStopped() then... etc ...**
For test purposes i want to play "a.wav" twice but the problem is that i only hear 'A' once... if i play e.g. 'A' and then 'B', it works fine..
Any help would be mush appreciated!
This is the test code i currently have:
function love.load()
voice = {"a","b","e","f", ......}
for i in pairs(voice) do
voice[i] = love.audio.newSource("VOICE/" .. voice[i] .. ".wav", "static")
end
end
function love.keypressed(key)
if key == "a" then
voice[1]:play()
while voice[1]:isPlaying() do end
voice[1]:play()
while voice[1]:isPlaying() do end
end
end
Aucun commentaire:
Enregistrer un commentaire