J jchal Active Member Licensed User Longtime User Mar 15, 2017 #1 hi all i am trying to find relevant information how can i make my own smart button like com.helloklick.android com.emniuen.easmartpower where can i start is the an example?
hi all i am trying to find relevant information how can i make my own smart button like com.helloklick.android com.emniuen.easmartpower where can i start is the an example?
Erel B4X founder Staff member Licensed User Longtime User Mar 15, 2017 #2 You can use AudioStreamer to listen to the microphone input. Upvote 0
J jchal Active Member Licensed User Longtime User Mar 17, 2017 #3 hi there i am using this example https://www.b4x.com/android/forum/threads/audio-library-v1-5-new-audiostreamer-object.30550/ trying to read the mic inmput i try to modificate the code to the one below Code: Copy Sub streamer_RecordBuffer (Buffer() As Byte) 'collect the recording data buffers.Add(Buffer) For Each b() As Byte In buffers ' Log(${b}$) Next End Sub the problem is that i did not suceed with the log , possibly i am doing some syndax error and secon when i peress the head set button what i must expect in b to be the value? Upvote 0
hi there i am using this example https://www.b4x.com/android/forum/threads/audio-library-v1-5-new-audiostreamer-object.30550/ trying to read the mic inmput i try to modificate the code to the one below Code: Copy Sub streamer_RecordBuffer (Buffer() As Byte) 'collect the recording data buffers.Add(Buffer) For Each b() As Byte In buffers ' Log(${b}$) Next End Sub the problem is that i did not suceed with the log , possibly i am doing some syndax error and secon when i peress the head set button what i must expect in b to be the value?
Erel B4X founder Staff member Licensed User Longtime User Mar 17, 2017 #4 jchal said: possibly i am doing some syndax error and secon when i peress the head set button what i must expect in b to be the value? Click to expand... You will need to test it. It is impossible to say. You can use ByteConverter.HexFromBytes to log the bytes. Upvote 0
jchal said: possibly i am doing some syndax error and secon when i peress the head set button what i must expect in b to be the value? Click to expand... You will need to test it. It is impossible to say. You can use ByteConverter.HexFromBytes to log the bytes.
J jchal Active Member Licensed User Longtime User Mar 17, 2017 #5 i have altered the code to Code: Copy Sub streamer_RecordBuffer (Buffer() As Byte) Dim z As String 'collect the recording data buffers.Add(Buffer) For Each b() As Byte In buffers z= BytesToString (b,1,10,"UTF-8") Log(z) Next End Sub but i get results that i cannot read i was not able to declear byteconverter , can you please tell me how do i declear byteconverter? Attachments audiostream.png 117.4 KB · Views: 367 Last edited: Mar 17, 2017 Upvote 0
i have altered the code to Code: Copy Sub streamer_RecordBuffer (Buffer() As Byte) Dim z As String 'collect the recording data buffers.Add(Buffer) For Each b() As Byte In buffers z= BytesToString (b,1,10,"UTF-8") Log(z) Next End Sub but i get results that i cannot read i was not able to declear byteconverter , can you please tell me how do i declear byteconverter?
Erel B4X founder Staff member Licensed User Longtime User Mar 19, 2017 #6 You cannot convert raw bytes to string. Code: Copy Dim bc as ByteCovnerter For Each b() As Byte In Buffers Log(bc.HexFromBytes(b)) Next Upvote 0
You cannot convert raw bytes to string. Code: Copy Dim bc as ByteCovnerter For Each b() As Byte In Buffers Log(bc.HexFromBytes(b)) Next