• C

MP3 while playibg tic-tac-toe

how do i start to write the code. By using c source only. I wanr to play tic-tac-toe while i also listen to my mp3.
HonAlanAsked:
Who is Participating?
 
CmdrRickHunterCommented:
best solution is griessh's: have someone else decode the mp3 =p
  time to impement: 5 seconds for an expert, 3 minutes for a begining (gotta find that mp3 player... now where is it hidden?)
next best solution: download someone else's mp3 playing library, learn multithreaded code (which is a PAIN), and implement TTT in one thread, and mp3 playing in the other.  Be aware that this will not be cross platform.
  time to implement: 1-2 days for an expert, 2-4 weeks for a beginner (depending on how good you are at picking up multithreading)
worst solution: find somewhere on the web that explains the exact mp3 format... be ready because there's 2 flavors with a few dozen different variants in each flavor.  Learn how to do audio output and buffering (openAL in linux, probably directsound in windows), learn to do multithreaded code (good multithreaded code, not the easy stuff for the "next best solution"), and decode the mp3, using the algorithm found online, on the fly... because you dont want to be decoding the entire mp3 into wav format all at once (huge memry waste), and play it... all while learning how to make the computer play TTT
   time to implement: 1-8 weeks for an expert, 2months-6years for a beginner (I shiver just looking at their algorithms).


As for good TTT thinkings...
1) can I win.  If I can win, then why bother with anything else... WIN
2) can my opponent win.  if he can win (and I can't - I got past step 1), then BLOCK IT
3) have "prefered" locations (it likes the middle better, so if its open, GRAB IT), or randomly pick an opening

you're welcome to try to make neural algorithms, or learning programs that look ahead a few moves, but its TTT for pete's sake.  Its been proven that unbeatable (albiet uncreative) algorithms can be build using 1 2 and 3
0
 
griesshCommented:
Hi HonAlan,

If you are a beginner, I suggest you concentrate on the TTT algorithm and use WinAmp to listen to mp3 files.

======
Werner
0
 
HonAlanAuthor Commented:
i have done the TTT algorithm but not yet done the Vs com 1 as i donne how to make it think by its own. So to gain a higher grade for my project at sch.
0
How do you know if your security is working?

Protecting your business doesn’t have to mean sifting through endless alerts and notifications. With WatchGuard Total Security Suite, you can feel confident that your business is secure, meaning you can get back to the things that have been sitting on your to-do list.

 
HonAlanAuthor Commented:
do u have the griessh's
0
 
CmdrRickHunterCommented:
griessh?
0
 
griesshCommented:
?
0
 
HonAlanAuthor Commented:
i need to play a song while i am playing a game in .c source
CmdrRickHunter say i need some 1 to help me decode the file and he call that griessh's
0
 
griesshCommented:
I don't have code for you ... I suggested to ue WinAmp to listen to music. You can download WinApm from http://winamp.com/player

=====
Werner
0
 
CmdrRickHunterCommented:
sorry, to clarify, if it doesn't make sense now:
>> best solution is griessh's: have someone else decode the mp3 =p
use griessh's solution : have winamp or annother program decode the mp3 in the background, withotu doing any coding.
griessh is just the name of the person who supplied the answer, not some code library or anything (well, I dont think griessh has made a public code library... have you? =p )
0
 
griesshCommented:
not public ... my company wants to charge for then :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.