_SoundPlay() Equalizen || Bass / Treble e.t.c. boosten

  • Hallo :)
    Meine Frage heute lautet:
    (Wie) kann man mit AutoIt den Bass/Treble von _SoundPlay() verändern? Ich suche nach etwas wie:

    [autoit]

    _SoundEqualize($hSound, $Freqs)

    [/autoit]


    Aufbau von $Freqs:

    [autoit]

    ;(Die Zahl ist die Frequenz)
    [31, 62, 125, 500, 1K, 2K, 4K, 8K, 16K, 32K]
    ;Man gibt immer ein +/- an db in der jeweiligen Frequenz ein:
    $Freqs = [5, 4, 3, 1, -2, -2, -1, 0, 0, 1]
    ;Das wäre jetzt Bassstark, heißt die EqKurve würde ungefähr so aussehen: '''''''''__-

    [/autoit]


    Bei Unklarheiten bitte Fragen.

    Spoiler anzeigen

    Überraschung!


    MfG Donkey

  • Ich habe für den Eigengebrauch mal eine kleine UDF geschrieben, um einen 3-Band-Equalizer darzustellen. Diese Funktionen solltest du ganz leicht auf einen n-Band-Equalizer erweitern können. Bitte dann aber wieder hier zur Verfügung stellen, ist ja GPL. :P

    Spoiler anzeigen
    [autoit]


    #cs ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    Copyright (C) 2014 Sebastian Walter (chesstiger)

    [/autoit] [autoit][/autoit] [autoit]

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    [/autoit] [autoit][/autoit] [autoit]

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    [/autoit] [autoit][/autoit] [autoit]

    You should have received a copy of the GNU General Public License
    along with this program. If not, see <http://www.gnu.org/licenses/>.

    [/autoit] [autoit][/autoit] [autoit]

    AutoIt Version: 3.3.10.0

    [/autoit] [autoit][/autoit] [autoit]

    #ce ----------------------------------------------------------------------------
    #include "BASSFX.au3"

    [/autoit] [autoit][/autoit] [autoit]

    Func _BassHelper_New3BandEq($hStream, $iLo, $iMi, $iHi, $iPriority = 0)
    Local $hFX, $sParamStd

    [/autoit] [autoit][/autoit] [autoit]

    $hFX = _BASS_ChannelSetFX($hStream, $BASS_FX_BFX_PEAKEQ, $iPriority)
    ;~ ConsoleWrite("SetFXErr: " & _Bass_ErrorGetCode() & @LF)
    $sParamStd = "%i|2.5|0|%s|%s|-1" ;band, bandwidth, Q, center, gain, chan

    [/autoit] [autoit][/autoit] [autoit]

    _BASS_FXSetParameters($hFX, StringFormat($sParamStd, 0, 0125, $iLo))
    ;~ ConsoleWrite("LoErr: " & _Bass_ErrorGetCode() & @LF)
    _BASS_FXSetParameters($hFX, StringFormat($sParamStd, 1, 1000, $iMi))
    ;~ ConsoleWrite("MiErr: " & _Bass_ErrorGetCode() & @LF)
    _BASS_FXSetParameters($hFX, StringFormat($sParamStd, 2, 8000, $iHi))
    ;~ ConsoleWrite("HiErr: " & _Bass_ErrorGetCode() & @LF)

    [/autoit] [autoit][/autoit] [autoit]

    Return $hFX
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _BassHelper_Set3BandEq($hFX, $iLo, $iMi, $iHi)
    $sParamStd = "%i|2.5|0|%s|%s|-1" ;band, bandwidth, Q, center, gain, chan

    [/autoit] [autoit][/autoit] [autoit]

    _BASS_FXSetParameters($hFX, StringFormat($sParamStd, 0, 0125, $iLo))
    ;~ ConsoleWrite("LoErr: " & _Bass_ErrorGetCode() & @LF)
    _BASS_FXSetParameters($hFX, StringFormat($sParamStd, 1, 1000, $iMi))
    ;~ ConsoleWrite("MiErr: " & _Bass_ErrorGetCode() & @LF)
    _BASS_FXSetParameters($hFX, StringFormat($sParamStd, 2, 8000, $iHi))
    ;~ ConsoleWrite("HiErr: " & _Bass_ErrorGetCode() & @LF)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _BassHelper_Rem3BandEq($hStream, $hFX)
    _BASS_ChannelRemoveFX($hStream, $hFX)
    EndFunc

    [/autoit]
  • Du musst die Funktion nur auf den geöffneten Sound-Stream anwenden... Allerdings ist das wegen der FX-DLL nicht ganz so einfach.

    Ich nehme an, du hast die vollständige BASS-UDF mit Beispielen? Dazu wird noch die Bass_FX-Dll benötigt. Ich habe mal ein Beispiel aus der Dokumentation entsprechend modifiziert und in eine ZIP-Datei gepackt. Du musst halt eben noch eine eigene Sounddatei einbauen, dann sollte das Handling klar sein.

  • Da wäre nur noch ein Problem.
    Wenn ich im Haupt Script das Zurückgegebene von der Funktion als $hFX speichere, und dann _BASS_ChannelRemoveFX($MusicHandle, $hFX) ausführe, passiert nichts; Der EQ hört nicht auf. Genauso wenig passiert, wenn ich die veränderten Freqs mit "+0" überschreibe..

    Spoiler anzeigen

    Überraschung!


    MfG Donkey