Last visit was: It is currently Thu Mar 28, 2024 7:19 am


All times are UTC-05:00




Post new topic Reply to topic  [17 posts ] 
Author Message
 Post subject:Uplink - Sound Modification
PostPosted:Thu Oct 17, 2013 9:11 pm 
 

Joined:Tue Oct 15, 2013 11:09 pm
Posts:18
EDIT: I figured out how to play mp3, ogg, aif, wav, it, xm, mod, s3m etc etc. Essentially all music types including various playlist types like m3u using FMOD


So, i could not figure out how to use other music formats other than mod, s3m, it or xm tracks.

I figured I would enhance the music system anyway. I decided to add 3 buttons and text spot to the HUD next to the speed buttons.

The text spot lists the current track name being played. The 3 buttons (technically 4) are Previous Track, Must/Unmute) and Next Track.

In order to make this more effective I found an awesome website which sports mod type music made by other people, when avoiding the techno type music you end up running into some decent Uplink type tracks and I was able to enhance my tracklist to 23 tracks at over 2 hours of music play.

The tracks sound pretty legit and fit Uplink to a tee.

Here is one of the functions for selecting a previous track in the playlist. This is a soundgarden modification.
Code:
void SgPlaylist_PrevSong () { SgPlaylist *playlist = SgPlaylist_GetPlaylist(currentplaylist); if ( playlist ) { if ( songindex < 1 ){ // songindex 0 = track 1 songindex = 22; }else{ --songindex; } char *songtitle = playlist->songs.GetData(songindex); SgPlayMod ( RsArchiveFileOpen ( songtitle ) ); strcpy ( currentsong, songtitle ); } else printf ("SgPlaylist_PrevSong : Failed because playlist %s does not exist\n", currentplaylist); }
I would post a screenshot but this forum says "Your post looks too spamy for a new user, please remove off-site URLs."


Last edited by someguy on Mon Oct 21, 2013 1:52 pm, edited 2 times in total.

Top
Offline  
 Post subject:Re: Uplink - Sound Modification
PostPosted:Fri Oct 18, 2013 12:14 am 
User avatar
 

Joined:Tue Mar 02, 2010 4:55 pm
Posts:265
AOL:superactor001
Location:Everywhere and nowhere... But also right behind you and watching you in your sleep >.>
Probably goes without saying, but you never initialized any variables xD

_________________
access procedure in progress...
...
/root access granted
attempting to input customized user information
upload failure, connection loss
system console session terminated


Top
Offline  
 Post subject:Re: Uplink - Sound Modification
PostPosted:Fri Oct 18, 2013 1:53 am 
 

Joined:Wed Feb 16, 2011 4:47 pm
Posts:184
Quote:
Probably goes without saying, but you never initialized any variables xD
Most of those variables are globally defined, this is why it works.
Quote:
Here is one of the functions for selecting a previous track in the playlist. This is a soundgarden modification.
That piece of code seems to be working but there's something terribly wrong with it :
Code:
songindex = 22;
Use
Code:
songindex = playlist->NumSongs();
instead ;).

On a side note we now have a sound system which support mp3 and ogg now.


Top
Offline  
 Post subject:Re: Uplink - Sound Modification
PostPosted:Fri Oct 18, 2013 11:05 am 
 

Joined:Mon Jul 02, 2012 7:20 am
Posts:78
Mind sharing the names of the tracks you found? Always looking to expand my library.


Top
Offline  
 Post subject:Re: Uplink - Sound Modification
PostPosted:Fri Oct 18, 2013 1:53 pm 
 

Joined:Tue Oct 15, 2013 11:09 pm
Posts:18
Code:
songindex = playlist->NumSongs();
Haha, wow, cant believe I missed that.

How do you manage ogg and mp3?


Top
Offline  
 Post subject:Re: Uplink - Sound Modification
PostPosted:Fri Oct 18, 2013 4:01 pm 
 

Joined:Wed Feb 16, 2011 4:47 pm
Posts:184
I didn't do that part so I'm not sure how to do it but basically you can use the appropriate modules (libogg, smpeg). There is enough explanation on the web to guide you through.

For mp3 there is a nasty thing about tags that requires you to use id3lib. If the file you use doesn't work, that's probably because of the tag.


Top
Offline  
 Post subject:Re: Uplink - Sound Modification
PostPosted:Fri Oct 18, 2013 8:23 pm 
User avatar
 

Joined:Tue Mar 02, 2010 4:55 pm
Posts:265
AOL:superactor001
Location:Everywhere and nowhere... But also right behind you and watching you in your sleep >.>
Quote:
Quote:
Probably goes without saying, but you never initialized any variables xD
Most of those variables are globally defined, this is why it works.
I figured, but it couldn't hurt to say it.

_________________
access procedure in progress...
...
/root access granted
attempting to input customized user information
upload failure, connection loss
system console session terminated


Top
Offline  
 Post subject:Re: Uplink - Sound Modification
PostPosted:Sat Oct 19, 2013 10:39 am 
Literally Nine
User avatar
 

Joined:Tue Mar 01, 2005 9:00 am
Posts:1263
Quote:
On a side note we now have a sound system which support mp3 and ogg now.
Well, mostly. Let's say I have a new reason to hate iTunes. It seems to encode mp3s is a way that basically no one else does and the soundsystem doesn't know what to do with it.

Plan is to allow people to play from their own lists, but that's proving quite the challenge. At least with this I can distribute my own music if I get any.


Top
Offline  
 Post subject:Re: Uplink - Sound Modification
PostPosted:Sat Oct 19, 2013 1:02 pm 
User avatar
 

Joined:Tue Mar 02, 2010 4:55 pm
Posts:265
AOL:superactor001
Location:Everywhere and nowhere... But also right behind you and watching you in your sleep >.>
Quote:
Quote:
On a side note we now have a sound system which support mp3 and ogg now.
Well, mostly. Let's say I have a new reason to hate iTunes. It seems to encode mp3s is a way that basically no one else does and the soundsystem doesn't know what to do with it.

Plan is to allow people to play from their own lists, but that's proving quite the challenge. At least with this I can distribute my own music if I get any.
Miah, itunes encodes with an AAC+ codec instead of the traditional mpeg2 audio stream.

_________________
access procedure in progress...
...
/root access granted
attempting to input customized user information
upload failure, connection loss
system console session terminated


Top
Offline  
 Post subject:Re: Uplink - Sound Modification
PostPosted:Sat Oct 19, 2013 4:24 pm 
Literally Nine
User avatar
 

Joined:Tue Mar 01, 2005 9:00 am
Posts:1263
I am aware. But even when you have it do mp3 format instead, it till behaves like a special snowflake.


Top
Offline  
 Post subject:Re: Uplink - Sound Modification
PostPosted:Sat Oct 19, 2013 4:37 pm 
 

Joined:Tue Oct 15, 2013 11:09 pm
Posts:18
Quote:
I am aware. But even when you have it do mp3 format instead, it till behaves like a special snowflake.
I actually managed today to go ahead and replace the entire sound system to use common formats like mp3, ogg, aif. It works pretty damn flawless regardless of the mp3 tags. I got it working where it accesses the music.dat and plays the tracks using a regular old .m3u playlist file also located in the music.dat (I hate cluttering the main program folder) :D

Works the same as above, skip track, previous track, and a mute/unmute button. If I can figure it out, I may make a volume slider.


Top
Offline  
 Post subject:Re: Uplink - Sound Modification
PostPosted:Sat Oct 19, 2013 8:10 pm 
Literally Nine
User avatar
 

Joined:Tue Mar 01, 2005 9:00 am
Posts:1263
Quote:
If I can figure it out, I may make a volume slider.
Well that's easy. I'm interested in seeing your implementation though. Any change of that?


Top
Offline  
 Post subject:Re: Uplink - Sound Modification
PostPosted:Sun Oct 20, 2013 9:08 pm 
 

Joined:Tue Oct 15, 2013 11:09 pm
Posts:18
Quote:
Well that's easy. I'm interested in seeing your implementation though. Any change of that?
Couldn't figure it out, seemed impractical anyhow


Top
Offline  
 Post subject:Re: Uplink - Sound Modification
PostPosted:Mon Oct 21, 2013 12:33 am 
Literally Nine
User avatar
 

Joined:Tue Mar 01, 2005 9:00 am
Posts:1263
Sorry, I meant your implementation of the sound system.

As for your slider, take a look at the worldmap code, particularly the zoom slider. It's not super awesome but it's a start.


Top
Offline  
 Post subject:Re: Uplink - Sound Modification
PostPosted:Mon Oct 21, 2013 1:03 am 
 

Joined:Tue Oct 15, 2013 11:09 pm
Posts:18
Ahh ok. Neat idea on the map slider.

As for the music implementation, I will toss you some code when I get back home, I am using FMOD, fmod . org

Was confusing at first since I have almost no c++ knowledge, but once I got the hang of it, works pretty nice. They have so many versions of things, the one you would want is to go to the downloads section and get your download under this section: "FMOD Ex Programmer’s API"

Finding examples online was hard because the newest version of the API changes the syntax of the old version which you find examples for on the net, so the examples almost become worthless. Will post some code when I get home in the morning.


Top
Offline  
Display posts from previous: Sort by 
Post new topic Reply to topic

All times are UTC-05:00


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created by Miah with assistance from hyprnova