Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Im trying to find a c code that embbeds a txt file into an audio file by LSB method or else but I couldt find one. Could anyone help me please because I dont even know from where to start.

I need your help.
Thank you in advance.

What I have tried:

I am new in C and have never programmed before related to signal processing that's why I am not getting any relsults by my search.
Posted
Updated 7-Jul-22 18:48pm
Comments
Patrice T 28-Feb-16 15:48pm    
Don't repost the same question, even in another form.
Use Improve question in first question and add details.
Kenneth Haugland 28-Feb-16 18:17pm    
What? I'm afraid I don't understand your question at all. IT just sounds bizarre to me.
Member 12357476 28-Feb-16 18:19pm    
It has to do with steganography. My aim is hiding a txt file into an audio file by embedding the txt file into LSB of the audio's samples.
Kenneth Haugland 28-Feb-16 18:21pm    
So, a txt file is just stored as a byte string, so is an audio file. If you want to store anything just use WriteAllBytes and store it.
Member 12357476 28-Feb-16 18:27pm    
Thank you for your answer, but where does it write it exatly? Because I dont want the audio file to be distorted. My aim is taking a bit from the txt file and replace it with the LSB of the first audio's sample (last beat of the 16 bits that the sample contain) . The take the second bit and replace it with the second audio's sample. And so go on till the last bit of the last bit of the txt file. I hope I did explain it better now.

1 solution

Load the audio file into memory. You must know and understand the format of your audio file. Depending on the audio file format, it may be necessary to perform some decoding to have access to the raw sample values. Once you have the raw sample values, set the LSB. Now prepare to create the new audio file. If you had to decode upon reading, perform the corresponding encoding now. Note also that some audio file formats use check sums. Then you have to re-calculate the check sums for the blocks where the LSB has been changed.

Finally you should know that changing the LSB will introduce distortion. But this will be usually small with high sample rates and resolutions.

Overall this is a question that can't be answered in short even when knowing the audio file format. But I hope that the above helps you to know what to look for so that you might come back with more detailed questions that can be answered in short.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900