Hi, I recently started working with my FEZ Domino and FEZ Music Shield again, and I’ve come across an annoying issue. First off, I got a bit of code together based off of some work that’s been done on here for the Music Shield, this code allows for just passing the FileStream to the Shield’s code library and it will start a new thread in which it plays the file to the earphone jack. This is good an all, but when the Garbage Collector runs, it tends to see the Stream that is feeding the music as something it needs to get rid of…
I was wondering if there was a way to tell the GC what items not to touch when it runs
Make your stream a static object in your class
class{
static stream …
void play()
{
stream.read
}
}
The thing is with this is that it already is static, next time I’m able to access my pc (I’m on my tablet), I’ll post the code for the shield and my main program here.
Show us the code then