Hi All,
I have demodulated two AM files (I/Q) succesfully but for one of the I/Q
files which was Gnuradio (USRP) file i had to scale down I and Q components
before demodulation by multiplying by 0.0001 (experimental value) to get
the value that can be demodulated and heard on the PC speakers. The values
read from file were like these
I= 469.00000, Q=-273.0000, I=462.00000, Q=-263.0000,,,,,,,,,,
then i multiplied them by 0.0001 and then performed demodulation and result
was a success.
But for other file, the values read were like
I= -0.0014953613, Q= 0.0039367676, I=0.0018615723 ,Q = 0.0010681152
In this case no scaling of I/Q samples before demodulation was required and
AM demodulation was perfect.

My question, What is the rule of thumb for scaling values if one has to
make generic function to read and demodulate from file or live source. What
factor one can calculate to be multiplied to I/Q samples based on its
current content value. I have also noticed that whatever you multiply after
demodulation for gain (volume) will not give result if before demodulation
the I/Q values are not scaled. Any comments please.

You need a baseline value range to determine if scaling is necessary for your situation, and that may vary depending upon your audio gear. Just remember that data is just data - you need to determine if it makes sense in your situation. Some audio gear may deal with the scaling (down-sampling) if necessary. Others may not. You might want to look at some open source audio tools like VLC to see what they do.