Audio, TouchKit, and Mobile Devices


I’m trying do develop an app that will be used on an android based scanner device. The device is used to take physical inventory in our plant. The application, developed with TouchKit as a proof-of-concept, works amazingly well, but there is one glaring exception: when a scanned item is not found in the database, or is in the wrong location, I want to sound an audible alert.
I have tried adding an Audio component to play the appropriate mp3 file to alert the user, however no sound is ever produced. I can place the same component in the desktop UI, and the sound plays perfectly well. I have tried on several mobile devices to make sure that it wasn’t a limitation of the android embedded in the scanner device, but it doesn’t appear to work on any mobile device.
Has anyone successfully integrated the Audio component with the TouchKit framework?



I did a similar application one year ago and had the same troubles.
As far as I remember it was a matter of browser’s security, not all browsers where reacting the same way.


So, did you get it to work? Or did you find another way?

I have found some interesting facts about using the audio component within TouchKit, and perhaps it might give someone a clue on what might need to be done to “fix” some of these issues.
setShowControls(false); will never allow the audio to play in the mobile device. This behavior is completely different on the desktop, where the audio will play whether or not the controls are showing.
setShowControls(true); will show the controls, and selecting the play button WILL play the audio.
setAutoPlay(true); seems to have no effect. The only way to begin playing the audio is to push the play button.
play(); doesn’t do anything really. If you navigate away from the current view where the audio is playing it will continue to play; navigating back to that view will cause the playback to stop, unless you call the play() method in the onBecomingVisible() method of the navigation view. The play() method works as expected on the desktop.
As I said in my original post, I would like to be able to use the Audio component to signal events on an android mobile scanning device. I have tested this with several different android devices and phones, and the behavior is the same.
So, to summarize, there doesn’t appear to be any way to programmatically begin play back from within the TouchKit framework. If this behavior could be changed, it would be awesome!

Bump! Anyone provide any insight on my questions?

Can anyone tell me who I might contact to get some information on how to use audio on mobile?

I had the same problem and found a solution here:

n Chrome (Android Version) enter
and set
Disable gesture requirement for media playback
to on.

Thanks daifel, I shall try that out!

Daifel, thank you so much. That solves the problem!! Now my handheld scanner can emit a terrifying sound when there is a scan error.