How to use FileSystem.browse to return a path rather than object
-
I am trying to load a .wav file into a scriptFX granulator that is triggered on a button press. i can load it as an object but how do i properly load this file into a slot on a granulator or in general load the audio file from scripting.
here is a hise snippet of my problem.
HiseSnippet 1400.3ocuWs0aaaCElxILo1s6Rwt7rPdxYH0vNWcwvvRhSbWvVRMpxR6dpfQhNlvTjBRTwwqn.6w939ot+AaGRJYI03Dz5sUGf.e34124vC+H8fXoOMIQFibpe9zHJx4QXuoB0ndiHLA5jiPNqfUzDE5voQjjDZ.xwYomo04TeYj4ye8iGR3DgOsXID5BIym9KrPlpX0A6+yLNuOIfdNKrj0au+I9RQOIWlB3XIbaTDweL4J5YDsY0v.HNNfojwdJB.FjyxGJCl5MRNQXs+BVB6RNUKzA4AAxtbeIOPiX8pndiX7fA40aBBhxfhpeIa0+03SYArYqWzE9RiB2BOJ2ObpUEdKUAdcJCu1kf2bfjSIHsrEROF64GyhTEZz34g3SDJZ7PBz1KCEqsnZuqFtmDrPnZERFS6GCBy7n4tsaugK7u0+9FMfVehx8ZRrq029upi6O3ZFBZcEUcPZ.S5QBi3zYHn4ZVScAaWChgMDIboR6YdTl4ceFm1ry7xkQ8KIWSGJiC0oMGyfq8jgQRAHjmspFqyK7gI3LA0cXpvWwjBWovZ7goJkTzQGuXIuoedv1.xNOktdi2znNaXyLgF00XzaZhhF15xX4jDZy0VaC2gDdBcC209tVSHWqkyRSygf4Iq+FvwhxMgpLUpQmoBzaulkdRm00vs9ag++V3K2WYlg70VWGvL72iv4WBmIZN+xChZoFvYRE84hllRrwaa399pFNbt5xhEmFOW05irw2miMEogWRiK2f0FBywUObfu6CGkO65aaQkLTJNQvTOOhJtqSznr9JbPpVFp.SUliQeNtbmCwfSKeQkk5fL.uLuFZVPVwFjuAOmQQSr914o4VgDgBHJhgRKlHthB8jXffD6nUYV4XQPtL5WO4Hs0vw5r5Bp0HZrhoaiNGQuFnXsbD0wGQSFqjQlBOafZFp+.J8aJv3us+zxBSXApQEKLc+QT1UiTkMAc6T9Q2ntC.7GiyA.14OgtRdxwNAlaTtEaIvSKCR4DUUxa8MVYJfg1JLlZVQQBSMs7N++YL5enP7w3ALk+n4iwZyAi5Y7+GvX18feF93gCo9pB.tLt+q9DboG1l+F3bdUSxeDt3BmJf3rzvYWwn4VbpAkS1cfNuCWPSEESiHwzykC3joMSL2m8B.3a3dIW5O1i86zaysEYw0gZKZ5OhHDTdxhPAtxGbqpy8uS8BYphIt5ThJlAGYvP86AuZxm1KCc48fL414jIdTQfQ3ugOYJ6nkcxT1IWYAIJ5LpZhLdrYOJ66HmUsaHIll7qGdC.eZbhdh0YUb6VvenC3b4DMo.KaVF1oLqMPxmFMRJX95krVjC8CBkoBUN9+IRx4DFWO76kl.b9AOW3AFadlod36LY.7MbehOzXmNfn4HdLVeqALwRia4OaxsBVKFdzcXcPxe2osOAXJzPjoe04RZ81p2lMa3tBXpsmeQ2J8wzVkT+wkMc+fSuImzuzfcYIjlxJfdSdLNkItvdKiNGmRtojDZ.IFdCM7rOcLVYlDbbtvMrdWqjiXbGPVWpMvCj.qidGLS2WA1ty1c6tU2c2bq1aua281oTR.eqF1cpD1Mgv5MlNw1zzO1tcqc2p8S27o6sa21c2Y68d5dl7tpkLDUAPn4i9UvaVE9qh61tcVA7P7yhgw.8oazL6619ti1c2KzWwZofqX5Gcbd.1C3hHA+qCyQTUpf99go3EBU27qnwv3pkf6SpYmoOI4BsVeBOOhvwvCkxwgDCAvB8XjOIzUgD+X4q8sLv5h6AlUfC.ByOerN9Tsr6rGiYaUgvOm60995K1dB7Vx46ylKfOas.9r8B3yNKfO6t.9r2B3S260G8uj9fTkLzd4.rvfiMCWNNGKHvEglq1Q+C7wQMZL
-
.toString is your friend -
inline function onScriptButton1Control(component, value) { if(value) FileSystem.browse("", false, "*.wav", function(files){ Console.print(files.toString(0)); //ScriptFX1.setFile(files.getChildFile(-1)); }); }; Content.getComponent("ScriptButton1").setControlCallback(onScriptButton1Control);