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)
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
I ripped another wav from that AVI file and changed how it was saved and FMOD reports that time correctly. It is:
22050 HZ, 8-bit Mono
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. ^_^
- Xombie asked 15 years ago
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!
^_^ 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.
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.
Please login first to submit.