• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sound

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am writing some code that includes the capability to play sound. After reading many tutorials I have some interesting stuff going. However, we tried changing a file recorded in a slightly different format for the file played in the demo I copied from and it gave a javax.sound.sampled.UnsupportedAudioFileException that said that it only supported 44100 kHz, 16 bit, mono, Windows PCM format audio. Why is that? I thought javax.sound.sampled was supposed to support several variations. At least, that's what it seems to say in the javadocs. There is a getFormat method that tells you about the format, so I would assume that you could set it to play various formats. How do you do that?

Also, what could I use to play a VOX file? Thanks to whoever is a sound guru.

Rebecca
 
Rebecca Witmer
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, I am replying to my own message since no one else is. I did yet more research and I found out that there likely is no magical way to play VOX files in Java. You'd have to convert to something Java can handle, then play that. Some people in a listserv said:


> I've been working on some telephony project and I am new to java sound API. Could someone give me some tips how could I convert a vox file to wave file for web display purpose? Many thanks.

Probably it's simplest to do all by yourself: use a RandomAccessFile or similar to open the vox file, parse the headers, etc. You need to know the vox file format, you can find many documents specifying it on the Internet. To create a wave file from that, create a AudioFileFormat instance with the format read from the vox-header and supply an InputStream with the audi data of the vox file. You can then use AudioSystem.write to write a wav file.

That sounds really complicated. Does anybody know what they're talking about? How would I even go about figuring out how to do that?

If this isn't the best place to post, does anyone know any place that is better? I tried some forums that are linked to jsresources.com but for some reason I either can't post or just can't log in. Who knows. Thanks for any thoughts.

Rebecca
 
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Found something:

http://www.jsresources.org/faq.html
 
Rebecca Witmer
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you mean: http://www.jsresources.org/faq_audio.html#read_vox? I saw that and pasted above but I didn't see anything else on vox. What did you mean?
 
Vladas Razas
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Was trying to find something quickly. I thought this website might be useful. Sorry if not.

Regards!
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like to know is it possible to play .vox extension file with java?
 
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'll repeat Joe Ess' warning:

Originally posted by Joe Ess:
Seb, please do not wake up old threads. You've already posted this question once on JavaRanch, woken up another old thread here and posted it to the Sun Java forums. You are going to cause a lot of wasted effort and confusion as people read all these posts and try to help you out.
CarefullyChooseOneForum

 
Villains always have antidotes. They're funny that way. Here's an antidote disguised as a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic