Author Topic: Tags Library  (Read 63205 times)

EWeiss

  • Posts: 354
Re: NEW: Tags Library
« Reply #175 on: 25 Feb '15 - 17:04 »
Quote
@Emil I can supply a set of short Jingles in all the formats I support. Would that help?
i hope to.. Thank you

Quote
Note that it is recognised as an Mpeg file
No ;) that is why read of TMPEGAudioAttributes Fails.

Quote
the bitrate and the samplerate are wrong
same by me with atMPEG (think atMPEG and atAutomatic Fails with *.mpc)
 
@3delite please tell me to which block of AudioType is *.mpc(MusePack)
can't find also *.mpc and *.wv in documentation

Quote
Supported 'AudioTypes's:

atAutomatic: returns 'TAudioAttributes' structure (automatic source detection) in 'Attributes'
atFlac: returns a 'TFlacAudioAttributes' structure (Flac and Ogg Flac) in 'Attributes'
atMPEG: returns a 'TMPEGAudioAttributes' structure (.mp3, .mp2, .mp1, .mpa) in 'Attributes'
atDSDDSF: returns a 'TDSFAudioAttributes' structure (DSD .dsf) in 'Attributes'
atMP4: returns a 'TMP4AudioAttributes' structure (MP4 audio) in 'Attributes'
atOpus: returns a 'TOpusAudioAttributes' structure (Opus) in 'Attributes'
atVorbis: returns a 'TVorbisAudioAttributes' structure (Vorbis) in 'Attributes'
atWAV: returns a 'TWAVEAudioAttributes' structure (WAV and RF64) in 'Attributes'
atAIFF: returns a 'TAIFFAudioAttributes' structure (AIFF and AIFC) in 'Attributes'
atWMA: returns a 'TWMAAudioAttributes' structure (WMA) in 'Attributes'

greets
« Last Edit: 25 Feb '15 - 18:13 by EWeiss »

EWeiss

  • Posts: 354
Re: NEW: Tags Library
« Reply #176 on: 25 Feb '15 - 21:13 »
Flacs Attributes works
Mp4 Attributes works
Opus Attributes works

Ogg from https://dl.dropboxusercontent.com/s/40kjjhav55jcyk3/Files.zip?dl=1
all Attributes are 0
if this File (Ogg Flac) or (Ogg Vorbis) ?

i think Ogg Vorbis
how can get the Attributes then? if Vorbis.
i can not compare this self, should works with atFlac or?

greets
« Last Edit: 26 Feb '15 - 03:48 by EWeiss »

Steve Grant

  • Posts: 145
Re: NEW: Tags Library
« Reply #177 on: 25 Feb '15 - 22:20 »
Just so there is no confusion over different languages. Emil when I said that MusePack is reported by TagsLib.dll as Mpeg, you have replied no. Did you mean that I am wrong?

I have checked and checked and MusePack returns 4 when it should return 16. Here is my code for getting the Audio Format and my array to turn a number into a string.

Code: [Select]
Aformat = TagsLibrary_GetAudioFormat(StrPtr(FileName))
        AFMat = Array("Unknown", "APE", "Flac", "OggFlac", "MPEG", _
            "MP4", "Opus", "Vorbis", "Theora", "WAV", "RF64", "AIFF", "AIFC", "DFF", _
            "DSF", "OptimFrog", "MusePack", "WavPack")

The ogg file is Vorbis and I have no problems with it other than the format of the bitrate as previously reported. See the attached screenshot.

You should ignore the sample rate as I have it coded so that if TagsLib returns 0 then I substitute 44100.

Code: [Select]
.AUDIOGetSampleRate = IIf(TagAtts.SamplesPerSec > 0, TagAtts.SamplesPerSec, 44100) & " Hz"
« Last Edit: 25 Feb '15 - 22:23 by Steve Grant »

EWeiss

  • Posts: 354
Re: NEW: Tags Library
« Reply #178 on: 25 Feb '15 - 22:52 »
Quote
Emil when I said that MusePack is reported by TagsLib.dll as Mpeg, you have replied no. Did you mean that I am wrong?
do use CD2Track08.mpc (MusePack with atAutomatic) that will not work, so i think Extension *.mpc is not add to Parse Routine.
it's work with atMPEG.. not at all.

