Hello,
For my first year project, I have to hide a message in a sound file, now my code doesn't work correctly so I was wondering if anyone can give me an insight on what is wrong? There's an encoder and decoder.
Encoder
Decoder
For my first year project, I have to hide a message in a sound file, now my code doesn't work correctly so I was wondering if anyone can give me an insight on what is wrong? There's an encoder and decoder.
Encoder
Code:
#include <stdio.h>
#include "scc110io.h"
#include "scc110wav.h"
int main()
{
printf("This program has been coded to work for uncompressed PCM WAV files.");
char *filename = AskForStringAndWait("Could you please enter the name of the audio file to be decoded?");
printf("Chosen audio file: %s\n", filename);
unsigned char *sounddata = LoadWavAudioFile(filename);
int soundFileSize = GetSizeOfWavFile();
if(soundFileSize != 0)
{
printf("\n");
printf("Printing out hidden message, wait for it!\n");
int SEQUENCE = 0;
while(soundata[2 * SEQUENCE + 1] != 179)
{
printf("%c", sounddata[2 * SEQUENCE + 1]);
SEQUENCE++;
}
}
return 0;
}
Decoder
Code:
#include <stdio.h>
#include "scc110io.h"
#include "scc110wav.h"
int main()
{
printf("This program has been coded to work for uncompressed PCM WAV files.");
char *filename = AskForStringAndWait("Could you please enter the name of the audio file that you would like encoded");
printf("Chosen audio file: %s\n", filename);
printf("\n");
unsigned char *sounddata = LoadWavAudioFile(filename);
int AudioFileSize = GetSizeOfWavFile();
if(AudioFileSize != 0)
{
char *msg = AskForStringAndWait("Could you please enter the message you would like encoded?");
printf("Your chosen message: %s\n", msg);
int SEQUENCE = 0;
while(SEQUENCE < sizeof(messge)){
sounddata[2 * SEQUENCE + 1] = messge[SEQUENCE];
SEQUENCE++;
}
}
return 0;
}