Re: LineUnavailableException when trying to play .wav file



Andrew Thompson wrote:
Scott wrote:
I'm trying to play a simple .wav file ..

What do you mean by 'simple'?

..using code copied from:
..
PCM_SIGNED 22050.0 Hz, 16 bit, mono, 2 bytes/frame, little-endian
javax.sound.sampled.LineUnavailableException: line with format PCM_SIGNED 22050.
0 Hz, 16 bit, mono, 2 bytes/frame, little-endian not supported.

That message is saying that Java does not support that format.

WinAmp plays the .wav file without any problems.

WinAmp will play almost anything.
I have MP3's that both WinAmp and the JMStudio will play, while I have others that can only be played by WinAmp. The same for MIDI files (and I expect,
WAV files).

I can even play it using the DirectSound code in:
http://msdn.microsoft.com/archive/en-us/dnarsound/html/msdn_streams3.asp?frame=true

That code digs directly into the Windows based system - it would not work cross-platform, so
Java does not work that way.


If I understand correctly Java is using DirectSound so think I've shown that the Windows DirectSound interface is OK.

Is this just a problem with windows 98 or is there something I'm over looking?

Try whis WAV file, which has been seen to be
'Java compatible'
<http://www.physci.org/test/oscilloscope/sounds/101_0166.wav>


Same problem:

PCM_UNSIGNED 16000.0 Hz, 8 bit, mono, 1 bytes/frame,
javax.sound.sampled.LineUnavailableException: line with format PCM_UNSIGNED 16000.0 Hz, 8 bit, mono, 1 bytes/frame, not supported.
at com.sun.media.sound.DirectAudioDevice$DirectDL.implOpen(Unknown Source)
at com.sun.media.sound.AbstractDataLine.open(Unknown Source)
at com.sun.media.sound.AbstractDataLine.open(Unknown Source)
at AudioPlayer02$PlayThread.run(AudioPlayer02.java:146)


The JMF (especially the Performance Pack) will bring
support for more codecs (types) of more formats, but
even that only covers a relatively small number of sound
types.


Thanks for your input, I've just downloaded JMF and I can play .wav files using JMStudio but the small test program still has the same problem. I think it must be a configuration issue.
.



Relevant Pages

  • NewestShareware.com Issue #120
    ... An easier to read version of this newsletter in HTML format can ... Program Name - Supported Platforms - Type - Category ... Download file size: 3518 K ... Full Windows Vista Support ...
    (comp.software.shareware.announce)
  • NewestShareware.com Issue #148
    ... An easier to read version of this newsletter in HTML format can ... Program Homepage/Download url ... Support Converting local HTML, MHT, TXT files to image; ... left behind from software installations. ...
    (comp.software.shareware.announce)
  • NewestShareware.com Issue #295
    ... Program Homepage/Download url ... Added limited Delphi 2007 support for Win32 ... PowerPoint presentations to MP4 video format. ... It is packaged as an MSI for easy installation ...
    (comp.software.shareware.announce)
  • PROBLEM: 2.6.7 does not compile (jfs errors)
    ... fs/jffs2/erase.c:321: warning: unknown conversion type character `z' in format ... # ACPI Support ... # Device Drivers ...
    (Linux-Kernel)
  • Re: 100% pure Win32 IDE
    ... This is where DevCo can put pressure to dedicate an engineer to help fix ... In the context of *nix only development, why should Mono be ... DB's support it. ... mono will improve their MS .NET ROI as well. ...
    (borland.public.delphi.non-technical)