How to REcord sound using GHI Music Module and Fez Cerbuino bee?

When I use RecordOggVorbis, I am having issues.

// GTM.Module definitions
        GTM.GHIElectronics.Music music;
        System.IO.MemoryStream inputSteram = new System.IO.MemoryStream();
        ushort[] inputPatch = new ushort[16];

        public SoundRecord()
            // Initialize GTM.Modules and event handlers here.		
            music = new GTM.GHIElectronics.Music(1);
            music.RecordOggVorbis(inputSteram, inputPatch);
            Gadgeteer.Timer timer = new Gadgeteer.Timer(10000); // every second (1000ms)
            timer.Tick += new Timer.TickEventHandler(timer_Tick);

I am trying to record for 10 seconds and I would like to play back the recorded sound. the


variable is always empty.

Can some one please help?
Also what should be the initial value of


be? I am plugging in my Samsung Cellphone Head ser in to the HeadPhone Jack

For oggPatch data, you can download from here:

And visit this link for more detail.

@ Dat, can you please explain in simpler terms, I saw the forum thread you linked below and I am not following how they connected the Iphone to the MusicModule.

The other post had same issue and code was optimized to give better recording rate. skip the iphone part as that doesn’t apply to you.

@ aksheik -

The oggpatch data will set VS1053 to out put a standard format. They can be 8KHz, 16KHz, 41KHz., 44KHz…
Currently music module works with 8 and 16KHz (venc16k1q02.plg or venc16k2q00.plg). If you want higher frequency, you need to write SPI in RLP.

“…I am not following how they connected the Iphone to the MusicModule…”=> Input line is not only Iphone.

Decided to focus on getting Sound Playback to work. However having issues with embedding a resource file. I am trying to embedd the sample file vs1053record.Ogg so I can play it back.

You should start with a file that you know it works and was recorder by someone else. See the beginner guide ebook on how ot load resources.

@ aksheik -

How did you start it as a resource file?
Just make it simple, open venc08k1q00.plg file, copy from:

const unsigned short plugin[12919] = { /* Compressed plugin */
0x0007, 0x0001, 0xc01a, 0x0006, 0x0001, 0x0002, 0x0007, 0x0001, /*    0 */
  0xffc0, 0x2000, 0x0014, 0xf292, 0x0024, 0x0000, 0x0000, 0x2000, /* 3268 */
  0x0000, 0x0020, 0x0001, 0x2000, 0x0000, 0xbc82, 0x45c4,

Rename const unsigned short plugin[12919] => static ushort[] OGG if you want
Now you can use our example directly.

Default ogg patch is 41KHz and that is too high. Try to use lower like 8 or 16KHz…