View Single Post
Old 02-06-2022, 09:11 AM  
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,012
Default

Ok, this is odd: ape seems to work now.

I have used
A,Filename=reaper.GetSetProjectInfo_String(0, "RENDER_TARGETS", "", false)
to get the to-be-rendered filename in my code, so there might be an issue in that regards.
Will check further on it, but right now, it works...
Strange.



In regards of TXXX in the MP3, I used this code-snippet.
It renders the file with metadata and checks, whether the data stored in TXXX is equal to the original test-data.
The results will be shown in various variables, beginning with A_

Code:
-- set to mp3
local A,B=reaper.GetSetProjectInfo_String(0, "RENDER_FORMAT", "bDNwbYAAAAAAAAAAAgAAAP////8EAAAAgAAAAAAAAAA=", true)
local retval

-- create test-metadata, that has only ABCD time and again in it
A_TestMetaData=""
for i=1, 1024*32 do A_TestMetaData=A_TestMetaData.."ABCDABCDABCDABCDABCDABCDABCDABCD" end

-- add metadata to Reaper's metadata-storage
reaper.GetSetProjectInfo_String(0, "RENDER_METADATA", "ID3:TXXX:TUCH|"..A_TestMetaData, true)

-- get current export-file-name
A,Filename=reaper.GetSetProjectInfo_String(0, "RENDER_TARGETS", "", false)

-- render the file
reaper.Main_OnCommand(41824,0)

-- get the TXXX-metadata-frame for TUCH from recently rendered file
PCM_source=reaper.PCM_Source_CreateFromFile(Filename)
Aretval, A_TestMetaData_FromFile = reaper.GetMediaFileMetadata(PCM_source, "ID3:TXXX:TUCH")

-- Check, if original data is equal to the one I got from the file(which it isn't)
A_TestMetaData_FromFile_Same_Or_Not=A_TestMetaData_FromFile==A_TestMetaData

-- the length of the original metadata versus the length of the metadata read from the mp3
A_TestMetadata_Length=A_TestMetaData:len()                           -- 1048576 Bytes
A_TestMetadata_Length_FromFile_Length=A_TestMetaData_FromFile:len()  -- 4095 bytes
The rendered file has only 4k of metadata stored with TXXX.

This resulted in this file: https://mespotin.uber.space/stuf/metadata-test.mp3
When I open it in a text-viewer, the TXXX-metadata is truncated after 4096 bytes.

Edit: Oh, tested on Windows 7...

Edit2:
Ahh, I got the problem with APE, which wasn't a problem with APE at all.

Code:
A,Filename=reaper.GetSetProjectInfo_String(0, "RENDER_TARGETS", "", false)
doesn't take into account if a file already exists AND silently increment filenames to avoid overwriting is activated.
So I basically didn't read from the most recently created filename, but rather the first one I created(that had no metadata in it).
I think, RENDER_TARGETS should add the incrementation-number of the filename when this checkbox is activated.

Means:
"metadata-test.wv" when checkbox is off and file already exists
"metadata-test-001.wv" when checkbox is on and file already exists.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish

Last edited by Meo-Ada Mespotine; 02-06-2022 at 09:22 AM.
Meo-Ada Mespotine is offline   Reply With Quote