Belini Posted April 7, 2015 Share Posted April 7, 2015 (edited) @BrewManNH, Thanks for the clarification! Edited April 7, 2015 by Belini My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
MarcroSoft Posted May 3, 2015 Share Posted May 3, 2015 Hi,I would like to play some data with bass which I have loaded into memory with FileOpen, which I will use later to load data from stdout, but how do I pass a string of data to bass?I have this code after bass is initialised:$file = fileopen(@ScriptDir & "\bass_example.wav", 16)$MusicHandle = _BASS_StreamCreateFile(True, fileread($file), 0, 0, 0)but it gives me an error 20.In the manual it says to pass a memory location, how do I do that?Regards,Marc Link to comment Share on other sites More sharing options...
MarcroSoft Posted July 27, 2015 Share Posted July 27, 2015 Hi,Has someone found a solution to my question above, I just can't get it.Marc Link to comment Share on other sites More sharing options...
Danyfirex Posted July 27, 2015 Share Posted July 27, 2015 Hi,Has someone found a solution to my question above, I just can't get it.MarcDo something like this.$file = @ScriptDir & "\bass_example.wav" Local $binData=FileRead($file) Local $Size=FileGetSize($file) Local $tData=DllStructCreate("byte[" & $Size & "]") Local $pData=DllStructGetPtr($tData) DllStructSetData($tData,1,$binData) $MusicHandle = _BASS_StreamCreateFile(True,$pData , 0, $Size, 0) $binData=0; FreeSaludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
MarcroSoft Posted July 28, 2015 Share Posted July 28, 2015 Hi,I don't know what that code is doing, but it Works, thanks!I also need to get 7-zip to extract a file to memory to play, but I also asked about that in another topic.Marc Link to comment Share on other sites More sharing options...
Danyfirex Posted July 28, 2015 Share Posted July 28, 2015 Hi,I don't know what that code is doing, but it Works, thanks!I also need to get 7-zip to extract a file to memory to play, but I also asked about that in another topic.Marc$file = @ScriptDir & "\bass_example.wav" ;Your File Path Local $binData=FileRead($file) ;Read the file an store to a variable Local $Size=FileGetSize($file) ;Get File Size Local $tData=DllStructCreate("byte[" & $Size & "]") ;Create a memory space with size of $Size Local $pData=DllStructGetPtr($tData) ;get memory space pointer DllStructSetData($tData,1,$binData) ;fill the memory space with your file data stored in the variable $MusicHandle = _BASS_StreamCreateFile(True,$pData , 0, $Size, 0) ;Play $binData=0; FreeSaludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
MarcroSoft Posted July 28, 2015 Share Posted July 28, 2015 Thanks! Link to comment Share on other sites More sharing options...
MarcroSoft Posted January 5, 2016 Share Posted January 5, 2016 Hi,Is it possible to join 2 or more sounds opened with bass_streamcreatefile so they play after each other in one channel?I think it would be great so that I don't need to constantly check the playing attribute.Thanks,Marc Link to comment Share on other sites More sharing options...
AndreyS Posted March 23, 2016 Share Posted March 23, 2016 Dear developers, please show me how to play the two parts of the file so that they sounded like a single file? I am trying to do this with the help of _SoundPlay function, but to no avail. Audible a pause or clicks. Re-read all this topic and I can not deal with this powerful UDF. Link to comment Share on other sites More sharing options...
dost0011 Posted September 26, 2017 Share Posted September 26, 2017 Is it possible to use bass.dll with several USB-Soundcards? If yes, how can I choose the right one? Thanks. Great dll Link to comment Share on other sites More sharing options...
nend Posted September 26, 2017 Share Posted September 26, 2017 1 hour ago, dost0011 said: Is it possible to use bass.dll with several USB-Soundcards? If yes, how can I choose the right one? Thanks. Great dll You can use _BASS_ChannelSetDevice to set the output device you want to. You can use _BASS_GetDeviceInfo to get all the listed audio devices. Link to comment Share on other sites More sharing options...
dost0011 Posted September 28, 2017 Share Posted September 28, 2017 Many thanks for the fast answer. I tried it but have the following problem: $return = _BASS_ChannelSetDevice($oPlayer1, 1) if $return = 0 then MsgBox(0,"",@error) $oPlayer1 = _BASS_StreamCreateFile(False, $Musikpath & $song1, 0, 0, 0) I get the @error = 5 --> invalid handle. Ok. If I change the lines: $oPlayer1 = _BASS_StreamCreateFile(False, $Musikpath & $song1, 0, 0, 0) $return = _BASS_ChannelSetDevice($oPlayer1, 1) if $return = 0 then MsgBox(0,"",@error) I get the error = 14 --> already initialized/paused/whatever What can I do? Is there anywhere a small example? Didn't find one. Thanks! Link to comment Share on other sites More sharing options...
nend Posted September 28, 2017 Share Posted September 28, 2017 (edited) @dost0011, please show me a full script so that I can see what's wrong with it? Did you set _BASS_Init? Something like this: ; Get all the audio devices For $i = 1 To 50 $info = _BASS_GetDeviceInfo($i) If @error Then ExitLoop Else If $info[0] <> "" Then ReDim $a_audio_device[$i + 1] $a_audio_device[$i] = $info[0] EndIf EndIf Next _ArrayDisplay($a_audio_device) ; Set Audo device $i = 1; device number _BASS_Init(0, $i, 44100, 0) _BASS_ChannelSetDevice($a_station_info[0], $i) Edited September 28, 2017 by nend Link to comment Share on other sites More sharing options...
dost0011 Posted September 28, 2017 Share Posted September 28, 2017 Hi, you're right - it's easier to show it with code. In the attachment you'll find example.au3. I tried to play the alarm01.wav on both soundcards (1 & 2) at the same time. In _ArrayDisplay($a_audio_device) I can see both devices - that's ok. But "_BASS_ChannelSetDevice($oPlayer1, 1)" doesn't work like supected - I get the @error = 14... What's wrong? Bass.zip Link to comment Share on other sites More sharing options...
dost0011 Posted September 29, 2017 Share Posted September 29, 2017 I got it :-) I have to initialize (_BASS_INIT()) with EVERY Device I want to use. Now it's possible to play 2 separate Soundfiles on 2 separate Devices at the same time: expandcollapse popup#include <Bass.au3> #include <BassConstants.au3> #include <array.au3> ;Open Bass.DLL. Required for all function calls. $ret = _BASS_STARTUP("Bass.dll") if $ret=0 then MsgBox(0,"Fehler","Bass.dll wurde nicht gefunden!") Global $a_audio_device[50] ; Get all the audio devices For $i = 1 To 50 $info = _BASS_GetDeviceInfo($i) If @error Then ExitLoop Else If $info[0] <> "" Then ReDim $a_audio_device[$i + 1] $a_audio_device[$i] = $info[0] _BASS_Init(0, $i, 44100, 0, "") EndIf EndIf Next _ArrayDisplay($a_audio_device) ;Initalize bass. Required for most functions. $oPlayer1 = _BASS_StreamCreateFile(False, "Alarm01.wav", 0, 0, $BASS_SAMPLE_LOOP) $oPlayer2 = _BASS_StreamCreateFile(False, "Alarm02.wav", 0, 0, $BASS_SAMPLE_LOOP) ; konfigure Device 1 for Player 1 _BASS_ChannelSetDevice($oPlayer1, 1) ; konfigure Device 2 for Player 2 _BASS_ChannelSetDevice($oPlayer2, 2) _BASS_ChannelPlay($oPlayer1, 0) _BASS_ChannelPlay($oPlayer2, 0) While 1 Sleep(100) WEnd Link to comment Share on other sites More sharing options...
Belini Posted September 29, 2017 Share Posted September 29, 2017 Is it possible to generate distortion in the audio file (Key + and key -) using this udf? My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
Belini Posted October 18, 2017 Share Posted October 18, 2017 Does anyone know how to use bass.dll to raise and lower semi-tones (karaok efffect) in music? My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
nend Posted October 18, 2017 Share Posted October 18, 2017 @Belini, this is a example I found in a older version of the bass.dll udf, maybe this is what you looking for? expandcollapse popup#AutoIt3Wrapper_UseX64=n #include "Bass.au3" #include "Bassmix.au3" Global $hMusicHandle, $hMixerHandle, $iSongLength _BASS_Startup() _BASS_MIX_Startup() _BASS_Init($BASS_DEVICE_SPEAKERS, -1, 44100, 0, "") If @error Then MsgBox(0, "Error", "Could not initialize audio") Exit EndIf $hGui = GUICreate("Karaoke Mode Test", 320, 80) $hSlider = GUICtrlCreateSlider(10, 10, 300, 30) $hButtonLoad = GUICtrlCreateButton("Load Song", 10, 50, 145, 20) $hButtonEnable = GUICtrlCreateButton("Enable Karaokemode", 165, 50, 145, 20) GUISetState() $bKaraoke = False While 1 $msg = GUIGetMsg() Switch $msg Case -3 _Exit() Case $hButtonEnable Switch $bKaraoke Case True $bKaraoke = False SetMatrix($hMusicHandle, 1, 1) GUICtrlSetData($hButtonEnable, "Enable KaraokeMode") Case Else $bKaraoke = True SetMatrix($hMusicHandle, 1, -1) GUICtrlSetData($hButtonEnable, "Disable KaraokeMode") EndSwitch Case $hButtonLoad If $hMusicHandle Then _BASS_ChannelStop($hMixerHandle) _BASS_StreamFree($hMusicHandle) EndIf $sFile = FileOpenDialog("Open...", "..\audiofiles", "MP3 Files (*.mp3)") $hMusicHandle = _BASS_StreamCreateFile(False, $sFile, 0, 0, $BASS_STREAM_DECODE + $BASS_SAMPLE_FLOAT + $BASS_SAMPLE_LOOP) $aInfo = _BASS_ChannelGetInfo($hMusicHandle) $hMixerHandle = _BASS_Mixer_StreamCreate($aInfo[0], 1, 0) _BASS_Mixer_StreamAddChannel($hMixerHandle, $hMusicHandle, $BASS_MIXER_MATRIX) $iSongLength = _BASS_ChannelGetLength($hMusicHandle, $BASS_POS_BYTE) _BASS_ChannelPlay($hMixerHandle, False) Case $hSlider If $hMusicHandle And $iSongLength Then $iPos = Round(GUICtrlRead($hSlider) * $iSongLength / 100) _BASS_ChannelSetPosition($hMusicHandle, $iPos, $BASS_POS_BYTE) EndIf EndSwitch Sleep(20) $aInfo = GUIGetCursorInfo($hGui) If Not $aInfo[2] And $aInfo[4] <> $hSlider And $hMusicHandle And $iSongLength Then $iPos = _BASS_ChannelGetPosition($hMusicHandle, $BASS_POS_BYTE) GUICtrlSetData($hSlider, $iPos * 100 / $iSongLength) EndIf WEnd Func SetMatrix($handle, $left, $right) Local $tStruct = DllStructCreate("float;float") DllStructSetData($tStruct, 1, $left) DllStructSetData($tStruct, 2, $right) _BASS_Mixer_ChannelSetMatrix($handle, DllStructGetPtr($tStruct)) EndFunc ;==>SetMatrix Func _Exit() _BASS_Free() Exit EndFunc ;==>_Exit Link to comment Share on other sites More sharing options...
Belini Posted October 18, 2017 Share Posted October 18, 2017 (edited) Thanks @nend, I did some tests with the example you posted but I could not change the semi tones as I need, maybe I'm not using the right function! Files to test Edited October 18, 2017 by Belini My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
nend Posted October 18, 2017 Share Posted October 18, 2017 @Belini, I don't either know how this works, I came across this snippets and thought this might help you. I know a bit how Bassdll udf works but I don't know all the ins and outs of it. Belini 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now