Hi there...
I am trying to record audio and then write it to db as string... but i have a problem i can;t do that... i dont know why - may be is a limitation... ?
I am using MSMariaDB for connector... + audio library (AudioStreamer)
So I can record the audio - i can play it... here the code of button:
Seems that going to write it... but nothing do... why ? if i just have a piece ex. length of 2.5K writes it ok... is a limitation of statement?... or what ?
What can i do... anyone do something like that ?
I am trying to record audio and then write it to db as string... but i have a problem i can;t do that... i dont know why - may be is a limitation... ?
I am using MSMariaDB for connector... + audio library (AudioStreamer)
So I can record the audio - i can play it... here the code of button:
B4X:
Sub Button1_Click
'start records
If nowrecord=False Then
Button1.textColor=Colors.red
nowrecord=True
Log("recording")
myaudio.clear
astream.StartRecording
Else
Log("writing to db")
astream.StopRecording
'astream.StartPlaying
Dim s As String
Dim su As StringUtils
For Each b() As Byte In myaudio
' astream.Write(b) 'with that playing /hear the audio
s = s & su.EncodeBase64(b) 'making some valid string for writing at db
Next
'astream.Write(Null) 'stops playing
'write to db
Log(s.Length) 'When i have more than 10 seconds... goes at 800KB !
db.ExecuteASync("INSERT INTO audios SET forid='0', fromid='" & myid & "', audio1='" & s & "', edate='" & DateTime.Date(DateTime.Now) &"', etime='" & DateTime.Time(DateTime.Now) & "'","")
nowrecord=False
Button1.textColor=Colors.Green
End If
End Sub
Seems that going to write it... but nothing do... why ? if i just have a piece ex. length of 2.5K writes it ok... is a limitation of statement?... or what ?
What can i do... anyone do something like that ?