0
0

Hi,

I’ve had a good look through the forums (perhaps not well enough) and I can’t seem to find anything relating to this topic, so here goes…

Basically, my VB6 app looks at MP3 files in a specified directory, and then adds them to the MySQL database, if they don’t already exist.

Included in the MySQL table are columns such as duration.

As a test, I got it to add the data of about 20 MP3 files to the MySQL table. Whilst the majority of the data was correct, 4 particular MP3 files came up as having a duration of zero. This happened when I used the following lines of code:

[code:2bd1pduj]
streamHandle = FSOUND_Stream_Open(audiofilename, FSOUND_NORMAL, 0, 0)
duration = FSOUND_Stream_GetLengthMs(streamHandle)
[/code:2bd1pduj]

Now, all of these files are definately CBR, and not VBR, and they’re not corrupt in any way. However, to doubly make sure, I copied each waveform in Cool Edit, and pasted it into a new waveform at 44100hz 16-bit. They were then saved at 320kbps (I thought this may be the source of the problem, but then FMOD had detected the duration of 16 other mp3 files fine at this bitrate…).

[code:2bd1pduj]
streamHandle = FSOUND_Stream_Open(audiofilename, FSOUND_MPEGACCURATE, 0, 0)
duration = FSOUND_Stream_GetLengthMs(streamHandle)
[/code:2bd1pduj]

On use of the above, one of the four files showed the correct duration in the database (despite not being VBR, which I found odd). The other three still show as having a duration of zero.

I’ve checked my general coding, thinking it’s me being stupid and missing out something simple, but I just can’t see it. My only thought is that perhaps I should be using a different function in FMOD to get the duration of the MP3 file?

Apologies if all of the above is a bit vague, but any help or advice would be much appriciated!

Tim.

  • You must to post comments
0
0

Okay, in which case, answer my next question:

Why would it be null? It seems to be fine with most MP3’s.

Tim.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.