Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: searching an "insert-coin" sound  (Read 8827 times)

0 Members and 1 Guest are viewing this topic.

Gh0sty

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 56
  • Last login:December 04, 2019, 05:04:06 pm
  • flying Mame Player
searching an "insert-coin" sound
« on: November 15, 2006, 03:36:06 am »
Good morning,

i seach an Insert-Coin sound, when you insert a real coin into a Cab this kind
of noise. And i plan to use it with Mame when i press key 5 it shold first play
this coin sound and then then go on with the game sound.
I'm not a programmer so i dont know how to solve this, i have the I-Pac
and i could use a free key for starting a small external program for playing
just this Insert-Coin sound, and after that it should examine the standard key 5.
Any helps here, maybe someone wrote such a programm allready?

Best regards
Gh0sty

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: searching an "insert-coin" sound
« Reply #1 on: November 15, 2006, 04:17:25 am »
How will you write a program to do this if your not a programmer?

Anyhow, the best way to get a coin drop sound is to record sound from Mame32 then hit 5 it will play the coin drop sound of any of your favourite games.

To play a sound it's as simple as using the PlaySound API function in winmm.dll. Your program would basically look like this...

Code: [Select]
#include "stdafx.h"
#include <mmsystem.h>

#define VK_5 0x35

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
while (1)
{
Sleep(500);
if(GetAsyncKeyState(VK_5) & 0x8001)
PlaySound("1up.wav", NULL, SND_FILENAME | SND_ASYNC);
}

return 0;
}

Okay I decided to compile it for you. Attached is the program above.

Gh0sty

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 56
  • Last login:December 04, 2019, 05:04:06 pm
  • flying Mame Player
Re: searching an "insert-coin" sound
« Reply #2 on: November 15, 2006, 05:43:59 am »
hey headkaze,

many thanks for the help so far!
i'm at work right now and only can test out your prog later tonight at home,
i still dont know how it will work, or how to start it, but i will test everthing.
You write " the best way to get a coin drop sound is to record sound from Mame32 "
what do you mean with this? right now a friend is recording a real WAV sound from
an Arcade Cab for me. Does Mame32 have one build in ??

R
Gh0sty

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: searching an "insert-coin" sound
« Reply #3 on: November 15, 2006, 06:54:47 am »
hey headkaze,

many thanks for the help so far!
i'm at work right now and only can test out your prog later tonight at home,
i still dont know how it will work, or how to start it, but i will test everthing.
You write " the best way to get a coin drop sound is to record sound from Mame32 "
what do you mean with this? right now a friend is recording a real WAV sound from
an Arcade Cab for me. Does Mame32 have one build in ??

R
Gh0sty


It's built into Mame32 (File->Play and Record Wave Output...)

unclet

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3561
  • Last login:March 17, 2025, 11:51:15 am
Re: searching an "insert-coin" sound
« Reply #4 on: November 15, 2006, 07:14:09 am »
I attached some WAV sound files of coins being inserted into a game.  Hope it helps you out.

Gh0sty

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 56
  • Last login:December 04, 2019, 05:04:06 pm
  • flying Mame Player
Re: searching an "insert-coin" sound
« Reply #5 on: November 15, 2006, 03:47:09 pm »
WOW! that is ecsactly what i was searching for !
I start headkazes coinsound prog and i use unclet's coinF 75P.wav,
It sound great, but something is still not working like the real thing.
Headkaze, it plays the virtual Coin sound simultaneously with the Mame one
when pressing key 5. In reality your would first hear the Coin drop sound
and after that the Game sound.

coinF 75P.wav is aprox 1.66 seconds long, i dont know how much work it
would be for you to change the small programm so it plays the coin sound
and after 1.5 seconds it continue with Mame Sound?

R
Gh0sty
« Last Edit: November 15, 2006, 03:51:43 pm by Gh0sty »

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: searching an "insert-coin" sound
« Reply #6 on: November 15, 2006, 05:51:26 pm »
I'm afraid that would be alot harder to do! The only way to have a delay (without me writing some heavy low level stuff to hook the keyboard), would be to have an AutoIt script or AutoHotKey script that will trap the 5 key then send the 5 key again after a delay.

Something like this:
Code: [Select]
5::
Sleep 5000
Send 5
return

Although I just tried the above script and the sound still plays then it loops over for some reason.

Silver

  • Wiki Contributor
  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1668
  • Last login:April 16, 2025, 04:09:53 pm
  • Cunning like the Fox.
    • Mods'n'Mods
Re: searching an "insert-coin" sound
« Reply #7 on: November 15, 2006, 07:49:01 pm »
I think it plays twice as the original 5 press is being sent along with the 2nd after a delay....


Try a new unused key - that could trigger your personal sound, then get autohk to send a "5" after a delay.

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: searching an "insert-coin" sound
« Reply #8 on: November 15, 2006, 09:31:33 pm »
I think it plays twice as the original 5 press is being sent along with the 2nd after a delay....


Try a new unused key - that could trigger your personal sound, then get autohk to send a "5" after a delay.

There is still the problem that AutoHotKey dosn't seem to stop GetAsyncKeyState() from detecting the key, so it plays the sound anyway.

Gh0sty

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 56
  • Last login:December 04, 2019, 05:04:06 pm
  • flying Mame Player
