refer to http://www.codeproject.com/Articles/505994/Creating-a-NFO-Viewer-in-Csharp-as-a-beginner
I've created a NFO Viewer (old version), a small application that instantly runs (no installer/extractor).
In this application I got the .NFO textfile working as a Resource file, but modfiles don't work this easy.
I'm using BASS from http://www.un4seen.com/ and I'm able to play modfiles from a fixed location on the computer.
With this I simply mean (note that the codes are examples to give an idea for the functionality):
BASS.Play("C:\\Test\\music.mod", 0, false, etc);
But this causes me to force users to extract files on that location to let it work (my application is instant run executable, no installer!).
I also have to search all correct music files with every application each time I want to share one.
There is an option: Resource. This means you can add the file in your project and you're independant of any location on the computer.
Wherever your application runs, it plays the music from within itself.
Like this:
BASS.Play(Properties.Resources.music, 0, false, etc);
From the computer I got it working, but from the Resource I never got any sound.
It seems it can't play it directly like from the pc. It probably needs more steps.
Are there any professionals that know how I can load this modfile (in memory?) to make it work as a resource?
I'm struggling with it for months and the people on the official BASS forums couldn't help me out, as they don't have knowledge from C#/.NET...
I noted I may have to use something like
_assembly = Assembly.GetExecutingAssembly(); _musicStream = _assembly.GetManifestResourceStream("WindowsFormsApplication1.Properties.Resources.mod_track_name_"); int load = Bass.BASS_MusicLoad(_musicStream, 0, 0, BASSFlag.BASS_SAMPLE_LOOP, 0); Bass.BASS_ChannelPlay(load, false);
But with this I get errors as well, converting problems or 'incorrect' parameters for the MusicLoad method...
============================================================================
I also have 2 DLL files with each app I make that uses the BASS modplayer.
Those need to be in the same directory and I need to pack all those files (dll's and music) with my app all the time.
I don't want a software tool to merge the dll's after creation, because this means I have to merge each time I make a small change to my app.
There are options available that code can read dll's from resource. That's what I need, so I have to add them 1 time and can create my exe
without adding the dlls or music each time. I found an article and that seemed to do exactly what I wanted.
Refer to http://www.codeproject.com/Articles/528178/Load-DLL-From-Embedded-Resource.
After trying to import and use this a few times, I could only fail. I'm missing references to Assembly etc..
I asked the creator for help, but how long do I have to wait (if I get a response ever)?
See my question at the comment section of that article. Is there anyone who can help me out adding my 2 DLL's to my app?
Using the code from that article or other simple code that does what I need.
These are one of the last steps I need to do to publish my applications, but for me it are the most complicated ones!
Thanks in advance for any help.