Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 6    Views: 71

MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
01/30/13 10:14 AM (12 years ago)

ipad Story Book sound

Hey guys, I'm using this fantastic ipad story book plugin. I'd like to have the sound play automatically when you open the screen, and even have it stop when you change page. Has anyone been around this? Thanks. Miguel
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
01/30/13 11:44 AM (12 years ago)
Miguel, great ideas. And not hard to accomplish. I'll show you the first part (play automatically), then I'll double check the second part (stop when you change page). To get the sound file to automatically play: Open Xcode, and find the ipad_story_book_page.m file. (in your plugins folder) Copy/paste these lines of code at the bottom of your viewWillAppear method: //Plays MP3 sound effect - The MP3 file must be added to the sound array in the appDelegate (around line 900) [appDelegate playSoundEffect:[BT_strings getJsonPropertyValue:self.screenData.jsonVars:@"sbInteractionSound":@""]]; that should get pasted around line 219, but BEFORE the closing brace } That will automatically play the sound that you've assigned to the Interactive Button, even if you decide not to include the button. That way you can have a sound file play when the user turns the page (for example, to have a narrator read the story from the page every time you turn the page.) Hope that helps. Let me get some code together for the second part. -Chris
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
01/30/13 12:11 PM (12 years ago)
Thats just what I need. Thanks stobe. Cheers. Miguel
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
01/30/13 12:38 PM (12 years ago)
The other part brings some complications because of how the ipad uses sound channels. I have a way to stop the existing sound when you turn the page (which will fire the next sound, obviously). But if you turn the page back, it will continue to play the first sound from where it left off. For example: -I fire up the app and browse to page one -Page One starts to play my 2 minute sound file -After 1 minute, I turn to page 2. -Page 2 starts playing a 2 minute sound file -If I click "Back" to page 1, I'll hear the original sound file, starting in the middle of the sound. -And If I click "Next" to page 2, it will start in the middle also. If this is acceptable, I can give you the code for that. Otherwise, I'll have to go back to the drawing board on how to load and play the sound files. -Chris
 
feraco
Aspiring developer
Profile
Posts: 705
Reg: Jan 23, 2012
nyc
15,050
like
01/30/13 02:17 PM (12 years ago)
Can I use multiple page pdfs with ipad storybook?
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
01/30/13 11:17 PM (12 years ago)
@feraco, The plugin is setup to use simple background images for each page. You'd have to export the PDF pages individually as images, and format the to the correct size for the plugin. There should be programs what export multi-page PDFs as images, if you're dealing with large PDFs.
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
03/01/13 03:34 PM (12 years ago)
Hi stobe, that is acceptable. If you could share that code, it would be great. Thanks.
 

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.