Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private AudioFormat getFormat() {
- float sampleRate = 44100;
- int sampleSizeInBits = 16;
- int channels = 1; //mono
- boolean signed = true; //Indicates whether the data is signed or unsigned
- boolean bigEndian = true; //Indicates whether the audio data is stored in big-endian or little-endian order
- return new AudioFormat(sampleRate, sampleSizeInBits, channels, signed, bigEndian);
- }
- private AudioFormat getFormat() {
- float sampleRate = 44100;
- int sampleSizeInBits = 16;
- int channels = 1; //mono
- boolean signed = true; //Indicates whether the data is signed or unsigned
- boolean bigEndian = true; //Indicates whether the audio data is stored in big-endian or little-endian order
- return new AudioFormat.Builder().setSampleRate(Math.round(sampleRate)).build();
- }
- class AudioFormat.Builder
- Builder class for AudioFormat objects.
Add Comment
Please, Sign In to add comment