On my dummy android app I try to replicate the functionality of an audio player. The files I have to deal with, are some ogg files which are not too long: 2-3 seconds.
The problem is that the volume of the files is too low. I'll like to augment the volume but I don't know how. In my app, the sounds are played on a volume equivalent to the one from phone call. I'll like to augment the volume, to the one from the voice call when I use the speaker mode.
AssetFileDescriptor afd;
try {
afd = getAssets().openFd(strPlayFileName);
mPlayer.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength());
mPlayer.prepare();
afd.close();
mPlayer.start();
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalStateException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
That is the code that plays my ogg files. Any feedback is welcome.
MediaPleyer allows for volume manipulation. You can try if the setVolume() method to see if it provides the desired result. You can get more info on this method here.
If this does not give you the desired result, I would suggest that you amplify the sound output of the source using some of the free audio editors such as audacity.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With