Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 05-12-2017, 04:41 PM   #1
inspired
Human being with feelings
 
inspired's Avatar
 
Join Date: Dec 2010
Posts: 271
Default Reascript `RPR_PCM_Source_CreateFromFile` not working

In the python API, the RPR_PCM_Source_CreateFromFile command is not working.
I tried a simple test:
Code:
item = RPR_GetSelectedMediaItem(0, 0)
source = RPR_PCM_Source_CreateFromFile("D:/folder/file.wave")
take = RPR_AddTakeToMediaItem(item)
RPR_SetMediaItemTake_Source(take, source)
and the new take seems just empty. The exact same commands in lua work perfectly.

The thing is at this time I'm building a python application for some signal processing (just denoising for now) as part of my thesis, and I wanted to interface that with reaper. I've stumbled upon plenty of problems, and now this is the latest.. I'm starting to get crazy with that :P (by searching around I found some people saying the same and suggesting the RPR_BR_SetTakeSourceFromFile, but this doesn't seem to work either:
Code:
NameError: global name 'BR_SetTakeSourceFromFile' is not defined
..while having the sws installed and having this function appear in the Reaper's generated Reascript documentation..


I was a crazy Reaper supporter praising its API.. but what is going on?? :P

- forgive my annoyance, it's 1:30 and I've been dealing with bugs for the past hour. I've stumbled with even more bugs on my tries..

I hope that the API will get fixed since i've seen this particular bug discussed even 1 year ago (http://forum.cockos.com/showthread.php?t=173743)
__________________
My ReaScripts
inspired is offline   Reply With Quote
Old 04-17-2018, 04:28 AM   #2
IReap
Human being with feelings
 
Join Date: Apr 2018
Posts: 13
Default

Quote:
Originally Posted by inspired View Post
In the python API, the RPR_PCM_Source_CreateFromFile command is not working.
I tried a simple test:
Code:
item = RPR_GetSelectedMediaItem(0, 0)
source = RPR_PCM_Source_CreateFromFile("D:/folder/file.wave")
take = RPR_AddTakeToMediaItem(item)
RPR_SetMediaItemTake_Source(take, source)
and the new take seems just empty. The exact same commands in lua work perfectly.

The thing is at this time I'm building a python application for some signal processing (just denoising for now) as part of my thesis, and I wanted to interface that with reaper. I've stumbled upon plenty of problems, and now this is the latest.. I'm starting to get crazy with that :P (by searching around I found some people saying the same and suggesting the RPR_BR_SetTakeSourceFromFile, but this doesn't seem to work either:
Code:
NameError: global name 'BR_SetTakeSourceFromFile' is not defined
..while having the sws installed and having this function appear in the Reaper's generated Reascript documentation..


I was a crazy Reaper supporter praising its API.. but what is going on?? :P

- forgive my annoyance, it's 1:30 and I've been dealing with bugs for the past hour. I've stumbled with even more bugs on my tries..

I hope that the API will get fixed since i've seen this particular bug discussed even 1 year ago (http://forum.cockos.com/showthread.php?t=173743)
I have a very similar problem, also using Reaper (and Reascript) with Python to do some automated testing..

Did you resolve it? If so, could you give any insight?
IReap is offline   Reply With Quote
Old 04-17-2018, 04:51 AM   #3
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

edit : nevermind, the poster mentioned it works in Lua.

Maybe those APIs just are not supported in Python.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 11-28-2021, 06:07 AM   #4
pterodox
Human being with feelings
 
Join Date: Sep 2020
Posts: 17
Default

Sorry for necrobump, but for anyone else looking for a workaround, RPR_InsertMedia did the trick for me.
pterodox is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:24 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.