modeExtension out of range
BitRate not work.

also should compatibel to MPEG then is not add to the Parsing function.
test with Delphi_TagsLibraryTutorialDLL and VB_TagsLibraryTutorialDLL.
that is what i mean.

Quote
The ogg file is Vorbis and I have no problems with it other than the format of the bitrate as previously reported. See the attached screenshot.
with Flag atFlac ? think not.
atAutomatic.. Yes

see!
Quote
atFlac: returns a 'TFlacAudioAttributes' structure (Flac and Ogg Flac) in 'Attributes'
which type should also use for Ogg Vorbis ?
Extension of ogg = *.ogg tell me a user can now read ist this Flac or is this Vorbis.?

any wrong.. what should also set for *.ogg that the right Attributes are shown.

Quote
I have checked and checked and MusePack returns 4 when it should return 16. Here is my code for getting the Audio Format and my array to turn a number into a string.
i have not used
TagsLibrary_GetAudioFormat i will test it.
there is a error in the TagsLibrary you can not handle this self.
same problem by me test with Delphi_TagsLibraryTutorialDLL and VB_TagsLibraryTutorialDLL


Quote
You should ignore the sample rate as I have it coded so that if TagsLib returns 0 then I substitute 44100.
i have no files which Returns 0 for samplerate.

greets
« Last Edit: 25 Feb '15 - 23:26 by EWeiss »

Stephen Grant

  • Guest
Re: NEW: Tags Library
« Reply #179 on: 25 Feb '15 - 23:17 »
The ogg file is a standard Vorbis file created with oggenc2.exe v2.87 using aoTuVb6.03 2014. TagsLib correctly returns 7 (Vorbis) for this file. atFlac has no part in this format.

I am sorry but this reference of MPeg when talking about MusePack confuses me. I thought that MusePack was a format not tied to anything else, just like Vorbis. If I am wrong then I am sorry.

I think you may be wrong about MusePack not being added to the parse routine. Here is a snippet of my Init code:

Code: [Select]
Public Sub GetTags(FileName As String, Optional TagsFree As Boolean = False, Optional GetPic As Boolean = False)
    Dim TagAtts As TAudioAttributes, CoverArt As TCoverArtData, TagSize As Long
    Dim PictureFileName As String, Ext As String, Aformat As Long, AFMat()
    
    TagsLibrary_SetConfig 0, 1, TAGSLIBRARY_PARSE_WAVPACK_AUDIO_ATTRIBUTES, ttAutomatic
    TagsLibrary_SetConfig 0, 1, TAGSLIBRARY_PARSE_MUSEPACK_AUDIO_ATTRIBUTES, ttAutomatic

    If lngTags = 0 Then lngTags = TagsLibrary_Create
    TagsLibrary_Load lngTags, StrPtr(FileName), ttAutomatic, True
    TagsLibrary_GetAudioAttributes lngTags, atAutomatic, TagAtts

EWeiss

  • Posts: 354
Re: NEW: Tags Library
« Reply #180 on: 25 Feb '15 - 23:37 »
Quote
I am sorry but this reference of MPeg when talking about MusePack confuses me. I thought that MusePack was a format not tied to anything else, just like Vorbis. If I am wrong then I am sorry.
you are right please give @3delite time for fix this.

Quote
The ogg file is a standard Vorbis file created with oggenc2.exe v2.87 using aoTuVb6.03 2014. TagsLib correctly returns 7 (Vorbis) for this file. atFlac has no part in this format.
atFlac has a Format for *.ogg (Ogg Flac)

Quote
atFlac: returns a 'TFlacAudioAttributes' structure (Flac and Ogg Flac) in 'Attributes'
and that is my Problem ;)

Quote
I think you may be wrong about MusePack not being added to the parse routine. Here is a snippet of my Init code:
should work as other files do without SetConfig.
@3delite what is the Problem activate it separately over SetConfig ?

Quote
I think you may be wrong
No .. without SetConfig nothing is parsing (not active at runtime) that is what i mean :)

Quote
The Vorbis bitrate is returned as 132,000 instead of 132.
i think that is fixed after Change to Int64

