mIRC Homepage
Posted By: klez $sound().length and $insong.length bug - 09/03/17 12:26 PM
Hi! I've found an bug on mp3's length return values. I don't know why, but on some songs (not all) the $sound().length and $insong.length return different values.

For example, i have a song located at: C:\Users\User\Music\2pac ft. Outlawz - Scars.mp3

When i type:

echo -a $sound("C:\Users\User\Music\2pac ft. Outlawz - Scars.mp3").length it returns: 285649 (i.e. 4 minutes 45 seconds)

When i type: /splay "C:\Users\User\Music\2pac ft. Outlawz - Scars.mp3" and when playing i execute /echo -a $insong.length ir returns: 1142649 (i.e. 19 minutes 20 seconds).

When i open this mp3 in Aimp or Winamp or something else it returns correct value: 4 minutes 45/46 seconds

So, the problem is in $insong.length as i guess. I match this problem on some mp3's, but in else both identifiers return correct values.

If Khaled wants to see this mp3, i can give a link for download this mp3, as example.

P.S. Tested on mIRC 7.47, without any scripts (clean mIRC).
Posted By: Khaled Re: $sound().length and $insong.length bug - 09/03/17 12:59 PM
Thanks for your bug report. This issue is reported every so often. Unfortunately, the situation has not changed (see other thread). Windows has not updated its MCI sound support to handle VBR files, so there is little mIRC can do about it.

One possible option might be to switch from using MCI to DirectShow (which should hopefully handle VBR), however that would require a hefty rewrite of the sound playing routines/events.
Posted By: Khaled Re: $sound().length and $insong.length bug - 26/03/17 09:42 PM
I have implemented support for DirectSound in the latest beta, which, I am hoping, resolves the issue with VBR MP3s. Could you let me know if $insong works any better with the latest beta? The new sound routines also affect all sound-related features in mIRC, including /splay and so on. If you could test this with a variety of MP3, wave, mid, etc. files that would be appreciated.
Posted By: klez Re: $sound().length and $insong.length bug - 27/03/17 06:08 AM
I've tested with the same song that is mentioned in my post and now it's showing the real time, both $insong and $sound

echo -a $sound("C:\Users\User\Music\2pac ft. Outlawz - Scars.mp3").length returns 285649

and i put it to play through /splay:

echo -a $insong.lenght returns 285648

So, the difference is in 1, that is not so important, but both identifiers return true values.

I'll test further with other audio files and i'll post if i find any difference.

P.S. I want to mention that the song above is VBR file that is showing in another audio players and in Adobe Audition CC also, but when i issue in mIRC:

echo -a $sound("C:\Users\User\Music\2pac ft. Outlawz - Scars.mp3").vbr returns $false

Other data like bitrate, sample etc. return correct values.
Posted By: Khaled Re: $sound().length and $insong.length bug - 27/03/17 05:01 PM
Thanks, the .vbr property has been fixed for the next beta.
© mIRC Discussion Forums