Android Tutorial Walkie Talkie - Audio streaming over Wifi or Bluetooth

Discussion in 'Tutorials & Examples' started by Erel, Jun 30, 2013.

Thread Status:
Not open for further replies.
  1. kris_audi

    kris_audi Member Licensed User

    I use Samsung GT-S5830i with Android version 2.3.6.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    I think that I see the cause of this problem. Try a different set of parameters. Your device doesn't support the current values.
     
  3. kris_audi

    kris_audi Member Licensed User

    I use SampleRate 44100 instead of 22050 this error goes away.
    Thank you Erel.
     
  4. mauro56

    mauro56 New Member Licensed User

    Hi,
    after updating my Nexus 7 to Android 4.4.2 now I have an error and the application Walkie Talkie crashes unexpectedly. The problem seems to be in the service module "Connector". More precisely, in the subroutine:

    Public Sub StopSendingAudio
    audioStream.StopRecording
    sendingAudio = False
    end Sub

    It seems to be the audiostream.StopRecording that causes abnormal termination.
    With the previous version (Android 4.4.3) Walkie Talkie application works correctly.
     
  5. Erel

    Erel Administrator Staff Member Licensed User

  6. mauro56

    mauro56 New Member Licensed User

    Yes, I have the same problem with the example you indicated, although less frequently. I am enclosing a few lines of the log when the error hoping you find it useful.
    I correct a mistake in my previous post. The previous version of Android is 4.3.0. With this version everything is ok.

    ** Service (service1) Destroy **
    ** Service (service1) Create **
    ** Service (service1) Start **
    Connected to B4A-Bridge (Wifi)
    Installing file.
    ** Activity (main) Pause, UserClosed = false **
    PackageAdded: package:b4a.audiostreamerex
    ** Activity (main) Create, isFirst = true **
    ** Activity (main) Resume **
    java.lang.NegativeArraySizeException: -3
    at anywheresoftware.b4a.audio.AudioStreamer$Recorder.run(AudioStreamer.java:145)
    at java.lang.Thread.run(Thread.java:841)
    ** Activity (main) Pause, UserClosed = true **
    ** Activity (main) Resume **
    ** Activity (main) Pause, UserClosed = false **
    Installing file.
    PackageAdded: package:b4a.audiostreamerex
    ** Activity (main) Create, isFirst = true **
    ** Activity (main) Resume **
    java.lang.NegativeArraySizeException: -3
    at anywheresoftware.b4a.audio.AudioStreamer$Recorder.run(AudioStreamer.java:145)
    at java.lang.Thread.run(Thread.java:841)
    ** Activity (main) Pause, UserClosed = true **

    Thank you for your attention.
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    I tested the second example with Android 4.4.2 (Nexus 4) and it ran properly. You said that it happened less frequently. When did it happen? When you started recording?
     
  8. mauro56

    mauro56 New Member Licensed User

    Yes, when you start the recording. And 'less frequent if you remain silent. If you register for a few seconds and close the recording application crashes. In the example of Walkie Talkies is definitely more common, but even in this final example at least once in two the application crashes. Always close when recording.
     
  9. Erel

    Erel Administrator Staff Member Licensed User

  10. mauro56

    mauro56 New Member Licensed User

    Thank you Erel. Now is OK on both examples.
     
  11. wm.chatman

    wm.chatman Well-Known Member Licensed User

    Can't compile the Walkie Talkie Sample.

    Compiling code. Error
    Error parsing program.
    Error description: Unknown type: audiostreamer
    Are you missing a library reference?
    Occurred on line: 18
    Private audioStream As AudioStreamer

    Audio 1.3 is avail.

    what's up, any thoughts on this one ?
     
  12. klaus

    klaus Expert Licensed User

    Erel likes this.
  13. wm.chatman

    wm.chatman Well-Known Member Licensed User

    I did 4 x. Does not seem to work.
     
  14. Erel

    Erel Administrator Staff Member Licensed User

    Do you get the same error?
     
  15. wm.chatman

    wm.chatman Well-Known Member Licensed User

    yes I do Erel.
     
  16. Erel

    Erel Administrator Staff Member Licensed User

    Make sure that you copied the updated Audio library to the internal libraries folder. You can see the version in the libraries tab. If it isn't 1.5 then you didn't copy it to the correct place.
     
  17. wm.chatman

    wm.chatman Well-Known Member Licensed User

  18. Erel

    Erel Administrator Staff Member Licensed User

    Make sure that you deleted the Audio library (both files) from both libraries folders. The internal one (under program files) and the additional one.
     
  19. ericvanderhoeven

    ericvanderhoeven Member Licensed User

    This app works fine here on 2 tablets both fitted with Wifi AND Bluetooth. It does not seem to work on 2 tablets with wifi only.
    Could that be the reason (that it does not have bluetooth)?
    And if so, what lines to take out of the sample code?
    On the wifi only tablets, it spits out quite a nasty (and lengthy) error log when I try to run it. On the combo tablets, no error log at all.

    Any help is appreciated.

    Thx,

    Eric
     
  20. Erel

    Erel Administrator Staff Member Licensed User

    Can you post the error message?

    Go over the code, it should be simple to remove all the Bluetooth related code.
     
Thread Status:
Not open for further replies.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice