I've been learning C for the past 4 months and I thought of giving my self a little challenge to motivate my self, so now i'm looking forward to do a little project on how to manipulate wave format files, but i have few little problems before i start doing this project.
First the program which i will create is simple application that allows the user to open his wave file, do few tricks that are listed in a menu like cutting, reversing, resizing and save his file at the end.
the menu will be lunched this way :
- Open : asks the user to open a file, if there is one already ope, it suggest to save it.
- Save as : Saving the file with a name given by the user (if the user doesn't give any name, a default name will be used) and giving
the user the ability to save his file in one of the formats
- WAVE 8 bits Mono 11.025 kHz
- WAVE 16 bits Stereo 44,1 kHz
- WAVE 24 bits 5.1 192 kHz
- MIDI .. ect
- Info : shows the information about the audio file (name of the file, type of the file, length of the file in hh:mm:ss)
- Exit : exiting the application ; if the file wasn't saved, the application suggest to save it.
- Reverse : reversing the audio file.
- Cut : cutting the audio file at a chosen moment as a start point and an end moment as a end point.
- Resize : making the audio file play faster or slower (for example, play 2 times faster or slower)
- … ect
Ask yourself, what do you want more out of this? Practice with C? or a way to modify .wav files? If you want C practice, by all means continue on, but I think if you're really looking for a way to modify a .wav file you'll be able to find plenty of solutions in higher level languages.
1) Its as simple as making your header file ( menu_f.h) and associated c file (menu_f.c). Follow a tutorial to find out what kind of code goes in what file ie: https://www.tutorialspoint.com/cprogramming/c_header_files.htm
2) Google some about make first, then check out the tool "automake". Again, make sure you're honest with yourself about what you're trying to accomplish. (You're getting practice in C, most likely there is better software already out there).
3) It might be interesting to try do perform a FFT (Fast Fourier Transform) of the .wav file. The math is pretty hardcore, but the concept is understandable, and you can borrow code from a library that already implements it (https://sourceforge.net/projects/kissfft/).