Search Results

Search found 4 results on 1 pages for 'arakn0'.

Page 1/1 | 1 

  • Problems with MediaRecorder class setting audio source - setAudioSource() - unsupported parameter

    - by arakn0
    Hello everybody, I'm new in Android development and I have the next question/problem. I'm playing around with the MediaRecorder class to record just audio from the microphone. I'm following the steps indicated in the official site: http://developer.android.com/reference/android/media/MediaRecorder.html So I have a method that initializes and configure the MediaRecorder object in order to start recording. Here you have the code: this.mr = new MediaRecorder(); this.mr.setAudioSource(MediaRecorder.AudioSource.MIC); this.mr.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); this.mr.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); this.mr.setOutputFile(this.path + this.fileName); try { this.mr.prepare(); } catch (IllegalStateException e) { Log.d("Syso", e.toString()); e.printStackTrace(); } catch (IOException e) { Log.d("Syso", e.toString()); e.printStackTrace(); } When I execute this code in the simulator, thanks to logcat, I can see that the method setAudioSource(MediaRecorder.AudioSource.MIC) gives the next error (with the tag audio_ipunt) when it is called: ERROR/audio_input(34): unsupported parameter: x-pvmf/media-input-node/cap-config-interface;valtype=key_specific_value ERROR/audio_input(34): VerifyAndSetParameter failed And then when the method prepare() is called, I get the another error again: ERROR/PVOMXEncNode(34): PVMFOMXEncNode-Audio_AMRNB::DoPrepare(): Got Component OMX.PV.amrencnb handle If I start to record bycalling the method start()... I get lots of messages saying: AudioFlinger(34):RecordThread: buffer overflow Then...after stop and release,.... I can see that a file has been created, but it doesn't seem that it been well recorderd. Anway, if i try this in a real device I can record with no problems, but I CAN'T play what I just recorded. I gues that the key is in these errors that I've mentioned before. How can I fix them? Any suggestion or help?? Thanks in advanced!!

    Read the article

  • Problems with MediaPlayer, raw resources, stop and start

    - by arakn0
    Hello everybody, I'm new in Android development and I have the next question/problem. I'm playing around with the MediaPlayer class to reproduce some sounds/music. I am playing raw resources (res/raw) and it looks kind of easy. To play a raw resource, the MediaPlayer has to be initialized like this: MediaPlayer mp = MediaPlayer.create(appContext, R.raw.song); mp.start(); Until here there is no problem. The sound is played, and everything works fine. My problem appears when I want to add more options to my application. Specifically when I add the "Stop" button/option. Basically, what I want to do is...when I press "Stop", the music stops. And when I press "Start", the song/sound starts over. (pretty basic!) To stop the media player, you only have to call stop(). But to play the sound again, the media player has to be reseted and prepared. mp.reset(); mp.setDataSource(params); mp.prepare(); The problem is that the method setDataSource() only accepts as params a file path, Content Provider URI, streaming media URL path, or File Descriptor. So, since this method doesn't accept a resource identifier, I don't know how to set the data source in order to call prepare(). In addition, I don't understand why you can't use a Resouce identifier to set the data source, but you can use a resource identifier when initializing the MediaPlayer. I guess that I'm missing something. I wonder if I am mixing concepts, and the method stop() doesn't have to be called in the "Stop" button. Any help? Thanks in advanced!!!

    Read the article

  • Problem with "Hello, WebView" example

    - by arakn0
    Hi there, I'm new in android development and I am trying out the WebView example in the official android site. http://developer.android.com/guide/tutorials/views/hello-webview.html But I do everything they say...which is pretty simple: I create the project, edit the layout file, then i add the code, etc. No problems building...but when I launch the app in the simulator I just got a black screen. It is like if the Layout is empty...like if the WebView is not created. does anybody know what I am doing wrong? Thanks in advanced

    Read the article

  • XML problem in the basic menu example

    - by arakn0
    Hi there, I am trying to create an app with some menus, an I am following the basic example available in the official android site: http://developer.android.com/guide/topics/ui/menus.html My problems appear when I define the menu in the XML. After creating the folder res/menu and creating the menu_option.xml file from eclipse.... The project (in general) gives an error that can be read from the Problems tab: Unparsed aapt error(s)! Check the console for output Android Packaging Problem So, changing to the Console tab to get more information about the problem, this can be read: [2010-06-02 11:35:54 - TestAudio] Error in an XML file: aborting build. [2010-06-02 11:35:54 - TestAudio] W/ResourceType(11566): Bad XML block: header size 63327 or total size -144759824 is larger than data size 0 [2010-06-02 11:35:54 - TestAudio] /home/User/workspace/TestAudio/res/menu/options_menu.xml:1: error: Error parsing XML: no element found The strange thing is that eclipse recognizes the menu items that I've defined in the XML,I can reference them in the code with no problems and my main activity builds. (and the rest of the files too). Could it be that when eclipse creates a file, for some reason, the Android SDK has problems to read it, or something similar?? The XML code is exactly the same as the one in the example, so I don't really know what is happening. The code in options_menu.xml is this: <menu xmlns:android="http://schemas.android.com/apk/res/android" <item android:id="@+id/new_game" android:title="New Game" / <item android:id="@+id/quit" android:title="Quit" / </menu Thanks in advance for your help!

    Read the article

1