Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Playing music in FB
#11
[note]For Input does not erase file contents. For Output does. For Append does the same thing For Output does except erase file contents.[/note]

Now I'm just going to give a little explainy on binary. Background knowlege is always helpful. So correct me if I'm wrong on anything here:

1byte = 8bits
A bit, sort for binary digit, is a 1 or a 0.

There are 256 ASCII values (0 - 255). In Hex that is (&h00 - &hFF). Since it is soooo easy to convert hex and binary thats what ASCII values do.

Each Hex digit is four binary digits long, so 2 hex digits is 8 bits long so each ASCII caracter is 1 byte long.

Hex|---|Binary
&h0|-|0000
&h1|-|0001
&h2|-|0010
&h3|-|0011
&h4|-|0100
&h5|-|0101
&h6|-|0110
&h7|-|0111
&h8|-|1000
&h9|-|1001
&hA|-|1010
&hB|-|1011
&hC|-|1100
&hD|-|1101
&hE|-|1110
&hF|-|1111

To get a byte value from a character like 'a' you do:
1. Convert to the ASCII decimal value: 'a' = 97
2. Convert it to hex: 97 = &h61
3. Convert each digit to binary: &h6 = 0110 | &h1 = 0001
4. Put the two digits together: 0110|0001

So 01100001 is the binary value of 'a'. The computer stores this value as 01100001 in the memory.

To get a ASCII value from byte then:
1. Get the byte value (lets use 'a' again): 01100001
2. Spilt it up to groups of four: 0110|0001
3. Get the Hex equivalents of it: &h6|&h1
4. Put that number together: &h61
5. Convert it to ASCII decimal: 97
6. Get the character equivalent: 'a'

Yes I know the converting to decimal is optional, but its for human interface more than programmer interface....ummm...ya.

Ok, there u go.
i]"But...it was so beautifully done"[/i]
Reply
#12
OK so i opened a mp3 file in notepad and in some one mp3 the name and title was at the top of the file on the first line
On another file the name and stuff was on the last line

ok but i looked into the playmp3.bas and it used the function: fsound_FindTagField()

anyone know how to use this and can explain it to me
his world has been connected...
Tied to the darkness.
Soon to be completely eclipsed.
There is so very much to learn...
You understand so little.
A meaningless effort.
One who knows nothing can understand nothing.
-Ansem Bringer of darkness and creator of the heartless
Reply
#13
yes yes i know that function but i print it out and all i get is numbers
his world has been connected...
Tied to the darkness.
Soon to be completely eclipsed.
There is so very much to learn...
You understand so little.
A meaningless effort.
One who knows nothing can understand nothing.
-Ansem Bringer of darkness and creator of the heartless
Reply
#14
here's basically how to use it:
Quote: dim shared Handle as long,num as integer,byt as byte ptr,doid3v2%,tagtype
dim shared naem as byte ptr,pointr as byte ptr,length
FSOUND_Stream_GetNumTagFields(Handle,@num)
for i% = 0 to num-1
FSOUND_Stream_GetTagField(Handle,i%,@tagtype,@naem,@pointr,@length)
j%=0
tagname$=*naem
tagdata$=""
for j = 0 to length-1
tagdata$=tagdata$+chr$(pointr[j])
next
if tagtype<>2 then print lcase$(tagname$); " : "; lcase$(tagdata$)
if tagtype=2 and doid3v2%=1 then
print lcase$(tagname$); " : "; lcase$(tagdata$)
end if
next

first get the number of tag fields, then for each tag, get the tag's name and contents. note that you can just use * for the name, but for the contents you have to extract it manually in a for loop since it's not null-terminated.
ttp://m0n573r.afraid.org/
Quote:quote: "<+whtiger> you... you don't know which way the earth spins?" ... see... stupidity leads to reverence, reverence to shakiness, shakiness to... the dark side
...phear
Reply
#15
(Off topic) You know, the bbcode generator is nice and all, but it's really hard to read code in a proportional-width font.
Reply
#16
(Off topic) I miss the indentations Cry
Reply
#17
yeah umm still confused member your talkin to a newbie
his world has been connected...
Tied to the darkness.
Soon to be completely eclipsed.
There is so very much to learn...
You understand so little.
A meaningless effort.
One who knows nothing can understand nothing.
-Ansem Bringer of darkness and creator of the heartless
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)