But i have some Questions that are not answered by reading all the doku (i'm quite new to processing and programming, sry ^^).
How do i access the speaker, in the wiki it says
[quote]
<Speaker>
void bufferSound(AudioInputStream audioIn)
float getSpeakerVolume()
void setSpeakerVolume(float volume)
boolean isPlayingSound()
void playPrebufferedSound()
void playSound(AudioInputStream audioIn)
void stopSound()
[/quote]
but i cant get just one to work...
and what do i "give" the playSound() void anyway? a "playme.wav" ?
since there is no way to play a sound in p5, i usualy use the sonia Library for that.
everything else works quite fine (the detection of wiiMode and so on) so thank you again for doing this great work!
Im using winXP,processing 135, BlueCove version 2.0.2 on widcomm and Java Build 1.6.0_06-b02
now you can load a sound with loadSound(); and play it with wii.rimokon.playBuffer();
the Audio.au file is my problem...
i used a Sun/NeXt audio format, mono, 1794Hz, 8-bit PCM sound. but the wiimote-techheads at some internetsites guess its a 4-bit adpcm sound (which is possible with wav- but wav is not accepted by the library). so.. if your soundfile is not simple enough you'll get a lot of distortion. square-wave sounds are working fine, but we want music and voice,no? ;)
RE: Speaker Usage... progress? (2008-08-07 18:36 by classiclll #38158)
hi ma_d
thank you for your feedback.
i think, "audio" can be converted by
- audiox = AudioSystem.getAudioInputStream( targetFormat, audio)
where targetformat(instance of AudioFormat) is set to be 4-bit at it's constuction(sampleSizeInBits).
RE: Speaker Usage... progress? (2008-08-11 22:52 by Anonym #38215)
hi!
thank you for the quick response. still, it does not seem to work. i get this error:
----------------------------------
java.lang.IllegalArgumentException: Unsupported conversion: PCM_SIGNED 1794.0 Hz, 4 bit, mono, 1 bytes/frame, from PCM_SIGNED 1794.0 Hz, 8 bit, mono, 1 bytes/frame,
at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:955)
----------------------------------
did i something wrong or is it just impossible for now? i changed my code to this:
----------------------------------
AudioInputStream audio = AudioSystem.getAudioInputStream(new java.io.File("/Users/mad/supersimple.au"));
AudioFormat targetFormat= new AudioFormat(1794, 4, 1, true, true);
//Audioformat(float sampleRate, int sampleSizeInBits, int channels, boolean signed, boolean bigEndian);