0
0

First off I want to say, “Wow”. I accidentally stumbled on this link just an hour ago when I went to look up some info on ogg files. I haven’t really done much at all with it yet beyond simple opening a file test but the pure fact that something like this exists for VB is absolutely amazing. Where have y’all been hiding all this time? And the wealth of functions… wow.

Now that I’m done fawning, I’d like to ask about a problem in reporting milliseconds length of a short clip. This is just something I put together to see if it would even work (FMOD, that is):

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
dim lStream as long

Call FSOUND_Init(44100, 32, 0)

sFile = returnFileName(“wav”, False, holdIndex, “wav”) ‘ Homebrew function – just returns a file name based on any extensions I pass it.

If sFile <> “” Then lStream = FSOUND_Stream_OpenFile(sFile, FSOUND_MPEGACCURATE, 0)

debug.print FSOUND_Stream_GetLengthMs(lstream)

Call FSOUND_Stream_Close(lStream)

FSOUND_Close
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

The time is reported as ‘21455’. CoolEdit Pro reports the time as ‘46796’ – correctly since I ripped it from an AVI. Here’s a little info on the file:

Microsoft ACM MPEG Layer-3
44100 HZ, 16 bit, stereo
0:46.796

I ripped another wav from that AVI file and changed how it was saved and FMOD reports that time correctly. It is:

Windows PCM
22050 HZ, 8-bit Mono
0:46.785

Am I doing something wrong? Like I said, I just barely found this place and tried this out. I’m using a 3rd party activex component in this project of mine but since my project is freeware and something I’m doing in my free time, I don’t want to spend the $500 to register that component. Plus, just browsing the docs for FMOD makes me all excited over the control I could get from using this. To move away from that activex object and have more control over the audio code for my project? I’m excited over the prospect. I can’t express enough thanks for this being available (and supported) in VB.

Now all I have to do is look to start graphing the waveform of whatever audio and I’ll be set for the neat stuff. ^_^

  • You must to post comments
0
0

In order for FMOD to accurately give the time in MS you need to use the MPEG_ACCURATE flag, but this flag is really CPU intensive I think, it will slow down the OpenFile function of FMOD, but it’s the only way, through fmod, to get accurate readings.

  • You must to post comments
0
0

Right, but if you look at my example you’ll see that’s what I used. The difference between using it and not was only a few milliseconds.

If any mods care to try the clip:

http://www.seijin.net/Storage/Test/test.wav

  • You must to post comments
0
0

Oh, I hadn’t noticed that you used it! :) Hmm, thats strange, I downloaded the test.wav file and it reported 00:48.86. If it keeps giving the wrong readings you should contact Brett.

  • You must to post comments
0
0

I tried it a couple times again and it’s still reporting it wrong. Do you mind sharing the code snippet you used to get the milliseconds? Maybe I’m doing something wrong with what I posted two messages ago.

  • You must to post comments
0
0

I just downloaded it and I got 46 seconds also.
Maybe you could try adding FSOUND_2D or FSOUND_HW2D flag?

FSOUND_Stream_OpenFile(sFile, FSOUND_2D Or FSOUND_MPEGACCURATE, 0)

It should even give the correct time withouth FSOUND_MPEGACCURATE.

  • You must to post comments
0
0

Well, here’s another part to it. For my first post, I was using the DLL from the download page on fmod.org. I get the 2500 ms reporting from that. Then earlier today, I read in the general forum about someone having problems with an mp3 file and Brett gave him a link to a newer dll. I downloaded that and tried my example again.

However, now I’m getting 46811 (with mpeg_accurate or sound_2d), which is still off from CoolEdit Pro’s 46796. 46796 is also what Microsoft Sound Recorder is reporting (well, 46.79). So there’s still a difference and since I’m seeing 46.79 from two separate programs, I’m inclined to go with the majority. The program I’m thinking of dropping FMOD into is a timing program that has to have absolutely accurate time reporting on audio files or it is fairly useless.

I emailed Brett with a good solid description of the problem I’m having so hopefully he can tell me what’s happening.

As a side note – Adion, I posted a reply to the waveform question in VB and you seemed to be knowledgeable on that subject. When you have time, could you check my post on that topic and see if you can help me? That’s the second most important thing I need out of FMOD.

Thanks for the post!

  • You must to post comments
0
0

^_^ I’m happy to know that the developer is very much on the ball with this. It works fine now, thank you very much. And I’ll look into switching over to Sound Forge if you think it’s a bit more reliable than Cool Edit. To be sure, it looks a lot nicer.

I’m much obliged for your extremely quick response.

  • You must to post comments
Showing 7 results
Your Answer

Please first to submit.