Jump to content

Recommended Posts

Posted

Does anyone know how to play sound directly w/o reading it from file? SoundPlay() requires sound to be stored as file but is it possible to make script that send sound directly to speakers w/o any saving it to file.

edited

Posted (edited)

Try this to play chip tunes directly from memory using bassmod.dll (also from memory):

http://autoit.pastebin.com/VNmkQZWh

I don't have enough free space left to upload it here! :x

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Posted (edited)

UEZs post:::::

or not, that issue is not limited to just you this time.

Edited by iamtheky

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Posted

@UEZ why your code is just a single line when i paste it onto scite?

Because forum software doesn't like me anymore :x

Use the link instead!

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Posted (edited)

Where you got that music? it sounds like some nitendo music from 8bit bit game. And what file standards you followed? midi or is it just raw data? and what does $Opcode? does it just load dll into memory or anything more? and where did you get that $Opcode?

Edited by E1M1

edited

Posted (edited)

Where you got that music? it sounds like some nitendo music from 8bit bit game.

from http://www.scenemusic.net/demovibes/songs/ for example

And what file standards you followed? midi or is it just raw data?

it is a xm file (eXtended Module)! check out http://www.un4seen.com/ for more details about bassmod.dll and what mods are supported!

and what does $Opcode? does it just load dll into memory or anything more?

the binary strings are the bassmod.dll and the chip sound. it will be loaded to the memory.

and where did you get that $Opcode?

you can convert any file with this code e.g.:

; ============================================================================================================================
; File     : MemoryDllGen.au3
; Purpose  : Convert DLL files to HEX binary data
; Author   : Ward
; modified : UEZ
; ============================================================================================================================

Local $VarName = StringStripWS(InputBox("MemoryDllGen", "Select a name of variable:", "DllBinary"), 3)
If $VarName = "" Then Exit

Local $DllName = FileOpenDialog("Open dll file", @ScriptDir, "DLL file (*.*)")
If $DllName = "" Then Exit

Local $Handle = FileOpen($DllName, 16)
Local $DllBinary = FileRead($Handle)
FileClose($Handle)

Local $LineLen = 1024
Local $DllString = String($DllBinary)

Local $Script = "Func " & $VarName & "()" & @CRLF & @TAB & "Local _" & @CRLF & @TAB & "$" & $VarName & " = '" & StringLeft($DllString, $LineLen) & "'" & @CRLF
$DllString = StringTrimLeft($DllString, $LineLen)


While StringLen($DllString) > $LineLen
    $Script &= "    $" & $VarName & " &= '" & StringLeft($DllString, $LineLen) & "'" & @CRLF
    $DllString = StringTrimLeft($DllString, $LineLen)
WEnd

If StringLen($DllString) <> 0 Then $Script &= "    $" & $VarName & " &= '" & $DllString & "'" & @CRLF
 $Script &= @TAB & "Return $" & $VarName & @CRLF & "EndFunc"
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $Script = ' & $Script & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
ClipPut($Script)

MsgBox(64, 'MemoryDll Generator', 'The result is in the clipboard, you can paste it to your script.')

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Posted

Very Cool! UEZ you're the user that just keeps giving! :x

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

  • 2 weeks later...
Posted

hi,

I want to play sounds like wave files in my script. But I want that nobody can play this files. So I have to encrypt the files or to include the files. But i didn't find a way to encrypt and play the files. Now i'm here and the question is: Can I include wave files into my script and play them? If yes, how? Can anybody explain it to me please? I'm a new programmer :x.

thanks.

Timtam

Posted (edited)

Here another method to play wave audio files from memory!

Source code here: http://autoit.pastebin.com/0fYwC9tZ

Original code by wolf9228 from this topic:

To create a binary string look to post #11.

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Posted

Can you tell me what part of post #11 you mean? the dll to hex binary? But this is only for dll's or can I convert other files into binary too?

Posted

Can you tell me what part of post #11 you mean? the dll to hex binary? But this is only for dll's or can I convert other files into binary too?

Yes, with the code from post #11 you can convert any kind of files to a binary string whereas binary files only would make sense!

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

  • 1 year later...
Posted

Here another method to play wave audio files from memory!

Source code here: http://autoit.pastebin.com/0fYwC9tZ

Original code by wolf9228 from this topic:

To create a binary string look to post #11.

Br,

UEZ

How to create WAV files (stereo, with volume and frequentz control for each channel (left,right)) in this form ..... like above example!?

Playing in memory!

  • 1 month later...
Posted

tnx Zenda

i don't how to use it.

i've just replaced my own MP3 with the music in example above and it didn't work:(

Posted (edited)

Here an example how to play a MP3 music from memory using FMOD.dll (also from memory ;) )

Play MP3 from mem using FMOD

Press ESC to stop sound and exit code.

Credits: MemoryDLL call code by Ward.

The Germans might know where the sound is from. :D

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...