Un pequeño ejemplo:
Public Struct SMPEG_Info
has_audio As Integer
has_video As Integer
width As Integer
height As Integer
current_frame As Integer
current_fps As Float
audio_string[80] As Byte
audio_current_frame As Integer
current_offset As Integer
total_size As Integer
current_time As Float
total_time As Float
End Struct
Library "libsmpeg-0.4:0.1.4"
Private Const audio As Integer = 1
' SMPEG* SMPEG_new(const char *file, SMPEG_Info* info, int sdl_audio)
' Create a new SMPEG object from an MPEG file. This function returns a new SMPEG object.
Private Extern SMPEG_new(file$ As String, infoP As SMPEG_Info, sdl_audio As Integer) As Pointer
' void SMPEG_delete( SMPEG* mpeg )
' Delete an SMPEG object
Private Extern SMPEG_delete(mp As Pointer)
Public Sub Main()
Dim info As New SMPEG_Info
Dim smpeg As Pointer
Dim direcciónFile As String
direcciónFile = "/dirección/del/file.mp3"
smpeg = SMPEG_new(direcciónFile, info, audio)
With info
If .has_audio = 0 Then Error.Raise("Error: el file cargado no es un archivo de audio !")
Print "File audio: "; File.Name(direcciónFile)
Print "Características principales: "; .audio_string.ToString()
Print "Tamaño del archivo de audio: "; .total_size; " byte"
Print "Duración del archivo de audio: "; Date(0, 0, 0, 0, 0, 0, .total_time * 1000)
End With
' .....ad opus conficiendum: :-D
SMPEG_delete(smpeg)
End
has_audio As Integer
has_video As Integer
width As Integer
height As Integer
current_frame As Integer
current_fps As Float
audio_string[80] As Byte
audio_current_frame As Integer
current_offset As Integer
total_size As Integer
current_time As Float
total_time As Float
End Struct
Library "libsmpeg-0.4:0.1.4"
Private Const audio As Integer = 1
' SMPEG* SMPEG_new(const char *file, SMPEG_Info* info, int sdl_audio)
' Create a new SMPEG object from an MPEG file. This function returns a new SMPEG object.
Private Extern SMPEG_new(file$ As String, infoP As SMPEG_Info, sdl_audio As Integer) As Pointer
' void SMPEG_delete( SMPEG* mpeg )
' Delete an SMPEG object
Private Extern SMPEG_delete(mp As Pointer)
Public Sub Main()
Dim info As New SMPEG_Info
Dim smpeg As Pointer
Dim direcciónFile As String
direcciónFile = "/dirección/del/file.mp3"
smpeg = SMPEG_new(direcciónFile, info, audio)
With info
If .has_audio = 0 Then Error.Raise("Error: el file cargado no es un archivo de audio !")
Print "File audio: "; File.Name(direcciónFile)
Print "Características principales: "; .audio_string.ToString()
Print "Tamaño del archivo de audio: "; .total_size; " byte"
Print "Duración del archivo de audio: "; Date(0, 0, 0, 0, 0, 0, .total_time * 1000)
End With
' .....ad opus conficiendum: :-D
SMPEG_delete(smpeg)
End