0
0

Hi i have some trouble, i want to show name of song i message box, but i dont know how can i do that. I use getTag, but this don’t work for me.
Can enyone help me??:)

Sry for Errors but i only study English :)

  • You must to post comments
0
0

when you use getTag, make sure you are not specifying FMOD_IGNORETAGS. Use FMOD_Sound_GetNumTags tags to get how many tags there are. and you use FMOD_Sound_GetTag for each tag you want. You need to search thru all the tags for the song title tags, or specify the tag by name. for example, you can search for a tag called TIT2, which is title for an mp3.

[code:10exeto9]FMOD_Sound_GetTag(fmodTmpSnd, "TIT2", -1, &fmodTag);[/code:10exeto9]

this will retrieve the title of an id3v2 tag of an mp3. "TITLE" will retrieve the title from a wma and ogg vorbis file.

If this doesnt help you, post some code of your tag retrieval and we can help you better.

  • You must to post comments
0
0

I have somethink like this , i new in fmod, and i dont understand this getTag.
Name of song is saved in tag.name??
In tag.name i have string "TITLE" only.

[code:324lv3ll]

include "fmod.h"

include "fmod.hpp"

include "iostream"

FMOD::System *sys;
FMOD::Sound *sound;
FMOD::Channel *cha = 0;
FMOD_TAG tag;
FMOD_RESULT result;
int a;
int music(){
FMOD::System_Create(&sys);
sys->init(1,FMOD_INIT_NORMAL,0);
sys->createSound("F:/Amour.mp3",FMOD_SOFTWARE,0,&sound);
sys->playSound(FMOD_CHANNEL_FREE,sound,false,&cha);
result=sound->getNumTags(&a,0);
if (result != FMOD_OK)
{
printf("FMOD error! (%d) %s\n", result);
exit(-1);
}

result=sound->getTag(NULL,-1,&tag);
if (result != FMOD_OK)
{
printf("FMOD error! (%d) %s\n", result);
exit(-1);
}[/code:324lv3ll]

  • You must to post comments
0
0

you wont find any tags with this
[code:2p3ihiwu]
result=sound->getTag(NULL,-1,&tag);
[/code:2p3ihiwu]

you need to specify either the name of the tag, like "TIT2" or "TITLE" depending on if it is an mp3 or wma.

Tag.name only returns the name of the tag frame, like "TITLE" or "ARTIST" it does not return whats in the tag. Tag.data contains the actuall data thats in the tag, like the name of the title. Tag.type tells you what kind of tag it is, like asf or id3. depending on the tag type, the tag frame name will be different. if tag type is id3, tag name for title is "TIT2".

[code:2p3ihiwu]
//try something like this
char* title;
sound->getTag(NULL, 0, &tag);

if (tag.type == FMOD_TAGTYPE_ID3V2)
{
sound->getTag("TIT2", 0, &tag);
title = (char)tag.data;
}
else
{
sound->getTag("TITLE", 0, &tag);
title = (char
)tag.data;
}
[/code:2p3ihiwu]

or something like that just to get you started

  • You must to post comments
0
0

:)

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.