Re: [Sndobj-devel] Odd behaviour?
Status: Abandoned
Brought to you by:
veplaini
From: Rory W. <ror...@ea...> - 2007-03-19 22:34:42
|
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. > > |