Hi all,
I'm a newbie with C or C++. I have a raw PCM file 16-bit (like a wav file but no header). I need to build a console application that can read the file, store data in an array, modify it (ex: add 100 to each value of the data array), then play it in sound (with a known frequency sampling, ex Fs = 16000 Hz).
It would be very nice if someone can explain to me how to do that.
Thank you very much.
real_castilla
0
Newbie Poster
Recommended Answers
Jump to PostSure, which bit exactly are you having problems with?
- reading into an array
- adding values
- playing it
Jump to PostI can't help you with your problem, but you don't need that while loop
f_in.read(speech, 10000 * sizeof(short));
But of course there is no guarentee that sizeof(short) will be 2. It might be on your system but if you intend to port that porgram to another os then the size …
All 6 Replies
Salem
5,138
Posting Sage
real_castilla
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
real_castilla
0
Newbie Poster
sujitSSSS
0
Newbie Poster
rafi867
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.