Ferrous Moon
http://www.ferrousmoon.com:80/forums/

Beep project
http://www.ferrousmoon.com:80/forums/viewtopic.php?f=45&t=1273
Page 1 of 1

Author:  eddieringle [Fri Mar 07, 2008 5:57 pm ]
Post subject:  Beep project

I already have a small beep program on my website, but I've taken it further.

Now, the code will only work on windows machines because it uses a windows system interface to access the speakers.

My program can do 2 things:
1. Allow you to make your own small songs through the pc speaker.
2. Play premade songs from a file.

Now, I have EVERYTHING working exactly how I want it. But I am having trouble with a feature I want to add.
Basically, all you can do now is tell the program which notes to play, but you cannot tell it the duration you want the notes played.

I want to know if there is a way to load from a file and put data from that file into two seperate variables, perhaps like:
Code:
notetoplay,duration
So the program would take notetoplay and store it in a note variable, and do the same for duration. And the comma would be the delimiter for each line.

I was thinking of doing an array, but I am not exactly sure how to do this.

If you need any more information then I will post it.

Author:  ChaosR [Sat Mar 08, 2008 4:44 am ]
Post subject:  Re: Beep project

strtok or explode (explode is very memory-leak sensitive, if you don't code correctly, but I like it)

Page 1 of 1 All times are UTC-05:00
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/