Este foro usa cookies
Este foro utiliza cookies para almacenar su información de inicio de sesión si está registrado y su última visita si no lo está. Las cookies son pequeños documentos de texto almacenados en su computadora; las cookies establecidas por este foro solo se pueden usar en este sitio web y no representan ningún riesgo de seguridad. Las cookies en este foro también rastrean los temas específicos que ha leído y la última vez que los leyó. Si Ud. continúa navegando, entenderemos que acepta todas las cookies.

Se almacenará una cookie en su navegador, independientemente de la elección, para evitar que se le vuelva a hacer esta pregunta. Podrá cambiar la configuración de sus cookies en cualquier momento utilizando el enlace en el pie de página.

El foro antiguo se encuentra accesible desde https://foro.gambas-es.org en modo de solo lectura.

Calificación:
  • 0 voto(s) - 0 Media
  • 1
  • 2
  • 3
  • 4
  • 5

TagLib como acceder mas información.
#1
Question 

Vuott: Estoy usando tu ejemplo de Extern con la librería TagLib y funciona bien y rápido para extraer metadatos de los archivos de música.
https://www.gambas-it.org/wiki/index.php...i_Libtag_c
Me interesa acceder a algunos datos mas pero luego de intentar un tiempo desistí.
Estos usando la información del sitio
https://taglib.org/
pero no logro implementar nada.
Deseo saber el codec del archivo, el artista del album, y el tipo de id3 y la versión.
En todos los intentos que hice, el código da error y dice que esa función no esta en libtag_c......
El código modificado es este:
GAMBAS
  1. Library "libtag_c:0.0.0"
  2.  
  3. Public Struct TagLib_File
  4.   dummy As Integer
  5.  
  6. Public Struct TagLib_Tag
  7.   dummy As Integer
  8.  
  9. Public Struct TagLib_AudioProperties
  10.   dummy As Integer
  11.  
  12. ' void taglib_set_strings_unicode(BOOL unicode)
  13. ' By default all strings coming into or out of TagLib's C API are in UTF8.
  14. ' However, it may be desirable For TagLib To operate On Latin1(ISO - 8859 - 1) strings In which Case this should be set To FALSE.
  15. Private Extern taglib_set_strings_unicode(unicode As Boolean)
  16.  
  17. ' TagLib_File *taglib_file_new_type(const char *filename)
  18. ' Creates a TagLib file based on \a filename.
  19. Private Extern taglib_file_new(filename As String) As TagLib_File
  20.  
  21. ' TagLib_Tag *taglib_file_tag(const TagLib_File *file)
  22. ' Returns a pointer to the tag associated with this file.
  23. Private Extern taglib_file_tag(_file As TagLib_File) As TagLib_Tag
  24.  
  25. ' char *taglib_tag_title(const TagLib_Tag *tag)
  26. ' Returns a string with this tag's title.
  27. Private Extern taglib_tag_title(tag As TagLib_Tag) As String
  28.  
  29. ' char *taglib_tag_artist(const TagLib_Tag *tag)
  30. ' Returns a string with this tag's artist.
  31. Private Extern taglib_tag_artist(tag As TagLib_Tag) As String
  32.  
  33. ' char *taglib_tag_album(const TagLib_Tag *tag)
  34. ' Returns a string with this tag's album name.
  35. Private Extern taglib_tag_album(tag As TagLib_Tag) As String
  36.  
  37. ' unsigned int taglib_tag_year(const TagLib_Tag *tag)
  38. ' Returns the tag's year or 0 if year is not set.
  39. Private Extern taglib_tag_year(tag As TagLib_Tag) As Integer
  40.  
  41. ' char *taglib_tag_comment(const TagLib_Tag *tag)
  42. ' Returns a string with this tag's comment.
  43. Private Extern taglib_tag_comment(tag As TagLib_Tag) As String
  44.  
  45. ' unsigned int taglib_tag_track(const TagLib_Tag *tag)
  46. ' Returns the tag's track number or 0 if track number is not set.
  47. Private Extern taglib_tag_track(tag As TagLib_Tag) As Integer
  48.  
  49. 'Private Extern taglib_tag_encoder(tag As TagLib_Tag) As String
  50. 'Private Extern taglib_tag_volume_number(tag As TagLib_Tag) As Integer
  51.  
  52. ' char *taglib_tag_genre(const TagLib_Tag *tag)
  53. ' Returns a string with this tag's genre.
  54. Private Extern taglib_tag_genre(tag As TagLib_Tag) As String
  55.  
  56. ' const TagLib_AudioProperties *taglib_file_audioproperties(const TagLib_File *file)
  57. ' Returns a pointer to the the audio properties associated with this file.
  58. Private Extern taglib_file_audioproperties(_file As TagLib_File) As TagLib_AudioProperties
  59.  
  60. ' int taglib_audioproperties_length(const TagLib_AudioProperties *audioProperties)
  61. ' Returns the length of the file in seconds.
  62. Private Extern taglib_audioproperties_length(audioProperties As TagLib_AudioProperties) As Integer
  63.  
  64. ' int taglib_audioproperties_bitrate(const TagLib_AudioProperties *audioProperties)
  65. ' Returns the bitrate of the file in kb/s.
  66. Private Extern taglib_audioproperties_bitrate(audioProperties As TagLib_AudioProperties) As Integer
  67.  
  68. ' int taglib_audioproperties_samplerate(const TagLib_AudioProperties *audioProperties)
  69. ' Returns the sample rate of the file in Hz.
  70. Private Extern taglib_audioproperties_samplerate(audioProperties As TagLib_AudioProperties) As Integer
  71.  
  72. ' int taglib_audioproperties_channels(const TagLib_AudioProperties *audioProperties)
  73. ' Returns the number of channels in the audio stream.
  74. Private Extern taglib_audioproperties_channels(audioProperties As TagLib_AudioProperties) As Integer
  75.  
  76. ' void taglib_tag_free_strings(void)
  77. ' Frees all of the strings that have been created by the tag.
  78. Private Extern taglib_tag_free_strings()
  79. ' void taglib_file_free(TagLib_File *file)
  80. ' Frees and closes the file.
  81. Private Extern taglib_file_free(_file As TagLib_File)
  82.   Dim fl As TagLib_File
  83.   Dim autag As TagLib_Tag
  84.   Dim auprop As TagLib_AudioProperties
  85.   Dim secondi, minuti As Integer
  86.   'taglib_set_strings_unicode(False)
  87.   taglib_set_strings_unicode(True)
  88.   fl = taglib_file_new(fileaudio)
  89.   If IsNull(fl) Then Error.Raise("Impossibile caricare il file audio: " & fileaudio)
  90.   autag = taglib_file_tag(fl)
  91.   If IsNull(autag) Then Error.Raise("Impossibile ottenere i tag dal file audio: " & fileaudio)
  92.   inf.Add(taglib_tag_album(autag), "Album")
  93.   inf.Add(taglib_tag_artist(autag), "Artist")
  94.   inf.Add(taglib_tag_track(autag), "Track")
  95.   inf.Add(taglib_tag_title(autag), "Title")
  96.   inf.Add(taglib_tag_year(autag), "Year")
  97.   inf.Add(taglib_tag_genre(autag), "Genre")
  98.   inf.Add(taglib_tag_comment(autag), "Comment")
  99.   ' Mostra le proprietà del file audio:
  100.   auprop = taglib_file_audioproperties(fl)
  101.   If IsNull(auprop) Then
  102.     inf.Add(True, "AudioError")
  103.   Else
  104.     inf.Add(taglib_audioproperties_length(auprop), "Length")
  105.     inf.Add(taglib_audioproperties_bitrate(auprop), "Bitrate")
  106.     inf.Add(taglib_audioproperties_samplerate(auprop), "Frequency")
  107.     inf.Add(taglib_audioproperties_channels(auprop), "Channels")
  108.   ' Va in chiusura:
  109.   taglib_tag_free_strings()
  110.   taglib_file_free(fl)
  111.   Return inf