Quote
FreeImage
if have time for it make inside my sample a function with GDI+ for extract the Image from Memory
i will get the IStream over CreateStreamOnHGlobal  
and write the Image_FromStream

Attach latest Tutorial for VB6

greets
« Last Edit: 1 Mar '15 - 06:45 by EWeiss »

EWeiss

  • Posts: 354
Re: NEW: Tags Library
« Reply #181 on: 26 Feb '15 - 04:38 »
i have create a test for Read Picture from Memory and works good.
that Problem is now i missing width and Height from GetCoverArt is always 0

@3delite
Please can you add this that width and Height is not 0 ?

if I know the with and height of the bitmap in the stream then it works.

is simple only for BMP yet.

Code: [Select]
       If Ext = ".bmp" Then
            Dim std As StdPicture
            If CreateBitmapObj(500, 459, 24, Tags.CoverArtData, std) Then
                Set Me.Image1 = std
                Image1.height = 1920
                Image1.width = 2640
                Me.Image1.Stretch = True
            End If
        End If

see pic

greets
« Last Edit: 27 Feb '15 - 02:24 by EWeiss »

3delite

  • Posts: 903
Re: NEW: Tags Library
« Reply #182 on: 26 Feb '15 - 04:59 »
Worked all night on this .mpc identified as MPEG, and now it's possible to identify it as a MusePack, it's an SV8 version which was not supported, but couldn't make a code to read the sample count, which is encoded as a 'nut encoded' value. No idea right now how to decode that. So only the sample rate and channels are available.

Didn't have time for the other issues, I check them tomorrow...

Here's the state: TagsLib.zip

EWeiss

  • Posts: 354
Re: NEW: Tags Library
« Reply #183 on: 26 Feb '15 - 05:45 »
Worked all night on this .mpc identified as MPEG, and now it's possible to identify it as a MusePack, it's an SV8 version which was not supported, but couldn't make a code to read the sample count, which is encoded as a 'nut encoded' value. No idea right now how to decode that. So only the sample rate and channels are available.

Didn't have time for the other issues, I check them tomorrow...

Here's the state: TagsLib.zip

Works.. Thank you

greets

3delite

  • Posts: 903
Re: NEW: Tags Library
« Reply #184 on: 26 Feb '15 - 05:53 »
Ok, managed to make it work! :)

Please try this update, it should read the audio attributes for MusePack SV8 files too: TagsLib.zip

EWeiss

  • Posts: 354
Re: NEW: Tags Library
« Reply #185 on: 26 Feb '15 - 06:02 »
Ok, managed to make it work! :)

Please try this update, it should read the audio attributes for MusePack SV8 files too: TagsLib.zip

sorry i have no file for MusePack SV8 so can not test it
you has one ?

greets

Steve Grant

  • Posts: 145
Re: NEW: Tags Library
« Reply #186 on: 26 Feb '15 - 08:52 »
The files in the zip you downloaded yesterday have a MPC SV8. SV8 is nothing special, it is the 'current' standard for MusePack.
 

EWeiss

  • Posts: 354
Re: NEW: Tags Library
« Reply #187 on: 26 Feb '15 - 17:26 »
The files in the zip you downloaded yesterday have a MPC SV8. SV8 is nothing special, it is the 'current' standard for MusePack.
 

ok.. then you can test it self.
and give a Feedback is working or not.
with latest *.dll

greets

Steve Grant

  • Posts: 145
Re: NEW: Tags Library
« Reply #188 on: 26 Feb '15 - 21:45 »
I have fully tested MPC (SV8).

All the tags now show in Mp3Tag, dbPA & FB2K as well as being read by TagsLib.  Tagslib correctly reports MusePack as the Audio Format.

I will mention one thing, simply so that you know. I initially found that the Image in the MusePack file was being reported as a BMP and when I tried to load the BMP into my Image Control the programme crashed. Mp3Tag, dbPA & FB2K all reported the image as JPG. I then found the wav file that I had converted to Musepack also had the same problem. I seem to remember converting to the wav file from my WavPack master in dbPA and perhaps this is the problem. Anyway I converted all the files from within my own programme and they are all ok.

