Is 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();
Is 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();
android.media.AudioTrack
[1] has the following methods to access information about audio data:
getChannelCount
to determine the number of channelsgetChannelConfiguration
to determine if you deal with mono or stereo contentgetSampleRate
to find out the sampling frequencyand
getAudioFormat
to determine if you deal with 8bit or 16bit sample width.The AudioTrack.getXXX methods you list merely return the values supplied to the constructor. This doesn't solve the original poster's issue.