Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 5    Views: 30

kingelessar
Lost but trying
Profile
Posts: 155
Reg: Mar 10, 2014
UK
6,500
05/18/14 02:19 AM (10 years ago)

Interactive quiz crashes on trying to play sound effect

Has anyone got any experience with this? I push an answer button in the Interactive Quiz and if it's set to play a sound, it crashes. I have an exception breakpoint set in Xcode and it highlights the following code at the moment the app crashes. BT_screen_quiz.m: [appDelegate playSoundEffect:[BT_strings getJsonPropertyValue:self.screenData.jsonVars nameOfProperty:@"quizSoundEffectFileNameCorrect" defaultValue:@""]]; And also this one. appDelegate.m: AVAudioPlayer *tmpPlayer = (AVAudioPlayer *)[self.soundEffectPlayers objectAtIndex:playerIndex];
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
05/18/14 11:51 PM (10 years ago)
Which version of BT are you using? If it is a custom mp3 you have to add the filename either to the delegate or in 3.0 you have to add the mp3 file name to the array in BT_Layout/BT_loadConfigDataViewController.m file [appDelegate.soundEffectNames addObject:@"bt_funk.mp3"]; [appDelegate.soundEffectNames addObject:@"bt_glass.mp3"];
 
kingelessar
Lost but trying
Profile
Posts: 155
Reg: Mar 10, 2014
UK
6,500
like
05/19/14 06:19 AM (10 years ago)
Thanks for trying to help mysps. I knew about this and so it wasn't that. It's now fixed but I have no clue how. I spent all morning re-building the app, trying to re-run the simulator after every change in the code, but with all the bits of old data that invariably get left behind somewhere, I was unable to determine why it sometimes crashed and sometimes not. The only thing I would say is that it first happened when I tried to integrate Scringo and I suspect that Scringo and the quiz don't get along - at least not with playing sound in the quiz. Despite various re-starts etc there could have been some old code left over somewhere, I suspect.
 
CampGirl
Lost but trying
Profile
Posts: 144
Reg: Jan 10, 2013
Here and Now
7,240
like
05/22/14 07:02 AM (10 years ago)
Thanks for posting this- helped me with a quiz I'm working on. Also, where does the filename for other sounds go in the code, if I'm adding a background audio which loops a few times? I'm assuming it's like the appDelegates MySPS mentioned above but I don't see the line where it goes... Thanks for any help!
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
05/22/14 07:36 AM (10 years ago)
If its 2.0 its in the delegate. If its 3.0 it would be in the BT_ Layout folder :BT_loadConfigDataViewController.m Do a search for: mp3 and you will see the other mp3 filenames.
 
CampGirl
Lost but trying
Profile
Posts: 144
Reg: Jan 10, 2013
Here and Now
7,240
like
05/22/14 09:15 AM (10 years ago)
Thanks mysps
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.