Moin Moin
ich würde gerne nen Audio Stream aufnehmen, dazu hab ich versucht die Bass.dll zu verwenden bin aber beim aufnehmen gescheitert.
Ich würde das ganze gerne ohne Umwege über die Soundkarte (Lautsprecherausgang) machen damit nix aus andern Anwendung auf einmal in meinen aufgenommanen Streams ist
ich hatte im Forums auf http://www.un4seen.com/igendwo sowas in der art gefunden:
_BASS_SetConfig($bass_dll,$BASS_CONFIG_NET_PLAYLIST,1)
$MusicHandle = _BASS_StreamCreateURL ($bass_dll, $file, 0, 1)
_BASS_Encode_Start($bass_dll,$bassenc_dll,$MusicHandle, @ScriptDir & "\Test.wav",0)
wenn ich es ausführe kommt kein Fehler aber er erstellt auch keine Datei
hier mal der ganze Code den ich aus dem Beispiel vom Bass.dll UDF Ersteller gemacht hab
Spoiler anzeigen
#include <Bass.au3>
#include <BassConstants.au3>
#include <GUIConstantsEx.au3>
#include <array.au3>
#include <BassEnc.au3>
#include <BassEncConstants.au3>
Global $playing_state = -1
;Open Bass.DLL. Required for all function calls.
$bass_dll = DllOpen("BASS.dll")
$bassenc_dll = DllOpen("BASSENC.dll")
If @error Then
MsgBox(0, "Error", "Could not load bass.dll")
Exit
EndIf
;Initalize bass. Required for most functions.
_BASS_Init ($bass_dll, 0, -1, 44100, 0, "")
;Check if bass iniated. If not, we cannot continue.
If @error Then
MsgBox(0, "Error", "Could not initialize audio")
Exit
EndIf
;Prompt the user to select a MP3 file
$file = "http://metafiles.gl-systemhaus.de/hr/youfm_2.m3u"
_BASS_SetConfig($bass_dll,$BASS_CONFIG_NET_PLAYLIST,1)
;Create a stream from that file.
$MusicHandle = _BASS_StreamCreateURL ($bass_dll, $file, 0, 1)
_BASS_Encode_Start($bass_dll,$bassenc_dll,$MusicHandle, @ScriptDir & "\Test.wav",0)
;~ _BASS_ChannelPlay($bass_dll,$MusicHandle, 0)
;Check if we opened the file correctly.
If @error Then
MsgBox(0, "Error", "Could not connect to the internet" & @CR & "Error = " & @error)
Exit
EndIf
;Create GUI and controls
$Form1 = GUICreate("Example 3", 380, 190, 193, 115)
$lblFileName = GUICtrlCreateLabel($file, 8, 8, 379, 17)
$progress_slider = GUICtrlCreateSlider(8, 32, 374, 29)
GUICtrlSetLimit(-1, 100, 0)
$rightVol = GUICtrlCreateProgress(8, 88, 366, 17)
GUICtrlSetLimit(-1, 100, 0)
$LeftVol = GUICtrlCreateProgress(8, 136, 366, 17)
GUICtrlSetLimit(-1, 100, 0)
GUICtrlCreateLabel("Right Channel Volume Level", 8, 64, 150, 17)
GUICtrlCreateLabel("Left Channel Volume Level", 8, 112, 150, 17)
$Close = GUICtrlCreateButton("Close", 296, 160, 75, 25, 0)
$Play_pause = GUICtrlCreateButton("Play/Pause", 216, 160, 75, 25, 0)
$Stop = GUICtrlCreateButton("Stop", 136, 160, 75, 25, 0)
;Show GUI
GUISetState(@SW_SHOW)
;Get the length of the song in bytes.
$song_length = _BASS_ChannelGetLength ($bass_dll, $MusicHandle, $BASS_POS_BYTE)
While 1
;Only do this if a song is playing.
If $playing_state = 1 Then
;Get cursor information for the GUI. We use this to know if the user is using the slider or no.
$GGCI = GUIGetCursorInfo($Form1)
;Can't be using the slider, so update.
If IsArray($GGCI) And Not $GGCI[2] Then
;Get Current playback position
$current = _BASS_ChannelGetPosition ($bass_dll, $MusicHandle, $BASS_POS_BYTE)
;Calculate the percentage
$percent = Round(($current / $song_length) * 100, 0)
EndIf
;User has clicked the slider, so we must not update the song position.
If IsArray($GGCI) And $GGCI[4] = $progress_slider And $GGCI[2] Then
;While the slider is being moved
While $GGCI[2]
;Get updated cursor info
$GGCI = GUIGetCursorInfo($Form1)
;Get position
$gpos = Round(GUICtrlRead($progress_slider) / 100 * $song_length, 0)
WEnd
;Slider is no longer clicked, so we now can set the pos.
_BASS_ChannelSetPosition ($bass_dll, $MusicHandle, $gpos, $BASS_POS_BYTE + $BASS_MUSIC_POSRESET)
EndIf
EndIf
;Get Channel levels.
$levels = _BASS_ChannelGetLevel ($bass_dll, $MusicHandle)
;Get Right and calculate percentage
$rightChLvl = _LoWord ($levels)
$rightChLvlper = Round(($rightChLvl / 32768) * 100, 0)
;Get Left and calculate percentage
$LeftChLvl = _HiWord ($levels)
$leftChLvlper = Round(($LeftChLvl / 32768) * 100, 0)
;Set the levels on GUI.
GUICtrlSetData($rightVol, $rightChLvlper)
GUICtrlSetData($LeftVol, $leftChLvlper)
;Get GUI Message
$nMsg = GUIGetMsg()
Switch $nMsg
;If Close button or red x, then exit. Alway remember to free resources
Case $GUI_EVENT_CLOSE, $Close
Exit
Case $Play_pause
;Check if playing or paused, then take appropriate action
Switch $playing_state
Case 0; Song Paused, Resume.
;Resume Song
_BASS_Start ($bass_dll)
$playing_state = 1
Case -1 ; Song stopped, start from begining.
;Play Song
_BASS_ChannelPlay ($bass_dll, $MusicHandle, 0)
$playing_state = 1
Case 1 ; Song Playing, Pause
;Pause song
_BASS_Pause ($bass_dll)
$playing_state = 0
EndSwitch
Case $Stop
;Stop Song
_BASS_ChannelStop ($bass_dll, $MusicHandle)
$playing_state = -1
EndSwitch
WEnd
Func OnAutoItExit()
;Free Resources
_BASS_Free($bass_dll)
EndFunc ;=
hoffe einer weis da weiter
Mfg Keyle