'how play 24bit wave?
f$ = "24bit.wav"
'try standard method:
PRINT "Nothing? Press any key..."
PRINT "Loading file to memory..." size
AS LONG ' 4 bytes (file size) subchunksize
AS LONG ' 4 bytes (lo / hi), $00000010 for PCM audio format
AS INTEGER ' 2 bytes (0001 = standard PCM, 0101 = IBM mu-law, 0102 = IBM a-law, 0103 = IBM AVC ADPCM) channels
AS INTEGER ' 2 bytes (1 = mono, 2 = stereo) rate
AS LONG ' 4 bytes (sample rate, standard is 44100) ByteRate
AS LONG ' 4 bytes (= sample rate * number of channels * (bits per channel /8)) Block
AS INTEGER ' 2 bytes (block align = number of channels * bits per sample /8) Bits
AS INTEGER ' 2 bytes (bits per sample. 8 = 8, 16 = 16) subchunk2
AS STRING * 4 ' 4 bytes ("data") contains begin audio samples lenght
AS LONG ' 4 bytes Data block size
'PRINT H24.format
'PRINT H24.channels
'PRINT H24.rate
'PRINT H24.Block
'PRINT H24.Bits
'PRINT H24.lenght
f$ = ""
PRINT "File loaded to memory, decoding it..."
D& = 0
DecimalToBinary Vl, 1, BinnaryL()
'24 bites - left channel
DecimalToBinary Vr, 1, BinnaryR()
'24 bites - right channel
FinalL(Ul) = BinaryToDecimal(BinnaryL())
FinalR(Ur) = BinaryToDecimal(BinnaryR())
D& = D& + 6
n& = 65535 * 128
Ls = FinalL(listen) / n&
Rs = FinalR(listen) / n&
PRINT "Erasing memory..."
SUB DecimalToBinary
(v
AS _UNSIGNED _BYTE, HowBytes
, Binnary
() AS _UNSIGNED _BYTE) 'vstup V prevede na pole o (8 * HowBytes) indexech (1 az HowBytes, nula se nepouziva) a vnich jsou ulozeny binarni hodnoty 0 nebo 1
u = u + 1
FUNCTION BinaryToDecimal&
(Binnary
() AS _UNSIGNED _BYTE) ' pro cisla ktera jsou tvorena 3 bytes musi mit pole Binnary celkem 24 indexu (ubound = 24, index 0 se nepouziva) c = Binnary(si)
Sj = u - si
btd = btd + (c * 2 ^ Sj)
BinaryToDecimal& = btd