Re: [Sndobj-devel] Odd behaviour?
Status: Abandoned
Brought to you by:
veplaini
From: Victor L. <Vic...@nu...> - 2007-03-20 08:44:21
|
would it be because somehow the objects have been destroyed before the Read() etc calls? Sometimes it can happen, depending on how your code is arranged that they get destroyed, esp. if they are local variables. Try using a class and making the SndObjs class members (as in the manual example). Victor At 22:34 19/03/2007, Rory Walsh wrote: >Sorry I should have mentioned that the crash only happen when I call >either Read(), DoProcess() or Write()... > >Rory Walsh wrote: > > I'm getting some odd behaviour with a simple Sndobj app I'm building > > with wxWidgets. I have the following simple code: > > > > ... > > SndWave input("Radiohead.wav", READ); > > SndRTIO output(1, SND_OUTPUT); > > SndIn signal(&input); > > output.SetOutput(1, &signal); > > > > for(int i=0; i<dur*(DEF_SR/DEF_VECSIZE); i++) > > { > > input.Read(); > > signal.DoProcess(); > > output.Write(); > > } > > ... > > > > When ran as a command line app it works fine and plays the audio. If I > > insert it to an OnButtonPress() method it causes a crash. I know I > > should be using threads but I'm trying to show some students why threads > > are necessary. Running this code should play some audio even though the > > application will freeze for 10 seconds. I'm using windows and MinGW. > > Any ideas? > > > > Rory. > > > > > >------------------------------------------------------------------------- >Take Surveys. Earn Cash. Influence the Future of IT >Join SourceForge.net's Techsay panel and you'll get the chance to share your >opinions on IT & business topics through brief surveys-and earn cash >http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >_______________________________________________ >Sndobj-devel mailing list >Snd...@li... >https://lists.sourceforge.net/lists/listinfo/sndobj-devel Victor Lazzarini Music Technology Laboratory Music Department National University of Ireland, Maynooth |