Welcome! Log In Create A New Profile

Advanced

Playing music while playing games?

Posted by Makmud 
Playing music while playing games?
February 26, 2009 11:13PM
I know that in the XBOX 360, you can play video games while listening to music on your 360. I wanna know if it will be created. Like playing music from you MP3 player or SD card. So can it be created?



Edited 1 time(s). Last edit at 02/26/2009 11:13PM by Makmud.
Re: Playing music while playing games?
February 26, 2009 11:59PM
Sorry, thats impossible.
Re: Playing music while playing games?
February 27, 2009 01:00AM
Quote
Arikado
Sorry, thats impossible.

really?
I wasn't thinkn about adding it to the game. I was talking bout playing it and running a music player at the same time.
Re: Playing music while playing games?
February 27, 2009 01:03AM
I know. And like I said, its impossible. I could give you a technical reason if you desire it.
Re: Playing music while playing games?
February 27, 2009 01:04AM
Yeah, that's not possible
Re: Playing music while playing games?
February 27, 2009 02:03AM
apparently someone done it on super smash bros brawl and i believe him because it seemed to be realistic, its like the texture hacks but with music and its far more complex than texture hacking

best solution would be to simply get an mp3 player and listen to whatever music you want on there, imagine how irritating it would be to change songs on a wii



Edited 1 time(s). Last edit at 02/27/2009 02:05AM by jassim.
Re: Playing music while playing games?
February 27, 2009 03:42AM
Ok, so it doesn't work for game play, how about while your on the Homebrew Channel, or running homebrew apps, the perfect app to incorporate this would be wii radio!
Re: Playing music while playing games?
February 27, 2009 03:50AM
As a developer, I could incoroporate the ability to listen to mp3s on your SD while playing my games. That was going to happen with WiiBreaker but I couldnt get the damn things to play on loop. I intend to try again though. Other developers could do this too, it just takes a couple days of work.
Re: Playing music while playing games?
February 27, 2009 06:53PM
@Arikado to loop an mp3 using mp3player.c you can add something like this to your main loop.


if (!MP3Player_IsPlaying()){
MP3Player_PlayBuffer(...);
}

or

if (!MP3Player_IsPlaying()){
rewind(name of file pointer);
MP3Player_PlayFile(...);
}

hope this helps
Re: Playing music while playing games?
February 27, 2009 08:10PM
Quote
Arikado
I know. And like I said, its impossible. I could give you a technical reason if you desire it.
That's not strictly true. We argued this case with the guy who wanted a video recorder. You can add a callback hack on the video or joypad interrupts before loading the game. However, you will receive performance issues, and may incur other issues during the game (such as running out of memory, as more will be allocated than usual)
Re: Playing music while playing games?
February 27, 2009 08:42PM
whodares - that's interesting but this would mean having to load your games via some kind of loader program, right? Just interested as a few people have asked if WiiRadio could run like this.

I also wrote a remote desktop viewer Windows to Wii, it would be interesting to create something that went the other way. If not only for a tech demo.
Re: Playing music while playing games?
February 27, 2009 08:53PM
Yes, you'd need something to install the hooks before loading the game.

Before you go getting too excited though, whilst it is technically possible, I would very much doubt it would run smoothly. Code hacks via Ocarina and GeckoOS only require a few instructions to overwrite memory addresses, therefore these a pretty much unnoticable. However, loading MP3's off an SD card,decoding them and playing them through the audio will be awful, and next to useless.

Regarding WiiRadio, there are other factors to consider, mainly the usage of the network interface. If a game establishes it's own network, then you'd have to be careful not to reset it etc. to start yours. If you hop on the existing one, you run the risk of sucking up the bandwidth ruining the game's network.

In short, yes it's technically possible, but no, it's (probably) not worth it.



Edited 1 time(s). Last edit at 02/27/2009 08:54PM by whodares.
Re: Playing music while playing games?
February 27, 2009 09:12PM
Whodares, my technical line of reasoning was going to be exactly what you were thinking. High performance games would probably crash due to lack of memory and other games would experience performance issues. Like scanff said, I was also thinking we would need a loader to pull it off that (like you said) runs the games with hooks attatched. Yes, I do agree that it is technically possible.

@Linus
I know that. I originally used your exact code when programming WiiBreaker. I diagnosed the problem to be that crashes were caused anytime FILE related functions were called to enact upon a FILE after the MP3Player_PlayFile() interacted with said FILE. I fixed my problem by using buffers instead. But (obviously) you cant run buffers off of an SD card. I had a topic about this here: [forum.wiibrew.org]



Edited 1 time(s). Last edit at 02/27/2009 09:13PM by Arikado.
Re: Playing music while playing games?
February 28, 2009 01:50AM
@Arikado
You can use MP3Player_PlayBuffer with a file from the SD card. You just need to read the file into a buffer first. This same code can be used with GRRLib to display a png from the SD card.

//variable needed for loading file
FILE* pFile;
long lSize;
char * buffer;
size_t result;

pFile = fopen ("sd:/test.mp3", "r");

if (pFile!=NULL) {
// obtain file size:
fseek (pFile , 0 , SEEK_END);
lSize = ftell (pFile);
rewind (pFile);

// allocate memory to contain the whole file:
buffer = (char*) malloc (sizeof(char)*lSize);

// copy the file into the buffer:
result = fread (buffer,1,lSize,pFile);
/* whole file is now loaded in the memory buffer*/
}

//this would be located in the main loop
if (!MP3Player_IsPlaying()){
MP3Player_PlayBuffer(buffer,lSize,NULL) ;
}
Sorry, only registered users may post in this forum.

Click here to login