When I have time I will check further. As the 3 progs mentioned above all loaded the file ok, I wonder if there is anyway to make the Image Format checking more robust?

Ogg Vorbis is also now ok.

I am getting good Sample Counts on the files I have tested (not all). I have had one occurrence of the 'Out of memory' error and this was while I was trying to track down the problem above. So TagsLib was not being freed correctly.

3delite & @Emil, I can see no reason for the compiler options to be left in the TagsLib VB wrapper. If you both agree, I will remove them.

EWeiss

  • Posts: 354
Re: NEW: Tags Library
« Reply #189 on: 27 Feb '15 - 01:19 »
Quote
3delite & @Emil, I can see no reason for the compiler options to be left in the TagsLib VB wrapper. If you both agree, I will remove them.

which Compiler Options ?
your mean..

Code: [Select]
#If False Then
Dim aaChannels, aaSamplesPerSec, aaBitsPerSample, aaPlayTime, aaSampleCount, aaBitRate
#End If

if so ?
i think yes that can all be removed
after fixed the Bytes for enums and type records

greets

3delite

  • Posts: 903
Re: NEW: Tags Library
« Reply #190 on: 27 Feb '15 - 01:49 »
Quote
Please can you add this that width and Height is not 0 ?

Sorry but no, the cover art data needs to be processed by other means. I suggest FreeImage Library. If the VB header is buggy, please make a custom one, really it would need at max. a dozen functions, probably much less, and really no need for any structures as far as I see. So it would be quite simple and straightforward.

Quote
atFlac: returns a 'TFlacAudioAttributes' structure (Flac and Ogg Flac) in 'Attributes'
and that is my Problem

Sorry don't get this, what is the concrete problem?

Quote
I think you may be wrong about MusePack not being added to the parse routine. Here is a snippet of my Init code:
should work as other files do without SetConfig.
@3delite what is the Problem activate it separately over SetConfig ?

WavPack and MusePack audio attribute parsing is off by default. It slows down loading as it tries to load every file (non-WacPack/MusePack files too). Really if you need audio attributes parsing then you can turn on - people who need only the tags for them it's not needed.

Sorry guys, could you please now post one post with the problems remaining so far?

Thank you!

EWeiss

  • Posts: 354
Re: NEW: Tags Library
« Reply #191 on: 27 Feb '15 - 02:22 »
Quote
Sorry but no, the cover art data needs to be processed by other means. I suggest FreeImage Library. If the VB header is buggy, please make a custom one, really it would need at max. a dozen functions, probably much less, and really no need for any structures as far as I see. So it would be quite simple and straightforward.

do Forget FreeImage :)
no understand the record of

Code: [Select]
Public Type TCoverArtData
    Name              As Long               '* LPWSTRtoBSTR(Name)
    Data              As Long               '* VarPtr(Data)
    DataSize          As Int64              '* DataSize.LowPart
    Description       As Long               '* LPWSTRtoBSTR(Description)
    CoverType         As Long
    MIMEType          As Long               '* LPWSTRtoBSTR(MIMEType)
    PictureFormat     As TTagPictureFormat
    width             As Long
    height            As Long
    ColorDepth        As Long
    NoOfColors        As Long
    ID3v2TextEncoding As Long
    index             As Long
End Type

your add With and Height for nothing? should then removed my opinion
ok not my problem ;)

Quote
Sorry don't get this, what is the concrete Problem

Forget it :)

Quote
WavPack and MusePack audio attribute parsing is off by default. It slows down loading as it tries to load every file (non-WacPack/MusePack files too). Really if you need audio attributes parsing then you can turn on - people who need only the tags for them it's not needed.
should be ok..

so i think finish then with Tags Library for VB
back to my own work :)

greets

3delite

  • Posts: 903
Re: NEW: Tags Library
« Reply #192 on: 27 Feb '15 - 02:25 »
Quote
your add With and Height for nothing? should then removed my opinion

It is reported from Flac cover art tags, Opus and Vorbis only.

Ok, thank you for all your help on improving the library! I could not achieve a VB header on my own. Thank you!
« Last Edit: 27 Feb '15 - 02:31 by 3delite »

