• Welcome to Powerbasic Museum 2020-B.
 

News:

Forum in repository mode. No new members allowed.

Main Menu

Recent posts

#31
General Discussion / Re: mp3 duration
Last post by Juergen Kuehlwein - December 26, 2019, 06:35:21 PM
Finally i found what i need here (https://forum.powerbasic.com/forum/user-to-user-discussions/powerbasic-for-windows/775019-mp3-tagger-discussion , Bob Carvers code). It reads (at least i think it reads it) the correct duration, even if there are no ID3 tags.
#32
General Discussion / Re: mp3 duration
Last post by Juergen Kuehlwein - December 26, 2019, 05:28:02 PM
I know that the duration information displayed by Windows doesn´t come from ID3 tags, because, when i remove these tags (i verfied removal with a hex editor), the duration displayed stays the same. Mp3tag (a program for showing and editing id3 tags) shows the correct duration with and without tags in Windows 7 and 10. So there must be some other (working) method than Media foundation.
#33
General Discussion / Re: mp3 duration
Last post by Juergen Kuehlwein - December 26, 2019, 03:48:39 PM
In the meantime i found Jim Fritts´ PB source code (https://forum.powerbasic.com/forum/user-to-user-discussions/source-code/773139-media-foundation-player) and could adapt it to show the duration - tada, now it´s correct.

Unfortunately the Media Foundation API seems a rather complicated way of retrieving this little piece of data and it requires Windows 8 or higher - i was hoping for an easier solution.
#34
General Discussion / Re: mp3 duration
Last post by Juergen Kuehlwein - December 26, 2019, 12:17:33 PM
Patrice,

Merry Christmas to you as well!

Thanks for your reply. I read about IMediaSeeking being a better choice, but for me (Windows 10), it returns the same (wrong) result as IMediaPosition. Strange that this bug hasn´t be fixed as of now and that you must do it yourself as your link proposes.

I know and already used Bass.dll (a great piece of software btw.), but i wanted to be independent of third party software. And obviously Windows can do what i want.
#35
General Discussion / Re: mp3 duration
Last post by Patrice Terrier - December 26, 2019, 10:23:24 AM
IMediaSeeking::GetDuration
and read this
https://support.microsoft.com/fr-fr/help/2676617/fix-the-imediaseeking-getduration-method-returns-an-incorrect-playback

Better to use Bass.dll, or the Media Foundation API.
#36
General Discussion / mp3 duration
Last post by Juergen Kuehlwein - December 26, 2019, 09:54:26 AM
Hi José,

Merry Christmas!


Found some time to play with my music collection. For playing mp3 files i use directshow, which works quite well for all music formats (.mid, .wav, .mp3, ...) - except for one thing, duration. I can get the time an audio file is expected to play from IMediaPosition or IMediaSeeking but in both cases the returned time is wrong for mp3 files. Interestingly enough Windows shows the correct time. The tooltip when hovering or the details tab of file properties (right click -> properties -> details tab) show the correct time.

So Windows somehow knows (or calculates) it. But how? How does Windows do that, and how can i make use of it? I cannot find an appropriate API nor am i able to find some COM code doing it. I found one thing, which looks promising here (https://docs.microsoft.com/de-de/uwp/api/windows.storage.fileproperties.musicproperties). I cannot find IStorageItemExtraProperties and related classes or interfaces in your includes. The required information might not be found in musicproperties but maybe in some other file property around here - this is my best bet.

Do you know how to retrieve these properties in PB?


Thanks,


JK
#37
Windows API Headers / SECURITY_DESCRIPTOR_CONTROL
Last post by Pierre Bellisle - December 08, 2019, 06:48:17 PM
Hi José,

Not big deal...
The SECURITY_DESCRIPTOR_CONTROL macro is absent...
Like in PB, WinNT.inc : MACRO SECURITY_DESCRIPTOR_CONTROL=WORD


#38
Brians Board / Re: Any Good news regarding PB...
Last post by Christian Damhus - December 08, 2019, 01:23:40 PM
C / C++ is the way to go... The Drakes are a big disappointment imo. I wonder wether they put any effort in a new pb compiler. But even if, too many years have passed since the last version and I wonder the PB will be able to attrack new customers.

And for hobbyist: Delphi, CBuilder and Visual C, C# are free. There are enough options.

The enterprise I am working switched to Delphi. We never regretted it.

Lets face it: BASIC is dead.
#39
Brians Board / Re: Any Good news regarding PB...
Last post by Johan Klassen - December 05, 2019, 10:55:17 AM
Quote from: Anthon Com on December 05, 2019, 12:37:50 AM
Look at Freebasic,  which is already dead and so is QuickBasic64  and those other old basic languages are either dead or dying.
please don't state your opinion as a matter of fact, FreeBasic is actively being developed
#40
Brians Board / Re: Any Good news regarding PB...
Last post by Patrice Terrier - December 05, 2019, 09:26:15 AM
For SDK programmers the learning curve is not that long, tooks me 6 monthes to translate my GDImage DLL to plain C/C++.

But for DDTer's that is another problem and i understand the concern.

Anyway i will always prefer a compiler based on a pool of programmers rather than one based on the work of a few.