| View previous topic :: View next topic |
| Author |
Message |
Fry
Joined: 01 Nov 2007 Posts: 689
|
Posted: Sun Apr 20, 2008 3:27 pm Post subject: SoundPause... |
|
|
I need help creating some sort of SoundPause.
If you know how please reply.
Thanks in advance. _________________ check out my site
www.eliteknifesquad.com |
|
| Back to top |
|
 |
Epuls56
Joined: 19 Apr 2008 Posts: 33
|
Posted: Sun Apr 20, 2008 3:40 pm Post subject: |
|
|
Wouldn't it be easy to just pause the script?
| Code: | Like p::pause
or label a button gPause
Pause:
pause |
|
|
| Back to top |
|
 |
Fry
Joined: 01 Nov 2007 Posts: 689
|
Posted: Sun Apr 20, 2008 3:42 pm Post subject: |
|
|
I tried that but it wouldnt stop the sound for some reason. _________________ check out my site
www.eliteknifesquad.com |
|
| Back to top |
|
 |
Epuls56
Joined: 19 Apr 2008 Posts: 33
|
Posted: Sun Apr 20, 2008 3:43 pm Post subject: |
|
|
| Really? Thats weird...let me test a script out real quick. |
|
| Back to top |
|
 |
Epuls56
Joined: 19 Apr 2008 Posts: 33
|
Posted: Sun Apr 20, 2008 3:46 pm Post subject: |
|
|
| I see what you mean. I'm going to mess around with it. |
|
| Back to top |
|
 |
Fry
Joined: 01 Nov 2007 Posts: 689
|
Posted: Sun Apr 20, 2008 3:47 pm Post subject: |
|
|
Okay, reply back with your findings _________________ check out my site
www.eliteknifesquad.com |
|
| Back to top |
|
 |
Trikster
Joined: 15 Jul 2007 Posts: 1224 Location: Enterprise, Alabama
|
Posted: Sun Apr 20, 2008 3:49 pm Post subject: |
|
|
There are some great sound functions posted by Jero3n.
Fusion MediaSuite 0.2 [BETA] [Jero3n]
Edit: The only downfall to using this is that all sound must be handled with the functions.
Functions:
| Code: | Sound_Open(File, Alias=""){
IfNotExist, %File%
{
ErrorLevel = 2
Return 0
}
If Alias =
{
Random, rand, 10, 10000000000000000000000000000000000000
Alias = AutoHotkey%rand%
}
Loop, %File%
File_Short = %A_LoopFileShortPath%
r := Sound_SendString("open " File_Short " alias " Alias)
If r
{
ErrorLevel = 1
Return 0
}Else{
ErrorLevel = 0
Return %Alias%
}
}
Sound_Close(SoundHandle){
r := Sound_SendString("close " SoundHandle)
Return NOT r
}
Sound_Play(SoundHandle, Wait=0){
If(Wait <> 0 AND Wait <> 1)
Return 0
If Wait
r := Sound_SendString("play " SoundHandle " wait")
Else
r := Sound_SendString("play " SoundHandle)
Return NOT r
}
Sound_Stop(SoundHandle){
r := Sound_SendString("seek " SoundHandle " to start")
r2 := Sound_SendString("stop " SoundHandle)
If(r AND r2)
{
Return 0
}Else{
Return 1
}
}
Sound_Pause(SoundHandle){
r := Sound_SendString("pause " SoundHandle)
Return NOT r
}
Sound_Resume(SoundHandle){
r := Sound_SendString("resume " SoundHandle)
Return NOT r
}
Sound_Length(SoundHandle){
r := Sound_SendString("set time format miliseconds", 1)
If r
Return 0
r := Sound_SendString("status " SoundHandle " length", 1, 1)
Return %r%
}
Sound_Seek(SoundHandle, Hour, Min, Sec){
milli := 0
r := Sound_SendString("set time format milliseconds", 1)
If r
Return 0
milli += Sec * 1000
milli += Min * 1000 * 60
milli += Hour * 1000 * 60 * 60
r := Sound_SendString("seek " SoundHandle " to " milli)
Return NOT r
}
Sound_Status(SoundHandle){
Return Sound_SendString("status " SoundHandle " mode", 1, 1)
}
Sound_Pos(SoundHandle){
r := Sound_SendString("set time format miliseconds", 1)
If r
Return 0
r := Sound_SendString("status " SoundHandle " position", 1, 1)
Return %r%
}
Sound_SeekSeconds(SoundHandle, Sec){
r := Sound_SendString("seek " SoundHandle " to " Sec)
Return NOT r
}
Sound_SetBass(SoundHandle){
r := Sound_SendString("setaudio " SoundHandle " bass to 1000")
Return
}
Sound_SendString(string, UseSend=0, ReturnTemp=0){
If UseSend
{
VarSetCapacity(stat1, 32, 32)
DllCall("winmm.dll\mciSendStringA", "UInt", &string, "UInt", &stat1, "Int", 32, "Int", 0)
}Else{
DllCall("winmm.dll\mciExecute", "str", string)
}
If(UseSend And ReturnTemp)
Return stat1
Else
Return %ErrorLevel%
} |
Last edited by Trikster on Sun Apr 20, 2008 3:51 pm; edited 1 time in total |
|
| Back to top |
|
 |
