can anybody tell me what represents the parameter “count” in the method: PlayPCMAudio(Microsoft.SPOT.Hardware.Cpu.AnalogOutputChannel channel, byte data, int offset, int count, int dataRate) ?
In the description it says: Size of playback sample.
Is it the count of the wave data in Bytes without the header-bytes (this is the right answer in my opinion) , or the size of the complete wave-file with header-info included or is it something very different?
Can you try both and see which one is right?
You should pass data only. There is no header
Both methods are working. Maybe the header-bytes are not hearable in the playback, if they are included.
BTW: Is it possible to power the cerberus without the USB-board directly from a power-supply connected to socket 8? I would only want to use the usb-board for flashing data.
You can power Gadgeteer through any socket. Just make sure there is always one “power” module attached.
I want to power the board without the power-mudule by an external power supply.
So could i connect a power supply to gnd an +5v pin on socket 8 or is vcc or something else also needed for running the cerberus after having flashed it?
You need to provide both 5v an 3v3.
Can anyone tell me, what is the highest data rate supported by GHI.OSHW.Hardware.Util.PlayPCMAudio on the cerberus-board?
This won’t be important as you will run out of memory before you run out of speed. We use 4800 I think.
Ok, i’ve got 11kb of sound data in a wave-file with a sample rate of 22,05kHz. If I give it to the PlayPCMAudio-method I only get something like a klicking sound.
So there’s no exception or anything else thrown. What could be the problem?
Would it be possible to play wav-data with higher sample rate by using the music-module?
When I add the music-module to the designer, my cerberus hangs in the initialization:
music = new GTM.GHIElectronics.Music(5);
The music_finished was added to the programStarte():
music.musicFinished +=new GTM.Music.MusicFinishedPlayingEventHandler(music_musicFinished);
Is there anything I’ve forgotten?
Not sure why but, to help you better, please start new thread as this question is not related to the topic.
Ok, then back to the primary problem
I’ve got two different wave-files.
Both have similar properties:
- unsingned 8Bit PCM
- 8kHz sample rate
The method “PlayPCMAudio” only plays one of the files in the right way. The other file is only a clicking sound. I’ve also tried different sample rates with the same result.
Which specifications are required for the wave-file? The documentation provides no info about it and I don’t get any exception.
The data-array with the wave-byte is correct, same for the header. I’ve also tried to provide the method with the pure sound-data without the header but same result.
What could be the problem with the second file?
I think the problem was that the sound level of the second file was too low.