• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get the audio encoding format of a audio file? (a-law, PCM)  RSS feed

 
Vijeth Konanavar Bhadrappa
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi All,

I have some 1000+ wav files. For my application, these should be with a-law encoding format only. But some files with PCM format also mixed in them. So I just want to know the format of the file and list them so that i can change the encoding format. Please guide me in this regard.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16009
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't used the Java sound API, so I'm not sure if this will be useful or not: Class javax.sound.sampled.AudioSystem contains a static method getAudioFileFormat(File file) that returns an AudioFileFormat object. Maybe you can use that to find out information about the encoding format of audio files - look those classes up in the API documentation.
 
Campbell Ritchie
Sheriff
Posts: 55358
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doesn't look like a beginner's question. Moving.
 
Vijeth Konanavar Bhadrappa
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jesper Young,

Thanks for your help. I wrote the simple code using the AudioFormat and fulfilled my application's need.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!