hi, i understand that Kindle doesn’t have an external mic, and i am testing using a headset with a mic. SimpleAudioRecorder is not working well as it’s not really recording any sound, and the playback is infinite. but at least it is not crash.
but the following code:
local music\_channel = audio.findFreeChannel()
dataFileName = "hello.aif"
local filePath = system.pathForFile( dataFileName, system.DocumentsDirectory )
r = media.newRecording(filePath)
r:startRecording()
produces the following crash on kindle with a headset with mic.
D/Omap4ALSA( 1290): open called for devices 00000004 in mode 0 channels 00000000...
D/Omap4ALSA( 1290): open called for devices 00100000 in mode 0 channels 00000010...
I/Omap4ALSA( 1290): Using ping-pong!
I/Omap4ALSA( 1290): Buffer size: 4096
I/Omap4ALSA( 1290): Latency: 92879
E/ALSAControl( 1290): Control 'MUX\_UL08' cannot get element info: -2
E/ALSAControl( 1290): Control 'MUX\_UL09' cannot get element info: -2
I/Omap4ALSA( 1290): Initialized ALSA PLAYBACK device 'plughw:0,0'
E/AudioHardwareALSA( 1290): RE-OPEN AFTER STANDBY:: took 300 msecs
W/AudioFlinger( 1290): write blocked for 302 msecs, 6 delayed writes, thread 0x58028
I/Omap4ALSA( 1290): Using FIFO
D/Omap4ALSA( 1290): Requested buffer size 2048 not granted, got 2054
I/Omap4ALSA( 1290): Buffer size: 2054
I/Omap4ALSA( 1290): Latency: 256750
E/Omap4ALSA( 1290): Unable to set hardware parameters: Device or resource busy
I/Omap4ALSA( 1290): Initialized ALSA CAPTURE device 'plughw:0,1'
E/AudioRecord( 1290): Could not get audio input for record source 1
E/StagefrightRecorder( 1290): audio source is not initialized
I/MPEG4Writer( 1290): The mp4 file will not be streamable.
E/MediaRecorder( 5961): start failed: -2147483648
I/Corona ( 5961): ok
W/dalvikvm( 5961): threadid=11: thread exiting with uncaught exception (group=0x40015560)
D/FlurryAgent( 5961): Ending session
E/AndroidRuntime( 5961): FATAL EXCEPTION: GLThread 12
E/AndroidRuntime( 5961): java.lang.RuntimeException: start failed.
E/AndroidRuntime( 5961): at android.media.MediaRecorder.start(Native Method)
E/AndroidRuntime( 5961): at com.ansca.corona.AudioRecorder.startRecording(AudioRecorder.java:81)
E/AndroidRuntime( 5961): at com.ansca.corona.NativeToJavaBridge.callRecordStart(NativeToJavaBridge.java:1564)
E/AndroidRuntime( 5961): at com.ansca.corona.JavaToNativeShim.nativeRender(Native Method)
E/AndroidRuntime( 5961): at com.ansca.corona.JavaToNativeShim.render(JavaToNativeShim.java:100)
E/AndroidRuntime( 5961): at com.ansca.corona.Controller.onDrawFrame(Controller.java:237)
E/AndroidRuntime( 5961): at com.ansca.corona.CoronaRenderer.onDrawFrame(CoronaRenderer.java:74)
E/AndroidRuntime( 5961): at android.opengl.derived.SwapGLSurfaceView$GLThread.guardedRun(SwapGLSurfaceView.java:913)
E/AndroidRuntime( 5961): at android.opengl.derived.SwapGLSurfaceView$GLThread.run(SwapGLSurfaceView.java:773)
W/FlurryAgent( 5961): onEndSession called without context from corresponding onStartSession
any one understand why? yes, without the findFreeChannel() this code won’t throw the exception. it seems that if I do anything with audio.* functions (like audio.pause, or audio.stop) the exception will be thrown.
[import]uid: 124979 topic_id: 28104 reply_id: 328104[/import]