Android :: Size Of Audio In Seconds?
Aug 11, 2010How do I know the file size in seconds mp4?
View 1 RepliesHow do I know the file size in seconds mp4?
View 1 RepliesThis may be impossible but is there any way that I can get a smaller buffer size for AudioTrack than what is provided by getMinBufferSize method?
This is how I am instantiating AudioTrack right now: SR = 44100; bufSize = AudioTrack.getMinBufferSize(SR, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT); audioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, SR, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, bufSize, AudioTrack.MODE_STREAM);
With sample rate of 44100, getMinBufferSize always returns 4800. If I try to make the buffer size smaller than 4800 then I get the following error message: E/AudioTrack( 318): Invalid buffer size: minFrameCount 1200, frameCount 600 E/AudioTrack-JNI( 318): Error initializing AudioTrack E/AudioTrack-Java( 318): [ android.media.AudioTrack ] Error code -20 when initializing AudioTrack. D/AndroidRuntime( 318): Shutting down VM W/dalvikvm( 318): threadid=3: thread exiting with uncaught exception (group=0x4000fe70) E/AndroidRuntime( 318): Uncaught handler: thread main exiting due to uncaught exception I/CheckinService( 59): From server: Intent { action=android.server.checkin.FOTA_CANCEL } E/AndroidRuntime( 318): java.lang.RuntimeException: Unable to start activity Does anyone has any ideas how to over come this problem?
The following works fine on a G1 but gives an error on the Samsung Galaxy. I was hoping cross-platform support would be better than this. See error below.
private final static int RATE = 44100; private final static int CHANNEL_MODE = AudioFormat.CHANNEL_CONFIGURATION_MONO; private final static int ENCODING = AudioFormat.ENCODING_PCM_16BIT; private AudioRecord recorder_; public boolean open() { int bufferSize = 4 * AudioRecord.getMinBufferSize(RATE, CHANNEL_MODE, ENCODING); recorder_ = new AudioRecord(AudioSource.MIC, RATE, CHANNEL_MODE, ENCODING, bufferSize);
last line gives the following on the Samsung Galaxy phone: 11-14 19:04:07.507: ERROR/AndroidRuntime(7617): java.lang.IllegalArgumentException: Invalid audio buffer size.
I am trying to play the bigger size audio wav file(which is >20 mb) using the following code(AudioTrack) on my Android 1.6 HTC device which basically has less memory. But i found device crash as soon as it executes reading, writing and play. But the same code works fine and plays the lesser size audio wav files(10kb, 20 kb files etc) very well.
P.S: I should play PCM(.wav) buffer sound, the reason behind why i use AudioTrack here. Though my device has lesser memory, how would i read bigger audio files bytes by bytes and play the sound to avoid crashing due to memory constraints. Code...
Could someone guide me please to play the AudioTrack code for bigger size wav files?
So I'm loading images from a web service, but the size of the images are sometimes smaller or bigger than other images and the visualization looks silly when I put them in a ListView in android. I'd like to fix the size of my ImageView so that it only shows a portion of the image if it's larger than a preset amount. I've tried everything I can think of setting the setMaxWidth/setMaxHeight, setting the scale type to centerCrop, using ClipableDrawable wrapping my BitmapDrawable, setting using Drawable.setBounds(). I've tried setting in the XML and programmatically, but neither worked. I'm very surprised setting max width/height didn't do anything. Below is the XML I'm using ImageView definition in my layout file
View 1 Replies View RelatedI am currently developing a dictionary application with voice database. I would like to know about the current Android limitation on the file size. I am using a self-provided sqlite database ( > 50mb ) . I tested that once the built .apk size exceeds ~30mb the app will not be installed onto the simulator (INSTALL_FAILED_ INSUFFICIENT _STORAGE). Could anyone confirm me that if up until now there is no way to embed such large size files in a single apk ( Aimed to sell at Google Market without requiring user to download datafile afterwards). Also, is there a limitation of 1,048,576 bytes for a single file in the assets folder ?
View 3 Replies View Relatedif size of image is larger than or smaller than specified display size (on screen), then it is automatically, compressed and stretched resp by android run time or require to handle by explicitly.
View 2 Replies View RelatedHi,
I would like to see how my app works on a 800x600 android netbook. how can i setup an emulator with this size?
thanks chris
I manage a cache of bitmap. Do you have an advise to fix the maximum size of it?
View 2 Replies View RelatedCan somebody explain to me what makes up the installed application size? I have an apk that is about 8 MB, and often when I install I get the INSUFFICIENT_STORAGE error. I have around 25-30 MB free space on the phone. I'm doing debugging so I have to upload lots of new versions. If I uninstall the previous version then I can install the new version. The application manager claims that the app is taking up 22 MB. So back to the original question, how come the app is taking up 22 MB when it really only is 8 MB?
View 7 Replies View RelatedI would like to know why the size of my shared library .so is bigger than my .apk file generated with Eclipse? Approximatly the so size is twice the apk one. What is strange is after having installed it in the device (2.1 firmware) I checked the size of the apk when I uninstalled it from the device and surprisingly the apk size indicated is bigger even than the .so one. Is there any explaination of that?
View 2 Replies View RelatedDoes anyone know if there is a way for either meridian or the regular android player to recognize audio tags on lossless audio files?
View 1 Replies View RelatedIs there an Android equivalent to the iOS Core Audio / Audio File Stream Services? I need to be able to read audio bytes from a network and feed them to the audio system under my control, so I can do my own timeouts / reconnects / range requests / etc. without interrupting the audio playback (since the system audio thread would be playing audio already enqueued). It seems that MediaPlayer doesn't give me this level of control. Is there a lower-level framework that does, either in the SDK or NDK?
View 2 Replies View RelatedMy app downloads .png files to the sd card for later use. I kept getting OutOfMemoryErrors (if anyone could explain this too, that'd be great!) and so I took a look at the sizes of the images saved to the sd card, and they seem to be roughly double what they are on the server. Why is this, and how can I make them smaller?
public void onCreate(Bundle saved)
setContentView(R.layout.namedrxnscreen);
TextView t1 = (TextView)findViewById(R.id.rxn_text1);
TextView t2 = (TextView)findViewById(R.id.rxn_text2);
TextView t3 = (TextView)findViewById(R.id.rxn_text3);
TextView t4 = (TextView)findViewById(R.id.rxn_text4);
iv = (ImageView) findViewById(R.id.rxn_image);
pb = (ProgressBar) findViewById(R.id.rxn_loading);
vs = (ViewSwitcher) findViewById(R.id.rxn_switch);
I want combine two audio files. (A audio file + B audio file = AB audio file)So, my search result is:
1. useing an AudioTrack.
2. decode PCM from audio file.
3. combine PCM.
This is currect? It there another way?
I want to record a sample from the microphone, then I want to play the recorded file maximizing the volume and apply some audio effect, like modifing sample rate or addind an echo.Waht is the best way? is there an example?
View 1 Replies View RelatedCould you please let me know how to do the audio record in android emulator and play the same recorded audio. Could you please help me in proceeding in development.I tried with MediaPlayer API's also.Its not working.
View 5 Replies View RelatedIs there a way to determine the audio format of an audio file in Android? On normal java I do it like this:
File file= new File(...);
AudioInputStream stream = AudioSystem.getAudioInputStream(file);
AudioFormat format= stream.getFormat();
The closest example of what i want to accomplish is the "Engadget" widget. It updates it's data from the internet every 5-10 minutes and "scrolls" to the stories every 5-7 seconds. I imagine it sets the 5 -10 minutes interval to the widget's provider to call the onUpdate without the inbuild limitations , something like that. AlarmManager alarms = (AlarmManager) getApplicationContext().getSystemService(Context.ALARM_SERVICE); alarms.setRepeating(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime(), updateRateSeconds * 1000, newPending);
Then the real issue.. to update the widgets content without calling onUpdate....................
I'm using traceview to identify bottlenecks in my app. If I use the emulator, everything works fine. But when the device is used, no matter how long I run the app, traceview only gets the initial 5 seconds of my session and nothing more. I also noticed an error message in the console: Traceview: (<unknown>:10301): GLib-WARNING **: g_set_prgname() called multiple times. Have you ever experienced this problem?
View 3 Replies View RelatedTo be able to do some accurate calculations that I want for my app, I need to be able to get an accelerometer reading every 100ms. I haven't found a way to do this on android, it seems like the only way to get accelerometer readings is to put a listener that can listen at different intervals. Basically, is there a way to get a reading at exact intervals?
View 2 Replies View RelatedI want to call my asp.net webservice for every 50 seconds (for different methods) .How can I achieve this...
View 3 Replies View RelatedI connected my phone via USB to my RR sport to upload audio files to the RR hard drive. However, I keep getting connection error. Apparently my device is not being recognized as a storage. I did the unmount thinking. Also, I am wondering how I can play audio from my phone through the RR audio system.
RR is 2010.
There are so many Date-classes (GregorianCalendar, Calendar, TimeZone, Date,.....), I lost track.
How can I get the seconds now since 1.1.1970 as "long" in Android?
I tried with threads, but android throws "CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.".
So how can I wait 3 seconds and then hide the view, letting the GUI responsive?
Currently the TimePicker view shows only hours and minutes by default and I am retrieving the values using getCurrentHour() and getCurrentMinute(). Is there a solution to add seconds to the TimePicker view?
View 1 Replies View RelatedI'm trying to implement a simple activity that will let user to insert a password.
I've a gridview with the 9 images to use and 4 imageviews that will be the selected images (on clicking on item on gridview, the corresponding image will be filled with the selected one).
Now the problem: I want that the 4 imageviews acts similar to password fields: for 1 seconds appears the selected item and then another image...
I tried using asyncthread but I got and error: Only the original thread that created a view hierarchy can touch its views
Here my code...
This is weird and hopefully only a Moto Droid or local tower problem.
There is a difference of 15 seconds between my Droid's idea of time and UTC/GMT. This supposedly can't happen as cellular communications rely on 10ms accuracy and the Droid internal clock is set by cell towers.
I'm looking for some other Moto Droid developers to take a look and report if there is any time offset in their area. I've written a test app and posted source and apk at http://a9k.net/#droid . There is a screen shot there. It's very basic - show internal time (both System.currentTimeMillis() and Calendar.getInstance()) and show web page at www.time.gov.
Another simple test is to compare the phone's time to a computer that is synchronized to a net time server. You'll need to check seconds or watch for a whole minute. The minutes will not be equal from 45-59 seconds UTC.
The repercussions of an error in setting the internal clock could be extensive. Then again maybe Verizon towers here are whacko in MT?
I have to display some data after every 10 seconds. Can anyone tell me how to do that?
View 3 Replies View RelatedI am programming an app using an absolute layout (@ eclipse). How to fit the button size with the screen size? (I have four buttons per row).
View 1 Replies View Related