 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Natascha Guest
|
Posted: Fri Oct 23, 2009 11:26 pm Post subject: SOund media samper problem |
|
|
Hi,
With this code i can press button d to play a sample (d.mp3), thats works fine, and when the sample has finish, after -7000, the music on my mediaplayer is back on the speakers. But when i press key d, and fast after that the upper key D, he plays _d.mp3, that working also fine, but when the d.mp3 has finish, the music is back again, also when upper D (_d.mp3) is playing, thats not what i want.
What i want is, when i press the last button, and play the latest sample, he must muting / holding the mediaplayer for the sound i press as latest. Not so that the music come back from the sound i press before.
So press key d and play d.mp3 & mute mediaplayer (works) but when i pres a other button, Upper D (_d.mp3) he must stop the action from d and start new action D (_d.mp3)
I hope some get understand me.
Thanks
| Code: | PostMessage, 0x111, 18817, 0, , Windows Media Player
return
d::
Caps := GetKeyState("CapsLock","T")
IfEqual, Caps, 1
goto UpperD
else
SoundPlay, %A_ScriptDir%\sounds\d.mp3
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
SoundSet, 1, Microphone, mute
soundset, 1, Line, mute
soundset, 1, Cd, mute
soundset, 1, Aux, mute
SetTimer, d_continue, -7000 ; run d_continue once, in 4 seconds.
return
d_continue:
SoundSet, 0, Microphone, mute
soundset, 0, Line, mute
soundset, 0, Cd, mute
soundset, 0, Aux, mute
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
return
UpperD:
SoundPlay, %A_ScriptDir%\sounds\_d.mp3
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
SoundSet, 1, Microphone, mute
soundset, 1, Line, mute
soundset, 1, Cd, mute
soundset, 1, Aux, mute
SetTimer, cd_continue, -1900 ; run cd_continue once, in 4 seconds.
return
cd_continue:
SoundSet, 0, Microphone, mute
soundset, 0, Line, mute
soundset, 0, Cd, mute
soundset, 0, Aux, mute
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
return |
|
|
| Back to top |
|
 |
Dirkie Guest
|
Posted: Sun Oct 25, 2009 5:28 pm Post subject: |
|
|
| What do you mean exactly? |
|
| Back to top |
|
 |
nataschabakker
Joined: 18 May 2009 Posts: 11 Location: Amsterdam Holand
|
Posted: Mon Oct 26, 2009 9:17 am Post subject: |
|
|
Okey that’s good.
If I press button a, it wil be play a sample a.mp3 for 10 seconds, also he mute the mediaplayer for 10 seconds and after 10 seconds, a.mp3 stops playing and the music from the mediaplayer is back. And that’s also with button s, if I press s, s.mp wil be playing for 20 seconds and the mediaplayer mute the music for 20 seconds, after 20 seconds, the music is back again.
But now the problem. If I press a and after 2 seconds I press s, he will play s.mp3, that’s oke, because I press s as latest, but in the background, the 10 seconds from button a is running also, so the unmute from a will be back and bring the music back on the mediaplayer while s.mp3 is playing.
So when I press a, and heys planning a.mp3, oke, after 2 seconds when I press s (s.mp3) he must stop the actions from a, including mute. So stop all actions from a and go further with the latest s action.
I hope someone can help me.
Thanks allot
X Natascha
See here the code i have now:
| Code: |
PostMessage, 0x111, 18817, 0, , Windows Media Player
return
a::
SoundPlay, %A_ScriptDir%\sounds\a.mp3
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
SoundSet, 1, Microphone, mute
soundset, 1, Line, mute
soundset, 1, Cd, mute
soundset, 1, Aux, mute
SetTimer, a_continue, 1000 ; run a_continue once, in 10 seconds.
Return
a_continue:
SoundSet, 0, Microphone, mute
soundset, 0, Line, mute
soundset, 0, Cd, mute
soundset, 0, Aux, mute
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
return
s:
SoundPlay, %A_ScriptDir%\sounds\s.mp3
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
SoundSet, 1, Microphone, mute
soundset, 1, Line, mute
soundset, 1, Cd, mute
soundset, 1, Aux, mute
SetTimer, s_continue, -2000 ; run s_continue once, in 20 seconds.
return
s_continue:
SoundSet, 0, Microphone, mute
soundset, 0, Line, mute
soundset, 0, Cd, mute
soundset, 0, Aux, mute
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
return
|
|
|
| Back to top |
|
 |
R.T.F.M. Guest
|
Posted: Mon Oct 26, 2009 12:58 pm Post subject: |
|
|
| I might have lost you, but why not run/identify the instance of a song separately and kill that beast once needed? |
|
| Back to top |
|
 |
nataschabakker
Joined: 18 May 2009 Posts: 11 Location: Amsterdam Holand
|
Posted: Mon Oct 26, 2009 1:25 pm Post subject: |
|
|
okay, if thats works why not.
Can u hel me with this? I have try many things and know where i must start, maybe there is a exampler or somehting |
|
| Back to top |
|
 |
nataschabakker
Joined: 18 May 2009 Posts: 11 Location: Amsterdam Holand
|
Posted: Mon Oct 26, 2009 9:32 pm Post subject: |
|
|
| Maybe there is a commando to stop the unmute function from a:: (play a.mp3) when i press the next button, or any other button? |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|