June 18, 2019, 07:14:31 PM

Author Topic: bah.bass recording ?  (Read 138 times)

Offline Flanker

  • Jr. Member
  • **
  • Posts: 39
    • Youtube channel on Blitzmax programming prototypes
bah.bass recording ?
« on: May 28, 2019, 11:50:27 PM »
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 :

Code: [Select]
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.