Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ingsaurabh
Level 7

Roku Audio wrong duration

I am playing audio(mp3), but the duration some wrong value, which is 1.844674407371e+16, I tried playing video but its working fine

I searched forums for the same, found two users having the same problem, but their problem fixed automatically

https://community.roku.com/t5/Roku-Developer-Program/wrong-remaining-time-on-player-progress-bar/m-p... 

 

https://community.roku.com/t5/Roku-Developer-Program/Dash-format-videos-not-properly-grabbing-durati... 

 

What more strange is problem happening on specific device Roku 3900X model, Software Version 9.2.0 build 4131-51 but not happening on other Roku 3600x model, Software Version 9.2.0 build 4131-24

0 Kudos
1 Reply
norcaljb
Level 7

Re: Roku Audio wrong duration

This is totally bizarre as I just revisited some old audio player templates I created and got the same duration as fore mentioned. What I did notice is that if you re-select the same audio file it will give you the correct audio duration. 

Assuming this is a bug that has to do with 

[beacon.signal] |VODStartComplete ----------> Duration

firing off after the duration was printed or set and I would get the error.

I was able to bypass it with conditional statements that print and set the duration after

[beacon.signal] |VODStartComplete ----------> Duration

and that worked.

Here is what I did.

First, right after calling the play function

m.audio.control = "play"
m.seek = 0    '<added

then by observing the audio state I wrote my conditional statements there,.

if (m.audio.state = "playing")
if m.seek = 0
m.audio.seek = 0
m.seek = 1
else if m.seek = 1 then
print "audio duration = " m.audio.duration
end if

I hope that helps someone else who had this happen to them or until Roku fixes this bug.

0 Kudos