Playing Custom Sounds For Scanning

Savatage
Member Posts: 7,142
I read a post on the mircosoft website and it got me thinking.
Our warehouse does alot of scanning and when a package is closed I would like it to play a specific sound so they don't have to keep looking back at the screen to see if the order has been closed.
The sound is SOUND55.WAV which is from the Built In MS pinball game or something.
I added this code on
OnPush()
WMPlayer.openPlayer ('Mydrive:\MyDir\SOUND55.WAV');
Works fine But It pops the Windows Media Player Up and I just want the sound and I don't need WMP to POP in front of Navision & lose focus .
I tried the WMPlayer.ShowDisplay := FALSE;
AnimationAtStart := False
TransparentAtStart := False
ShowDisplay :=False
I get a NAv error when saving that Nav doesn't understand these params.
WMPlayer.close;
doesn't close anything?
Is there a parameter list or does anyone know how to get the sound only?
All the Params I could Find
http://www.w3schools.com/media/media_playerref.asp
Our warehouse does alot of scanning and when a package is closed I would like it to play a specific sound so they don't have to keep looking back at the screen to see if the order has been closed.
The sound is SOUND55.WAV which is from the Built In MS pinball game or something.
I added this code on
OnPush()
WMPlayer.openPlayer ('Mydrive:\MyDir\SOUND55.WAV');
Works fine But It pops the Windows Media Player Up and I just want the sound and I don't need WMP to POP in front of Navision & lose focus .
I tried the WMPlayer.ShowDisplay := FALSE;
AnimationAtStart := False
TransparentAtStart := False
ShowDisplay :=False
I get a NAv error when saving that Nav doesn't understand these params.
WMPlayer.close;
doesn't close anything?
Is there a parameter list or does anyone know how to get the sound only?
All the Params I could Find
http://www.w3schools.com/media/media_playerref.asp
0
Answers
-
Have a look at this download: Attain MP3 Player v1.1
Maybe you can look at the C/AL Code of that project to get you further.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
I have checked that out but It doesn't help me.
I just need a way to surpress the player and just get the sound.
I've tried a bunch of parameters but can't find the right one.0 -
I'll go with this until I can figure it out
BEEP(5000, 200);
BEEP(4000, 200);
BEEP(3000, 200);
BEEP(2000, 200);
BEEP(3000, 200);
BEEP(4000, 200);0 -
Did you try:
autWMPlayer OCX Windows Media Player autWMPlayer.Open('YourFavoriteSong.mp3');
No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
Hi Luc,
I think the problem is not playing the file in windows media player. The problem is that once the media player is open, the control does not switch back to Navision.
This is especially a problem when you're using a barcode scanner and want to play a .wav file to the user if an mistake is made, but want Navision to be active.
Harry, I've been trying to solve this problems too with our e-ship customers. Will let you know if I find a solution.Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
That's exactly what I'm using it for - Eship.
I've made the changes on these Functions...ClosePackage(PrintLabel : Boolean;ScaleWeight : BEEP(1000, 300);
OpenOrder() : Boolean BEEP(1000, 300);
CloseOrder(PrintOrder : Boolean;ForceClose : Boolean) BEEP(3000, 300); BEEP(2000, 300); BEEP(1000, 300);
Would be better to use real good noticable sounds instead of little beeps n' tings.
Yes, I can play the sound but I just want the sound without the whole WMP program getting in the way.0 -
When I use the OPEN method, Navision does not lose focus. No Media Player is displayed, but the file get played.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
I use
Var:
WMPlayer - OCX - Windows Media Player
Code:
WMPlayer.openPlayer ('Mydrive:\MyDir\SOUND55.WAV');
When I switch it to "open" alone I get
you have specified an unknown Variable
Open
Win 2000 server - using WMP 90 -
I also use the OCX automation variable. The Custom Control List shows it uses C:\WINDOWS\system32\wmp.dll. And that dll has version number 10.0.0.4036.
So you probably need to install Windows Media Player 10.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
That seems to be a problem - you can't install ver 10 on win 2000 server - it only allows up to 90
-
I rest my case ;-)No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
I'll see if I can add the wmp.dll from 10 to c:\windows\system32
and register that one too maybe rename it wmp10.dll or something.
](*,)0 -
Hmm... I just downloaded the Windows Media player version 10, however, I still don't get the *.open function. I tried to re-register my custom controls, but still don't get the *.open function.
Luc, what version of Navision are you using?Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
Updated to version 10.0.0.4036, but still no *.open command.
I'm using Windows XP Professional for my OS.Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
Sorry about the spam guys, but I've finally figured it out.
There are actually 2 OCX controls that's registered so you have to be careful of which one you select.
The one that Harry and myself was using was:
C:\WINDOWS\system32\wmp.dll
This OCX control only has the openPlayer method.
The one Luc was using was:
C:\WINDOWS\system32\msdxm.ocx
This OCX control has the open method available.
To get the C:\WINDOWS\system32\msdxm.ocx OCX control, I basically unregistered the existing C:\WINDOWS\system32\wmp.dll in Navision. Exited Navision, then re-register the wmp.dll file.
Afterwards, I get 2 OCX controls with Windows Media Player. One pointing to wmp.dll and the other one pointing to msdxm.ocx.Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
-
Does this topic deserve to be marked as [SOLVED]?Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
Using the correct ocx allows windows 2000 server to play the sounds too - update to ver 10 was not necessary0
-
Windows Media Player is huge and takes time to load, so there is a delay before the sound plays. I have made a small DLL with VC++ 6.0 to play WAV files, it's only 32KB in size. You can download it from here, including the source code.
The DLL provides 2 methods:
1 - Play
Plays a WAV file immediately, if there was a sound playing already, it's stopped and then the new sound begins playing immediately.
PARAMETRS:
FileName: WAV file to play.
Wait: Set to FALSE if you want the function to return immediately without waiting for the sound to finish.
2 - Stop
Stops any sound that might still be playing. You are not required to call this function.
Please try it and let me know. I have already tested it with Windows 98 and XP.Naji Shaman
http://www.autocloseidle.com0 -
Hmm... When my wav file was playing, I did not notice any delays... :?:Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
In my XP machine, wmp.dll is 5.26 MB in size, this might take some time to load. Hard disk caching could make this faster, but it still larger than 32K. In addition to that, Windows does not load the entire DLL into memory, only parts of it; this depends on how the developers made the DLL, so how much of the DLL is loaded is uncertain. However, WMP contains a lot of code to handle different file formats, including video, when it's just sufficient to only use WAV files. In the DLL I made, I used only PlaySound() API call, which exists in Windows 95+ and does not require WMP. Feel free to modify the code to suit your needs.
Few months ago; in a grocery store, one cashier was scanning items too quickly and sometimes the beep sound is too late, so the cashier thinks the item was not scanned probably, so she scans it again, only to hear 2 successive beeps, so now she has to cancel one of scans to avoid double charging the customer. She had to work slower to allow the machine to catch up.
I am not sure what software they are using, but they seem to have upgraded their systems a year ago and they are using modern equipment with LCD touch screens and all that.
So this alternative DLL is suitable for those who want to play WAV files only with minimal system resources.
I plan to submit this DLL to the download section of mibuso, but I wanted to hear from others if they want any changes made to the DLL before submitting it...Naji Shaman
http://www.autocloseidle.com0 -
Hey Harry, what was the sound file you ended up using? For us, we ended up using a high pitch WAV file so it can be heard even far away.
The file that gave the best results for us is:
http://www.talkingwav.com/wavs/beep_16.wav
Maybe you found something that's louder, higher pitch, and more annoying than this one?Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
search your computer for SOUND999.wav
it's part of the pinball game that comes with windows
it tell us the order is closed & screen cleared
it's pretty loud - we need that for our warehouse because we have radios's playing, fans, misc noise. easily heard
Renamed:
http://savatage99.googlepages.com/SOUNDLONG.WAV0 -
Just to finish this off
Add to codeunit 14000746 at the bottom of GetScaleWeightIF ScaleWeight = 0 THEN WMPlayer.Open ('"Your Drive"\SOUNDERROR.WAV');
http://savatage99.googlepages.com/SOUNDERROR.WAV0 -
Thx Harry, for putting that right ... after 2 years ;-)No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
-
Will this work if you don't use the scale?Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
Haven't tested it but I'm sure before the system gets to that point in the code (since you will have to manually enter a weight if you don't use a scale) that it makes you put something in else errors out way before then.
I guess.. :-k0 -
Windows Media Player is huge and takes time to load, so there is a delay before the sound plays. I have made a small DLL with VC++ 6.0 to play WAV files, it's only 32KB in size. You can download it from here, including the source code.
The DLL provides 2 methods:
1 - Play
Plays a WAV file immediately, if there was a sound playing already, it's stopped and then the new sound begins playing immediately.
PARAMETRS:
FileName: WAV file to play.
Wait: Set to FALSE if you want the function to return immediately without waiting for the sound to finish.
2 - Stop
Stops any sound that might still be playing. You are not required to call this function.
Please try it and let me know. I have already tested it with Windows 98 and XP.
Hi aci,
Thanks for sharing. But, how to use it in NAV?
Best regards,
Johanna0 -
Haha, I did exactly the same in 2006. We optimized the job on the factory shop floor so much that all the operator had is one huge field on screen to scan barcode into, and I gave out three short beeps, each higher than the other, trying to imitate R2 D2, when it was OK and one long bzzzzt nooope type low beep when it was wrong0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions