0
0

Hi !

I’m a beginner with fmod library…
I made a delphi program which can open a SHOUTCAST stream and it works.

But I have some problem with GetTagField to get some information about the stream I play.
I ‘m not familiar with pointers in delphi so I don’t understand how to use this function:

F_API FSOUND_Stream_GetTagField(
FSOUND_STREAM *stream,
int num,
int *type,
char **name,
void **value,
int *length
);

Has someone any example for me ? 😥

Thanks

  • You must to post comments
0
0

this probbaly isnt the neatest or best code in the world but it works:[code:1faxqv4a]FSOUND_Stream_GetNumTagFields(fmodhan,n);
arn:='<none>’;
aln:='<none>’;
genn:='<none>’;
tn:=0;
yr:=0;
l:=0;
if n<>0 then begin
for i:= 0 to n -1 do begin
FSound_stream_gettagfield(fmodhan,i,tagtype,name,val,l);
case ansiindextext(name,[’artist’,’genre’,’album’,’title’,’tracknumber’,’AUTHOR’,’WM/Genre’,’WM/AlbumTitle’,’WM/TrackNumber’,’WM/Year’]) of
0,5:arn:=pchar(val);
1,6:genn:=pchar(val);
2,7:aln:=pchar(val);
3:nm:=pchar(val);
4:tn:=strtointdef(pchar(val),0);
8:tn:=pinteger(val)^;
9:yr:=strtointdef(pchar(val),0);
end;
end;
end;[/code:1faxqv4a]
where “fmodhan” is the handle to the stream you want to get tags from, pinteger is a pointer to an integer declared like this:[code:1faxqv4a]type pinteger=^integer;[/code:1faxqv4a] you will need to declare the following variables as well:
[code:1faxqv4a]var fmodhan:pointer;
i,n,l,tn,yr:integer;
TagType:TFSoundTagFieldType;
name:pchar;
val:pointer;
aln,arn,nm,genn:string;
[/code:1faxqv4a]

  • You must to post comments
0
0

It works !!! Thanxx !

😀

  • You must to post comments
0
0

It’s true it works with ID3V1 tags but not with ID3V2 tags : there is nothing written in the name field when I try to get the title of the stream….
How can it be fixed ?

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.