Saludos.

1 Saludo.
    ¡Gracias!
#2

Hola tincho,
probé tu codigo: a mi funciona normalmente.
Descargaste la libreria con el Gestor de paquetes ?
Mi codigo a ti funciona ?

...forse il nuovo "Gesù Cristo" sceso sulla terra potrebbe dare una benedizione.

"Los horizontes perdidos nunca regresan. " (F. Battiato, La stagione dell'amore, 1983)

"Las ondas nunca regresan. " (Genesis: Ripples - A trick of the tail, 1976)
    ¡Gracias!
#3

(24-08-2020, 02:24)vuott escribió:  Hola tincho,
probé tu codigo: a mi funciona normalmente.
Descargaste la libreria con el Gestor de paquetes ?
...forse il nuovo "Gesù Cristo" sceso sulla terra potrebbe fare un miracolo.
Hola Vuott,
El código funciona bien y es muy veloz, lo que deseo hacer es ampliar en tres parámetros la información extraída del archivo.
  • Codec
  • Artista del album
  • Tipo de id3 y la versión.
Saludos

1 Saludo.
    ¡Gracias!
#4

(23-08-2020, 19:33)tincho escribió:  ...dice que esa función no esta en libtag_c......

Cual función ?

Non sono l'Onnipotente che sa tutto, tincho !

"Los horizontes perdidos nunca regresan. " (F. Battiato, La stagione dell'amore, 1983)

"Las ondas nunca regresan. " (Genesis: Ripples - A trick of the tail, 1976)
    ¡Gracias!
#5

(24-08-2020, 03:37)vuott escribió:  
(23-08-2020, 19:33)tincho escribió:  ...dice que esa función no esta en libtag_c......
Cual función ?
Non sono l'Onnipotente che sa tutto, tincho !
Por ejemplo intento poner esta funcióntaglib_tag_album_artist
Ninguna funciona, pero.... donde puedo ver que funciones hay disponibles.
Por ejemplo en esta lista de funciones para haskell no figura lo que busco ¿eso quiere decir que no esta? asi que dejo de busscar, por ejemplo, "album_artist" verdad?
https://hackage.haskell.org/package/tagl...agLib.html
Saludos.

1 Saludo.
    ¡Gracias!
#6

(24-08-2020, 04:07)tincho escribió:  Por ejemplo intento poner esta función taglib_tag_album_artist
Ninguna funciona, pero.... donde puedo ver que funciones hay disponibles.

Las funciones en C de esta libreria puedes verle en este archivo header:

     /usr/include/taglib/tag_c.h

la función taglib_tag_album_artist( ) no existe !

Solo l'Onnipotente può crearla, tincho !

"Los horizontes perdidos nunca regresan. " (F. Battiato, La stagione dell'amore, 1983)

"Las ondas nunca regresan. " (Genesis: Ripples - A trick of the tail, 1976)
    ¡Gracias!


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)