Re: searching an "insert-coin" sound
« Reply #9 on: November 17, 2006, 10:54:46 am »
ok, thank you anyway for small programm and the listing!
Headkaze if you dont mind i will ask other programmers
to view & modify your program, maybe someone can figure it
out how to delay the sound.

Best Regards
Gh0sty

jlfreund

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 187
  • Last login:June 12, 2025, 02:25:33 pm
    • My project's blog
Re: searching an "insert-coin" sound
« Reply #10 on: November 20, 2006, 11:19:00 pm »
Wouldn't it be easier to use some kind of sound authoring tool to construct a wav file that has a delay, then a coin drop, then a clink sound?

Jason

leapinlew

  • Some questionable things going on in this room with cheetos
  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7919
  • Last login:July 12, 2025, 10:33:20 pm
Re: searching an "insert-coin" sound
« Reply #11 on: November 21, 2006, 12:15:14 am »
Wouldn't it be easier to use some kind of sound authoring tool to construct a wav file that has a delay, then a coin drop, then a clink sound?

Jason


awesome....

a few seconds of dead air.

Sometimes the easiest solution is the hardest to come up with. That was a genius suggestion.

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: searching an "insert-coin" sound
« Reply #12 on: November 21, 2006, 09:53:28 am »
You could use the Sleep() function to have a delay

Code: [Select]
if(GetAsyncKeyState(VK_5) & 0x8001)
{
Sleep(1000);
PlaySound("1up.wav", NULL, SND_FILENAME | SND_ASYNC);
}

But I think the problem is he wants the 1up sound in Mame to have the delay not the coin drop.

Gh0sty

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 56
  • Last login:December 04, 2019, 05:04:06 pm
  • flying Mame Player
Re: searching an "insert-coin" sound
« Reply #13 on: November 21, 2006, 10:23:39 am »
Folks, what Headkaze said, the Problem is not the insert-coin sound at all.
The problem is that both sounds (insert-coin & 1up-mame) play simultaneously.
But it should play the Insert-coin first till its finished and after that mame should
start his 1up sound.  I hope everyone understand this fundamental Problem now ;)

ahofle

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4544
  • Last login:August 30, 2023, 05:10:22 pm
    • Arcade Ambience Project
Re: searching an "insert-coin" sound
« Reply #14 on: January 31, 2007, 01:38:51 pm »
Has anyone gotten this to work?  I still don't understand why Silver's suggestion doesn't work.  I would think it should work if you made your coin button activate some other key than 5 (let's say 0).  Recompile headkaze's program to look for VK_0, and play the coin wav, then have the AutoHotKey listen for the 0, wait a second or two, and then send a 5 for MAME to consume and play the coinup sound. 

Nologic

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 54
  • Last login:November 21, 2008, 03:22:57 pm
Re: searching an "insert-coin" sound
« Reply #15 on: February 01, 2007, 09:54:43 am »
Actually here is a silly idea...why not join the sound files. :)

Seems like it would be fair less hassle, plus you can tweak the pitch, fade, and delay to where your perfectly happy.
"Pinky, you've left the lens cap of your mind on again." - The Brain

FrizzleFried

  • no one listens to me anyway.
  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5145
  • Last login:March 07, 2025, 10:44:09 am
    • Idaho Garagecade
Re: searching an "insert-coin" sound
« Reply #16 on: February 01, 2007, 10:10:01 am »
I took the easy way out and just attached a coin sound to the SELECTION button in mamewah.

Sure,  it doesn't make the coin noise when I actually give credits in MAME,  but it does play the noise every time you enter in to a new game from the FE.

Simple...acceptable...OK.

Visit my arcade blog at: www.idahogaragecade.com (Updated 10-28-21)

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re: searching an "insert-coin" sound
« Reply #17 on: February 01, 2007, 11:30:31 am »
Simplest solution: wire up a coin mech!

ahofle

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4544
  • Last login:August 30, 2023, 05:10:22 pm
    • Arcade Ambience Project
Re: searching an "insert-coin" sound
« Reply #18 on: February 01, 2007, 04:21:41 pm »
Actually here is a silly idea...why not join the sound files. :)

Because every game has a different coinup sound effect.  I wouldn't want the Frogger coinup sound to play for Pacman.  Only the coin drop sound is common. 

Nologic

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 54
  • Last login:November 21, 2008, 03:22:57 pm
Re: searching an "insert-coin" sound
« Reply #19 on: February 02, 2007, 04:05:09 am »
well a batch script or autoit script could be written to batch process the files being joined...if need be...ideally shouldn't be a big deal to code up if you had access to all the coinup sounds.

hehe tho maybe Minwah has a point. ;)

Other wise chat up the emu dev's to see if they could add such a novelity as an option to enable.
"Pinky, you've left the lens cap of your mind on again." - The Brain

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re: searching an "insert-coin" sound
« Reply #20 on: February 02, 2007, 04:53:34 am »
well a batch script or autoit script could be written to batch process the files being joined...if need be...ideally shouldn't be a big deal to code up if you had access to all the coinup sounds.

If the sounds in Mame were all samples that might be a solution but I don't think that is the way to go.

Quote
Other wise chat up the emu dev's to see if they could add such a novelity as an option to enable.

Don't hold your breathe!