Android Question AudioStreamer object

hookshy

Well-Known Member
Licensed User
Longtime User
I have installed the library from this link
Audio library v1.5
http://www.b4x.com/android/forum/threads/audio-library-v1-5-new-audiostreamer-object.30550/#content

The example seem to work fine but when I put it in to my app here what came out .
https://www.dropbox.com/s/bz4idrq8qf7xasn/1.wav
If you could give me a hint about what might probably go wrong I could apreciate... I will come back as soon as I find an answer myself .
I know this lib is on beta testing so maybe my case would be small help as tester !
Thank you
 

hookshy

Well-Known Member
Licensed User
Longtime User
Found problem by not copying the right initialise statement and the sample rate got to the crapy effect from the audio file above !
Device I have tested the library motorola defy+ android 2.3.2
B4X:
streamer.Initialize("streamer", mSampleRate, mMono, mBitRate, streamer.VOLUME_MUSIC)
'streamer.Initialize("streamer", 44100, True, 16, streamer.VOLUME_MUSIC) 'this statement was from previous example :rolleyes:
Sometime we make the code do strange things when coding !!!:rolleyes:
thank you for this library
 
Upvote 0

hookshy

Well-Known Member
Licensed User
Longtime User
while playing with example from library and the test I made I have the following errors .
On example :
error on java line 290 illegalStateException:stop() called on an uninitilised Audiorecord
ON my implementation:
I can press record but the file I can not play the file
error java.io.IOException : Prepared failed: status=0x1
 
Upvote 0

hookshy

Well-Known Member
Licensed User
Longtime User
Fixed problem ... off .. I have wrong handled the button for recording, stop and play .
The recorder was started but and never stopped !
 
Upvote 0

hookshy

Well-Known Member
Licensed User
Longtime User
NEW PROBLEM on device:
Vodafon smart II (No carrier , no sim inserted)
Android 2.3.7
320 x 480 px, 3.2 '' (180 ppi )

on line: streamer.Initialize("streamer", mSampleRate, mMono, mBitRate, streamer.VOLUME_MUSIC)
Error: NegativeARraySizeException !!
Simple try catch end try over streamer intialisation will start the app but surely the recorder function won't work.

This device has not SIM inserted are there related in some way ?
 
Upvote 0

hookshy

Well-Known Member
Licensed User
Longtime User
This error I got on LGOptimus l5 while the app works great on Motorola Defy +
Fatal signal 6 (SIGABRT) at 0x00000180 (code=0)
Error occured on activity create ! And the message box that give you the option to wait for the app is often showing when creating streamer object .

Regarding the parametrers of the streamer it is possible that some configuration to crack on some phones ?
Does each device have it one hardware configuration that support more of less more parameter and how can you tell this from the first install of the app?
How important is the channel in the streamer initialise and how could you now what channel works ?
 
Upvote 0

hookshy

Well-Known Member
Licensed User
Longtime User
Because I am handeling both the library example and my test record example i have an error each time when pressing play button to record . (called on an uninitilised Audiorecord)
I have restarted the phone in order to catch the problem and after restart the first app that runs is recording just fine .
That means that a release must be done before leaving the app is this correct ?
I have used this code found here to release the job in activity pause
B4X:
  Dim r As Reflector
  r.Target = streamer
  r.Target = r.GetField("audioRecord")
  r.RunMethod("release")
I hope I am not wrong actually I used the release option only when userclosed option in activity pause as for example a scaner or voice recognition will not recreate the activity but only pause and resume .
Please correct me when I am writing BS.

Strange thing is that the app that handles the same hardware resource wrong will cause eventually the crash of the other one .. but the users does not feel that and may tell that your app actually sucks and that is not good .. the problem was same place else!
This might be the case of a lot of other hardware resources on android device !
 
Last edited:
Upvote 0

hookshy

Well-Known Member
Licensed User
Longtime User
I did not changed nothing from the lib example
As soon as I will catch something I will post error . Thank you !
I have inserted also the lastexception routine !


B4X:
Private streamer As AudioStreamer
    Private buffers As List
    Private timer1 As Timer
    Private recordingStart As Long
  
  
    Private output As OutputStream
    Private recording As Boolean
    Private mBitRate As Int = 16
    Private mSampleRate As Int = 22050
    Private mMono As Boolean = True
    Private mFileName As String = "ac.wav"
    Private mp As MediaPlayer
B4X:
        buffers.Initialize
        streamer.Initialize("streamer", mSampleRate, mMono, mBitRate, streamer.VOLUME_MUSIC)
 
Upvote 0

hookshy

Well-Known Member
Licensed User
Longtime User
I had another crash on Motorola this time, this is what I see in my logs ! I do not know if this helps but I do report any problems I met !
I have restarted app and recorder works fine !

(/Jenkins/jobs/Android-4-3-0-Build-Debug/workspace/make//WebRTC/webrtc/modules/audio_device/android/audiolayer/audioeffect_dyldproxy.cc:147) assertion failure: NULL != thisPtr
(/Jenkins/jobs/Android-4-3-0-Build-Debug/workspace/make//WebRTC/webrtc/modules/audio_device/android/audiolayer/audioeffect_dyldproxy.cc:254) assertion failure: DLAudioEffect::_queryDefaultPreProcessing.bound()
(/Jenkins/jobs/Android-4-3-0-Build-Debug/workspace/make//WebRTC/webrtc/modules/audio_device/android/audiolayer/audioeffect_dyldproxy.cc:147) assertion failure: NULL != thisPtr
(/Jenkins/jobs/Android-4-3-0-Build-Debug/workspace/make//WebRTC/webrtc/modules/audio_device/android/audiolayer/audioeffect_dyldproxy.cc:147) assertion failure: NULL != thisPtr
 
Upvote 0

hookshy

Well-Known Member
Licensed User
Longtime User
Can you post the stack trace when that happens?
I am afraid I do not now how to do that ! :(

Another thing I see :
By pressing home button while recording I see the following statement in log . by resuming the recording is resuming again !
sending message to waiting queue (streamer_recordbuffer)
Ignoring event (too many queued events: streamer_recordbuffer)
 
Upvote 0

hookshy

Well-Known Member
Licensed User
Longtime User
Ok .. I understand .. the purpose is not to record in background but to record simple message in order to share it via what app ... so it is not a problem .
 
Upvote 0
Top