FR: Expose PCM_source::GetBitsPerSample() to ReaScript API #1010
there is currently no efficient way to get bit per sample of an audio file with ReaScript.
The function seems to exists in www.reaper.fm/files/reaper_plugin.h (but I don't know if it works).
It would be nice if we could expose it to ReaScript API, as handling such thing from ReaScript requires quite a lot of code. Here, it will be just one line.
Here was the discussion thread.
The text was updated successfully, but these errors were encountered:
@cfillion Excellent ! So more handy that the whole lua code I use to have (more than 100lines, with a shell comand etc for v1, then full file parsing for v2 in 20 lines... not just 1 !).
item = reaper.GetSelectedMediaItem( 0, 0 ) take = reaper.GetActiveTake( item ) source = reaper.GetMediaItemTake_Source( take ) bit_depth = reaper.CF_GetMediaSourceBitDepth(source)
I tested with all bit depth avaible by wavefile, seems to work good,
Nice thing is that it do work for mp3 and flac ! I didn't test other formats.