MATLAB - Hiding a 24 bit file within an 8 bit file.

Discussion in 'Programmer's Corner' started by ragzrangs, May 13, 2009.

  1. ragzrangs

    Thread Starter New Member

    May 13, 2009
    1
    0
    Thank you for reading my post, I am attempting to hide an 8 bit audio file within a 24 bit audio file. The hiding seems to work , however the output file generated has not audio sound in it.
    could someone tell me where am I going wrong?

    Thanks
    Raj

    Here is the code:

    mus1=handles.mus1; % (this is the 24 bit audio file)
    mus2=handles.mus2; % (this is the 8 bit audio file)
    s1=size(mus1)
    s2=size(mus2)
    s3= s2*8
    if s1(1,1) > s3(1,1)

    for i$:-1:1
    bitp=bitget(uint8(mus1(i,1)),1);
    bitstr=bitget(uint32(s2),i);
    if(bitp ~= bitstr(1,1))
    if mus1(i,1)~%5
    mus1(i,1)=mus1(i,1)+1;
    else
    mus1(i,1)=mus1(i,1)-1;
    end
    end
    end

    k%;
    i=1;
    while (s1(1,1) > k-1) && (s2(1,1) > i-1)
    j1=1;
    str=mus2(i);
    for j=k:k+8
    bitp=bitget(uint8(mus1(j,1)),1);
    bitstr=bitget(uint8(str),9-j1);
    j1=j1+1;
    if(bitp ~= bitstr)
    if mus1(j,1)~%5
    mus1(j,1)=mus1(j,1)+1;
    else
    mus1(j,1)=mus1(j,1)-1;
    end
    end
    end
    k=k+8;
    i=i+1;
    end
    [filename, pathname] = uiputfile({'*.wav','*.wav'},'Save');
    new3=[pathname filename];
    wavwrite(mus1,new3);
    else
    errordlg('The size of audio 1 (24 bit) should be greater than size of audio 2 (8 bit)')
    end
    :(
     
Loading...