Register for your free account! | Forgot your password?

You last visited: Today at 11:02

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Sound

Discussion on Sound within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jun 2010
Posts: 42
Received Thanks: 18
Sound

hi i need help in sound i know code that code Sound
Code:
#include <Sound.au3>
Local $aSound = _SoundOpen("F:\a\F.mp3")
If @error = 2 Then
	MsgBox(0, "Error", "The file does not exist")
	Exit
ElseIf @extended <> 0 Then
	Local $iExtended = @extended ; Assign because @extended will be set after DllCall.
	Local $tText = DllStructCreate("char[128]")
	DllCall("winmm.dll", "short", "mciGetErrorStringA", "str", $iExtended, "ptr", DllStructGetPtr($tText), "int", 128)
	MsgBox(0, "Error", "The open failed." & @CRLF & "Error Number: " & $iExtended & @CRLF & "Error Description: " & DllStructGetData($tText, 1) & @CRLF & "Please Note: The sound may still play correctly.")
Else
	MsgBox(0, "Success", "The file opened successfully")
EndIf

_SoundPlay($aSound, 1)

_SoundClose($aSound)
will work but if i make it F.exe and if i copy the F.exe out Folder the have F.Mp3 don't work i went make it work in any Driver Example D:\a\F.exe went it work F:\a\F.exe went it work E:\a\F.exe went it work G:\a\F.exe went it work C:\a\F.exe went it work can help?
osamaman2008 is offline  
Old 05/02/2012, 20:29   #2


 
K1ramoX's Avatar
 
elite*gold: 26
Join Date: Jan 2012
Posts: 3,474
Received Thanks: 18,847
FileInstall("F:\a\F.mp3", "F.mp3")

Add this in front of your code.
K1ramoX is offline  
Thanks
1 User
Old 05/02/2012, 20:45   #3
 
elite*gold: 0
Join Date: Jun 2010
Posts: 42
Received Thanks: 18
Quote:
Originally Posted by Applecode View Post
FileInstall("F:\a\F.mp3", "F.mp3")

Add this in front of your code.
Thanks you Applecode
it is work
;=======================
Applecode can help me again

i i went open Script and the sound play how add it ? Example

Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Test", 299, 112, 299, 218)
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 24, 24, 97, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit

	EndSwitch
WEnd
where i add
Code:
#include <Sound.au3>
Local $aSound = _SoundOpen("F:\a\F.mp3")
If @error = 2 Then
	MsgBox(0, "Error", "The file does not exist")
	Exit
ElseIf @extended <> 0 Then
	Local $iExtended = @extended ; Assign because @extended will be set after DllCall.
	Local $tText = DllStructCreate("char[128]")
	DllCall("winmm.dll", "short", "mciGetErrorStringA", "str", $iExtended, "ptr", DllStructGetPtr($tText), "int", 128)
	MsgBox(0, "Error", "The open failed." & @CRLF & "Error Number: " & $iExtended & @CRLF & "Error Description: " & DllStructGetData($tText, 1) & @CRLF & "Please Note: The sound may still play correctly.")
Else
	MsgBox(0, "Success", "The file opened successfully")
EndIf

_SoundPlay($aSound, 1)

_SoundClose($aSound)
FileInstall("F:\a\F.mp3", "F.mp3")
where add it ? to script open and sound play At the same time ?
osamaman2008 is offline  
Old 05/02/2012, 21:07   #4
 
elite*gold: 0
Join Date: Jun 2009
Posts: 121
Received Thanks: 13
FileInstall should be written after the includes.
Quote:
FileInstall("F:\a\F.mp3", "F.mp3")
Means that the file is being copied to the same folder as the script. The Line
Quote:
Local $aSound = _SoundOpen("F:\a\F.mp3")
has to be changed into
Code:
Local $aSound = _SoundOpen("F.mp3")
Why do you compare @error with 2?
Quote:
If @error = 2 Then
Tobolobo is offline  
Old 05/02/2012, 21:59   #5
 
*TheWarLords*'s Avatar
 
elite*gold: 0
Join Date: Mar 2012
Posts: 134
Received Thanks: 76
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Test", 299, 112, 299, 218)
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 24, 24, 97, 17)
GUISetState(@SW_SHOW)
Local $aSound = _SoundOpen("F:\a\F.mp3")
_SoundPlay($aSound)
FileInstall("F:\a\F.mp3")
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd
*TheWarLords* is offline  
Thanks
1 User
Old 05/03/2012, 13:40   #6


 
K1ramoX's Avatar
 
elite*gold: 26
Join Date: Jan 2012
Posts: 3,474
Received Thanks: 18,847
Quote:
Originally Posted by *TheWarLords* View Post
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Test", 299, 112, 299, 218)
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 24, 24, 97, 17)
GUISetState(@SW_SHOW)
Local $aSound = _SoundOpen("F:\a\F.mp3")
_SoundPlay($aSound)
FileInstall("F:\a\F.mp3")
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd
Srsly wrong. Do it like this:

Code:
#include <Sound.au3>

FileInstall("F:\a\F.mp3")
$aSound = _SoundOpen("F:\a\F.mp3")

$Form1 = GUICreate("Test", 299, 112, 299, 218)
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 24, 24, 97, 17)
GUISetState()

_SoundPlay($aSound)

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case -3
			_SoundClose($aSound)
			Exit

	EndSwitch
WEnd
K1ramoX is offline  
Reply


Similar Threads Similar Threads
[Release] CF German Sound Mod V 2.1 / Deutscher Sound mod 2.1
10/22/2010 - CrossFire Hacks, Bots, Cheats & Exploits - 13 Replies
Hey folks, As u saw in http://www.elitepvpers.com/forum/crossfire/394518-g erman-crossfire-sound-mod-deutscher-sound-mod.html i improved the sound modification. Now its supports: *male characters *female characters *the black market *the lobby sounds *the background music
TS2 sound to TS3 | alte TS2 Sound
01/17/2010 - Off Topic - 0 Replies
Wer die neue TS3 Sound nicht haben möchte sondern möchte die alte TS2 Sound hier. einfach die Sounds umtauschen. TS2 sound to TS3 http://www.mediafire.com/?f4lmsii5kl83q8h
German Crossfire Sound Mod - Deutscher Sound Mod
01/02/2010 - CrossFire - 26 Replies
Hey folks, I made a Sound Modification for Crossfire in German and English. There are mainly fun sounds and some elements of Postal 2 and UT therein. Readme File is also added. Scan: VirusTotal - Kostenloser online Viren- und Malwarescanner - Ergebnis Size: ~15MB Download



All times are GMT +2. The time now is 11:02.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.