Hello. I am using the
https://www.ghielectronics.com/community/codeshare/entry/368
custom music module so I can use filestream from the SD card.
I simply created a music.cs and added the code in there and it worked fine and i got the audio to play back.
I connected all other modules for my project and the code suddenly wont do anything when I start debugging. I worked out by elimination of all the other parts it is the sercam that causes it.
the code is literally just
using System;
using System.IO;
using System.Threading;
using Microsoft.SPOT;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;
namespace GadgeteerApp28
{
public partial class Program
{
void ProgramStarted()
{
music.MusicFinished += new Music.MusicFinishedPlayingEventHandler(music_MusicFinished);
sdCard.SDCardMounted += new SDCard.SDCardMountedEventHandler(sdCard_SDCardMounted);
music.SetVolume(200);
Debug.Print("Program started");
}
void sdCard_SDCardMounted(SDCard sender, GT.StorageDevice SDCard)
{
Debug.Print("SDCard mounted");
FileStream fileStream;
fileStream = new FileStream(@ "\SD\Audio\Audio-1.mp3", FileMode.Open);
//Play the FileStream
music.Play(fileStream);
Debug.Print("Playing Audio-1.mp3");
//wait until audio is over
while (music.IsBusy)
Thread.Sleep(10);
}
void music_MusicFinished(Music sender)
{
// Program will crash when switching to the
// next song if we don't have this event handler
Debug.Print("Finished playing this song");
}
}
}
When sercam is connected the output window doesnt even show program started.
when is it not connected it works fine.
I can provide more information but as i said no error is shown.
Thank you for help in advance