0
0

I’m trying to get the table of contents for a CD but whenever I call the function to retrieve the TOC I get all of the information except for the number of tracks. I get “TOC” as the name, and all of the offsets etc. But I dont get the number of tracks. here is my code:
[code:33tr93gs]
private Toc as FSOUND_TOC_TAG
Call FSOUND_Stream_FindTagField(strm, 0, "CD_TOC", TOCptr, 0)
Call CopyMemory(Toc, ByVal TOCptr, Len(Toc))
[/code:33tr93gs]
Does anyone know what the problem is?

  • You must to post comments
0
0

I looked at the C CDDA example but because VB doesnt have pointer support I have to use copymemory, which is the reason why its not being copied into the FSOUND_TOC_TAG structure properly. Does anyone know how to do this properly?

  • You must to post comments
0
0

I don’t use VB anymore but you can get a pointer by calling StrPtr, VarPtr or ObjPtr.

  • You must to post comments
0
0

Thats true, but when I use VarPtr FMOD doesnt even return any information, the pointer it returns is NULL.

  • You must to post comments
0
0

I just dont understand how to get the table of contents of a cd. I know Im doing something wrong. Does anybody know whats wrong with my code?

[code:a6am0ds0]
Public Function cddb_discid(ByVal strm As Long) As Long

Dim i As Long, t As Long, n As Long, TOCptr As Long
Dim TOC As FSOUND_TOC_TAG

Call FSOUND_Stream_FindTagField(strm, 0, "CD_TOC", TOCptr&, 0)
Call CopyMemory(TOC, ByVal TOCptr, Len(TOC))

For i = 0 To TOC.numtracks - 1
    n = n + cddb_sum((TOC.min(i) * 60) + TOC.sec(i))
Next i

t = ((TOC.min(TOC.numtracks) * 60) + TOC.sec(TOC.numtracks)) - ((TOC.min(0) * 60) + TOC.sec(0))

cddb_discid = LShift((n Mod 255), 24) Or LShift(t, 8) Or TOC.numtracks

End Function
[/code:a6am0ds0]
It isnt filling my struct with correct information. But it does give the tag name of “TOC”.

  • You must to post comments
0
0

Does anybody have an example of this?

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.