I’m working on a digital book and would like to have audio available for a “read it to me” option. Additionally, the user should be able to click on any word and have just that word read to them. My thought was to have a single audio track per page and to use audio.seek() to go directly to that portion of the track where the specific word is. The problem I’m having is that audio.seek() is always returning false for me and therefore is not moving to the correct point in the audio, but rather is simply playing the first X ms of audio no matter what.
Here’s my test code. The audio track is about 5 seconds long. I would expect that this would play one second of audio starting 1 second into the track. It plays the 1 second, but it always starts from the beginning.
audioHandle = audio.loadSound("audio/test.mp3")
local mychannel = audio.play(audioHandle, {channel = 2, duration = 1000})
local seekResult = audio.seek(1000, {channel = mychannel})
print ("seek result: ")
print (seekResult)
I’ve tried pausing then seeking then resuming, but it doesn’t change the end result that seekResult is always false, and the audio always plays from the beginning.
Any help in understanding what I’m doing wrong and how to correct it is greatly appreciated.
Thanks,
-Glen [import]uid: 46321 topic_id: 12504 reply_id: 312504[/import]