Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Internet Radio

Author
Message
puzzler2018
User Banned
Posted: 8th Jul 2018 21:03 Edited at: 8th Jul 2018 21:06
Hello

Here is the idea, im wishing to implement radio into our apps, AppGameKit Tier 1 hasnt got the functionality, so im writing a player in C# and produce a DLL (of which I will share when its complete)

Need to add reference to Windows Media Play - WMPLIB.DLL



Works perfectly for that station http://jam-high.rautemusik.fm

So now, here is the idea - to create it as a class library instead (or DLL) and then bring it in using AGK's PlugIn

I did this and doesnt work.

Anyone been successful in creating a DLL from C# which works perfectly and how did you do this?

Ive seen that require DLLImports and extern and such like but thats beyond me..

We can get to internet radio stations via https://www.internet-radio.com/

and clicking the Winamp links on each to bring down a PLS file - in that PLS file is the final link to use as the station and in the PlayMusicFromURL command you see in the C# code
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 9th Jul 2018 06:58
I believe PartTimeCoder has made plug in DLLs
https://forum.thegamecreators.com/thread/219864
He may be able to help when he sees this thread but I think that
thread is over 90 days old without a post
fubar
puzzler2018
User Banned
Posted: 9th Jul 2018 07:54 Edited at: 9th Jul 2018 07:54
Cheers

Also another nice help thread https://www.appgamekit.com/documentation/guides/14_plugins.htm

I can see this been something very useful,

I always loved GTA and its radio player channels whilst driving around aimlessly upsetting folk
puzzler2018
User Banned
Posted: 9th Jul 2018 10:35
Great.... I need DllExport not DllImport - DOH!!

Natively Visual C# doesn't have a DllExport, so can get one from NuGet Packages, one called UnmanagedExports by RGiessecke

Install and use it accordingly



Seems to compile, so im going to have a test with this tonight

Back to work....


puzzler2018
User Banned
Posted: 9th Jul 2018 20:09
Ive only gone and done it

Here is what you need to do

- Go to your PlugIns for your Main AppGameKit program folders Plug Ins directory

- Mine is C:\Program Files (x86)\Steam\steamapps\common\App Game Kit 2\Tier 1\Compiler\Plugins

- Create a folder called RadioPlayer

- Copy the COmmands.txt and Windows.dll (attatched) into this

In AppGameKit Tier 1



C# code is compiled at x86 build

- Download UnmanagedExports by RGiesecke through NuGet Packages

- Add reference to Media Player COM and add the WMPLib one


- Create a CLASS application



Any probs let me know, but this can now be further developed into something more

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 9th Jul 2018 22:45
There will be copyrighted guides to stream, so what ever ones you do find that makes it to a 24 hour cycle, then good luck.

BBC ones stop within 1 minute of playing and quiet rightly so.


Use this at your copyrighting experience.
puzzler2018
User Banned
Posted: 9th Jul 2018 22:47
If we can find a chanel to last a week. Record it. and play over and over again like GTA


puzzler2018
User Banned
Posted: 10th Jul 2018 19:36
Doesnt seem like anyone interested, never mind..

Here is something extra



You need to have a PlugIns/RadioPlayer folder and put the two files in there

Any probs give me a shout

Attachments

Login to view attachments
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 10th Jul 2018 22:38
I plan on trying it, just been busy


fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 10th Jul 2018 22:53 Edited at: 10th Jul 2018 23:19
Works really well
liked the fact that I could make the folder and copy the files
in such a way that it made removing easy later as I mostly develop for
android


I do that with all plugins until im ready to use them cuts back on size
costs


I always have music streaming in the background while im in forums or
developing usually from the virtual world second life because I can have
music playing and if someone wants to chat I have a tiny bit showing on
the left of all my windows open lol and its a great test to see how well the
apps will work on android or a lower end machine. The radio player exe
that was created will be great for that. will have to find other streams to.
fubar
puzzler2018
User Banned
Posted: 10th Jul 2018 23:19
Thank you for trying it out

Happy listening to the three stations on there

If like advise how to add more stations then give me a shout
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 11th Jul 2018 05:22 Edited at: 11th Jul 2018 05:24
I like the idea you have add stations part to the code I presume that means we can add any
number of stations. I was thinking it would be good to have a scrolling selection of a heap of
different music stations.

DLLs i wanted to write ages ago for other stuff when i was using TGCs GDK as i had visual
studio installed. I may do so again who knows lol its all in my to do list and ive been rather
sidetracked since then.

I dont know if it was just me but I had to use the arrow keys to get a selection before the
first station would play.

I also noticed that they are UK stations, i havent examined the workings of your c# code but
I am curious if that restricts to a particle type of stream or its totally independant of the stream
Sounds like a silly question I know but there are many streams out there just curious if they
would all be compatible
fubar
puzzler2018
User Banned
Posted: 11th Jul 2018 10:24 Edited at: 11th Jul 2018 10:27
Hi

Here is the C#



Now you need commands.txt file



and copy the DLL that this builds and the Commands.txt into the PlugsIn\RadioPlayer folder

I added 3 to get you all going

But absolutely add hundreds more if you like, It will play absolutely any station anywhere in the world
puzzler2018
User Banned
Posted: 11th Jul 2018 19:14
Ill write a PLS importer for this, so to read the PLS file automatically and add to the stations list

So all could do is put all the PLS files into the Media folder as is... and then read them each automatically

Also perhaps a CSV importer, forexample

CSV file maybe

Name , URL
BBC1 ,http://bbc1.......................
BBC2 ,http://bbc2.......................
BBC3 ,http://bbc3.......................
BBC4 ,http://bbc4.......................
ROCK ,http://rock.......................
etc

You can source CSV full of them out there on GitHub for example

https://github.com/ssh0/dotfiles/blob/master/pyradio/stations.csv

puzzler2018
User Banned
Posted: 18th Jul 2018 22:08
Anyone interested in this
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 26th Jul 2018 14:32
Been playing with this and thought it could greatly benefit from some kind of graphic equalizer
as AppGameKit doesn't allow access to the media layer without a dll I found this http://wiki.libsdl.org/FrontPage
which grants low level access and written in C could possibly be made into a dll for AGK
fubar
puzzler2018
User Banned
Posted: 26th Jul 2018 15:07
I always been fond of been able to create a VU-Meter style thingy ma-jiggy and been trying to make my own DLL for a VuMeter but can only bring in for the two channels left and right speakers lol, but music as FFT frequencies and lots of them

so been trying to figure out without using any other sources from like NuGet to be able to bring in the hundreds of frequencies of the music, so can use those levels to create graphical bars into AppGameKit, but no success so I abandoned the idea and went back to Minecraft


Ill take an immediate look at this. cheers.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 26th Jul 2018 15:13
Quote: " can only bring in for the two channels left and right speakers"

That's still pretty good

I really would like to write my own dlls but currently uninstalled vis studio as I found it a pain to get tier2 to work
I had to keep copying my code to the original template and modify that and I like to play and test stuff in tier 1
I have a test project. I place test code in but comment out the rest with the /* method hence why when people
comment sections I go through commenting // lol

all in my to do list to
fubar

Login to post a reply

Server time is: 2024-04-24 12:25:17
Your offset time is: 2024-04-24 12:25:17