Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Files.AudioTags
Queries audio tags for audio file.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Files | 9.4 | ✅ Yes | ✅ Yes | ❌ No | ✅ Yes, on macOS and Windows | ❌ No |
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
FilePath | The native file path to the audio file. | "/Users/cs/Desktop/test.mp3" | |
Flags | Available in MBS FileMaker Plugin 15.0 or newer. Pass 1 to dump ID3v2Tags values. Default is 0 for no flags. |
Optional |
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.
See Files.AudioCoverArt to get covert art.
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
Colorize and format in Auto-Enter calculation:
Let ( [
jsonFormatted = MBS("JSON.Format"; Self);
jsonFormatFailed = MBS("IsError");
jsonText = If(jsonFormatFailed; Self; jsonFormatted);
result = MBS("JSON.Colorize"; jsonText)
]; result )
// put this calculation into a field, so the field gets formated and colorized whenever the field is changed and the record gets commited.
See also
- Files.AudioCoverArt
- Files.SetAudioTags
- IsError
- JSON.Colorize
- JSON.Format
- Path.FileMakerPathToNativePath
Release notes
- Version 15.0
- Added flags parameter for Files.AudioTags to request dumping all ID3v2Tags.
- Version 13.3
- Fixed Files.AudioTags function for macARM target.
- Version 9.4
- Added Files.AudioTags to read ID tags from audio files.
Example Databases
Blog Entries
- MBS FileMaker Plugin, version 14.6pr1
- MBS FileMaker Plugin, version 13.3pr7
- Neue Funktionen des MBS FileMaker Plugin 9.4
- MBS FileMaker Plugin 9.4, second release
- Neues MBS FileMaker Plugin 9.4
- MBS FileMaker Plugin 9.4 - More than 5900 Functions In One Plugin
- MBS FileMaker Plugin, version 9.4pr8
- TagLib to read and write ID3v2 Tags in FileMaker
FileMaker Magazin
This function checks for a license.
Created 12nd September 2019, last changed 21st November 2024
