A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Software Craftsman
this week in the
Java Micro Edition
Problems playing some wav audio formats using MMAPI (WTK22)
Joined: Sep 08, 2004
Jan 18, 2005 10:01:00
I'm having some problems playing some wav files with the MMAPI (WTK22).
my application with some wav files, I realised that I can play some types of
wav files but I can't play others.
This is just a snapshot of my code.
is = getClass().getResourceAsStream("/res/audio/RICOCHET.WAV");
p = Manager.createPlayer(is, "audio/x-wav");
} catch (
} catch (
In this case, the ricochet.wav has the "PCM 11.025 kHz, 8 bit, Mono" audio format
and it works fine.
The audio format "PCM 22.050 kHz, 16 bit, Mono" works fine as well.
When I try to play a wav file that has one of the following audio formats I get a
with the message "Malformed wave media".
- CCITT uLaw 8.000 kHz, 8 bit, Mono
- Microsoft ADPCM 22.050 kHz, 4 bit, Stereo
Does anyone know this problem? Which types of wav file audio formats are supported
by the MMAPI? If the "CCITT uLaw 8.000 kHz, 8 bit, Mono" format is not supported at all, for which format should I convert?
In advance, thank you very much for the help.
Joined: Jan 21, 2004
Jan 19, 2005 11:16:00
I think that youR problem is the path "res/audio".
Try rather this bit code in your code :
is = getClass().getResourceAsStream("RICOCHET.WAV");
We are ones that build the world, thus build it well.
I agree. Here's the link:
subject: Problems playing some wav audio formats using MMAPI (WTK22)
Canot play an mp3 file using Java Media Framework (JMF)
downloading a song from web in j2me
audio visualization graphics
Java Sound API
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015