Android Question About audiostreamer

Addo

Well-Known Member
Licensed User
can i insert some text to the audio data and then remove this text when receive ?


B4X:
Sub AudioStream_RecordBuffer(Data() As Byte)
    
Dim packet As UDPPacket
packet.Initialize(Data, ip, port)
UDPSck.Send(packet)

End sub

i would like to add identification to each audio sent like example

B4X:
packet.Initialize("Audio1"&Data, ip, port)
 

DonManfred

Expert
Licensed User
Longtime User
it takes a minute to build one.

B4X:
    Type MyData(infostring As String, data() As Byte)
B4X:
Sub AudioStream_RecordBuffer(Data() As Byte)
Dim s As B4XSerializator
dim mdata as MyData
mdata.initialize
mdata.infostring = "TEST"
mdata.data = Data
    
Dim packet As UDPPacket

packet.Initialize(s.ConvertObjectToBytes(mdata), ip, port)
UDPSck.Send(packet)

End sub

note that the receiving side must know the Customtype (and needs to be a B4X App).
 
Upvote 0
Top