[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] soundfile weirdness



No, the path is not correct.

[ /Users/dewdrop/sounds/a11wlk01.wav ]

The current drag seems to be giving you an array containing the string -- the brackets.

BTW, you have an extra pair of {} in there, removed here and reformatted to be legible :)

{
var w,a,sf;

w=Window.new("drag n drop utility",Rect(700,270,540,35)).front;
a=SCDragSink(w,Rect(20,0,450,20));
a.string="..drag a file here to output a string..";
a.receiveDragHandler={|i|
sf=SoundFile.new;
sf.openRead(SCView.currentDrag[0].asString);
sf.path.postln; sf.numFrames.postln; sf.numChannels.postln;
sf.sampleRate.postln;
};
}.defer(0.1);


hjh


On May 1, 2009, at 8:14 AM, Marinos Koutsomichalis wrote:

this code :

{{var w,a,sf;

w=Window.new("drag n drop utility",Rect(700,270,540,35)).front;
a=SCDragSink(w,Rect(20,0,450,20));
a.string="..drag a file here to output a string..";
a.receiveDragHandler={|i| sf=SoundFile.new; sf.openRead(SCView.currentDrag.asString); sf.path.postln; sf.numFrames.postln; sf.numChannels.postln; sf.sampleRate.postln;}}.value;}.defer(0.1);


gives obviously wrong results...
every file I drag upon the GUI results in correct path and sample name but nuFrames allways equals 0 and numChannels 1..

any ideas ?


: H. James Harkins
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman