Hi all,
I have a problem with music module and midi files. When I debug my code line by line and just run music.Play(…), it plays well. But when I run next statement, music stops immediately.
Here is my code. I tried both Gadgeteer App and MFConsole App. Nothing changed. Mucis stops when run “bool ledState = true;” line.
Thanks a lot for your help.
Edit:
I tried with Hydra and mp3 files. I works properly. But it doesn’t behave same with cerberus…
using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using GHIElectronics.Gadgeteer;
using Gadgeteer;
using System.IO;
using System.Threading;
using GTM = Gadgeteer.Modules;
namespace MFConsoleApplication1
{
public class Program
{
public static Mainboard Mainboard { get; set; }
static Gadgeteer.Modules.GHIElectronics.Music music;
public static void Main()
{
Debug.Print("Started");
Mainboard = new GHIElectronics.Gadgeteer.FEZCerberus();
music = new GTM.GHIElectronics.Music(6);
music.Play(Resources.GetBytes(Resources.BinaryResources._000AcPiano));
bool ledState = true;
while (true)
{
Mainboard.SetDebugLED(ledState = !ledState);
Thread.Sleep(500);
}
}
}
}