Wave playback

I’ve got another question regarding the PlayPCMAudio-method of the cerberus.

I’ve got an audio-amp attached to the analog-output of ma cerberus. If I start the cerb, erverything is ok, but after having played a wave-sound by using PlayPCMAudio there’s a loud noise coming from the speaker.
Is it possible to get the cerberus into the same state like before playing the audio file? Or is there some kind of reset for the analog output?

Maybe try to set the analog out to zero.

I tried it like this:

//define the analog output port to pin PA4
private static Cpu.Pin analogOutPin = GHI.OSHW.Hardware.FEZCerberus.Pin.PA4;
private static OutputPort analogOut = new OutputPort(analogOutPin, false);

//Play the soundfile
GHI.OSHW.Hardware.Util.PlayPCMAudio(Cpu.AnalogOutputChannel.ANALOG_OUTPUT_0, wavBuffer, 0, (int)Subchunk2Size, sampleRate);
//set the analog out to zero
analogOut.Write(false);

Is this the right way?
It doesn’t help, so maybe I’m wrong.

OutputPort is a digital output, not an analog output. You’re looking for AnalogOutput.


private static Cpu.AnalogOutputChannel analogOutputChan = Cpu.AnalogOutputChannel.ANALOG_OUTPUT_0;
private static AnalogOutput analogOut = new AnalogOutput(analogOutputChan);

Is this the right way?

The code posted above doesn’t help. The noise is as loud as before.
Is there a possibility to set the analog-out pin to high-impedance?