Jump to content
nacerbaaziz

easy audio player progect

Recommended Posts

nacerbaaziz

hellow guys
I am a blind young man
I started a project to make an audio player
with recorder
I ended the player and i did not know how to recorder
This player is Compatible with the blind and visually impaired and ordinary users
Unfortunately I do not see so I could not merge images and icons

So I hope you will be able to help me in this matter

I will bring you the open source project and please help me to add images, icons and recorder, the project is requires easy access in order to be compatible with the screen readers, Please take this into account.
the software is organized so the recorder is In a special  menu that Contains stop and start and pause and save.
The same is true for player
Please help
And greetings to all

easy player.zip

  • Like 1

Share this post


Link to post
Share on other sites
Xandy

Thanks for this script.  It was a lot of fun.  The script is doing things that I want to know how to do.  Your examples will help me quickly learn how to do this stuff. :)

(Things that probably aren't an issue anymore)

Spoiler

In easyPlayer.au3: Code had scope issues due to order of includes.  

I replaced Include FileOptions.au3 with File.au3.  Rewrote _FileGetDirPath, _GetFileName using _PathSplit() this was just to make it work.  I'm not sure my changes are the right way to go about things.

In options.au3: $Color_Green was giving me warnings replaced with 0x00C000.

 

Here is an updated example of easyPlayer.au3 in case anyone else wants to pickup with this running at default AutoIt settings.

#RequireAdmin
#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_UseUpx=y
#AutoIt3Wrapper_Res_Comment=easy player
#AutoIt3Wrapper_Res_Description=easy player
#AutoIt3Wrapper_Res_Fileversion=1.5.0.22
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
#AutoIt3Wrapper_Res_LegalCopyright=2017, by nacer baaziz
#AutoIt3Wrapper_Res_Language=1033
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

Global $sound = "", $MusicHandle, $reverb = false, $echo = false, $Chorus = false, $Reverse = false, $ReverbHandle, $EchoHandle, $ChorusHandle, $param

#######
#include <include\Bass.au3>
#include <include\BassConstants.au3>
#include <include\BassFX.au3>
#include <GUIConstants.au3>
#include <File.au3>
#include <include\restart.au3>
#include <include\func.au3>
#include <include\options.au3>
#include <include\Sec2Time.au3>
#include <include\languages.au3>
#include <ColorConstantS.au3>
#include <SliderConstants.au3>
#include <Sound.au3>
#include <ToolTipConstants.au3>
#include <UpDownConstants.au3>
#include <MenuConstants.au3>
#include <MsgBoxConstants.au3>

#include <ProgressConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListBox.au3>
;#include <FileOptions.au3>
########
Opt("GUICloseOnESC", 0)
main()
func main()
    _BASS_Startup(@scriptDir & "\dll\bass.dll")
    If @error = -1 Then
        MsgBox (0, "", "DLL Does not exist?  Please check file exists.")
        Exit
    EndIf

    _BASS_FX_Startup(@scriptDir & "\dll\bass_fx.dll")
    If @error = -1 Then
        MsgBox (0, "", "DLL Does not exist?  Please check file exists.")
        Exit
    EndIf
    _BASS_Init(0, -1, 44100, 0, "")
    If @error Then
        MsgBox(0, "Error", "Could not initialize audio")
        Exit
    EndIf

    ;global $sound = "", $MusicHandle, $reverb = false, $echo = false, $Chorus = false, $Reverse = false, $ReverbHandle, $EchoHandle, $ChorusHandle, $param
    global $file = False, $dir = 0, $filePos
    global $volume = ""
    $volume = RegRead("HKEY_CURRENT_USER\SOFTWARE\easy audio player", "volume")
    if @error then
    $volume = INIRead(@scriptdir&"settings.ini", "settings", "volume", "")
    If @Error then
    $volume = 50
    endIf
    _BASS_ChannelSetVolume($MusicHandle, $volume)
    endIf

    Global $Playing = False, $state = false
    global $sFilePath
    global $vlm = ""
    GUICreate("2")
    global $List = GUICtrlCreateList("", -1, -1, -1, -1)

    ###### command line ######
    If $CmdLine[0] = 0 Then
    $file = False
    ElseIf $CmdLine[0] = 1 Then
    $File = $CmdLine[1]
    $dir = _FileGetDirPath($file)
        _GUICtrlListBox_BeginUpdate($List)
        _GUICtrlListBox_Dir($List, $dir & "\*.mp3")
        _GUICtrlListBox_Dir($List, $dir & "\*.wav")
        _GUICtrlListBox_Dir($List, $dir & "\*.ogg")
        _GUICtrlListBox_Dir($List, $dir & "\*.mp1")
        _GUICtrlListBox_Dir($List, $dir & "\*.mp2")
        _GUICtrlListBox_Dir($List, $dir & "\*.m3u")
        _GUICtrlListBox_Dir($List, $dir & "\*.pls")

        _GUICtrlListBox_endUpdate($List)
    _GUICtrlListBox_SelectString($list, _GetFileName($file))

    $MusicHandle = _BASS_StreamCreateFile(False, $file, 0, 0, 0)
    _BASS_ChannelSetvolume($MusicHandle, $volume)
    _BASS_ChannelPlay($MusicHandle, 1)
    else
       Switch $CmdLine[1]
    Case "-play"

    $File = $CmdLine[2]
    $dir = _FileGetDirPath($file)
        _GUICtrlListBox_BeginUpdate($List)
        _GUICtrlListBox_Dir($List, $dir & "\*.mp3")
        _GUICtrlListBox_Dir($List, $dir & "\*.wav")
        _GUICtrlListBox_Dir($List, $dir & "\*.ogg")
        _GUICtrlListBox_Dir($List, $dir & "\*.mp1")
        _GUICtrlListBox_Dir($List, $dir & "\*.mp2")
        _GUICtrlListBox_Dir($List, $dir & "\*.m3u")
        _GUICtrlListBox_Dir($List, $dir & "\*.pls")

        _GUICtrlListBox_endUpdate($List)
    _GUICtrlListBox_SelectString($list, _GetFileName($file))

    $MusicHandle = _BASS_StreamCreateFile(False, $file, 0, 0, 0)
    _BASS_ChannelSetvolume($MusicHandle, $volume)
    _BASS_ChannelPlay($MusicHandle, 1)
    $Playing = True
    case else
    $file = $file
    endSwitch
    endIf
    ####### command line end #######
    ### check ###
    if not fileExists(@scriptdir & "\" & StringTrimRight(@scriptName, 4) & ".ini") then
    Opt("GUICloseOnESC", 1)
    Options()
    _scriptRestart()
    endIf
        Local $hGUI = GUICreate(_t("10"), 1000, 700)
        GUISetBkColor($COLOR_RED)

    ######### menu bar #######
    $FileMenu = GUICtrlCreateMenu(_t("100"))
        GUICtrlSetBkColor(-1, 0x8080ff)
    #######
    local $opene = GUICtrlCreateMenuItem(_t("101") & "... (ctrl+o)", $FileMenu)
        GUICtrlSetBkColor(-1, 0x8080ff)
    local $openURL = GUICtrlCreateMenuItem("open an url...", $FileMenu)
    local $explore = GUICtrlCreateMenuItem(_t("103") & "... (ctrl+e)", $FileMenu)
    local $ExitItem = GUICtrlCreateMenuItem(_t("102"), $FileMenu)
    #######
    local   $playMenu = GUICtrlCreateMenu(_t("200"))
    ####
    local $play = GUICtrlCreateMenuItem(_t("201") & "... (space)", $playMenu)

    local $stop = GUICtrlCreateMenuItem(_t("202") & "... (ctrl+space)", $playMenu)

    local $FORWARD = GUICtrlCreateMenuItem(_t("203") & "... (right key)", $playMenu)

    local $rearward = GUICtrlCreateMenuItem(_t("204") & "... (left key)", $playMenu)
    local $goto = GUICtrlCreateMenuItem(_t("210") & "... (ctrl+g)", $playMenu)
    local $up = GUICtrlCreateMenuItem(_t("205") & "... (up key)", $playMenu)
    local $down = GUICtrlCreateMenuItem(_t("206") & "... (down key)", $playMenu)
    local $fast = GUICtrlCreateMenuItem("faster", $playMenu)
    local $slow = GUICtrlCreateMenuItem("slowly", $playMenu)
    local $next = GUICtrlCreateMenuItem(_t(208) & "... (tab)", $playMenu)
    local $back = GUICtrlCreateMenuItem(_t(209) & "... (shift+tab)", $playMenu)
    ###
    local $efectMenu = GUICtrlCreateMenu(_t(300))
    local $rev = GUICtrlCreateMenuItem(_t(301) & "...", $efectMenu)
    local $ech = GUICtrlCreateMenuItem(_t(302) & "...", $efectMenu)
    local $chor = GUICtrlCreateMenuItem(_t(303) & "...", $efectMenu)

    ########
    local $toolsmenu = GUICtrlCreateMenu(_t("400"))
    ###########
    local $options = GUICtrlCreateMenuItem(_t("401"), $toolsMenu)
    local $recorderMe = GUICtrlCreateMenuItem("go to recorder mod...", $toolsMenu)
    ##########
    local $helppMenu = GUICtrlCreateMenu(_t("500"))
    ####

    ###
    ##########  menu bar end########
    ###label #####

    local $Label = GUICtrlCreateLabel("", 50, 80, 300, 70)

        GUICtrlSetBkColor(-1, 0xffffff)
    local $My = GUICtrlCreateLabel("welcom to easy player", 50, 10, 150, 50)
    local $Label1 = GUICtrlCreateLabel("00:00:00 / 00:00:00" & @crlf & "0%", 50, 120, 200, 70)
        GUICtrlSetBkColor(-1, 0x5ffffff)


    local $play2 = GUICtrlCreateLabel("play", 0, 200, 100, 50)
    local $stop2 = GUICtrlCreateLabel("stop", 350, 200, 100, 50)
    local $up2 = GUICtrlCreateLabel("volume(up)", 0, 250, 100, 50)
    local $down2 = GUICtrlCreateLabel("volume(down)", 350, 250, 100, 50)
    local $FORWARD2 = GUICtrlCreateLabel("FORWARD", 0, 300, 100, 50)
    local $reaRWARD2 = GUICtrlCreateLabel("reaRWARD", 350, 300, 100, 50)
    local $next2 = GUICtrlCreateLabel("next", 0, 360, 100, 50)

    local $back2 = GUICtrlCreateLabel("back", 350, 360, 100, 50)


    ########### label end########
    $hrecorder = GUICreate("recorder", 700, 700)
    GUICtrlCreateLabel("welcom to audio recorder" & @crlf & "please select your microphone and press start to begin recording." & @crlf & "if you want to stop it press stop, or press pause to pause the recorde." & @crlf & "when you finish your record press save to get your audio file.", 50, 10, 500, 100)
    GUICtrlCreateLabel("microphone", 100, 90, 100, 50)
    $microphone = GUICtrlCreateCombo("", 100, 100, 150, 50, $CBS_DROPDOWNList)
    $rstart = GUICtrlCreateButton("&start", 0, 200, 50, 50)
    $rstop = GUICtrlCreateButton("&stop", 150, 200, 50, 50)
    if $file then
    winSetTitle($hGUI, "", _t(10) & " : " & _GetFileName($file))
    endIf
        GUISetState(@SW_SHOW, $hGUI)
    $volume = RegRead("HKEY_CURRENT_USER\SOFTWARE\easy audio player", "volume")
    if @error then
    $volume = INIRead(@scriptdir&"settings.ini", "settings", "volume", "")
    If @Error then
    $volume = 50
    endIf
    _BASS_ChannelSetVolume($MusicHandle, $volume)
    endIf

    dim $aAccelKeys = [["^o", $opene], ["{space}", $play], ["{up}", $up], ["{down}", $down], ["{right}", $FORWARD], ["{left}", $rearward], ["^+o", $options], ["{tab}", $next], ["+{tab}", $back], ["{enter}", $play], ["!{left}", $back], ["!{right}", $next], ["^{space}", $stop], ["^g", $goto], ["^e", $explore], ["r", $rev], ["e", $ech], ["c", $chor], ["n", $next], ["b", $back], ["^u", $openURL], ["{MEDIA_NEXT}", $next], ["{MEDIA_PREV}", $back], ["{MEDIA_STOP}", $stop], ["{MEDIA_PLAY_PAUSE}", $play]]
        GUISetAccelerators($aAccelKeys, 0)
        While 1


        GUISetAccelerators($aAccelKeys, 0)

            Switch GUIGetMsg()
                Case $GUI_EVENT_CLOSE, $exititem
    _BASS_ChannelStop($MusicHandle)
        _BASS_Free()
                    Exit
    case $explore
    $oPath = _fileGetDirPath($file)
    ShellExecute("explorer.exe","/select, " & $oPath & GUICtrlRead($list))

    case $up, $up2
    if $volume >= 100 then
    $vlm = 100
    else
    $vlm = $volume+10
    endIf
    $volume = $vlm
    INIWrite(@scriptDir&"\" & StringTrimRight(@scriptName, 4) & ".ini", "settings", "volume", $vlm)
    RegWrite("HKEY_CURRENT_USER\SOFTWARE\easy audio player", "volume", "REG_SZ", $vlm)
    _BASS_ChannelSetVolume($MusicHandle, $vlm)

    case $down, $down2

    if $volume <= 0 then
    $vlm = 0
    else
    $vlm = $volume-10
    endIf
    $volume = $vlm
    INIWrite(@scriptDir&"\" & StringTrimRight(@scriptName, 4) & ".ini", "settings", "volume", $vlm)
    RegWrite("HKEY_CURRENT_USER\SOFTWARE\easy audio player", "volume", "REG_SZ", $vlm)
    _BASS_ChannelSetVolume($MusicHandle, $vlm)


                Case $play, $play2
    if not $file then
    $Fileopen = FileOpenDialog("Select Audio file","","Sound Files(*.mp1;*.mp2;*.mp3;*.wav;*.ogg;*.m3u;*.pls)|All siported Files(*.*)")
    if not @error then
    $file = $fileOpen
    $dir = _FileGetDirPath($file)
        _GUICtrlListBox_BeginUpdate($List)
        _GUICtrlListBox_Dir($List, $dir & "\*.mp3")
        _GUICtrlListBox_Dir($List, $dir & "\*.wav")
        _GUICtrlListBox_Dir($List, $dir & "\*.ogg")
        _GUICtrlListBox_Dir($List, $dir & "\*.mp1")
        _GUICtrlListBox_Dir($List, $dir & "\*.mp2")
        _GUICtrlListBox_Dir($List, $dir & "\*.m3u")
        _GUICtrlListBox_Dir($List, $dir & "\*.pls")
        _GUICtrlListBox_endUpdate($List)
    _GUICtrlListBox_SelectString($list, _GetFileName($file))
    $MusicHandle = _BASS_StreamCreateFile(False, $file, 0, 0, 0)
    _BASS_ChannelSetDevice($MusicHandle, 1)
    _BASS_ChannelSetvolume($MusicHandle, $volume)
    autoefect()
    _BASS_ChannelPlay($MusicHandle, 1)
    if @error then
    msgbox(16, "error", @error)
    else
    GUICtrlSetData($label, @crlf & _GetFileName($file) & @crlf & " in progress")
    GUICtrlSetData($PLAy,_t(207) & "... (space)")
    GUICtrlSetData($PLAy2,"&pause")
    $Playing = True
    winSetTitle($hGUI, "", _t(10) & " : " & _GetFileName($file))

    endIf



    winSetTitle($hGUI, "", _t(10) & " : " & _GetFileName($file))
    endIf
    else
    SWITCH _BASS_ChannelIsActive($MusicHandle)
    case 0
    _BASS_ChannelSetDevice($MusicHandle, 1)
    _BASS_ChannelSetvolume($MusicHandle, $volume)

    _BASS_ChannelPlay($MusicHandle, 1)
    GUICtrlSetData($PLAy,_t(207) & "... (space)")
    GUICtrlSetData($PLAy2,"&pause")

    $Playing = True

    case 1
    _BASS_ChannelPause($MusicHandle)
    GUICtrlSetData($PLAY,_t(201) & "... (space)")
    GUICtrlSetData($PLAY2,"play")
    $Playing = False

    case 3
    _BASS_ChannelSetDevice($MusicHandle, 1)
    _BASS_ChannelSetvolume($MusicHandle, $volume)
    _BASS_ChannelPlay($MusicHandle, 0)
    GUICtrlSetData($PLAy,_t(207) & "... (space)")
    GUICtrlSetData($PLAy2,"&pause")

    $Playing = True

    case else
    $Fileopen = FileOpenDialog("Select Audio file","","Sound Files(*.mp1;*.mp2;*.mp3;*.wav;*.ogg;*.m3u;*.pls)|All siported Files(*.*)")
    if not @error then
    $file = $fileOpen
    $dir = _FileGetDirPath($file)
        _GUICtrlListBox_BeginUpdate($List)
        _GUICtrlListBox_Dir($List, $dir & "\*.mp3")
        _GUICtrlListBox_Dir($List, $dir & "\*.wav")
        _GUICtrlListBox_Dir($List, $dir & "\*.ogg")
        _GUICtrlListBox_Dir($List, $dir & "\*.mp1")
        _GUICtrlListBox_Dir($List, $dir & "\*.mp2")
        _GUICtrlListBox_Dir($List, $dir & "\*.m3u")
        _GUICtrlListBox_Dir($List, $dir & "\*.pls")

        _GUICtrlListBox_endUpdate($List)
    _GUICtrlListBox_SelectString($list, _GetFileName($file))
    $MusicHandle = _BASS_StreamCreateFile(False, $file, 0, 0, 0)
    _BASS_ChannelSetDevice($MusicHandle, 1)
    _BASS_ChannelSetvolume($MusicHandle, $volume)
    autoefect()
    _BASS_ChannelPlay($MusicHandle, 1)
    if @error then
    msgbox(16, "error", @error)
    endIf
    GUICtrlSetData($PLAy,_t(207) & "... (space)")
    GUICtrlSetData($PLAy2,"&pause")
    $Playing = True

    endIf
    endSwitch
    endIf
    case $opene

    $Fileopen = FileOpenDialog("Select Audio file","","Sound Files(*.mp1;*.mp2;*.mp3;*.wav;*.ogg;*.m3u;*.pls)|All siported Files(*.*)")
    if not @error then
    $file = $fileOpen
    $dir = _FileGetDirPath($file)
        _GUICtrlListBox_BeginUpdate($List)
        _GUICtrlListBox_Dir($List, $dir & "\*.mp3")
        _GUICtrlListBox_Dir($List, $dir & "\*.wav")
        _GUICtrlListBox_Dir($List, $dir & "\*.ogg")
        _GUICtrlListBox_Dir($List, $dir & "\*.mp1")
        _GUICtrlListBox_Dir($List, $dir & "\*.mp2")
        _GUICtrlListBox_Dir($List, $dir & "\*.m3u")
        _GUICtrlListBox_Dir($List, $dir & "\*.pls")

        _GUICtrlListBox_endUpdate($List)
    _GUICtrlListBox_SelectString($list, _GetFileName($file))

    _BASS_ChannelStop($MusicHandle)
    $MusicHandle = _BASS_StreamCreateFile(False, $file, 0, 0, 0)
    _BASS_ChannelSetDevice($MusicHandle, 1)
    _BASS_ChannelSetvolume($MusicHandle, $volume)
    autoefect()
    _BASS_ChannelPlay($MusicHandle, 1)
    if @error then
    msgbox(16, "error", _BASS_ErrorGetCode())
    else
    GUICtrlSetData($label, @crlf & _GetFileName($file) & @crlf & " in progress")
    GUICtrlSetData($PLAy,_t(207) & "... (space)")
    GUICtrlSetData($PLAy2,"&pause")
    $Playing = True
    winSetTitle($hGUI, "", _t(10) & " : " & _GetFileName($file))

    endIf

    endIf
    case $openUrl
    $url = InputBox("play an url audio", "enter the file url")
    if not @error then
    $MusicHandle = _BASS_StreamCreateURL($url, 0, 0)
    _BASS_ChannelSetvolume($MusicHandle, $volume)
    autoefect()
    _BASS_ChannelPlay($MusicHandle, 0)
    $file = $url
    winSetTitle($hGUI, "", _t(10) & " : " & _GetFileName($file))
    endIf
    Case $STOP, $stop2
    GUICtrlSetData($PLAY,_t("201") & "... (space)")
    GUICtrlSetData($PLAY2,"play")
    $Playing = False
    _BASS_ChannelStop($MusicHandle)
    _BASS_ChannelSetPosition($MusicHandle, 0, $BASS_POS_BYTE)
    GUICtrlSetData($label1, _Sec2Time(Round(_BASS_ChannelBytes2Seconds($MusicHandle, _BASS_ChannelGetPosition($MusicHandle, 0)))) & " / " & _sec2Time(Round(_BASS_ChannelBytes2Seconds($MusicHandle, _BASS_ChannelGetLength($MusicHandle, 0)))) & @crlf & Round((_BASS_ChannelGetPosition($MusicHandle, 0) / _BASS_ChannelGetLength($MusicHandle, 0)) * 100, 0) & "%")
    Case $rearward, $rearward2
    $pos = _BASS_ChannelGetPosition($MusicHandle, $BASS_POS_BYTE)
    if $pos < _BASS_ChannelSeconds2Bytes($MusicHandle, 5) then
    _BASS_ChannelSetPosition($MusicHandle, 0, $BASS_POS_BYTE)
    else
    _BASS_ChannelSetPosition($MusicHandle, $pos-_BASS_ChannelSeconds2Bytes($MusicHandle, 5), $BASS_POS_BYTE)
    endIf
    Case $FORWARD, $FORWARD2

    $pos = _BASS_ChannelGetPosition($MusicHandle, $BASS_POS_BYTE)
    $length = _BASS_ChannelGetLength($MusicHandle, $BASS_POS_BYTE)
    if $pos+_BASS_ChannelSeconds2Bytes($MusicHandle, 5) >= $length then
    _BASS_ChannelSetPosition($MusicHandle, $length, $BASS_POS_BYTE)
    else
    _BASS_ChannelSetPosition($MusicHandle, $pos+_BASS_ChannelSeconds2Bytes($MusicHandle, 5), $BASS_POS_BYTE)
    endIf
    case $goto
    GUISetState(@sw_hide, $hGUI)
    Opt("GUICloseOnESC", 1)
    $sPosition = Round(_BASS_ChannelBytes2Seconds($MusicHandle, _BASS_ChannelGetPosition($MusicHandle, $BASS_POS_BYTE)))

    $goToDo = _goto($sPosition)

    if $goToDo = $sPosition then
    $GoToDo = false
    $sPosition = false

    else
    _BASS_ChannelSetPosition($MusicHandle, _BASS_ChannelSeconds2Bytes($MusicHandle, $GoToDo), $BASS_POS_BYTE)
    $GoToDo = false
    $sPosition = false

    endIf
    Opt("GUICloseOnESC", 0)
    GUISetState(@sw_show, $hGUI)
    case $my
    MSGBox(0, "about apps", "this app is an small tool which help you to play your audio files" & @crlf & "this app is devloped by nacer baaziz")
    case $next, $next2
    if $file then

    $filePos = $file
    $all = StringReplace(_GUICtrlListBox_GetCount($list), " ", "")
    $pushd = StringReplace(_GUICtrlListBox_GetCurSel($list), " ", "")

    if $pushd = $all-1 then
    $pushd = 0
    $text = _GUICtrlListBox_GetText($list, $pushd)
    _GUICtrlListBox_setCurSel($list, $pushd)
    _BASS_ChannelStop($MusicHandle)
    $MusicHandle = _BASS_StreamCreateFile(False, $Dir & $text, 0, 0, 0)
    _BASS_ChannelSetvolume($MusicHandle, $volume)
    _BASS_ChannelPlay($MusicHandle, 1)
    if @error then
    $MusicHandle = _BASS_StreamCreateFile(False, $file, 0, 0, 0)
    _BASS_ChannelSetvolume($MusicHandle, $volume)
    _BASS_ChannelPlay($MusicHandle, 1)
    else
    $file = $Dir & $text
    GUICtrlSetData($label, @crlf & _GetFileName($file) & @crlf & " in progress")
    winSetTitle($hGUI, "", _t(10) & " : " & _GetFileName($file))
    endIf
    autoEfect()
    else

    $text = _GUICtrlListBox_GetText($list, $pushd+1)
    _GUICtrlListBox_setCurSel($list, $pushd+1)
    _BASS_ChannelStop($MusicHandle)
    $MusicHandle = _BASS_StreamCreateFile(False, $Dir & $text, 0, 0, 0)
    _BASS_ChannelSetvolume($MusicHandle, $volume)
    _BASS_ChannelPlay($MusicHandle, 1)
    if @error then
    $MusicHandle = _BASS_StreamCreateFile(False, $file, 0, 0, 0)
    _BASS_ChannelSetvolume($MusicHandle, $volume)
    _BASS_ChannelPlay($MusicHandle, 1)
    else

    $file = $Dir & $text
    GUICtrlSetData($label, @crlf & _GetFileName($file) & @crlf & " in progress")
    winSetTitle($hGUI, "", _t(10) & " : " & _GetFileName($file))
    endIf
    autoEfect()
    endIf

    endIf
    case $Back, $back2
    if $file then
    $all = _GUICtrlListBox_GetCount($list)
    $pushd = _GUICtrlListBox_GetCurSel($list)
    if $pushd = 0 then
    $pushd = $all
    endIf
    $text = _GUICtrlListBox_GetText($list, $pushd-1)
    _GUICtrlListBox_setCurSel($list, $pushd-1)
    _BASS_ChannelStop($MusicHandle)
    $MusicHandle = _BASS_StreamCreateFile(False, $Dir & $text, 0, 0, 0)
    _BASS_ChannelSetvolume($MusicHandle, $volume)
    _BASS_ChannelPlay($MusicHandle, 1)
    if @error then
    $MusicHandle = _BASS_StreamCreateFile(False, $file, 0, 0, 0)
    _BASS_ChannelSetvolume($MusicHandle, $volume)
    _BASS_ChannelPlay($MusicHandle, 1)
    else

    $file = $Dir & $text
    GUICtrlSetData($label, @crlf & _GetFileName($file) & @crlf & " in progress")
    winSetTitle($hGUI, "", _t(10) & " : " & _GetFileName($file))
    endIf
    autoEfect()
    endIf
    case $rev
                If not $reverb then
                    _BASS_FXSetParameters($ReverbHandle, "0")
                    _BASS_ChannelRemoveFX($MusicHandle, $ReverbHandle)
                    $ReverbHandle = _BASS_ChannelSetFX($MusicHandle, $BASS_FX_DX8_REVERB, 7)

                    _BASS_FXSetParameters($ReverbHandle, "2|-8|3000|0.010")
    $reverb = true
    GUICtrlSetState($rev, $GUI_checked)
                Else
                    _BASS_FXSetParameters($ReverbHandle, "0")
                    _BASS_ChannelRemoveFX($MusicHandle, $ReverbHandle)


    $reverb = false
    GUICtrlSetState($rev, $GUI_unchecked)
                EndIf
    case $ech
                If not $echo Then
                    _BASS_FXSetParameters($EchoHandle, "0")
                    _BASS_ChannelRemoveFX($MusicHandle, $EchoHandle)
                    $EchoHandle = _BASS_ChannelSetFX($MusicHandle, $BASS_FX_BFX_ECHO2, 6)
                    _BASS_FXSetParameters($EchoHandle, "0")
                    _BASS_FXSetParameters($EchoHandle, "1|0.3|0.4|1|" & $BASS_BFX_CHANALL)
    $echo = true
    GUICtrlSetState($ech, $GUI_checked)
                Else
                    _BASS_FXSetParameters($EchoHandle, "0")
                    _BASS_ChannelRemoveFX($MusicHandle, $EchoHandle)
    $echo = false
    GUICtrlSetState($ech, $GUI_unchecked)
                EndIf
    case $Chor
                If not $Chorus then
                    _BASS_FXSetParameters($ChorusHandle, "0")
                    _BASS_ChannelRemoveFX($MusicHandle, $ChorusHandle)
                    $ChorusHandle = _BASS_ChannelSetFX($MusicHandle, $BASS_FX_BFX_CHORUS, 5)
                    $param = _BASS_FXGetParameters($ChorusHandle)

                    _BASS_FXSetParameters($ChorusHandle, "1|0.6|0.2|2|11|4|" & $BASS_BFX_CHANALL)
    $Chorus = true
    GUICtrlSetState($chor, $GUI_checked)
                Else
                    _BASS_FXSetParameters($ChorusHandle, "0")
                    _BASS_ChannelRemoveFX($MusicHandle, $ChorusHandle)
    $Chorus = false
    GUICtrlSetState($chor, $GUI_unchecked)
                EndIf
    case $fast
    local $t = 0



    local $t2 = _BASS_ChannelSetAttribute ($MusicHandle, $BASS_ATTRIB_TEMPO, $t+10)
    $t = $t2
    case $recorderMe
    GUISetState(@sw_hide, $hGUI)
    GUISetState(@sw_show, $HRecorder)
    case $options
    Opt("GUICloseOnESC", 1)
        GUISetState(@SW_hide, $hGUI)
    $return = options()
    if $return = 1 then
    $answer = MSGBox(4, "the settings has been changed", "to apply the new settings you must to restart your application, do you want to restart it now? press yes to restart it now or no to restart it later")
    switch $answer
    case 6
    _scriptRestart()
    case 7
    Opt("GUICloseOnESC", 0)
        GUISetState(@SW_show, $hGUI)
    endSwitch
    else
    Opt("GUICloseOnESC", 0)
        GUISetState(@SW_show, $hGUI)
    endIf

            EndSwitch
    if _BASS_ChannelIsActive($MusicHandle) = 1 and $file then
    GUICtrlSetData($label1, _Sec2Time(Round(_BASS_ChannelBytes2Seconds($MusicHandle, _BASS_ChannelGetPosition($MusicHandle, 0)))) & " / " & _sec2Time(Round(_BASS_ChannelBytes2Seconds($MusicHandle, _BASS_ChannelGetLength($MusicHandle, 0)))) & @crlf & Round((_BASS_ChannelGetPosition($MusicHandle, 0) / _BASS_ChannelGetLength($MusicHandle, 0)) * 100, 0) & "%")
    endIf
    if $file then
    if _BASS_ChannelGetPosition($MusicHandle, $BASS_POS_BYTE) = _BASS_ChannelGetLength($MusicHandle, $BASS_POS_BYTE) then
    Sleep(500)
    $all = StringReplace(_GUICtrlListBox_GetCount($list), " ", "")
    $pushd = StringReplace(_GUICtrlListBox_GetCurSel($list), " ", "")

    if $pushd = $all-1 then
    $pushd = 0
    $text = _GUICtrlListBox_GetText($list, $pushd)
    _GUICtrlListBox_setCurSel($list, $pushd)
    _BASS_ChannelStop($MusicHandle)
    $MusicHandle = _BASS_StreamCreateFile(False, $Dir & $text, 0, 0, 0)
    _BASS_ChannelPlay($MusicHandle, 1)
    if @error then
    _BASS_ChannelStop($MusicHandle)
    $MusicHandle = _BASS_StreamCreateFile(False, $file, 0, 0, 0)
    _BASS_ChannelPlay($MusicHandle, 1)
    else

    $file = $Dir & $text
    GUICtrlSetData($label, @crlf & _GetFileName($file) & @crlf & " in progress")
    winSetTitle($hGUI, "", _t(10) & " : " & _GetFileName($file))
    endIf
    autoEfect()
    elseif $pushd = $all then
    _BASS_ChannelPlay($MusicHandle, 1)
    GUICtrlSetData($label, @crlf & _GetFileName($file) & @crlf & " in progress")
    else
    $text = _GUICtrlListBox_GetText($list, $pushd+1)
    _GUICtrlListBox_setCurSel($list, $pushd+1)
    _BASS_ChannelStop($MusicHandle)
    $MusicHandle = _BASS_StreamCreateFile(False, $Dir & $text, 0, 0, 0)
    _BASS_ChannelPlay($MusicHandle, 1)
    if @error then
    _BASS_ChannelStop($MusicHandle)
    $MusicHandle = _BASS_StreamCreateFile(False, $file, 0, 0, 0)
    _BASS_ChannelPlay($MusicHandle, 1)
    else

    $file = $Dir & $text
    GUICtrlSetData($label, @crlf & _GetFileName($file) & @crlf & " in progress")
    winSetTitle($hGUI, "", _t(10) & " : " & _GetFileName($file))
    endIf
    autoEfect()
    endIf
    endIf
    endIf
    if $file then
    switch _BASS_ChannelIsActive($MusicHandle)
    case 1
    if $state = 1 then
    $state = 1
    else
    GUICtrlSetData($label, @crlf & _GetFileName($file) & @crlf & " in progress")
    $state = 1
    endIf
    case 0
    if $state = 0 then
    $state = 0
    else
    GUICtrlSetData($label, @crlf & _GetFileName($file) & @crlf & " stoped")
    $state = 0
    endIf
    case 3
    if $state = 3 then
    $state =3
    else
    GUICtrlSetData($label, @crlf & _GetFileName($file) & @crlf & " on pause")
    $state =3
    endIf
    endSwitch
    endIf
        WEnd

        ; Delete the previous GUI and all controls.
        GUIDelete($hGUI)
EndFunc; main

Func _FileGetDirPath($sPath)
    Local $sDrive = "", $sDir = "", $sFilename = "", $sExt = ""

    Local $aPath_split = _PathSplit($sPath, $sDrive, $sDir, $sFilename, $sExt)

    Return $sDrive & $sDir & "\"
EndFunc; _FileGetDirPath

Func _GetFileName($sPath)
    Local $sDrive = "", $sDir = "", $sFilename = "", $sExt = ""

    Local $aPath_split = _PathSplit($sPath, $sDrive, $sDir, $sFilename, $sExt)

    Return $sFilename & $sExt
EndFunc; _GetFileName

 

If anyone else tries these scripts.  Start with zip in post one, then if you're having problems replace the contents of easyPlayer.au3 with my revision of script.  

The first GUI that appeared for me was a Green options dialog.  The main dialog doesn't load until you press the 'Okay' button.  The script relaunches it'self too at that stage (before pressing 'Okay') I had to Kill Process Tree.  After pressing 'Okay' at the Green dialog it doesn't happen anymore (script does not relaunch).

Why does it relaunch @nacerbaaziz?

Edited by Xandy

Share this post


Link to post
Share on other sites
nacerbaaziz

Hello dear
Thank you for your nice post and for your modification of the file and to alerted me about the unintended mistake
My brother so far I have not finished working on the options page
It is Requiring a restart Because I will put some options for the screen readers and these options require restart
and about the  fileOptions.au3 file
I will amend the above publication and will add it to anyone who wants to benefit from it
With my best greetings and best wishesTHE

fileOptions.au3

Share this post


Link to post
Share on other sites
Xandy

I am interested in writing the recorder.  I have a lot of work these weeks to come (day job) and I still have lots to learn about your script.  I have written a multi-track recorder already.  I will enjoy integrating our two scripts.

I'll start by saving a recording of stereo mix from computer output, then a microphone, then I'll see if I can output a file with both.

Edit: If that sounds like a reasonable plan.

Edited by Xandy

Share this post


Link to post
Share on other sites
nacerbaaziz

OK dear
Thank you very much

am waiting

Share this post


Link to post
Share on other sites

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

  • Similar Content

    • TheSaint
      By TheSaint
      This is my latest project, which I have been working on for a few days now, so this is kind of hot off the press. However, in reality, I have been working on some element of this for years. Some of you may remember a huge project of mine (Audio DVD Producer + Chat Blog Screenshots) that I worked on a good while back? Well, this one is very much related, and very much simpler in scope. That other project by the way, has been basically stalled for a good length of time now. Not because I never finished it, but because the end result was not as great as I hoped. I may share the files for it one day. I may even start working on it again one day, though this latest project kind of makes much of it redundant for my aims.
      Anyway, this project. I have a good bunch of DTS-CDs, from same or other sources (i.e. DVD). You can read more about what a DTS-CD is here, but the short of it, is that you cannot play them on a normal CD player, as you will just get noise. Many if not most DVD or Blu-ray players can play the embedded DTS data in the otherwise empty CD tracks. Further to that, a DTS-CD is essentially a compressed PCM or WAV file for all intents and purposes ... to keep things simple. So a 6 Channel (5.1) track takes up roughly the same amount of bytes as a normal stereo CD track ... so 6 channels for the price of 2.
      Up until recently, the best device for me to play the DTS-CDs on, as CDs, is my PS3. It plays them faithfully (reader issues aside) and has nice visuals. It is also my most convenient DVD/Blu-ray player, so a heap of hassle to play on one of my regular players, and not much success with the Xbox 360 ... at least with burnt backup copies.
      DTS-CDs are also kind of old school, and been superseded by the more superior lossless DVD Audio, Super CD and now Blu-ray Audio discs. That kind of makes them rare now and essentially irreplaceable, so being a wise man, I store them safely and only play backup discs.
      Playing discs though is kind of limited, and to be honest a pain, as my PS3 spits the dummy on some days, with the reader not being what its should be ... or perhaps poorly calibrated. So for a long time now, I have been wanting to use the backup files instead. Unfortunately, while I can play them fine on my PC (foobar2000 + DTS plugin), that is not where I want to listen to them. Until recently, neither my NeoTV 550 hardware player or my Laser one, have been very good at playing the files, and the PS3 even worse with its lack of file support. Back when I first investigated all this, and tried a bunch of things, and didn't yet have the Laser (4k Android) player, I did attempt to go the FLAC route. However, I was left unsatisfied, as my NeoTV did not support CUE files and M3U playlist files are a bit of a hassle ... and no help, when I have a single album file with cue index points for each track ... which many of my DTS-CD rips were ... especially for albums that have one track running into the next ... live albums too. The other issues for me with FLAC, were the artwork (album cover) and TAGS (details for each track - Title, Artist, Album, Year, etc), which I could not get to work.
      So, moving forward to recently. I played a DTS-CD on the PS3 the other day, and if there is one things I hate, it is a playing issue when I am in the midst of enjoying a nice piece of music. The PS3 is not very forgiving and just aborts play. I am not very forgiving of the PS3, so decided to investigate FLACs again. Now perhaps something has changed, since I last tried ... or I just wasn't on the ball. Anyway, to cut a long story a bit shorter, I loaded a DTS WAV file in foobar2000, and ripped it to a FLAC file. I then tried that file on my NeoTV 550 hardware player, and it played fine ... and some tags were visible, which surprised me. So I thought it was worth looking into further. I also tried the file on my Laser hardware player, with the Kodi (XBMC) Android app, but alas, while the Tags and Artwork worked well, all I got was noise ... and same for every other app I tried.
      Now don't ask me why I thought to try FLAC on its own, using the FLAC Frontend program initially, but I did ... and it recognized the tracks as 5.1. With foobar2000, I'd selected the decoder for DTS files when converting to FLAC, as I thought it was required. I hadn't at that stage used flac.exe by itself, but I decided to investigate the TAG command-line options and also noticed you could embed a picture, which I was keen as mustard to try. So I set up a BAT file and gave it a whirl.
      Now the results on my NeoTV 550 hardware player, were brilliant - Sound, Tags and Artwork were as I wanted. I decided to update Kodi at that point. Then, I tried my Laser hardware player again, but still no joy. I then did some online research and read about how to get it all working. Alas, I had mixed results. The foobar2000 ripped file worked, but the one I did with the BAT file did not. Not being keen to rip everything via foobar2000 menus, and wanting to code a quicker batch solution myself, I first attempted to see what command-line options I could use for foobar. That was a dismal failure, so I then revisited some of the programs I had used way back when with DTS WAV based files, and eventually discovered that 'valdec.exe' from the AC3Filter tools collection, gave the compatibility I needed. So I put my WAV or DTS files through that program first, then converted them to FLAC.
      Now the files played with DTS surround sound, on both my hardware players. They also play gapless, so I split album length files into separate track files, which avoids the CUE and M3U issues. That said, a joined M3U file for something like a (separate folders) double album, plays great with Kodi.
      So of course, I just had to whip up a program ... with drag and drop of course.
      And that program has steadily been growing & changing, and is where I want it now, at v1.5.
      Screenshots further below.
      REQUIRED COMPONENTS
      Most programs (if not all) can be obtained from VideoHelp, but here are some alternative sites to source them. The 'flac.exe' program is definitely required, and 'valdec.exe' if you want maximum compatibility support for a wider range of players.
      [flac.exe]
      https://xiph.org/flac/
      https://xiph.org/flac/download.html
      https://ftp.osuosl.org/pub/xiph/releases/flac/
      https://ftp.osuosl.org/pub/xiph/releases/flac/flac-1.3.1-win.zip
      [valdec.exe] [found in the AC3Filter tools collection]
      http://www.ac3filter.net/wiki/AC3Filter_tools (Info only, downloads no longer work)
      https://web.archive.org/web/*/http://www.ac3filter.net/wiki/AC3Filter_tools
      https://web.archive.org/web/20130623004920/http://www.ac3filter.net:80/wiki/Download_AC3Filter_tools
      If The Wayback Machine options fail, then go to VideoHelp (maybe go there anyway).
      https://www.videohelp.com/software/AC3-Filter/old-versions
      NOTE - The AC3Filter site has loads of information, which could help you enable other players aside from those below.
      RECOMMENDED PLAYERS
      PC = foobar2000 + DTS plugin component.
      Android Device = Kodi (XBMC) app with DTS etc enabled with passthrough.
      NOTE - foobar2000 with plugin, will play even those not processed with 'valdec.exe'. My 'NeoTV 550' hardware player does the same. My 'Laser' (Android device) with Kodi just emits noise with the FLAC files, if not processed with 'valdec.exe'.
      RECOMMENDED DTS-CD RIPPERS
      http://www.imgburn.com/
      http://www.exactaudiocopy.de/
      OTHER LINKS
      This one of mine tells you a lot more about DTS-CDs, including ripping or burning.
      https://forum.doom9.org/showthread.php?t=172484
      SCREENSHOTS
         

      P.S. I made a brilliant discovery today. Whereas in the past, with PS3 etc, I could not listen to my DTS-CDs via my Surround Sound Headphones, I now can with these files. So it is well worth playing those CDs as files, just for that benefit alone. Overall though, I have future proofed my collection.
    • nacerbaaziz
      By nacerbaaziz
      hello
      Hi dear, I have a question please
      I designed a function to read the content of the playlist
      I succeeded in that
      I have a problem
      For VLC player playlists
      If the path of the files in Arabic language the path is be as follows
      %D8%A3%D8%B0%D9%83%D8%A7%D8%B1%20%D9%88%D8%A3%D8%AF%D8%B9%D9%8A%D8%A9/%D8%A3%D8%B0%D9%83%D8%A7%D8%B1%20%D9%85%D9%86%D9%88%D8%B9%D8%A9/%D8%A3%D8%B0%D9%83%D8%A7%D8%B1%2003.mp3
      I did not know how to decrypt this text to be readable
      This is the function that i used

      func M3UImport($M3UFile) dim $AM3UItems local $fileOpen = FileOpen($path, bitOr($FO_OVERWRITE,$FO_CREATEPATH,$FO_ANSI)) _FileReadToArray ($fileOpen, $AM3UItems) if @error then return setError(1) local $M3UPath for $i = 1 to $AM3UItems[0] $AM3UItems[$i] = stringReplace($AM3UItems[$i], "file:///", "") $AM3UItems[$i] = stringReplace($AM3UItems[$i], "/", "\") $AM3UItems[$i] = stringReplace($AM3UItems[$i], "%20", " ") $M3UPath = _fileGetDirPath($AM3UItems[$i]) if $M3UPath = "" then $M3UPath = @WorkingDir if not StringTrimRight($M3UPath, 1) = "\" then $M3UPath &= "\" $AM3UItems[$i] = $M3UPath & $AM3UItems[$i] endIf local $ext = _GetFileExt($AM3UItems[$i]) if fileExists($AM3UItems[$i]) and not (StringInStr($FilesExt, $ext) = 0) then $aListItems[0] += 1 GUICtrlCreateListViewItem(_GetFileName($AM3UItems[$i]) & Opt("GUIDataSeparatorChar") & " : " & Opt("GUIDataSeparatorChar") & $AM3UItems[$i], $list) endIf next return "" endFunc

      I ask for your help in this work
      with my Greetings and thanks in advance
    • Subz
      By Subz
      Hello all.
      in the process of packaging an application (Voip) and looking at trying to automate capturing the following information to add to a config.xml file:
      Default: Playback Device Name and Guid
      Example:
      Name: Speakers (Realtek High Definition Audio)
      Guid: {0.0.0.00000000}.{a46ce930-4dd3-49b5-8e8e-7c8a2fdc3925}
      Default Microphone Device Name and Guid
      Example:
      Name: Microphone (Realtek High Definition Audio)
      Guid: {0.0.1.00000000}.{cff6f838-33ce-4c2d-9f77-98f4e19e4a75}
      I've seen the following post by @trancexx, which gives me the Default Audit Device Name, but unsure how to get the Guid or the Microphone Name and Guid.  I believe to get the Guid, I would need to use PKEY_AudioEndpoint_GUID but unsure how to code this.  If anyone can assist or point me in the right direction it would be much appreciated.
      Cheers Subz
       
    • nacerbaaziz
      By nacerbaaziz
      Hello
      I designed this code To help the blind
      Where screen readers users can  Identify the sefocus  item with audio files
      In this code i define some elements
      Unfortunately, I did not know how to define the other elements
      I am waiting for your initiative to  define the other elements
      Thank you in advance
      Global $CFocus = "" Func focus($window) Local $focusing = ControlGetFocus($window) Local $handle = ControlGetHandle($window, "", $focusing) If Not ($focusing = $CFocus) Then Switch StringTrimRight($focusing, 1) Case "button" If IsCheckBox($handle) Then play("checkBox") ElseIf IsRadio($handle) Then play("RadioButton") Else play("focus") EndIf $CFocus = $focusing Case "comboBox", "ListBox" play("list") $CFocus = $focusing Case "edit", "input" play("edit") $CFocus = $focusing Case Else play("focus") $CFocus = $focusing EndSwitch EndIf EndFunc ;==>focus Func IsCheckBox($ctrl_hwnd) $Style = _WinAPI_GetWindowLong($ctrl_hwnd, $GWL_STYLE) Return BitAND($Style, $BS_CHECKBOX) = $BS_CHECKBOX EndFunc ;==>IsCheckBox Func IsRadio($ctrl_hwnd) $Style = _WinAPI_GetWindowLong($ctrl_hwnd, $GWL_STYLE) Return BitAND($Style, $BS_AUTORADIOBUTTON) = $BS_AUTORADIOBUTTON EndFunc ;==>IsRadio Func play($name, $wait = 0) Local Const $SND_RESOURCE = 0x00040004 Local Const $SND_ASYNC = 1 ; Play the file - the script will pause as it sounds If $wait = 0 Then DllCall("winmm.dll", "int", "PlaySound", "str", $name, "hwnd", 0, "int", BitOR($SND_RESOURCE, $SND_ASYNC)) Else DllCall("winmm.dll", "int", "PlaySound", "str", $name, "hwnd", 0, "int", $SND_RESOURCE) EndIf Return 1 EndFunc ;==>play  
    • MrCheese
      By MrCheese
      Hi guys,
       
      Wondering, is there a better way, likely to use 'for...next' to add a letter to each range, by moving right -> along a range of columns in excel.
      I currently use this, but its clunky.
      If $run = 1 Then $range = "B6:B41" If $run = 2 Then $range = "C6:C41" If $run = 3 Then $range = "D6:D41" If $run = 4 Then $range = "E6:E41" If $run = 5 Then $range = "F6:F41" If $run = 6 Then $range = "G6:G41" If $run = 7 Then $range = "H6:H41" If $run = 8 Then $range = "I6:I41" If $run = 9 Then $range = "J6:J41" If $run = 10 Then $range = "K6:K41" If $run = 11 Then $range = "L6:L41" If $run = 12 Then $range = "M6:M41" If $run = 13 Then $range = "N6:N41" If $run = 14 Then $range = "O6:O41" If $run = 15 Then $range = "P6:P41" If $run = 16 Then $range = "Q6:Q41" If $run = 17 Then $range = "R6:R41" If $run = 18 Then $range = "S6:S41" If $run = 19 Then $range = "T6:T41" If $run = 20 Then $range = "U6:U41" If $run = 21 Then $range = "V6:V41" If $run = 22 Then $range = "W6:W41" If $run = 23 Then $range = "X6:X41" If $run = 24 Then $range = "Y6:Y41" If $run = 25 Then $range = "Z6:Z41" If $run = 26 Then $range = "AA6:AA41" If $run = 27 Then $range = "AB6:AB41" If $run = 28 Then $range = "AC6:AC41" If $run = 29 Then $range = "AD6:AD41" If $run = 30 Then $range = "AE6:AE41" If $run = 31 Then $range = "AF6:AF41" If $run = 32 Then $range = "AG6:AG41" If $run = 33 Then $range = "AH6:AH41" If $run = 34 Then $range = "AI6:AI41" If $run = 35 Then $range = "AJ6:AJ41" If $run = 36 Then $range = "AK6:AK41" If $run = 37 Then $range = "AL6:AL41" If $run = 38 Then $range = "AM6:AM41" If $run = 39 Then $range = "AN6:AN41" If $run = 40 Then $range = "AO6:AO41" If $run = 41 Then $range = "AP6:AP41" If $run = 42 Then $range = "AQ6:AQ41" If $run = 43 Then $range = "AR6:AR41" If $run = 44 Then $range = "AS6:AS41" If $run = 45 Then $range = "AT6:AT41" If $run = 46 Then $range = "AU6:AU41" If $run = 47 Then $range = "AV6:AV41" If $run = 48 Then $range = "AW6:AW41" If $run = 49 Then $range = "AX6:AX41" If $run = 50 Then $range = "AY6:AY41"  
      Normally, if it was going down the rows, i'd use this:
       
      For $i = 0 To UBound($iRowCount) - 1 $row = $i + 1 $range = "B"&$row&":B"&$row+1 Next  
      so something like this, but i don't know how to code sequential columns:
      For $i = 0 To UBound($iColCount) - 1 $col = $i + 1 $range = $col&"1:"&$col&"40" Next  
      If I don't make sense, let me know.
      Any help would be great. thanks
×