0
0

[Compiler BCB6]

Hi @ all,
in generel the most mp3 tags seems to: FMOD_TAGDATATYPE_STRING,FMOD_TAGDATATYPE_STRING_UTF16,FMOD_TAGDATATYPE_STRING_UTF8.

but i’m not realy sure of the correct conversion of these types to AnsiString.
an i need help with the other "open conversions", at his time only the datatype will be send back.

please heve look at my code … thanks for your help

[code:2madh2wp]
String GetTagString(void data,int length,FMOD_TAGDATATYPE datatype)
{
String TagString;
if (datatype == FMOD_TAGDATATYPE_INT)
TagString = "FMOD_TAGDATATYPE_INT";
else if (datatype == FMOD_TAGDATATYPE_FLOAT)
TagString = "FMOD_TAGDATATYPE_FLOAT";
else if (datatype == FMOD_TAGDATATYPE_STRING)
TagString = (char
)data;
else if (datatype == FMOD_TAGDATATYPE_STRING_UTF16)
TagString = (wchar_t)data+1;
else if (datatype == FMOD_TAGDATATYPE_STRING_UTF16BE)
TagString = "FMOD_TAGDATATYPE_STRING_UTF16BE";
else if (datatype == FMOD_TAGDATATYPE_STRING_UTF8)
{
TagString = (char
) data;
TagString = TagString.SubString(0,length);
}
else if (datatype == FMOD_TAGDATATYPE_CDTOC)
TagString = "FMOD_TAGDATATYPE_CDTOC";
return TagString;
}
[/code:2madh2wp]

  • You must to post comments
0
0

You can use MultiByteToWideChar to convert Ansi / Utf8 to WideChar;
You may convert WideChar to Ansi (if your programm requires Ansi – Windows 95, 98, ME) using WideCharToMultiByte.

For my experience, if datatype is FMOD_TAGDATATYPE_STRING and type is either
– FMOD_TAGTYPE_VORBISCOMMENT
– FMOD_TAGTYPE_ICECAST
– FMOD_TAGTYPE_ASF
I thread them as FMOD_TAGDATATYPE_STRING_UTF8 anyway (tags are disastrous).

For multi tag formats, do not rely on priorities – you may not overwrite any [previous found] FMOD_TAGTYPE_ID3V2 tags with FMOD_TAGTYPE_ID3V1 ones (assuming the ID3V2 tags are better; V1 tags have very limited maximum sizes).

For datatype FMOD_TAGDATATYPE_STRING_UTF16, you may check/strip the endian bytes if present ($ff + $fe). It’s also good practice to check datalen is even (if odd, decrease; nulltermination may be incorrect!)

Copy the tags without any nulltermination (use datalen!) to new memory and add nullbyte(s) manually (reserve size for this byte(s) in your memory)

My project supports only FMOD_TAGDATATYPE_STRING, FMOD_TAGDATATYPE_STRING_UTF16, FMOD_TAGDATATYPE_STRING_UTF8, so I cannot say anything about other formats/usage (For certain tags, I "convert" the string to [integer] number).

Also note that for internet streams, tags may change during stream (I’m not 100% sure and to lazy to test but I think fmodex supports this)

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.