jaco0646
Joined: 07 Oct 2006 Posts: 666 Location: MN, USA
|
Posted: Sun Apr 20, 2008 3:51 pm Post subject: |
|
|
| AHK Help File wrote: | | To stop a file that is currently playing, use SoundPlay on a nonexistent filename as in this example: SoundPlay, Nonexistent.avi |
_________________ http://autohotkey.net/~jaco0646/ |
|
| Back to top |
|
 |
Trikster
Joined: 15 Jul 2007 Posts: 1224 Location: Enterprise, Alabama
|
Posted: Sun Apr 20, 2008 3:52 pm Post subject: |
|
|
| He wants to pause it, not stop it. |
|
| Back to top |
|
 |
Fry
Joined: 01 Nov 2007 Posts: 689
|
Posted: Sun Apr 20, 2008 3:52 pm Post subject: |
|
|
@jaco0646
I want SoundPause meaning to stop the song at a current spot then be able to resume it not just stop it completely _________________ check out my site
www.eliteknifesquad.com |
|
| Back to top |
|
 |
Fry
Joined: 01 Nov 2007 Posts: 689
|
Posted: Sun Apr 20, 2008 3:55 pm Post subject: |
|
|
@Ian
I would prefer not to use functions or maybe jsut one function to pause the song _________________ check out my site
www.eliteknifesquad.com |
|
| Back to top |
|
 |
jaco0646
Joined: 07 Oct 2006 Posts: 666 Location: MN, USA
|
Posted: Sun Apr 20, 2008 3:57 pm Post subject: |
|
|
Pausing sound (as Ian noted) will be totally dependent on the default media player. _________________ http://autohotkey.net/~jaco0646/ |
|
| Back to top |
|
 |
Epuls56
Joined: 19 Apr 2008 Posts: 33
|
Posted: Sun Apr 20, 2008 3:57 pm Post subject: |
|
|
| So far, no luck. Everything stops the song rather than pausing it x.x |
|
| Back to top |
|
 |
n-l-i-d Guest
|
Posted: Sun Apr 20, 2008 4:07 pm Post subject: |
|
|
The mci command is simply: pause
Check and adapt the mentioned mci script, you should be able to use pause alias/play alias |
|
| Back to top |
|
 |
Fry
Joined: 01 Nov 2007 Posts: 689
|
Posted: Sun Apr 20, 2008 4:47 pm Post subject: |
|
|
n-l-i-d please explain more _________________ check out my site
www.eliteknifesquad.com |
|
| Back to top |
|
 |
|