Differenze tra le versioni di "Estrarre informazioni da un file VOC con le sole risorse di Gambas"

Da Gambas-it.org - Wikipedia.
(Creata pagina con 'Il formato di file audio '''VOC''' è stato creato dalla ''Creative''. Esso è composto da un blocco di intestazione di 31 byte seguito da uno o più blocchi di dati. Tutti i...')
 
Riga 23: Riga 23:
 
   Print "Versione del file 'voc': "; bb[&17]; "."; bb[&16]
 
   Print "Versione del file 'voc': "; bb[&17]; "."; bb[&16]
 
      
 
      
   Print "Dimensione dei dati audio: "; Val("&" & Hex(bb[29]) & Hex(bb[28]) & Hex(bb[27]));; "byte"
+
   Print "Dimensione dei dati audio: "; Val("&" & Hex(bb[29], 2) & Hex(bb[28], 2) & Hex(bb[27], 2));; "byte"
 
   Print "Frequenza di campionamento: "; Fix(1000000 / (256 - bb[30]));; "hertz"
 
   Print "Frequenza di campionamento: "; Fix(1000000 / (256 - bb[30]));; "hertz"
 
   Select Case bb[31]
 
   Select Case bb[31]
Riga 57: Riga 57:
 
* http://www.justindeltener.com/sound-programming/sound-blaster-16-tutorial/reading-the-creative-voc-sound-file-format/
 
* http://www.justindeltener.com/sound-programming/sound-blaster-16-tutorial/reading-the-creative-voc-sound-file-format/
 
* https://github.com/fabiensanglard/libRealSpace/blob/master/doc/Creative%20Voice%20%28VOC%29%20file%20format
 
* https://github.com/fabiensanglard/libRealSpace/blob/master/doc/Creative%20Voice%20%28VOC%29%20file%20format
 +
 +
 +
<FONT Color=red size=4><B>Pagina in costruzione</b></font>

Versione delle 12:58, 15 giu 2015

Il formato di file audio VOC è stato creato dalla Creative.

Esso è composto da un blocco di intestazione di 31 byte seguito da uno o più blocchi di dati. Tutti i valori interi sono in ordine dei byte di tipo Little Endian.


Mostriamo un semplice codice per estrarre alcune informazioni generali relative ad un file VOC:

 Public Sub Main()
 
 Dim voc, codec As String
 Dim fl As File
 Dim bb As Byte[]
 
  voc = "/percorso/del/file.voc"
  Print "File voc: "; voc
   
  fl = Open voc For Read
   
  With bb = New Byte[32]
    .Read(fl, 0, bb.Count)
    If .ToString(0, 19) <> "Creative Voice File" Then Error.Raise("Il file non è un file 'voc' !")
  End With
   
  Print "Versione del file 'voc': "; bb[&17]; "."; bb[&16]
   
  Print "Dimensione dei dati audio: "; Val("&" & Hex(bb[29], 2) & Hex(bb[28], 2) & Hex(bb[27], 2));; "byte"
  Print "Frequenza di campionamento: "; Fix(1000000 / (256 - bb[30]));; "hertz"
  Select Case bb[31]
    Case 0
      codec = "8 bits unsigned PCM"
    Case 1
      codec = "4 bits to 8 bits Creative ADPCM"
    Case 2
      codec = "3 bits to 8 bits Creative ADPCM (2.6 bits)"
    Case 3
      codec = "2 bits to 8 bits Creative ADPCM "
    Case 4
      codec = "16 bits signed PCM "
    Case 6
      codec = "alaw"
    Case 7
      codec = "ulaw"
    Case &200
      codec = "4 bits to 16 bits Creative ADPCM"
    End Select
    Print "Codec: "; codec
       
  fl.Close
  
End



Riferimenti


Pagina in costruzione