bah.bass recording ?

Started by Flanker, May 28, 2019, 23:50:27

Previous topic - Next topic

Flanker

Hello, does anyone have a working example of microphone recording with bah.bass ?

How is the callback function supposed to work ? I looked for TBassRecord in bass.bmx, but I don't get it.

And if I don't use the callback function (with proc=null, as stated in the documentation we can use TBassChannel.GetData() as an alternative), it gives an error "Attempt to call uninitialized function pointer" when starting recording :

SuperStrict

Import BaH.Bass

Local record:TBassRecord = New TBassRecord

If Not record.Init(-1) Then
DebugLog "Can't initialize record device : " + TBass.ErrorGetCode()
End
End If

record.Start(44100,1,BASS_SAMPLE_8BITS,Null,Null)

Graphics 400,300
Repeat

Cls

'Local length:Int = record.GetData(Null,BASS_DATA_AVAILABLE)

Flip

Until KeyHit(KEY_ESCAPE) Or AppTerminate()

record.Stop()
record.Free()

End
Everyone knew it was impossible, until someone who didn't know made it.