0
0

I found a bug concerning “long times”.

I load and play MP3 files with different
lengths:
a) 1 hour
b) 2 hours
c) 3 hours
d) 5 hours
e) 6 hours
f) 8 hours
g) 10 hours

Now I read the length by Sound::getLength():

(All numbers rounded here!!!)
a) 1 hour => 3,400,000 ms (approximately) [color=blue:1tgy2vu4]okay[/color:1tgy2vu4]
b) 2 hours => 7,200,000 ms (approximately) [color=blue:1tgy2vu4]okay[/color:1tgy2vu4]
c) 3 hours => 10,800,000 ms (approximately) [color=blue:1tgy2vu4]okay[/color:1tgy2vu4]
d) 5 hours => 19,000,000 ms (approximately) [color=blue:1tgy2vu4]okay[/color:1tgy2vu4]
e) 6 hours => 22,500,000 ms (approximately) [color=blue:1tgy2vu4]okay[/color:1tgy2vu4]
f) 8 hours => 4,000,000 ms (approximately) [color=red:1tgy2vu4]wrong[/color:1tgy2vu4]
[color=blue:1tgy2vu4]should be (approximately) 28,800,000 ms[/color:1tgy2vu4]
g) 10 hours => 12,000,000 ms (approximately) [color=red:1tgy2vu4]wrong[/color:1tgy2vu4]
[color=blue:1tgy2vu4]should be (approximately) 36,000,000 ms[/color:1tgy2vu4]

The Sound:getLength() method return the length with “uint”.
[b:1tgy2vu4]uint means 2^32 ms => (approximately) 1194 hours!!![/b:1tgy2vu4]

My environment:
Visual Studio 2005 Express,
.NET 2.0 with C#,
Windows XP PRO

  • You must to post comments
0
0

HI!
I’ve got a 7.5 hrs mp3, I tried to play it with FMOD, but it says the long is only 46 mins. I think uint should manage this size, so if someone has any idea, please tell us!
I have the same environment (XP Pro, VS 2005 Pro, C#)

  • You must to post comments
0
0

your 2^32 calculation is wrong, it is 2^32 divided by samples per second, for FMOD_TIMEUNIT_PCM, so if 44khz, that actually works out to 27 hours (4gig / 44100 / 60 / 60).
Besides this, i made a 10 hour mp3 and with FMOD_ACCURATETIME or without, it came out with the correct time.
You may have to link me to such an mp3 that you say doesnt work. I also tested with C++ not C#.

  • You must to post comments
0
0

HI! Could you post the system.createSound’s parameters, as you used?
Because I use this:
[code:2wbbvdjr]result = system.createSound(Filename_, (FMOD.MODE.SOFTWARE | FMOD.MODE.2D | FMOD.MODE.CREATESTREAM | FMOD.MODE.OPENONLY), ref sound);[/code:2wbbvdjr]
but it doesn’t work.
And I got the length this way:
private UInt32 LengthInSecs
;
{…}
[code:2wbbvdjr]result = sound.getLength(ref LengthInSecs_, FMOD.TIMEUNIT.MS);
ERRCHECK(result);
LengthInSecs_ = LengthInSecs_ / 1000;[/code:2wbbvdjr]

  • You must to post comments
0
0

I used pretty much the same flags, though i didnt use openonly, but that doesnt affect getlength. Can you link the file you used?

  • You must to post comments
0
0

Well, I download it from a torrent site, so i haven’t got a link. I can’t upload it anywhere, because my upload bandwidth is very low. WMP10 plays it well.

  • You must to post comments
0
0

I tryed to play it with the sample project (PlayStream) but it also said that the length is ~46 min

  • You must to post comments
0
0

Now I used FMOD.MODE.SOFTWARE | FMOD.MODE.OPENONLY | FMOD.MODE.ACCURATETIME flags, (or with HARDWARE) but the new time is 9306 secs (2:35:06) without ACCURATETIME it is still 2815 (00:46:55). Any idea?

  • You must to post comments
0
0

This isnt really helping without a file to test it on

  • You must to post comments
Showing 8 results
Your Answer

Please first to submit.