Greetings,
I'm working on a low level programming project and I want to play a music with the computer speaker.
I'm already capable of using the speaker (with timer2
) and a song is represented in the following way:
note_t *music;
where note_t
represents a note and it's compound by:
typedef struct {
int freq; /* note frequency */
int dur; /* note duration in miliseconds */
} note_t;
Now, what would be the best way to get the frequencies and durations of the notes from a music file?
Thanks in advance!
EDIT
To clarify some doubts, what I want to know is the best format to get the necessary information to create a song with the structure above indicated.