Criminosis
Lurker
I'm experiencing this when using MediaPlayer on a 2.2 device (my MotoDroid) and using a 2.2 emulator. I'm making a simple sound board as my first app into Android thinking it would press me into learning a gradual curve of basic processes. And so far it has. Though recently I thought I was using bad sound files, but it appears that my app running in 2.2 causes the ending bit of the sound file to be tapered off. The sound files are at most 1 or 2 seconds long.
To compare I ran a 2.1 and a 2.2. emulation and installed my app. The 2.1 played the audio files fine, but the 2.2 continued to taper off the endings. I came across another site mentioning duration errors but it was for a different context of us of MediaPlayer. So I created a Toast to show me the duration after clicking.
Interestingly when playing the same file, here are the outputs :
2.2 : Audio file is 1.635long
2.1 : Audio file is 1.388long
To confirm one of the numbers I ran the app in a 1.6 emulator. Like 2.1 it did not cut off the audio playback.
1.6 : Audio file is 1.388long
So it appears there is a change that affects 2.2 specifically causing it to not playback properly at least for audio files of this tiny length. Any thoughts or workarounds?
Code:
mp = MediaPlayer.create(this, audioToPlay);
makeToast(mp);
mp.start();
To compare I ran a 2.1 and a 2.2. emulation and installed my app. The 2.1 played the audio files fine, but the 2.2 continued to taper off the endings. I came across another site mentioning duration errors but it was for a different context of us of MediaPlayer. So I created a Toast to show me the duration after clicking.
Code:
double length = mp.getDuration();
length = length / 1000;
String audioLength = new String();
audioLength = "Audio file is: " + length + "long";
new Toast(this);
Toast toast = Toast.makeText(this, audioLength, Toast.LENGTH_SHORT);
toast.show();
Interestingly when playing the same file, here are the outputs :
2.2 : Audio file is 1.635long
2.1 : Audio file is 1.388long
To confirm one of the numbers I ran the app in a 1.6 emulator. Like 2.1 it did not cut off the audio playback.
1.6 : Audio file is 1.388long
So it appears there is a change that affects 2.2 specifically causing it to not playback properly at least for audio files of this tiny length. Any thoughts or workarounds?