EWeiss

  • Posts: 354
Re: NEW: Tags Library
« Reply #193 on: 27 Feb '15 - 22:12 »
Supplement :)

add Information for Data Type which to be converted.

Code: [Select]
Public Type TMP4TagEx
    Name      As Long                       '* LPWSTRtoBSTR(Name)
    Value     As Long                       '* LPWSTRtoBSTR(Value)
    ValueSize As Long
    NameValue As Long                       '* LPWSTRtoBSTR(NameValue)
    MeanValue As Long                       '* LPWSTRtoBSTR(MeanValue)
    TagType   As TMP4TagType
    DataType  As Long
    index     As Long
End Type

Public Type TCoverArtData
    Name              As Long               '* LPWSTRtoBSTR(Name)
    Data              As Long               '* VarPtr(Data)
    DataSize          As Int64              '* DataSize.LowPart
    Description       As Long               '* LPWSTRtoBSTR(Description)
    CoverType         As Long
    MIMEType          As Long               '* LPWSTRtoBSTR(MIMEType)
    PictureFormat     As TTagPictureFormat
    width             As Long
    height            As Long
    ColorDepth        As Long
    NoOfColors        As Long
    ID3v2TextEncoding As Long
    index             As Long
End Type

greets
« Last Edit: 1 Mar '15 - 11:50 by EWeiss »

3delite

  • Posts: 903
Re: NEW: Tags Library
« Reply #194 on: 27 Feb '15 - 22:50 »
Ok, thank you!

The package has been updated, download link in the first post:

  • Added audio attribute parsing for MusePack, and WavPack files
  • Fixed deleting tags for MP4 '----' atom tags
  • Improvements to the VB header

EWeiss

  • Posts: 354
Re: NEW: Tags Library
« Reply #195 on: 1 Mar '15 - 00:38 »
@Steve Grant

i have create a working Version for VB which get CoverArt from Memory using GDI+
works with all Data Types of Pictures to gif,bmp,jpg,png 9K for the Class and 15k for IStream.tlb

using 24k instead of FreeImage Library (4 MB which is bad, sorry)
all Data Types of Pictures will be convert then to StdPicture.

that is all..

Code: [Select]
If Tags.CoverArtData <> 0 Then

    Set PicFromMem = New clsPicFromMem

    hBitmap = PicFromMem.MemToHBitmap(Tags.CoverArtData, Tags.CoverArtDataSize.LowPart)
    
    Image1.Picture = PicFromMem.HBitmapToStdPicture(hBitmap, vbPicTypeBitmap)
    
    Image1.width = 2640
    Image1.height = 1920
    Image1.Stretch = True
End If

Attach working Version for CoverArt

greets
« Last Edit: 8 Mar '15 - 08:30 by EWeiss »

Steve Grant

  • Posts: 145
Re: NEW: Tags Library
« Reply #196 on: 1 Mar '15 - 10:13 »
@EWeiss that is superb thank you!!!

greets

EWeiss

  • Posts: 354
Re: NEW: Tags Library
« Reply #197 on: 1 Mar '15 - 10:25 »
@EWeiss that is superb thank you!!!

greets

i hope it work with Image for you
StretchBlt is not the best way for resize Bitmap to.

greets
« Last Edit: 1 Mar '15 - 10:43 by EWeiss »

Steve Grant

  • Posts: 145
Re: NEW: Tags Library
« Reply #198 on: 1 Mar '15 - 10:29 »
It works really well. I have not used a tlb before.

One question when I package my programme for deployment, will the tlb be put into the exe? or do I need to ship it separately? If the latter, will it need to be registered?

greets

EWeiss

  • Posts: 354
Re: NEW: Tags Library
« Reply #199 on: 1 Mar '15 - 10:32 »
It works really well. I have not used a tlb before.

One question when I package my programme for deployment, will the tlb be put into the exe? or do I need to ship it separately? If the latter, will it need to be registered?

greets

copy the file with your Installer to WinSysdir.. (or AppDir)
should be Registered from your Installer where copy the file to
i'm use Setup Factory 8.0

greets
« Last Edit: 3 Mar '15 - 10:23 by EWeiss »