0

Since Android doesnt support javax.sampled sound apis am trying to build AudioInputStream and Audioformat for WAV FILE. I tried to build a WAVE FILE class by reading the WAV file using this https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ And using this wave object i tried to create my own AudioInputStream .. But it is not working . Any help is highly appreciated ? Does AudioInputstream contains only PCM data or what ?

rana
  • 1,824
  • 3
  • 21
  • 36

2 Answers2

1

Does AudioInputstream contains only PCM data or what ?

No, it can contain various types.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
  • Android doesnt support Audiosystem,AudioInputstream,Audiofileformat and AudioFormat ... So am writing it myself .. What I meant was Does AudioInputStream contains Just Audio data (could be PCM or any other) Or Only Audiodata along with the header ? – rana Oct 12 '12 at 18:00
  • See edit to answer. It contains no more, or different information, in fact less - but you seemed to have trouble with my earlier version, so I took that part out. Maybe my answer should just be *"Or what."*. – Andrew Thompson Oct 12 '12 at 18:07
  • Alright .. What does the parameter **bold** private InputStream stream; Inside AudioInputStream hold ? **bold** Does it start with Audio data directly or with the header ? – rana Oct 12 '12 at 19:51
  • ?!? Are you referring to [this constructor](http://docs.oracle.com/javase/7/docs/api/javax/sound/sampled/AudioInputStream.html#AudioInputStream%28java.io.InputStream,%20javax.sound.sampled.AudioFormat,%20long%29)? If not, I have no idea what your are asking. – Andrew Thompson Oct 12 '12 at 19:55
  • Ok here is what iam doing . I have the WAV file being read and stored in Inputstream .Now i am adding this information to the Audioinputstream with constructor. I am confused as to do i have to just send data only or the Data with header.I tried both but it is not working :( i must be doign some thign wrong . I am clueless . any help is appreciated ?? – rana Oct 12 '12 at 20:02
0

Ok I got it ... AudioInputStream chops off the first 14 bytes of Audio data and updates the length correspondingly . Hence I was able to see the difference ..

rana
  • 1,824
  • 3
  • 21
  • 36