Ok now every method is called successful:
Public Sub Play_Execute(obj As Object)
Bass.BASS_ChannelStop(stream)
If stream <> 0 Then Bass.BASS_StreamFree(stream)
stream = Bass.BASS_StreamCreateFile(Playlist(PlaylistSelectedIndex).Filename, 0, 0, BASSFlag.BASS_STREAM_PRESCAN Or BASSFlag.BASS_STREAM_DECODE)
Debug.WriteLine("streamcreatefile: " & CStr(Bass.BASS_ErrorGetCode))
If MainModule.streamfx(WhichDeck - 1) <> 0 Then Bass.BASS_StreamFree(MainModule.streamfx(WelchesDeck - 1))
MainModule.streamfx(WhichDeck - 1) = BassFx.BASS_FX_TempoCreate(stream, BASSFlag.BASS_FX_FREESOURCE Or BASSFlag.BASS_STREAM_DECODE)
Debug.WriteLine("tempocreate: " & CStr(Bass.BASS_ErrorGetCode))
'Bass.BASS_ChannelPlay(MainModule.streamfx(WhichDeck - 1), False)
Bass.BASS_ChannelSetDevice(MainModule.mixer, 2)
Debug.WriteLine("setdevice: " & CStr(Bass.BASS_ErrorGetCode))
Debug.WriteLine("channelsetdevice" & Bass.BASS_ErrorGetCode)
BassMix.BASS_Mixer_StreamAddChannel(MainModule.mixer, MainModule.streamfx(WhichDeck - 1), BASSFlag.BASS_MIXER_NORAMPIN Or BASSFlag.BASS_STREAM_AUTOFREE)
Debug.WriteLine("add stream to mix: " & CStr(Bass.BASS_ErrorGetCode))
MainModule.MyEQ(WhichDeck - 1) = New Equalizer(MainModule.streamfx(WhichDeck - 1))
MainModule.MyEQ(WelchesDeck - 1).EQ_Init()
MainModule.VisualizationTimer.Start()
End Sub
But when I start my music, it is not audible, even though my peak meter and spectrum anaylzer show some action.
When I add a microphone to the mixer channel first, the music is audible but sounds kind of totally chopped up...:
Bass.BASS_ChannelSetAttribute(MainModule.mikro, BASSAttribute.BASS_ATTRIB_VOL, 1)
BassMix.BASS_Mixer_StreamAddChannel(MainModule.mixer, MainModule.mikro, BASSFlag.BASS_MIXER_NORAMPIN Or BASSFlag.BASS_STREAM_AUTOFREE)
Any idea what this is all about? Do you need some extra code? Maybe the chopped up sound has soemthing to do with mono/stereo playback? At some point I remember you could add a flag like ...MONO or so to some method, but i cant remember which one...
PS:
VisualisationTimer repeatedly calls this:
Dim Flag As BASSLevel = CType(16, BASSLevel)
peak = Bass.BASS_ChannelGetLevels(MainModule.streamfx(WhichDeck - 1), 0.1, Flag)
If peak IsNot Nothing Then
PeakLeft = peak(0)
PeakRight = peak(1)
End If
and this:
BMP = Spektrum.CreateSpectrumLinePeak(MainModule.streamfx(WhichEQ - 1), Width, Height, System.Drawing.Color.Green, System.Drawing.Color.IndianRed, System.Drawing.Color.SlateGray, System.Drawing.Color.Transparent, Resolution, 3, Distance, 40, False, True, True)
Picture = BitmapToImageSource(BMP)