Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 8.2   8.3   8.4   8.5   9.0   9.1   9.2   9.3   9.4   9.5    Statistic  

Files.AudioTags

Queries audio tags for audio file.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Files 9.4 Yes Yes Yes No No
MBS( "Files.AudioTags"; FilePath )   More

Parameters

Parameter Description Example value
FilePath The native file path to the audio file. "/Users/cs/Desktop/test.mp3"

Result

Returns JSON or error.

Description

Queries audio tags for audio file.
Returns JSON object with usual two sub objects. One is AudioProperties with length (in seconds), bitrate (in bits per second), sampleRate (in Hz) and channels as numbers.
The Properties object contains all the properties with various tags. Values are texts for the given keys.

Uses TagLib, an open source library to read metadata from audio files, e.g. ID3 tags.
Currently it supports both ID3v1 and ID3v2 for MP3 files, Ogg Vorbis comments and ID3 tags and Vorbis comments in FLAC, MPC, Speex, WavPack, TrueAudio, WAV, AIFF, MP4 and ASF files.

List of ID3v2 tag names:
ALBUM, ALBUMARTIST, ALBUMARTISTSORT, ALBUMSORT, ARTIST, ARTISTSORT, ARTISTWEBPAGE, AUDIOSOURCEWEBPAGE, BPM, COMMENT, COMPOSER, CONDUCTOR, CONTENTGROUP, COPYRIGHT, COPYRIGHTURL, DATE, DISCNUMBER, ENCODEDBY, ENCODING, ENCODINGTIME, FILETYPE, FILEWEBPAGE, GENRE, INITIALKEY, INVOLVEDPEOPLE, ISRC, LABEL, LANGUAGE, LENGTH, LYRICIST, LYRICS, MEDIA, MOOD, MUSICIANCREDITS, ORIGINALALBUM, ORIGINALARTIST, ORIGINALDATE, ORIGINALFILENAME, ORIGINALLYRICIST, OWNER, PAYMENTWEBPAGE, PLAYLISTDELAY, PODCAST, PODCASTCATEGORY, PODCASTDESC, PODCASTID, PODCASTURL, PRODUCEDNOTICE, PUBLISHERWEBPAGE, RADIOSTATION, RADIOSTATIONOWNER, RADIOSTATIONWEBPAGE, RELEASEDATE, REMIXER, SUBTITLE, TAGGINGDATE, TITLE, TITLESORT, TRACKNUMBER, URL.

This function requires a native path. Use Path.FileMakerPathToNativePath to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use FileDialog functions.
For Server be aware that server has limited permissions and may not be able to access all files on a computer.

Examples

Query MP3 tags:

MBS("Files.AudioTags"; "/Users/cs/Desktop/test.mp3")

Example result:
{
  "AudioProperties":   {
    "length":   282,
    "bitrate":   128,
    "sampleRate":   44100,
    "channels":   2
  },
  "Tags":   {
    "ARTIST":   "John Doe",
    "COMMENT":   "test comment",
    "TITLE":   "Hello World"
  }
}

Read tags and show JSON in field:

If [ Length ( AudioTags::FilePath ) > 0 ]
    Set Variable [ $r ; Value: MBS("Files.AudioTags"; AudioTags::FilePath) ]
    If [ MBS("IsError") = 0 ]
        Set Field [ AudioTags::JSON ; MBS("JSON.Colorize"; MBS("JSON.Format"; $r)) ]
    End If
End If

See also

Example Databases

Blog Entries

Release notes

Created 12nd September 2019, last changed 20th September 2019


Files.AppPath   -   Files.CanOpenFile

Feedback: Report problem or ask question.




Links
MBS FileMaker tutorial videos