问题
I've developed a barcoding app that runs in a web browser on for example a motorola MC65 (WM 6.5) and a Cipherlab CP30. It works OK giving clear visual indication of the ticket status - let them in or don't.
What I would like to do is make different go / no go sounds depending on the status of the barcode I've just scanned being returned from the server. By having the different beeps, the user doesn't have to read the screen, but can move straight on to the next ticket to scan, speeding it up massively. Whilst we're about it, vibrating the phone would be great as well if the PDA supports it - very useful outisde a rock concert, but it's the beep that's a necessity.
Any ideas? Or is developing a native WM app the only way to go.
Will consider installing different browsers / software if it'll be cheaper than a custom app.
回答1:
yes, you can play wav files on the device controlled by html code. Here is a snippet from my post at http://www.hjgode.de/wp/2010/02/26/the-pocket-or-mobile-internet-explorer/: -->
<object type="audio/x-wav" data="file://\windows\asterisk.wav" width="1" height="1">
<param name="FileName" value="file://\windows\asterisk.wav">
<param name="hidden" value="true">
<param name="loop" value="false">
<param name="numloop" value="2">
</object>
<noembed>
<p>Could not embed wav file!</p>
</noembed>
<embed src="file://\windows\asterisk.wav" width="1" height="1" hidden="true" type="audio/x-wav">
<a href="javascript:document.embeds[0].play()">Starten</a>
I hope the snippet is right, the formatter did some strange replacements.
The snippet shows how you could play a wav as background (commented out) or by clicking a link. But you can also play the sound by just issuing the shown javascript:document.embeds[0].play() code.
For the LED control (vibrate included) I have not seen any way to do it from html. If you are able, you can write an activex to call native windows mobile API.
regards
Josef
回答2:
The bgsound is the easiest way. However it is not possible to play mp3 files. Just in html enter bgsound id=IDname and in javascript use IDname.src="sound.wav"; it can't be simpler
来源:https://stackoverflow.com/questions/11248861/how-can-i-make-a-windows-mobile-browser-beep