fLaC (Beta 1.1.0)

by Kgotso Mong

Version 5 (July 1, 2025)

Download (9 downloads)

Read the stream info, metadata & embedded images of flac files

This flow makes use of od & dd to read & write data, dd is not necessary but will speed up writing drastically

Use flow beginning block #1 for reading & block #2 for writing

SUPPORTED PAYLOAD KEYS

𝗳𝗶𝗹𝗲 (string, mandatory) : relative or absolute path of the flac file

𝗿𝗲𝘁𝘂𝗿𝗻_𝘂𝗿𝗶 (string, mandatory if broadcast is not passed) : flow uri to return results to

𝗯𝗿𝗼𝗮𝗱𝗰𝗮𝘀𝘁 (string, mandatory if return_uri is not passed) : broadcast action to use when sending results

𝗶𝗻𝗰𝗹𝘂𝗱𝗲 (string array) : metadata blocks to read from the file. Currently only stream_info, vorbis_comment & picture are supported
• 𝘀𝘁𝗿𝗲𝗮𝗺_𝗶𝗻𝗳𝗼 : bitrate, sampling rate & number of audio channels
• 𝘃𝗼𝗿𝗯𝗶𝘀_𝗰𝗼𝗺𝗺𝗲𝗻𝘁 : general information or 'tags' e.g. artist, album, etc
• 𝗽𝗶𝗰𝘁𝘂𝗿𝗲 : mime type, dimensions & size of embedded image(s)

𝗽𝗶𝗰𝘁𝘂𝗿𝗲_𝗳𝗶𝗹𝗲 (string) : filepath where the image should be saved. The parent folder will not be created, so ensure it exists (requires picture to be included)

𝗽𝗶𝗰𝘁𝘂𝗿𝗲_𝘁𝘆𝗽𝗲𝘀 (array) : an array of picture types you want process

𝗯𝗹𝗼𝗰𝗸𝘀 (mandatory when writing, dictionary) : the metadata blocks to write to the file as arrays e.g. {"blocks" :{"vorbis_comment" :[{"ARTIST" :["The Weeknd", "Kendrick Lamar"]}], "picture" :[{"file" :"cover.jpg","type":"front_cover"}]}}
The flow can currently only write 'vorbis_comment' & 'picture' blocks

supported picture types :
other, 32x32_icon, file_icon, front_cover, back_cover, liner_notes, media_label, lead_artist, artist, conductor, lyricist, location, recording, performance, screen_shot, colored_fish, illustration, band & studio

𝗼𝘃𝗲𝗿𝘄𝗿𝗶𝘁𝗲_𝗰𝗼𝗺𝗺𝗲𝗻𝘁 : whether the existing comments should be removed

𝗼𝘃𝗲𝗿𝘄𝗿𝗶𝘁𝗲_𝗽𝗶𝗰𝘁𝘂𝗿𝗲 : whether any existing pictures should be removed

𝗮𝗽𝗽𝗲𝗻𝗱_𝗰𝗼𝗺𝗺𝗲𝗻𝘁𝘀 : whether passed comments should be appended to any existing comment fields

𝗰𝗵𝘂𝗻𝗸_𝘀𝗶𝘇𝗲 : the chunk size to use when writing large files to disk. This will be ignored if your device supports dd

RETURNED PAYLOAD

𝘀𝘂𝗰𝗰𝗲𝘀𝘀 (boolean) : whether the file was read successfully

𝗲𝗿𝗿𝗼𝗿 (string) : error message explaining why the flow failed

𝗽𝗶𝗰𝘁𝘂𝗿𝗲 (array of dictionaries) : image info and any included extras

Vorbis comment fields will be appended to this dictionary with the field name as the key as is and field value as the value. If there are multiple fields with the same name (case sensitive), they will be concatenated to one array of the field name

### ChangeLog ###
• Added support for editing/writing files
• Removed 'picture_bytes' as this has little use cases
• Picture uris are now supported although many players don't support them