Guest User

Untitled

a guest
Nov 21st, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. private AudioFormat getFormat() {
  2. float sampleRate = 44100;
  3. int sampleSizeInBits = 16;
  4. int channels = 1; //mono
  5. boolean signed = true; //Indicates whether the data is signed or unsigned
  6. boolean bigEndian = true; //Indicates whether the audio data is stored in big-endian or little-endian order
  7. return new AudioFormat(sampleRate, sampleSizeInBits, channels, signed, bigEndian);
  8. }
  9.  
  10. private AudioFormat getFormat() {
  11. float sampleRate = 44100;
  12. int sampleSizeInBits = 16;
  13. int channels = 1; //mono
  14. boolean signed = true; //Indicates whether the data is signed or unsigned
  15. boolean bigEndian = true; //Indicates whether the audio data is stored in big-endian or little-endian order
  16.  
  17. return new AudioFormat.Builder().setSampleRate(Math.round(sampleRate)).build();
  18. }
  19.  
  20. class AudioFormat.Builder
  21. Builder class for AudioFormat objects.
Add Comment
Please, Sign In to add comment