- This topic has 22 replies, 4 voices, and was last updated 10 years, 6 months ago by Code_A.
-
AuthorPosts
-
Code_AMemberThis is my first attempt at a callback function but I think it works. Give this a try and see if it helps:
playSound(findTIME); function playSound(callback) { AudioPlayerWidget.active.play(); callback(); }
falloffalotMemberSorry guys…still no go!
It’s gonna be something really stupid I just know it!I’ve attached the template to see if anyone can help.
ha ha so much for a simple build, this tiny thing is driving me crackers
PS. the attached is the bare bones version and just the stopwatch, have removed all the things that don’t work to keep it simple.
Thanks a million guys
Attachments:
You must be logged in to view attached files.
Code_AMemberYou can use this code to play the audio. I tested it in your file and the sound played and the findTIME() function worked. Be sure to add the audio file to your project before testing.
var audioFile = new Audio(); audioFile.src = "doorbell.mp3"; //audio file name audioFile.play(); audioFile = null; //cleanup
TurgutGuneysuMemberAttached is the modified MOBI file that plays a click sound when buttons are pressed.
Place the mp3 file into the www\Stopwatch_Help\audio where your mobi program is located.
Gen and Test.
I have also included a ZIP file of the generated www\Stopwatch_Help directory.
This one has everything included in the right places.
You can unzip it and run the Stopwatch_Help.html in the browser.I tested it in the Chrome browser and Mobi Simulator. Both work.
TG
Attachments:
You must be logged in to view attached files.
TurgutGuneysuMemberCode A,
Sorry I did not notice your post below until after I posted my reply.
I did not want to come across as having stolen your technique.
It was pure coincidence.
Cheers, Turgut@Code A wrote:
You can use this code to play the audio. I tested it in your file and the sound played and the findTIME() function worked. Be sure to add the audio file to your project before testing.
var audioFile = new Audio(); audioFile.src = "doorbell.mp3"; //audio file name audioFile.play(); audioFile = null; //cleanup
falloffalotMembertguneysu & others
Thank you guys so much for the help.
I now have sound to go with the Stop / Start on my stopwatch.Can’t thank you guys enough.
My skills are limited with MobiOne but if anyone who has helped needs any 3D models let me know.THE most helpful forum ever
falloffalotMemberI am really appreciative of the help guys, but just published and tested on my iPad2 and there is no sound???
Works perfectly using M1 sim but nothing on iPad?
Code_AMemberI am guessing it is one of these issues, either:
1. Your iPad is “soft” muted which can be remedied in this How To Fix No Sound in iPad Apps articled
or
2. You need to “enable” the sound through code after the initial app load due to Apple not allowing auto play on their devices. Here is an articled related to Audio Not Playing on iPad.
Hope this helps!
-
AuthorPosts